diff --git a/build/active-filters-frontend.asset.php b/build/active-filters-frontend.asset.php new file mode 100644 index 00000000000..2b7ce530f31 --- /dev/null +++ b/build/active-filters-frontend.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'b98f84b7c9f0959ec249d105769eeac4'); \ No newline at end of file diff --git a/build/active-filters-frontend.js b/build/active-filters-frontend.js new file mode 100644 index 00000000000..3718320b22f --- /dev/null +++ b/build/active-filters-frontend.js @@ -0,0 +1,15 @@ +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=227)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},101:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(3);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const c=e.filter(e=>e.attribute===r.taxonomy),s=c.length?c[0]:null;if(!(s&&s.slug&&Array.isArray(s.slug)&&s.slug.includes(o)))return;const a=s.slug.filter(e=>e!==o),i=e.filter(e=>e.attribute!==r.taxonomy);a.length>0&&(s.slug=a.sort(),i.push(s)),t(Object(n.sortBy)(i,"attribute"))},c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";if(!r||!r.taxonomy)return[];const s=e.filter(e=>e.attribute!==r.taxonomy);return 0===o.length?t(s):(s.push({attribute:r.taxonomy,operator:c,slug:o.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(n.sortBy)(s,"attribute"))),s}},109:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return s}));var n=r(2);const o=Object(n.getSetting)("attributes",[]).reduce((e,t)=>{const r=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;var n;return r&&r.id&&e.push(r),e},[]),c=e=>{if(e)return o.find(t=>t.id===e)},s=e=>{if(e)return o.find(t=>t.taxonomy===e)}},11:function(e,t){e.exports=window.wp.isShallowEqual},117:function(e,t,r){"use strict";var n=r(0);t.a=function(e){let{icon:t,size:r=24,...o}=e;return Object(n.cloneElement)(t,{width:r,height:r,...o})}},12:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t{let{imageUrl:t=i.l+"/block-error.svg",header:r=Object(a.__)("Oops!","woo-gutenberg-products-block"),text:n=Object(a.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:s=Object(a.__)("Error:","woo-gutenberg-products-block"),button:l,showErrorBlock:u=!0}=e;return u?Object(c.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(c.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(c.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(c.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),n&&Object(c.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},n),o&&Object(c.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",o),l&&Object(c.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};r(35);class u extends s.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(c.createElement)(c.Fragment,null,Object(c.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:n=!0,text:o,errorMessagePrefix:s,renderError:a,button:i}=this.props,{errorMessage:u,hasError:b}=this.state;return b?"function"==typeof a?a({errorMessage:u}):Object(c.createElement)(l,{showErrorBlock:n,errorMessage:r?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:s,button:i}):this.props.children}}t.a=u},17:function(e,t){e.exports=window.wp.htmlEntities},18:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return o}));const n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return n(e)&&t in e}},19:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},2:function(e,t){e.exports=window.wc.wcSettings},201:function(e,t){},22:function(e,t,r){"use strict";var n=r(0),o=r(4),c=r.n(o);t.a=e=>{let t,{label:r,screenReaderLabel:o,wrapperElement:s,wrapperProps:a={}}=e;const i=null!=r,l=null!=o;return!i&&l?(t=s||"span",a={...a,className:c()(a.className,"screen-reader-text")},Object(n.createElement)(t,a,o)):(t=s||n.Fragment,i&&l&&r!==o?Object(n.createElement)(t,a,Object(n.createElement)("span",{"aria-hidden":"true"},r),Object(n.createElement)("span",{className:"screen-reader-text"},o)):Object(n.createElement)(t,a,r))}},223:function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return a}));var n=r(18);const o=e=>Object(n.b)(e,"count")&&Object(n.b)(e,"description")&&Object(n.b)(e,"id")&&Object(n.b)(e,"name")&&Object(n.b)(e,"parent")&&Object(n.b)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,c=e=>Array.isArray(e)&&e.every(o),s=e=>Object(n.b)(e,"attribute")&&Object(n.b)(e,"operator")&&Object(n.b)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every(e=>"string"==typeof e),a=e=>Array.isArray(e)&&e.every(s)},227:function(e,t,r){e.exports=r(246)},228:function(e,t){},246:function(e,t,r){"use strict";r.r(t);var n=r(52),o=r(0),c=r(1),s=r(39),a=r(2),i=r(4),l=r.n(i),u=r(22),b=r(77),p=r(18),d=r(223),f=r(124),m=(r(228),r(109)),g=r(41),O=r(256),j=r(14);const y=(e,t)=>Number.isFinite(e)&&Number.isFinite(t)?Object(c.sprintf)( +/* translators: %1$s min price, %2$s max price */ +Object(c.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(g.formatPrice)(e),Object(g.formatPrice)(t)):Number.isFinite(e)?Object(c.sprintf)( +/* translators: %s min price */ +Object(c.__)("From %s","woo-gutenberg-products-block"),Object(g.formatPrice)(e)):Object(c.sprintf)( +/* translators: %s max price */ +Object(c.__)("Up to %s","woo-gutenberg-products-block"),Object(g.formatPrice)(t)),_=e=>{let{type:t,name:r,prefix:n="",removeCallback:s=(()=>null),showLabel:a=!0,displayStyle:i}=e;const l=n?Object(o.createElement)(o.Fragment,null,n," ",r):r,b=Object(c.sprintf)( +/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */ +Object(c.__)("Remove %s filter","woo-gutenberg-products-block"),r);return Object(o.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},a&&Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===i?Object(o.createElement)(O.a,{element:"span",text:l,onRemove:s,radius:"large",ariaLabel:b}):Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-name"},l,Object(o.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:s},Object(o.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(o.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(o.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(o.createElement)(u.a,{screenReaderLabel:b}))))},w=function(){if(!window)return;const e=window.location.href,t=Object(j.getQueryArgs)(e),r=Object(j.removeQueryArgs)(e,...Object.keys(t));for(var n=arguments.length,o=new Array(n),c=0;c{if("string"==typeof e)return delete t[e];if("object"==typeof e){const r=Object.keys(e)[0],n=t[r].toString().split(",");t[r]=n.filter(t=>t!==e[r]).join(",")}});const s=Object.fromEntries(Object.entries(t).filter(e=>{let[,t]=e;return t})),a=Object(j.addQueryArgs)(r,s);Object(f.c)(a)};var h=r(65),v=r(17),E=r(101),k=e=>{let{attributeObject:t,slugs:r=[],operator:n="in",displayStyle:i}=e;const{results:l,isLoading:u}=Object(h.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[t.id]}),[p,f]=Object(s.b)("attributes",[]);if(u||!Array.isArray(l)||!Object(d.b)(l)||!Object(d.a)(p))return null;const m=t.label,g=Object(a.getSettingWithCoercion)("is_rendering_php_template",!1,b.a);return Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},m,":"),Object(o.createElement)("ul",null,r.map((e,r)=>{const s=l.find(t=>t.slug===e);if(!s)return null;let a="";return r>0&&"and"===n&&(a=Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(c.__)("and","woo-gutenberg-products-block"))),_({type:m,name:Object(v.decodeEntities)(s.name||e),prefix:a,removeCallback:()=>{const r=p.find(e=>{let{attribute:r}=e;return r==="pa_"+t.name});1===(null==r?void 0:r.slug.length)?w("query_type_"+t.name,"filter_"+t.name):w({["filter_"+t.name]:e}),g||Object(E.a)(p,f,t,e)},showLabel:!1,displayStyle:i})})))},S=r(134);const x={heading:{type:"string",default:Object(c.__)("Active filters","woo-gutenberg-products-block")}};Object(n.a)({selector:".wp-block-woocommerce-active-filters",Block:e=>{let{attributes:t,isEditor:r=!1}=e;const n=Object(a.getSettingWithCoercion)("is_rendering_php_template",!1,b.a),[i,g]=Object(s.b)("attributes",[]),[O,h]=Object(s.b)("stock_status",[]),[v,E]=Object(s.b)("min_price"),[S,x]=Object(s.b)("max_price"),A=Object(a.getSetting)("stockStatusOptions",[]),P=Object(o.useMemo)(()=>{return 0!==O.length&&(e=O,Array.isArray(e)&&e.every(e=>["instock","outofstock","onbackorder"].includes(e)))&&(e=>Object(p.a)(e)&&Object.keys(e).every(e=>["instock","outofstock","onbackorder"].includes(e)))(A)?O.map(e=>_({type:Object(c.__)("Stock Status","woo-gutenberg-products-block"),name:A[e],removeCallback:()=>{if(w({filter_stock_status:e}),!n){const t=O.filter(t=>t!==e);h(t)}},displayStyle:t.displayStyle})):null;var e},[A,O,h,t.displayStyle,n]),N=Object(o.useMemo)(()=>Number.isFinite(v)||Number.isFinite(S)?_({type:Object(c.__)("Price","woo-gutenberg-products-block"),name:y(v,S),removeCallback:()=>{w("max_price","min_price"),n||(E(void 0),x(void 0))},displayStyle:t.displayStyle}):null,[v,S,t.displayStyle,E,x,n]),R=Object(o.useMemo)(()=>Object(d.a)(i)?i.map(e=>{const r=Object(m.b)(e.attribute);return r?Object(o.createElement)(k,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator}):null}):null,[i,t.displayStyle]),[C,T]=Object(s.b)("ratings");Object(o.useEffect)(()=>{var e;if(!n)return;if(C.length&&C.length>0)return;const t=null===(e=Object(f.d)("rating_filter"))||void 0===e?void 0:e.toString();t&&T(t.split(","))},[n,C,T]);const B=Object(o.useMemo)(()=>{return 0!==C.length&&(e=C,Array.isArray(e)&&e.every(e=>["1","2","3","4","5"].includes(e)))?C.map(e=>_({type:Object(c.__)("Rating","woo-gutenberg-products-block"),name:Object(c.sprintf)( +/* translators: %s is referring to the average rating value */ +Object(c.__)("Rated %s out of 5","woo-gutenberg-products-block"),e),removeCallback:()=>{if(n)return w({rating_filter:e});const t=C.filter(t=>t!==e);T(t)},displayStyle:t.displayStyle})):null;var e},[C,T,t.displayStyle,n]);if(!(i.length>0||O.length>0||C.length>0||Number.isFinite(v)||Number.isFinite(S)||r))return null;const L="h"+t.headingLevel;if(!Object(a.getSettingWithCoercion)("has_filterable_products",!1,b.a))return null;const M=l()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(L,{className:"wc-block-active-filters__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-active-filters"},Object(o.createElement)("ul",{className:M},r?Object(o.createElement)(o.Fragment,null,_({type:Object(c.__)("Size","woo-gutenberg-products-block"),name:Object(c.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),_({type:Object(c.__)("Color","woo-gutenberg-products-block"),name:Object(c.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(o.createElement)(o.Fragment,null,N,P,R,B)),Object(o.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:()=>{(()=>{if(!window)return;const e=window.location.href,t=Object(j.getQueryArgs)(e),r=Object(j.removeQueryArgs)(e,...Object.keys(t)),n=Object.fromEntries(Object.keys(t).filter(e=>!(e.includes("min_price")||e.includes("max_price")||e.includes("rating_filter")||e.includes("filter_")||e.includes("query_type_"))).map(e=>[e,t[e]])),o=Object(j.addQueryArgs)(r,n);Object(f.c)(o)})(),n||(E(void 0),x(void 0),g([]),h([]))}},Object(o.createElement)(u.a,{label:Object(c.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(c.__)("Clear All Filters","woo-gutenberg-products-block")}))))},getProps:e=>({attributes:{displayStyle:e.dataset.displayStyle||S.attributes.displayStyle.default,heading:e.dataset.heading||x.heading.default,headingLevel:e.dataset.headingLevel?parseInt(e.dataset.headingLevel,10):S.attributes.headingLevel.default},isEditor:!1})})},256:function(e,t,r){"use strict";var n=r(12),o=r.n(n),c=r(0),s=r(4),a=r.n(s),i=r(1),l=r(117),u=r(13),b=Object(c.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(u.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));r(201);var p=e=>{let{text:t,screenReaderText:r="",element:n="li",className:s="",radius:i="small",children:l=null,...u}=e;const b=n,p=a()(s,"wc-block-components-chip","wc-block-components-chip--radius-"+i),d=Boolean(r&&r!==t);return Object(c.createElement)(b,o()({className:p},u),Object(c.createElement)("span",{"aria-hidden":d,className:"wc-block-components-chip__text"},t),d&&Object(c.createElement)("span",{className:"screen-reader-text"},r),l)};t.a=e=>{let{ariaLabel:t="",className:r="",disabled:n=!1,onRemove:s=(()=>{}),removeOnAnyClick:u=!1,text:d,screenReaderText:f="",...m}=e;const g=u?"span":"button";if(!t){const e=f&&"string"==typeof f?f:d;t="string"!=typeof e? +/* translators: Remove chip. */ +Object(i.__)("Remove","woo-gutenberg-products-block"):Object(i.sprintf)( +/* translators: %s text of the chip to remove. */ +Object(i.__)('Remove "%s"',"woo-gutenberg-products-block"),e)}const O={"aria-label":t,disabled:n,onClick:s,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||s()}},j=u?O:{},y=u?{"aria-hidden":!0}:O;return Object(c.createElement)(p,o()({},m,j,{className:a()(r,"is-removable"),element:u?"button":m.element,screenReaderText:f,text:d}),Object(c.createElement)(g,o()({className:"wc-block-components-chip__remove"},y),Object(c.createElement)(l.a,{className:"wc-block-components-chip__remove-icon",icon:b,size:16})))}},26:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0);const o=Object(n.createContext)("page"),c=()=>Object(n.useContext)(o);o.Provider},3:function(e,t){e.exports=window.lodash},31:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(0),o=r(11),c=r.n(o);function s(e){const t=Object(n.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},35:function(e,t){},39:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return d}));var n=r(6),o=r(7),c=r(0),s=r(11),a=r.n(s),i=r(31),l=r(61),u=r(26);const b=e=>{const t=Object(u.a)();e=e||t;const r=Object(o.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:s}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[r,Object(c.useCallback)(t=>{s(e,t)},[e,s])]},p=(e,t,r)=>{const s=Object(u.a)();r=r||s;const a=Object(o.useSelect)(o=>o(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t),[r,e]),{setQueryValue:i}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[a,Object(c.useCallback)(t=>{i(r,e,t)},[r,e,i])]},d=(e,t)=>{const r=Object(u.a)();t=t||r;const[n,o]=b(t),s=Object(i.a)(n),p=Object(i.a)(e),d=Object(l.a)(p),f=Object(c.useRef)(!1);return Object(c.useEffect)(()=>{a()(d,p)||(o(Object.assign({},s,p)),f.current=!0)},[s,p,d,o]),f.current?[n,o]:[e,o]}},4:function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t{let{Block:t,containers:r,getProps:n=(()=>({})),getErrorBoundaryProps:a=(()=>({}))}=e;0!==r.length&&Array.prototype.forEach.call(r,(e,r)=>{const i=n(e,r),l=a(e,r),u={...e.dataset,...i.attributes||{}};(e=>{let{Block:t,container:r,attributes:n={},props:a={},errorBoundaryProps:i={}}=e;Object(c.render)(Object(c.createElement)(s.a,i,Object(c.createElement)(c.Suspense,{fallback:Object(c.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(c.createElement)(t,o()({},a,{attributes:n})))),r,()=>{r.classList&&r.classList.remove("is-loading")})})({Block:t,container:e,props:i,attributes:u,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(a.join(",")),{Block:r,getProps:n,getErrorBoundaryProps:o,selector:c}=e;(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrappers:c}=e;const s=document.body.querySelectorAll(o);c&&c.length>0&&Array.prototype.filter.call(s,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,c)),i({Block:t,containers:s,getProps:r,getErrorBoundaryProps:n})})({Block:r,getProps:n,getErrorBoundaryProps:o,selector:c,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrapper:c}=e;const s=c.querySelectorAll(o);i({Block:t,containers:s,getProps:r,getErrorBoundaryProps:n})})({...e,wrapper:t})})})}},6:function(e,t){e.exports=window.wc.wcBlocksData},61:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(5);function o(e,t){const r=Object(n.useRef)();return Object(n.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},65:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(6),o=r(7),c=r(0),s=r(31),a=r(73);const i=e=>{const{namespace:t,resourceName:r,resourceValues:i=[],query:l={},shouldSelect:u=!0}=e;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(c.useRef)({results:[],isLoading:!0}),p=Object(s.a)(l),d=Object(s.a)(i),f=Object(a.a)(),m=Object(o.useSelect)(e=>{if(!u)return null;const o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,p,d],s=o.getCollectionError(...c);if(s){if(!(s instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");f(s)}return{results:o.getCollection(...c),isLoading:!o.hasFinishedResolution("getCollection",c)}},[t,r,d,p,u]);return null!==m&&(b.current=m),b.current}},7:function(e,t){e.exports=window.wp.data},73:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const o=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},77:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"boolean"==typeof e}}); \ No newline at end of file diff --git a/build/active-filters.asset.php b/build/active-filters.asset.php new file mode 100644 index 00000000000..e3f161cd9a8 --- /dev/null +++ b/build/active-filters.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '7707b862e815870df4fa30f85727ebd1'); \ No newline at end of file diff --git a/build/active-filters.js b/build/active-filters.js new file mode 100644 index 00000000000..e98698791df --- /dev/null +++ b/build/active-filters.js @@ -0,0 +1,17 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var n,l,i=t[0],s=t[1],a=t[2],b=0,p=[];b{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},11:function(e,t){e.exports=window.wp.primitives},12:function(e,t){e.exports=window.React},120:function(e,t,r){"use strict";var n=r(0),c=r(5),o=r(10),l=r(1);r(158),t.a=Object(o.withInstanceId)(e=>{let{className:t,headingLevel:r,onChange:o,heading:i,instanceId:s}=e;const a="h"+r;return Object(n.createElement)(a,{className:t},Object(n.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-"+s},Object(l.__)("Block title","woo-gutenberg-products-block")),Object(n.createElement)(c.PlainText,{id:"block-title-"+s,className:"wc-block-editor-components-title",value:i,onChange:o}))})},124:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0);const c=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},125:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(17),c=r(9),o=r(0),l=r(49),i=r(124);const s=e=>{const{namespace:t,resourceName:r,resourceValues:s=[],query:a={},shouldSelect:u=!0}=e;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(o.useRef)({results:[],isLoading:!0}),p=Object(l.a)(a),d=Object(l.a)(s),m=Object(i.a)(),f=Object(c.useSelect)(e=>{if(!u)return null;const c=e(n.COLLECTIONS_STORE_KEY),o=[t,r,p,d],l=c.getCollectionError(...o);if(l){if(!(l instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(l)}return{results:c.getCollection(...o),isLoading:!c.hasFinishedResolution("getCollection",o)}},[t,r,d,p,u]);return null!==f&&(b.current=f),b.current}},13:function(e,t){e.exports=window.wp.htmlEntities},15:function(e,t){e.exports=window.wp.url},158:function(e,t){},162:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"boolean"==typeof e},17:function(e,t){e.exports=window.wc.wcBlocksData},170:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return o}));var n=r(7);const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const o=e.filter(e=>e.attribute===r.taxonomy),l=o.length?o[0]:null;if(!(l&&l.slug&&Array.isArray(l.slug)&&l.slug.includes(c)))return;const i=l.slug.filter(e=>e!==c),s=e.filter(e=>e.attribute!==r.taxonomy);i.length>0&&(l.slug=i.sort(),s.push(l)),t(Object(n.sortBy)(s,"attribute"))},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";if(!r||!r.taxonomy)return[];const l=e.filter(e=>e.attribute!==r.taxonomy);return 0===c.length?t(l):(l.push({attribute:r.taxonomy,operator:o,slug:c.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(n.sortBy)(l,"attribute"))),l}},184:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},203:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return l}));var n=r(2);const c=Object(n.getSetting)("attributes",[]).reduce((e,t)=>{const r=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;var n;return r&&r.id&&e.push(r),e},[]),o=e=>{if(e)return c.find(t=>t.id===e)},l=e=>{if(e)return c.find(t=>t.taxonomy===e)}},22:function(e,t){e.exports=window.wp.isShallowEqual},232:function(e,t,r){"use strict";var n=r(6),c=r.n(n),o=r(0),l=r(4),i=r.n(l),s=r(1),a=r(113),u=r(521);r(184);var b=e=>{let{text:t,screenReaderText:r="",element:n="li",className:l="",radius:s="small",children:a=null,...u}=e;const b=n,p=i()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+s),d=Boolean(r&&r!==t);return Object(o.createElement)(b,c()({className:p},u),Object(o.createElement)("span",{"aria-hidden":d,className:"wc-block-components-chip__text"},t),d&&Object(o.createElement)("span",{className:"screen-reader-text"},r),a)};t.a=e=>{let{ariaLabel:t="",className:r="",disabled:n=!1,onRemove:l=(()=>{}),removeOnAnyClick:p=!1,text:d,screenReaderText:m="",...f}=e;const g=p?"span":"button";if(!t){const e=m&&"string"==typeof m?m:d;t="string"!=typeof e? +/* translators: Remove chip. */ +Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)( +/* translators: %s text of the chip to remove. */ +Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),e)}const O={"aria-label":t,disabled:n,onClick:l,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||l()}},j=p?O:{},h=p?{"aria-hidden":!0}:O;return Object(o.createElement)(b,c()({},f,j,{className:i()(r,"is-removable"),element:p?"button":f.element,screenReaderText:m,text:d}),Object(o.createElement)(g,c()({className:"wc-block-components-chip__remove"},h),Object(o.createElement)(a.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},245:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return s})),r.d(t,"d",(function(){return a})),r.d(t,"c",(function(){return u}));var n=r(15),c=r(2),o=r(162);const l=Object(c.getSettingWithCoercion)("is_rendering_php_template",!1,o.a),i="query_type_",s="filter_";function a(e){return window?Object(n.getQueryArg)(window.location.href,e):null}function u(e){l?window.location.href=e:window.history.replaceState({},"",e)}},26:function(e,t){e.exports=window.wc.priceFormat},279:function(e){e.exports=JSON.parse('{"name":"woocommerce/active-filters","version":"1.0.0","title":"Active Product Filters","description":"Show the currently active product filters. Works in combination with the All Products and filters blocks.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"multiple":false,"color":{"text":true,"background":false}},"attributes":{"displayStyle":{"type":"string","default":"list"},"headingLevel":{"type":"number","default":3}},"textdomain":"woo-gutenberg-products-block","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},28:function(e,t,r){"use strict";var n=r(0),c=r(4),o=r.n(c);t.a=e=>{let t,{label:r,screenReaderLabel:c,wrapperElement:l,wrapperProps:i={}}=e;const s=null!=r,a=null!=c;return!s&&a?(t=l||"span",i={...i,className:o()(i.className,"screen-reader-text")},Object(n.createElement)(t,i,c)):(t=l||n.Fragment,s&&a&&r!==c?Object(n.createElement)(t,i,Object(n.createElement)("span",{"aria-hidden":"true"},r),Object(n.createElement)("span",{className:"screen-reader-text"},c)):Object(n.createElement)(t,i,r))}},3:function(e,t){e.exports=window.wp.components},35:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));const n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function c(e,t){return n(e)&&t in e}},394:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return i}));var n=r(35);const c=e=>Object(n.b)(e,"count")&&Object(n.b)(e,"description")&&Object(n.b)(e,"id")&&Object(n.b)(e,"name")&&Object(n.b)(e,"parent")&&Object(n.b)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,o=e=>Array.isArray(e)&&e.every(c),l=e=>Object(n.b)(e,"attribute")&&Object(n.b)(e,"operator")&&Object(n.b)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every(e=>"string"==typeof e),i=e=>Array.isArray(e)&&e.every(l)},401:function(e,t,r){e.exports=r(459)},402:function(e,t){},459:function(e,t,r){"use strict";r.r(t);var n=r(6),c=r.n(n),o=r(0),l=r(1),i=r(8),s=r(11),a=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zm0-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})),u=r(113),b=r(4),p=r.n(b),d=r(5),m=r(99),f=r(120),g=r(3),O=r(75),j=r(2),h=r(28),v=r(162),w=r(35),y=r(394),_=r(245),k=(r(402),r(203)),E=r(26),x=r(232),S=r(15);const C=(e,t)=>Number.isFinite(e)&&Number.isFinite(t)?Object(l.sprintf)( +/* translators: %1$s min price, %2$s max price */ +Object(l.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(E.formatPrice)(e),Object(E.formatPrice)(t)):Number.isFinite(e)?Object(l.sprintf)( +/* translators: %s min price */ +Object(l.__)("From %s","woo-gutenberg-products-block"),Object(E.formatPrice)(e)):Object(l.sprintf)( +/* translators: %s max price */ +Object(l.__)("Up to %s","woo-gutenberg-products-block"),Object(E.formatPrice)(t)),N=e=>{let{type:t,name:r,prefix:n="",removeCallback:c=(()=>null),showLabel:i=!0,displayStyle:s}=e;const a=n?Object(o.createElement)(o.Fragment,null,n," ",r):r,u=Object(l.sprintf)( +/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */ +Object(l.__)("Remove %s filter","woo-gutenberg-products-block"),r);return Object(o.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},i&&Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===s?Object(o.createElement)(x.a,{element:"span",text:a,onRemove:c,radius:"large",ariaLabel:u}):Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-name"},a,Object(o.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:c},Object(o.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(o.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(o.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(o.createElement)(h.a,{screenReaderLabel:u}))))},A=function(){if(!window)return;const e=window.location.href,t=Object(S.getQueryArgs)(e),r=Object(S.removeQueryArgs)(e,...Object.keys(t));for(var n=arguments.length,c=new Array(n),o=0;o{if("string"==typeof e)return delete t[e];if("object"==typeof e){const r=Object.keys(e)[0],n=t[r].toString().split(",");t[r]=n.filter(t=>t!==e[r]).join(",")}});const l=Object.fromEntries(Object.entries(t).filter(e=>{let[,t]=e;return t})),i=Object(S.addQueryArgs)(r,l);Object(_.c)(i)};var L=r(125),R=r(13),T=r(170),H=e=>{let{attributeObject:t,slugs:r=[],operator:n="in",displayStyle:c}=e;const{results:i,isLoading:s}=Object(L.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[t.id]}),[a,u]=Object(O.b)("attributes",[]);if(s||!Array.isArray(i)||!Object(y.b)(i)||!Object(y.a)(a))return null;const b=t.label,p=Object(j.getSettingWithCoercion)("is_rendering_php_template",!1,v.a);return Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},b,":"),Object(o.createElement)("ul",null,r.map((e,r)=>{const s=i.find(t=>t.slug===e);if(!s)return null;let d="";return r>0&&"and"===n&&(d=Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(l.__)("and","woo-gutenberg-products-block"))),N({type:b,name:Object(R.decodeEntities)(s.name||e),prefix:d,removeCallback:()=>{const r=a.find(e=>{let{attribute:r}=e;return r==="pa_"+t.name});1===(null==r?void 0:r.slug.length)?A("query_type_"+t.name,"filter_"+t.name):A({["filter_"+t.name]:e}),p||Object(T.a)(a,u,t,e)},showLabel:!1,displayStyle:c})})))},V=e=>{let{attributes:t,isEditor:r=!1}=e;const n=Object(j.getSettingWithCoercion)("is_rendering_php_template",!1,v.a),[c,i]=Object(O.b)("attributes",[]),[s,a]=Object(O.b)("stock_status",[]),[u,b]=Object(O.b)("min_price"),[d,m]=Object(O.b)("max_price"),f=Object(j.getSetting)("stockStatusOptions",[]),g=Object(o.useMemo)(()=>{return 0!==s.length&&(e=s,Array.isArray(e)&&e.every(e=>["instock","outofstock","onbackorder"].includes(e)))&&(e=>Object(w.a)(e)&&Object.keys(e).every(e=>["instock","outofstock","onbackorder"].includes(e)))(f)?s.map(e=>N({type:Object(l.__)("Stock Status","woo-gutenberg-products-block"),name:f[e],removeCallback:()=>{if(A({filter_stock_status:e}),!n){const t=s.filter(t=>t!==e);a(t)}},displayStyle:t.displayStyle})):null;var e},[f,s,a,t.displayStyle,n]),E=Object(o.useMemo)(()=>Number.isFinite(u)||Number.isFinite(d)?N({type:Object(l.__)("Price","woo-gutenberg-products-block"),name:C(u,d),removeCallback:()=>{A("max_price","min_price"),n||(b(void 0),m(void 0))},displayStyle:t.displayStyle}):null,[u,d,t.displayStyle,b,m,n]),x=Object(o.useMemo)(()=>Object(y.a)(c)?c.map(e=>{const r=Object(k.b)(e.attribute);return r?Object(o.createElement)(H,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator}):null}):null,[c,t.displayStyle]),[L,R]=Object(O.b)("ratings");Object(o.useEffect)(()=>{var e;if(!n)return;if(L.length&&L.length>0)return;const t=null===(e=Object(_.d)("rating_filter"))||void 0===e?void 0:e.toString();t&&R(t.split(","))},[n,L,R]);const T=Object(o.useMemo)(()=>{return 0!==L.length&&(e=L,Array.isArray(e)&&e.every(e=>["1","2","3","4","5"].includes(e)))?L.map(e=>N({type:Object(l.__)("Rating","woo-gutenberg-products-block"),name:Object(l.sprintf)( +/* translators: %s is referring to the average rating value */ +Object(l.__)("Rated %s out of 5","woo-gutenberg-products-block"),e),removeCallback:()=>{if(n)return A({rating_filter:e});const t=L.filter(t=>t!==e);R(t)},displayStyle:t.displayStyle})):null;var e},[L,R,t.displayStyle,n]);if(!(c.length>0||s.length>0||L.length>0||Number.isFinite(u)||Number.isFinite(d)||r))return null;const V="h"+t.headingLevel;if(!Object(j.getSettingWithCoercion)("has_filterable_products",!1,v.a))return null;const P=p()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(V,{className:"wc-block-active-filters__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-active-filters"},Object(o.createElement)("ul",{className:P},r?Object(o.createElement)(o.Fragment,null,N({type:Object(l.__)("Size","woo-gutenberg-products-block"),name:Object(l.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),N({type:Object(l.__)("Color","woo-gutenberg-products-block"),name:Object(l.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(o.createElement)(o.Fragment,null,E,g,x,T)),Object(o.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:()=>{(()=>{if(!window)return;const e=window.location.href,t=Object(S.getQueryArgs)(e),r=Object(S.removeQueryArgs)(e,...Object.keys(t)),n=Object.fromEntries(Object.keys(t).filter(e=>!(e.includes("min_price")||e.includes("max_price")||e.includes("rating_filter")||e.includes("filter_")||e.includes("query_type_"))).map(e=>[e,t[e]])),c=Object(S.addQueryArgs)(r,n);Object(_.c)(c)})(),n||(b(void 0),m(void 0),i([]),a([]))}},Object(o.createElement)(h.a,{label:Object(l.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(l.__)("Clear All Filters","woo-gutenberg-products-block")}))))},P=Object(g.withSpokenMessages)(e=>{let{attributes:t,setAttributes:r}=e;const{className:n,displayStyle:c,heading:i,headingLevel:s}=t,a=Object(d.useBlockProps)({className:n});return Object(o.createElement)("div",a,Object(o.createElement)(d.InspectorControls,{key:"inspector"},Object(o.createElement)(g.PanelBody,{title:Object(l.__)("Block Settings","woo-gutenberg-products-block")},Object(o.createElement)(g.__experimentalToggleGroupControl,{label:Object(l.__)("Display Style","woo-gutenberg-products-block"),value:c,onChange:e=>r({displayStyle:e})},Object(o.createElement)(g.__experimentalToggleGroupControlOption,{value:"list",label:Object(l.__)("List","woo-gutenberg-products-block")}),Object(o.createElement)(g.__experimentalToggleGroupControlOption,{value:"chips",label:Object(l.__)("Chips","woo-gutenberg-products-block")})),Object(o.createElement)("p",null,Object(l.__)("Heading Level","woo-gutenberg-products-block")),Object(o.createElement)(m.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:s,onChange:e=>r({headingLevel:e})}))),Object(o.createElement)(f.a,{className:"wc-block-active-filters__title",headingLevel:s,heading:i,onChange:e=>r({heading:e})}),Object(o.createElement)(g.Disabled,null,Object(o.createElement)(V,{attributes:t,isEditor:!0})))}),F=r(279);const z={heading:{type:"string",default:Object(l.__)("Active filters","woo-gutenberg-products-block")}};Object(i.registerBlockType)(F,{title:Object(l.__)("Active Product Filters","woo-gutenberg-products-block"),description:Object(l.__)("Show the currently active product filters. Works in combination with the All Products and filters blocks.","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(u.a,{icon:a,className:"wc-block-editor-components-block-icon"})},attributes:{...F.attributes,...z},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:r}=e;return"woocommerce_layered_nav_filters"===t&&!(null==r||!r.raw)},transform:e=>{var t;let{instance:r}=e;return Object(i.createBlock)("woocommerce/active-filters",{displayStyle:"list",heading:(null==r||null===(t=r.raw)||void 0===t?void 0:t.title)||Object(l.__)("Active filters","woo-gutenberg-products-block"),headingLevel:3})}}]},edit:P,save(e){let{attributes:t}=e;const{className:r,displayStyle:n,heading:l,headingLevel:i}=t,s={"data-display-style":n,"data-heading":l,"data-heading-level":i};return Object(o.createElement)("div",c()({},d.useBlockProps.save({className:p()("is-loading",r)}),s),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-product-filters__placeholder"}))}})},49:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(0),c=r(22),o=r.n(c);function l(e){const t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},5:function(e,t){e.exports=window.wp.blockEditor},52:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const c=Object(n.createContext)("page"),o=()=>Object(n.useContext)(c);c.Provider},7:function(e,t){e.exports=window.lodash},75:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return d}));var n=r(17),c=r(9),o=r(0),l=r(22),i=r.n(l),s=r(49),a=r(109),u=r(52);const b=e=>{const t=Object(u.a)();e=e||t;const r=Object(c.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:l}=Object(c.useDispatch)(n.QUERY_STATE_STORE_KEY);return[r,Object(o.useCallback)(t=>{l(e,t)},[e,l])]},p=(e,t,r)=>{const l=Object(u.a)();r=r||l;const i=Object(c.useSelect)(c=>c(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t),[r,e]),{setQueryValue:s}=Object(c.useDispatch)(n.QUERY_STATE_STORE_KEY);return[i,Object(o.useCallback)(t=>{s(r,e,t)},[r,e,s])]},d=(e,t)=>{const r=Object(u.a)();t=t||r;const[n,c]=b(t),l=Object(s.a)(n),p=Object(s.a)(e),d=Object(a.a)(p),m=Object(o.useRef)(!1);return Object(o.useEffect)(()=>{i()(d,p)||(c(Object.assign({},l,p)),m.current=!0)},[l,p,d,c]),m.current?[n,c]:[e,c]}},8:function(e,t){e.exports=window.wp.blocks},9:function(e,t){e.exports=window.wp.data},99:function(e,t,r){"use strict";var n=r(0),c=r(7),o=r(1),l=r(3),i=r(11);function s(e){let{level:t}=e;const r={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return r.hasOwnProperty(t)?Object(n.createElement)(i.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)(i.Path,{d:r[t]})):null}class a extends n.Component{createLevelControl(e,t,r){const c=e===t;return{icon:Object(n.createElement)(s,{level:e}),title:Object(o.sprintf)( +/* translators: %s: heading level e.g: "2", "3", "4" */ +Object(o.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:c,onClick:()=>r(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:r,selectedLevel:o,onChange:i}=this.props;return Object(n.createElement)(l.ToolbarGroup,{isCollapsed:e,icon:Object(n.createElement)(s,{level:o}),controls:Object(c.range)(t,r).map(e=>this.createLevelControl(e,o,i))})}}t.a=a}}); \ No newline at end of file diff --git a/build/active-filters/block.json b/build/active-filters/block.json new file mode 100644 index 00000000000..83b791c35eb --- /dev/null +++ b/build/active-filters/block.json @@ -0,0 +1,29 @@ +{ + "name": "woocommerce/active-filters", + "version": "1.0.0", + "title": "Active Product Filters", + "description": "Show the currently active product filters. Works in combination with the All Products and filters blocks.", + "category": "woocommerce", + "keywords": [ "WooCommerce" ], + "supports": { + "html": false, + "multiple": false, + "color": { + "text": true, + "background": false + } + }, + "attributes": { + "displayStyle": { + "type": "string", + "default": "list" + }, + "headingLevel": { + "type": "number", + "default": 3 + } + }, + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2, + "$schema": "https://schemas.wp.org/trunk/block.json" +} diff --git a/build/all-products-frontend.asset.php b/build/all-products-frontend.asset.php new file mode 100644 index 00000000000..160ce2d4e03 --- /dev/null +++ b/build/all-products-frontend.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'fbb90a18a9915ed66fc4c91464e44b5f'); \ No newline at end of file diff --git a/build/all-products-frontend.js b/build/all-products-frontend.js new file mode 100644 index 00000000000..f282896b73d --- /dev/null +++ b/build/all-products-frontend.js @@ -0,0 +1,11 @@ +!function(e){function t(t){for(var r,o,c=t[0],i=t[1],s=0,l=[];s{let{imageUrl:t=a.l+"/block-error.svg",header:r=Object(s.__)("Oops!","woo-gutenberg-products-block"),text:n=Object(s.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:i=Object(s.__)("Error:","woo-gutenberg-products-block"),button:l,showErrorBlock:u=!0}=e;return u?Object(c.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(c.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(c.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(c.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),n&&Object(c.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},n),o&&Object(c.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},i?i+" ":"",o),l&&Object(c.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};r(35);class u extends i.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(c.createElement)(c.Fragment,null,Object(c.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:n=!0,text:o,errorMessagePrefix:i,renderError:s,button:a}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof s?s({errorMessage:u}):Object(c.createElement)(l,{showErrorBlock:n,errorMessage:r?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:i,button:a}):this.props.children}}t.a=u},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){e.exports=window.wp.htmlEntities},,function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t,r){"use strict";var n=r(0),o=r(4),c=r.n(o);t.a=e=>{let t,{label:r,screenReaderLabel:o,wrapperElement:i,wrapperProps:s={}}=e;const a=null!=r,l=null!=o;return!a&&l?(t=i||"span",s={...s,className:c()(s.className,"screen-reader-text")},Object(n.createElement)(t,s,o)):(t=i||n.Fragment,a&&l&&r!==o?Object(n.createElement)(t,s,Object(n.createElement)("span",{"aria-hidden":"true"},r),Object(n.createElement)("span",{className:"screen-reader-text"},o)):Object(n.createElement)(t,s,r))}},function(e,t){e.exports=window.wp.a11y},function(e,t,r){"use strict";(function(e){var n=r(0);r(37);const o=Object(n.createContext)({slots:{},fills:{},registerSlot:()=>{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,r(55))},function(e,t){e.exports=window.wp.deprecated},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0);const o=Object(n.createContext)("page"),c=()=>Object(n.useContext)(o);o.Provider},function(e,t){e.exports=window.wp.apiFetch},,function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0);r(7);const o=Object(n.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),c=()=>Object(n.useContext)(o)},,function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=r(11),c=r.n(o);function i(e){const t=Object(n.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},function(e,t,r){"use strict";r.d(t,"a",(function(){return O}));var n=r(3),o=r(0),c=r(6),i=r(7),s=r(17),a=r(118),l=r(29),u=r(70);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(i.dispatch)(c.CART_STORE_KEY).invalidateResolutionForStore()},p=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},b=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.b)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.b)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),p),[])},m={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},f={...m,email:""},g={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:c.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},h=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,r]=e;return[t,Object(s.decodeEntities)(r)]})),E={cartCoupons:c.EMPTY_CART_COUPONS,cartItems:c.EMPTY_CART_ITEMS,cartFees:c.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:c.EMPTY_CART_ITEM_ERRORS,cartTotals:g,cartIsLoading:!0,cartErrors:c.EMPTY_CART_ERRORS,billingAddress:f,shippingAddress:m,shippingRates:c.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:c.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:c.EMPTY_EXTENSIONS},O=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:r}=Object(l.a)(),s=null==r?void 0:r.previewCart,{shouldSelect:u}=e,d=Object(o.useRef)();b();const p=Object(i.useSelect)((e,r)=>{let{dispatch:n}=r;if(!u)return E;if(t)return{cartCoupons:s.coupons,cartItems:s.items,cartFees:s.fees,cartItemsCount:s.items_count,cartItemsWeight:s.items_weight,cartNeedsPayment:s.needs_payment,cartNeedsShipping:s.needs_shipping,cartItemErrors:c.EMPTY_CART_ITEM_ERRORS,cartTotals:s.totals,cartIsLoading:!1,cartErrors:c.EMPTY_CART_ERRORS,billingData:f,billingAddress:f,shippingAddress:m,extensions:c.EMPTY_EXTENSIONS,shippingRates:s.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:s.has_calculated_shipping,paymentRequirements:s.paymentRequirements,receiveCart:"function"==typeof(null==s?void 0:s.receiveCart)?s.receiveCart:()=>{}};const o=e(c.CART_STORE_KEY),i=o.getCartData(),l=o.getCartErrors(),d=o.getCartTotals(),p=!o.hasFinishedResolution("getCartData"),b=o.isCustomerDataUpdating(),{receiveCart:g}=n(c.CART_STORE_KEY),O=h(i.billingAddress),w=i.needsShipping?h(i.shippingAddress):O,j=i.fees.length>0?i.fees.map(e=>h(e)):c.EMPTY_CART_FEES;return{cartCoupons:i.coupons.length>0?i.coupons.map(e=>({...e,label:e.code})):c.EMPTY_CART_COUPONS,cartItems:i.items,cartFees:j,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors,cartTotals:d,cartIsLoading:p,cartErrors:l,billingData:Object(a.a)(O),billingAddress:Object(a.a)(O),shippingAddress:Object(a.a)(w),extensions:i.extensions,shippingRates:i.shippingRates,isLoadingRates:b,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements,receiveCart:g}},[u]);return d.current&&Object(n.isEqual)(d.current,p)||(d.current=p),d.current}},,function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(0);t.a=Object(c.forwardRef)((function({as:e="div",className:t,...r},n){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(c.createElement)(e,t)}({as:e,className:o()("components-visually-hidden",t),...r,ref:n})}))},function(e,t){},,function(e,t){e.exports=window.wp.warning},function(e,t,r){"use strict";var n=r(8),o=r(0),c=r(13),i=function({icon:e,className:t,...r}){const c=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(o.createElement)("span",Object(n.a)({className:c},r))};t.a=function({icon:e=null,size:t=24,...r}){if("string"==typeof e)return Object(o.createElement)(i,Object(n.a)({icon:e},r));if(Object(o.isValidElement)(e)&&i===e.type)return Object(o.cloneElement)(e,{...r});if("function"==typeof e)return e.prototype instanceof o.Component?Object(o.createElement)(e,{size:t,...r}):e({size:t,...r});if(e&&("svg"===e.type||e.type===c.SVG)){const n={width:t,height:t,...e.props,...r};return Object(o.createElement)(c.SVG,n)}return Object(o.isValidElement)(e)?Object(o.cloneElement)(e,{size:t,...r}):e}},function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return b}));var n=r(6),o=r(7),c=r(0),i=r(11),s=r.n(i),a=r(31),l=r(61),u=r(26);const d=e=>{const t=Object(u.a)();e=e||t;const r=Object(o.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:i}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[r,Object(c.useCallback)(t=>{i(e,t)},[e,i])]},p=(e,t,r)=>{const i=Object(u.a)();r=r||i;const s=Object(o.useSelect)(o=>o(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t),[r,e]),{setQueryValue:a}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[s,Object(c.useCallback)(t=>{a(r,e,t)},[r,e,a])]},b=(e,t)=>{const r=Object(u.a)();t=t||r;const[n,o]=d(t),i=Object(a.a)(n),p=Object(a.a)(e),b=Object(l.a)(p),m=Object(c.useRef)(!1);return Object(c.useEffect)(()=>{s()(b,p)||(o(Object.assign({},i,p)),m.current=!0)},[i,p,b,o]),m.current?[n,o]:[e,o]}},,function(e,t){e.exports=window.wc.priceFormat},function(e,t,r){"use strict";var n=r(8),o=r(0),c=r(4),i=r.n(c),s=r(3),a=r(25),l=r.n(a),u=r(9),d=r(44),p=r(71),b=r(1);function m(e,t,r){const{defaultView:n}=t,{frameElement:o}=n;if(!o||t===r.ownerDocument)return e;const c=o.getBoundingClientRect();return new n.DOMRect(e.left+c.left,e.top+c.top,e.width,e.height)}let f=0;function g(e){const t=document.scrollingElement||document.body;e&&(f=t.scrollTop);const r=e?"add":"remove";t.classList[r]("lockscroll"),document.documentElement.classList[r]("lockscroll"),e||(t.scrollTop=f)}let h=0;function E(){return Object(o.useEffect)(()=>(0===h&&g(!0),++h,()=>{1===h&&g(!1),--h}),[]),null}var O=r(24);function w(e){const t=Object(o.useContext)(O.a),r=t.slots[e]||{},n=t.fills[e],c=Object(o.useMemo)(()=>n||[],[n]);return{...r,updateSlot:Object(o.useCallback)(r=>{t.updateSlot(e,r)},[e,t.updateSlot]),unregisterSlot:Object(o.useCallback)(r=>{t.unregisterSlot(e,r)},[e,t.unregisterSlot]),fills:c,registerFill:Object(o.useCallback)(r=>{t.registerFill(e,r)},[e,t.registerFill]),unregisterFill:Object(o.useCallback)(r=>{t.unregisterFill(e,r)},[e,t.unregisterFill])}}var j=Object(o.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function v({name:e,children:t,registerFill:r,unregisterFill:n}){const c=(e=>{const{getSlot:t,subscribe:r}=Object(o.useContext)(j),[n,c]=Object(o.useState)(t(e));return Object(o.useEffect)(()=>(c(t(e)),r(()=>{c(t(e))})),[e]),n})(e),i=Object(o.useRef)({name:e,children:t});return Object(o.useLayoutEffect)(()=>(r(e,i.current),()=>n(e,i.current)),[]),Object(o.useLayoutEffect)(()=>{i.current.children=t,c&&c.forceUpdate()},[t]),Object(o.useLayoutEffect)(()=>{e!==i.current.name&&(n(i.current.name,i.current),i.current.name=e,r(e,i.current))},[e]),c&&c.node?(Object(s.isFunction)(t)&&(t=t(c.props.fillProps)),Object(o.createPortal)(t,c.node)):null}var y=e=>Object(o.createElement)(j.Consumer,null,({registerFill:t,unregisterFill:r})=>Object(o.createElement)(v,Object(n.a)({},e,{registerFill:t,unregisterFill:r})));class _ extends o.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:r,registerSlot:n}=this.props;e.name!==t&&(r(e.name),n(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:r={},getFills:n}=this.props,c=Object(s.map)(n(t,this),e=>{const t=Object(s.isFunction)(e.children)?e.children(r):e.children;return o.Children.map(t,(e,t)=>{if(!e||Object(s.isString)(e))return e;const r=e.key||t;return Object(o.cloneElement)(e,{key:r})})}).filter(Object(s.negate)(o.isEmptyElement));return Object(o.createElement)(o.Fragment,null,Object(s.isFunction)(e)?e(c):c)}}var x=e=>Object(o.createElement)(j.Consumer,null,({registerSlot:t,unregisterSlot:r,getFills:c})=>Object(o.createElement)(_,Object(n.a)({},e,{registerSlot:t,unregisterSlot:r,getFills:c})));function k(){const[,e]=Object(o.useState)({}),t=Object(o.useRef)(!0);return Object(o.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function S({name:e,children:t}){const r=w(e),n=Object(o.useRef)({rerender:k()});return Object(o.useEffect)(()=>(r.registerFill(n),()=>{r.unregisterFill(n)}),[r.registerFill,r.unregisterFill]),r.ref&&r.ref.current?("function"==typeof t&&(t=t(r.fillProps)),Object(o.createPortal)(t,r.ref.current)):null}var C=Object(o.forwardRef)((function({name:e,fillProps:t={},as:r="div",...c},i){const s=Object(o.useContext)(O.a),a=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(s.registerSlot(e,a,t),()=>{s.unregisterSlot(e,a)}),[s.registerSlot,s.unregisterSlot,e]),Object(o.useLayoutEffect)(()=>{s.updateSlot(e,t)}),Object(o.createElement)(r,Object(n.a)({ref:Object(u.useMergeRefs)([i,a])},c))}));function P(e){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(y,e),Object(o.createElement)(S,e))}r(11),o.Component;const R=Object(o.forwardRef)(({bubblesVirtually:e,...t},r)=>e?Object(o.createElement)(C,Object(n.a)({},t,{ref:r})):Object(o.createElement)(x,t));function N(e){return"appear"===e?"top":"left"}function T(e,t){const{paddingTop:r,paddingBottom:n,paddingLeft:o,paddingRight:c}=(i=t).ownerDocument.defaultView.getComputedStyle(i);var i;const s=r?parseInt(r,10):0,a=n?parseInt(n,10):0,l=o?parseInt(o,10):0,u=c?parseInt(c,10):0;return{x:e.left+l,y:e.top+s,width:e.width-l-u,height:e.height-s-a,left:e.left+l,right:e.right-u,top:e.top+s,bottom:e.bottom-a}}function L(e,t,r){r?e.getAttribute(t)!==r&&e.setAttribute(t,r):e.hasAttribute(t)&&e.removeAttribute(t)}function B(e,t,r=""){e.style[t]!==r&&(e.style[t]=r)}function A(e,t,r){r?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const M=Object(o.forwardRef)(({headerTitle:e,onClose:t,children:r,className:c,noArrow:s=!0,isAlternate:a,position:f="bottom right",range:g,focusOnMount:h="firstElement",anchorRef:O,shouldAnchorIncludePadding:j,anchorRect:v,getAnchorRect:y,expandOnMobile:_,animate:x=!0,onClickOutside:k,onFocusOutside:S,__unstableStickyBoundaryElement:C,__unstableSlotName:R="Popover",__unstableObserveElement:M,__unstableBoundaryParent:F,__unstableForcePosition:I,__unstableForceXAlignment:D,...z},H)=>{const W=Object(o.useRef)(null),V=Object(o.useRef)(null),Y=Object(o.useRef)(),U=Object(u.useViewportMatch)("medium","<"),[q,G]=Object(o.useState)(),K=w(R),X=_&&U,[J,Z]=Object(u.useResizeObserver)();s=X||s,Object(o.useLayoutEffect)(()=>{if(X)return A(Y.current,"is-without-arrow",s),A(Y.current,"is-alternate",a),L(Y.current,"data-x-axis"),L(Y.current,"data-y-axis"),B(Y.current,"top"),B(Y.current,"left"),B(V.current,"maxHeight"),void B(V.current,"maxWidth");const e=()=>{if(!Y.current||!V.current)return;let e=function(e,t,r,n=!1,o,c){if(t)return t;if(r){if(!e.current)return;const t=r(e.current);return m(t,t.ownerDocument||e.current.ownerDocument,c)}if(!1!==n){if(!(n&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==n?void 0:n.cloneRange))return m(Object(d.getRectangleFromRange)(n),n.endContainer.ownerDocument,c);if("function"==typeof(null==n?void 0:n.getBoundingClientRect)){const e=m(n.getBoundingClientRect(),n.ownerDocument,c);return o?e:T(e,n)}const{top:e,bottom:t}=n,r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),s=m(new window.DOMRect(r.left,r.top,r.width,i.bottom-r.top),e.ownerDocument,c);return o?s:T(s,n)}if(!e.current)return;const{parentNode:i}=e.current,s=i.getBoundingClientRect();return o?s:T(s,i)}(W,v,y,O,j,Y.current);if(!e)return;const{offsetParent:t,ownerDocument:r}=Y.current;let n,o=0;if(t&&t!==r.body){const r=t.getBoundingClientRect();o=r.top,e=new window.DOMRect(e.left-r.left,e.top-r.top,e.width,e.height)}var c;F&&(n=null===(c=Y.current.closest(".popover-slot"))||void 0===c?void 0:c.parentNode);const i=Z.height?Z:V.current.getBoundingClientRect(),{popoverTop:l,popoverLeft:u,xAxis:p,yAxis:g,contentHeight:h,contentWidth:E}=function(e,t,r="top",n,o,c,i,s,a){const[l,u="center",d]=r.split(" "),p=function(e,t,r,n,o,c,i,s){const{height:a}=t;if(o){const t=o.getBoundingClientRect().top+a-i;if(e.top<=t)return{yAxis:r,popoverTop:Math.min(e.bottom,t)}}let l=e.top+e.height/2;"bottom"===n?l=e.bottom:"top"===n&&(l=e.top);const u={popoverTop:l,contentHeight:(l-a/2>0?a/2:l)+(l+a/2>window.innerHeight?window.innerHeight-l:a/2)},d={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a};let b,m=r,f=null;if(!o&&!s)if("middle"===r&&u.contentHeight===a)m="middle";else if("top"===r&&d.contentHeight===a)m="top";else if("bottom"===r&&p.contentHeight===a)m="bottom";else{m=d.contentHeight>p.contentHeight?"top":"bottom";const e="top"===m?d.contentHeight:p.contentHeight;f=e!==a?e:null}return b="middle"===m?u.popoverTop:"top"===m?d.popoverTop:p.popoverTop,{yAxis:m,popoverTop:b,contentHeight:f}}(e,t,l,d,n,0,c,s);return{...function(e,t,r,n,o,c,i,s,a){const{width:l}=t;"left"===r&&Object(b.isRTL)()?r="right":"right"===r&&Object(b.isRTL)()&&(r="left"),"left"===n&&Object(b.isRTL)()?n="right":"right"===n&&Object(b.isRTL)()&&(n="left");const u=Math.round(e.left+e.width/2),d={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)};let p=e.left;"right"===n?p=e.right:"middle"===c||a||(p=u);let m=e.right;"left"===n?m=e.left:"middle"===c||a||(m=u);const f={popoverLeft:p,contentWidth:p-l>0?l:p},g={popoverLeft:m,contentWidth:m+l>window.innerWidth?window.innerWidth-m:l};let h,E=r,O=null;if(!o&&!s)if("center"===r&&d.contentWidth===l)E="center";else if("left"===r&&f.contentWidth===l)E="left";else if("right"===r&&g.contentWidth===l)E="right";else{E=f.contentWidth>g.contentWidth?"left":"right";const e="left"===E?f.contentWidth:g.contentWidth;l>window.innerWidth&&(O=window.innerWidth),e!==l&&(E="center",d.popoverLeft=window.innerWidth/2)}if(h="center"===E?d.popoverLeft:"left"===E?f.popoverLeft:g.popoverLeft,i){const e=i.getBoundingClientRect();h=Math.min(h,e.right-l),Object(b.isRTL)()||(h=Math.max(h,0))}return{xAxis:E,popoverLeft:h,contentWidth:O}}(e,t,u,d,n,p.yAxis,i,s,a),...p}}(e,i,f,C,Y.current,o,n,I,D);"number"==typeof l&&"number"==typeof u&&(B(Y.current,"top",l+"px"),B(Y.current,"left",u+"px")),A(Y.current,"is-without-arrow",s||"center"===p&&"middle"===g),A(Y.current,"is-alternate",a),L(Y.current,"data-x-axis",p),L(Y.current,"data-y-axis",g),B(V.current,"maxHeight","number"==typeof h?h+"px":""),B(V.current,"maxWidth","number"==typeof E?E+"px":""),G(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[g]||"middle"))};e();const{ownerDocument:t}=Y.current,{defaultView:r}=t,n=r.setInterval(e,500);let o;const c=()=>{r.cancelAnimationFrame(o),o=r.requestAnimationFrame(e)};r.addEventListener("click",c),r.addEventListener("resize",e),r.addEventListener("scroll",e,!0);const i=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(O);let l;return i&&i!==t&&(i.defaultView.addEventListener("resize",e),i.defaultView.addEventListener("scroll",e,!0)),M&&(l=new r.MutationObserver(e),l.observe(M,{attributes:!0})),()=>{r.clearInterval(n),r.removeEventListener("resize",e),r.removeEventListener("scroll",e,!0),r.removeEventListener("click",c),r.cancelAnimationFrame(o),i&&i!==t&&(i.defaultView.removeEventListener("resize",e),i.defaultView.removeEventListener("scroll",e,!0)),l&&l.disconnect()}},[X,v,y,O,j,f,Z,C,M,F]);const $=(e,r)=>{if("focus-outside"===e&&S)S(r);else if("focus-outside"===e&&k){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>r.relatedTarget}),l()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),k(e)}else t&&t()},[ee,te]=Object(u.__experimentalUseDialog)({focusOnMount:h,__unstableOnClose:$,onClose:$}),re=Object(u.useMergeRefs)([Y,ee,H]),ne=Boolean(x&&q)&&function(e){if("loading"===e.type)return i()("components-animate__loading");const{type:t,origin:r=N(t)}=e;if("appear"===t){const[e,t="center"]=r.split(" ");return i()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?i()("components-animate__slide-in","is-from-"+r):void 0}({type:"appear",origin:q});let oe=Object(o.createElement)("div",Object(n.a)({className:i()("components-popover",c,ne,{"is-expanded":X,"is-without-arrow":s,"is-alternate":a})},z,{ref:re},te,{tabIndex:"-1"}),X&&Object(o.createElement)(E,null),X&&Object(o.createElement)("div",{className:"components-popover__header"},Object(o.createElement)("span",{className:"components-popover__header-title"},e),Object(o.createElement)(Q,{className:"components-popover__close",icon:p.a,onClick:t})),Object(o.createElement)("div",{ref:V,className:"components-popover__content"},Object(o.createElement)("div",{style:{position:"relative"}},J,r)));return K.ref&&(oe=Object(o.createElement)(P,{name:R},oe)),O||v?oe:Object(o.createElement)("span",{ref:W},oe)});M.Slot=Object(o.forwardRef)((function({name:e="Popover"},t){return Object(o.createElement)(R,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var F=M,I=function({shortcut:e,className:t}){if(!e)return null;let r,n;return Object(s.isString)(e)&&(r=e),Object(s.isObject)(e)&&(r=e.display,n=e.ariaLabel),Object(o.createElement)("span",{className:t,"aria-label":n},r)};const D=Object(o.createElement)("div",{className:"event-catcher"}),z=({eventHandlers:e,child:t,childrenWithPopover:r})=>Object(o.cloneElement)(Object(o.createElement)("span",{className:"disabled-element-wrapper"},Object(o.cloneElement)(D,e),Object(o.cloneElement)(t,{children:r}),","),e),H=({child:e,eventHandlers:t,childrenWithPopover:r})=>Object(o.cloneElement)(e,{...t,children:r}),W=(e,t,r)=>{if(1!==o.Children.count(e))return;const n=o.Children.only(e);"function"==typeof n.props[t]&&n.props[t](r)};var V=function({children:e,position:t,text:r,shortcut:n}){const[c,i]=Object(o.useState)(!1),[a,l]=Object(o.useState)(!1),d=Object(u.useDebounce)(l,700),p=t=>{W(e,"onMouseDown",t),document.addEventListener("mouseup",f),i(!0)},b=t=>{W(e,"onMouseUp",t),document.removeEventListener("mouseup",f),i(!1)},m=e=>"mouseUp"===e?b:"mouseDown"===e?p:void 0,f=m("mouseUp"),g=(t,r)=>n=>{if(W(e,t,n),n.currentTarget.disabled)return;if("focus"===n.type&&c)return;d.cancel();const o=Object(s.includes)(["focus","mouseenter"],n.type);o!==a&&(r?d(o):l(o))},h=()=>{d.cancel(),document.removeEventListener("mouseup",f)};if(Object(o.useEffect)(()=>h,[]),1!==o.Children.count(e))return e;const E={onMouseEnter:g("onMouseEnter",!0),onMouseLeave:g("onMouseLeave"),onClick:g("onClick"),onFocus:g("onFocus"),onBlur:g("onBlur"),onMouseDown:m("mouseDown")},O=o.Children.only(e),{children:w,disabled:j}=O.props;return(j?z:H)({child:O,eventHandlers:E,childrenWithPopover:(({grandchildren:e,isOver:t,position:r,text:n,shortcut:c})=>Object(o.concatChildren)(e,t&&Object(o.createElement)(F,{focusOnMount:!1,position:r,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},n,Object(o.createElement)(I,{className:"components-tooltip__shortcut",shortcut:c}))))({grandchildren:w,isOver:a,position:t,text:r,shortcut:n})})},Y=r(38),U=r(34);const q=["onMouseDown","onClick"];var Q=t.a=Object(o.forwardRef)((function(e,t){const{href:r,target:c,isSmall:a,isPressed:u,isBusy:d,isDestructive:p,className:b,disabled:m,icon:f,iconPosition:g="left",iconSize:h,showTooltip:E,tooltipPosition:O,shortcut:w,label:j,children:v,text:y,variant:_,__experimentalIsFocusable:x,describedBy:k,...S}=function({isDefault:e,isPrimary:t,isSecondary:r,isTertiary:n,isLink:o,variant:c,...i}){let s=c;var a,u,d,p,b;return t&&(null!==(a=s)&&void 0!==a||(s="primary")),n&&(null!==(u=s)&&void 0!==u||(s="tertiary")),r&&(null!==(d=s)&&void 0!==d||(s="secondary")),e&&(l()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(p=s)&&void 0!==p||(s="secondary")),o&&(null!==(b=s)&&void 0!==b||(s="link")),{...i,variant:s}}(e),C=i()("components-button",b,{"is-secondary":"secondary"===_,"is-primary":"primary"===_,"is-small":a,"is-tertiary":"tertiary"===_,"is-pressed":u,"is-busy":d,"is-link":"link"===_,"is-destructive":p,"has-text":!!f&&!!v,"has-icon":!!f}),P=m&&!x,R=void 0===r||P?"button":"a",N="a"===R?{href:r,target:c}:{type:"button",disabled:P,"aria-pressed":u};if(m&&x){N["aria-disabled"]=!0;for(const e of q)S[e]=e=>{e.stopPropagation(),e.preventDefault()}}const T=!P&&(E&&j||w||!!j&&(!v||Object(s.isArray)(v)&&!v.length)&&!1!==E),L=k?Object(s.uniqueId)():null,B=S["aria-describedby"]||L,A=Object(o.createElement)(R,Object(n.a)({},N,S,{className:C,"aria-label":S["aria-label"]||j,"aria-describedby":B,ref:t}),f&&"left"===g&&Object(o.createElement)(Y.a,{icon:f,size:h}),y&&Object(o.createElement)(o.Fragment,null,y),f&&"right"===g&&Object(o.createElement)(Y.a,{icon:f,size:h}),v);return T?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(V,{text:k||j,shortcut:w,position:O},A),k&&Object(o.createElement)(U.a,null,Object(o.createElement)("span",{id:L},k))):Object(o.createElement)(o.Fragment,null,A,k&&Object(o.createElement)(U.a,null,Object(o.createElement)("span",{id:L},k)))}))},function(e,t){e.exports=window.wp.hooks},function(e,t){e.exports=window.wp.dom},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"string"==typeof e},,function(e,t){e.exports=window.wc.wcBlocksSharedContext},function(e,t,r){"use strict";r.d(t,"n",(function(){return c})),r.d(t,"l",(function(){return i})),r.d(t,"k",(function(){return s})),r.d(t,"m",(function(){return a})),r.d(t,"i",(function(){return l})),r.d(t,"d",(function(){return u})),r.d(t,"f",(function(){return d})),r.d(t,"j",(function(){return p})),r.d(t,"c",(function(){return b})),r.d(t,"e",(function(){return m})),r.d(t,"g",(function(){return f})),r.d(t,"a",(function(){return g})),r.d(t,"h",(function(){return h})),r.d(t,"b",(function(){return E}));var n,o=r(2);const c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"images/",s=c.pluginUrl+"build/",a=c.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),b=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),m=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),f=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),E=Object(o.getSetting)("allowedStates",{})},function(e,t,r){"use strict";var n=r(2),o=r(1),c=r(72),i=r(45);const s=Object(n.getSetting)("countryLocale",{}),a=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(o.sprintf)( +/* translators: %s Field label. */ +Object(o.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(c.a)(e.priority)&&(t.index=e.priority),Object(i.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},l=Object.entries(s).map(e=>{let[t,r]=e;return[t,Object.entries(r).map(e=>{let[t,r]=e;return[t,a(r)]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{})]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{});t.a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=r&&void 0!==l[r]?l[r]:{};return e.map(e=>({key:e,...n.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(12),o=r.n(n),c=r(0),i=r(15);const s=[".wp-block-woocommerce-cart"],a=e=>{let{Block:t,containers:r,getProps:n=(()=>({})),getErrorBoundaryProps:s=(()=>({}))}=e;0!==r.length&&Array.prototype.forEach.call(r,(e,r)=>{const a=n(e,r),l=s(e,r),u={...e.dataset,...a.attributes||{}};(e=>{let{Block:t,container:r,attributes:n={},props:s={},errorBoundaryProps:a={}}=e;Object(c.render)(Object(c.createElement)(i.a,a,Object(c.createElement)(c.Suspense,{fallback:Object(c.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(c.createElement)(t,o()({},s,{attributes:n})))),r,()=>{r.classList&&r.classList.remove("is-loading")})})({Block:t,container:e,props:a,attributes:u,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(s.join(",")),{Block:r,getProps:n,getErrorBoundaryProps:o,selector:c}=e;(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrappers:c}=e;const i=document.body.querySelectorAll(o);c&&c.length>0&&Array.prototype.filter.call(i,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,c)),a({Block:t,containers:i,getProps:r,getErrorBoundaryProps:n})})({Block:r,getProps:n,getErrorBoundaryProps:o,selector:c,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrapper:c}=e;const i=c.querySelectorAll(o);a({Block:t,containers:i,getProps:r,getErrorBoundaryProps:n})})({...e,wrapper:t})})})}},,,function(e,t){var r,n,o=e.exports={};function c(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===c||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:c}catch(e){r=c}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var a,l=[],u=!1,d=-1;function p(){u&&a&&(u=!1,a.length?l=a.concat(l):d=-1,l.length&&b())}function b(){if(!u){var e=s(p);u=!0;for(var t=l.length;t;){for(a=l,l=[];++d1)for(var r=1;r{const e=Object(c.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...r,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return i}));var n=r(0);const o=Object(n.createContext)({setIsSuppressed:e=>{},isSuppressed:!1}),c=()=>Object(n.useContext)(o),i=e=>{let{children:t}=e;const[r,c]=Object(n.useState)(!1),i={setIsSuppressed:c,isSuppressed:r};return Object(n.createElement)(o.Provider,{value:i},t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(5);function o(e,t){const r=Object(n.useRef)();return Object(n.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(6),o=r(7),c=r(0),i=r(31),s=r(73);const a=e=>{const{namespace:t,resourceName:r,resourceValues:a=[],query:l={},shouldSelect:u=!0}=e;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(c.useRef)({results:[],isLoading:!0}),p=Object(i.a)(l),b=Object(i.a)(a),m=Object(s.a)(),f=Object(o.useSelect)(e=>{if(!u)return null;const o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,p,b],i=o.getCollectionError(...c);if(i){if(!(i instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(i)}return{results:o.getCollection(...c),isLoading:!o.hasFinishedResolution("getCollection",c)}},[t,r,b,p,u]);return null!==f&&(d.current=f),d.current}},,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"d",(function(){return i})),r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return a}));const n=window.CustomEvent||null,o=(e,t)=>{let{bubbles:r=!1,cancelable:o=!1,element:c,detail:i={}}=t;if(!n)return;c||(c=document.body);const s=new n(e,{bubbles:r,cancelable:o,detail:i});c.dispatchEvent(s)};let c;const i=()=>{c&&clearTimeout(c),c=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},s=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const c=()=>{o(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,c),()=>jQuery(document).off(e,c)}},function(e,t,r){"use strict";var n=r(0),o=r(13);const c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"number"==typeof e},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const o=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},function(e,t,r){"use strict";var n=r(12),o=r.n(n),c=r(0);r(106);const i=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};t.a=e=>t=>{const r=Object(c.useRef)(null);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:r,"aria-hidden":!0}),Object(c.createElement)(e,o()({},t,{scrollToTop:e=>{null!==r.current&&((e,t)=>{const{focusableSelector:r}=t||{};window&&Number.isFinite(window.innerHeight)&&(r?((e,t)=>{var r;const n=(null===(r=e.parentElement)||void 0===r?void 0:r.querySelectorAll(t))||[];if(n.length){const e=n[0];i(e),null==e||e.focus()}else i(e)})(e,r):i(e))})(r.current,e)}})))}},,function(e,t,r){"use strict";var n=r(0),o=r(3),c=r(4),i=r.n(c),s=r(1),a=r(23),l=r(71),u=r(42);function d(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}t.a=function({className:e,status:t="info",children:r,spokenMessage:c=r,onRemove:p=o.noop,isDismissible:b=!0,actions:m=[],politeness:f=d(t),__unstableHTML:g,onDismiss:h=o.noop}){!function(e,t){const r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)(()=>{r&&Object(a.speak)(r,t)},[r,t])}(c,f);const E=i()(e,"components-notice","is-"+t,{"is-dismissible":b});return g&&(r=Object(n.createElement)(n.RawHTML,null,r)),Object(n.createElement)("div",{className:E},Object(n.createElement)("div",{className:"components-notice__content"},r,Object(n.createElement)("div",{className:"components-notice__actions"},m.map(({className:e,label:t,isPrimary:r,variant:o,noDefaultClasses:c=!1,onClick:s,url:a},l)=>{let d=o;return"primary"===o||c||(d=a?"link":"secondary"),void 0===d&&r&&(d="primary"),Object(n.createElement)(u.a,{key:l,href:a,variant:d,onClick:a?void 0:s,className:i()("components-notice__action",e)},t)}))),b&&Object(n.createElement)(u.a,{className:"components-notice__dismiss",icon:l.a,label:Object(s.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),h(),p()},showTooltip:!1}))}},,,,,function(e,t){},,,,,,,,,,,,,,,,,,,,,,function(e,t){e.exports=window.wp.blocks},,,function(e,t){},,function(e,t,r){"use strict";var n=r(0),o=r(4),c=r.n(o),i=r(22),s=r(9);r(122),t.a=Object(s.withInstanceId)(e=>{let{className:t,instanceId:r,label:o="",onChange:s,options:a,screenReaderLabel:l,value:u=""}=e;const d="wc-block-components-sort-select__select-"+r;return Object(n.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(i.a,{label:o,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(n.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:s,value:u},a&&a.map(e=>Object(n.createElement)("option",{key:e.key,value:e.key},e.label))))})},,,,,,function(e,t){e.exports=window.wp.blockEditor},function(e,t){e.exports=window.wp.wordcount},function(e,t){e.exports=window.wp.autop},function(e,t,r){"use strict";var n=r(0);t.a=function(e){let{icon:t,size:r=24,...o}=e;return Object(n.cloneElement)(t,{width:r,height:r,...o})}},function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return i}));var n=r(49),o=(r(14),r(2));const c=(e,t)=>Object.keys(o.defaultAddressFields).every(r=>e[r]===t[r]),i=e=>{const t=Object.keys(o.defaultAddressFields),r=Object(n.a)(t,{},e.country),c=Object.assign({},e);return r.forEach(t=>{let{key:r="",hidden:n=!1}=t;n&&((e,t)=>e in t)(r,e)&&(c[r]="")}),c}},function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,,function(e,t){},function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(12),o=r.n(n),c=r(0),i=r(4),s=r.n(i),a=r(76),l=r(7),u=(r(81),r(60));const d=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""},p=e=>{let{className:t,context:r="default",additionalNotices:n=[]}=e;const{isSuppressed:i}=Object(u.b)(),{notices:p}=Object(l.useSelect)(e=>({notices:e("core/notices").getNotices(r)})),{removeNotice:b}=Object(l.useDispatch)("core/notices"),m=p.filter(e=>"snackbar"!==e.type).concat(n);if(!m.length)return null;const f=s()(t,"wc-block-components-notices");return i?null:Object(c.createElement)("div",{className:f},m.map(e=>Object(c.createElement)(a.a,o()({key:"store-notice-"+e.id},e,{className:s()("wc-block-components-notices__notice",d(e)),onRemove:()=>{e.isDismissible&&b(e.id,r)}}),e.content)))}},,,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(16),o=r(0),c=r(48);r.p=c.k,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)(()=>Promise.all([r.e(0),r.e(62)]).then(r.bind(null,402)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)(()=>r.e(61).then(r.bind(null,446)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)(()=>r.e(69).then(r.bind(null,447)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)(()=>r.e(63).then(r.bind(null,403)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)(()=>r.e(59).then(r.bind(null,404)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)(()=>r.e(67).then(r.bind(null,405)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)(()=>r.e(64).then(r.bind(null,323)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)(()=>r.e(65).then(r.bind(null,406)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)(()=>r.e(60).then(r.bind(null,407)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)(()=>r.e(68).then(r.bind(null,408)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)(()=>r.e(66).then(r.bind(null,409)))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)(()=>Promise.all([r.e(1),r.e(74),r.e(58)]).then(r.bind(null,429)))});const i=e=>Object(n.getRegisteredBlockComponents)(e)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){e.exports=r(239)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(60),c=r(52),i=r(5),s=r(1),a=r(3),l=r(4),u=r.n(l),d=r(22);r(216);var p=e=>{let{currentPage:t,displayFirstAndLastPages:r=!0,displayNextAndPreviousArrows:o=!0,pagesToDisplay:c=3,onPageChange:i,totalPages:a}=e,{minIndex:l,maxIndex:p}=((e,t,r)=>{if(r<=2)return{minIndex:null,maxIndex:null};const n=e-1,o=Math.max(Math.floor(t-n/2),2),c=Math.min(Math.ceil(t+(n-(t-o))),r-1);return{minIndex:Math.max(Math.floor(t-(n-(c-t))),2),maxIndex:c}})(c,t,a);const b=r&&Boolean(1!==l),m=r&&Boolean(p!==a),f=r&&Boolean(l&&l>3),g=r&&Boolean(p&&pi(t-1),title:Object(s.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(n.createElement)(d.a,{label:"←",screenReaderLabel:Object(s.__)("Previous page","woo-gutenberg-products-block")})),b&&Object(n.createElement)("button",{className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:()=>i(1),disabled:1===t},Object(n.createElement)(d.a,{label:"1",screenReaderLabel:Object(s.sprintf)( +/* translators: %d is the page number (1, 2, 3...). */ +Object(s.__)("Page %d","woo-gutenberg-products-block"),1)})),f&&Object(n.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),h.map(e=>Object(n.createElement)("button",{key:e,className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?void 0:()=>i(e),disabled:t===e},Object(n.createElement)(d.a,{label:e.toString(),screenReaderLabel:Object(s.sprintf)( +/* translators: %d is the page number (1, 2, 3...). */ +Object(s.__)("Page %d","woo-gutenberg-products-block"),e)}))),g&&Object(n.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),m&&Object(n.createElement)("button",{className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===a,"wc-block-components-pagination__page--active":t===a}),onClick:()=>i(a),disabled:t===a},Object(n.createElement)(d.a,{label:a.toString(),screenReaderLabel:Object(s.sprintf)( +/* translators: %d is the page number (1, 2, 3...). */ +Object(s.__)("Page %d","woo-gutenberg-products-block"),a)})),o&&Object(n.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>i(t+1),title:Object(s.__)("Next page","woo-gutenberg-products-block"),disabled:t>=a},Object(n.createElement)(d.a,{label:"→",screenReaderLabel:Object(s.__)("Next page","woo-gutenberg-products-block")})))},b=r(61),m=r(39),f=r(65),g=r(6),h=r(7),E=r(31);var O=r(59),w=r(74),j=r(47),v=r(23),y=r(117),_=r(13),x=Object(n.createElement)(_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(n.createElement)(_.Path,{d:"M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z"})),k=()=>{const{parentClassName:e}=Object(j.useInnerBlockLayoutContext)();return Object(n.createElement)("div",{className:e+"__no-products"},Object(n.createElement)(y.a,{className:e+"__no-products-image",icon:x,size:100}),Object(n.createElement)("strong",{className:e+"__no-products-title"},Object(s.__)("No products","woo-gutenberg-products-block")),Object(n.createElement)("p",{className:e+"__no-products-description"},Object(s.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},S=Object(n.createElement)(_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(_.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"})),C=e=>{let{resetCallback:t=(()=>{})}=e;const{parentClassName:r}=Object(j.useInnerBlockLayoutContext)();return Object(n.createElement)("div",{className:r+"__no-products"},Object(n.createElement)(y.a,{className:r+"__no-products-image",icon:S,size:100}),Object(n.createElement)("strong",{className:r+"__no-products-title"},Object(s.__)("No products found","woo-gutenberg-products-block")),Object(n.createElement)("p",{className:r+"__no-products-description"},Object(s.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(n.createElement)("button",{onClick:t},Object(s.__)("Reset Search","woo-gutenberg-products-block")))},P=r(108);r(215);var R=e=>{let{onChange:t,value:r}=e;return Object(n.createElement)(P.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",onChange:t,options:[{key:"menu_order",label:Object(s.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(s.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(s.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(s.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(s.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(s.__)("Price: high to low","woo-gutenberg-products-block")}],screenReaderLabel:Object(s.__)("Order products by","woo-gutenberg-products-block"),value:r})},N=r(9),T=r(12),L=r.n(T),B=r(133);const A=(e,t,r,o)=>{if(!r)return;const c=Object(B.a)(e);return r.map((r,i)=>{let[s,a={}]=r,l=[];a.children&&a.children.length>0&&(l=A(e,t,a.children,o));const u=c[s];if(!u)return null;const d=t.id||0,p=["layout",s,i,o,d];return Object(n.createElement)(n.Suspense,{key:p.join("_"),fallback:Object(n.createElement)("div",{className:"wc-block-placeholder"})},Object(n.createElement)(u,L()({},a,{children:l,product:t})))})};var M=Object(N.withInstanceId)(e=>{let{product:t={},attributes:r,instanceId:o}=e;const{layoutConfig:c}=r,{parentClassName:i,parentName:s}=Object(j.useInnerBlockLayoutContext)(),a=0===Object.keys(t).length,l=u()(i+"__product","wc-block-layout",{"is-loading":a});return Object(n.createElement)("li",{className:l,"aria-hidden":a},A(s,t,c,o))});r(214);const F=e=>{switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}},I=function(e){let{totalQuery:t,totalProducts:r}=e,{totalQuery:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!Object(a.isEqual)(t,n)&&Number.isFinite(r)};var D=Object(w.a)(e=>{let{attributes:t,currentPage:r,onPageChange:o,onSortChange:c,sortValue:i,scrollToTop:l}=e;const[d,w]=Object(m.b)("attributes",[]),[y,_]=Object(m.b)("stock_status",[]),[x,S]=Object(m.b)("min_price"),[P,N]=Object(m.b)("max_price"),[T]=Object(m.c)((e=>{let{sortValue:t,currentPage:r,attributes:n}=e;const{columns:o,rows:c}=n;return{...F(t),catalog_visibility:"catalog",per_page:o*c,page:r}})({attributes:t,sortValue:i,currentPage:r})),{products:L,totalProducts:B,productsLoading:A}=(e=>{const t={namespace:"/wc/store/v1",resourceName:"products"},{results:r,isLoading:n}=Object(f.a)({...t,query:e}),{value:o}=((e,t)=>{const{namespace:r,resourceName:n,resourceValues:o=[],query:c={}}=t;if(!r||!n)throw new Error("The options object must have valid values for the namespace and the resource name properties.");const i=Object(E.a)(c),s=Object(E.a)(o),{value:a,isLoading:l=!0}=Object(h.useSelect)(e=>{const t=e(g.COLLECTIONS_STORE_KEY),o=["x-wp-total",r,n,i,s];return{value:t.getCollectionHeader(...o),isLoading:t.hasFinishedResolution("getCollectionHeader",o)}},["x-wp-total",r,n,s,i]);return{value:a,isLoading:l}})(0,{...t,query:e});return{products:r,totalProducts:parseInt(o,10),productsLoading:n}})(T),{parentClassName:D,parentName:z}=Object(j.useInnerBlockLayoutContext)(),H=(e=>{const{order:t,orderby:r,page:n,per_page:o,...c}=e;return c||{}})(T),{dispatchStoreEvent:W}=Object(O.a)(),V=Object(b.a)({totalQuery:H,totalProducts:B},I);Object(n.useEffect)(()=>{W("product-list-render",{products:L,listName:z})},[L,z,W]),Object(n.useEffect)(()=>{Object(a.isEqual)(H,null==V?void 0:V.totalQuery)||(o(1),null!=V&&V.totalQuery&&(e=>{Number.isFinite(e)&&(0===e?Object(v.speak)(Object(s.__)("No products found","woo-gutenberg-products-block")):Object(v.speak)(Object(s.sprintf)( +/* translators: %s is an integer higher than 0 (1, 2, 3...) */ +Object(s._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))})(B))},[null==V?void 0:V.totalQuery,B,o,H]);const{contentVisibility:Y}=t,U=t.columns*t.rows,q=!Number.isFinite(B)&&Number.isFinite(null==V?void 0:V.totalProducts)&&Object(a.isEqual)(H,null==V?void 0:V.totalQuery)?Math.ceil(((null==V?void 0:V.totalProducts)||0)/U):Math.ceil(B/U),Q=L.length?L:Array.from({length:U}),G=0!==L.length||A,K=d.length>0||y.length>0||Number.isFinite(x)||Number.isFinite(P);return Object(n.createElement)("div",{className:(()=>{const{columns:e,rows:r,alignButtons:n,align:o}=t,c=void 0!==o?"align"+o:"";return u()(D,c,"has-"+e+"-columns",{"has-multiple-rows":r>1,"has-aligned-buttons":n})})()},(null==Y?void 0:Y.orderBy)&&G&&Object(n.createElement)(R,{onChange:c,value:i}),!G&&K&&Object(n.createElement)(C,{resetCallback:()=>{w([]),_([]),S(null),N(null)}}),!G&&!K&&Object(n.createElement)(k,null),G&&Object(n.createElement)("ul",{className:u()(D+"__products",{"is-loading-products":A})},Q.map((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return Object(n.createElement)(M,{key:e.id||r,attributes:t,product:e})}))),q>1&&Object(n.createElement)(p,{currentPage:r,onPageChange:e=>{l({focusableSelector:"a, button"}),o(e)},totalPages:q}))}),z=e=>{let{attributes:t}=e;const[r,o]=Object(n.useState)(1),[c,i]=Object(n.useState)(t.orderby);return Object(n.useEffect)(()=>{i(t.orderby)},[t.orderby]),Object(n.createElement)(D,{attributes:t,currentPage:r,onPageChange:e=>{o(e)},onSortChange:e=>{var t;const r=null==e||null===(t=e.target)||void 0===t?void 0:t.value;i(r),o(1)},sortValue:c})};const H=Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(n.createElement)("title",null,"Grid Block Preview"),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(n.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(n.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}));var W=r(123);class V extends i.Component{render(){const{attributes:e,urlParameterSuffix:t}=this.props;return e.isPreview?H:Object(n.createElement)(j.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(n.createElement)(o.a,null,Object(n.createElement)(W.a,{context:"wc/all-products"})),Object(n.createElement)(z,{attributes:e,urlParameterSuffix:t}))}}var Y=V;Object(c.a)({selector:".wp-block-woocommerce-all-products",Block:e=>Object(n.createElement)(o.a,{context:"wc/all-products"},Object(n.createElement)(Y,e)),getProps:e=>({attributes:JSON.parse(e.dataset.attributes)})})}]); \ No newline at end of file diff --git a/build/all-products.asset.php b/build/all-products.asset.php new file mode 100644 index 00000000000..c955b3f8875 --- /dev/null +++ b/build/all-products.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '2aa333f4fb9ce4d1d47672df4f52509d'); \ No newline at end of file diff --git a/build/all-products.js b/build/all-products.js new file mode 100644 index 00000000000..59d696ac28b --- /dev/null +++ b/build/all-products.js @@ -0,0 +1,36 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-products"]=function(e){function t(t){for(var r,a,s=t[0],l=t[1],i=t[2],d=0,b=[];dObject(n.sprintf)( +/* translators: Number of items selected from list. */ +Object(n._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(n.__)("Search results updated.","woo-gutenberg-products-block")},s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(o.groupBy)(e,"parent"),r=Object(o.keyBy)(t,"id"),n=["0"],a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=a(r[e.parent]);return[...t,e.name]},s=e=>e.map(e=>{const t=c[e.id];return n.push(""+e.id),{...e,breadcrumbs:a(r[e.parent]),children:t&&t.length?s(t):[]}}),l=s(c[0]||[]);return Object.entries(c).forEach(e=>{let[t,c]=e;n.includes(t)||l.push(...s(c||[]))}),l},l=(e,t,c)=>{if(!t)return c?s(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),o=e.map(e=>!!r.test(e.name)&&e).filter(Boolean);return c?s(o,e):o},i=(e,t)=>{if(!t)return e;const c=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(c).map((e,t)=>c.test(e)?Object(r.createElement)("strong",{key:t},e):Object(r.createElement)(r.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},,,function(e,t){e.exports=window.wp.isShallowEqual},function(e,t,c){"use strict";c.d(t,"o",(function(){return n})),c.d(t,"m",(function(){return a})),c.d(t,"l",(function(){return s})),c.d(t,"n",(function(){return l})),c.d(t,"j",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return d})),c.d(t,"g",(function(){return b})),c.d(t,"k",(function(){return p})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return g})),c.d(t,"h",(function(){return O})),c.d(t,"a",(function(){return j})),c.d(t,"i",(function(){return h})),c.d(t,"b",(function(){return _}));var r,o=c(2);const n=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=n.pluginUrl+"images/",s=n.pluginUrl+"build/",l=n.buildPhase,i=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=o.STORE_PAGES.checkout.id,d=o.STORE_PAGES.checkout.permalink,b=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),m=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),g=o.STORE_PAGES.cart.permalink,O=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),j=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),_=Object(o.getSetting)("allowedStates",{})},,function(e,t,c){"use strict";c.d(t,"h",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"b",(function(){return d})),c.d(t,"i",(function(){return b})),c.d(t,"f",(function(){return p})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return g})),c.d(t,"g",(function(){return O})),c.d(t,"a",(function(){return j}));var r=c(15),o=c(14),n=c.n(o),a=c(7),s=c(2),l=c(23);const i=e=>{let{selected:t=[],search:c="",queryArgs:o={}}=e;const s=(e=>{let{selected:t=[],search:c="",queryArgs:o={}}=e;const n=l.o.productCount>100,a={per_page:n?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},s=[Object(r.addQueryArgs)("/wc/store/v1/products",{...a,...o})];return n&&t.length&&s.push(Object(r.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),s})({selected:t,search:c,queryArgs:o});return Promise.all(s.map(e=>n()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>n()({path:"/wc/store/v1/products/"+e}),d=()=>n()({path:"wc/store/v1/products/attributes"}),b=e=>n()({path:`wc/store/v1/products/attributes/${e}/terms`}),p=e=>{let{selected:t=[],search:c}=e;const o=(e=>{let{selected:t=[],search:c}=e;const o=Object(s.getSetting)("limitTags",!1),n=[Object(r.addQueryArgs)("wc/store/v1/products/tags",{per_page:o?100:0,orderby:o?"count":"name",order:o?"desc":"asc",search:c})];return o&&t.length&&n.push(Object(r.addQueryArgs)("wc/store/v1/products/tags",{include:t})),n})({selected:t,search:c});return Promise.all(o.map(e=>n()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id"))},m=e=>n()({path:Object(r.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),g=e=>n()({path:"wc/store/v1/products/categories/"+e}),O=e=>n()({path:Object(r.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),j=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},function(e,t){e.exports=window.wc.priceFormat},function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return a}));var r=c(1),o=c(13);const n=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},a=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(o.decodeEntities)(e.message):Object(r.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o);t.a=e=>{let t,{label:c,screenReaderLabel:o,wrapperElement:a,wrapperProps:s={}}=e;const l=null!=c,i=null!=o;return!l&&i?(t=a||"span",s={...s,className:n()(s.className,"screen-reader-text")},Object(r.createElement)(t,s,o)):(t=a||r.Fragment,l&&i&&c!==o?Object(r.createElement)(t,s,Object(r.createElement)("span",{"aria-hidden":"true"},c),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,s,c))}},function(e,t){e.exports=window.wc.wcBlocksSharedContext},,,function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(33);t.a=e=>{let{error:t}=e;return Object(r.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:c}=e;return t?"general"===c?Object(r.createElement)("span",null,Object(o.__)("The following error was returned","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(n.escapeHTML)(t))):"api"===c?Object(r.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(n.escapeHTML)(t))):t:Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},function(e,t){e.exports=window.wp.escapeHtml},,function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return o}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return r(e)&&t in e}},function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var r=c(6),o=c.n(r),n=c(0),a=c(19);const s=e=>{let{countLabel:t,className:c,depth:r=0,controlId:s="",item:l,isSelected:i,isSingle:u,onSelect:d,search:b="",...p}=e;const m=null!=t&&void 0!==l.count&&null!==l.count,g=[c,"woocommerce-search-list__item"];g.push("depth-"+r),u&&g.push("is-radio-button"),m&&g.push("has-count");const O=l.breadcrumbs&&l.breadcrumbs.length,j=p.name||"search-list-item-"+s,h=`${j}-${l.id}`;return Object(n.createElement)("label",{htmlFor:h,className:g.join(" ")},u?Object(n.createElement)("input",o()({type:"radio",id:h,name:j,value:l.value,onChange:d(l),checked:i,className:"woocommerce-search-list__item-input"},p)):Object(n.createElement)("input",o()({type:"checkbox",id:h,name:j,value:l.value,onChange:d(l),checked:i,className:"woocommerce-search-list__item-input"},p)),Object(n.createElement)("span",{className:"woocommerce-search-list__item-label"},O?Object(n.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(a.b)(l.breadcrumbs)):null,Object(n.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(a.d)(l.name,b))),!!m&&Object(n.createElement)("span",{className:"woocommerce-search-list__item-count"},t||l.count))};t.b=s},function(e,t,c){"use strict";c.d(t,"c",(function(){return n})),c.d(t,"a",(function(){return l})),c.d(t,"b",(function(){return i})),c.d(t,"d",(function(){return d}));var r=c(35);let o,n;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(o||(o={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(n||(n={}));const a=(e,t)=>Object(r.a)(e)&&"type"in e&&e.type===t,s=e=>a(e,o.SUCCESS),l=e=>a(e,o.ERROR),i=e=>a(e,o.FAIL),u=e=>!Object(r.a)(e)||void 0===e.retry||!0===e.retry,d=()=>({responseTypes:o,noticeContexts:n,shouldRetry:u,isSuccessResponse:s,isErrorResponse:l,isFailResponse:i})},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(126),s=c(4),l=c.n(s);c(131);const i=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:c,currency:r,onValueChange:s,displayType:u="text",...d}=e;const b="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(b))return null;const p=b/10**r.minorUnit;if(!Number.isFinite(p))return null;const m=l()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),g={...d,...i(r),value:void 0,currency:void 0,onValueChange:void 0},O=s?e=>{const t=+e.value*10**r.minorUnit;s(t)}:()=>{};return Object(n.createElement)(a.a,o()({className:m,displayType:u},g,{value:p,onValueChange:O}))}},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return _}));var r=c(7),o=c(0),n=c(17),a=c(9),s=c(13),l=c(237),i=c(59),u=c(236);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(a.dispatch)(n.CART_STORE_KEY).invalidateResolutionForStore()},b=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},p=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.a)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.a)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),b),[])},m={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},g={...m,email:""},O={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:n.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},j=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,c]=e;return[t,Object(s.decodeEntities)(c)]})),h={cartCoupons:n.EMPTY_CART_COUPONS,cartItems:n.EMPTY_CART_ITEMS,cartFees:n.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:n.EMPTY_CART_ITEM_ERRORS,cartTotals:O,cartIsLoading:!0,cartErrors:n.EMPTY_CART_ERRORS,billingAddress:g,shippingAddress:m,shippingRates:n.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:n.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:n.EMPTY_EXTENSIONS},_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:c}=Object(i.b)(),s=null==c?void 0:c.previewCart,{shouldSelect:u}=e,d=Object(o.useRef)();p();const b=Object(a.useSelect)((e,c)=>{let{dispatch:r}=c;if(!u)return h;if(t)return{cartCoupons:s.coupons,cartItems:s.items,cartFees:s.fees,cartItemsCount:s.items_count,cartItemsWeight:s.items_weight,cartNeedsPayment:s.needs_payment,cartNeedsShipping:s.needs_shipping,cartItemErrors:n.EMPTY_CART_ITEM_ERRORS,cartTotals:s.totals,cartIsLoading:!1,cartErrors:n.EMPTY_CART_ERRORS,billingData:g,billingAddress:g,shippingAddress:m,extensions:n.EMPTY_EXTENSIONS,shippingRates:s.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:s.has_calculated_shipping,paymentRequirements:s.paymentRequirements,receiveCart:"function"==typeof(null==s?void 0:s.receiveCart)?s.receiveCart:()=>{}};const o=e(n.CART_STORE_KEY),a=o.getCartData(),i=o.getCartErrors(),d=o.getCartTotals(),b=!o.hasFinishedResolution("getCartData"),p=o.isCustomerDataUpdating(),{receiveCart:O}=r(n.CART_STORE_KEY),_=j(a.billingAddress),E=a.needsShipping?j(a.shippingAddress):_,w=a.fees.length>0?a.fees.map(e=>j(e)):n.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map(e=>({...e,label:e.code})):n.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:w,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:d,cartIsLoading:b,cartErrors:i,billingData:Object(l.a)(_),billingAddress:Object(l.a)(_),shippingAddress:Object(l.a)(E),extensions:a.extensions,shippingRates:a.shippingRates,isLoadingRates:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:O}},[u]);return d.current&&Object(r.isEqual)(d.current,b)||(d.current=b),d.current}},function(e,t){e.exports=window.wc.wcBlocksRegistry},,,function(e,t){e.exports=window.wp.a11y},,,function(e,t){e.exports=window.wp.hooks},function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(0),o=c(22),n=c.n(o);function a(e){const t=Object(r.useRef)(e);return n()(e,t.current)||(t.current=e),t.current}},,function(e,t){e.exports=window.wp.deprecated},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(0);const o=Object(r.createContext)("page"),n=()=>Object(r.useContext)(o);o.Provider},,,,,,function(e,t){e.exports=window.wc.wcBlocksSharedHocs},function(e,t,c){"use strict";c.d(t,"b",(function(){return a})),c.d(t,"a",(function(){return s}));var r=c(0),o=c(9);const n=Object(r.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),a=()=>Object(r.useContext)(n),s=e=>{let{children:t,currentPostId:c=0,currentView:a="",previewData:s={}}=e;const l=Object(o.useSelect)(e=>c||e("core/editor").getCurrentPostId(),[c]),i=Object(r.useCallback)(e=>e in s?s[e]:{},[s]),u={isEditor:!0,currentPostId:l,currentView:a,previewData:s,getPreviewData:i};return Object(r.createElement)(n.Provider,{value:u},t)}},function(e,t){e.exports=window.wp.autop},,,function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(7),a=c(3);t.a=e=>{let{columns:t,rows:c,setAttributes:s,alignButtons:l,minColumns:i=1,maxColumns:u=6,minRows:d=1,maxRows:b=6}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.RangeControl,{label:Object(o.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:e=>{const t=Object(n.clamp)(e,i,u);s({columns:Number.isNaN(t)?"":t})},min:i,max:u}),Object(r.createElement)(a.RangeControl,{label:Object(o.__)("Rows","woo-gutenberg-products-block"),value:c,onChange:e=>{const t=Object(n.clamp)(e,d,b);s({rows:Number.isNaN(t)?"":t})},min:d,max:b}),Object(r.createElement)(a.ToggleControl,{label:Object(o.__)("Align Last Block","woo-gutenberg-products-block"),help:l?Object(o.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(o.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:l,onChange:()=>s({alignButtons:!l})}))}},,,,,function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(130),s=c(4),l=c.n(s),i=c(91);c(153),t.a=e=>{let{className:t,showSpinner:c=!1,children:r,variant:s="contained",...u}=e;const d=l()("wc-block-components-button",t,s,{"wc-block-components-button--loading":c});return Object(n.createElement)(a.a,o()({className:d},u),c&&Object(n.createElement)(i.a,null),Object(n.createElement)("span",{className:"wc-block-components-button__text"},r))}},,,function(e,t){e.exports=window.wp.dom},,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return d})),c.d(t,"b",(function(){return b})),c.d(t,"c",(function(){return p}));var r=c(17),o=c(9),n=c(0),a=c(22),s=c.n(a),l=c(49),i=c(109),u=c(52);const d=e=>{const t=Object(u.a)();e=e||t;const c=Object(o.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:a}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[c,Object(n.useCallback)(t=>{a(e,t)},[e,a])]},b=(e,t,c)=>{const a=Object(u.a)();c=c||a;const s=Object(o.useSelect)(o=>o(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(c,e,t),[c,e]),{setQueryValue:l}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[s,Object(n.useCallback)(t=>{l(c,e,t)},[c,e,l])]},p=(e,t)=>{const c=Object(u.a)();t=t||c;const[r,o]=d(t),a=Object(l.a)(r),b=Object(l.a)(e),p=Object(i.a)(b),m=Object(n.useRef)(!1);return Object(n.useEffect)(()=>{s()(p,b)||(o(Object.assign({},a,b)),m.current=!0)},[a,b,p,o]),m.current?[r,o]:[e,o]}},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(48),o=c(0),n=c(41);const a=()=>{const e=Object(n.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...c,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},,,,function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(36),s=c(3),l=c(4),i=c.n(l);t.a=e=>{let{className:t,item:c,isSelected:r,isLoading:l,onSelect:u,disabled:d,...b}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.a,o()({},b,{key:c.id,className:t,isSelected:r,item:c,onSelect:u,isSingle:!0,disabled:d})),r&&l&&Object(n.createElement)("div",{key:"loading",className:i()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(n.createElement)(s.Spinner,null)))}},,,,,function(e,t){e.exports=window.wp.wordcount},,,function(e,t,c){"use strict";var r=c(2),o=c(1),n=c(159),a=c(100);const s=Object(r.getSetting)("countryLocale",{}),l=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(o.sprintf)( +/* translators: %s Field label. */ +Object(o.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(n.a)(e.priority)&&(t.index=e.priority),Object(a.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},i=Object.entries(s).map(e=>{let[t,c]=e;return[t,Object.entries(c).map(e=>{let[t,c]=e;return[t,l(c)]}).reduce((e,t)=>{let[c,r]=t;return e[c]=r,e},{})]}).reduce((e,t)=>{let[c,r]=t;return e[c]=r,e},{});t.a=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=c&&void 0!==i[c]?i[c]:{};return e.map(e=>({key:e,...r.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},function(e,t,c){"use strict";var r=c(0);c(154),t.a=()=>Object(r.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(38),a=c(4),s=c.n(a),l=c(26);c(152);const i=e=>{let{currency:t,maxPrice:c,minPrice:a,priceClassName:i,priceStyle:u={}}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(o.sprintf)( +/* translators: %1$s min price, %2$s max price */ +Object(o.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(l.formatPrice)(a),Object(l.formatPrice)(c))),Object(r.createElement)("span",{"aria-hidden":!0},Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",i),currency:t,value:a,style:u})," — ",Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",i),currency:t,value:c,style:u})))},u=e=>{let{currency:t,regularPriceClassName:c,regularPriceStyle:a,regularPrice:l,priceClassName:i,priceStyle:u,price:d}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Previous price:","woo-gutenberg-products-block")),Object(r.createElement)(n.a,{currency:t,renderText:e=>Object(r.createElement)("del",{className:s()("wc-block-components-product-price__regular",c),style:a},e),value:l}),Object(r.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Discounted price:","woo-gutenberg-products-block")),Object(r.createElement)(n.a,{currency:t,renderText:e=>Object(r.createElement)("ins",{className:s()("wc-block-components-product-price__value","is-discounted",i),style:u},e),value:d}))};t.a=e=>{let{align:t,className:c,currency:o,format:a="",maxPrice:l,minPrice:d,price:b,priceClassName:p,priceStyle:m,regularPrice:g,regularPriceClassName:O,regularPriceStyle:j}=e;const h=s()(c,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+t]:t});a.includes("")||(a="",console.error("Price formats need to include the `` tag."));const _=g&&b!==g;let E=Object(r.createElement)("span",{className:s()("wc-block-components-product-price__value",p)});return _?E=Object(r.createElement)(u,{currency:o,price:b,priceClassName:p,priceStyle:m,regularPrice:g,regularPriceClassName:O,regularPriceStyle:j}):void 0!==d&&void 0!==l?E=Object(r.createElement)(i,{currency:o,maxPrice:l,minPrice:d,priceClassName:p,priceStyle:m}):b&&(E=Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",p),currency:o,value:b,style:m})),Object(r.createElement)("span",{className:h},Object(r.createInterpolateElement)(a,{price:E}))}},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(1),s=c(7),l=c(36),i=c(97),u=c(10),d=Object(u.createHigherOrderComponent)(e=>{class t extends n.Component{render(){const{selected:t}=this.props,c=null==t;return Array.isArray(t)?Object(n.createElement)(e,this.props):Object(n.createElement)(e,o()({},this.props,{selected:c?[]:[t]}))}}return t.defaultProps={selected:null},t},"withTransformSingleSelectToMultipleSelect"),b=c(176),p=c(24),m=c.n(p),g=c(22),O=c.n(g),j=c(25),h=c(27),_=Object(u.createHigherOrderComponent)(e=>{class t extends n.Component{constructor(){super(...arguments),m()(this,"state",{error:null,loading:!1,variations:{}}),m()(this,"loadVariations",()=>{const{products:e}=this.props,{loading:t,variations:c}=this.state;if(t)return;const r=this.getExpandedProduct();if(!r||c[r])return;const o=e.find(e=>e.id===r);o.variations&&0!==o.variations.length?(this.setState({loading:!0}),Object(j.g)(r).then(e=>{const t=e.map(e=>({...e,parent:r}));this.setState({variations:{...this.state.variations,[r]:t},loading:!1,error:null})}).catch(async e=>{const t=await Object(h.a)(e);this.setState({variations:{...this.state.variations,[r]:null},loading:!1,error:t})})):this.setState({variations:{...this.state.variations,[r]:null},loading:!1,error:null})})}componentDidMount(){const{selected:e,showVariations:t}=this.props;e&&t&&this.loadVariations()}componentDidUpdate(e){const{isLoading:t,selected:c,showVariations:r}=this.props;r&&(!O()(e.selected,c)||e.isLoading&&!t)&&this.loadVariations()}isProductId(e){const{products:t}=this.props;return t.some(t=>t.id===e)}findParentProduct(e){var t;const{products:c}=this.props;return null===(t=c.filter(t=>t.variations&&t.variations.find(t=>{let{id:c}=t;return c===e}))[0])||void 0===t?void 0:t.id}getExpandedProduct(){const{isLoading:e,selected:t,showVariations:c}=this.props;if(!c)return null;let r=t&&t.length?t[0]:null;return r?this.prevSelectedItem=r:this.prevSelectedItem&&(e||this.isProductId(this.prevSelectedItem)||(r=this.prevSelectedItem)),!e&&r?this.isProductId(r)?r:this.findParentProduct(r):null}render(){const{error:t,isLoading:c}=this.props,{error:r,loading:a,variations:s}=this.state;return Object(n.createElement)(e,o()({},this.props,{error:r||t,expandedProduct:this.getExpandedProduct(),isLoading:c,variations:s,variationsLoading:a}))}}return m()(t,"defaultProps",{selected:[],showVariations:!1}),t},"withProductVariations"),E=c(32),w=c(4),f=c.n(w),k=c(82);c(134);const y={list:Object(a.__)("Products","woo-gutenberg-products-block"),noItems:Object(a.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(a.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(a.__)("Product search results updated.","woo-gutenberg-products-block")},v=e=>{let{expandedProduct:t,error:c,instanceId:r,isCompact:u,isLoading:d,onChange:b,onSearch:p,products:m,renderItem:g,selected:O,showVariations:j,variations:h,variationsLoading:_}=e;if(c)return Object(n.createElement)(E.a,{error:c});const w=[...m,...h&&h[t]?h[t]:[]];return Object(n.createElement)(i.a,{className:"woocommerce-products",list:w,isCompact:u,isLoading:d,isSingle:!0,selected:w.filter(e=>{let{id:t}=e;return O.includes(t)}),onChange:b,renderItem:g||(j?e=>{const{item:t,search:c,depth:i=0,isSelected:u,onSelect:b}=e,p=t.variations&&Array.isArray(t.variations)?t.variations.length:0,m=f()("woocommerce-search-product__item","woocommerce-search-list__item","depth-"+i,"has-count",{"is-searching":c.length>0,"is-skip-level":0===i&&0!==t.parent,"is-variable":p>0});if(!t.breadcrumbs.length)return Object(n.createElement)(k.a,o()({},e,{className:f()(m,{"is-selected":u}),isSelected:u,item:t,onSelect:()=>()=>{b(t)()},isLoading:d||_,countLabel:t.variations.length>0?Object(a.sprintf)( +/* translators: %1$d is the number of variations of a product product. */ +Object(a.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-"+r,"aria-label":Object(a.sprintf)( +/* translators: %1$s is the product name, %2$d is the number of variations of that product. */ +Object(a._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,"woo-gutenberg-products-block"),t.name,t.variations.length)}));const g=Object(s.isEmpty)(t.variation)?e:{...e,item:{...e.item,name:t.variation},"aria-label":`${t.breadcrumbs[0]}: ${t.variation}`};return Object(n.createElement)(l.a,o()({},g,{className:m,name:"variations-"+r}))}:null),onSearch:p,messages:y,isHierarchical:!0})};v.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=d(Object(b.a)(_(Object(u.withInstanceId)(v))))},function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return s}));var r=c(7);let o;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(o||(o={}));const n={addEventCallback:function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(r.uniqueId)(),type:o.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:c}},removeEventCallback:(e,t)=>({id:t,type:o.REMOVE_EVENT_CALLBACK,eventType:e})},a={},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,{type:t,eventType:c,id:r,callback:n,priority:s}=arguments.length>1?arguments[1]:void 0;const l=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(t){case o.ADD_EVENT_CALLBACK:return l.set(r,{priority:s,callback:n}),{...e,[c]:l};case o.REMOVE_EVENT_CALLBACK:return l.delete(r),{...e,[c]:l}}}},function(e,t,c){"use strict";c.d(t,"c",(function(){return n})),c.d(t,"a",(function(){return a})),c.d(t,"b",(function(){return s}));var r=c(8),o=c(23);const n=(e,t)=>{if(o.n>2)return Object(r.registerBlockType)(e,t)},a=()=>o.n>2,s=()=>o.n>1},,function(e,t,c){"use strict";c.d(t,"a",(function(){return k}));var r=c(6),o=c.n(r),n=c(0),a=c(1),s=c(3),l=c(113),i=c(498),u=c(4),d=c.n(u),b=c(10),p=c(19),m=c(36),g=c(497),O=c(13);const j=e=>{let{id:t,label:c,popoverContents:r,remove:o,screenReaderLabel:i,className:u=""}=e;const[p,m]=Object(n.useState)(!1),h=Object(b.useInstanceId)(j);if(i=i||c,!c)return null;c=Object(O.decodeEntities)(c);const _=d()("woocommerce-tag",u,{"has-remove":!!o}),E="woocommerce-tag__label-"+h,w=Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"screen-reader-text"},i),Object(n.createElement)("span",{"aria-hidden":"true"},c));return Object(n.createElement)("span",{className:_},r?Object(n.createElement)(s.Button,{className:"woocommerce-tag__text",id:E,onClick:()=>m(!0)},w):Object(n.createElement)("span",{className:"woocommerce-tag__text",id:E},w),r&&p&&Object(n.createElement)(s.Popover,{onClose:()=>m(!1)},r),o&&Object(n.createElement)(s.Button,{className:"woocommerce-tag__remove",onClick:o(t),label:Object(a.sprintf)(// Translators: %s label. +Object(a.__)("Remove %s","woo-gutenberg-products-block"),c),"aria-describedby":E},Object(n.createElement)(l.a,{icon:g.a,size:20,className:"clear-icon"})))};var h=j;const _=e=>Object(n.createElement)(m.b,e),E=e=>{const{list:t,selected:c,renderItem:r,depth:a=0,onSelect:s,instanceId:l,isSingle:i,search:u}=e;return t?Object(n.createElement)(n.Fragment,null,t.map(t=>{const d=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(n.createElement)(n.Fragment,{key:t.id},Object(n.createElement)("li",null,r({item:t,isSelected:d,onSelect:s,isSingle:i,search:u,depth:a,controlId:l})),Object(n.createElement)(E,o()({},e,{list:t.children,depth:a+1})))})):null},w=e=>{let{isLoading:t,isSingle:c,selected:r,messages:o,onChange:l,onRemove:i}=e;if(t||c||!r)return null;const u=r.length;return Object(n.createElement)("div",{className:"woocommerce-search-list__selected"},Object(n.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(n.createElement)("strong",null,o.selected(u)),u>0?Object(n.createElement)(s.Button,{isLink:!0,isDestructive:!0,onClick:()=>l([]),"aria-label":o.clear},Object(a.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(n.createElement)("ul",null,r.map((e,t)=>Object(n.createElement)("li",{key:t},Object(n.createElement)(h,{label:e.name,id:e.id,remove:i})))):null)},f=e=>{let{filteredList:t,search:c,onSelect:r,instanceId:o,...s}=e;const{messages:u,renderItem:d,selected:b,isSingle:p}=s,m=d||_;return 0===t.length?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(n.createElement)(l.a,{icon:i.a})),Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(a.sprintf)(u.noResults,c):u.noItems)):Object(n.createElement)("ul",{className:"woocommerce-search-list__list"},Object(n.createElement)(E,{list:t,selected:b,renderItem:m,onSelect:r,instanceId:o,isSingle:p,search:c}))},k=e=>{const{className:t="",isCompact:c,isHierarchical:r,isLoading:a,isSingle:l,list:i,messages:u=p.a,onChange:m,onSearch:g,selected:O,debouncedSpeak:j}=e,[h,_]=Object(n.useState)(""),E=Object(b.useInstanceId)(k),y=Object(n.useMemo)(()=>({...p.a,...u}),[u]),v=Object(n.useMemo)(()=>Object(p.c)(i,h,r),[i,h,r]);Object(n.useEffect)(()=>{j&&j(y.updated)},[j,y]),Object(n.useEffect)(()=>{"function"==typeof g&&g(h)},[h,g]);const S=Object(n.useCallback)(e=>()=>{l&&m([]);const t=O.findIndex(t=>{let{id:c}=t;return c===e});m([...O.slice(0,t),...O.slice(t+1)])},[l,O,m]),C=Object(n.useCallback)(e=>()=>{-1===O.findIndex(t=>{let{id:c}=t;return c===e.id})?m(l?[e]:[...O,e]):S(e.id)()},[l,S,m,O]);return Object(n.createElement)("div",{className:d()("woocommerce-search-list",t,{"is-compact":c})},Object(n.createElement)(w,o()({},e,{onRemove:S,messages:y})),Object(n.createElement)("div",{className:"woocommerce-search-list__search"},Object(n.createElement)(s.TextControl,{label:y.search,type:"search",value:h,onChange:e=>_(e)})),a?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(n.createElement)(s.Spinner,null)):Object(n.createElement)(f,o()({},e,{search:h,filteredList:v,messages:y,onSelect:C,instanceId:E})))};Object(s.withSpokenMessages)(k)},,function(e,t,c){"use strict";var r=c(0),o=c(7),n=c(1),a=c(3),s=c(11);function l(e){let{level:t}=e;const c={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return c.hasOwnProperty(t)?Object(r.createElement)(s.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(s.Path,{d:c[t]})):null}class i extends r.Component{createLevelControl(e,t,c){const o=e===t;return{icon:Object(r.createElement)(l,{level:e}),title:Object(n.sprintf)( +/* translators: %s: heading level e.g: "2", "3", "4" */ +Object(n.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:o,onClick:()=>c(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:c,selectedLevel:n,onChange:s}=this.props;return Object(r.createElement)(a.ToolbarGroup,{isCollapsed:e,icon:Object(r.createElement)(l,{level:n}),controls:Object(o.range)(t,c).map(e=>this.createLevelControl(e,n,s))})}}t.a=i},function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r=e=>"string"==typeof e},function(e,t){e.exports=window.wp.warning},function(e,t,c){"use strict";c.d(t,"b",(function(){return l})),c.d(t,"a",(function(){return i}));var r=c(0),o=c(7),n=c(22),a=c.n(n);const s=Object(r.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),l=()=>Object(r.useContext)(s),i=e=>{let{children:t}=e;const[c,n]=Object(r.useState)({}),l=Object(r.useCallback)(e=>c[e],[c]),i=Object(r.useCallback)(e=>{const t=c[e];return!t||t.hidden?"":"validate-error-"+e},[c]),u=Object(r.useCallback)(e=>{n(t=>{if(!t[e])return t;const{[e]:c,...r}=t;return r})},[]),d=Object(r.useCallback)(()=>{n({})},[]),b=Object(r.useCallback)(e=>{e&&n(t=>(e=Object(o.pickBy)(e,(e,c)=>!("string"!=typeof e.message||t.hasOwnProperty(c)&&a()(t[c],e))),0===Object.values(e).length?t:{...t,...e}))},[]),p=Object(r.useCallback)((e,t)=>{n(c=>{if(!c.hasOwnProperty(e))return c;const r={...c[e],...t};return a()(c[e],r)?c:{...c,[e]:r}})},[]),m={getValidationError:l,setValidationErrors:b,clearValidationError:u,clearAllValidationErrors:d,hideValidationError:Object(r.useCallback)(e=>{p(e,{hidden:!0})},[p]),showValidationError:Object(r.useCallback)(e=>{p(e,{hidden:!1})},[p]),showAllValidationErrors:Object(r.useCallback)(()=>{n(e=>{const t={};return Object.keys(e).forEach(c=>{e[c].hidden&&(t[c]={...e[c],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:i};return Object(r.createElement)(s.Provider,{value:m},t)}},function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(113),a=c(235),s=c(2),l=c(5),i=c(29);t.a=e=>{const t=(Object(i.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(r.createElement)(l.InspectorControls,null,Object(r.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(r.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(r.createElement)("a",{href:`${s.ADMIN_URL}post.php?post=${t}&action=edit`,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Edit this product's details","woo-gutenberg-products-block"),Object(r.createElement)(n.a,{icon:a.a,size:16}))),Object(r.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(o.__)("Edit details such as title, price, description and more.","woo-gutenberg-products-block")))):null}},,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(12);function o(e,t){const c=Object(r.useRef)();return Object(r.useEffect)(()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)},[e,t]),c.current}},,,,,,function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(13),s=c(4),l=c.n(s);c(151),t.a=e=>{let{className:t="",disabled:c=!1,name:r,permalink:s="",target:i,rel:u,style:d,onClick:b,...p}=e;const m=l()("wc-block-components-product-name",t);if(c){const e=p;return Object(n.createElement)("span",o()({className:m},e,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(r)}}))}return Object(n.createElement)("a",o()({className:m,href:s,target:i},p,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(r)},style:d}))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(9);const o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const c=Object(r.select)("core/notices").getNotices(),{removeNotice:o}=Object(r.dispatch)("core/notices"),n=c.filter(t=>t.status===e);n.forEach(e=>o(e.id,t))}},function(e,t,c){"use strict";var r=c(0),o=c(87),n=c(60);const a=e=>{const t=e.indexOf("

");return-1===t?e:e.substr(0,t+4)},s=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),l=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,i=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…";const r=s(e),o=r.split(" ").splice(0,t).join(" ");return Object(n.autop)(l(o,c))},u=function(e,t){let c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…";const o=s(e),a=o.slice(0,t);if(c)return Object(n.autop)(l(a,r));const i=a.match(/([\s]+)/g),u=i?i.length:0,d=o.slice(0,t+u);return Object(n.autop)(l(d,r))};t.a=e=>{let{source:t,maxLength:c=15,countType:s="words",className:l="",style:d={}}=e;const b=Object(r.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const r=Object(n.autop)(e),s=Object(o.count)(r,c);if(s<=t)return r;const l=a(r),d=Object(o.count)(l,c);return d<=t?l:"words"===c?i(l,t):u(l,t,"characters_including_spaces"===c)}(t,c,s),[t,c,s]);return Object(r.createElement)(r.RawHTML,{style:d,className:l},b)}},,function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o),a=c(28),s=c(10);c(157),t.a=Object(s.withInstanceId)(e=>{let{className:t,instanceId:c,label:o="",onChange:s,options:l,screenReaderLabel:i,value:u=""}=e;const d="wc-block-components-sort-select__select-"+c;return Object(r.createElement)("div",{className:n()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(r.createElement)(a.a,{label:o,screenReaderLabel:i,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(r.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:s,value:u},l&&l.map(e=>Object(r.createElement)("option",{key:e.key,value:e.key},e.label))))})},,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(5);const o=()=>"function"==typeof r.__experimentalGetSpacingClassesAndStyles},,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(35),o=c(150);const n=e=>{const t=Object(r.a)(e)?e:{},c=Object(o.a)(t.style),n=Object(r.a)(c.typography)?c.typography:{};return{style:{fontSize:t.fontSize?`var(--wp--preset--font-size--${t.fontSize})`:n.fontSize,lineHeight:n.lineHeight,fontWeight:n.fontWeight,textTransform:n.textTransform,fontFamily:t.fontFamily}}}},function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(0);const o=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var r=c(17),o=c(9),n=c(0),a=c(49),s=c(124);const l=e=>{const{namespace:t,resourceName:c,resourceValues:l=[],query:i={},shouldSelect:u=!0}=e;if(!t||!c)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(n.useRef)({results:[],isLoading:!0}),b=Object(a.a)(i),p=Object(a.a)(l),m=Object(s.a)(),g=Object(o.useSelect)(e=>{if(!u)return null;const o=e(r.COLLECTIONS_STORE_KEY),n=[t,c,b,p],a=o.getCollectionError(...n);if(a){if(!(a instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(a)}return{results:o.getCollection(...n),isLoading:!o.hasFinishedResolution("getCollection",n)}},[t,c,p,b,u]);return null!==g&&(d.current=g),d.current}},,,,,,function(e,t){},,,function(e,t){},,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var r=c(5),o=c(95),n=c(35),a=c(150);const s=e=>{if(!Object(o.b)())return{className:"",style:{}};const t=Object(n.a)(e)?e:{},c=Object(a.a)(t.style);return Object(r.__experimentalUseColorProps)({...t,style:c})}},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(0);const o=Object(r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(r.createElement)("title",null,"Grid Block Preview"),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(3),s=c(4),l=c.n(s);c(177),t.a=function(e){let{className:t="",...c}=e;const r=l()("wc-block-text-toolbar-button",t);return Object(n.createElement)(a.Button,o()({className:r},c))}},,,function(e,t,c){"use strict";c.d(t,"b",(function(){return n})),c.d(t,"a",(function(){return a}));var r=c(0);const o=Object(r.createContext)({setIsSuppressed:e=>{},isSuppressed:!1}),n=()=>Object(r.useContext)(o),a=e=>{let{children:t}=e;const[c,n]=Object(r.useState)(!1),a={setIsSuppressed:n,isSuppressed:c};return Object(r.createElement)(o.Provider,{value:a},t)}},,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(100),o=c(35);const n=e=>Object(r.a)(e)?JSON.parse(e)||{}:Object(o.a)(e)?e:{}},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,function(e,t){},,function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r=e=>"number"==typeof e},,,,,,,,,,,,,,function(e,t){},,,function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(23),s=c(25),l=c(112),i=c(27);t.a=e=>t=>{let{selected:c,...r}=t;const[u,d]=Object(n.useState)(!0),[b,p]=Object(n.useState)(null),[m,g]=Object(n.useState)([]),O=a.o.productCount>100,j=async e=>{const t=await Object(i.a)(e);p(t),d(!1)},h=Object(n.useRef)(c);Object(n.useEffect)(()=>{Object(s.h)({selected:h.current}).then(e=>{g(e),d(!1)}).catch(j)},[h]);const _=Object(l.a)(e=>{Object(s.h)({selected:c,search:e}).then(e=>{g(e),d(!1)}).catch(j)},400),E=Object(n.useCallback)(e=>{d(!0),_(e)},[d,_]);return Object(n.createElement)(e,o()({},r,{selected:c,error:b,products:m,isLoading:u,onSearch:O?E:null}))}},function(e,t){},,,,,function(e,t){},,,,,,,,,,,,,,,,,,,,function(e){e.exports=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":1,"textdomain":"woo-gutenberg-products-block","name":"woocommerce/all-products","title":"All Products","category":"woocommerce","keywords":["WooCommerce"],"description":"Display products from your store in a grid layout.","supports":{"align":["wide","full"],"html":false,"multiple":false},"example":{"attributes":{"isPreview":true}},"attributes":{"columns":{"type":"number"},"rows":{"type":"number"},"alignButtons":{"type":"boolean"},"contentVisibility":{"type":"object"},"orderby":{"type":"string"},"layoutConfig":{"type":"array"},"isPreview":{"type":"boolean","default":false}}}')},,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var r=c(5),o=c(95),n=c(35),a=c(121),s=c(150);const l=e=>{if(!Object(o.b)()||!Object(a.a)())return{style:{}};const t=Object(n.a)(e)?e:{},c=Object(s.a)(t.style);return Object(r.__experimentalGetSpacingClassesAndStyles)({...t,style:c})}},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(28),l=c(29),i=c(219),u=c(138),d=c(123),b=c(215),p=c(58);c(330),t.default=Object(p.withProductDataContext)(e=>{const{className:t,align:c}=e,{parentClassName:n}=Object(l.useInnerBlockLayoutContext)(),{product:p}=Object(l.useProductDataContext)(),m=Object(i.a)(e),g=Object(u.a)(e),O=Object(d.a)(e),j=Object(b.a)(e);if(!p.id||!p.on_sale)return null;const h="string"==typeof c?"wc-block-components-product-sale-badge--align-"+c:"";return Object(r.createElement)("div",{className:a()("wc-block-components-product-sale-badge",t,h,{[n+"__product-onsale"]:n},g.className,m.className),style:{...g.style,...m.style,...O.style,...j.style}},Object(r.createElement)(s.a,{label:Object(o.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(o.__)("Product on sale","woo-gutenberg-products-block")}))})},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var r=c(5),o=c(95),n=c(35),a=c(150);const s=e=>{if(!Object(o.b)())return{className:"",style:{}};const t=Object(n.a)(e)?e:{},c=Object(a.a)(t.style);return Object(r.__experimentalUseBorderProps)({...t,style:c})}},,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(0),o=c(102);c(173);const n=e=>{let{errorMessage:t="",propertyName:c="",elementId:n=""}=e;const{getValidationError:a,getValidationErrorId:s}=Object(o.b)();if(!t||"string"!=typeof t){const e=a(c)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(r.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(r.createElement)("p",{id:s(n)},t))}},,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return b}));var r=c(6),o=c.n(r),n=c(0),a=c(4),s=c.n(a),l=c(283),i=c(9),u=(c(182),c(145));const d=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""},b=e=>{let{className:t,context:c="default",additionalNotices:r=[]}=e;const{isSuppressed:a}=Object(u.b)(),{notices:b}=Object(i.useSelect)(e=>({notices:e("core/notices").getNotices(c)})),{removeNotice:p}=Object(i.useDispatch)("core/notices"),m=b.filter(e=>"snackbar"!==e.type).concat(r);if(!m.length)return null;const g=s()(t,"wc-block-components-notices");return a?null:Object(n.createElement)("div",{className:g},m.map(e=>Object(n.createElement)(l.a,o()({key:"store-notice-"+e.id},e,{className:s()("wc-block-components-notices__notice",d(e)),onRemove:()=>{e.isDismissible&&p(e.id,c)}}),e.content)))}},,,,,,,,function(e,t,c){"use strict";c.d(t,"c",(function(){return a})),c.d(t,"b",(function(){return s})),c.d(t,"a",(function(){return l}));const r=window.CustomEvent||null,o=(e,t)=>{let{bubbles:c=!1,cancelable:o=!1,element:n,detail:a={}}=t;if(!r)return;n||(n=document.body);const s=new r(e,{bubbles:c,cancelable:o,detail:a});n.dispatchEvent(s)};let n;const a=()=>{n&&clearTimeout(n),n=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},s=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},l=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const n=()=>{o(t,{bubbles:c,cancelable:r})};return jQuery(document).on(e,n),()=>jQuery(document).off(e,n)}},function(e,t,c){"use strict";c.d(t,"b",(function(){return n})),c.d(t,"a",(function(){return a}));var r=c(90),o=(c(15),c(2));const n=(e,t)=>Object.keys(o.defaultAddressFields).every(c=>e[c]===t[c]),a=e=>{const t=Object.keys(o.defaultAddressFields),c=Object(r.a)(t,{},e.country),n=Object.assign({},e);return c.forEach(t=>{let{key:c="",hidden:r=!1}=t;r&&((e,t)=>e in t)(c,e)&&(n[c]="")}),n}},function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(94);const o=(e,t)=>function(c){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const n=r.a.addEventCallback(e,c,o);return t(n),()=>{t(r.a.removeEventCallback(e,n.id))}}},function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return a}));const r=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var o=c(37);const n=async(e,t,c)=>{const o=r(e,t),n=[];for(const e of o)try{const t=await Promise.resolve(e.callback(c));"object"==typeof t&&n.push(t)}catch(e){console.error(e)}return!n.length||n},a=async(e,t,c)=>{const n=[],a=r(e,t);for(const e of a)try{const t=await Promise.resolve(e.callback(c));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(o.a)(t)||Object(o.b)(t))return n.push(t),n;n.push(t)}catch(e){return console.error(e),n.push({type:"error"}),n}return n}},,,,,function(e,t,c){"use strict";var r=c(0),o=c(11);const n=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));t.a=n},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t,c){"use strict";var r=c(95);let o={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},linkTarget:{type:"string"},productId:{type:"number",default:0}};Object(r.b)()&&(o={...o,align:{type:"string"}}),t.a=o},function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o),a=c(29),s=c(95),l=c(58),i=c(115),u=c(78),d=c(138),b=c(215),p=c(123);c(331);const m=e=>{let{children:t,headingLevel:c,elementType:o="h"+c,...n}=e;return Object(r.createElement)(o,n,t)};t.a=Object(l.withProductDataContext)(e=>{const{className:t,headingLevel:c=2,showProductLink:o=!0,linkTarget:l,align:g}=e,{parentClassName:O}=Object(a.useInnerBlockLayoutContext)(),{product:j}=Object(a.useProductDataContext)(),{dispatchStoreEvent:h}=Object(u.a)(),_=Object(d.a)(e),E=Object(b.a)(e),w=Object(p.a)(e);return j.id?Object(r.createElement)(m,{headingLevel:c,className:n()(t,_.className,"wc-block-components-product-title",{[O+"__product-title"]:O,["wc-block-components-product-title--align-"+g]:g&&Object(s.b)()}),style:Object(s.b)()?{...E.style,...w.style,..._.style}:{}},Object(r.createElement)(i.a,{disabled:!o,name:j.name,permalink:j.permalink,target:l,onClick:()=>{h("product-view-link",{product:j})}})):Object(r.createElement)(m,{headingLevel:c,className:n()(t,_.className,"wc-block-components-product-title",{[O+"__product-title"]:O,["wc-block-components-product-title--align-"+g]:g&&Object(s.b)()}),style:Object(s.b)()?{...E.style,...w.style,..._.style}:{}})})},function(e,t,c){"use strict";t.a={showProductLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}}},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(1),s=c(4),l=c.n(s),i=c(2),u=c(29),d=c(123),b=c(219),p=c(215),m=c(58),g=c(78),O=c(216);c(332);const j=()=>Object(n.createElement)("img",{src:i.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500}),h=e=>{let{image:t,onLoad:c,loaded:r,showFullSize:a,fallbackAlt:s}=e;const{thumbnail:l,src:i,srcset:u,sizes:d,alt:b}=t||{},p={alt:b||s,onLoad:c,hidden:!r,src:l,...a&&{src:i,srcSet:u,sizes:d}};return Object(n.createElement)(n.Fragment,null,p.src&&Object(n.createElement)("img",o()({"data-testid":"product-image"},p)),!r&&Object(n.createElement)(j,null))};t.a=Object(m.withProductDataContext)(e=>{const{className:t,imageSizing:c="full-size",showProductLink:r=!0,showSaleBadge:o,saleBadgeAlign:s="right"}=e,{parentClassName:i}=Object(u.useInnerBlockLayoutContext)(),{product:m}=Object(u.useProductDataContext)(),[_,E]=Object(n.useState)(!1),{dispatchStoreEvent:w}=Object(g.a)(),f=Object(d.a)(e),k=Object(b.a)(e),y=Object(p.a)(e);if(!m.id)return Object(n.createElement)("div",{className:l()(t,"wc-block-components-product-image",{[i+"__product-image"]:i},k.className),style:{...f.style,...k.style,...y.style}},Object(n.createElement)(j,null));const v=!!m.images.length,S=v?m.images[0]:null,C=r?"a":n.Fragment,x=Object(a.sprintf)( +/* translators: %s is referring to the product name */ +Object(a.__)("Link to %s","woo-gutenberg-products-block"),m.name),N={href:m.permalink,...!v&&{"aria-label":x},onClick:()=>{w("product-view-link",{product:m})}};return Object(n.createElement)("div",{className:l()(t,"wc-block-components-product-image",{[i+"__product-image"]:i},k.className),style:{...f.style,...k.style,...y.style}},Object(n.createElement)(C,r&&N,!!o&&Object(n.createElement)(O.default,{align:s,product:m}),Object(n.createElement)(h,{fallbackAlt:m.name,image:S,onLoad:()=>E(!0),loaded:_,showFullSize:"cropped"!==c})))})},function(e,t,c){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o),a=c(1),s=c(49),l=c(490),i=c(9);const u={PRISTINE:"pristine",IDLE:"idle",DISABLED:"disabled",PROCESSING:"processing",BEFORE_PROCESSING:"before_processing",AFTER_PROCESSING:"after_processing"},d={status:u.PRISTINE,hasError:!1,quantity:0,processingResponse:null,requestParams:{}},b={SET_PRISTINE:"set_pristine",SET_IDLE:"set_idle",SET_DISABLED:"set_disabled",SET_PROCESSING:"set_processing",SET_BEFORE_PROCESSING:"set_before_processing",SET_AFTER_PROCESSING:"set_after_processing",SET_PROCESSING_RESPONSE:"set_processing_response",SET_HAS_ERROR:"set_has_error",SET_NO_ERROR:"set_no_error",SET_QUANTITY:"set_quantity",SET_REQUEST_PARAMS:"set_request_params"},{SET_PRISTINE:p,SET_IDLE:m,SET_DISABLED:g,SET_PROCESSING:O,SET_BEFORE_PROCESSING:j,SET_AFTER_PROCESSING:h,SET_PROCESSING_RESPONSE:_,SET_HAS_ERROR:E,SET_NO_ERROR:w,SET_QUANTITY:f,SET_REQUEST_PARAMS:k}=b,y=()=>({type:m}),v=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e?E:w;return{type:t}},{SET_PRISTINE:S,SET_IDLE:C,SET_DISABLED:x,SET_PROCESSING:N,SET_BEFORE_PROCESSING:P,SET_AFTER_PROCESSING:T,SET_PROCESSING_RESPONSE:R,SET_HAS_ERROR:I,SET_NO_ERROR:A,SET_QUANTITY:B,SET_REQUEST_PARAMS:L}=b,{PRISTINE:D,IDLE:V,DISABLED:F,PROCESSING:M,BEFORE_PROCESSING:z,AFTER_PROCESSING:H}=u,q=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,{quantity:c,type:r,data:o}=arguments.length>1?arguments[1]:void 0;switch(r){case S:e=d;break;case C:e=t.status!==V?{...t,status:V}:t;break;case x:e=t.status!==F?{...t,status:F}:t;break;case B:e=c!==t.quantity?{...t,quantity:c}:t;break;case L:e={...t,requestParams:{...t.requestParams,...o}};break;case R:e={...t,processingResponse:o};break;case N:e=t.status!==M?{...t,status:M,hasError:!1}:t,e=!1===e.hasError?e:{...e,hasError:!1};break;case P:e=t.status!==z?{...t,status:z,hasError:!1}:t;break;case T:e=t.status!==H?{...t,status:H}:t;break;case I:e=t.hasError?t:{...t,hasError:!0},e=t.status===M||t.status===z?{...e,status:V}:e;break;case A:e=t.hasError?{...t,hasError:!1}:t}return e!==t&&r!==S&&e.status===D&&(e.status=V),e};var G=c(94),Q=c(238);const Y=e=>({onAddToCartAfterProcessingWithSuccess:Object(Q.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(Q.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(Q.a)("add_to_cart_before_processing",e)});var U=c(239),W=c(102),$=c(37),K=c(116);const J=Object(r.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:e=>{},onAddToCartAfterProcessingWithError:e=>{},onAddToCartBeforeProcessing:e=>{}},dispatchActions:{resetForm:()=>{},submitForm:()=>{},setQuantity:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},setRequestParams:e=>{}}}),X=()=>Object(r.useContext)(J),Z=e=>{var t,c,o,n;let{children:b,product:m,showFormElements:E}=e;const[w,S]=Object(r.useReducer)(q,d),[C,x]=Object(r.useReducer)(G.b,{}),N=Object(s.a)(C),{createErrorNotice:P}=Object(i.useDispatch)("core/notices"),{setValidationErrors:T}=Object(W.b)(),{isSuccessResponse:R,isErrorResponse:I,isFailResponse:A}=Object($.d)(),B=Object(r.useMemo)(()=>({onAddToCartAfterProcessingWithSuccess:Y(x).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:Y(x).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:Y(x).onAddToCartBeforeProcessing}),[x]),L=Object(r.useMemo)(()=>({resetForm:()=>{S({type:p})},submitForm:()=>{S({type:j})},setQuantity:e=>{S((e=>({type:f,quantity:e}))(e))},setHasError:e=>{S(v(e))},setRequestParams:e=>{S((e=>({type:k,data:e}))(e))},setAfterProcessing:e=>{S({type:_,data:e}),S({type:h})}}),[]);Object(r.useEffect)(()=>{const e=w.status,t=!m.id||!Object(l.a)(m);e!==u.DISABLED||t?e!==u.DISABLED&&t&&S({type:g}):S(y())},[w.status,m,S]),Object(r.useEffect)(()=>{w.status===u.BEFORE_PROCESSING&&(Object(K.a)("error","wc/add-to-cart"),Object(U.a)(N,"add_to_cart_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:c}=e;t&&P(t,{context:"wc/add-to-cart"}),c&&T(c)}),S(y())):S({type:O})}))},[w.status,T,P,S,N,null==m?void 0:m.id]),Object(r.useEffect)(()=>{if(w.status===u.AFTER_PROCESSING){const e={processingResponse:w.processingResponse},t=e=>{let t=!1;return e.forEach(e=>{const{message:c,messageContext:r}=e;(I(e)||A(e))&&c&&(t=!0,P(c,r?{context:r}:void 0))}),t};if(w.hasError)return void Object(U.b)(N,"add_to_cart_after_processing_with_error",e).then(c=>{if(!t(c)){var r;const t=(null===(r=e.processingResponse)||void 0===r?void 0:r.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");P(t,{id:"add-to-cart",context:"woocommerce/single-product/"+((null==m?void 0:m.id)||0)})}S(y())});Object(U.b)(N,"add_to_cart_after_processing_with_success",e).then(e=>{t(e)?S(v(!0)):S(y())})}},[w.status,w.hasError,w.processingResponse,L,P,I,A,R,N,null==m?void 0:m.id]);const D=Object(l.b)(m),V={product:m,productType:m.type||"simple",productIsPurchasable:Object(l.a)(m),productHasOptions:m.has_options||!1,supportsFormElements:D,showFormElements:E&&D,quantity:w.quantity||(null==m||null===(t=m.add_to_cart)||void 0===t?void 0:t.minimum)||1,minQuantity:(null==m||null===(c=m.add_to_cart)||void 0===c?void 0:c.minimum)||1,maxQuantity:(null==m||null===(o=m.add_to_cart)||void 0===o?void 0:o.maximum)||99,multipleOf:(null==m||null===(n=m.add_to_cart)||void 0===n?void 0:n.multiple_of)||1,requestParams:w.requestParams,isIdle:w.status===u.IDLE,isDisabled:w.status===u.DISABLED,isProcessing:w.status===u.PROCESSING,isBeforeProcessing:w.status===u.BEFORE_PROCESSING,isAfterProcessing:w.status===u.AFTER_PROCESSING,hasError:w.hasError,eventRegistration:B,dispatchActions:L};return Object(r.createElement)(J.Provider,{value:V},b)};var ee=c(14),te=c.n(ee),ce=c(13),re=c(236),oe=c(41),ne=()=>{const{dispatchActions:e,product:t,quantity:c,eventRegistration:o,hasError:n,isProcessing:s,requestParams:l}=X(),{hasValidationErrors:u,showAllValidationErrors:d}=Object(W.b)(),{createErrorNotice:b,removeNotice:p}=Object(i.useDispatch)("core/notices"),{receiveCart:m}=Object(oe.a)(),[g,O]=Object(r.useState)(!1),j=!n&&s,h=Object(r.useCallback)(()=>!u||(d(),{type:"error"}),[u,d]);Object(r.useEffect)(()=>{const e=o.onAddToCartBeforeProcessing(h,0);return()=>{e()}},[o,h]);const _=Object(r.useCallback)(()=>{O(!0),p("add-to-cart","woocommerce/single-product/"+((null==t?void 0:t.id)||0));const r={id:t.id||0,quantity:c,...l};te()({path:"/wc/store/v1/cart/add-item",method:"POST",data:r,cache:"no-store",parse:!1}).then(c=>{te.a.setNonce(c.headers),c.json().then((function(r){c.ok?m(r):(r.body&&r.body.message?b(Object(ce.decodeEntities)(r.body.message),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}):b(Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}),e.setHasError()),Object(re.b)({preserveCartData:!0}),e.setAfterProcessing(r),O(!1)}))}).catch(t=>{t.json().then((function(t){var c;null!==(c=t.data)&&void 0!==c&&c.cart&&m(t.data.cart),e.setHasError(),e.setAfterProcessing(t),O(!1)}))})},[t,b,p,m,e,c,l]);return Object(r.useEffect)(()=>{j&&!g&&_()},[j,_,g]),null};const ae=e=>{let{children:t,product:c,showFormElements:o}=e;return Object(r.createElement)(W.a,null,Object(r.createElement)(Z,{product:c,showFormElements:o},t,Object(r.createElement)(ne,null)))};var se=c(29),le=c(7),ie=c(58),ue=(c(285),c(68)),de=c(113),be=c(517),pe=c(78),me=c(341);const ge=e=>{let{className:t,href:c,text:o,onClick:n}=e;return Object(r.createElement)(ue.a,{className:t,href:c,onClick:n,rel:"nofollow"},o)},Oe=e=>{let{className:t,quantityInCart:c,isProcessing:o,isDisabled:n,isDone:s,onClick:l}=e;return Object(r.createElement)(ue.a,{className:t,disabled:n,showSpinner:o,onClick:l},s&&c>0?Object(a.sprintf)( +/* translators: %s number of products in cart. */ +Object(a._n)("%d in cart","%d in cart",c,"woo-gutenberg-products-block"),c):Object(a.__)("Add to cart","woo-gutenberg-products-block"),!!s&&Object(r.createElement)(de.a,{icon:be.a}))};var je=()=>{const{showFormElements:e,productIsPurchasable:t,productHasOptions:c,product:o,productType:n,isDisabled:s,isProcessing:l,eventRegistration:i,hasError:u,dispatchActions:d}=X(),{parentName:b}=Object(se.useInnerBlockLayoutContext)(),{dispatchStoreEvent:p}=Object(pe.a)(),{cartQuantity:m}=Object(me.a)(o.id||0),[g,O]=Object(r.useState)(!1),j=o.add_to_cart||{url:"",text:""};return Object(r.useEffect)(()=>{const e=i.onAddToCartAfterProcessingWithSuccess(()=>(u||O(!0),!0),0);return()=>{e()}},[i,u]),(e||!c&&"simple"===n)&&t?Object(r.createElement)(Oe,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:s,isProcessing:l,isDone:g,onClick:()=>{d.submitForm("woocommerce/single-product/"+((null==o?void 0:o.id)||0)),p("cart-add-item",{product:o,listName:b})}}):Object(r.createElement)(ge,{className:"wc-block-components-product-add-to-cart-button",href:j.url,text:j.text||Object(a.__)("View Product","woo-gutenberg-products-block"),onClick:()=>{p("product-view-link",{product:o,listName:b})}})},he=c(112),_e=e=>{let{disabled:t,min:c,max:o,step:n=1,value:a,onChange:s}=e;const l=void 0!==o,i=Object(he.a)(e=>{let t=e;l&&(t=Math.min(t,Math.floor(o/n)*n)),t=Math.max(t,Math.ceil(c/n)*n),t=Math.floor(t/n)*n,t!==e&&s(t)},300);return Object(r.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:a,min:c,max:o,step:n,hidden:1===o,disabled:t,onChange:e=>{s(e.target.value),i(e.target.value)}})},Ee=e=>{let{reason:t=Object(a.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block")}=e;return Object(r.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},t)},we=()=>{const{product:e,quantity:t,minQuantity:c,maxQuantity:o,multipleOf:n,dispatchActions:s,isDisabled:l}=X();return e.id&&!e.is_purchasable?Object(r.createElement)(Ee,null):e.id&&!e.is_in_stock?Object(r.createElement)(Ee,{reason:Object(a.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(_e,{value:t,min:c,max:o,step:n,disabled:l,onChange:s.setQuantity}),Object(r.createElement)(je,null))},fe=(c(340),c(533)),ke=c(12),ye=c(221);const ve={value:"",label:Object(a.__)("Select an option","woo-gutenberg-products-block")};var Se=e=>{let{attributeName:t,options:c=[],value:o="",onChange:s=(()=>{}),errorMessage:l=Object(a.__)("Please select a value.","woo-gutenberg-products-block")}=e;const{getValidationError:i,setValidationErrors:u,clearValidationError:d}=Object(W.b)(),b=t,p=i(b)||{};return Object(ke.useEffect)(()=>{o?d(b):u({[b]:{message:l,hidden:!0}})},[o,b,l,d,u]),Object(ke.useEffect)(()=>()=>{d(b)},[b,d]),Object(r.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(r.createElement)(fe.a,{label:Object(ce.decodeEntities)(t),value:o||"",options:[ve,...c],onChange:s,required:!0,className:n()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":p.message&&!p.hidden})}),Object(r.createElement)(ye.a,{propertyName:b,elementId:b}))},Ce=c(35);const xe=(e,t,c)=>{const r=Object.values(t).map(e=>{let{id:t}=e;return t});if(Object.values(c).every(e=>""===e))return r;const o=Object.keys(e);return r.filter(e=>o.every(r=>{const o=c[r]||"",n=t["id:"+e].attributes[r];return""===o||null===n||n===o}))};var Ne=e=>{let{attributes:t,variationAttributes:c,setRequestParams:o}=e;const n=Object(s.a)(t),a=Object(s.a)(c),[l,i]=Object(r.useState)(0),[u,d]=Object(r.useState)({}),[b,p]=Object(r.useState)(!1),m=Object(r.useMemo)(()=>((e,t,c)=>{const r={},o=Object.keys(e),n=Object.values(c).filter(Boolean).length>0;return o.forEach(o=>{const a=e[o],s={...c,[o]:null},l=n?xe(e,t,s):null,i=null!==l?l.map(e=>t["id:"+e].attributes[o]):null;r[o]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map(e=>{let{name:c,slug:r}=e;return null===t||t.includes(null)||t.includes(r)?{value:r,label:Object(ce.decodeEntities)(c)}:null}).filter(Boolean)}(a.terms,i)}),r})(n,a,u),[u,n,a]);return Object(r.useEffect)(()=>{if(!b){const e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(Ce.a)(e))return{};const t=Object.keys(e),c={};return 0===t.length||t.forEach(t=>{const r=e[t],o=r.terms.filter(e=>e.default);var n;o.length>0&&(c[r.name]=null===(n=o[0])||void 0===n?void 0:n.slug)}),c}(t);e&&d({...e}),p(!0)}},[u,t,b]),Object(r.useEffect)(()=>{Object.values(u).filter(e=>""!==e).length===Object.keys(n).length?i(((e,t,c)=>xe(e,t,c)[0]||0)(n,a,u)):l>0&&i(0)},[u,l,n,a]),Object(r.useEffect)(()=>{o({id:l,variation:Object.keys(u).map(e=>({attribute:e,value:u[e]}))})},[o,l,u]),Object(r.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(n).map(e=>Object(r.createElement)(Se,{key:e,attributeName:e,options:m[e],value:u[e],onChange:t=>{d({...u,[e]:t})}})))},Pe=e=>{let{product:t,dispatchers:c}=e;const o=(e=>e?Object(le.keyBy)(Object.values(e).filter(e=>{let{has_variations:t}=e;return t}),"name"):{})(t.attributes),n=(e=>{if(!e)return{};const t={};return e.forEach(e=>{let{id:c,attributes:r}=e;t["id:"+c]={id:c,attributes:r.reduce((e,t)=>{let{name:c,value:r}=t;return e[c]=r,e},{})}}),t})(t.variations);return 0===Object.keys(o).length||0===n.length?null:Object(r.createElement)(Ne,{attributes:o,variationAttributes:n,setRequestParams:c.setRequestParams})},Te=()=>{const{product:e,quantity:t,minQuantity:c,maxQuantity:o,multipleOf:n,dispatchActions:s,isDisabled:l}=X();return e.id&&!e.is_purchasable?Object(r.createElement)(Ee,null):e.id&&!e.is_in_stock?Object(r.createElement)(Ee,{reason:Object(a.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Pe,{product:e,dispatchers:s}),Object(r.createElement)(_e,{value:t,min:c,max:o,step:n,disabled:l,onChange:s.setQuantity}),Object(r.createElement)(je,null))},Re=()=>Object(r.createElement)(je,null),Ie=c(519),Ae=()=>Object(r.createElement)(Ie.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element."),Be=()=>Object(r.createElement)(Ae,null);const Le=()=>{const{showFormElements:e,productType:t}=X();return e?"variable"===t?Object(r.createElement)(Te,null):"grouped"===t?Object(r.createElement)(Be,null):"external"===t?Object(r.createElement)(Re,null):"simple"===t||"variation"===t?Object(r.createElement)(we,null):null:Object(r.createElement)(je,null)};t.a=Object(ie.withProductDataContext)(e=>{let{className:t,showFormElements:c}=e;const{product:o}=Object(se.useProductDataContext)(),a=n()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(le.isEmpty)(o)});return Object(r.createElement)(ae,{product:o,showFormElements:c},Object(r.createElement)("div",{className:a},Object(r.createElement)(Le,null)))})},,,,,,,,,,function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(4),n=c.n(o),a=c(92),s=c(26),l=c(29),i=c(138),u=c(123),d=c(58);t.default=Object(d.withProductDataContext)(e=>{var t,c;const{className:o,textAlign:d}=e,{parentClassName:b}=Object(l.useInnerBlockLayoutContext)(),{product:p}=Object(l.useProductDataContext)(),m=Object(i.a)(e),g=Object(u.a)(e),O=n()("wc-block-components-product-price",o,m.className,{[b+"__product-price"]:b}),j={...g.style,...m.style};if(!p.id)return Object(r.createElement)(a.a,{align:d,className:O});const h=p.prices,_=Object(s.getCurrencyFromPriceResponse)(h),E=h.price!==h.regular_price,w=n()({[b+"__product-price__value"]:b,[b+"__product-price__value--on-sale"]:E});return Object(r.createElement)(a.a,{align:d,className:O,priceStyle:j,regularPriceStyle:j,priceClassName:w,currency:_,price:h.price,minPrice:null==h||null===(t=h.price_range)||void 0===t?void 0:t.min_amount,maxPrice:null==h||null===(c=h.price_range)||void 0===c?void 0:c.max_amount,regularPrice:h.regular_price,regularPriceClassName:n()({[b+"__product-price__regular"]:b})})})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(29),l=c(138),i=c(123),u=c(215),d=c(58);c(333);t.default=Object(d.withProductDataContext)(e=>{const{parentClassName:t}=Object(s.useInnerBlockLayoutContext)(),{product:c}=Object(s.useProductDataContext)(),n=(e=>{const t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0})(c),d=Object(l.a)(e),b=Object(i.a)(e),p=Object(u.a)(e);if(!n)return null;const m={width:n/5*100+"%"},g=Object(o.sprintf)( +/* translators: %f is referring to the average rating value */ +Object(o.__)("Rated %f out of 5","woo-gutenberg-products-block"),n),O=(e=>{const t=parseInt(e.review_count,10);return Number.isFinite(t)&&t>0?t:0})(c),j={__html:Object(o.sprintf)( +/* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */ +Object(o._n)("Rated %1$s out of 5 based on %2$s customer rating","Rated %1$s out of 5 based on %2$s customer ratings",O,"woo-gutenberg-products-block"),Object(o.sprintf)('%f',n),Object(o.sprintf)('%d',O))};return Object(r.createElement)("div",{className:a()(d.className,"wc-block-components-product-rating",{[t+"__product-rating"]:t}),style:{...d.style,...b.style,...p.style}},Object(r.createElement)("div",{className:a()("wc-block-components-product-rating__stars",t+"__product-rating__stars"),role:"img","aria-label":g},Object(r.createElement)("span",{style:m,dangerouslySetInnerHTML:j})))})},function(e,t,c){"use strict";c.r(t);var r=c(6),o=c.n(r),n=c(0),a=c(4),s=c.n(a),l=c(1),i=c(78),u=c(341),d=c(138),b=c(219),p=c(123),m=c(215),g=c(13),O=c(23),j=c(2),h=c(29),_=c(58);c(334);const E=e=>{let{product:t,colorStyles:c,borderStyles:r,typographyStyles:a,spacingStyles:d}=e;const{id:b,permalink:p,add_to_cart:m,has_options:h,is_purchasable:_,is_in_stock:E}=t,{dispatchStoreEvent:w}=Object(i.a)(),{cartQuantity:f,addingToCart:k,addToCart:y}=Object(u.a)(b,"woocommerce/single-product/"+(b||0)),v=Number.isFinite(f)&&f>0,S=!h&&_&&E,C=Object(g.decodeEntities)((null==m?void 0:m.description)||""),x=v?Object(l.sprintf)( +/* translators: %s number of products in cart. */ +Object(l._n)("%d in cart","%d in cart",f,"woo-gutenberg-products-block"),f):Object(g.decodeEntities)((null==m?void 0:m.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),N=S?"button":"a",P={};return S?P.onClick=async()=>{await y(),w("cart-add-item",{product:t});const{cartRedirectAfterAdd:e}=Object(j.getSetting)("productsSettings");e&&(window.location.href=O.d)}:(P.href=p,P.rel="nofollow",P.onClick=()=>{w("product-view-link",{product:t})}),Object(n.createElement)(N,o()({"aria-label":C,className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",c.className,r.className,{loading:k,added:v}),style:{...c.style,...r.style,...a.style,...d.style},disabled:k},P),x)},w=e=>{let{colorStyles:t,borderStyles:c,typographyStyles:r,spacingStyles:o}=e;return Object(n.createElement)("button",{className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder",t.className,c.className),style:{...t.style,...c.style,...r.style,...o.style},disabled:!0})};t.default=Object(_.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(h.useInnerBlockLayoutContext)(),{product:r}=Object(h.useProductDataContext)(),o=Object(d.a)(e),a=Object(b.a)(e),l=Object(p.a)(e),i=Object(m.a)(e);return Object(n.createElement)("div",{className:s()(t,"wp-block-button","wc-block-components-product-button",{[c+"__product-add-to-cart"]:c})},r.id?Object(n.createElement)(E,{product:r,colorStyles:o,borderStyles:a,typographyStyles:l,spacingStyles:i}):Object(n.createElement)(w,{colorStyles:o,borderStyles:a,typographyStyles:l,spacingStyles:i}))})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(4),n=c.n(o),a=c(117),s=c(23),l=c(29),i=c(138),u=c(123),d=c(58);c(335),t.default=Object(d.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(l.useInnerBlockLayoutContext)(),{product:o}=Object(l.useProductDataContext)(),d=Object(i.a)(e),b=Object(u.a)(e);if(!o)return Object(r.createElement)("div",{className:n()(t,"wc-block-components-product-summary",{[c+"__product-summary"]:c})});const p=o.short_description?o.short_description:o.description;return p?Object(r.createElement)(a.a,{className:n()(t,d.className,"wc-block-components-product-summary",{[c+"__product-summary"]:c}),source:p,maxLength:150,countType:s.o.wordCountType||"words",style:{...d.style,...b.style}}):null})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(29),l=c(58);c(336),t.default=Object(l.withProductDataContext)(e=>{let{className:t}=e;const{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),l=n.sku;return l?Object(r.createElement)("div",{className:a()(t,"wc-block-components-product-sku",{[c+"__product-sku"]:c})},Object(o.__)("SKU:","woo-gutenberg-products-block")," ",Object(r.createElement)("strong",null,l)):null})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(29),l=c(138),i=c(123),u=c(7),d=c(58);c(337),t.default=Object(d.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),d=Object(l.a)(e),b=Object(i.a)(e);return Object(u.isEmpty)(n.categories)?null:Object(r.createElement)("div",{className:a()(t,"wc-block-components-product-category-list",d.className,{[c+"__product-category-list"]:c}),style:{...d.style,...b.style}},Object(o.__)("Categories:","woo-gutenberg-products-block")," ",Object(r.createElement)("ul",null,Object.values(n.categories).map(e=>{let{name:t,link:c,slug:o}=e;return Object(r.createElement)("li",{key:"category-list-item-"+o},Object(r.createElement)("a",{href:c},t))})))})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(29),l=c(138),i=c(123),u=c(7),d=c(58);c(338),t.default=Object(d.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),d=Object(l.a)(e),b=Object(i.a)(e);return Object(u.isEmpty)(n.tags)?null:Object(r.createElement)("div",{className:a()(t,d.className,"wc-block-components-product-tag-list",{[c+"__product-tag-list"]:c}),style:{...d.style,...b.style}},Object(o.__)("Tags:","woo-gutenberg-products-block")," ",Object(r.createElement)("ul",null,Object.values(n.tags).map(e=>{let{name:t,link:c,slug:o}=e;return Object(r.createElement)("li",{key:"tag-list-item-"+o},Object(r.createElement)("a",{href:c},t))})))})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(29),l=c(138),i=c(123),u=c(58);c(339);t.default=Object(u.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),u=Object(l.a)(e),d=Object(i.a)(e);if(!n.id||!n.is_purchasable)return null;const b=!!n.is_in_stock,p=n.low_stock_remaining,m=n.is_on_backorder;return Object(r.createElement)("div",{className:a()(t,u.className,"wc-block-components-product-stock-indicator",{[c+"__stock-indicator"]:c,"wc-block-components-product-stock-indicator--in-stock":b,"wc-block-components-product-stock-indicator--out-of-stock":!b,"wc-block-components-product-stock-indicator--low-stock":!!p,"wc-block-components-product-stock-indicator--available-on-backorder":!!m}),style:{...u.style,...d.style}},p?(e=>Object(o.sprintf)( +/* translators: %d stock amount (number of items in stock for product) */ +Object(o.__)("%d left in stock","woo-gutenberg-products-block"),e))(p):((e,t)=>t?Object(o.__)("Available on backorder","woo-gutenberg-products-block"):e?Object(o.__)("In Stock","woo-gutenberg-products-block"):Object(o.__)("Out of Stock","woo-gutenberg-products-block"))(b,m))})},,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var r=c(0),o=c(9),n=c(17),a=c(13),s=c(41);const l=(e,t)=>{const c=e.find(e=>{let{id:c}=e;return c===t});return c?c.quantity:0},i=e=>{const{addItemToCart:t}=Object(o.useDispatch)(n.CART_STORE_KEY),{cartItems:c,cartIsLoading:i}=Object(s.a)(),{createErrorNotice:u,removeNotice:d}=Object(o.useDispatch)("core/notices"),[b,p]=Object(r.useState)(!1),m=Object(r.useRef)(l(c,e));return Object(r.useEffect)(()=>{const t=l(c,e);t!==m.current&&(m.current=t)},[c,e]),{cartQuantity:Number.isFinite(m.current)?m.current:0,addingToCart:b,cartIsLoading:i,addToCart:function(){let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return p(!0),t(e,c).then(()=>{d("add-to-cart")}).catch(e=>{u(Object(a.decodeEntities)(e.message),{id:"add-to-cart",context:"wc/all-products",isDismissible:!0})}).finally(()=>{p(!1)})}}}},,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(1),o=c(23);const n=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(r.__)("Fly your WordPress banner with this beauty! Deck out your office space or add it to your kids walls. This banner will spruce up any space it’s hung!","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",price:"7.99",price_html:'$7.99',images:[{id:1,src:o.m+"previews/pennant.jpg",thumbnail:o.m+"previews/pennant.jpg",name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,categories:[{id:1,name:"Decor",slug:"decor",link:"https://example.org"}],review_count:1,prices:{currency_code:"GBP",decimal_separator:".",thousand_separator:",",decimals:2,price_prefix:"£",price_suffix:"",price:"7.99",regular_price:"9.99",sale_price:"7.99",price_range:null},add_to_cart:{text:Object(r.__)("Add to cart","woo-gutenberg-products-block"),description:Object(r.__)("Add to cart","woo-gutenberg-products-block")},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},,,,,,,,,,function(e,t,c){e.exports=c(454)},function(e,t){},function(e,t){},function(e,t){},,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.r(t),c.d(t,"metadata",(function(){return ot})),c.d(t,"name",(function(){return Zt}));var r=c(0),o=c(8),n=c(113),a=c(509),s=c(95),l=c(1),i=c(4),u=c.n(i),d={category:"woocommerce-product-elements",keywords:[Object(l.__)("WooCommerce","woo-gutenberg-products-block")],icon:{src:Object(r.createElement)(n.a,{icon:a.a,className:"wc-block-editor-components-block-icon"})},supports:{html:!1},parent:Object(s.a)()?void 0:["@woocommerce/all-products","@woocommerce/single-product"],save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",{className:u()("is-loading",t.className)})},deprecated:[{attributes:{},save:()=>null}]},b=c(286),p=c(3),m=c(10),g=c(5),O=c(99),j=c(287),h=c(93),_=c(142),E=c(29);c(376);var w=e=>t=>c=>{const o=Object(E.useProductDataContext)(),{attributes:n,setAttributes:a}=c,{productId:s}=n,[i,u]=Object(r.useState)(!s);return o.hasContext?Object(r.createElement)(t,c):Object(r.createElement)(r.Fragment,null,i?Object(r.createElement)(p.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&Object(r.createElement)("div",null,e.description),Object(r.createElement)("div",{className:"wc-atomic-blocks-product__selection"},Object(r.createElement)(h.a,{selected:s||0,showVariations:!0,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];a({productId:e[0]?e[0].id:0})}}),Object(r.createElement)(p.Button,{isSecondary:!0,disabled:!s,onClick:()=>{u(!1)}},Object(l.__)("Done","woo-gutenberg-products-block")))):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(g.BlockControls,null,Object(r.createElement)(p.ToolbarGroup,null,Object(r.createElement)(_.a,{onClick:()=>u(!0)},Object(l.__)("Switch product…","woo-gutenberg-products-block")))),Object(r.createElement)(t,c)))},f=c(510);const k=Object(l.__)("Product Title","woo-gutenberg-products-block"),y=Object(r.createElement)(n.a,{icon:f.a,className:"wc-block-editor-components-block-icon"}),v=Object(l.__)("Display the title of a product.","woo-gutenberg-products-block");c(377);const S=e=>{let{attributes:t,setAttributes:c}=e;const o=Object(g.useBlockProps)(),{headingLevel:n,showProductLink:a,align:i,linkTarget:u}=t;return Object(r.createElement)("div",o,Object(r.createElement)(g.BlockControls,null,Object(r.createElement)(O.a,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:n,onChange:e=>c({headingLevel:e})}),Object(s.b)()&&Object(r.createElement)(g.AlignmentToolbar,{value:i,onChange:e=>{c({align:e})}})),Object(r.createElement)(g.InspectorControls,null,Object(r.createElement)(p.PanelBody,{title:Object(l.__)("Link settings","woo-gutenberg-products-block")},Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Make title a link","woo-gutenberg-products-block"),checked:a,onChange:()=>c({showProductLink:!a})}),a&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Open in new tab","woo-gutenberg-products-block"),onChange:e=>c({linkTarget:e?"_blank":"_self"}),checked:"_blank"===u})))),Object(r.createElement)(p.Disabled,null,Object(r.createElement)(j.a,t)))};var C=Object(s.b)()?Object(m.compose)([w({icon:y,label:k,description:Object(l.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(S):S;const x=e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))};var N=c(121);const P={...d,apiVersion:2,title:k,description:v,icon:{src:y},attributes:b.a,edit:C,save:x,supports:{...d.supports,...Object(s.b)()&&{typography:{fontSize:!0,lineHeight:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0},color:{text:!0,background:!0,link:!1,gradients:!0,__experimentalSkipSerialization:!0},...Object(N.a)()&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-title"}}};Object(o.registerBlockType)("woocommerce/product-title",P);var T=c(301),R=c(511);const I=Object(l.__)("Product Price","woo-gutenberg-products-block"),A=Object(r.createElement)(n.a,{icon:R.a,className:"wc-block-editor-components-block-icon"}),B=Object(l.__)("Display the price of a product.","woo-gutenberg-products-block");var L=w({icon:A,label:I,description:Object(l.__)("Choose a product to display its price.","woo-gutenberg-products-block")})(e=>{let{attributes:t,setAttributes:c}=e;const o=Object(g.useBlockProps)();return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(g.BlockControls,null,Object(s.b)()&&Object(r.createElement)(g.AlignmentToolbar,{value:t.textAlign,onChange:e=>{c({textAlign:e})}})),Object(r.createElement)("div",o,Object(r.createElement)(T.default,t)))});let D={productId:{type:"number",default:0}};Object(s.b)()&&(D={...D,textAlign:{type:"string"}});var V=D;const F={...d,apiVersion:2,title:I,description:B,icon:{src:A},attributes:V,edit:L,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))},supports:{...d.supports,...Object(s.b)()&&{color:{text:!0,background:!1,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wc-block-components-product-price"}}};Object(o.registerBlockType)("woocommerce/product-price",F);var M=c(288);const z={...Object(s.b)()&&{__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},...Object(N.a)()&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-image"}};var H=c(2),q=c(289),G=c(512);const Q=Object(l.__)("Product Image","woo-gutenberg-products-block"),Y=Object(r.createElement)(n.a,{icon:G.a,className:"wc-block-editor-components-block-icon"}),U=Object(l.__)("Display the main product image","woo-gutenberg-products-block");var W=w({icon:Y,label:Q,description:Object(l.__)("Choose a product to display its image.","woo-gutenberg-products-block")})(e=>{let{attributes:t,setAttributes:c}=e;const{showProductLink:o,imageSizing:n,showSaleBadge:a,saleBadgeAlign:s}=t,i=Object(g.useBlockProps)();return Object(r.createElement)("div",i,Object(r.createElement)(g.InspectorControls,null,Object(r.createElement)(p.PanelBody,{title:Object(l.__)("Content","woo-gutenberg-products-block")},Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(l.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:o,onChange:()=>c({showProductLink:!o})}),Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Show On-Sale Badge","woo-gutenberg-products-block"),help:Object(l.__)('Overlay a "sale" badge if the product is on-sale.',"woo-gutenberg-products-block"),checked:a,onChange:()=>c({showSaleBadge:!a})}),a&&Object(r.createElement)(p.__experimentalToggleGroupControl,{label:Object(l.__)("Sale Badge Alignment","woo-gutenberg-products-block"),value:s,onChange:e=>c({saleBadgeAlign:e})},Object(r.createElement)(p.__experimentalToggleGroupControlOption,{value:"left",label:Object(l.__)("Left","woo-gutenberg-products-block")}),Object(r.createElement)(p.__experimentalToggleGroupControlOption,{value:"center",label:Object(l.__)("Center","woo-gutenberg-products-block")}),Object(r.createElement)(p.__experimentalToggleGroupControlOption,{value:"right",label:Object(l.__)("Right","woo-gutenberg-products-block")})),Object(r.createElement)(p.__experimentalToggleGroupControl,{label:Object(l.__)("Image Sizing","woo-gutenberg-products-block"),help:Object(r.createInterpolateElement)(Object(l.__)("Product image cropping can be modified in the Customizer.","woo-gutenberg-products-block"),{a:Object(r.createElement)("a",{href:Object(H.getAdminLink)("customize.php")+"?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images",target:"_blank",rel:"noopener noreferrer"})}),value:n,onChange:e=>c({imageSizing:e})},Object(r.createElement)(p.__experimentalToggleGroupControlOption,{value:"full-size",label:Object(l.__)("Full Size","woo-gutenberg-products-block")}),Object(r.createElement)(p.__experimentalToggleGroupControlOption,{value:"cropped",label:Object(l.__)("Cropped","woo-gutenberg-products-block")})))),Object(r.createElement)(p.Disabled,null,Object(r.createElement)(q.a,t)))});const $={apiVersion:2,title:Q,description:U,icon:{src:Y},attributes:M.a,edit:W,supports:z,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))}};Object(o.registerBlockType)("woocommerce/product-image",{...d,...$});var K=c(302),J=c(505);const X=Object(l.__)("Product Rating","woo-gutenberg-products-block"),Z=Object(r.createElement)(n.a,{icon:J.a,className:"wc-block-editor-components-block-icon"}),ee=Object(l.__)("Display the average rating of a product.","woo-gutenberg-products-block");var te=w({icon:Z,label:X,description:Object(l.__)("Choose a product to display its rating.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)({className:"wp-block-woocommerce-product-rating"});return Object(r.createElement)("div",c,Object(r.createElement)(K.default,t))});const ce={apiVersion:2,title:X,description:ee,icon:{src:Z},attributes:{productId:{type:"number",default:0}},supports:{...Object(s.b)()&&{color:{text:!0,background:!1,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},...Object(N.a)()&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-rating"}},edit:te,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))}};Object(o.registerBlockType)("woocommerce/product-rating",{...d,...ce});var re=c(303),oe=c(513);const ne=Object(l.__)("Add to Cart Button","woo-gutenberg-products-block"),ae=Object(r.createElement)(n.a,{icon:oe.a,className:"wc-block-editor-components-block-icon"}),se=Object(l.__)("Display a call to action button which either adds the product to the cart, or links to the product page.","woo-gutenberg-products-block");var le=w({icon:ae,label:ne,description:Object(l.__)("Choose a product to display its add to cart button.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)();return Object(r.createElement)("div",c,Object(r.createElement)(p.Disabled,null,Object(r.createElement)(re.default,t)))});const ie={apiVersion:2,title:ne,description:se,icon:{src:ae},attributes:{productId:{type:"number",default:0}},supports:{...Object(s.b)()&&{color:{text:!0,background:!0,link:!1,__experimentalSkipSerialization:!0},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},...Object(N.a)()&&{spacing:{padding:!0,__experimentalSkipSerialization:!0}},typography:{fontSize:!0,__experimentalFontWeight:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button"}},edit:le,save:x};Object(o.registerBlockType)("woocommerce/product-button",{...d,...ie});var ue=c(304),de=c(514);const be=Object(l.__)("Product Summary","woo-gutenberg-products-block"),pe=Object(r.createElement)(n.a,{icon:de.a,className:"wc-block-editor-components-block-icon"}),me=Object(l.__)("Display a short description about a product.","woo-gutenberg-products-block");c(378);var ge=w({icon:pe,label:be,description:Object(l.__)("Choose a product to display its short description.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)();return Object(r.createElement)("div",c,Object(r.createElement)(ue.default,t))});const Oe={apiVersion:2,title:be,description:me,icon:{src:pe},attributes:{productId:{type:"number",default:0}},supports:{...Object(s.b)()&&{color:{text:!0,background:!1,link:!1},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-summary"}},edit:ge,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))}};Object(o.registerBlockType)("woocommerce/product-summary",{...d,...Oe});var je=c(216),he=c(503);const _e=Object(l.__)("On-Sale Badge","woo-gutenberg-products-block"),Ee=Object(r.createElement)(n.a,{icon:he.a,className:"wc-block-editor-components-block-icon"}),we=Object(l.__)("Displays an on-sale badge if the product is on-sale.","woo-gutenberg-products-block");var fe=w({icon:Ee,label:_e,description:Object(l.__)("Choose a product to display its sale-badge.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)();return Object(r.createElement)("div",c,Object(r.createElement)(je.default,t))});const ke={title:_e,description:we,icon:{src:Ee},apiVersion:2,supports:{html:!1,...Object(s.b)()&&{color:{gradients:!0,background:!0,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0},...Object(N.a)()&&{spacing:{padding:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-sale-badge"}},attributes:{productId:{type:"number",default:0}},edit:fe,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))}};Object(o.registerBlockType)("woocommerce/product-sale-badge",{...d,...ke});var ye=c(103),ve=c(305),Se=c(11),Ce=Object(r.createElement)(Se.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{d:"M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"}));const xe=Object(l.__)("Product SKU","woo-gutenberg-products-block"),Ne=Object(r.createElement)(n.a,{icon:Ce,className:"wc-block-editor-components-block-icon"}),Pe={title:xe,description:Object(l.__)("Display the SKU of a product.","woo-gutenberg-products-block"),icon:{src:Ne},attributes:{productId:{type:"number",default:0}},edit:w({icon:Ne,label:xe,description:Object(l.__)("Choose a product to display its SKU.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(ye.a,null),Object(r.createElement)(ve.default,t))})};Object(s.c)("woocommerce/product-sku",{...d,...Pe});var Te=c(306),Re=c(515);const Ie=Object(l.__)("Product Category List","woo-gutenberg-products-block"),Ae=Object(r.createElement)(n.a,{icon:Re.a,className:"wc-block-editor-components-block-icon"}),Be=Object(l.__)("Display a list of categories belonging to a product.","woo-gutenberg-products-block");var Le=w({icon:Ae,label:Ie,description:Object(l.__)("Choose a product to display its categories.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)();return Object(r.createElement)("div",c,Object(r.createElement)(ye.a,null),Object(r.createElement)(p.Disabled,null,Object(r.createElement)(Te.default,t)))});const De={...d,apiVersion:2,title:Ie,description:Be,icon:{src:Ae},attributes:{productId:{type:"number",default:0}},supports:{...Object(s.b)()&&{color:{text:!0,link:!0,background:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wc-block-components-product-category-list"}},save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))},edit:Le};Object(s.c)("woocommerce/product-category-list",De);var Ve=c(307),Fe=c(508);const Me=Object(l.__)("Product Tag List","woo-gutenberg-products-block"),ze=Object(r.createElement)(n.a,{icon:Fe.a,className:"wc-block-editor-components-block-icon"}),He=Object(l.__)("Display a list of tags belonging to a product.","woo-gutenberg-products-block");var qe=w({icon:ze,label:Me,description:Object(l.__)("Choose a product to display its tags.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)();return Object(r.createElement)("div",c,Object(r.createElement)(ye.a,null),Object(r.createElement)(p.Disabled,null,Object(r.createElement)(Ve.default,t)))});const Ge={apiVersion:2,title:Me,description:He,icon:{src:ze},attributes:{productId:{type:"number",default:0}},supports:{...Object(s.b)()&&{color:{text:!0,background:!1,link:!0},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-tag-list"}},edit:qe,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))}};Object(s.c)("woocommerce/product-tag-list",{...d,...Ge});var Qe=c(308),Ye=c(516);const Ue=Object(l.__)("Product Stock Indicator","woo-gutenberg-products-block"),We=Object(r.createElement)(n.a,{icon:Ye.a,className:"wc-block-editor-components-block-icon"}),$e=Object(l.__)("Display product stock status.","woo-gutenberg-products-block");var Ke=w({icon:We,label:Ue,description:Object(l.__)("Choose a product to display its stock.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)();return Object(r.createElement)("div",c,Object(r.createElement)(ye.a,null),Object(r.createElement)(Qe.default,t))});const Je={apiVersion:2,title:Ue,description:$e,icon:{src:We},attributes:{productId:{type:"number",default:0}},supports:{...Object(s.b)()&&{color:{text:!0,background:!1,link:!1},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-stock-indicator"}},edit:Ke,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))}};Object(s.c)("woocommerce/product-stock-indicator",{...d,...Je});var Xe=c(490),Ze=(c(285),c(291)),et=c(244);const tt=Object(l.__)("Add to Cart","woo-gutenberg-products-block"),ct=Object(r.createElement)(n.a,{icon:et.a,className:"wc-block-editor-components-block-icon"}),rt={title:tt,description:Object(l.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:ct},edit:w({icon:ct,label:tt,description:Object(l.__)("Choose a product to display its add to cart form.","woo-gutenberg-products-block")})(e=>{let{attributes:t,setAttributes:c}=e;const{product:o}=Object(E.useProductDataContext)(),{className:n,showFormElements:a}=t;return Object(r.createElement)("div",{className:u()(n,"wc-block-components-product-add-to-cart")},Object(r.createElement)(ye.a,{productId:o.id}),Object(r.createElement)(g.InspectorControls,null,Object(r.createElement)(p.PanelBody,{title:Object(l.__)("Layout","woo-gutenberg-products-block")},Object(Xe.b)(o)?Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Display form elements","woo-gutenberg-products-block"),help:Object(l.__)("Depending on product type, allow customers to select a quantity, variations etc.","woo-gutenberg-products-block"),checked:a,onChange:()=>c({showFormElements:!a})}):Object(r.createElement)(p.Notice,{className:"wc-block-components-product-add-to-cart-notice",isDismissible:!1,status:"info"},Object(l.__)("This product does not support the block based add to cart form. A link to the product page will be shown instead.","woo-gutenberg-products-block")))),Object(r.createElement)(p.Disabled,null,Object(r.createElement)(Ze.a,t)))}),attributes:c(290).a};Object(s.c)("woocommerce/product-add-to-cart",{...d,...rt});var ot=c(202),nt=c(6),at=c.n(nt);const st=(e,t)=>{const{className:c,contentVisibility:r}=t;return u()(e,c,{"has-image":r&&r.image,"has-title":r&&r.title,"has-rating":r&&r.rating,"has-price":r&&r.price,"has-button":r&&r.button})},{attributes:lt}=ot;var it=[{attributes:Object.assign({},lt,{rows:{type:"number",default:1}}),save(e){let{attributes:t}=e;const c={"data-attributes":JSON.stringify(t)};return Object(r.createElement)("div",at()({className:st("wc-block-all-products",t)},c),Object(r.createElement)(g.InnerBlocks.Content,null))}}],ut=c(24),dt=c.n(ut),bt=c(9),pt=c(63),mt=c(482),gt=c(365),Ot=c(23),jt=c(235);const ht=[["woocommerce/product-image",{imageSizing:"cropped"}],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],_t=e=>e&&0!==e.length?e.map(e=>[e.name,{...e.attributes,product:void 0,children:e.innerBlocks.length>0?_t(e.innerBlocks):[]}]):[];var Et=c(12),wt=c(7),ft=c(28);c(384);var kt=e=>{let{currentPage:t,displayFirstAndLastPages:c=!0,displayNextAndPreviousArrows:o=!0,pagesToDisplay:n=3,onPageChange:a,totalPages:s}=e,{minIndex:i,maxIndex:d}=((e,t,c)=>{if(c<=2)return{minIndex:null,maxIndex:null};const r=e-1,o=Math.max(Math.floor(t-r/2),2),n=Math.min(Math.ceil(t+(r-(t-o))),c-1);return{minIndex:Math.max(Math.floor(t-(r-(n-t))),2),maxIndex:n}})(n,t,s);const b=c&&Boolean(1!==i),p=c&&Boolean(d!==s),m=c&&Boolean(i&&i>3),g=c&&Boolean(d&&da(t-1),title:Object(l.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(r.createElement)(ft.a,{label:"←",screenReaderLabel:Object(l.__)("Previous page","woo-gutenberg-products-block")})),b&&Object(r.createElement)("button",{className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:()=>a(1),disabled:1===t},Object(r.createElement)(ft.a,{label:"1",screenReaderLabel:Object(l.sprintf)( +/* translators: %d is the page number (1, 2, 3...). */ +Object(l.__)("Page %d","woo-gutenberg-products-block"),1)})),m&&Object(r.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(l.__)("…","woo-gutenberg-products-block")),O.map(e=>Object(r.createElement)("button",{key:e,className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?void 0:()=>a(e),disabled:t===e},Object(r.createElement)(ft.a,{label:e.toString(),screenReaderLabel:Object(l.sprintf)( +/* translators: %d is the page number (1, 2, 3...). */ +Object(l.__)("Page %d","woo-gutenberg-products-block"),e)}))),g&&Object(r.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(l.__)("…","woo-gutenberg-products-block")),p&&Object(r.createElement)("button",{className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===s,"wc-block-components-pagination__page--active":t===s}),onClick:()=>a(s),disabled:t===s},Object(r.createElement)(ft.a,{label:s.toString(),screenReaderLabel:Object(l.sprintf)( +/* translators: %d is the page number (1, 2, 3...). */ +Object(l.__)("Page %d","woo-gutenberg-products-block"),s)})),o&&Object(r.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>a(t+1),title:Object(l.__)("Next page","woo-gutenberg-products-block"),disabled:t>=s},Object(r.createElement)(ft.a,{label:"→",screenReaderLabel:Object(l.__)("Next page","woo-gutenberg-products-block")})))},yt=c(109),vt=c(75),St=c(125),Ct=c(17),xt=c(49);var Nt=c(78);c(385);const Pt=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};var Tt=c(45),Rt=c(172),It=()=>{const{parentClassName:e}=Object(E.useInnerBlockLayoutContext)();return Object(r.createElement)("div",{className:e+"__no-products"},Object(r.createElement)(n.a,{className:e+"__no-products-image",icon:Rt.a,size:100}),Object(r.createElement)("strong",{className:e+"__no-products-title"},Object(l.__)("No products","woo-gutenberg-products-block")),Object(r.createElement)("p",{className:e+"__no-products-description"},Object(l.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},At=c(507),Bt=e=>{let{resetCallback:t=(()=>{})}=e;const{parentClassName:c}=Object(E.useInnerBlockLayoutContext)();return Object(r.createElement)("div",{className:c+"__no-products"},Object(r.createElement)(n.a,{className:c+"__no-products-image",icon:At.a,size:100}),Object(r.createElement)("strong",{className:c+"__no-products-title"},Object(l.__)("No products found","woo-gutenberg-products-block")),Object(r.createElement)("p",{className:c+"__no-products-description"},Object(l.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(r.createElement)("button",{onClick:t},Object(l.__)("Reset Search","woo-gutenberg-products-block")))},Lt=c(119);c(383);var Dt=e=>{let{onChange:t,value:c}=e;return Object(r.createElement)(Lt.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",onChange:t,options:[{key:"menu_order",label:Object(l.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(l.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(l.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(l.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(l.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(l.__)("Price: high to low","woo-gutenberg-products-block")}],screenReaderLabel:Object(l.__)("Order products by","woo-gutenberg-products-block"),value:c})};const Vt=(e,t,c,o)=>{if(!c)return;const n=Object(mt.a)(e);return c.map((c,a)=>{let[s,l={}]=c,i=[];l.children&&l.children.length>0&&(i=Vt(e,t,l.children,o));const u=n[s];if(!u)return null;const d=t.id||0,b=["layout",s,a,o,d];return Object(r.createElement)(r.Suspense,{key:b.join("_"),fallback:Object(r.createElement)("div",{className:"wc-block-placeholder"})},Object(r.createElement)(u,at()({},l,{children:i,product:t})))})};var Ft=Object(m.withInstanceId)(e=>{let{product:t={},attributes:c,instanceId:o}=e;const{layoutConfig:n}=c,{parentClassName:a,parentName:s}=Object(E.useInnerBlockLayoutContext)(),l=0===Object.keys(t).length,i=u()(a+"__product","wc-block-layout",{"is-loading":l});return Object(r.createElement)("li",{className:i,"aria-hidden":l},Vt(s,t,n,o))});c(382);const Mt=e=>{switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}},zt=function(e){let{totalQuery:t,totalProducts:c}=e,{totalQuery:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!Object(wt.isEqual)(t,r)&&Number.isFinite(c)};var Ht,qt=(Ht=e=>{let{attributes:t,currentPage:c,onPageChange:o,onSortChange:n,sortValue:a,scrollToTop:s}=e;const[i,d]=Object(vt.b)("attributes",[]),[b,p]=Object(vt.b)("stock_status",[]),[m,g]=Object(vt.b)("min_price"),[O,j]=Object(vt.b)("max_price"),[h]=Object(vt.c)((e=>{let{sortValue:t,currentPage:c,attributes:r}=e;const{columns:o,rows:n}=r;return{...Mt(t),catalog_visibility:"catalog",per_page:o*n,page:c}})({attributes:t,sortValue:a,currentPage:c})),{products:_,totalProducts:w,productsLoading:f}=(e=>{const t={namespace:"/wc/store/v1",resourceName:"products"},{results:c,isLoading:r}=Object(St.a)({...t,query:e}),{value:o}=((e,t)=>{const{namespace:c,resourceName:r,resourceValues:o=[],query:n={}}=t;if(!c||!r)throw new Error("The options object must have valid values for the namespace and the resource name properties.");const a=Object(xt.a)(n),s=Object(xt.a)(o),{value:l,isLoading:i=!0}=Object(bt.useSelect)(e=>{const t=e(Ct.COLLECTIONS_STORE_KEY),o=["x-wp-total",c,r,a,s];return{value:t.getCollectionHeader(...o),isLoading:t.hasFinishedResolution("getCollectionHeader",o)}},["x-wp-total",c,r,s,a]);return{value:l,isLoading:i}})(0,{...t,query:e});return{products:c,totalProducts:parseInt(o,10),productsLoading:r}})(h),{parentClassName:k,parentName:y}=Object(E.useInnerBlockLayoutContext)(),v=(e=>{const{order:t,orderby:c,page:r,per_page:o,...n}=e;return n||{}})(h),{dispatchStoreEvent:S}=Object(Nt.a)(),C=Object(yt.a)({totalQuery:v,totalProducts:w},zt);Object(r.useEffect)(()=>{S("product-list-render",{products:_,listName:y})},[_,y,S]),Object(r.useEffect)(()=>{Object(wt.isEqual)(v,null==C?void 0:C.totalQuery)||(o(1),null!=C&&C.totalQuery&&(e=>{Number.isFinite(e)&&(0===e?Object(Tt.speak)(Object(l.__)("No products found","woo-gutenberg-products-block")):Object(Tt.speak)(Object(l.sprintf)( +/* translators: %s is an integer higher than 0 (1, 2, 3...) */ +Object(l._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))})(w))},[null==C?void 0:C.totalQuery,w,o,v]);const{contentVisibility:x}=t,N=t.columns*t.rows,P=!Number.isFinite(w)&&Number.isFinite(null==C?void 0:C.totalProducts)&&Object(wt.isEqual)(v,null==C?void 0:C.totalQuery)?Math.ceil(((null==C?void 0:C.totalProducts)||0)/N):Math.ceil(w/N),T=_.length?_:Array.from({length:N}),R=0!==_.length||f,I=i.length>0||b.length>0||Number.isFinite(m)||Number.isFinite(O);return Object(r.createElement)("div",{className:(()=>{const{columns:e,rows:c,alignButtons:r,align:o}=t,n=void 0!==o?"align"+o:"";return u()(k,n,"has-"+e+"-columns",{"has-multiple-rows":c>1,"has-aligned-buttons":r})})()},(null==x?void 0:x.orderBy)&&R&&Object(r.createElement)(Dt,{onChange:n,value:a}),!R&&I&&Object(r.createElement)(Bt,{resetCallback:()=>{d([]),p([]),g(null),j(null)}}),!R&&!I&&Object(r.createElement)(It,null),R&&Object(r.createElement)("ul",{className:u()(k+"__products",{"is-loading-products":f})},T.map((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=arguments.length>1?arguments[1]:void 0;return Object(r.createElement)(Ft,{key:e.id||c,attributes:t,product:e})}))),P>1&&Object(r.createElement)(kt,{currentPage:c,onPageChange:e=>{s({focusableSelector:"a, button"}),o(e)},totalPages:P}))},e=>{const t=Object(r.useRef)(null);return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:t,"aria-hidden":!0}),Object(r.createElement)(Ht,at()({},e,{scrollToTop:e=>{null!==t.current&&((e,t)=>{const{focusableSelector:c}=t||{};window&&Number.isFinite(window.innerHeight)&&(c?((e,t)=>{var c;const r=(null===(c=e.parentElement)||void 0===c?void 0:c.querySelectorAll(t))||[];if(r.length){const e=r[0];Pt(e),null==e||e.focus()}else Pt(e)})(e,c):Pt(e))})(t.current,e)}})))}),Gt=e=>{let{attributes:t}=e;const[c,o]=Object(r.useState)(1),[n,a]=Object(r.useState)(t.orderby);return Object(r.useEffect)(()=>{a(t.orderby)},[t.orderby]),Object(r.createElement)(qt,{attributes:t,currentPage:c,onPageChange:e=>{o(e)},onSortChange:e=>{var t;const c=null==e||null===(t=e.target)||void 0===t?void 0:t.value;a(c),o(1)},sortValue:n})},Qt=c(141),Yt=c(145),Ut=c(228);class Wt extends Et.Component{render(){const{attributes:e,urlParameterSuffix:t}=this.props;return e.isPreview?Qt.a:Object(r.createElement)(E.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(r.createElement)(Yt.a,null,Object(r.createElement)(Ut.a,{context:"wc/all-products"})),Object(r.createElement)(Gt,{attributes:e,urlParameterSuffix:t}))}}var $t=Wt;c(381);class Kt extends r.Component{constructor(){super(...arguments),dt()(this,"state",{isEditing:!1,innerBlocks:[]}),dt()(this,"blockMap",Object(mt.a)("woocommerce/all-products")),dt()(this,"componentDidMount",()=>{const{block:e}=this.props;this.setState({innerBlocks:e.innerBlocks})}),dt()(this,"getTitle",()=>Object(l.__)("All Products","woo-gutenberg-products-block")),dt()(this,"getIcon",()=>Object(r.createElement)(n.a,{icon:a.a})),dt()(this,"togglePreview",()=>{const{debouncedSpeak:e}=this.props;this.setState({isEditing:!this.state.isEditing}),this.state.isEditing||e(Object(l.__)("Showing All Products block preview.","woo-gutenberg-products-block"))}),dt()(this,"getInspectorControls",()=>{const{attributes:e,setAttributes:t}=this.props,{columns:c,rows:o,alignButtons:n}=e;return Object(r.createElement)(g.InspectorControls,{key:"inspector"},Object(r.createElement)(p.PanelBody,{title:Object(l.__)("Layout Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(pt.a,{columns:c,rows:o,alignButtons:n,setAttributes:t,minColumns:Object(H.getSetting)("min_columns",1),maxColumns:Object(H.getSetting)("max_columns",6),minRows:Object(H.getSetting)("min_rows",1),maxRows:Object(H.getSetting)("max_rows",6)})),Object(r.createElement)(p.PanelBody,{title:Object(l.__)("Content Settings","woo-gutenberg-products-block")},((e,t)=>{const{contentVisibility:c}=e;return Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Show Sorting Dropdown","woo-gutenberg-products-block"),checked:c.orderBy,onChange:()=>t({contentVisibility:{...c,orderBy:!c.orderBy}})})})(e,t),((e,t)=>Object(r.createElement)(p.SelectControl,{label:Object(l.__)("Order Products By","woo-gutenberg-products-block"),value:e.orderby,options:[{label:Object(l.__)("Default sorting (menu order)","woo-gutenberg-products-block"),value:"menu_order"},{label:Object(l.__)("Popularity","woo-gutenberg-products-block"),value:"popularity"},{label:Object(l.__)("Average rating","woo-gutenberg-products-block"),value:"rating"},{label:Object(l.__)("Latest","woo-gutenberg-products-block"),value:"date"},{label:Object(l.__)("Price: low to high","woo-gutenberg-products-block"),value:"price"},{label:Object(l.__)("Price: high to low","woo-gutenberg-products-block"),value:"price-desc"}],onChange:e=>t({orderby:e})}))(e,t)))}),dt()(this,"getBlockControls",()=>{const{isEditing:e}=this.state;return Object(r.createElement)(g.BlockControls,null,Object(r.createElement)(p.ToolbarGroup,{controls:[{icon:"edit",title:Object(l.__)("Edit inner product layout","woo-gutenberg-products-block"),onClick:()=>this.togglePreview(),isActive:e}]}))}),dt()(this,"renderEditMode",()=>{const e={template:this.props.attributes.layoutConfig,templateLock:!1,allowedBlocks:Object.keys(this.blockMap)};return 0!==this.props.attributes.layoutConfig.length&&(e.renderAppender=!1),Object(r.createElement)(p.Placeholder,{icon:this.getIcon(),label:this.getTitle()},Object(l.__)("Display all products from your store as a grid.","woo-gutenberg-products-block"),Object(r.createElement)("div",{className:"wc-block-all-products-grid-item-template"},Object(r.createElement)(p.Tip,null,Object(l.__)("Edit the blocks inside the preview below to change the content displayed for each product within the product grid.","woo-gutenberg-products-block")),Object(r.createElement)(E.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(r.createElement)("div",{className:"wc-block-grid wc-block-layout has-1-columns"},Object(r.createElement)("ul",{className:"wc-block-grid__products"},Object(r.createElement)("li",{className:"wc-block-grid__product"},Object(r.createElement)(E.ProductDataContextProvider,{product:gt.a[0]},Object(r.createElement)(g.InnerBlocks,e)))))),Object(r.createElement)("div",{className:"wc-block-all-products__actions"},Object(r.createElement)(p.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,onClick:()=>{const{block:e,setAttributes:t}=this.props;t({layoutConfig:_t(e.innerBlocks)}),this.setState({innerBlocks:e.innerBlocks}),this.togglePreview()}},Object(l.__)("Done","woo-gutenberg-products-block")),Object(r.createElement)(p.Button,{className:"wc-block-all-products__cancel-button",isTertiary:!0,onClick:()=>{const{block:e,replaceInnerBlocks:t}=this.props,{innerBlocks:c}=this.state;t(e.clientId,c,!1),this.togglePreview()}},Object(l.__)("Cancel","woo-gutenberg-products-block")),Object(r.createElement)(p.Button,{className:"wc-block-all-products__reset-button",icon:Object(r.createElement)(n.a,{icon:a.a}),label:Object(l.__)("Reset layout to default","woo-gutenberg-products-block"),onClick:()=>{const{block:e,replaceInnerBlocks:t}=this.props,c=[];ht.map(e=>{let[t,r]=e;return c.push(Object(o.createBlock)(t,r)),!0}),t(e.clientId,c,!1),this.setState({innerBlocks:e.innerBlocks})}},Object(l.__)("Reset Layout","woo-gutenberg-products-block")))))}),dt()(this,"renderViewMode",()=>{const{attributes:e}=this.props,{layoutConfig:t}=e,c=t&&0!==t.length,o=this.getTitle(),n=this.getIcon();return c?Object(r.createElement)(p.Disabled,null,Object(r.createElement)($t,{attributes:e})):((e,t)=>Object(r.createElement)(p.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(l.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block")))(o,n)}),dt()(this,"render",()=>{const{attributes:e}=this.props,{isEditing:t}=this.state,c=this.getTitle(),o=this.getIcon();return 0===Ot.o.productCount?((e,t)=>Object(r.createElement)(p.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(r.createElement)("p",null,Object(l.__)("You haven't published any products to list here yet.","woo-gutenberg-products-block")),Object(r.createElement)(p.Button,{className:"wc-block-products__add-product-button",isSecondary:!0,href:H.ADMIN_URL+"post-new.php?post_type=product"},Object(l.__)("Add new product","woo-gutenberg-products-block")+" ",Object(r.createElement)(n.a,{icon:jt.a})),Object(r.createElement)(p.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(l.__)("Learn more","woo-gutenberg-products-block"))))(c,o):Object(r.createElement)("div",{className:st("wc-block-all-products",e)},this.getBlockControls(),this.getInspectorControls(),t?this.renderEditMode():this.renderViewMode())})}}var Jt=Object(m.compose)(p.withSpokenMessages,Object(bt.withSelect)((e,t)=>{let{clientId:c}=t;const{getBlock:r}=e("core/block-editor");return{block:r(c)}}),Object(bt.withDispatch)(e=>{const{replaceInnerBlocks:t}=e("core/block-editor");return{replaceInnerBlocks:t}}))(Kt),Xt={columns:Object(H.getSetting)("default_columns",3),rows:Object(H.getSetting)("default_rows",3),alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:ht,isPreview:!1};const{name:Zt}=ot,ec={icon:{src:Object(r.createElement)(n.a,{icon:a.a,className:"wc-block-editor-components-block-icon"})},edit:Jt,save:function(e){let{attributes:t}=e;const c={};Object.keys(t).sort().forEach(e=>{c[e]=t[e]});const o={"data-attributes":JSON.stringify(c)};return Object(r.createElement)("div",at()({className:st("wc-block-all-products",t)},o),Object(r.createElement)(g.InnerBlocks.Content,null))},deprecated:it,defaults:Xt};Object(o.registerBlockType)(Zt,ec)},,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(42),o=c(0),n=c(23);c.p=n.l,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)(()=>Promise.all([c.e(0),c.e(1),c.e(2),c.e(27)]).then(c.bind(null,301)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(4),c.e(24)]).then(c.bind(null,537)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(4),c.e(36)]).then(c.bind(null,538)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(28)]).then(c.bind(null,302)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(4),c.e(20)]).then(c.bind(null,303)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(33)]).then(c.bind(null,304)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(29)]).then(c.bind(null,216)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)(()=>c.e(31).then(c.bind(null,305)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(23)]).then(c.bind(null,306)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(35)]).then(c.bind(null,307)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(32)]).then(c.bind(null,308)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)(()=>Promise.all([c.e(0),c.e(1),c.e(4),c.e(18)]).then(c.bind(null,539)))});const a=e=>Object(r.getRegisteredBlockComponents)(e)},,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return o}));const r=e=>e.is_purchasable||!1,o=e=>["simple","variable"].includes(e.type||"simple")}]); \ No newline at end of file diff --git a/build/all-products/block.json b/build/all-products/block.json new file mode 100644 index 00000000000..f5a37be8a3a --- /dev/null +++ b/build/all-products/block.json @@ -0,0 +1,44 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 1, + "textdomain": "woo-gutenberg-products-block", + "name": "woocommerce/all-products", + "title": "All Products", + "category": "woocommerce", + "keywords": [ "WooCommerce" ], + "description": "Display products from your store in a grid layout.", + "supports": { + "align": [ "wide", "full" ], + "html": false, + "multiple": false + }, + "example": { + "attributes": { + "isPreview": true + } + }, + "attributes": { + "columns": { + "type": "number" + }, + "rows": { + "type": "number" + }, + "alignButtons": { + "type": "boolean" + }, + "contentVisibility": { + "type": "object" + }, + "orderby": { + "type": "string" + }, + "layoutConfig": { + "type": "array" + }, + "isPreview": { + "type": "boolean", + "default": false + } + } +} diff --git a/build/all-reviews.asset.php b/build/all-reviews.asset.php new file mode 100644 index 00000000000..8b7ab8ed41f --- /dev/null +++ b/build/all-reviews.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '92747438c561c1ae6b419aeee8444f8a'); \ No newline at end of file diff --git a/build/all-reviews.js b/build/all-reviews.js new file mode 100644 index 00000000000..bbaf648c0cb --- /dev/null +++ b/build/all-reviews.js @@ -0,0 +1,9 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var o,a,i=t[0],s=t[1],l=t[2],u=0,b=[];uObject(o.createElement)(c.BlockControls,null,Object(o.createElement)(i.ToolbarGroup,{controls:[{icon:"edit",title:r,onClick:()=>t({editMode:!e}),isActive:e}]})),l=(e,t)=>{const r=Object(a.getSetting)("showAvatars",!0),c=Object(a.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:()=>t({showReviewRating:!e.showReviewRating})}),e.showReviewRating&&!c&&Object(o.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Product rating is disabled in your store settings.","woo-gutenberg-products-block"),{a:Object(o.createElement)("a",{href:Object(a.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:()=>t({showReviewerName:!e.showReviewerName})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:()=>t({showReviewImage:!e.showReviewImage})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:()=>t({showReviewDate:!e.showReviewDate})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:()=>t({showReviewContent:!e.showReviewContent})}),e.showReviewImage&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.__experimentalToggleGroupControl,{label:Object(n.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,onChange:e=>t({imageType:e})},Object(o.createElement)(i.__experimentalToggleGroupControlOption,{value:"reviewer",label:Object(n.__)("Reviewer photo","woo-gutenberg-products-block")}),Object(o.createElement)(i.__experimentalToggleGroupControlOption,{value:"product",label:Object(n.__)("Product","woo-gutenberg-products-block")})),"reviewer"===e.imageType&&!r&&Object(o.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Reviewer photo is disabled in your site settings.","woo-gutenberg-products-block"),{a:Object(o.createElement)("a",{href:Object(a.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},d=(e,t)=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:()=>t({showOrderby:!e.showOrderby})}),Object(o.createElement)(i.SelectControl,{label:Object(n.__)("Order Product Reviews by","woo-gutenberg-products-block"),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:e=>t({orderby:e})}),Object(o.createElement)(i.RangeControl,{label:Object(n.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:e=>t({reviewsOnPageLoad:e}),max:20,min:1}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:()=>t({showLoadMore:!e.showLoadMore})}),e.showLoadMore&&Object(o.createElement)(i.RangeControl,{label:Object(n.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:e=>t({reviewsOnLoadMore:e}),max:20,min:1}))},11:function(e,t){e.exports=window.wp.primitives},114:function(e,t){},119:function(e,t,r){"use strict";var o=r(0),n=r(4),c=r.n(n),a=r(28),i=r(10);r(157),t.a=Object(i.withInstanceId)(e=>{let{className:t,instanceId:r,label:n="",onChange:i,options:s,screenReaderLabel:l,value:d=""}=e;const u="wc-block-components-sort-select__select-"+r;return Object(o.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(o.createElement)(a.a,{label:n,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:u}}),Object(o.createElement)("select",{id:u,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:i,value:d},s&&s.map(e=>Object(o.createElement)("option",{key:e.key,value:e.key},e.label))))})},12:function(e,t){e.exports=window.React},122:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var o=r(1),n=r(23);const c={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(o.__)("July 15, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(o.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#", +/* translators: An example person name used for the block previews. */ +reviewer:Object(o.__)("Alice","woo-gutenberg-products-block"),review:`

${Object(o.__)("I bought this product last week and I'm very happy with it.","woo-gutenberg-products-block")}

\n`,reviewer_avatar_urls:{48:n.o.defaultAvatar,96:n.o.defaultAvatar},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(o.__)("July 12, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(o.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#", +/* translators: An example person name used for the block previews. */ +reviewer:Object(o.__)("Bob","woo-gutenberg-products-block"),review:`

${Object(o.__)("This product is awesome, I love it!","woo-gutenberg-products-block")}

\n`,reviewer_avatar_urls:{48:n.o.defaultAvatar,96:n.o.defaultAvatar},rating:null,verified:!1}]}}},13:function(e,t){e.exports=window.wp.htmlEntities},14:function(e,t){e.exports=window.wp.apiFetch},143:function(e,t,r){"use strict";t.a={editMode:{type:"boolean",default:!0},imageType:{type:"string",default:"reviewer"},orderby:{type:"string",default:"most-recent"},reviewsOnLoadMore:{type:"number",default:10},reviewsOnPageLoad:{type:"number",default:10},showLoadMore:{type:"boolean",default:!0},showOrderby:{type:"boolean",default:!0},showReviewDate:{type:"boolean",default:!0},showReviewerName:{type:"boolean",default:!0},showReviewImage:{type:"boolean",default:!0},showReviewRating:{type:"boolean",default:!0},showReviewContent:{type:"boolean",default:!0},previewReviews:{type:"array",default:null}}},144:function(e,t,r){"use strict";var o=r(6),n=r.n(o),c=r(0),a=r(5),i=(r(156),r(57));t.a=e=>{let{attributes:t}=e;return Object(c.createElement)("div",n()({},a.useBlockProps.save({className:Object(i.a)(t)}),Object(i.b)(t)))}},147:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(7),a=r(3),i=r(5),s=r(12),l=r(2),d=r(73),u=r(28);r(181);var b=e=>{let{onClick:t,label:r=Object(n.__)("Load more","woo-gutenberg-products-block"),screenReaderLabel:c=Object(n.__)("Load more","woo-gutenberg-products-block")}=e;return Object(o.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(o.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(o.createElement)(u.a,{label:r,screenReaderLabel:c})))},w=r(119);r(178);var p=e=>{let{onChange:t,readOnly:r,value:c}=e;return Object(o.createElement)(w.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:Object(n.__)("Order by","woo-gutenberg-products-block"),onChange:t,options:[{key:"most-recent",label:Object(n.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(n.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(n.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(n.__)("Order reviews by","woo-gutenberg-products-block"),value:c})},m=r(4),g=r.n(m),v=r(24),h=r.n(v),_=r(167),O=r.n(_);const j=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";const o=O()(e,{suffix:r,limit:t});return o.html},f=(e,t,r)=>(t<=r?e.start=e.middle+1:e.end=e.middle-1,e),k=(e,t,r,o)=>{const n=((e,t,r)=>{let o={start:0,middle:0,end:e.length};for(;o.start<=o.end;)o.middle=Math.floor((o.start+o.end)/2),t.innerHTML=j(e,o.middle),o=f(o,t.clientHeight,r);return o.middle})(e,t,r);return j(e,n-o.length,o)},y={className:"read-more-content",ellipsis:"…",lessText:Object(n.__)("Read less","woo-gutenberg-products-block"),maxLines:3,moreText:Object(n.__)("Read more","woo-gutenberg-products-block")};class R extends s.Component{constructor(e){super(e),this.state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},this.reviewContent=Object(s.createRef)(),this.reviewSummary=Object(s.createRef)(),this.getButton=this.getButton.bind(this),this.onClick=this.onClick.bind(this)}componentDidMount(){this.setSummary()}componentDidUpdate(e){e.maxLines===this.props.maxLines&&e.children===this.props.children||this.setState({clampEnabled:null,summary:"."},this.setSummary)}setSummary(){if(this.props.children){const{maxLines:e,ellipsis:t}=this.props;if(!this.reviewSummary.current||!this.reviewContent.current)return;const r=(this.reviewSummary.current.clientHeight+1)*e+1,o=this.reviewContent.current.clientHeight+1>r;this.setState({clampEnabled:o}),o&&this.setState({summary:k(this.reviewContent.current.innerHTML,this.reviewSummary.current,r,t)})}}getButton(){const{isExpanded:e}=this.state,{className:t,lessText:r,moreText:n}=this.props,c=e?r:n;if(c)return Object(o.createElement)("a",{href:"#more",className:t+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}onClick(e){e.preventDefault();const{isExpanded:t}=this.state;this.setState({isExpanded:!t})}render(){const{className:e}=this.props,{content:t,summary:r,clampEnabled:n,isExpanded:c}=this.state;return t?!1===n?Object(o.createElement)("div",{className:e},Object(o.createElement)("div",{ref:this.reviewContent},t)):Object(o.createElement)("div",{className:e},(!c||null===n)&&Object(o.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:r}}),(c||null===n)&&Object(o.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},t),this.getButton()):null}}h()(R,"defaultProps",y);var E=R;r(180);var S=e=>{let{attributes:t,review:r={}}=e;const{imageType:c,showReviewDate:a,showReviewerName:i,showReviewImage:s,showReviewRating:l,showReviewContent:d,showProductName:u}=t,{rating:b}=r,w=!Object.keys(r).length>0,p=Number.isFinite(b)&&l;return Object(o.createElement)("li",{className:g()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":w,"wc-block-components-review-list-item__item--has-image":s}),"aria-hidden":w},(u||a||i||s||p)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},s&&function(e,t,r){var c,a;return r||!e?Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(o.createElement)("img",{"aria-hidden":"true",alt:(null===(c=e.product_image)||void 0===c?void 0:c.alt)||"",src:(null===(a=e.product_image)||void 0===a?void 0:a.thumbnail)||""}):Object(o.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[96]||""}),e.verified&&Object(o.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(n.__)("Verified buyer","woo-gutenberg-products-block")},Object(n.__)("Verified buyer","woo-gutenberg-products-block")))}(r,c,w),(u||i||p||a)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},p&&function(e){const{rating:t}=e,r={width:t/5*100+"%"},c=Object(n.sprintf)( +/* translators: %f is referring to the average rating value */ +Object(n.__)("Rated %f out of 5","woo-gutenberg-products-block"),t),a={__html:Object(n.sprintf)( +/* translators: %s is referring to the average rating value */ +Object(n.__)("Rated %s out of 5","woo-gutenberg-products-block"),Object(n.sprintf)('%f',t))};return Object(o.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(o.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":c},Object(o.createElement)("span",{style:r,dangerouslySetInnerHTML:a})))}(r),u&&function(e){return Object(o.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(o.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(r),i&&function(e){const{reviewer:t=""}=e;return Object(o.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},t)}(r),a&&function(e){const{date_created:t,formatted_date_created:r}=e;return Object(o.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(r))),d&&function(e){return Object(o.createElement)(E,{maxLines:10,moreText:Object(n.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(n.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(o.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(r))};r(179);var C=e=>{let{attributes:t,reviews:r}=e;const n=Object(l.getSetting)("showAvatars",!0),c=Object(l.getSetting)("reviewRatingsEnabled",!0),a=(n||"product"===t.imageType)&&t.showReviewImage,i=c&&t.showReviewRating,s={...t,showReviewImage:a,showReviewRating:i};return Object(o.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(o.createElement)(S,{attributes:s}):r.map((e,t)=>Object(o.createElement)(S,{key:e.id||t,attributes:s,review:e})))},T=r(6),P=r.n(T),N=r(22),L=r.n(N),x=r(57),A=r(27);class M extends s.Component{render(){const{attributes:e,error:t,isLoading:r,noReviewsPlaceholder:c,reviews:i,totalReviews:s}=this.props;if(t)return Object(o.createElement)(d.a,{className:"wc-block-featured-product-error",error:t,isLoading:r});if(0===i.length&&!r)return Object(o.createElement)(c,{attributes:e});const u=Object(l.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(a.Disabled,null,e.showOrderby&&u&&Object(o.createElement)(p,{readOnly:!0,value:e.orderby}),Object(o.createElement)(C,{attributes:e,reviews:i}),e.showLoadMore&&s>i.length&&Object(o.createElement)(b,{screenReaderLabel:Object(n.__)("Load more reviews","woo-gutenberg-products-block")}))}}var I=(e=>{class t extends s.Component{constructor(){super(...arguments),h()(this,"isPreview",!!this.props.attributes.previewReviews),h()(this,"delayedAppendReviews",this.props.delayFunction(this.appendReviews)),h()(this,"isMounted",!1),h()(this,"state",{error:null,loading:!0,reviews:this.isPreview?this.props.attributes.previewReviews:[],totalReviews:this.isPreview?this.props.attributes.previewReviews.length:0}),h()(this,"setError",async e=>{if(!this.isMounted)return;const{onReviewsLoadError:t}=this.props,r=await Object(A.a)(e);this.setState({reviews:[],loading:!1,error:r}),t(r)})}componentDidMount(){this.isMounted=!0,this.replaceReviews()}componentDidUpdate(e){e.reviewsToDisplay0&&void 0!==arguments[0]?arguments[0]:[];const{reviewsToDisplay:t}=this.props,{totalReviews:r}=this.state,o=Math.min(r,t)-e.length;return this.setState({loading:!0,reviews:e.concat(Array(o).fill({}))}),Object(x.c)(this.getArgs(e.length)).then(t=>{let{reviews:r,totalReviews:o}=t;return this.isMounted&&this.setState({reviews:e.filter(e=>Object.keys(e).length).concat(r),totalReviews:o,loading:!1,error:null}),{newReviews:r}}).catch(this.setError)}render(){const{reviewsToDisplay:t}=this.props,{error:r,loading:n,reviews:c,totalReviews:a}=this.state;return Object(o.createElement)(e,P()({},this.props,{error:r,isLoading:n,reviews:c.slice(0,t),totalReviews:a}))}}h()(t,"defaultProps",{delayFunction:e=>e,onReviewsAppended:()=>{},onReviewsLoadError:()=>{},onReviewsReplaced:()=>{}});const{displayName:r=e.name||"Component"}=e;return t.displayName=`WithReviews( ${r} )`,t})(M);t.a=e=>{let{attributes:t,icon:r,name:s,noReviewsPlaceholder:l}=e;const{categoryIds:d,productId:u,reviewsOnPageLoad:b,showProductName:w,showReviewDate:p,showReviewerName:m,showReviewContent:g,showReviewImage:v,showReviewRating:h}=t,{order:_,orderby:O}=Object(x.d)(t.orderby),j=!(g||h||p||m||v||w),f=Object(i.useBlockProps)({className:Object(x.a)(t)});return j?Object(o.createElement)(a.Placeholder,{icon:r,label:s},Object(n.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block")):Object(o.createElement)("div",f,Object(o.createElement)(I,{attributes:t,categoryIds:d,delayFunction:e=>Object(c.debounce)(e,400),noReviewsPlaceholder:l,orderby:O,order:_,productId:u,reviewsToDisplay:b}))}},156:function(e,t){},157:function(e,t){},178:function(e,t){},179:function(e,t){},180:function(e,t){},181:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},22:function(e,t){e.exports=window.wp.isShallowEqual},23:function(e,t,r){"use strict";r.d(t,"o",(function(){return c})),r.d(t,"m",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"n",(function(){return s})),r.d(t,"j",(function(){return l})),r.d(t,"e",(function(){return d})),r.d(t,"f",(function(){return u})),r.d(t,"g",(function(){return b})),r.d(t,"k",(function(){return w})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return m})),r.d(t,"h",(function(){return g})),r.d(t,"a",(function(){return v})),r.d(t,"i",(function(){return h})),r.d(t,"b",(function(){return _}));var o,n=r(2);const c=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",i=c.pluginUrl+"build/",s=c.buildPhase,l=null===(o=n.STORE_PAGES.shop)||void 0===o?void 0:o.permalink,d=n.STORE_PAGES.checkout.id,u=n.STORE_PAGES.checkout.permalink,b=n.STORE_PAGES.privacy.permalink,w=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),p=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),m=n.STORE_PAGES.cart.permalink,g=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),v=Object(n.getSetting)("allowedCountries",{}),h=Object(n.getSetting)("shippingStates",{}),_=Object(n.getSetting)("allowedStates",{})},27:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return a}));var o=r(1),n=r(13);const c=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},a=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(n.decodeEntities)(e.message):Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},28:function(e,t,r){"use strict";var o=r(0),n=r(4),c=r.n(n);t.a=e=>{let t,{label:r,screenReaderLabel:n,wrapperElement:a,wrapperProps:i={}}=e;const s=null!=r,l=null!=n;return!s&&l?(t=a||"span",i={...i,className:c()(i.className,"screen-reader-text")},Object(o.createElement)(t,i,n)):(t=a||o.Fragment,s&&l&&r!==n?Object(o.createElement)(t,i,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,i,r))}},3:function(e,t){e.exports=window.wp.components},32:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(33);t.a=e=>{let{error:t}=e;return Object(o.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:r}=e;return t?"general"===r?Object(o.createElement)("span",null,Object(n.__)("The following error was returned","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(t))):"api"===r?Object(o.createElement)("span",null,Object(n.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(t))):t:Object(n.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},33:function(e,t){e.exports=window.wp.escapeHtml},366:function(e,t,r){e.exports=r(475)},475:function(e,t,r){"use strict";r.r(t);var o=r(0),n=r(1),c=r(8),a=r(113),i=r(506),s=(r(156),r(5)),l=r(3),d=r(147),u=()=>Object(o.createElement)(l.Placeholder,{className:"wc-block-all-reviews",icon:Object(o.createElement)(a.a,{icon:i.a,className:"block-editor-block-icon"}),label:Object(n.__)("All Reviews","woo-gutenberg-products-block")},Object(n.__)("This block shows a list of all product reviews. Your store does not have any reviews yet, but they will show up here when it does.","woo-gutenberg-products-block")),b=r(105),w=r(143),p=r(144),m=r(122);Object(c.registerBlockType)("woocommerce/all-reviews",{apiVersion:2,title:Object(n.__)("All Reviews","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(a.a,{icon:i.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(n.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(n.__)("Show a list of all product reviews.","woo-gutenberg-products-block"),supports:{html:!1,color:{background:!1},typography:{fontSize:!0}},example:{...m.a,attributes:{...m.a.attributes,showProductName:!0}},attributes:{...w.a,showProductName:{type:"boolean",default:!0}},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:r}=e;return"woocommerce_recent_reviews"===t&&!(null==r||!r.raw)},transform:e=>{let{instance:t}=e;return Object(c.createBlock)("woocommerce/all-reviews",{reviewsOnPageLoad:t.raw.number,imageType:"product",showLoadMore:!1,showOrderby:!1,showReviewDate:!1,showReviewContent:!1})}}]},edit:e=>{let{attributes:t,setAttributes:r}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(s.InspectorControls,{key:"inspector"},Object(o.createElement)(l.PanelBody,{title:Object(n.__)("Content","woo-gutenberg-products-block")},Object(o.createElement)(l.ToggleControl,{label:Object(n.__)("Product name","woo-gutenberg-products-block"),checked:t.showProductName,onChange:()=>r({showProductName:!t.showProductName})}),Object(b.b)(t,r)),Object(o.createElement)(l.PanelBody,{title:Object(n.__)("List Settings","woo-gutenberg-products-block")},Object(b.c)(t,r))),Object(o.createElement)(d.a,{attributes:t,icon:Object(o.createElement)(a.a,{icon:i.a,className:"block-editor-block-icon"}),name:Object(n.__)("All Reviews","woo-gutenberg-products-block"),noReviewsPlaceholder:u}))},save:p.a})},5:function(e,t){e.exports=window.wp.blockEditor},57:function(e,t,r){"use strict";r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return u}));var o=r(14),n=r.n(o),c=r(4),a=r.n(c),i=r(2);const s=e=>{if(Object(i.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=e=>n()({path:"/wc/store/v1/products/reviews?"+Object.entries(e).map(e=>e.join("=")).join("&"),parse:!1}).then(e=>e.json().then(t=>({reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}))),d=e=>{const{className:t,categoryIds:r,productId:o,showReviewDate:n,showReviewerName:c,showReviewContent:i,showProductName:s,showReviewImage:l,showReviewRating:d}=e;let u="wc-block-all-reviews";return o&&(u="wc-block-reviews-by-product"),Array.isArray(r)&&(u="wc-block-reviews-by-category"),a()(u,t,{"has-image":l,"has-name":c,"has-date":n,"has-rating":d,"has-content":i,"has-product-name":s})},u=e=>{const{categoryIds:t,imageType:r,orderby:o,productId:n,reviewsOnPageLoad:c,reviewsOnLoadMore:a,showLoadMore:i,showOrderby:s}=e,l={"data-image-type":r,"data-orderby":o,"data-reviews-on-page-load":c,"data-reviews-on-load-more":a,"data-show-load-more":i,"data-show-orderby":s};return n&&(l["data-product-id"]=n),Array.isArray(t)&&(l["data-category-ids"]=t.join(",")),l}},7:function(e,t){e.exports=window.lodash},73:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(113),a=r(172),i=r(4),s=r.n(i),l=r(3),d=r(32);r(114),t.a=e=>{let{className:t,error:r,isLoading:i=!1,onRetry:u}=e;return Object(o.createElement)(l.Placeholder,{icon:Object(o.createElement)(c.a,{icon:a.a}),label:Object(n.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:s()("wc-block-api-error",t)},Object(o.createElement)(d.a,{error:r}),u&&Object(o.createElement)(o.Fragment,null,i?Object(o.createElement)(l.Spinner,null):Object(o.createElement)(l.Button,{isSecondary:!0,onClick:u},Object(n.__)("Retry","woo-gutenberg-products-block"))))}},8:function(e,t){e.exports=window.wp.blocks}}); \ No newline at end of file diff --git a/build/attribute-filter-frontend.asset.php b/build/attribute-filter-frontend.asset.php new file mode 100644 index 00000000000..70620c85559 --- /dev/null +++ b/build/attribute-filter-frontend.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning'), 'version' => '74c067c5699e0c466551d27ee3182cdf'); \ No newline at end of file diff --git a/build/attribute-filter-frontend.js b/build/attribute-filter-frontend.js new file mode 100644 index 00000000000..d9c68609ec8 --- /dev/null +++ b/build/attribute-filter-frontend.js @@ -0,0 +1,23 @@ +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=221)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.lodash},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t{let{imageUrl:t=a.l+"/block-error.svg",header:n=Object(c.__)("Oops!","woo-gutenberg-products-block"),text:r=Object(c.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:i=Object(c.__)("Error:","woo-gutenberg-products-block"),button:l,showErrorBlock:u=!0}=e;return u?Object(s.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(s.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(s.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},n&&Object(s.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},n),r&&Object(s.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},r),o&&Object(s.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},i?i+" ":"",o),l&&Object(s.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};n(35);class u extends i.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(s.createElement)(s.Fragment,null,Object(s.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:n=!0,showErrorBlock:r=!0,text:o,errorMessagePrefix:i,renderError:c,button:a}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof c?c({errorMessage:u}):Object(s.createElement)(l,{showErrorBlock:r,errorMessage:n?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:i,button:a}):this.props.children}}t.a=u},,function(e,t){e.exports=window.wp.htmlEntities},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return r(e)&&t in e}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t,n){"use strict";var r=n(0),o=n(4),s=n.n(o);t.a=e=>{let t,{label:n,screenReaderLabel:o,wrapperElement:i,wrapperProps:c={}}=e;const a=null!=n,l=null!=o;return!a&&l?(t=i||"span",c={...c,className:s()(c.className,"screen-reader-text")},Object(r.createElement)(t,c,o)):(t=i||r.Fragment,a&&l&&n!==o?Object(r.createElement)(t,c,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,c,n))}},function(e,t){e.exports=window.wp.a11y},function(e,t,n){"use strict";(function(e){var r=n(0);n(37);const o=Object(r.createContext)({slots:{},fills:{},registerSlot:()=>{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,n(55))},function(e,t){e.exports=window.wp.deprecated},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(0);const o=Object(r.createContext)("page"),s=()=>Object(r.useContext)(o);o.Provider},,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(11),s=n.n(o);function i(e){const t=Object(r.useRef)(e);return s()(e,t.current)||(t.current=e),t.current}},,,function(e,t,n){"use strict";var r=n(4),o=n.n(r),s=n(0);t.a=Object(s.forwardRef)((function({as:e="div",className:t,...n},r){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(s.createElement)(e,t)}({as:e,className:o()("components-visually-hidden",t),...n,ref:r})}))},function(e,t){},,function(e,t){e.exports=window.wp.warning},function(e,t,n){"use strict";var r=n(8),o=n(0),s=n(13),i=function({icon:e,className:t,...n}){const s=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(o.createElement)("span",Object(r.a)({className:s},n))};t.a=function({icon:e=null,size:t=24,...n}){if("string"==typeof e)return Object(o.createElement)(i,Object(r.a)({icon:e},n));if(Object(o.isValidElement)(e)&&i===e.type)return Object(o.cloneElement)(e,{...n});if("function"==typeof e)return e.prototype instanceof o.Component?Object(o.createElement)(e,{size:t,...n}):e({size:t,...n});if(e&&("svg"===e.type||e.type===s.SVG)){const r={width:t,height:t,...e.props,...n};return Object(o.createElement)(s.SVG,r)}return Object(o.isValidElement)(e)?Object(o.cloneElement)(e,{size:t,...n}):e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return f}));var r=n(6),o=n(7),s=n(0),i=n(11),c=n.n(i),a=n(31),l=n(61),u=n(26);const d=e=>{const t=Object(u.a)();e=e||t;const n=Object(o.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:i}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[n,Object(s.useCallback)(t=>{i(e,t)},[e,i])]},p=(e,t,n)=>{const i=Object(u.a)();n=n||i;const c=Object(o.useSelect)(o=>o(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t),[n,e]),{setQueryValue:a}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[c,Object(s.useCallback)(t=>{a(n,e,t)},[n,e,a])]},f=(e,t)=>{const n=Object(u.a)();t=t||n;const[r,o]=d(t),i=Object(a.a)(r),p=Object(a.a)(e),f=Object(l.a)(p),b=Object(s.useRef)(!1);return Object(s.useEffect)(()=>{c()(f,p)||(o(Object.assign({},i,p)),b.current=!0)},[i,p,f,o]),b.current?[r,o]:[e,o]}},,,function(e,t,n){"use strict";var r=n(8),o=n(0),s=n(4),i=n.n(s),c=n(3),a=n(25),l=n.n(a),u=n(9),d=n(44),p=n(71),f=n(1);function b(e,t,n){const{defaultView:r}=t,{frameElement:o}=r;if(!o||t===n.ownerDocument)return e;const s=o.getBoundingClientRect();return new r.DOMRect(e.left+s.left,e.top+s.top,e.width,e.height)}let m=0;function h(e){const t=document.scrollingElement||document.body;e&&(m=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=m)}let g=0;function v(){return Object(o.useEffect)(()=>(0===g&&h(!0),++g,()=>{1===g&&h(!1),--g}),[]),null}var O=n(24);function w(e){const t=Object(o.useContext)(O.a),n=t.slots[e]||{},r=t.fills[e],s=Object(o.useMemo)(()=>r||[],[r]);return{...n,updateSlot:Object(o.useCallback)(n=>{t.updateSlot(e,n)},[e,t.updateSlot]),unregisterSlot:Object(o.useCallback)(n=>{t.unregisterSlot(e,n)},[e,t.unregisterSlot]),fills:s,registerFill:Object(o.useCallback)(n=>{t.registerFill(e,n)},[e,t.registerFill]),unregisterFill:Object(o.useCallback)(n=>{t.unregisterFill(e,n)},[e,t.unregisterFill])}}var j=Object(o.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function y({name:e,children:t,registerFill:n,unregisterFill:r}){const s=(e=>{const{getSlot:t,subscribe:n}=Object(o.useContext)(j),[r,s]=Object(o.useState)(t(e));return Object(o.useEffect)(()=>(s(t(e)),n(()=>{s(t(e))})),[e]),r})(e),i=Object(o.useRef)({name:e,children:t});return Object(o.useLayoutEffect)(()=>(n(e,i.current),()=>r(e,i.current)),[]),Object(o.useLayoutEffect)(()=>{i.current.children=t,s&&s.forceUpdate()},[t]),Object(o.useLayoutEffect)(()=>{e!==i.current.name&&(r(i.current.name,i.current),i.current.name=e,n(e,i.current))},[e]),s&&s.node?(Object(c.isFunction)(t)&&(t=t(s.props.fillProps)),Object(o.createPortal)(t,s.node)):null}var E=e=>Object(o.createElement)(j.Consumer,null,({registerFill:t,unregisterFill:n})=>Object(o.createElement)(y,Object(r.a)({},e,{registerFill:t,unregisterFill:n})));class k extends o.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:n,registerSlot:r}=this.props;e.name!==t&&(n(e.name),r(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:n={},getFills:r}=this.props,s=Object(c.map)(r(t,this),e=>{const t=Object(c.isFunction)(e.children)?e.children(n):e.children;return o.Children.map(t,(e,t)=>{if(!e||Object(c.isString)(e))return e;const n=e.key||t;return Object(o.cloneElement)(e,{key:n})})}).filter(Object(c.negate)(o.isEmptyElement));return Object(o.createElement)(o.Fragment,null,Object(c.isFunction)(e)?e(s):s)}}var _=e=>Object(o.createElement)(j.Consumer,null,({registerSlot:t,unregisterSlot:n,getFills:s})=>Object(o.createElement)(k,Object(r.a)({},e,{registerSlot:t,unregisterSlot:n,getFills:s})));function S(){const[,e]=Object(o.useState)({}),t=Object(o.useRef)(!0);return Object(o.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function x({name:e,children:t}){const n=w(e),r=Object(o.useRef)({rerender:S()});return Object(o.useEffect)(()=>(n.registerFill(r),()=>{n.unregisterFill(r)}),[n.registerFill,n.unregisterFill]),n.ref&&n.ref.current?("function"==typeof t&&(t=t(n.fillProps)),Object(o.createPortal)(t,n.ref.current)):null}var T=Object(o.forwardRef)((function({name:e,fillProps:t={},as:n="div",...s},i){const c=Object(o.useContext)(O.a),a=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(c.registerSlot(e,a,t),()=>{c.unregisterSlot(e,a)}),[c.registerSlot,c.unregisterSlot,e]),Object(o.useLayoutEffect)(()=>{c.updateSlot(e,t)}),Object(o.createElement)(n,Object(r.a)({ref:Object(u.useMergeRefs)([i,a])},s))}));function C(e){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(E,e),Object(o.createElement)(x,e))}n(11),o.Component;const I=Object(o.forwardRef)(({bubblesVirtually:e,...t},n)=>e?Object(o.createElement)(T,Object(r.a)({},t,{ref:n})):Object(o.createElement)(_,t));function L(e){return"appear"===e?"top":"left"}function A(e,t){const{paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:s}=(i=t).ownerDocument.defaultView.getComputedStyle(i);var i;const c=n?parseInt(n,10):0,a=r?parseInt(r,10):0,l=o?parseInt(o,10):0,u=s?parseInt(s,10):0;return{x:e.left+l,y:e.top+c,width:e.width-l-u,height:e.height-c-a,left:e.left+l,right:e.right-u,top:e.top+c,bottom:e.bottom-a}}function F(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function P(e,t,n=""){e.style[t]!==n&&(e.style[t]=n)}function R(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const M=Object(o.forwardRef)(({headerTitle:e,onClose:t,children:n,className:s,noArrow:c=!0,isAlternate:a,position:m="bottom right",range:h,focusOnMount:g="firstElement",anchorRef:O,shouldAnchorIncludePadding:j,anchorRect:y,getAnchorRect:E,expandOnMobile:k,animate:_=!0,onClickOutside:S,onFocusOutside:x,__unstableStickyBoundaryElement:T,__unstableSlotName:I="Popover",__unstableObserveElement:M,__unstableBoundaryParent:N,__unstableForcePosition:B,__unstableForceXAlignment:D,...V},W)=>{const H=Object(o.useRef)(null),q=Object(o.useRef)(null),K=Object(o.useRef)(),U=Object(u.useViewportMatch)("medium","<"),[z,$]=Object(o.useState)(),Q=w(I),Y=k&&U,[J,X]=Object(u.useResizeObserver)();c=Y||c,Object(o.useLayoutEffect)(()=>{if(Y)return R(K.current,"is-without-arrow",c),R(K.current,"is-alternate",a),F(K.current,"data-x-axis"),F(K.current,"data-y-axis"),P(K.current,"top"),P(K.current,"left"),P(q.current,"maxHeight"),void P(q.current,"maxWidth");const e=()=>{if(!K.current||!q.current)return;let e=function(e,t,n,r=!1,o,s){if(t)return t;if(n){if(!e.current)return;const t=n(e.current);return b(t,t.ownerDocument||e.current.ownerDocument,s)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==r?void 0:r.cloneRange))return b(Object(d.getRectangleFromRange)(r),r.endContainer.ownerDocument,s);if("function"==typeof(null==r?void 0:r.getBoundingClientRect)){const e=b(r.getBoundingClientRect(),r.ownerDocument,s);return o?e:A(e,r)}const{top:e,bottom:t}=r,n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),c=b(new window.DOMRect(n.left,n.top,n.width,i.bottom-n.top),e.ownerDocument,s);return o?c:A(c,r)}if(!e.current)return;const{parentNode:i}=e.current,c=i.getBoundingClientRect();return o?c:A(c,i)}(H,y,E,O,j,K.current);if(!e)return;const{offsetParent:t,ownerDocument:n}=K.current;let r,o=0;if(t&&t!==n.body){const n=t.getBoundingClientRect();o=n.top,e=new window.DOMRect(e.left-n.left,e.top-n.top,e.width,e.height)}var s;N&&(r=null===(s=K.current.closest(".popover-slot"))||void 0===s?void 0:s.parentNode);const i=X.height?X:q.current.getBoundingClientRect(),{popoverTop:l,popoverLeft:u,xAxis:p,yAxis:h,contentHeight:g,contentWidth:v}=function(e,t,n="top",r,o,s,i,c,a){const[l,u="center",d]=n.split(" "),p=function(e,t,n,r,o,s,i,c){const{height:a}=t;if(o){const t=o.getBoundingClientRect().top+a-i;if(e.top<=t)return{yAxis:n,popoverTop:Math.min(e.bottom,t)}}let l=e.top+e.height/2;"bottom"===r?l=e.bottom:"top"===r&&(l=e.top);const u={popoverTop:l,contentHeight:(l-a/2>0?a/2:l)+(l+a/2>window.innerHeight?window.innerHeight-l:a/2)},d={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a};let f,b=n,m=null;if(!o&&!c)if("middle"===n&&u.contentHeight===a)b="middle";else if("top"===n&&d.contentHeight===a)b="top";else if("bottom"===n&&p.contentHeight===a)b="bottom";else{b=d.contentHeight>p.contentHeight?"top":"bottom";const e="top"===b?d.contentHeight:p.contentHeight;m=e!==a?e:null}return f="middle"===b?u.popoverTop:"top"===b?d.popoverTop:p.popoverTop,{yAxis:b,popoverTop:f,contentHeight:m}}(e,t,l,d,r,0,s,c);return{...function(e,t,n,r,o,s,i,c,a){const{width:l}=t;"left"===n&&Object(f.isRTL)()?n="right":"right"===n&&Object(f.isRTL)()&&(n="left"),"left"===r&&Object(f.isRTL)()?r="right":"right"===r&&Object(f.isRTL)()&&(r="left");const u=Math.round(e.left+e.width/2),d={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)};let p=e.left;"right"===r?p=e.right:"middle"===s||a||(p=u);let b=e.right;"left"===r?b=e.left:"middle"===s||a||(b=u);const m={popoverLeft:p,contentWidth:p-l>0?l:p},h={popoverLeft:b,contentWidth:b+l>window.innerWidth?window.innerWidth-b:l};let g,v=n,O=null;if(!o&&!c)if("center"===n&&d.contentWidth===l)v="center";else if("left"===n&&m.contentWidth===l)v="left";else if("right"===n&&h.contentWidth===l)v="right";else{v=m.contentWidth>h.contentWidth?"left":"right";const e="left"===v?m.contentWidth:h.contentWidth;l>window.innerWidth&&(O=window.innerWidth),e!==l&&(v="center",d.popoverLeft=window.innerWidth/2)}if(g="center"===v?d.popoverLeft:"left"===v?m.popoverLeft:h.popoverLeft,i){const e=i.getBoundingClientRect();g=Math.min(g,e.right-l),Object(f.isRTL)()||(g=Math.max(g,0))}return{xAxis:v,popoverLeft:g,contentWidth:O}}(e,t,u,d,r,p.yAxis,i,c,a),...p}}(e,i,m,T,K.current,o,r,B,D);"number"==typeof l&&"number"==typeof u&&(P(K.current,"top",l+"px"),P(K.current,"left",u+"px")),R(K.current,"is-without-arrow",c||"center"===p&&"middle"===h),R(K.current,"is-alternate",a),F(K.current,"data-x-axis",p),F(K.current,"data-y-axis",h),P(q.current,"maxHeight","number"==typeof g?g+"px":""),P(q.current,"maxWidth","number"==typeof v?v+"px":""),$(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[h]||"middle"))};e();const{ownerDocument:t}=K.current,{defaultView:n}=t,r=n.setInterval(e,500);let o;const s=()=>{n.cancelAnimationFrame(o),o=n.requestAnimationFrame(e)};n.addEventListener("click",s),n.addEventListener("resize",e),n.addEventListener("scroll",e,!0);const i=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(O);let l;return i&&i!==t&&(i.defaultView.addEventListener("resize",e),i.defaultView.addEventListener("scroll",e,!0)),M&&(l=new n.MutationObserver(e),l.observe(M,{attributes:!0})),()=>{n.clearInterval(r),n.removeEventListener("resize",e),n.removeEventListener("scroll",e,!0),n.removeEventListener("click",s),n.cancelAnimationFrame(o),i&&i!==t&&(i.defaultView.removeEventListener("resize",e),i.defaultView.removeEventListener("scroll",e,!0)),l&&l.disconnect()}},[Y,y,E,O,j,m,X,T,M,N]);const Z=(e,n)=>{if("focus-outside"===e&&x)x(n);else if("focus-outside"===e&&S){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>n.relatedTarget}),l()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),S(e)}else t&&t()},[ee,te]=Object(u.__experimentalUseDialog)({focusOnMount:g,__unstableOnClose:Z,onClose:Z}),ne=Object(u.useMergeRefs)([K,ee,W]),re=Boolean(_&&z)&&function(e){if("loading"===e.type)return i()("components-animate__loading");const{type:t,origin:n=L(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return i()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?i()("components-animate__slide-in","is-from-"+n):void 0}({type:"appear",origin:z});let oe=Object(o.createElement)("div",Object(r.a)({className:i()("components-popover",s,re,{"is-expanded":Y,"is-without-arrow":c,"is-alternate":a})},V,{ref:ne},te,{tabIndex:"-1"}),Y&&Object(o.createElement)(v,null),Y&&Object(o.createElement)("div",{className:"components-popover__header"},Object(o.createElement)("span",{className:"components-popover__header-title"},e),Object(o.createElement)(G,{className:"components-popover__close",icon:p.a,onClick:t})),Object(o.createElement)("div",{ref:q,className:"components-popover__content"},Object(o.createElement)("div",{style:{position:"relative"}},J,n)));return Q.ref&&(oe=Object(o.createElement)(C,{name:I},oe)),O||y?oe:Object(o.createElement)("span",{ref:H},oe)});M.Slot=Object(o.forwardRef)((function({name:e="Popover"},t){return Object(o.createElement)(I,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var N=M,B=function({shortcut:e,className:t}){if(!e)return null;let n,r;return Object(c.isString)(e)&&(n=e),Object(c.isObject)(e)&&(n=e.display,r=e.ariaLabel),Object(o.createElement)("span",{className:t,"aria-label":r},n)};const D=Object(o.createElement)("div",{className:"event-catcher"}),V=({eventHandlers:e,child:t,childrenWithPopover:n})=>Object(o.cloneElement)(Object(o.createElement)("span",{className:"disabled-element-wrapper"},Object(o.cloneElement)(D,e),Object(o.cloneElement)(t,{children:n}),","),e),W=({child:e,eventHandlers:t,childrenWithPopover:n})=>Object(o.cloneElement)(e,{...t,children:n}),H=(e,t,n)=>{if(1!==o.Children.count(e))return;const r=o.Children.only(e);"function"==typeof r.props[t]&&r.props[t](n)};var q=function({children:e,position:t,text:n,shortcut:r}){const[s,i]=Object(o.useState)(!1),[a,l]=Object(o.useState)(!1),d=Object(u.useDebounce)(l,700),p=t=>{H(e,"onMouseDown",t),document.addEventListener("mouseup",m),i(!0)},f=t=>{H(e,"onMouseUp",t),document.removeEventListener("mouseup",m),i(!1)},b=e=>"mouseUp"===e?f:"mouseDown"===e?p:void 0,m=b("mouseUp"),h=(t,n)=>r=>{if(H(e,t,r),r.currentTarget.disabled)return;if("focus"===r.type&&s)return;d.cancel();const o=Object(c.includes)(["focus","mouseenter"],r.type);o!==a&&(n?d(o):l(o))},g=()=>{d.cancel(),document.removeEventListener("mouseup",m)};if(Object(o.useEffect)(()=>g,[]),1!==o.Children.count(e))return e;const v={onMouseEnter:h("onMouseEnter",!0),onMouseLeave:h("onMouseLeave"),onClick:h("onClick"),onFocus:h("onFocus"),onBlur:h("onBlur"),onMouseDown:b("mouseDown")},O=o.Children.only(e),{children:w,disabled:j}=O.props;return(j?V:W)({child:O,eventHandlers:v,childrenWithPopover:(({grandchildren:e,isOver:t,position:n,text:r,shortcut:s})=>Object(o.concatChildren)(e,t&&Object(o.createElement)(N,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(o.createElement)(B,{className:"components-tooltip__shortcut",shortcut:s}))))({grandchildren:w,isOver:a,position:t,text:n,shortcut:r})})},K=n(38),U=n(34);const z=["onMouseDown","onClick"];var G=t.a=Object(o.forwardRef)((function(e,t){const{href:n,target:s,isSmall:a,isPressed:u,isBusy:d,isDestructive:p,className:f,disabled:b,icon:m,iconPosition:h="left",iconSize:g,showTooltip:v,tooltipPosition:O,shortcut:w,label:j,children:y,text:E,variant:k,__experimentalIsFocusable:_,describedBy:S,...x}=function({isDefault:e,isPrimary:t,isSecondary:n,isTertiary:r,isLink:o,variant:s,...i}){let c=s;var a,u,d,p,f;return t&&(null!==(a=c)&&void 0!==a||(c="primary")),r&&(null!==(u=c)&&void 0!==u||(c="tertiary")),n&&(null!==(d=c)&&void 0!==d||(c="secondary")),e&&(l()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(p=c)&&void 0!==p||(c="secondary")),o&&(null!==(f=c)&&void 0!==f||(c="link")),{...i,variant:c}}(e),T=i()("components-button",f,{"is-secondary":"secondary"===k,"is-primary":"primary"===k,"is-small":a,"is-tertiary":"tertiary"===k,"is-pressed":u,"is-busy":d,"is-link":"link"===k,"is-destructive":p,"has-text":!!m&&!!y,"has-icon":!!m}),C=b&&!_,I=void 0===n||C?"button":"a",L="a"===I?{href:n,target:s}:{type:"button",disabled:C,"aria-pressed":u};if(b&&_){L["aria-disabled"]=!0;for(const e of z)x[e]=e=>{e.stopPropagation(),e.preventDefault()}}const A=!C&&(v&&j||w||!!j&&(!y||Object(c.isArray)(y)&&!y.length)&&!1!==v),F=S?Object(c.uniqueId)():null,P=x["aria-describedby"]||F,R=Object(o.createElement)(I,Object(r.a)({},L,x,{className:T,"aria-label":x["aria-label"]||j,"aria-describedby":P,ref:t}),m&&"left"===h&&Object(o.createElement)(K.a,{icon:m,size:g}),E&&Object(o.createElement)(o.Fragment,null,E),m&&"right"===h&&Object(o.createElement)(K.a,{icon:m,size:g}),y);return A?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(q,{text:S||j,shortcut:w,position:O},R),S&&Object(o.createElement)(U.a,null,Object(o.createElement)("span",{id:F},S))):Object(o.createElement)(o.Fragment,null,R,S&&Object(o.createElement)(U.a,null,Object(o.createElement)("span",{id:F},S)))}))},,function(e,t){e.exports=window.wp.dom},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"string"==typeof e},,,function(e,t,n){"use strict";n.d(t,"n",(function(){return s})),n.d(t,"l",(function(){return i})),n.d(t,"k",(function(){return c})),n.d(t,"m",(function(){return a})),n.d(t,"i",(function(){return l})),n.d(t,"d",(function(){return u})),n.d(t,"f",(function(){return d})),n.d(t,"j",(function(){return p})),n.d(t,"c",(function(){return f})),n.d(t,"e",(function(){return b})),n.d(t,"g",(function(){return m})),n.d(t,"a",(function(){return h})),n.d(t,"h",(function(){return g})),n.d(t,"b",(function(){return v}));var r,o=n(2);const s=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=s.pluginUrl+"images/",c=s.pluginUrl+"build/",a=s.buildPhase,l=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),f=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),b=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),m=Object(o.getSetting)("shippingCountries",{}),h=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),v=Object(o.getSetting)("allowedStates",{})},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(5);function o(e,t,n){var o=this,s=Object(r.useRef)(null),i=Object(r.useRef)(0),c=Object(r.useRef)(null),a=Object(r.useRef)([]),l=Object(r.useRef)(),u=Object(r.useRef)(),d=Object(r.useRef)(e),p=Object(r.useRef)(!0);d.current=e;var f=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var b=!!(n=n||{}).leading,m=!("trailing"in n)||!!n.trailing,h="maxWait"in n,g=h?Math.max(+n.maxWait||0,t):null;return Object(r.useEffect)((function(){return p.current=!0,function(){p.current=!1}}),[]),Object(r.useMemo)((function(){var e=function(e){var t=a.current,n=l.current;return a.current=l.current=null,i.current=e,u.current=d.current.apply(n,t)},n=function(e,t){f&&cancelAnimationFrame(c.current),c.current=f?requestAnimationFrame(e):setTimeout(e,t)},r=function(e){if(!p.current)return!1;var n=e-s.current,r=e-i.current;return!s.current||n>=t||n<0||h&&r>=g},v=function(t){return c.current=null,m&&a.current?e(t):(a.current=l.current=null,u.current)},O=function(){var e=Date.now();if(r(e))return v(e);if(p.current){var o=e-s.current,c=e-i.current,a=t-o,l=h?Math.min(a,g-c):a;n(O,l)}},w=function(){for(var d=[],f=0;f{let{Block:t,containers:n,getProps:r=(()=>({})),getErrorBoundaryProps:c=(()=>({}))}=e;0!==n.length&&Array.prototype.forEach.call(n,(e,n)=>{const a=r(e,n),l=c(e,n),u={...e.dataset,...a.attributes||{}};(e=>{let{Block:t,container:n,attributes:r={},props:c={},errorBoundaryProps:a={}}=e;Object(s.render)(Object(s.createElement)(i.a,a,Object(s.createElement)(s.Suspense,{fallback:Object(s.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(s.createElement)(t,o()({},c,{attributes:r})))),n,()=>{n.classList&&n.classList.remove("is-loading")})})({Block:t,container:e,props:a,attributes:u,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(c.join(",")),{Block:n,getProps:r,getErrorBoundaryProps:o,selector:s}=e;(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrappers:s}=e;const i=document.body.querySelectorAll(o);s&&s.length>0&&Array.prototype.filter.call(i,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,s)),a({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})})({Block:n,getProps:r,getErrorBoundaryProps:o,selector:s,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrapper:s}=e;const i=s.querySelectorAll(o);a({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})})({...e,wrapper:t})})})}},function(e,t){e.exports=window.wp.keycodes},function(e,t,n){"use strict";var r=n(0),o=n(1),s=n(22);n(125),t.a=e=>{let{name:t,count:n}=e;return Object(r.createElement)(r.Fragment,null,t,n&&Number.isFinite(n)&&Object(r.createElement)(s.a,{label:n.toString(),screenReaderLabel:Object(o.sprintf)( +/* translators: %s number of products. */ +Object(o._n)("%s product","%s products",n,"woo-gutenberg-products-block"),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},function(e,t){var n,r,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var a,l=[],u=!1,d=-1;function p(){u&&a&&(u=!1,a.length?l=a.concat(l):d=-1,l.length&&f())}function f(){if(!u){var e=c(p);u=!0;for(var t=l.length;t;){for(a=l,l=[];++d1)for(var n=1;n{n.current===e||t&&!t(e,n.current)||(n.current=e)},[e,t]),n.current}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(6),o=n(7),s=n(0),i=n(31),c=n(73);const a=e=>{const{namespace:t,resourceName:n,resourceValues:a=[],query:l={},shouldSelect:u=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(s.useRef)({results:[],isLoading:!0}),p=Object(i.a)(l),f=Object(i.a)(a),b=Object(c.a)(),m=Object(o.useSelect)(e=>{if(!u)return null;const o=e(r.COLLECTIONS_STORE_KEY),s=[t,n,p,f],i=o.getCollectionError(...s);if(i){if(!(i instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");b(i)}return{results:o.getCollection(...s),isLoading:!o.hasFinishedResolution("getCollection",s)}},[t,n,f,p,u]);return null!==m&&(d.current=m),d.current}},,,,,,function(e,t,n){"use strict";var r=n(0),o=n(13);const s=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=s},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);const o=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},,function(e,t,n){"use strict";var r=n(0),o=n(1),s=n(4),i=n.n(s),c=n(22);n(107),t.a=e=>{let{className:t,disabled:n,label: +/* translators: Submit button text for filters. */ +s=Object(o.__)("Apply","woo-gutenberg-products-block"),onClick:a,screenReaderLabel:l=Object(o.__)("Apply filter","woo-gutenberg-products-block")}=e;return Object(r.createElement)("button",{type:"submit",className:i()("wp-block-button__link","wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:n,onClick:a},Object(r.createElement)(c.a,{label:s,screenReaderLabel:l}))}},function(e,t,n){"use strict";var r=n(0),o=n(3),s=n(4),i=n.n(s),c=n(1),a=n(23),l=n(71),u=n(42);function d(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}t.a=function({className:e,status:t="info",children:n,spokenMessage:s=n,onRemove:p=o.noop,isDismissible:f=!0,actions:b=[],politeness:m=d(t),__unstableHTML:h,onDismiss:g=o.noop}){!function(e,t){const n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)(()=>{n&&Object(a.speak)(n,t)},[n,t])}(s,m);const v=i()(e,"components-notice","is-"+t,{"is-dismissible":f});return h&&(n=Object(r.createElement)(r.RawHTML,null,n)),Object(r.createElement)("div",{className:v},Object(r.createElement)("div",{className:"components-notice__content"},n,Object(r.createElement)("div",{className:"components-notice__actions"},b.map(({className:e,label:t,isPrimary:n,variant:o,noDefaultClasses:s=!1,onClick:c,url:a},l)=>{let d=o;return"primary"===o||s||(d=a?"link":"secondary"),void 0===d&&n&&(d="primary"),Object(r.createElement)(u.a,{key:l,href:a,variant:d,onClick:a?void 0:c,className:i()("components-notice__action",e)},t)}))),f&&Object(r.createElement)(u.a,{className:"components-notice__dismiss",icon:l.a,label:Object(c.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),g(),p()},showTooltip:!1}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"boolean"==typeof e},,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(5),o=n(51);function s(e,t){return e===t}function i(e){return"function"==typeof e?function(){return e}:e}function c(e,t,n){var c=n&&n.equalityFn||s,a=function(e){var t=Object(r.useState)(i(e)),n=t[0],o=t[1];return[n,Object(r.useCallback)((function(e){return o(i(e))}),[])]}(e),l=a[0],u=a[1],d=Object(o.a)(Object(r.useCallback)((function(e){return u(e)}),[u]),t,n),p=Object(r.useRef)(e);return c(p.current,e)||(d(e),p.current=e),[l,d]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return s}));var r=n(3);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const s=e.filter(e=>e.attribute===n.taxonomy),i=s.length?s[0]:null;if(!(i&&i.slug&&Array.isArray(i.slug)&&i.slug.includes(o)))return;const c=i.slug.filter(e=>e!==o),a=e.filter(e=>e.attribute!==n.taxonomy);c.length>0&&(i.slug=c.sort(),a.push(i)),t(Object(r.sortBy)(a,"attribute"))},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";if(!n||!n.taxonomy)return[];const i=e.filter(e=>e.attribute!==n.taxonomy);return 0===o.length?t(i):(i.push({attribute:n.taxonomy,operator:s,slug:o.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(r.sortBy)(i,"attribute"))),i}},,function(e,t){e.exports=window.wp.blocks},,,,function(e,t){},,function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return i}));var r=n(2);const o=Object(r.getSetting)("attributes",[]).reduce((e,t)=>{const n=(r=t)&&r.attribute_name?{id:parseInt(r.attribute_id,10),name:r.attribute_name,taxonomy:"pa_"+r.attribute_name,label:r.attribute_label}:null;var r;return n&&n.id&&e.push(n),e},[]),s=e=>{if(e)return o.find(t=>t.id===e)},i=e=>{if(e)return o.find(t=>t.taxonomy===e)}},function(e,t,n){"use strict";var r=n(0),o=n(1),s=n(4),i=n.n(s);n(126),t.a=e=>{let{className:t,onChange:n,options:s=[],checked:c=[],isLoading:a=!1,isDisabled:l=!1,limit:u=10}=e;const[d,p]=Object(r.useState)(!1),f=Object(r.useMemo)(()=>[...Array(5)].map((e,t)=>Object(r.createElement)("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})),[]),b=Object(r.useMemo)(()=>{const e=s.length-u;return!d&&Object(r.createElement)("li",{key:"show-more",className:"show-more"},Object(r.createElement)("button",{onClick:()=>{p(!0)},"aria-expanded":!1,"aria-label":Object(o.sprintf)( +/* translators: %s is referring the remaining count of options */ +Object(o._n)("Show %s more option","Show %s more options",e,"woo-gutenberg-products-block"),e)},Object(o.sprintf)( +/* translators: %s number of options to reveal. */ +Object(o._n)("Show %s more","Show %s more",e,"woo-gutenberg-products-block"),e)))},[s,u,d]),m=Object(r.useMemo)(()=>d&&Object(r.createElement)("li",{key:"show-less",className:"show-less"},Object(r.createElement)("button",{onClick:()=>{p(!1)},"aria-expanded":!0,"aria-label":Object(o.__)("Show less options","woo-gutenberg-products-block")},Object(o.__)("Show less","woo-gutenberg-products-block"))),[d]),h=Object(r.useMemo)(()=>{const e=s.length>u+5;return Object(r.createElement)(r.Fragment,null,s.map((t,o)=>Object(r.createElement)(r.Fragment,{key:t.value},Object(r.createElement)("li",e&&!d&&o>=u&&{hidden:!0},Object(r.createElement)("input",{type:"checkbox",id:t.value,value:t.value,onChange:e=>{n(e.target.value)},checked:c.includes(t.value),disabled:l}),Object(r.createElement)("label",{htmlFor:t.value},t.label)),e&&o===u-1&&b)),e&&m)},[s,n,c,d,u,m,b,l]),g=i()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":a},t);return Object(r.createElement)("ul",{className:g},a?f:h)}},,,function(e){e.exports=JSON.parse('{"name":"woocommerce/attribute-filter","version":"1.0.0","title":"Filter Products by Attribute","description":"Allow customers to filter the grid by product attribute, such as color. Works in combination with the All Products block.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"color":{"text":true,"background":false}},"example":{"attributes":{"isPreview":true}},"attributes":{"className":{"type":"string","default":""},"attributeId":{"type":"number","default":0},"showCounts":{"type":"boolean","default":true},"queryType":{"type":"string","default":"or"},"headingLevel":{"type":"number","default":3},"displayStyle":{"type":"string","default":"list"},"showFilterButton":{"type":"boolean","default":false},"selectType":{"type":"string","default":"multiple"},"isPreview":{"type":"boolean","default":false}},"textdomain":"woo-gutenberg-products-block","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},function(e,t){e.exports=window.wp.blockEditor},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(45),o=n(18);const s=e=>Object(r.a)(e)?JSON.parse(e)||{}:Object(o.a)(e)?e:{}},,,function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return a})),n.d(t,"d",(function(){return l})),n.d(t,"c",(function(){return u}));var r=n(14),o=n(2),s=n(77);const i=Object(o.getSettingWithCoercion)("is_rendering_php_template",!1,s.a),c="query_type_",a="filter_";function l(e){return window?Object(r.getQueryArg)(window.location.href,e):null}function u(e){i?window.location.href=e:window.history.replaceState({},"",e)}},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(8),o=n(0),s=n(4),i=n.n(s);class c extends o.Component{constructor(){super(...arguments),this.onChange=this.onChange.bind(this),this.bindInput=this.bindInput.bind(this)}focus(){this.input.focus()}hasFocus(){return this.input===this.input.ownerDocument.activeElement}bindInput(e){this.input=e}onChange(e){this.props.onChange({value:e.target.value})}render(){const{value:e,isExpanded:t,instanceId:n,selectedSuggestionIndex:s,className:c,...a}=this.props,l=e?e.length+1:0;return Object(o.createElement)("input",Object(r.a)({ref:this.bindInput,id:"components-form-token-input-"+n,type:"text"},a,{value:e||"",onChange:this.onChange,size:l,className:i()(c,"components-form-token-field__input"),autoComplete:"off",role:"combobox","aria-expanded":t,"aria-autocomplete":"list","aria-owns":t?"components-form-token-suggestions-"+n:void 0,"aria-activedescendant":-1!==s?`components-form-token-suggestions-${n}-${s}`:void 0,"aria-describedby":"components-form-token-suggestions-howto-"+n}))}}t.a=c},function(e,t,n){"use strict";var r=n(0),o=n(3),s=n(144),i=n.n(s),c=n(4),a=n.n(c),l=n(9);class u extends r.Component{constructor(){super(...arguments),this.handleMouseDown=this.handleMouseDown.bind(this),this.bindList=this.bindList.bind(this)}componentDidUpdate(){this.props.selectedIndex>-1&&this.props.scrollIntoView&&this.list.children[this.props.selectedIndex]&&(this.scrollingIntoView=!0,i()(this.list.children[this.props.selectedIndex],this.list,{onlyScrollIfNeeded:!0}),this.props.setTimeout(()=>{this.scrollingIntoView=!1},100))}bindList(e){this.list=e}handleHover(e){return()=>{this.scrollingIntoView||this.props.onHover(e)}}handleClick(e){return()=>{this.props.onSelect(e)}}handleMouseDown(e){e.preventDefault()}computeSuggestionMatch(e){const t=this.props.displayTransform(this.props.match||"").toLocaleLowerCase();if(0===t.length)return null;const n=(e=this.props.displayTransform(e)).toLocaleLowerCase().indexOf(t);return{suggestionBeforeMatch:e.substring(0,n),suggestionMatch:e.substring(n,n+t.length),suggestionAfterMatch:e.substring(n+t.length)}}render(){return Object(r.createElement)("ul",{ref:this.bindList,className:"components-form-token-field__suggestions-list",id:"components-form-token-suggestions-"+this.props.instanceId,role:"listbox"},Object(o.map)(this.props.suggestions,(e,t)=>{const n=this.computeSuggestionMatch(e),o=a()("components-form-token-field__suggestion",{"is-selected":t===this.props.selectedIndex});return Object(r.createElement)("li",{id:`components-form-token-suggestions-${this.props.instanceId}-${t}`,role:"option",className:o,key:null!=e&&e.value?e.value:this.props.displayTransform(e),onMouseDown:this.handleMouseDown,onClick:this.handleClick(e),onMouseEnter:this.handleHover(e),"aria-selected":t===this.props.selectedIndex},n?Object(r.createElement)("span",{"aria-label":this.props.displayTransform(e)},n.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch):this.props.displayTransform(e))}))}}u.defaultProps={match:"",onHover:()=>{},onSelect:()=>{},suggestions:Object.freeze([])},t.a=Object(l.withSafeTimeout)(u)},function(e,t,n){"use strict";e.exports=n(202)},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(0),o=n(100),s=n(3),i=n(31),c=n(18),a=n(39),l=n(65),u=n(26);const d=e=>{let{queryAttribute:t,queryPrices:n,queryStock:d,queryState:p}=e,f=Object(u.a)();f+="-collection-data";const[b]=Object(a.a)(f),[m,h]=Object(a.b)("calculate_attribute_counts",[],f),[g,v]=Object(a.b)("calculate_price_range",null,f),[O,w]=Object(a.b)("calculate_stock_status_counts",null,f),j=Object(i.a)(t||{}),y=Object(i.a)(n),E=Object(i.a)(d);Object(r.useEffect)(()=>{"object"==typeof j&&Object.keys(j).length&&(m.find(e=>Object(c.b)(j,"taxonomy")&&e.taxonomy===j.taxonomy)||h([...m,j]))},[j,m,h]),Object(r.useEffect)(()=>{g!==y&&void 0!==y&&v(y)},[y,v,g]),Object(r.useEffect)(()=>{O!==E&&void 0!==E&&w(E)},[E,w,O]);const[k,_]=Object(r.useState)(!1),[S]=Object(o.a)(k,200);k||_(!0);const x=Object(r.useMemo)(()=>(e=>{const t=e;return Array.isArray(e.calculate_attribute_counts)&&(t.calculate_attribute_counts=Object(s.sortBy)(e.calculate_attribute_counts.map(e=>{let{taxonomy:t,queryType:n}=e;return{taxonomy:t,query_type:n}}),["taxonomy","query_type"])),t})(b),[b]);return Object(l.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...p,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...x},shouldSelect:S})}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n(103);var r=n(48);const o=()=>r.m>1},,function(e,t,n){"use strict";var r=n(203);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=r.getWindow(t));var o=n.allowHorizontalScroll,s=n.onlyScrollIfNeeded,i=n.alignWithTop,c=n.alignWithLeft,a=n.offsetTop||0,l=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;o=void 0===o||o;var p=r.isWindow(t),f=r.offset(e),b=r.outerHeight(e),m=r.outerWidth(e),h=void 0,g=void 0,v=void 0,O=void 0,w=void 0,j=void 0,y=void 0,E=void 0,k=void 0,_=void 0;p?(y=t,_=r.height(y),k=r.width(y),E={left:r.scrollLeft(y),top:r.scrollTop(y)},w={left:f.left-E.left-l,top:f.top-E.top-a},j={left:f.left+m-(E.left+k)+d,top:f.top+b-(E.top+_)+u},O=E):(h=r.offset(t),g=t.clientHeight,v=t.clientWidth,O={left:t.scrollLeft,top:t.scrollTop},w={left:f.left-(h.left+(parseFloat(r.css(t,"borderLeftWidth"))||0))-l,top:f.top-(h.top+(parseFloat(r.css(t,"borderTopWidth"))||0))-a},j={left:f.left+m-(h.left+v+(parseFloat(r.css(t,"borderRightWidth"))||0))+d,top:f.top+b-(h.top+g+(parseFloat(r.css(t,"borderBottomWidth"))||0))+u}),w.top<0||j.top>0?!0===i?r.scrollTop(t,O.top+w.top):!1===i?r.scrollTop(t,O.top+j.top):w.top<0?r.scrollTop(t,O.top+w.top):r.scrollTop(t,O.top+j.top):s||((i=void 0===i||!!i)?r.scrollTop(t,O.top+w.top):r.scrollTop(t,O.top+j.top)),o&&(w.left<0||j.left>0?!0===c?r.scrollLeft(t,O.left+w.left):!1===c?r.scrollLeft(t,O.left+j.left):w.left<0?r.scrollLeft(t,O.left+w.left):r.scrollLeft(t,O.left+j.left):s||((c=void 0===c||!!c)?r.scrollLeft(t,O.left+w.left):r.scrollLeft(t,O.left+j.left)))}},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;tObject(r.b)(e,"count")&&Object(r.b)(e,"description")&&Object(r.b)(e,"id")&&Object(r.b)(e,"name")&&Object(r.b)(e,"parent")&&Object(r.b)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,s=e=>Array.isArray(e)&&e.every(o),i=e=>Object(r.b)(e,"attribute")&&Object(r.b)(e,"operator")&&Object(r.b)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every(e=>"string"==typeof e),c=e=>Array.isArray(e)&&e.every(i)},function(e,t){},,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(52),o=n(0),s=n(1),i=n(254),c=n(31),a=n(61),l=n(39),u=n(65),d=n(145),p=n(110),f=n(54),b=n(75),m=n(11),h=n.n(m),g=n(17),v=n(76),O=n(2),w=n(14),j=n(77),y=n(45),E=n(18),k=n(223),_=n(124),S=n(3),x=n(12),T=n.n(x),C=n(4),I=n.n(C),L=n(9),A=n(53),F=n(257),P=n(42),R=n(34);function M({value:e,status:t,title:n,displayTransform:r,isBorderless:i=!1,disabled:c=!1,onClickRemove:a=S.noop,onMouseEnter:l,onMouseLeave:u,messages:d,termPosition:p,termsCount:f}){const b=Object(L.useInstanceId)(M),m=I()("components-form-token-field__token",{"is-error":"error"===t,"is-success":"success"===t,"is-validating":"validating"===t,"is-borderless":i,"is-disabled":c}),h=r(e),g=Object(s.sprintf)( +/* translators: 1: term name, 2: term position in a set of terms, 3: total term set count. */ +Object(s.__)("%1$s (%2$s of %3$s)"),h,p,f);return Object(o.createElement)("span",{className:m,onMouseEnter:l,onMouseLeave:u,title:n},Object(o.createElement)("span",{className:"components-form-token-field__token-text",id:"components-form-token-field__token-text-"+b},Object(o.createElement)(R.a,{as:"span"},g),Object(o.createElement)("span",{"aria-hidden":"true"},h)),Object(o.createElement)(P.a,{className:"components-form-token-field__remove-token",icon:F.a,onClick:!c&&(()=>a({value:e})),label:d.remove,"aria-describedby":"components-form-token-field__token-text-"+b}))}var N=n(142),B=n(143),D=n(8),V=n(23),W=Object(L.createHigherOrderComponent)(e=>t=>Object(o.createElement)(e,Object(D.a)({},t,{speak:V.speak,debouncedSpeak:Object(L.useDebounce)(V.speak,500)})),"withSpokenMessages");const H={incompleteTokenValue:"",inputOffsetFromEnd:0,isActive:!1,isExpanded:!1,selectedSuggestionIndex:-1,selectedSuggestionScroll:!1};class q extends o.Component{constructor(){super(...arguments),this.state=H,this.onKeyDown=this.onKeyDown.bind(this),this.onKeyPress=this.onKeyPress.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.deleteTokenBeforeInput=this.deleteTokenBeforeInput.bind(this),this.deleteTokenAfterInput=this.deleteTokenAfterInput.bind(this),this.addCurrentToken=this.addCurrentToken.bind(this),this.onContainerTouched=this.onContainerTouched.bind(this),this.renderToken=this.renderToken.bind(this),this.onTokenClickRemove=this.onTokenClickRemove.bind(this),this.onSuggestionHovered=this.onSuggestionHovered.bind(this),this.onSuggestionSelected=this.onSuggestionSelected.bind(this),this.onInputChange=this.onInputChange.bind(this),this.bindInput=this.bindInput.bind(this),this.bindTokensAndInput=this.bindTokensAndInput.bind(this),this.updateSuggestions=this.updateSuggestions.bind(this)}componentDidUpdate(e){this.state.isActive&&!this.input.hasFocus()&&this.input.focus();const{suggestions:t,value:n}=this.props,r=!h()(t,e.suggestions);(r||n!==e.value)&&this.updateSuggestions(r)}static getDerivedStateFromProps(e,t){return e.disabled&&t.isActive?{isActive:!1,incompleteTokenValue:""}:null}bindInput(e){this.input=e}bindTokensAndInput(e){this.tokensAndInput=e}onFocus(e){const{__experimentalExpandOnFocus:t}=this.props;this.input.hasFocus()||e.target===this.tokensAndInput?this.setState({isActive:!0,isExpanded:!!t||this.state.isExpanded}):this.setState({isActive:!1}),"function"==typeof this.props.onFocus&&this.props.onFocus(e)}onBlur(){this.inputHasValidValue()?this.setState({isActive:!1}):this.setState(H)}onKeyDown(e){let t=!1;switch(e.keyCode){case A.BACKSPACE:t=this.handleDeleteKey(this.deleteTokenBeforeInput);break;case A.ENTER:t=this.addCurrentToken();break;case A.LEFT:t=this.handleLeftArrowKey();break;case A.UP:t=this.handleUpArrowKey();break;case A.RIGHT:t=this.handleRightArrowKey();break;case A.DOWN:t=this.handleDownArrowKey();break;case A.DELETE:t=this.handleDeleteKey(this.deleteTokenAfterInput);break;case A.SPACE:this.props.tokenizeOnSpace&&(t=this.addCurrentToken());break;case A.ESCAPE:t=this.handleEscapeKey(e),e.stopPropagation()}t&&e.preventDefault()}onKeyPress(e){let t=!1;switch(e.charCode){case 44:t=this.handleCommaKey()}t&&e.preventDefault()}onContainerTouched(e){e.target===this.tokensAndInput&&this.state.isActive&&e.preventDefault()}onTokenClickRemove(e){this.deleteToken(e.value),this.input.focus()}onSuggestionHovered(e){const t=this.getMatchingSuggestions().indexOf(e);t>=0&&this.setState({selectedSuggestionIndex:t,selectedSuggestionScroll:!1})}onSuggestionSelected(e){this.addNewToken(e)}onInputChange(e){const t=e.value,n=this.props.tokenizeOnSpace?/[ ,\t]+/:/[,\t]+/,r=t.split(n),o=Object(S.last)(r)||"";r.length>1&&this.addNewTokens(r.slice(0,-1)),this.setState({incompleteTokenValue:o},this.updateSuggestions),this.props.onInputChange(o)}handleDeleteKey(e){let t=!1;return this.input.hasFocus()&&this.isInputEmpty()&&(e(),t=!0),t}handleLeftArrowKey(){let e=!1;return this.isInputEmpty()&&(this.moveInputBeforePreviousToken(),e=!0),e}handleRightArrowKey(){let e=!1;return this.isInputEmpty()&&(this.moveInputAfterNextToken(),e=!0),e}handleUpArrowKey(){return this.setState((e,t)=>({selectedSuggestionIndex:(0===e.selectedSuggestionIndex?this.getMatchingSuggestions(e.incompleteTokenValue,t.suggestions,t.value,t.maxSuggestions,t.saveTransform).length:e.selectedSuggestionIndex)-1,selectedSuggestionScroll:!0})),!0}handleDownArrowKey(){return this.setState((e,t)=>({selectedSuggestionIndex:(e.selectedSuggestionIndex+1)%this.getMatchingSuggestions(e.incompleteTokenValue,t.suggestions,t.value,t.maxSuggestions,t.saveTransform).length,selectedSuggestionScroll:!0})),!0}handleEscapeKey(e){return this.setState({incompleteTokenValue:e.target.value,isExpanded:!1,selectedSuggestionIndex:-1,selectedSuggestionScroll:!1}),!0}handleCommaKey(){return this.inputHasValidValue()&&this.addNewToken(this.state.incompleteTokenValue),!0}moveInputToIndex(e){this.setState((t,n)=>({inputOffsetFromEnd:n.value.length-Math.max(e,-1)-1}))}moveInputBeforePreviousToken(){this.setState((e,t)=>({inputOffsetFromEnd:Math.min(e.inputOffsetFromEnd+1,t.value.length)}))}moveInputAfterNextToken(){this.setState(e=>({inputOffsetFromEnd:Math.max(e.inputOffsetFromEnd-1,0)}))}deleteTokenBeforeInput(){const e=this.getIndexOfInput()-1;e>-1&&this.deleteToken(this.props.value[e])}deleteTokenAfterInput(){const e=this.getIndexOfInput();e!this.valueContainsToken(e)));if(t.length>0){const e=Object(S.clone)(this.props.value);e.splice.apply(e,[this.getIndexOfInput(),0].concat(t)),this.props.onChange(e)}}addNewToken(e){const{__experimentalExpandOnFocus:t,__experimentalValidateInput:n}=this.props;n(e)?(this.addNewTokens([e]),this.props.speak(this.props.messages.added,"assertive"),this.setState({incompleteTokenValue:"",selectedSuggestionIndex:-1,selectedSuggestionScroll:!1,isExpanded:!t}),this.state.isActive&&this.input.focus()):this.props.speak(this.props.messages.__experimentalInvalid,"assertive")}deleteToken(e){const t=this.props.value.filter(t=>this.getTokenValue(t)!==this.getTokenValue(e));this.props.onChange(t),this.props.speak(this.props.messages.removed,"assertive")}getTokenValue(e){return"object"==typeof e?e.value:e}getMatchingSuggestions(e=this.state.incompleteTokenValue,t=this.props.suggestions,n=this.props.value,r=this.props.maxSuggestions,o=this.props.saveTransform){let s=o(e);const i=[],c=[];return 0===s.length?t=Object(S.difference)(t,n):(s=s.toLocaleLowerCase(),Object(S.each)(t,e=>{const t=e.toLocaleLowerCase().indexOf(s);-1===n.indexOf(e)&&(0===t?i.push(e):t>0&&c.push(e))}),t=i.concat(c)),Object(S.take)(t,r)}getSelectedSuggestion(){if(-1!==this.state.selectedSuggestionIndex)return this.getMatchingSuggestions()[this.state.selectedSuggestionIndex]}valueContainsToken(e){return Object(S.some)(this.props.value,t=>this.getTokenValue(e)===this.getTokenValue(t))}getIndexOfInput(){return this.props.value.length-this.state.inputOffsetFromEnd}isInputEmpty(){return 0===this.state.incompleteTokenValue.length}inputHasValidValue(){return this.props.saveTransform(this.state.incompleteTokenValue).length>0}updateSuggestions(e=!0){const{__experimentalExpandOnFocus:t}=this.props,{incompleteTokenValue:n}=this.state,r=n.trim().length>1,o=this.getMatchingSuggestions(n),i=o.length>0,c={isExpanded:t||r&&i};if(e&&(c.selectedSuggestionIndex=-1,c.selectedSuggestionScroll=!1),this.setState(c),r){const{debouncedSpeak:e}=this.props;e(i?Object(s.sprintf)( +/* translators: %d: number of results. */ +Object(s._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",o.length),o.length):Object(s.__)("No results."),"assertive")}}renderTokensAndInput(){const e=Object(S.map)(this.props.value,this.renderToken);return e.splice(this.getIndexOfInput(),0,this.renderInput()),e}renderToken(e,t,n){const r=this.getTokenValue(e),s=e.status?e.status:void 0,i=t+1,c=n.length;return Object(o.createElement)(M,{key:"token-"+r,value:r,status:s,title:e.title,displayTransform:this.props.displayTransform,onClickRemove:this.onTokenClickRemove,isBorderless:e.isBorderless||this.props.isBorderless,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,disabled:"error"!==s&&this.props.disabled,messages:this.props.messages,termsCount:c,termPosition:i})}renderInput(){const{autoCapitalize:e,autoComplete:t,maxLength:n,placeholder:r,value:s,instanceId:i}=this.props;let c={instanceId:i,autoCapitalize:e,autoComplete:t,placeholder:0===s.length?r:"",ref:this.bindInput,key:"input",disabled:this.props.disabled,value:this.state.incompleteTokenValue,onBlur:this.onBlur,isExpanded:this.state.isExpanded,selectedSuggestionIndex:this.state.selectedSuggestionIndex};return n&&s.length>=n||(c={...c,onChange:this.onInputChange}),Object(o.createElement)(N.a,c)}render(){const{disabled:e,label:t=Object(s.__)("Add item"),instanceId:n,className:r,__experimentalShowHowTo:i}=this.props,{isExpanded:c}=this.state,a=I()(r,"components-form-token-field__input-container",{"is-active":this.state.isActive,"is-disabled":e});let l={className:"components-form-token-field",tabIndex:"-1"};const u=this.getMatchingSuggestions();return e||(l=Object.assign({},l,{onKeyDown:this.onKeyDown,onKeyPress:this.onKeyPress,onFocus:this.onFocus})),Object(o.createElement)("div",l,Object(o.createElement)("label",{htmlFor:"components-form-token-input-"+n,className:"components-form-token-field__label"},t),Object(o.createElement)("div",{ref:this.bindTokensAndInput,className:a,tabIndex:"-1",onMouseDown:this.onContainerTouched,onTouchStart:this.onContainerTouched},this.renderTokensAndInput(),c&&Object(o.createElement)(B.a,{instanceId:n,match:this.props.saveTransform(this.state.incompleteTokenValue),displayTransform:this.props.displayTransform,suggestions:u,selectedIndex:this.state.selectedSuggestionIndex,scrollIntoView:this.state.selectedSuggestionScroll,onHover:this.onSuggestionHovered,onSelect:this.onSuggestionSelected})),i&&Object(o.createElement)("p",{id:"components-form-token-suggestions-howto-"+n,className:"components-form-token-field__help"},this.props.tokenizeOnSpace?Object(s.__)("Separate with commas, spaces, or the Enter key."):Object(s.__)("Separate with commas or the Enter key.")))}}q.defaultProps={suggestions:Object.freeze([]),maxSuggestions:100,value:Object.freeze([]),displayTransform:S.identity,saveTransform:e=>e.trim(),onChange:()=>{},onInputChange:()=>{},isBorderless:!1,disabled:!1,tokenizeOnSpace:!1,messages:{added:Object(s.__)("Item added."),removed:Object(s.__)("Item removed."),remove:Object(s.__)("Remove item"),__experimentalInvalid:Object(s.__)("Invalid item")},__experimentalExpandOnFocus:!1,__experimentalValidateInput:()=>!0,__experimentalShowHowTo:!0};var K=W(Object(L.withInstanceId)(q));n(224);var U=e=>{let{className:t,style:n,suggestions:r,multiple:s=!0,saveTransform:i=(e=>e.trim().replace(/\s/g,"-")),messages:c={},validateInput:a=(e=>r.includes(e)),label:l="",...u}=e;return Object(o.createElement)("div",{className:I()("wc-blocks-components-form-token-field-wrapper",t,{"single-selection":!s}),style:n},Object(o.createElement)(K,T()({label:l,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,__experimentalValidateInput:a,saveTransform:i,maxLength:s?void 0:1,suggestions:r,messages:c},u)))},z=n(109),G=n(101);const $=[{value:"preview-1",formattedValue:"preview-1",name:"Blue",label:Object(o.createElement)(f.a,{name:"Blue",count:3}),textLabel:"Blue (3)"},{value:"preview-2",formattedValue:"preview-2",name:"Green",label:Object(o.createElement)(f.a,{name:"Green",count:3}),textLabel:"Green (3)"},{value:"preview-3",formattedValue:"preview-3",name:"Red",label:Object(o.createElement)(f.a,{name:"Red",count:2}),textLabel:"Red (2)"}],Q={id:0,name:"preview",taxonomy:"preview",label:"Preview"};n(222);const Y=e=>e.replace("pa_",""),J=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n={};t.forEach(e=>{const{attribute:t,slug:r,operator:o}=e,s=Y(t),i=r.join(","),c=`${_.b}${s}`,a="in"===o?"or":"and";n[`${_.a}${s}`]=i,n[c]=a});const r=Object(w.removeQueryArgs)(e,...Object.keys(n));return Object(w.addQueryArgs)(r,n)},X=(e,t)=>{const n=Object.entries(t).reduce((e,t)=>{let[n,r]=t;return n.includes("query_type")?e:{...e,[n]:r}},{});return Object.entries(n).reduce((t,n)=>{let[r,o]=n;return e[r]===o&&t},!0)},Z=e=>e.trim().replace(/\s/g,"-").replace(/_/g,"-").replace(/-+/g,"-").replace(/[^a-zA-Z0-9-]/g,"");const ee={heading:{type:"string",default:Object(s.__)("Filter by attribute","woo-gutenberg-products-block")}};var te=n(113);Object(r.a)({selector:".wp-block-woocommerce-attribute-filter",Block:e=>{let{attributes:t,isEditor:n=!1}=e;const r=Object(O.getSettingWithCoercion)("has_filterable_products",!1,j.a),m=Object(O.getSettingWithCoercion)("is_rendering_php_template",!1,j.a),x=Object(O.getSettingWithCoercion)("page_url",window.location.href,y.a),[T,C]=Object(o.useState)(!1),L=t.isPreview&&!t.attributeId?Q:Object(z.a)(t.attributeId),A=Object(o.useMemo)(()=>(e=>{if(e){const t=Object(_.d)("filter_"+e.name);return"string"==typeof t?t.split(","):[]}return[]})(L),[L]),[F,P]=Object(o.useState)(A),[R,M]=Object(o.useState)(t.isPreview&&!t.attributeId?$:[]),N=Object(i.a)(t),[B]=Object(l.a)(),[D,V]=Object(l.b)("attributes",[]),{results:W,isLoading:H}=Object(u.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[(null==L?void 0:L.id)||0],shouldSelect:t.attributeId>0}),q="dropdown"!==t.displayStyle&&"and"===t.queryType,{results:K,isLoading:ee}=Object(d.a)({queryAttribute:{taxonomy:(null==L?void 0:L.taxonomy)||"",queryType:t.queryType},queryState:{...B,attributes:q?B.attributes:null}}),te=Object(o.useCallback)(e=>Object(E.b)(K,"attribute_counts")&&Array.isArray(K.attribute_counts)?K.attribute_counts.find(t=>{let{term:n}=t;return n===e}):null,[K]);Object(o.useEffect)(()=>{if(H||ee)return;if(!Array.isArray(W))return;const e=W.map(e=>{const n=te(e.id);if(!(n||F.includes(e.slug)||(r=e.slug,null!=B&&B.attributes&&B.attributes.some(e=>{let{attribute:t,slug:n=[]}=e;return t===(null==L?void 0:L.taxonomy)&&n.includes(r)}))))return null;var r;const s=n?n.count:0;return{formattedValue:Z(e.slug),value:e.slug,name:Object(g.decodeEntities)(e.name),label:Object(o.createElement)(f.a,{name:Object(g.decodeEntities)(e.name),count:t.showCounts?s:null}),textLabel:t.showCounts?`${Object(g.decodeEntities)(e.name)} (${s})`:Object(g.decodeEntities)(e.name)}}).filter(e=>!!e);M(e)},[null==L?void 0:L.taxonomy,W,H,t.showCounts,ee,te,F,B.attributes]);const ne=Object(o.useCallback)(e=>Array.isArray(W)?W.reduce((t,n)=>(e.includes(n.slug)&&t.push(n),t),[]):[],[W]),re=Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){if(null==L||!L.taxonomy)return;const t=Object.keys(Object(w.getQueryArgs)(window.location.href)),n=Y(L.taxonomy),r=t.reduce((e,t)=>t.includes(_.b+n)||t.includes(_.a+n)?Object(w.removeQueryArgs)(e,t):e,window.location.href),o=J(r,e);Object(_.c)(o)}else{const t=J(x,e),n=Object(w.getQueryArgs)(window.location.href),r=Object(w.getQueryArgs)(t);X(n,r)||Object(_.c)(t)}}),[x,null==L?void 0:L.taxonomy]),oe=Object(o.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n||(P(e),!r&&t.showFilterButton||Object(G.b)(D,V,L,ne(e),"or"===t.queryType?"in":"and"))}),[n,P,D,V,L,ne,t.queryType,t.showFilterButton]),se=Object(o.useMemo)(()=>Object(k.a)(D)?D.filter(e=>{let{attribute:t}=e;return t===(null==L?void 0:L.taxonomy)}).flatMap(e=>{let{slug:t}=e;return t}):[],[D,null==L?void 0:L.taxonomy]),ie=Object(c.a)(se),ce=Object(a.a)(ie);Object(o.useEffect)(()=>{!ce||h()(ce,ie)||h()(F,ie)||oe(ie)},[F,ie,ce,oe]);const ae="single"!==t.selectType,le=Object(o.useCallback)(e=>{const t=F.includes(e);let n;ae?(n=F.filter(t=>t!==e),t||(n.push(e),n.sort())):n=t?[]:[e],oe(n)},[F,ae,oe]);if(Object(o.useEffect)(()=>{L&&!t.showFilterButton&&((e=>{let{currentCheckedFilters:t,hasSetFilterDefaultsFromUrl:n}=e;return n&&0===t.length})({currentCheckedFilters:F,hasSetFilterDefaultsFromUrl:T})?re(D,!0):re(D,!1))},[T,re,D,L,F,t.showFilterButton]),Object(o.useEffect)(()=>{if(!T&&!H)return A.length>0?(C(!0),void oe(A,!0)):void(m||C(!0))},[L,T,H,oe,A,m]),!r)return null;if(!L)return n?Object(o.createElement)(v.a,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(s.__)("Please select an attribute to use this filter!","woo-gutenberg-products-block"))):null;if(0===R.length&&!H)return n?Object(o.createElement)(v.a,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(s.__)("The selected attribute does not have any term assigned to products.","woo-gutenberg-products-block"))):null;const ue="h"+t.headingLevel,de=!t.isPreview&&H,pe=!t.isPreview&ⅇreturn Object(o.createElement)(o.Fragment,null,!n&&t.heading&&R.length>0&&Object(o.createElement)(ue,{className:"wc-block-attribute-filter__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-attribute-filter style-"+t.displayStyle},"dropdown"===t.displayStyle?Object(o.createElement)(U,{className:I()(N.className,{"single-selection":!ae}),style:{...N.style,borderStyle:"none"},suggestions:R.filter(e=>!F.includes(e.value)).map(e=>e.formattedValue),disabled:pe,placeholder:Object(s.sprintf)( +/* translators: %s attribute name. */ +Object(s.__)("Any %s","woo-gutenberg-products-block"),L.label),onChange:e=>{!ae&&e.length>1&&(e=[e[e.length-1]]),e=e.map(e=>{const t=R.find(t=>t.formattedValue===e);return t?t.value:e});const t=Object(S.difference)(e,F);if(1===t.length)return le(t[0]);const n=Object(S.difference)(F,e);1===n.length&&le(n[0])},value:F,displayTransform:e=>{const t=R.find(t=>[t.value,t.formattedValue].includes(e));return t?t.textLabel:e},saveTransform:Z,messages:{added:Object(s.sprintf)( +/* translators: %s is the attribute label. */ +Object(s.__)("%s filter added.","woo-gutenberg-products-block"),L.label),removed:Object(s.sprintf)( +/* translators: %s is the attribute label. */ +Object(s.__)("%s filter removed.","woo-gutenberg-products-block"),L.label),remove:Object(s.sprintf)( +/* translators: %s is the attribute label. */ +Object(s.__)("Remove %s filter.","woo-gutenberg-products-block"),L.label.toLocaleLowerCase()),__experimentalInvalid:Object(s.sprintf)( +/* translators: %s is the attribute label. */ +Object(s.__)("Invalid %s filter.","woo-gutenberg-products-block"),L.label.toLocaleLowerCase())}}):Object(o.createElement)(p.a,{className:"wc-block-attribute-filter-list",options:R,checked:F,onChange:le,isLoading:de,isDisabled:pe}),t.showFilterButton&&Object(o.createElement)(b.a,{className:"wc-block-attribute-filter__button",disabled:de||pe,onClick:()=>(e=>{const n=Object(G.b)(D,V,L,ne(e),"or"===t.queryType?"in":"and");re(n,0===e.length)})(F)})))},getProps:e=>({isEditor:!1,attributes:{attributeId:parseInt(e.dataset.attributeId||"0",10),showCounts:"true"===e.dataset.showCounts,queryType:e.dataset.queryType||te.attributes.queryType.default,heading:e.dataset.heading||ee.heading.default,headingLevel:e.dataset.headingLevel?parseInt(e.dataset.headingLevel,10):te.attributes.headingLevel.default,displayStyle:e.dataset.displayStyle||te.attributes.displayStyle.default,showFilterButton:"true"===e.dataset.showFilterButton,selectType:e.dataset.selectType||te.attributes.selectType.default}})})},,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(114),o=n(200),s=n(18),i=n(121);const c=e=>{if(!Object(o.a)())return{className:"",style:{}};const t=Object(s.a)(e)?e:{},n=Object(i.a)(t.style);return Object(r.__experimentalUseBorderProps)({...t,style:n})}},,,function(e,t,n){"use strict";var r=n(0),o=n(13);const s=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=s}]); \ No newline at end of file diff --git a/build/attribute-filter.asset.php b/build/attribute-filter.asset.php new file mode 100644 index 00000000000..444e1bd9bfa --- /dev/null +++ b/build/attribute-filter.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning'), 'version' => 'a295b991424c7d5c75ccc32b2997202f'); \ No newline at end of file diff --git a/build/attribute-filter.js b/build/attribute-filter.js new file mode 100644 index 00000000000..9eef27f51df --- /dev/null +++ b/build/attribute-filter.js @@ -0,0 +1,30 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["attribute-filter"]=function(e){function t(t){for(var r,l,a=t[0],s=t[1],i=t[2],b=0,d=[];b"string"==typeof e},101:function(e,t){e.exports=window.wp.warning},106:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(28);n(246),t.a=e=>{let{name:t,count:n}=e;return Object(r.createElement)(r.Fragment,null,t,n&&Number.isFinite(n)&&Object(r.createElement)(o.a,{label:n.toString(),screenReaderLabel:Object(c.sprintf)( +/* translators: %s number of products. */ +Object(c._n)("%s product","%s products",n,"woo-gutenberg-products-block"),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},109:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(12);function c(e,t){const n=Object(r.useRef)();return Object(r.useEffect)(()=>{n.current===e||t&&!t(e,n.current)||(n.current=e)},[e,t]),n.current}},11:function(e,t){e.exports=window.wp.primitives},12:function(e,t){e.exports=window.React},120:function(e,t,n){"use strict";var r=n(0),c=n(5),o=n(10),l=n(1);n(158),t.a=Object(o.withInstanceId)(e=>{let{className:t,headingLevel:n,onChange:o,heading:a,instanceId:s}=e;const i="h"+n;return Object(r.createElement)(i,{className:t},Object(r.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-"+s},Object(l.__)("Block title","woo-gutenberg-products-block")),Object(r.createElement)(c.PlainText,{id:"block-title-"+s,className:"wc-block-editor-components-title",value:a,onChange:o}))})},124:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0);const c=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},125:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(17),c=n(9),o=n(0),l=n(49),a=n(124);const s=e=>{const{namespace:t,resourceName:n,resourceValues:s=[],query:i={},shouldSelect:u=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(o.useRef)({results:[],isLoading:!0}),d=Object(l.a)(i),p=Object(l.a)(s),m=Object(a.a)(),g=Object(c.useSelect)(e=>{if(!u)return null;const c=e(r.COLLECTIONS_STORE_KEY),o=[t,n,d,p],l=c.getCollectionError(...o);if(l){if(!(l instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(l)}return{results:c.getCollection(...o),isLoading:!c.hasFinishedResolution("getCollection",o)}},[t,n,p,d,u]);return null!==g&&(b.current=g),b.current}},13:function(e,t){e.exports=window.wp.htmlEntities},146:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(4),l=n.n(o),a=n(28);n(183),t.a=e=>{let{className:t,disabled:n,label: +/* translators: Submit button text for filters. */ +o=Object(c.__)("Apply","woo-gutenberg-products-block"),onClick:s,screenReaderLabel:i=Object(c.__)("Apply filter","woo-gutenberg-products-block")}=e;return Object(r.createElement)("button",{type:"submit",className:l()("wp-block-button__link","wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:n,onClick:s},Object(r.createElement)(a.a,{label:o,screenReaderLabel:i}))}},15:function(e,t){e.exports=window.wp.url},150:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(100),c=n(35);const o=e=>Object(r.a)(e)?JSON.parse(e)||{}:Object(c.a)(e)?e:{}},158:function(e,t){},162:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"boolean"==typeof e},17:function(e,t){e.exports=window.wc.wcBlocksData},170:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return o}));var r=n(7);const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const o=e.filter(e=>e.attribute===n.taxonomy),l=o.length?o[0]:null;if(!(l&&l.slug&&Array.isArray(l.slug)&&l.slug.includes(c)))return;const a=l.slug.filter(e=>e!==c),s=e.filter(e=>e.attribute!==n.taxonomy);a.length>0&&(l.slug=a.sort(),s.push(l)),t(Object(r.sortBy)(s,"attribute"))},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";if(!n||!n.taxonomy)return[];const l=e.filter(e=>e.attribute!==n.taxonomy);return 0===c.length?t(l):(l.push({attribute:n.taxonomy,operator:o,slug:c.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(r.sortBy)(l,"attribute"))),l}},183:function(e,t){},19:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return i})),n.d(t,"b",(function(){return u}));var r=n(0),c=n(7),o=n(1);const l={clear:Object(o.__)("Clear all selected items","woo-gutenberg-products-block"),noItems:Object(o.__)("No items found.","woo-gutenberg-products-block"), +/* Translators: %s search term */ +noResults:Object(o.__)("No results for %s","woo-gutenberg-products-block"),search:Object(o.__)("Search for items","woo-gutenberg-products-block"),selected:e=>Object(o.sprintf)( +/* translators: Number of items selected from list. */ +Object(o._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(o.__)("Search results updated.","woo-gutenberg-products-block")},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const n=Object(c.groupBy)(e,"parent"),r=Object(c.keyBy)(t,"id"),o=["0"],l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=l(r[e.parent]);return[...t,e.name]},a=e=>e.map(e=>{const t=n[e.id];return o.push(""+e.id),{...e,breadcrumbs:l(r[e.parent]),children:t&&t.length?a(t):[]}}),s=a(n[0]||[]);return Object.entries(n).forEach(e=>{let[t,n]=e;o.includes(t)||s.push(...a(n||[]))}),s},s=(e,t,n)=>{if(!t)return n?a(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),c=e.map(e=>!!r.test(e.name)&&e).filter(Boolean);return n?a(c,e):c},i=(e,t)=>{if(!t)return e;const n=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(n).map((e,t)=>n.test(e)?Object(r.createElement)("strong",{key:t},e):Object(r.createElement)(r.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},2:function(e,t){e.exports=window.wc.wcSettings},203:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return l}));var r=n(2);const c=Object(r.getSetting)("attributes",[]).reduce((e,t)=>{const n=(r=t)&&r.attribute_name?{id:parseInt(r.attribute_id,10),name:r.attribute_name,taxonomy:"pa_"+r.attribute_name,label:r.attribute_label}:null;var r;return n&&n.id&&e.push(n),e},[]),o=e=>{if(e)return c.find(t=>t.id===e)},l=e=>{if(e)return c.find(t=>t.taxonomy===e)}},204:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(4),l=n.n(o);n(247),t.a=e=>{let{className:t,onChange:n,options:o=[],checked:a=[],isLoading:s=!1,isDisabled:i=!1,limit:u=10}=e;const[b,d]=Object(r.useState)(!1),p=Object(r.useMemo)(()=>[...Array(5)].map((e,t)=>Object(r.createElement)("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})),[]),m=Object(r.useMemo)(()=>{const e=o.length-u;return!b&&Object(r.createElement)("li",{key:"show-more",className:"show-more"},Object(r.createElement)("button",{onClick:()=>{d(!0)},"aria-expanded":!1,"aria-label":Object(c.sprintf)( +/* translators: %s is referring the remaining count of options */ +Object(c._n)("Show %s more option","Show %s more options",e,"woo-gutenberg-products-block"),e)},Object(c.sprintf)( +/* translators: %s number of options to reveal. */ +Object(c._n)("Show %s more","Show %s more",e,"woo-gutenberg-products-block"),e)))},[o,u,b]),g=Object(r.useMemo)(()=>b&&Object(r.createElement)("li",{key:"show-less",className:"show-less"},Object(r.createElement)("button",{onClick:()=>{d(!1)},"aria-expanded":!0,"aria-label":Object(c.__)("Show less options","woo-gutenberg-products-block")},Object(c.__)("Show less","woo-gutenberg-products-block"))),[b]),O=Object(r.useMemo)(()=>{const e=o.length>u+5;return Object(r.createElement)(r.Fragment,null,o.map((t,c)=>Object(r.createElement)(r.Fragment,{key:t.value},Object(r.createElement)("li",e&&!b&&c>=u&&{hidden:!0},Object(r.createElement)("input",{type:"checkbox",id:t.value,value:t.value,onChange:e=>{n(e.target.value)},checked:a.includes(t.value),disabled:i}),Object(r.createElement)("label",{htmlFor:t.value},t.label)),e&&c===u-1&&m)),e&&g)},[o,n,a,b,u,g,m,i]),j=l()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":s},t);return Object(r.createElement)("ul",{className:j},s?p:O)}},219:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(5),c=n(95),o=n(35),l=n(150);const a=e=>{if(!Object(c.b)())return{className:"",style:{}};const t=Object(o.a)(e)?e:{},n=Object(l.a)(t.style);return Object(r.__experimentalUseBorderProps)({...t,style:n})}},22:function(e,t){e.exports=window.wp.isShallowEqual},23:function(e,t,n){"use strict";n.d(t,"o",(function(){return o})),n.d(t,"m",(function(){return l})),n.d(t,"l",(function(){return a})),n.d(t,"n",(function(){return s})),n.d(t,"j",(function(){return i})),n.d(t,"e",(function(){return u})),n.d(t,"f",(function(){return b})),n.d(t,"g",(function(){return d})),n.d(t,"k",(function(){return p})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return g})),n.d(t,"h",(function(){return O})),n.d(t,"a",(function(){return j})),n.d(t,"i",(function(){return f})),n.d(t,"b",(function(){return h}));var r,c=n(2);const o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),l=o.pluginUrl+"images/",a=o.pluginUrl+"build/",s=o.buildPhase,i=null===(r=c.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,d=c.STORE_PAGES.privacy.permalink,p=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),m=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),g=c.STORE_PAGES.cart.permalink,O=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),j=Object(c.getSetting)("allowedCountries",{}),f=Object(c.getSetting)("shippingStates",{}),h=Object(c.getSetting)("allowedStates",{})},233:function(e){e.exports=JSON.parse('{"name":"woocommerce/attribute-filter","version":"1.0.0","title":"Filter Products by Attribute","description":"Allow customers to filter the grid by product attribute, such as color. Works in combination with the All Products block.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"color":{"text":true,"background":false}},"example":{"attributes":{"isPreview":true}},"attributes":{"className":{"type":"string","default":""},"attributeId":{"type":"number","default":0},"showCounts":{"type":"boolean","default":true},"queryType":{"type":"string","default":"or"},"headingLevel":{"type":"number","default":3},"displayStyle":{"type":"string","default":"list"},"showFilterButton":{"type":"boolean","default":false},"selectType":{"type":"string","default":"multiple"},"isPreview":{"type":"boolean","default":false}},"textdomain":"woo-gutenberg-products-block","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},245:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return u}));var r=n(15),c=n(2),o=n(162);const l=Object(c.getSettingWithCoercion)("is_rendering_php_template",!1,o.a),a="query_type_",s="filter_";function i(e){return window?Object(r.getQueryArg)(window.location.href,e):null}function u(e){l?window.location.href=e:window.history.replaceState({},"",e)}},246:function(e,t){},247:function(e,t){},28:function(e,t,n){"use strict";var r=n(0),c=n(4),o=n.n(c);t.a=e=>{let t,{label:n,screenReaderLabel:c,wrapperElement:l,wrapperProps:a={}}=e;const s=null!=n,i=null!=c;return!s&&i?(t=l||"span",a={...a,className:o()(a.className,"screen-reader-text")},Object(r.createElement)(t,a,c)):(t=l||r.Fragment,s&&i&&n!==c?Object(r.createElement)(t,a,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},c)):Object(r.createElement)(t,a,n))}},3:function(e,t){e.exports=window.wp.components},309:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(0),c=n(284),o=n(7),l=n(49),a=n(35),s=n(75),i=n(125),u=n(52);const b=e=>{let{queryAttribute:t,queryPrices:n,queryStock:b,queryState:d}=e,p=Object(u.a)();p+="-collection-data";const[m]=Object(s.a)(p),[g,O]=Object(s.b)("calculate_attribute_counts",[],p),[j,f]=Object(s.b)("calculate_price_range",null,p),[h,w]=Object(s.b)("calculate_stock_status_counts",null,p),_=Object(l.a)(t||{}),y=Object(l.a)(n),v=Object(l.a)(b);Object(r.useEffect)(()=>{"object"==typeof _&&Object.keys(_).length&&(g.find(e=>Object(a.b)(_,"taxonomy")&&e.taxonomy===_.taxonomy)||O([...g,_]))},[_,g,O]),Object(r.useEffect)(()=>{j!==y&&void 0!==y&&f(y)},[y,f,j]),Object(r.useEffect)(()=>{h!==v&&void 0!==v&&w(v)},[v,w,h]);const[E,k]=Object(r.useState)(!1),[S]=Object(c.a)(E,200);E||k(!0);const x=Object(r.useMemo)(()=>(e=>{const t=e;return Array.isArray(e.calculate_attribute_counts)&&(t.calculate_attribute_counts=Object(o.sortBy)(e.calculate_attribute_counts.map(e=>{let{taxonomy:t,queryType:n}=e;return{taxonomy:t,query_type:n}}),["taxonomy","query_type"])),t})(m),[m]);return Object(i.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...d,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...x},shouldSelect:S})}},35:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return c}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function c(e,t){return r(e)&&t in e}},36:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(6),c=n.n(r),o=n(0),l=n(19);const a=e=>{let{countLabel:t,className:n,depth:r=0,controlId:a="",item:s,isSelected:i,isSingle:u,onSelect:b,search:d="",...p}=e;const m=null!=t&&void 0!==s.count&&null!==s.count,g=[n,"woocommerce-search-list__item"];g.push("depth-"+r),u&&g.push("is-radio-button"),m&&g.push("has-count");const O=s.breadcrumbs&&s.breadcrumbs.length,j=p.name||"search-list-item-"+a,f=`${j}-${s.id}`;return Object(o.createElement)("label",{htmlFor:f,className:g.join(" ")},u?Object(o.createElement)("input",c()({type:"radio",id:f,name:j,value:s.value,onChange:b(s),checked:i,className:"woocommerce-search-list__item-input"},p)):Object(o.createElement)("input",c()({type:"checkbox",id:f,name:j,value:s.value,onChange:b(s),checked:i,className:"woocommerce-search-list__item-input"},p)),Object(o.createElement)("span",{className:"woocommerce-search-list__item-label"},O?Object(o.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(l.b)(s.breadcrumbs)):null,Object(o.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(l.d)(s.name,d))),!!m&&Object(o.createElement)("span",{className:"woocommerce-search-list__item-count"},t||s.count))};t.b=a},391:function(e,t,n){e.exports=n(462)},392:function(e,t){},393:function(e,t){},394:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a}));var r=n(35);const c=e=>Object(r.b)(e,"count")&&Object(r.b)(e,"description")&&Object(r.b)(e,"id")&&Object(r.b)(e,"name")&&Object(r.b)(e,"parent")&&Object(r.b)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,o=e=>Array.isArray(e)&&e.every(c),l=e=>Object(r.b)(e,"attribute")&&Object(r.b)(e,"operator")&&Object(r.b)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every(e=>"string"==typeof e),a=e=>Array.isArray(e)&&e.every(l)},395:function(e,t){},45:function(e,t){e.exports=window.wp.a11y},462:function(e,t,n){"use strict";n.r(t);var r=n(6),c=n.n(r),o=n(0),l=n(1),a=n(8),s=n(5),i=n(95),u=n(113),b=n(504),d=n(4),p=n.n(d),m=n(235),g=n(97),O=n(7),j=n(2),f=n(99),h=n(120),w=n(3),_=n(219),y=n(49),v=n(109),E=n(75),k=n(125),S=n(309),x=n(204),C=n(106),T=n(146),N=n(22),A=n.n(N),P=n(13),L=n(283),B=n(15),F=n(162),R=n(100),I=n(35),V=n(394),M=n(245),q=n(535);n(395);var G=e=>{let{className:t,style:n,suggestions:r,multiple:l=!0,saveTransform:a=(e=>e.trim().replace(/\s/g,"-")),messages:s={},validateInput:i=(e=>r.includes(e)),label:u="",...b}=e;return Object(o.createElement)("div",{className:p()("wc-blocks-components-form-token-field-wrapper",t,{"single-selection":!l}),style:n},Object(o.createElement)(q.a,c()({label:u,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,__experimentalValidateInput:i,saveTransform:a,maxLength:l?void 0:1,suggestions:r,messages:s},b)))},H=n(203),z=n(170);const D=[{value:"preview-1",formattedValue:"preview-1",name:"Blue",label:Object(o.createElement)(C.a,{name:"Blue",count:3}),textLabel:"Blue (3)"},{value:"preview-2",formattedValue:"preview-2",name:"Green",label:Object(o.createElement)(C.a,{name:"Green",count:3}),textLabel:"Green (3)"},{value:"preview-3",formattedValue:"preview-3",name:"Red",label:Object(o.createElement)(C.a,{name:"Red",count:2}),textLabel:"Red (2)"}],Q={id:0,name:"preview",taxonomy:"preview",label:"Preview"};n(393);const $=e=>e.replace("pa_",""),U=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n={};t.forEach(e=>{const{attribute:t,slug:r,operator:c}=e,o=$(t),l=r.join(","),a=`${M.b}${o}`,s="in"===c?"or":"and";n[`${M.a}${o}`]=l,n[a]=s});const r=Object(B.removeQueryArgs)(e,...Object.keys(n));return Object(B.addQueryArgs)(r,n)},Y=(e,t)=>{const n=Object.entries(t).reduce((e,t)=>{let[n,r]=t;return n.includes("query_type")?e:{...e,[n]:r}},{});return Object.entries(n).reduce((t,n)=>{let[r,c]=n;return e[r]===c&&t},!0)},W=e=>e.trim().replace(/\s/g,"-").replace(/_/g,"-").replace(/-+/g,"-").replace(/[^a-zA-Z0-9-]/g,"");var K=e=>{let{attributes:t,isEditor:n=!1}=e;const r=Object(j.getSettingWithCoercion)("has_filterable_products",!1,F.a),c=Object(j.getSettingWithCoercion)("is_rendering_php_template",!1,F.a),a=Object(j.getSettingWithCoercion)("page_url",window.location.href,R.a),[s,i]=Object(o.useState)(!1),u=t.isPreview&&!t.attributeId?Q:Object(H.a)(t.attributeId),b=Object(o.useMemo)(()=>(e=>{if(e){const t=Object(M.d)("filter_"+e.name);return"string"==typeof t?t.split(","):[]}return[]})(u),[u]),[d,m]=Object(o.useState)(b),[g,f]=Object(o.useState)(t.isPreview&&!t.attributeId?D:[]),h=Object(_.a)(t),[w]=Object(E.a)(),[N,q]=Object(E.b)("attributes",[]),{results:K,isLoading:J}=Object(k.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[(null==u?void 0:u.id)||0],shouldSelect:t.attributeId>0}),Z="dropdown"!==t.displayStyle&&"and"===t.queryType,{results:X,isLoading:ee}=Object(S.a)({queryAttribute:{taxonomy:(null==u?void 0:u.taxonomy)||"",queryType:t.queryType},queryState:{...w,attributes:Z?w.attributes:null}}),te=Object(o.useCallback)(e=>Object(I.b)(X,"attribute_counts")&&Array.isArray(X.attribute_counts)?X.attribute_counts.find(t=>{let{term:n}=t;return n===e}):null,[X]);Object(o.useEffect)(()=>{if(J||ee)return;if(!Array.isArray(K))return;const e=K.map(e=>{const n=te(e.id);if(!(n||d.includes(e.slug)||(r=e.slug,null!=w&&w.attributes&&w.attributes.some(e=>{let{attribute:t,slug:n=[]}=e;return t===(null==u?void 0:u.taxonomy)&&n.includes(r)}))))return null;var r;const c=n?n.count:0;return{formattedValue:W(e.slug),value:e.slug,name:Object(P.decodeEntities)(e.name),label:Object(o.createElement)(C.a,{name:Object(P.decodeEntities)(e.name),count:t.showCounts?c:null}),textLabel:t.showCounts?`${Object(P.decodeEntities)(e.name)} (${c})`:Object(P.decodeEntities)(e.name)}}).filter(e=>!!e);f(e)},[null==u?void 0:u.taxonomy,K,J,t.showCounts,ee,te,d,w.attributes]);const ne=Object(o.useCallback)(e=>Array.isArray(K)?K.reduce((t,n)=>(e.includes(n.slug)&&t.push(n),t),[]):[],[K]),re=Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){if(null==u||!u.taxonomy)return;const t=Object.keys(Object(B.getQueryArgs)(window.location.href)),n=$(u.taxonomy),r=t.reduce((e,t)=>t.includes(M.b+n)||t.includes(M.a+n)?Object(B.removeQueryArgs)(e,t):e,window.location.href),c=U(r,e);Object(M.c)(c)}else{const t=U(a,e),n=Object(B.getQueryArgs)(window.location.href),r=Object(B.getQueryArgs)(t);Y(n,r)||Object(M.c)(t)}}),[a,null==u?void 0:u.taxonomy]),ce=Object(o.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n||(m(e),!r&&t.showFilterButton||Object(z.b)(N,q,u,ne(e),"or"===t.queryType?"in":"and"))}),[n,m,N,q,u,ne,t.queryType,t.showFilterButton]),oe=Object(o.useMemo)(()=>Object(V.a)(N)?N.filter(e=>{let{attribute:t}=e;return t===(null==u?void 0:u.taxonomy)}).flatMap(e=>{let{slug:t}=e;return t}):[],[N,null==u?void 0:u.taxonomy]),le=Object(y.a)(oe),ae=Object(v.a)(le);Object(o.useEffect)(()=>{!ae||A()(ae,le)||A()(d,le)||ce(le)},[d,le,ae,ce]);const se="single"!==t.selectType,ie=Object(o.useCallback)(e=>{const t=d.includes(e);let n;se?(n=d.filter(t=>t!==e),t||(n.push(e),n.sort())):n=t?[]:[e],ce(n)},[d,se,ce]);if(Object(o.useEffect)(()=>{u&&!t.showFilterButton&&((e=>{let{currentCheckedFilters:t,hasSetFilterDefaultsFromUrl:n}=e;return n&&0===t.length})({currentCheckedFilters:d,hasSetFilterDefaultsFromUrl:s})?re(N,!0):re(N,!1))},[s,re,N,u,d,t.showFilterButton]),Object(o.useEffect)(()=>{if(!s&&!J)return b.length>0?(i(!0),void ce(b,!0)):void(c||i(!0))},[u,s,J,ce,b,c]),!r)return null;if(!u)return n?Object(o.createElement)(L.a,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(l.__)("Please select an attribute to use this filter!","woo-gutenberg-products-block"))):null;if(0===g.length&&!J)return n?Object(o.createElement)(L.a,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(l.__)("The selected attribute does not have any term assigned to products.","woo-gutenberg-products-block"))):null;const ue="h"+t.headingLevel,be=!t.isPreview&&J,de=!t.isPreview&ⅇreturn Object(o.createElement)(o.Fragment,null,!n&&t.heading&&g.length>0&&Object(o.createElement)(ue,{className:"wc-block-attribute-filter__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-attribute-filter style-"+t.displayStyle},"dropdown"===t.displayStyle?Object(o.createElement)(G,{className:p()(h.className,{"single-selection":!se}),style:{...h.style,borderStyle:"none"},suggestions:g.filter(e=>!d.includes(e.value)).map(e=>e.formattedValue),disabled:de,placeholder:Object(l.sprintf)( +/* translators: %s attribute name. */ +Object(l.__)("Any %s","woo-gutenberg-products-block"),u.label),onChange:e=>{!se&&e.length>1&&(e=[e[e.length-1]]),e=e.map(e=>{const t=g.find(t=>t.formattedValue===e);return t?t.value:e});const t=Object(O.difference)(e,d);if(1===t.length)return ie(t[0]);const n=Object(O.difference)(d,e);1===n.length&&ie(n[0])},value:d,displayTransform:e=>{const t=g.find(t=>[t.value,t.formattedValue].includes(e));return t?t.textLabel:e},saveTransform:W,messages:{added:Object(l.sprintf)( +/* translators: %s is the attribute label. */ +Object(l.__)("%s filter added.","woo-gutenberg-products-block"),u.label),removed:Object(l.sprintf)( +/* translators: %s is the attribute label. */ +Object(l.__)("%s filter removed.","woo-gutenberg-products-block"),u.label),remove:Object(l.sprintf)( +/* translators: %s is the attribute label. */ +Object(l.__)("Remove %s filter.","woo-gutenberg-products-block"),u.label.toLocaleLowerCase()),__experimentalInvalid:Object(l.sprintf)( +/* translators: %s is the attribute label. */ +Object(l.__)("Invalid %s filter.","woo-gutenberg-products-block"),u.label.toLocaleLowerCase())}}):Object(o.createElement)(x.a,{className:"wc-block-attribute-filter-list",options:g,checked:d,onChange:ie,isLoading:be,isDisabled:de}),t.showFilterButton&&Object(o.createElement)(T.a,{className:"wc-block-attribute-filter__button",disabled:be||de,onClick:()=>(e=>{const n=Object(z.b)(N,q,u,ne(e),"or"===t.queryType?"in":"and");re(n,0===e.length)})(d)})))};n(392);const J=Object(j.getSetting)("attributes",[]);var Z=Object(w.withSpokenMessages)(e=>{let{attributes:t,setAttributes:n,debouncedSpeak:r}=e;const{attributeId:c,className:a,displayStyle:i,heading:d,headingLevel:_,isPreview:y,queryType:v,showCounts:E,showFilterButton:k,selectType:S}=t,[x,C]=Object(o.useState)(!c&&!y),T=Object(s.useBlockProps)(),N=e=>{if(!e||!e.length)return;const t=e[0].id,r=J.find(e=>e.attribute_id===t.toString());if(!r||c===t)return;const o=r.attribute_label;n({attributeId:t,heading:Object(l.sprintf)( +/* translators: %s attribute name. */ +Object(l.__)("Filter by %s","woo-gutenberg-products-block"),o)})},A=e=>{let{isCompact:t}=e;const n={clear:Object(l.__)("Clear selected attribute","woo-gutenberg-products-block"),list:Object(l.__)("Product Attributes","woo-gutenberg-products-block"),noItems:Object(l.__)("Your store doesn't have any product attributes.","woo-gutenberg-products-block"),search:Object(l.__)("Search for a product attribute:","woo-gutenberg-products-block"),selected:e=>Object(l.sprintf)( +/* translators: %d is the number of attributes selected. */ +Object(l._n)("%d attribute selected","%d attributes selected",e,"woo-gutenberg-products-block"),e),updated:Object(l.__)("Product attribute search results updated.","woo-gutenberg-products-block")},r=Object(O.sortBy)(J.map(e=>({id:parseInt(e.attribute_id,10),name:e.attribute_label})),"name");return Object(o.createElement)(g.a,{className:"woocommerce-product-attributes",list:r,selected:r.filter(e=>{let{id:t}=e;return t===c}),onChange:N,messages:n,isSingle:!0,isCompact:t})};return 0===Object.keys(J).length?Object(o.createElement)(w.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(u.a,{icon:b.a}),label:Object(l.__)("Filter Products by Attribute","woo-gutenberg-products-block"),instructions:Object(l.__)("Display a list of filters based on a chosen attribute.","woo-gutenberg-products-block")},Object(o.createElement)("p",null,Object(l.__)("Attributes are needed for filtering your products. You haven't created any attributes yet.","woo-gutenberg-products-block")),Object(o.createElement)(w.Button,{className:"wc-block-attribute-filter__add-attribute-button",isSecondary:!0,href:Object(j.getAdminLink)("edit.php?post_type=product&page=product_attributes")},Object(l.__)("Add new attribute","woo-gutenberg-products-block")+" ",Object(o.createElement)(u.a,{icon:m.a})),Object(o.createElement)(w.Button,{className:"wc-block-attribute-filter__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-product-taxonomies/"},Object(l.__)("Learn more","woo-gutenberg-products-block"))):Object(o.createElement)("div",T,Object(o.createElement)(s.BlockControls,null,Object(o.createElement)(w.ToolbarGroup,{controls:[{icon:"edit",title:Object(l.__)("Edit","woo-gutenberg-products-block"),onClick:()=>C(!x),isActive:x}]})),Object(o.createElement)(s.InspectorControls,{key:"inspector"},Object(o.createElement)(w.PanelBody,{title:Object(l.__)("Content","woo-gutenberg-products-block")},Object(o.createElement)(w.ToggleControl,{label:Object(l.__)("Product count","woo-gutenberg-products-block"),help:E?Object(l.__)("Product count is visible.","woo-gutenberg-products-block"):Object(l.__)("Product count is hidden.","woo-gutenberg-products-block"),checked:E,onChange:()=>n({showCounts:!E})}),Object(o.createElement)("p",null,Object(l.__)("Heading Level","woo-gutenberg-products-block")),Object(o.createElement)(f.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:_,onChange:e=>n({headingLevel:e})})),Object(o.createElement)(w.PanelBody,{title:Object(l.__)("Block Settings","woo-gutenberg-products-block")},Object(o.createElement)(w.__experimentalToggleGroupControl,{label:Object(l.__)("Allow selecting multiple options?","woo-gutenberg-products-block"),value:S||"multiple",onChange:e=>n({selectType:e})},Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"multiple",label:Object(l.__)("Multiple","woo-gutenberg-products-block")}),Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"single",label:Object(l.__)("Single","woo-gutenberg-products-block")})),"multiple"===S&&Object(o.createElement)(w.__experimentalToggleGroupControl,{label:Object(l.__)("Query Type","woo-gutenberg-products-block"),help:"and"===v?Object(l.__)("Products that have all of the selected attributes will be shown.","woo-gutenberg-products-block"):Object(l.__)("Products that have any of the selected attributes will be shown.","woo-gutenberg-products-block"),value:v,onChange:e=>n({queryType:e})},Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"and",label:Object(l.__)("And","woo-gutenberg-products-block")}),Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"or",label:Object(l.__)("Or","woo-gutenberg-products-block")})),Object(o.createElement)(w.__experimentalToggleGroupControl,{label:Object(l.__)("Display Style","woo-gutenberg-products-block"),value:i,onChange:e=>n({displayStyle:e})},Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"list",label:Object(l.__)("List","woo-gutenberg-products-block")}),Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"dropdown",label:Object(l.__)("Dropdown","woo-gutenberg-products-block")})),Object(o.createElement)(w.ToggleControl,{label:Object(l.__)("Filter button","woo-gutenberg-products-block"),help:k?Object(l.__)("Products will only update when the button is pressed.","woo-gutenberg-products-block"):Object(l.__)("Products will update as options are selected.","woo-gutenberg-products-block"),checked:k,onChange:e=>n({showFilterButton:e})})),Object(o.createElement)(w.PanelBody,{title:Object(l.__)("Filter Products by Attribute","woo-gutenberg-products-block"),initialOpen:!1},A({isCompact:!0}))),x?Object(o.createElement)(w.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(u.a,{icon:b.a}),label:Object(l.__)("Filter Products by Attribute","woo-gutenberg-products-block"),instructions:Object(l.__)("Display a list of filters based on a chosen attribute.","woo-gutenberg-products-block")},Object(o.createElement)("div",{className:"wc-block-attribute-filter__selection"},A({isCompact:!1}),Object(o.createElement)(w.Button,{isPrimary:!0,onClick:()=>{C(!1),r(Object(l.__)("Showing Filter Products by Attribute block preview.","woo-gutenberg-products-block"))}},Object(l.__)("Done","woo-gutenberg-products-block")))):Object(o.createElement)("div",{className:p()(a,"wc-block-attribute-filter")},Object(o.createElement)(h.a,{className:"wc-block-attribute-filter__title",headingLevel:_,heading:d,onChange:e=>n({heading:e})}),Object(o.createElement)(w.Disabled,null,Object(o.createElement)(K,{attributes:t,isEditor:!0}))))});const X={heading:{type:"string",default:Object(l.__)("Filter by attribute","woo-gutenberg-products-block")}};var ee=n(233);Object(a.registerBlockType)(ee,{title:Object(l.__)("Filter Products by Attribute","woo-gutenberg-products-block"),description:Object(l.__)("Allow customers to filter the grid by product attribute, such as color. Works in combination with the All Products block.","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(u.a,{icon:b.a,className:"wc-block-editor-components-block-icon"})},supports:{...ee.supports,...Object(i.b)()&&{__experimentalBorder:{radius:!1,color:!0,width:!1}}},attributes:{...ee.attributes,...X},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:n}=e;return"woocommerce_layered_nav"===t&&!(null==n||!n.raw)},transform:e=>{var t,n,r,c;let{instance:o}=e;return Object(a.createBlock)("woocommerce/attribute-filter",{attributeId:0,showCounts:!0,queryType:(null==o||null===(t=o.raw)||void 0===t?void 0:t.query_type)||"or",heading:(null==o||null===(n=o.raw)||void 0===n?void 0:n.title)||Object(l.__)("Filter by attribute","woo-gutenberg-products-block"),headingLevel:3,displayStyle:(null==o||null===(r=o.raw)||void 0===r?void 0:r.display_type)||"list",showFilterButton:!1,selectType:(null==o||null===(c=o.raw)||void 0===c?void 0:c.select_type)||"multiple",isPreview:!1})}}]},edit:Z,save(e){let{attributes:t}=e;const{className:n,showCounts:r,queryType:l,attributeId:a,heading:i,headingLevel:u,displayStyle:b,showFilterButton:d,selectType:m}=t,g={"data-attribute-id":a,"data-show-counts":r,"data-query-type":l,"data-heading":i,"data-heading-level":u};return"list"!==b&&(g["data-display-style"]=b),d&&(g["data-show-filter-button"]=d),"single"===m&&(g["data-select-type"]=m),Object(o.createElement)("div",c()({},s.useBlockProps.save({className:p()("is-loading",n)}),g),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-product-attribute-filter__placeholder"}))}})},49:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(0),c=n(22),o=n.n(c);function l(e){const t=Object(r.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},5:function(e,t){e.exports=window.wp.blockEditor},51:function(e,t){e.exports=window.wp.deprecated},52:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);const c=Object(r.createContext)("page"),o=()=>Object(r.useContext)(c);c.Provider},53:function(e,t){e.exports=window.wp.keycodes},7:function(e,t){e.exports=window.lodash},71:function(e,t){e.exports=window.wp.dom},75:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return p}));var r=n(17),c=n(9),o=n(0),l=n(22),a=n.n(l),s=n(49),i=n(109),u=n(52);const b=e=>{const t=Object(u.a)();e=e||t;const n=Object(c.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:l}=Object(c.useDispatch)(r.QUERY_STATE_STORE_KEY);return[n,Object(o.useCallback)(t=>{l(e,t)},[e,l])]},d=(e,t,n)=>{const l=Object(u.a)();n=n||l;const a=Object(c.useSelect)(c=>c(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t),[n,e]),{setQueryValue:s}=Object(c.useDispatch)(r.QUERY_STATE_STORE_KEY);return[a,Object(o.useCallback)(t=>{s(n,e,t)},[n,e,s])]},p=(e,t)=>{const n=Object(u.a)();t=t||n;const[r,c]=b(t),l=Object(s.a)(r),d=Object(s.a)(e),p=Object(i.a)(d),m=Object(o.useRef)(!1);return Object(o.useEffect)(()=>{a()(p,d)||(c(Object.assign({},l,d)),m.current=!0)},[l,d,p,c]),m.current?[r,c]:[e,c]}},8:function(e,t){e.exports=window.wp.blocks},9:function(e,t){e.exports=window.wp.data},95:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return a}));var r=n(8),c=n(23);const o=(e,t)=>{if(c.n>2)return Object(r.registerBlockType)(e,t)},l=()=>c.n>2,a=()=>c.n>1},97:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var r=n(6),c=n.n(r),o=n(0),l=n(1),a=n(3),s=n(113),i=n(498),u=n(4),b=n.n(u),d=n(10),p=n(19),m=n(36),g=n(497),O=n(13);const j=e=>{let{id:t,label:n,popoverContents:r,remove:c,screenReaderLabel:i,className:u=""}=e;const[p,m]=Object(o.useState)(!1),f=Object(d.useInstanceId)(j);if(i=i||n,!n)return null;n=Object(O.decodeEntities)(n);const h=b()("woocommerce-tag",u,{"has-remove":!!c}),w="woocommerce-tag__label-"+f,_=Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},i),Object(o.createElement)("span",{"aria-hidden":"true"},n));return Object(o.createElement)("span",{className:h},r?Object(o.createElement)(a.Button,{className:"woocommerce-tag__text",id:w,onClick:()=>m(!0)},_):Object(o.createElement)("span",{className:"woocommerce-tag__text",id:w},_),r&&p&&Object(o.createElement)(a.Popover,{onClose:()=>m(!1)},r),c&&Object(o.createElement)(a.Button,{className:"woocommerce-tag__remove",onClick:c(t),label:Object(l.sprintf)(// Translators: %s label. +Object(l.__)("Remove %s","woo-gutenberg-products-block"),n),"aria-describedby":w},Object(o.createElement)(s.a,{icon:g.a,size:20,className:"clear-icon"})))};var f=j;const h=e=>Object(o.createElement)(m.b,e),w=e=>{const{list:t,selected:n,renderItem:r,depth:l=0,onSelect:a,instanceId:s,isSingle:i,search:u}=e;return t?Object(o.createElement)(o.Fragment,null,t.map(t=>{const b=-1!==n.findIndex(e=>{let{id:n}=e;return n===t.id});return Object(o.createElement)(o.Fragment,{key:t.id},Object(o.createElement)("li",null,r({item:t,isSelected:b,onSelect:a,isSingle:i,search:u,depth:l,controlId:s})),Object(o.createElement)(w,c()({},e,{list:t.children,depth:l+1})))})):null},_=e=>{let{isLoading:t,isSingle:n,selected:r,messages:c,onChange:s,onRemove:i}=e;if(t||n||!r)return null;const u=r.length;return Object(o.createElement)("div",{className:"woocommerce-search-list__selected"},Object(o.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(o.createElement)("strong",null,c.selected(u)),u>0?Object(o.createElement)(a.Button,{isLink:!0,isDestructive:!0,onClick:()=>s([]),"aria-label":c.clear},Object(l.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(o.createElement)("ul",null,r.map((e,t)=>Object(o.createElement)("li",{key:t},Object(o.createElement)(f,{label:e.name,id:e.id,remove:i})))):null)},y=e=>{let{filteredList:t,search:n,onSelect:r,instanceId:c,...a}=e;const{messages:u,renderItem:b,selected:d,isSingle:p}=a,m=b||h;return 0===t.length?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(o.createElement)(s.a,{icon:i.a})),Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-text"},n?Object(l.sprintf)(u.noResults,n):u.noItems)):Object(o.createElement)("ul",{className:"woocommerce-search-list__list"},Object(o.createElement)(w,{list:t,selected:d,renderItem:m,onSelect:r,instanceId:c,isSingle:p,search:n}))},v=e=>{const{className:t="",isCompact:n,isHierarchical:r,isLoading:l,isSingle:s,list:i,messages:u=p.a,onChange:m,onSearch:g,selected:O,debouncedSpeak:j}=e,[f,h]=Object(o.useState)(""),w=Object(d.useInstanceId)(v),E=Object(o.useMemo)(()=>({...p.a,...u}),[u]),k=Object(o.useMemo)(()=>Object(p.c)(i,f,r),[i,f,r]);Object(o.useEffect)(()=>{j&&j(E.updated)},[j,E]),Object(o.useEffect)(()=>{"function"==typeof g&&g(f)},[f,g]);const S=Object(o.useCallback)(e=>()=>{s&&m([]);const t=O.findIndex(t=>{let{id:n}=t;return n===e});m([...O.slice(0,t),...O.slice(t+1)])},[s,O,m]),x=Object(o.useCallback)(e=>()=>{-1===O.findIndex(t=>{let{id:n}=t;return n===e.id})?m(s?[e]:[...O,e]):S(e.id)()},[s,S,m,O]);return Object(o.createElement)("div",{className:b()("woocommerce-search-list",t,{"is-compact":n})},Object(o.createElement)(_,c()({},e,{onRemove:S,messages:E})),Object(o.createElement)("div",{className:"woocommerce-search-list__search"},Object(o.createElement)(a.TextControl,{label:E.search,type:"search",value:f,onChange:e=>h(e)})),l?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(o.createElement)(a.Spinner,null)):Object(o.createElement)(y,c()({},e,{search:f,filteredList:k,messages:E,onSelect:x,instanceId:w})))};Object(a.withSpokenMessages)(v)},99:function(e,t,n){"use strict";var r=n(0),c=n(7),o=n(1),l=n(3),a=n(11);function s(e){let{level:t}=e;const n={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return n.hasOwnProperty(t)?Object(r.createElement)(a.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(a.Path,{d:n[t]})):null}class i extends r.Component{createLevelControl(e,t,n){const c=e===t;return{icon:Object(r.createElement)(s,{level:e}),title:Object(o.sprintf)( +/* translators: %s: heading level e.g: "2", "3", "4" */ +Object(o.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:c,onClick:()=>n(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:n,selectedLevel:o,onChange:a}=this.props;return Object(r.createElement)(l.ToolbarGroup,{isCollapsed:e,icon:Object(r.createElement)(s,{level:o}),controls:Object(c.range)(t,n).map(e=>this.createLevelControl(e,o,a))})}}t.a=i}}); \ No newline at end of file diff --git a/build/attribute-filter/block.json b/build/attribute-filter/block.json new file mode 100644 index 00000000000..86d313b11fd --- /dev/null +++ b/build/attribute-filter/block.json @@ -0,0 +1,61 @@ +{ + "name": "woocommerce/attribute-filter", + "version": "1.0.0", + "title": "Filter Products by Attribute", + "description": "Allow customers to filter the grid by product attribute, such as color. Works in combination with the All Products block.", + "category": "woocommerce", + "keywords": [ "WooCommerce" ], + "supports": { + "html": false, + "color": { + "text": true, + "background": false + } + }, + "example": { + "attributes": { + "isPreview": true + } + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "attributeId": { + "type": "number", + "default": 0 + }, + "showCounts": { + "type": "boolean", + "default": true + }, + "queryType": { + "type": "string", + "default": "or" + }, + "headingLevel": { + "type": "number", + "default": 3 + }, + "displayStyle": { + "type": "string", + "default": "list" + }, + "showFilterButton": { + "type": "boolean", + "default": false + }, + "selectType": { + "type": "string", + "default": "multiple" + }, + "isPreview": { + "type": "boolean", + "default": false + } + }, + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2, + "$schema": "https://schemas.wp.org/trunk/block.json" +} diff --git a/build/blocks-checkout.asset.php b/build/blocks-checkout.asset.php new file mode 100644 index 00000000000..11d9bf11ded --- /dev/null +++ b/build/blocks-checkout.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-registry', 'wc-settings', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-warning'), 'version' => '8615169679a5878d78d97fb72d5c8341'); \ No newline at end of file diff --git a/build/blocks-checkout.js b/build/blocks-checkout.js new file mode 100644 index 00000000000..4b201b8fa80 --- /dev/null +++ b/build/blocks-checkout.js @@ -0,0 +1,5 @@ +this.wc=this.wc||{},this.wc.blocksCheckout=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=135)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;tc&&("#"!==s[u]||!p(e[u]));)u-=1;return!p(e[m])||"left"===n&&t!==c||t-u=s?r+=b("0",i-s):r=(r.substring(0,i)||"0")+"."+r.substring(i),t+r}(a),c=!0),"Infinity"===a&&c&&(a=""),c&&!n&&"number"==typeof r&&(a=function(e,t,n){if(-1!==["","-"].indexOf(e))return e;var r=-1!==e.indexOf(".")&&t,o=d(e),i=o.beforeDecimal,s=o.afterDecimal,a=o.hasNagation,c=parseFloat("0."+(s||"0")),l=(s.length<=t?"0."+s:c.toFixed(t)).split(".");return(a?"-":"")+i.split("").reverse().reduce((function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e}),l[0])+(r?".":"")+h(l[1]||"",Math.min(t,s.length),n)}(a,r,o)),c?this.formatNumString(a):this.formatInput(a))},t.prototype.formatNegation=function(e){void 0===e&&(e="");var t=this.props.allowNegative,n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),i=r.test(e);return e=e.replace(/-/g,""),o&&!i&&t&&(e="-"+e),e},t.prototype.formatInput=function(e){return void 0===e&&(e=""),this.props.format||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)},t.prototype.isCharacterAFormat=function(e,t){var n=this.props,r=n.format,o=n.prefix,i=n.suffix,s=n.decimalScale,a=n.fixedDecimalScale,c=this.getSeparators().decimalSeparator;return"string"==typeof r&&"#"!==r[e]||!(r||!(e=t.length-i.length||s&&a&&t[e]===c))},t.prototype.correctInputValue=function(e,t,n){var r=this,o=this.props,i=o.format,s=o.allowNegative,a=o.prefix,c=o.suffix,l=o.decimalScale,u=this.getSeparators(),p=u.allowedDecimalSeparators,m=u.decimalSeparator,f=this.state.numAsString||"",h=this.selectionBeforeInput,b=h.selectionStart,g=h.selectionEnd,v=function(e,t){for(var n=0,r=0,o=e.length,i=t.length;e[n]===t[n]&&nn&&o-r>n;)r++;return{start:n,end:o-r}}(t,n),w=v.start,O=v.end;if(!i&&w===O&&-1!==p.indexOf(n[b])){var y=0===l?"":m;return n.substr(0,b)+y+n.substr(b+1,n.length)}var j=i?0:a.length,E=t.length-(i?0:c.length);if(n.length>t.length||!n.length||w===O||0===b&&g===t.length||0===w&&O===t.length||b===j&&g===E)return n;var S=t.substr(w,O-w);if([].concat(S).find((function(e,n){return r.isCharacterAFormat(n+w,t)}))){var x=t.substr(w),k={},N=[];[].concat(x).forEach((function(e,n){r.isCharacterAFormat(n+w,t)?k[n]=e:n>S.length-1&&N.push(e)})),Object.keys(k).forEach((function(e){N.length>e?N.splice(e,0,k[e]):N.push(k[e])})),n=t.substr(0,w)+N.join("")}if(!i){var _=this.removeFormatting(n),F=d(_,s),C=F.beforeDecimal,T=F.afterDecimal,P=F.addNegation,R=ew;)v--;v=this.correctCaretPosition(s,v,"left")}}else for(;!h.test(s[v])&&vO)&&(e.preventDefault(),this.setPatchedCaretPosition(n,v,s)),e.isUnitTestRun&&this.setPatchedCaretPosition(n,v,s),f(e)}else f(e)},t.prototype.onMouseUp=function(e){var t=e.target,n=t.selectionStart,r=t.selectionEnd,o=t.value;if(void 0===o&&(o=""),n===r){var i=this.correctCaretPosition(o,n);i!==n&&this.setPatchedCaretPosition(t,i,o)}this.props.onMouseUp(e)},t.prototype.onFocus=function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout((function(){var n=e.target,r=n.selectionStart,o=n.selectionEnd,i=n.value;void 0===i&&(i="");var s=t.correctCaretPosition(i,r);s===r||0===r&&o===i.length||t.setPatchedCaretPosition(n,s,i),t.props.onFocus(e)}),0)},t.prototype.render=function(){var e=this.props,t=e.type,n=e.displayType,r=e.customInput,o=e.renderText,i=e.getInputRef,s=e.format,a=(e.thousandSeparator,e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle,e.decimalScale,e.fixedDecimalScale,e.prefix,e.suffix,e.removeFormatting,e.mask,e.defaultValue,e.isNumericString,e.allowNegative,e.allowEmptyFormatting,e.allowLeadingZeros,e.onValueChange,e.isAllowed,e.customNumerals,e.onChange,e.onKeyDown,e.onMouseUp,e.onFocus,e.onBlur,e.value,function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}(e,["type","displayType","customInput","renderText","getInputRef","format","thousandSeparator","decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","decimalScale","fixedDecimalScale","prefix","suffix","removeFormatting","mask","defaultValue","isNumericString","allowNegative","allowEmptyFormatting","allowLeadingZeros","onValueChange","isAllowed","customNumerals","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value"])),c=this.state,u=c.value,p=c.mounted&&function(e){return e||"undefined"!=typeof navigator&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}(s)?"numeric":void 0,m=Object.assign({inputMode:p},a,{type:t,value:u,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===n)return o?o(u,a)||null:l.a.createElement("span",Object.assign({},a,{ref:i}),u);if(r){var f=r;return l.a.createElement(f,Object.assign({},m,{ref:i}))}return l.a.createElement("input",Object.assign({},m,{ref:i}))},t}(l.a.Component);y.defaultProps=O;var j=y;n(129);const E=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});var S=e=>{let{className:t,value:n,currency:o,onValueChange:s,displayType:c="text",...l}=e;const u="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(u))return null;const p=u/10**o.minorUnit;if(!Number.isFinite(p))return null;const m=i()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),f={...l,...E(o),value:void 0,currency:void 0,onValueChange:void 0},d=s?e=>{const t=+e.value*10**o.minorUnit;s(t)}:()=>{};return Object(r.createElement)(j,a()({className:m,displayType:c},f,{value:p,onValueChange:d}))};n(128);const x=e=>{let{value:t,currency:n}=e;return Object(r.isValidElement)(t)?Object(r.createElement)("div",{className:"wc-block-components-totals-item__value"},t):Number.isFinite(t)?Object(r.createElement)(S,{className:"wc-block-components-totals-item__value",currency:n||{},value:t}):null};var k=e=>{let{className:t,currency:n,label:o,value:s,description:a}=e;return Object(r.createElement)("div",{className:i()("wc-block-components-totals-item",t)},Object(r.createElement)("span",{className:"wc-block-components-totals-item__label"},o),Object(r.createElement)(x,{value:s,currency:n}),Object(r.createElement)("div",{className:"wc-block-components-totals-item__description"},a))},N=n(1),_=n(5),F=e=>{let{currency:t,values:n,className:o}=e;const{total_items:i,total_items_tax:s}=n,a=parseInt(i,10),c=parseInt(s,10);return Object(r.createElement)(k,{className:o,currency:t,label:Object(N.__)("Subtotal","woo-gutenberg-products-block"),value:Object(_.getSetting)("displayCartPricesIncludingTax",!1)?a+c:a})},C=e=>{let{currency:t,values:n,className:o,showRateAfterTaxName:s}=e;const{total_tax:a,tax_lines:c}=n;if(!Object(_.getSetting)("taxesEnabled",!0)&&parseInt(a,10)<=0)return null;const l=Object(_.getSetting)("displayItemizedTaxes",!1),u=l&&c.length>0?Object(r.createElement)(r.Fragment,null,c.map((e,n)=>{let{name:a,rate:c,price:l}=e;const u=`${a}${s?" "+c:""}`;return Object(r.createElement)(k,{key:"tax-line-"+n,className:i()("wc-block-components-totals-taxes",o),currency:t,label:u,value:parseInt(l,10)})})," "):null;return l?u:Object(r.createElement)(r.Fragment,null,Object(r.createElement)(k,{className:i()("wc-block-components-totals-taxes",o),currency:t,label:Object(N.__)("Taxes","woo-gutenberg-products-block"),value:parseInt(a,10),description:null}))},T=e=>{let{currency:t,cartFees:n,className:o}=e;return Object(r.createElement)(r.Fragment,null,n.map((e,n)=>{let{id:s,name:a,totals:c}=e;const l=parseInt(c.total,10);if(!l)return null;const u=parseInt(c.total_tax,10);return Object(r.createElement)(k,{key:s||`${n}-${a}`,className:i()("wc-block-components-totals-fees",o),currency:t,label:a||Object(N.__)("Fee","woo-gutenberg-products-block"),value:Object(_.getSetting)("displayCartPricesIncludingTax",!1)?l+u:l})}))};n(130);var P=e=>{let{children:t,slotWrapper:n=!1,className:o}=e;return c.Children.count(t)?Object(r.createElement)("div",{className:i()(o,"wc-block-components-totals-wrapper",{"slot-wrapper":n})},t):null},R=n(7),M=n.n(R),A=n(6),D=n(19);function I(e){const t=Object(r.useContext)(D.a),n=t.slots[e]||{},o=t.fills[e],i=Object(r.useMemo)(()=>o||[],[o]);return{...n,updateSlot:Object(r.useCallback)(n=>{t.updateSlot(e,n)},[e,t.updateSlot]),unregisterSlot:Object(r.useCallback)(n=>{t.unregisterSlot(e,n)},[e,t.unregisterSlot]),fills:i,registerFill:Object(r.useCallback)(n=>{t.registerFill(e,n)},[e,t.registerFill]),unregisterFill:Object(r.useCallback)(n=>{t.unregisterFill(e,n)},[e,t.unregisterFill])}}var L=n(8),V=n(4),B=Object(r.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function U({name:e,children:t,registerFill:n,unregisterFill:o}){const i=(e=>{const{getSlot:t,subscribe:n}=Object(r.useContext)(B),[o,i]=Object(r.useState)(t(e));return Object(r.useEffect)(()=>(i(t(e)),n(()=>{i(t(e))})),[e]),o})(e),s=Object(r.useRef)({name:e,children:t});return Object(r.useLayoutEffect)(()=>(n(e,s.current),()=>o(e,s.current)),[]),Object(r.useLayoutEffect)(()=>{s.current.children=t,i&&i.forceUpdate()},[t]),Object(r.useLayoutEffect)(()=>{e!==s.current.name&&(o(s.current.name,s.current),s.current.name=e,n(e,s.current))},[e]),i&&i.node?(Object(V.isFunction)(t)&&(t=t(i.props.fillProps)),Object(r.createPortal)(t,i.node)):null}var W=e=>Object(r.createElement)(B.Consumer,null,({registerFill:t,unregisterFill:n})=>Object(r.createElement)(U,Object(L.a)({},e,{registerFill:t,unregisterFill:n})));class H extends r.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:n,registerSlot:r}=this.props;e.name!==t&&(n(e.name),r(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:n={},getFills:o}=this.props,i=Object(V.map)(o(t,this),e=>{const t=Object(V.isFunction)(e.children)?e.children(n):e.children;return r.Children.map(t,(e,t)=>{if(!e||Object(V.isString)(e))return e;const n=e.key||t;return Object(r.cloneElement)(e,{key:n})})}).filter(Object(V.negate)(r.isEmptyElement));return Object(r.createElement)(r.Fragment,null,Object(V.isFunction)(e)?e(i):i)}}var z=e=>Object(r.createElement)(B.Consumer,null,({registerSlot:t,unregisterSlot:n,getFills:o})=>Object(r.createElement)(H,Object(L.a)({},e,{registerSlot:t,unregisterSlot:n,getFills:o})));function $(){const[,e]=Object(r.useState)({}),t=Object(r.useRef)(!0);return Object(r.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function K({name:e,children:t}){const n=I(e),o=Object(r.useRef)({rerender:$()});return Object(r.useEffect)(()=>(n.registerFill(o),()=>{n.unregisterFill(o)}),[n.registerFill,n.unregisterFill]),n.ref&&n.ref.current?("function"==typeof t&&(t=t(n.fillProps)),Object(r.createPortal)(t,n.ref.current)):null}var G=n(12),q=Object(r.forwardRef)((function({name:e,fillProps:t={},as:n="div",...o},i){const s=Object(r.useContext)(D.a),a=Object(r.useRef)();return Object(r.useLayoutEffect)(()=>(s.registerSlot(e,a,t),()=>{s.unregisterSlot(e,a)}),[s.registerSlot,s.unregisterSlot,e]),Object(r.useLayoutEffect)(()=>{s.updateSlot(e,t)}),Object(r.createElement)(n,Object(L.a)({ref:Object(G.useMergeRefs)([i,a])},o))})),Y=n(16),Z=n.n(Y);function X({children:e}){const t=function(){const[e,t]=Object(r.useState)({}),[n,o]=Object(r.useState)({}),i=Object(r.useCallback)((e,n,r)=>{t(t=>{const o=t[e]||{};return{...t,[e]:{...o,ref:n||o.ref,fillProps:r||o.fillProps||{}}}})},[]),s=Object(r.useCallback)((e,n)=>{t(t=>{const{[e]:r,...o}=t;return(null==r?void 0:r.ref)===n?o:t})},[]),a=Object(r.useCallback)((t,r)=>{const o=e[t];if(o&&!Z()(o.fillProps,r)){o.fillProps=r;const e=n[t];e&&e.map(e=>e.current.rerender())}},[e,n]),c=Object(r.useCallback)((e,t)=>{o(n=>({...n,[e]:[...n[e]||[],t]}))},[]),l=Object(r.useCallback)((e,t)=>{o(n=>n[e]?{...n,[e]:n[e].filter(e=>e!==t)}:n)},[]);return Object(r.useMemo)(()=>({slots:e,fills:n,registerSlot:i,updateSlot:a,unregisterSlot:s,registerFill:c,unregisterFill:l}),[e,n,i,a,s,c,l])}();return Object(r.createElement)(D.a.Provider,{value:t},e)}class J extends r.Component{constructor(){super(...arguments),this.registerSlot=this.registerSlot.bind(this),this.registerFill=this.registerFill.bind(this),this.unregisterSlot=this.unregisterSlot.bind(this),this.unregisterFill=this.unregisterFill.bind(this),this.getSlot=this.getSlot.bind(this),this.getFills=this.getFills.bind(this),this.hasFills=this.hasFills.bind(this),this.subscribe=this.subscribe.bind(this),this.slots={},this.fills={},this.listeners=[],this.contextValue={registerSlot:this.registerSlot,unregisterSlot:this.unregisterSlot,registerFill:this.registerFill,unregisterFill:this.unregisterFill,getSlot:this.getSlot,getFills:this.getFills,hasFills:this.hasFills,subscribe:this.subscribe}}registerSlot(e,t){const n=this.slots[e];this.slots[e]=t,this.triggerListeners(),this.forceUpdateSlot(e),n&&n.forceUpdate()}registerFill(e,t){this.fills[e]=[...this.fills[e]||[],t],this.forceUpdateSlot(e)}unregisterSlot(e,t){this.slots[e]===t&&(delete this.slots[e],this.triggerListeners())}unregisterFill(e,t){this.fills[e]=Object(V.without)(this.fills[e],t),this.forceUpdateSlot(e)}getSlot(e){return this.slots[e]}getFills(e,t){return this.slots[e]!==t?[]:this.fills[e]}hasFills(e){return this.fills[e]&&!!this.fills[e].length}forceUpdateSlot(e){const t=this.getSlot(e);t&&t.forceUpdate()}triggerListeners(){this.listeners.forEach(e=>e())}subscribe(e){return this.listeners.push(e),()=>{this.listeners=Object(V.without)(this.listeners,e)}}render(){return Object(r.createElement)(B.Provider,{value:this.contextValue},this.props.children)}}function Q(e){return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(W,e),Object(r.createElement)(K,e))}const ee=Object(r.forwardRef)(({bubblesVirtually:e,...t},n)=>e?Object(r.createElement)(q,Object(L.a)({},t,{ref:n})):Object(r.createElement)(z,t));function te({children:e,...t}){return Object(r.createElement)(J,t,Object(r.createElement)(X,null,e))}function ne(e){const t=t=>Object(r.createElement)(Q,Object(L.a)({name:e},t));t.displayName=e+"Fill";const n=t=>Object(r.createElement)(ee,Object(L.a)({name:e},t));return n.displayName=e+"Slot",n.__unstableName=e,{Fill:t,Slot:n}}var re=n(15),oe=n.n(re);class ie extends c.Component{constructor(){super(...arguments),oe()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(r.createElement)(r.Fragment,null,Object(r.createElement)("strong",null,e.status),": "+e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{renderError:e}=this.props,{errorMessage:t,hasError:n}=this.state;return n?"function"==typeof e?e(t):Object(r.createElement)("p",null,t):this.props.children}}var se=ie;const ae=e=>Array.isArray(e)&&e.filter(Boolean).length>0;let ce;ce=I;const le=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const{Fill:n,Slot:o}=ne(e),i=e=>{let{children:o}=e;return Object(r.createElement)(n,null,e=>r.Children.map(o,n=>Object(r.createElement)(se,{renderError:_.CURRENT_USER_IS_ADMIN?t:()=>null},Object(r.cloneElement)(n,e))))},s=e=>Object(r.createElement)(o,a()({},e,{bubblesVirtually:!0}));return{Fill:i,Slot:s}},{Fill:ue,Slot:pe}=le("__experimentalOrderMeta");ue.Slot=e=>{let{className:t,extensions:n,cart:o,context:s}=e;const{fills:a}=ce("__experimentalOrderMeta");return ae(a)&&Object(r.createElement)(P,{slotWrapper:!0},Object(r.createElement)(pe,{className:i()(t,"wc-block-components-order-meta"),fillProps:{extensions:n,cart:o,context:s}}))};var me=ue;const{Fill:fe,Slot:de}=le("__experimentalDiscountsMeta");fe.Slot=e=>{let{className:t,extensions:n,cart:o,context:s}=e;const{fills:a}=ce("__experimentalDiscountsMeta");return ae(a)&&Object(r.createElement)(P,{slotWrapper:!0},Object(r.createElement)(de,{className:i()(t,"wc-block-components-discounts-meta"),fillProps:{extensions:n,cart:o,context:s}}))};var he=fe;const{Fill:be,Slot:ge}=le("__experimentalOrderShippingPackages");be.Slot=e=>{let{className:t,collapsible:n,noResultsMessage:o,renderOption:s,extensions:a,cart:c,components:l,context:u,shippingRates:p}=e;const{fills:m}=ce("__experimentalOrderShippingPackages"),f=m.length>1||(null==p?void 0:p.length)>1;return Object(r.createElement)(ge,{className:i()("wc-block-components-shipping-rates-control",t),fillProps:{collapsible:n,collapse:f,showItems:f,noResultsMessage:o,renderOption:s,extensions:a,cart:c,components:l,context:u}})};var ve=be,we=function(e){let{icon:t,size:n=24,...o}=e;return Object(r.cloneElement)(t,{width:n,height:n,...o})},Oe=Object(r.createElement)(A.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(A.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),ye=Object(r.createElement)(A.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(A.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));n(131);var je=e=>{let{children:t,className:n,initialOpen:o=!1,hasBorder:s=!1,title:a,titleTag:c="div"}=e;const[l,u]=Object(r.useState)(o);return Object(r.createElement)("div",{className:i()(n,"wc-block-components-panel",{"has-border":s})},Object(r.createElement)(c,null,Object(r.createElement)("button",{"aria-expanded":l,className:"wc-block-components-panel__button",onClick:()=>u(!l)},Object(r.createElement)(we,{"aria-hidden":"true",className:"wc-block-components-panel__button-icon",icon:l?Oe:ye}),a)),l&&Object(r.createElement)("div",{className:"wc-block-components-panel__content"},t))},Ee=n(33),Se=Object(r.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(A.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function xe(e,t,n){const{defaultView:r}=t,{frameElement:o}=r;if(!o||t===n.ownerDocument)return e;const i=o.getBoundingClientRect();return new r.DOMRect(e.left+i.left,e.top+i.top,e.width,e.height)}let ke=0;function Ne(e){const t=document.scrollingElement||document.body;e&&(ke=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=ke)}let _e=0;function Fe(){return Object(r.useEffect)(()=>(0===_e&&Ne(!0),++_e,()=>{1===_e&&Ne(!1),--_e}),[]),null}function Ce(e){return"appear"===e?"top":"left"}function Te(e,t){const{paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:i}=(s=t).ownerDocument.defaultView.getComputedStyle(s);var s;const a=n?parseInt(n,10):0,c=r?parseInt(r,10):0,l=o?parseInt(o,10):0,u=i?parseInt(i,10):0;return{x:e.left+l,y:e.top+a,width:e.width-l-u,height:e.height-a-c,left:e.left+l,right:e.right-u,top:e.top+a,bottom:e.bottom-c}}function Pe(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function Re(e,t,n=""){e.style[t]!==n&&(e.style[t]=n)}function Me(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const Ae=Object(r.forwardRef)(({headerTitle:e,onClose:t,children:n,className:o,noArrow:s=!0,isAlternate:a,position:c="bottom right",range:l,focusOnMount:u="firstElement",anchorRef:p,shouldAnchorIncludePadding:m,anchorRect:f,getAnchorRect:d,expandOnMobile:h,animate:b=!0,onClickOutside:g,onFocusOutside:v,__unstableStickyBoundaryElement:w,__unstableSlotName:O="Popover",__unstableObserveElement:y,__unstableBoundaryParent:j,__unstableForcePosition:E,__unstableForceXAlignment:S,...x},k)=>{const _=Object(r.useRef)(null),F=Object(r.useRef)(null),C=Object(r.useRef)(),T=Object(G.useViewportMatch)("medium","<"),[P,R]=Object(r.useState)(),A=I(O),D=h&&T,[V,B]=Object(G.useResizeObserver)();s=D||s,Object(r.useLayoutEffect)(()=>{if(D)return Me(C.current,"is-without-arrow",s),Me(C.current,"is-alternate",a),Pe(C.current,"data-x-axis"),Pe(C.current,"data-y-axis"),Re(C.current,"top"),Re(C.current,"left"),Re(F.current,"maxHeight"),void Re(F.current,"maxWidth");const e=()=>{if(!C.current||!F.current)return;let e=function(e,t,n,r=!1,o,i){if(t)return t;if(n){if(!e.current)return;const t=n(e.current);return xe(t,t.ownerDocument||e.current.ownerDocument,i)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==r?void 0:r.cloneRange))return xe(Object(Ee.getRectangleFromRange)(r),r.endContainer.ownerDocument,i);if("function"==typeof(null==r?void 0:r.getBoundingClientRect)){const e=xe(r.getBoundingClientRect(),r.ownerDocument,i);return o?e:Te(e,r)}const{top:e,bottom:t}=r,n=e.getBoundingClientRect(),s=t.getBoundingClientRect(),a=xe(new window.DOMRect(n.left,n.top,n.width,s.bottom-n.top),e.ownerDocument,i);return o?a:Te(a,r)}if(!e.current)return;const{parentNode:s}=e.current,a=s.getBoundingClientRect();return o?a:Te(a,s)}(_,f,d,p,m,C.current);if(!e)return;const{offsetParent:t,ownerDocument:n}=C.current;let r,o=0;if(t&&t!==n.body){const n=t.getBoundingClientRect();o=n.top,e=new window.DOMRect(e.left-n.left,e.top-n.top,e.width,e.height)}var i;j&&(r=null===(i=C.current.closest(".popover-slot"))||void 0===i?void 0:i.parentNode);const l=B.height?B:F.current.getBoundingClientRect(),{popoverTop:u,popoverLeft:h,xAxis:b,yAxis:g,contentHeight:v,contentWidth:O}=function(e,t,n="top",r,o,i,s,a,c){const[l,u="center",p]=n.split(" "),m=function(e,t,n,r,o,i,s,a){const{height:c}=t;if(o){const t=o.getBoundingClientRect().top+c-s;if(e.top<=t)return{yAxis:n,popoverTop:Math.min(e.bottom,t)}}let l=e.top+e.height/2;"bottom"===r?l=e.bottom:"top"===r&&(l=e.top);const u={popoverTop:l,contentHeight:(l-c/2>0?c/2:l)+(l+c/2>window.innerHeight?window.innerHeight-l:c/2)},p={popoverTop:e.top,contentHeight:e.top-10-c>0?c:e.top-10},m={popoverTop:e.bottom,contentHeight:e.bottom+10+c>window.innerHeight?window.innerHeight-10-e.bottom:c};let f,d=n,h=null;if(!o&&!a)if("middle"===n&&u.contentHeight===c)d="middle";else if("top"===n&&p.contentHeight===c)d="top";else if("bottom"===n&&m.contentHeight===c)d="bottom";else{d=p.contentHeight>m.contentHeight?"top":"bottom";const e="top"===d?p.contentHeight:m.contentHeight;h=e!==c?e:null}return f="middle"===d?u.popoverTop:"top"===d?p.popoverTop:m.popoverTop,{yAxis:d,popoverTop:f,contentHeight:h}}(e,t,l,p,r,0,i,a);return{...function(e,t,n,r,o,i,s,a,c){const{width:l}=t;"left"===n&&Object(N.isRTL)()?n="right":"right"===n&&Object(N.isRTL)()&&(n="left"),"left"===r&&Object(N.isRTL)()?r="right":"right"===r&&Object(N.isRTL)()&&(r="left");const u=Math.round(e.left+e.width/2),p={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)};let m=e.left;"right"===r?m=e.right:"middle"===i||c||(m=u);let f=e.right;"left"===r?f=e.left:"middle"===i||c||(f=u);const d={popoverLeft:m,contentWidth:m-l>0?l:m},h={popoverLeft:f,contentWidth:f+l>window.innerWidth?window.innerWidth-f:l};let b,g=n,v=null;if(!o&&!a)if("center"===n&&p.contentWidth===l)g="center";else if("left"===n&&d.contentWidth===l)g="left";else if("right"===n&&h.contentWidth===l)g="right";else{g=d.contentWidth>h.contentWidth?"left":"right";const e="left"===g?d.contentWidth:h.contentWidth;l>window.innerWidth&&(v=window.innerWidth),e!==l&&(g="center",p.popoverLeft=window.innerWidth/2)}if(b="center"===g?p.popoverLeft:"left"===g?d.popoverLeft:h.popoverLeft,s){const e=s.getBoundingClientRect();b=Math.min(b,e.right-l),Object(N.isRTL)()||(b=Math.max(b,0))}return{xAxis:g,popoverLeft:b,contentWidth:v}}(e,t,u,p,r,m.yAxis,s,a,c),...m}}(e,l,c,w,C.current,o,r,E,S);"number"==typeof u&&"number"==typeof h&&(Re(C.current,"top",u+"px"),Re(C.current,"left",h+"px")),Me(C.current,"is-without-arrow",s||"center"===b&&"middle"===g),Me(C.current,"is-alternate",a),Pe(C.current,"data-x-axis",b),Pe(C.current,"data-y-axis",g),Re(F.current,"maxHeight","number"==typeof v?v+"px":""),Re(F.current,"maxWidth","number"==typeof O?O+"px":""),R(({left:"right",right:"left"}[b]||"center")+" "+({top:"bottom",bottom:"top"}[g]||"middle"))};e();const{ownerDocument:t}=C.current,{defaultView:n}=t,r=n.setInterval(e,500);let o;const i=()=>{n.cancelAnimationFrame(o),o=n.requestAnimationFrame(e)};n.addEventListener("click",i),n.addEventListener("resize",e),n.addEventListener("scroll",e,!0);const l=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(p);let u;return l&&l!==t&&(l.defaultView.addEventListener("resize",e),l.defaultView.addEventListener("scroll",e,!0)),y&&(u=new n.MutationObserver(e),u.observe(y,{attributes:!0})),()=>{n.clearInterval(r),n.removeEventListener("resize",e),n.removeEventListener("scroll",e,!0),n.removeEventListener("click",i),n.cancelAnimationFrame(o),l&&l!==t&&(l.defaultView.removeEventListener("resize",e),l.defaultView.removeEventListener("scroll",e,!0)),u&&u.disconnect()}},[D,f,d,p,m,c,B,w,y,j]);const U=(e,n)=>{if("focus-outside"===e&&v)v(n);else if("focus-outside"===e&&g){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>n.relatedTarget}),M()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),g(e)}else t&&t()},[W,H]=Object(G.__experimentalUseDialog)({focusOnMount:u,__unstableOnClose:U,onClose:U}),z=Object(G.useMergeRefs)([C,W,k]),$=Boolean(b&&P)&&function(e){if("loading"===e.type)return i()("components-animate__loading");const{type:t,origin:n=Ce(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return i()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?i()("components-animate__slide-in","is-from-"+n):void 0}({type:"appear",origin:P});let K=Object(r.createElement)("div",Object(L.a)({className:i()("components-popover",o,$,{"is-expanded":D,"is-without-arrow":s,"is-alternate":a})},x,{ref:z},H,{tabIndex:"-1"}),D&&Object(r.createElement)(Fe,null),D&&Object(r.createElement)("div",{className:"components-popover__header"},Object(r.createElement)("span",{className:"components-popover__header-title"},e),Object(r.createElement)(Ge,{className:"components-popover__close",icon:Se,onClick:t})),Object(r.createElement)("div",{ref:F,className:"components-popover__content"},Object(r.createElement)("div",{style:{position:"relative"}},V,n)));return A.ref&&(K=Object(r.createElement)(Q,{name:O},K)),p||f?K:Object(r.createElement)("span",{ref:_},K)});Ae.Slot=Object(r.forwardRef)((function({name:e="Popover"},t){return Object(r.createElement)(ee,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var De=Ae,Ie=function({shortcut:e,className:t}){if(!e)return null;let n,o;return Object(V.isString)(e)&&(n=e),Object(V.isObject)(e)&&(n=e.display,o=e.ariaLabel),Object(r.createElement)("span",{className:t,"aria-label":o},n)};const Le=Object(r.createElement)("div",{className:"event-catcher"}),Ve=({eventHandlers:e,child:t,childrenWithPopover:n})=>Object(r.cloneElement)(Object(r.createElement)("span",{className:"disabled-element-wrapper"},Object(r.cloneElement)(Le,e),Object(r.cloneElement)(t,{children:n}),","),e),Be=({child:e,eventHandlers:t,childrenWithPopover:n})=>Object(r.cloneElement)(e,{...t,children:n}),Ue=(e,t,n)=>{if(1!==r.Children.count(e))return;const o=r.Children.only(e);"function"==typeof o.props[t]&&o.props[t](n)};var We=function({children:e,position:t,text:n,shortcut:o}){const[i,s]=Object(r.useState)(!1),[a,c]=Object(r.useState)(!1),l=Object(G.useDebounce)(c,700),u=t=>{Ue(e,"onMouseDown",t),document.addEventListener("mouseup",f),s(!0)},p=t=>{Ue(e,"onMouseUp",t),document.removeEventListener("mouseup",f),s(!1)},m=e=>"mouseUp"===e?p:"mouseDown"===e?u:void 0,f=m("mouseUp"),d=(t,n)=>r=>{if(Ue(e,t,r),r.currentTarget.disabled)return;if("focus"===r.type&&i)return;l.cancel();const o=Object(V.includes)(["focus","mouseenter"],r.type);o!==a&&(n?l(o):c(o))},h=()=>{l.cancel(),document.removeEventListener("mouseup",f)};if(Object(r.useEffect)(()=>h,[]),1!==r.Children.count(e))return e;const b={onMouseEnter:d("onMouseEnter",!0),onMouseLeave:d("onMouseLeave"),onClick:d("onClick"),onFocus:d("onFocus"),onBlur:d("onBlur"),onMouseDown:m("mouseDown")},g=r.Children.only(e),{children:v,disabled:w}=g.props;return(w?Ve:Be)({child:g,eventHandlers:b,childrenWithPopover:(({grandchildren:e,isOver:t,position:n,text:o,shortcut:i})=>Object(r.concatChildren)(e,t&&Object(r.createElement)(De,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},o,Object(r.createElement)(Ie,{className:"components-tooltip__shortcut",shortcut:i}))))({grandchildren:v,isOver:a,position:t,text:n,shortcut:o})})},He=function({icon:e,className:t,...n}){const o=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(r.createElement)("span",Object(L.a)({className:o},n))},ze=function({icon:e=null,size:t=24,...n}){if("string"==typeof e)return Object(r.createElement)(He,Object(L.a)({icon:e},n));if(Object(r.isValidElement)(e)&&He===e.type)return Object(r.cloneElement)(e,{...n});if("function"==typeof e)return e.prototype instanceof r.Component?Object(r.createElement)(e,{size:t,...n}):e({size:t,...n});if(e&&("svg"===e.type||e.type===A.SVG)){const o={width:t,height:t,...e.props,...n};return Object(r.createElement)(A.SVG,o)}return Object(r.isValidElement)(e)?Object(r.cloneElement)(e,{size:t,...n}):e},$e=Object(r.forwardRef)((function({as:e="div",className:t,...n},o){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(r.createElement)(e,t)}({as:e,className:i()("components-visually-hidden",t),...n,ref:o})}));const Ke=["onMouseDown","onClick"];var Ge=Object(r.forwardRef)((function(e,t){const{href:n,target:o,isSmall:s,isPressed:a,isBusy:c,isDestructive:l,className:u,disabled:p,icon:m,iconPosition:f="left",iconSize:d,showTooltip:h,tooltipPosition:b,shortcut:g,label:v,children:w,text:O,variant:y,__experimentalIsFocusable:j,describedBy:E,...S}=function({isDefault:e,isPrimary:t,isSecondary:n,isTertiary:r,isLink:o,variant:i,...s}){let a=i;var c,l,u,p,m;return t&&(null!==(c=a)&&void 0!==c||(a="primary")),r&&(null!==(l=a)&&void 0!==l||(a="tertiary")),n&&(null!==(u=a)&&void 0!==u||(a="secondary")),e&&(M()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(p=a)&&void 0!==p||(a="secondary")),o&&(null!==(m=a)&&void 0!==m||(a="link")),{...s,variant:a}}(e),x=i()("components-button",u,{"is-secondary":"secondary"===y,"is-primary":"primary"===y,"is-small":s,"is-tertiary":"tertiary"===y,"is-pressed":a,"is-busy":c,"is-link":"link"===y,"is-destructive":l,"has-text":!!m&&!!w,"has-icon":!!m}),k=p&&!j,N=void 0===n||k?"button":"a",_="a"===N?{href:n,target:o}:{type:"button",disabled:k,"aria-pressed":a};if(p&&j){_["aria-disabled"]=!0;for(const e of Ke)S[e]=e=>{e.stopPropagation(),e.preventDefault()}}const F=!k&&(h&&v||g||!!v&&(!w||Object(V.isArray)(w)&&!w.length)&&!1!==h),C=E?Object(V.uniqueId)():null,T=S["aria-describedby"]||C,P=Object(r.createElement)(N,Object(L.a)({},_,S,{className:x,"aria-label":S["aria-label"]||v,"aria-describedby":T,ref:t}),m&&"left"===f&&Object(r.createElement)(ze,{icon:m,size:d}),O&&Object(r.createElement)(r.Fragment,null,O),m&&"right"===f&&Object(r.createElement)(ze,{icon:m,size:d}),w);return F?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(We,{text:E||v,shortcut:g,position:b},P),E&&Object(r.createElement)($e,null,Object(r.createElement)("span",{id:C},E))):Object(r.createElement)(r.Fragment,null,P,E&&Object(r.createElement)($e,null,Object(r.createElement)("span",{id:C},E)))}));n(133);var qe=()=>Object(r.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"});n(132);var Ye=e=>{let{className:t,showSpinner:n=!1,children:o,variant:s="contained",...c}=e;const l=i()("wc-block-components-button",t,s,{"wc-block-components-button--loading":n});return Object(r.createElement)(Ge,a()({className:l},c),n&&Object(r.createElement)(qe,null),Object(r.createElement)("span",{className:"wc-block-components-button__text"},o))},Ze=e=>{let t,{label:n,screenReaderLabel:o,wrapperElement:s,wrapperProps:a={}}=e;const c=null!=n,l=null!=o;return!c&&l?(t=s||"span",a={...a,className:i()(a.className,"screen-reader-text")},Object(r.createElement)(t,a,o)):(t=s||r.Fragment,c&&l&&n!==o?Object(r.createElement)(t,a,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,a,n))};n(134);const Xe=e=>{let{className:t,label:n,id:o,onChange:s,children:c,hasError:l=!1,checked:u=!1,...p}=e;const m=Object(G.useInstanceId)(Xe),f=o||"checkbox-control-"+m;return Object(r.createElement)("div",{className:i()("wc-block-components-checkbox",{"has-error":l},t)},Object(r.createElement)("label",{htmlFor:f},Object(r.createElement)("input",a()({id:f,className:"wc-block-components-checkbox__input",type:"checkbox",onChange:e=>s(e.target.checked),"aria-invalid":!0===l,checked:u},p)),Object(r.createElement)("svg",{className:"wc-block-components-checkbox__mark","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 20"},Object(r.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})),n&&Object(r.createElement)("span",{className:"wc-block-components-checkbox__label"},n),c))};var Je=Xe;const Qe=(e,t)=>{if(!e.includes(t))throw Error(Object(N.sprintf)( +/* translators: %1$s value passed to filter, %2$s : value that must be included. */ +Object(N.__)('Returned value must include %1$s, you passed "%2$s"',"woo-gutenberg-products-block"),t,e));return!0};var et=n(3),tt=n(9);const nt=e=>{const{applyExtensionCartUpdate:t}=Object(et.dispatch)(tt.b);return t(e)},rt=e=>null===e,ot=e=>!rt(e)&&e instanceof Object&&e.constructor===Object,it=()=>!0;let st={};const at=(e,t)=>{Object.keys(t).includes("couponName")&&M()("snackbarNotices",{alternative:"snackbarNoticeVisibility",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4417"}),Object.keys(t).includes("couponName")&&M()("couponName",{alternative:"coupons",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/bb921d21f42e21f38df2b1c87b48e07aa4cb0538/docs/extensibility/available-filters.md#coupons"}),st={...st,[e]:t}},ct={},lt=(e,t,n,r)=>{ct[e]={arg:t,extensions:n,defaultValue:r}},ut=(e,t)=>!(!rt(e)||!rt(t))||ot(e)&&ot(t)&&Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(n=>{return o=n,ot(r=t)&&o in r&&Z()(e[n],t[n]);var r,o}),pt=e=>{let{filterName:t,defaultValue:n,extensions:o=null,arg:i=null,validation:s=it}=e;const a=Object(r.useRef)({});return Object(r.useMemo)(()=>{if(!((e,t,n,r)=>{const o=ct[e];if(!o)return lt(e,t,n,r),!0;const{arg:i={},extensions:s={},defaultValue:a=null}=o;return ut(t,i)?!(r===a&&ut(n,s)||(lt(e,t,n,r),0)):(lt(e,t,n,r),!0)})(t,i,o,n)&&void 0!==a.current[t])return a.current[t];const e=(e=>Object.keys(st).map(t=>st[t][e]).filter(Boolean))(t);let r=n;return e.forEach(e=>{try{const t=e(r,o||{},i);if(typeof t!=typeof r)throw new Error(Object(N.sprintf)( +/* translators: %1$s is the type of the variable passed to the filter function, %2$s is the type of the value returned by the filter function. */ +Object(N.__)("The type returned by checkout filters must be the same as the type they receive. The function received %1$s but returned %2$s.","woo-gutenberg-products-block"),typeof r,typeof t));r=s(t)?t:r}catch(e){if(_.CURRENT_USER_IS_ADMIN)throw e;console.error(e)}}),a.current[t]=r,r},[t,n,o,i,s])};let mt;!function(e){e.CHECKOUT="woocommerce/checkout",e.CHECKOUT_FIELDS="woocommerce/checkout-fields-block",e.CHECKOUT_TOTALS="woocommerce/checkout-totals-block",e.CONTACT_INFORMATION="woocommerce/checkout-contact-information-block",e.SHIPPING_ADDRESS="woocommerce/checkout-shipping-address-block",e.BILLING_ADDRESS="woocommerce/checkout-billing-address-block",e.SHIPPING_METHODS="woocommerce/checkout-shipping-methods-block",e.PAYMENT_METHODS="woocommerce/checkout-payment-methods-block",e.CART="woocommerce/cart",e.EMPTY_CART="woocommerce/empty-cart-block",e.FILLED_CART="woocommerce/filled-cart-block",e.CART_ITEMS="woocommerce/cart-items-block",e.CART_TOTALS="woocommerce/cart-totals-block",e.MINI_CART="woocommerce/mini-cart-contents",e.EMPTY_MINI_CART="woocommerce/empty-mini-cart-contents-block",e.FILLED_MINI_CART="woocommerce/filled-mini-cart-contents-block",e.MINI_CART_ITEMS="woocommerce/mini-cart-items-block",e.CART_ORDER_SUMMARY="woocommerce/cart-order-summary-block",e.CHECKOUT_ORDER_SUMMARY="woocommerce/checkout-order-summary-block"}(mt||(mt={}));const ft={},dt=e=>Object.values(mt).includes(e),ht=e=>dt(e)?Object.values(ft).filter(t=>{let{metadata:n}=t;return((null==n?void 0:n.parent)||[]).includes(e)}):[];var bt=n(34);const gt=e=>{var t,n,r,o;((e,t,n)=>{if(!ot(e))return;const r=typeof e.metadata;if("object"!==r)throw new Error(`Incorrect value for the metadata argument when registering a block component. It was a ${r}, but must be a object.`)})(e),(e=>{if(((e,t,n)=>{const r=typeof t;if("string"!==r)throw new Error(`Incorrect value for the blockName argument when registering a checkout block. It was a ${r}, but must be a string.`)})(0,e),!e)throw new Error("Value for the blockName argument must not be empty.")})(e.metadata.name),(e=>{if("string"!=typeof e&&!Array.isArray(e))throw new Error(`Incorrect value for the parent argument when registering a checkout block. It was a ${typeof e}, but must be a string or array of strings.`);if("string"==typeof e&&!dt(e))throw new Error("When registering a checkout block, the parent must be a valid inner block area.");if(Array.isArray(e)&&!e.some(e=>dt(e)))throw new Error("When registering a checkout block, the parent must be a valid inner block area.")})(e.metadata.parent),((e,t)=>{const n=e.component;if(n){if("function"==typeof n)return;if(ot(n)&&n.$$typeof&&n.$$typeof===Symbol.for("react.lazy"))return}throw new Error("Incorrect value for the component argument when registering a block component. Component must be a valid React Element or Lazy callback.")})(e),Object(bt.registerBlockComponent)({blockName:e.metadata.name,component:e.component}),ft[e.metadata.name]={blockName:e.metadata.name,metadata:e.metadata,component:e.component,force:!(null===(t=e.metadata)||void 0===t||null===(n=t.attributes)||void 0===n||null===(r=n.lock)||void 0===r||null===(o=r.default)||void 0===o||!o.remove)}}},14:function(e,t){e.exports=window.React},15:function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},16:function(e,t){e.exports=window.wp.isShallowEqual},19:function(e,t,n){"use strict";(function(e){var r=n(0);n(32);const o=Object(r.createContext)({slots:{},fills:{},registerSlot:()=>{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,n(20))},2:function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t1)for(var n=1;n0&&void 0!==arguments[0]&&arguments[0];const{paymentMethods:e,expressPaymentMethods:s,paymentMethodsInitialized:c,expressPaymentMethodsInitialized:o}=Object(n.b)(),l=Object(a.a)(e),i=Object(a.a)(s);return{paymentMethods:t?i:l,isInitialized:t?o:c}},o=()=>c(!1),l=()=>c(!0)},280:function(t,e,s){"use strict";var a=s(12),n=s.n(a),c=s(0),o=s(4),l=s.n(o);const i=t=>"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--"+t;var r=t=>{let{id:e,src:s=null,alt:a=""}=t;return s?Object(c.createElement)("img",{className:i(e),src:s,alt:a}):null},d=s(48);const m=[{id:"alipay",alt:"Alipay",src:d.l+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:d.l+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:d.l+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:d.l+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:d.l+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:d.l+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:d.l+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:d.l+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:d.l+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:d.l+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:d.l+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:d.l+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:d.l+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:d.l+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:d.l+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:d.l+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:d.l+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:d.l+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:d.l+"payment-methods/wechat.svg"}];var p=s(45);s(275),e.a=t=>{let{icons:e=[],align:s="center",className:a}=t;const o=(t=>{const e={};return t.forEach(t=>{let s={};"string"==typeof t&&(s={id:t,alt:t,src:null}),"object"==typeof t&&(s={id:t.id||"",alt:t.alt||"",src:t.src||null}),s.id&&Object(p.a)(s.id)&&!e[s.id]&&(e[s.id]=s)}),Object.values(e)})(e);if(0===o.length)return null;const i=l()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===s,"wc-block-components-payment-method-icons--align-right":"right"===s},a);return Object(c.createElement)("div",{className:i},o.map(t=>{const e={...t,...(s=t.id,m.find(t=>t.id===s)||{})};var s;return Object(c.createElement)(r,n()({key:"payment-method-icon-"+t.id},e))}))}},378:function(t,e,s){"use strict";s.d(e,"a",(function(){return a}));const a=t=>Object.values(t).reduce((t,e)=>(null!==e.icons&&(t=t.concat(e.icons)),t),[])},451:function(t,e,s){"use strict";s.r(e);var a=s(0),n=s(280),c=s(278),o=s(378);e.default=t=>{let{className:e}=t;const{paymentMethods:s}=Object(c.b)();return Object(a.createElement)(n.a,{className:e,icons:Object(o.a)(s)})}}}]); \ No newline at end of file diff --git a/build/cart-blocks/cart-express-payment-frontend.js b/build/cart-blocks/cart-express-payment-frontend.js new file mode 100644 index 00000000000..91117ef53dd --- /dev/null +++ b/build/cart-blocks/cart-express-payment-frontend.js @@ -0,0 +1,5 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[13],{117:function(e,t,n){"use strict";var o=n(0);t.a=function(e){let{icon:t,size:n=24,...s}=e;return Object(o.cloneElement)(t,{width:n,height:n,...s})}},264:function(e,t){},274:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n(1),s=n(7),c=n(6),r=n(17),a=n(32),i=n(199);const l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{cartCoupons:t,cartIsLoading:n}=Object(a.a)(),{createErrorNotice:l}=Object(s.useDispatch)("core/notices"),{createNotice:p}=Object(s.useDispatch)("core/notices"),{setValidationErrors:u}=Object(i.b)(),{applyCoupon:d,removeCoupon:m,isApplyingCoupon:b,isRemovingCoupon:h}=Object(s.useSelect)((e,t)=>{let{dispatch:n}=t;const o=e(c.CART_STORE_KEY),s=n(c.CART_STORE_KEY);return{applyCoupon:s.applyCoupon,removeCoupon:s.removeCoupon,isApplyingCoupon:o.isApplyingCoupon(),isRemovingCoupon:o.isRemovingCoupon(),receiveApplyingCoupon:s.receiveApplyingCoupon}},[l,p]),g=t=>{d(t).then(n=>{!0===n&&p("info",Object(o.sprintf)( +/* translators: %s coupon code. */ +Object(o.__)('Coupon code "%s" has been applied to your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(e=>{u({coupon:{message:Object(r.decodeEntities)(e.message),hidden:!1}}),receiveApplyingCoupon("")})},v=t=>{m(t).then(n=>{!0===n&&p("info",Object(o.sprintf)( +/* translators: %s coupon code. */ +Object(o.__)('Coupon code "%s" has been removed from your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(t=>{l(t.message,{id:"coupon-form",context:e}),receiveApplyingCoupon("")})};return{appliedCoupons:t,isLoading:n,applyCoupon:g,removeCoupon:v,isApplyingCoupon:b,isRemovingCoupon:h}}},275:function(e,t){},277:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var o=n(0),s=n(199);n(264);const c=e=>{let{errorMessage:t="",propertyName:n="",elementId:c=""}=e;const{getValidationError:r,getValidationErrorId:a}=Object(s.b)();if(!t||"string"!=typeof t){const e=r(n)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(o.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(o.createElement)("p",{id:a(c)},t))}},278:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));var o=n(31),s=n(207);const c=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{paymentMethods:t,expressPaymentMethods:n,paymentMethodsInitialized:c,expressPaymentMethodsInitialized:r}=Object(s.b)(),a=Object(o.a)(t),i=Object(o.a)(n);return{paymentMethods:e?i:a,isInitialized:e?r:c}},r=()=>c(!1),a=()=>c(!0)},280:function(e,t,n){"use strict";var o=n(12),s=n.n(o),c=n(0),r=n(4),a=n.n(r);const i=e=>"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--"+e;var l=e=>{let{id:t,src:n=null,alt:o=""}=e;return n?Object(c.createElement)("img",{className:i(t),src:n,alt:o}):null},p=n(48);const u=[{id:"alipay",alt:"Alipay",src:p.l+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:p.l+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:p.l+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:p.l+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:p.l+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:p.l+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:p.l+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:p.l+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:p.l+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:p.l+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:p.l+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:p.l+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:p.l+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:p.l+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:p.l+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:p.l+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:p.l+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:p.l+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:p.l+"payment-methods/wechat.svg"}];var d=n(45);n(275),t.a=e=>{let{icons:t=[],align:n="center",className:o}=e;const r=(e=>{const t={};return e.forEach(e=>{let n={};"string"==typeof e&&(n={id:e,alt:e,src:null}),"object"==typeof e&&(n={id:e.id||"",alt:e.alt||"",src:e.src||null}),n.id&&Object(d.a)(n.id)&&!t[n.id]&&(t[n.id]=n)}),Object.values(t)})(t);if(0===r.length)return null;const i=a()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===n,"wc-block-components-payment-method-icons--align-right":"right"===n},o);return Object(c.createElement)("div",{className:i},r.map(e=>{const t={...e,...(n=e.id,u.find(e=>e.id===n)||{})};var n;return Object(c.createElement)(l,s()({key:"payment-method-icon-"+e.id},t))}))}},290:function(e,t){},291:function(e,t,n){"use strict";var o=n(19),s=n.n(o),c=n(0),r=n(1),a=n(5),i=n(2),l=n(123),p=n(30);class u extends a.Component{constructor(){super(...arguments),s()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return{errorMessage:e.message,hasError:!0}}render(){const{hasError:e,errorMessage:t}=this.state,{isEditor:n}=this.props;if(e){let e=Object(r.__)("This site is experiencing difficulties with this payment method. Please contact the owner of the site for assistance.","woo-gutenberg-products-block");(n||i.CURRENT_USER_IS_ADMIN)&&(e=t||Object(r.__)("There was an error with this payment method. Please verify it's configured correctly.","woo-gutenberg-products-block"));const o=[{id:"0",content:e,isDismissible:!1,status:"error"}];return Object(c.createElement)(l.a,{additionalNotices:o,context:p.c.PAYMENTS})}return this.props.children}}u.defaultProps={isEditor:!1},t.a=u},313:function(e,t){},314:function(e,t,n){"use strict";var o=n(0),s=n(1),c=n(342),r=n(278),a=n(29),i=n(207),l=n(25),p=n.n(l),u=n(291);t.a=()=>{const{isEditor:e}=Object(a.a)(),{setActivePaymentMethod:t,setExpressPaymentError:n,activePaymentMethod:l,paymentMethodData:d,setPaymentStatus:m}=Object(i.b)(),b=Object(c.a)(),{paymentMethods:h}=Object(r.a)(),g=Object(o.useRef)(l),v=Object(o.useRef)(d),y=Object(o.useCallback)(e=>()=>{g.current=l,v.current=d,m().started(),t(e)},[l,d,t,m]),j=Object(o.useCallback)(()=>{m().pristine(),t(g.current,v.current)},[t,m]),O=Object(o.useCallback)(e=>{m().error(e),n(e),t(g.current,v.current)},[t,m,n]),E=Object(o.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";p()("Express Payment Methods should use the provided onError handler instead.",{alternative:"onError",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),e?O(e):n("")}),[n,O]),f=Object.entries(h),w=f.length>0?f.map(t=>{let[n,s]=t;const c=e?s.edit:s.content;return Object(o.isValidElement)(c)?Object(o.createElement)("li",{key:n,id:"express-payment-method-"+n},Object(o.cloneElement)(c,{...b,onClick:y(n),onClose:j,onError:O,setExpressPaymentError:E})):null}):Object(o.createElement)("li",{key:"noneRegistered"},Object(s.__)("No registered Payment Methods","woo-gutenberg-products-block"));return Object(o.createElement)(u.a,{isEditor:e},Object(o.createElement)("ul",{className:"wc-block-components-express-payment__event-buttons"},w))}},337:function(e,t,n){"use strict";var o=n(0),s=n(13);const c=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(s.Path,{fillRule:"evenodd",d:"M5.5 9.5v-2h13v2h-13zm0 3v4h13v-4h-13zM4 7a1 1 0 011-1h14a1 1 0 011 1v10a1 1 0 01-1 1H5a1 1 0 01-1-1V7z",clipRule:"evenodd"}));t.a=c},342:function(e,t,n){"use strict";n.d(t,"a",(function(){return I}));var o=n(1),s=n(41),c=n(0),r=n(4),a=n.n(r),i=n(13),l=Object(c.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(c.createElement)("path",{d:"M0 0h24v24H0z"}),Object(c.createElement)("path",{fill:"#000",fillRule:"nonzero",d:"M17.3 8v1c1 .2 1.4.9 1.4 1.7h-1c0-.6-.3-1-1-1-.8 0-1.3.4-1.3.9 0 .4.3.6 1.4 1 1 .2 2 .6 2 1.9 0 .9-.6 1.4-1.5 1.5v1H16v-1c-.9-.1-1.6-.7-1.7-1.7h1c0 .6.4 1 1.3 1 1 0 1.2-.5 1.2-.8 0-.4-.2-.8-1.3-1.1-1.3-.3-2.1-.8-2.1-1.8 0-.9.7-1.5 1.6-1.6V8h1.3zM12 10v1H6v-1h6zm2-2v1H6V8h8zM2 4v16h20V4H2zm2 14V6h16v12H4z"}),Object(c.createElement)("path",{stroke:"#000",strokeLinecap:"round",d:"M6 16c2.6 0 3.9-3 1.7-3-2 0-1 3 1.5 3 1 0 1-.8 2.8-.8"}))),p=Object(c.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(i.Path,{fillRule:"evenodd",d:"M18.646 9H20V8l-1-.5L12 4 5 7.5 4 8v1h14.646zm-3-1.5L12 5.677 8.354 7.5h7.292zm-7.897 9.44v-6.5h-1.5v6.5h1.5zm5-6.5v6.5h-1.5v-6.5h1.5zm5 0v6.5h-1.5v-6.5h1.5zm2.252 8.81c0 .414-.334.75-.748.75H4.752a.75.75 0 010-1.5h14.5a.75.75 0 01.749.75z",clipRule:"evenodd"})),u=Object(c.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(i.Path,{d:"M3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zm-1.338 4.877c-.314.22-.412.452-.412.623 0 .171.098.403.412.623.312.218.783.377 1.338.377.825 0 1.605.233 2.198.648.59.414 1.052 1.057 1.052 1.852 0 .795-.461 1.438-1.052 1.852-.41.286-.907.486-1.448.582v.316a.75.75 0 01-1.5 0v-.316a3.64 3.64 0 01-1.448-.582c-.59-.414-1.052-1.057-1.052-1.852a.75.75 0 011.5 0c0 .171.098.403.412.623.312.218.783.377 1.338.377s1.026-.159 1.338-.377c.314-.22.412-.452.412-.623 0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377-.825 0-1.605-.233-2.198-.648-.59-.414-1.052-1.057-1.052-1.852 0-.795.461-1.438 1.052-1.852a3.64 3.64 0 011.448-.582V7.5a.75.75 0 011.5 0v.316c.54.096 1.039.296 1.448.582.59.414 1.052 1.057 1.052 1.852a.75.75 0 01-1.5 0c0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377s-1.026.159-1.338.377z"})),d=n(337),m=n(117),b=n(45),h=n(18);n(290);const g={bank:p,bill:u,card:d.a,checkPayment:l};var v=e=>{let{icon:t="",text:n=""}=e;const o=!!t,s=Object(c.useCallback)(e=>o&&Object(b.a)(e)&&Object(h.b)(g,e),[o]),r=a()("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":o});return Object(c.createElement)("span",{className:r},s(t)?Object(c.createElement)(m.a,{icon:g[t]}):t,n)},y=n(280),j=n(2),O=n(25),E=n.n(O),f=n(136),w=n(277),k=n(32),C=n(274),S=n(30),P=n(36),x=n(207),_=n(68),R=n(50);const M=(e,t)=>{const n=[],s=(t,n)=>{const o=n+"_tax",s=Object(h.b)(e,n)&&Object(b.a)(e[n])?parseInt(e[n],10):0;return{key:n,label:t,value:s,valueWithTax:s+(Object(h.b)(e,o)&&Object(b.a)(e[o])?parseInt(e[o],10):0)}};return n.push(s(Object(o.__)("Subtotal:","woo-gutenberg-products-block"),"total_items")),n.push(s(Object(o.__)("Fees:","woo-gutenberg-products-block"),"total_fees")),n.push(s(Object(o.__)("Discount:","woo-gutenberg-products-block"),"total_discount")),n.push({key:"total_tax",label:Object(o.__)("Taxes:","woo-gutenberg-products-block"),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&n.push(s(Object(o.__)("Shipping:","woo-gutenberg-products-block"),"total_shipping")),n};var A=n(66);const I=()=>{const{isCalculating:e,isComplete:t,isIdle:n,isProcessing:r,onCheckoutBeforeProcessing:a,onCheckoutValidationBeforeProcessing:i,onCheckoutAfterProcessingWithSuccess:l,onCheckoutAfterProcessingWithError:p,onSubmit:u,customerId:d}=Object(P.b)(),{currentStatus:m,activePaymentMethod:b,onPaymentProcessing:h,setExpressPaymentError:g,shouldSavePayment:O}=Object(x.b)(),{shippingErrorStatus:I,shippingErrorTypes:z,onShippingRateSuccess:T,onShippingRateFail:N,onShippingRateSelectSuccess:V,onShippingRateSelectFail:D}=Object(_.b)(),{shippingRates:B,isLoadingRates:L,selectedRates:F,isSelectingRate:H,selectShippingRate:W,needsShipping:G}=Object(A.a)(),{billingAddress:Y,shippingAddress:J,setShippingAddress:U}=Object(R.b)(),{cartItems:K,cartFees:X,cartTotals:q,extensions:Q}=Object(k.a)(),{appliedCoupons:Z}=Object(C.a)(),{noticeContexts:$,responseTypes:ee}=Object(S.d)(),te=Object(c.useRef)(M(q,G)),ne=Object(c.useRef)({label:Object(o.__)("Total","woo-gutenberg-products-block"),value:parseInt(q.total_price,10)});Object(c.useEffect)(()=>{te.current=M(q,G),ne.current={label:Object(o.__)("Total","woo-gutenberg-products-block"),value:parseInt(q.total_price,10)}},[q,G]);const oe=Object(c.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";E()("setExpressPaymentError should only be used by Express Payment Methods (using the provided onError handler).",{alternative:"",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),g(e)}),[g]);return{activePaymentMethod:b,billing:{appliedCoupons:Z,billingAddress:Y,billingData:Y,cartTotal:ne.current,cartTotalItems:te.current,currency:Object(s.getCurrencyFromPriceResponse)(q),customerId:d,displayPricesIncludingTax:Object(j.getSetting)("displayCartPricesIncludingTax",!1)},cartData:{cartItems:K,cartFees:X,extensions:Q},checkoutStatus:{isCalculating:e,isComplete:t,isIdle:n,isProcessing:r},components:{LoadingMask:f.a,PaymentMethodIcons:y.a,PaymentMethodLabel:v,ValidationInputError:w.a},emitResponse:{noticeContexts:$,responseTypes:ee},eventRegistration:{onCheckoutAfterProcessingWithError:p,onCheckoutAfterProcessingWithSuccess:l,onCheckoutBeforeProcessing:a,onCheckoutValidationBeforeProcessing:i,onPaymentProcessing:h,onShippingRateFail:N,onShippingRateSelectFail:D,onShippingRateSelectSuccess:V,onShippingRateSuccess:T},onSubmit:u,paymentStatus:m,setExpressPaymentError:oe,shippingData:{isSelectingRate:H,needsShipping:G,selectedRates:F,setSelectedRates:W,setShippingAddress:U,shippingAddress:J,shippingRates:B,shippingRatesLoading:L},shippingStatus:{shippingErrorStatus:I,shippingErrorTypes:z},shouldSavePayment:O}}},438:function(e,t,n){"use strict";n.r(t);var o=n(0),s=n(32),c=n(4),r=n.n(c),a=n(1),i=n(278),l=n(30),p=n(36),u=n(207),d=n(123),m=n(136),b=n(314);n(313);var h=()=>{const{paymentMethods:e,isInitialized:t}=Object(i.a)(),{noticeContexts:n}=Object(l.d)(),{isCalculating:s,isProcessing:c,isAfterProcessing:r,isBeforeProcessing:h,isComplete:g,hasError:v}=Object(p.b)(),{currentStatus:y}=Object(u.b)();if(!t||t&&0===Object.keys(e).length)return null;const j=c||r||h||g&&!v;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(m.a,{isLoading:s||j||y.isDoingExpressPayment},Object(o.createElement)("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--cart"},Object(o.createElement)("div",{className:"wc-block-components-express-payment__content"},Object(o.createElement)(d.a,{context:n.EXPRESS_PAYMENTS}),Object(o.createElement)(b.a,null)))),Object(o.createElement)("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--cart"},Object(a.__)("Or","woo-gutenberg-products-block")))};t.default=e=>{let{className:t}=e;const{cartNeedsPayment:n}=Object(s.a)();return n?Object(o.createElement)("div",{className:r()("wc-block-cart__payment-options",t)},Object(o.createElement)(h,null)):null}}}]); \ No newline at end of file diff --git a/build/cart-blocks/cart-items-frontend.js b/build/cart-blocks/cart-items-frontend.js new file mode 100644 index 00000000000..338475e1de5 --- /dev/null +++ b/build/cart-blocks/cart-items-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[14],{371:function(e,c,a){"use strict";var n=a(0),t=a(5),s=a(4),r=a.n(s);const l=Object(t.forwardRef)((e,c)=>{let{children:a,className:t=""}=e;return Object(n.createElement)("div",{ref:c,className:r()("wc-block-components-main",t)},a)});c.a=l},417:function(e,c,a){"use strict";a.r(c);var n=a(0),t=a(371),s=a(4),r=a.n(s);c.default=e=>{let{children:c,className:a}=e;return Object(n.createElement)(t.a,{className:r()("wc-block-cart__main",a)},c)}}}]); \ No newline at end of file diff --git a/build/cart-blocks/cart-line-items--mini-cart-contents-block/products-table-frontend.js b/build/cart-blocks/cart-line-items--mini-cart-contents-block/products-table-frontend.js new file mode 100644 index 00000000000..71670c3463b --- /dev/null +++ b/build/cart-blocks/cart-line-items--mini-cart-contents-block/products-table-frontend.js @@ -0,0 +1,15 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[4],{102:function(e,t,c){"use strict";var a=c(12),r=c.n(a),n=c(0),l=c(137),o=c(4),i=c.n(o);c(197);const s=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:c,currency:a,onValueChange:o,displayType:u="text",...m}=e;const b="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(b))return null;const p=b/10**a.minorUnit;if(!Number.isFinite(p))return null;const d=i()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),O={...m,...s(a),value:void 0,currency:void 0,onValueChange:void 0},j=o?e=>{const t=+e.value*10**a.minorUnit;o(t)}:()=>{};return Object(n.createElement)(l.a,r()({className:d,displayType:u},O,{value:p,onValueChange:j}))}},197:function(e,t){},284:function(e,t,c){"use strict";var a=c(0),r=c(4),n=c.n(r);c(310),t.a=e=>{let{children:t,className:c}=e;return Object(a.createElement)("div",{className:n()("wc-block-components-product-badge",c)},t)}},286:function(e,t,c){"use strict";var a=c(0),r=c(1),n=c(102),l=c(4),o=c.n(l),i=c(41);c(287);const s=e=>{let{currency:t,maxPrice:c,minPrice:l,priceClassName:s,priceStyle:u={}}=e;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("span",{className:"screen-reader-text"},Object(r.sprintf)( +/* translators: %1$s min price, %2$s max price */ +Object(r.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(i.formatPrice)(l),Object(i.formatPrice)(c))),Object(a.createElement)("span",{"aria-hidden":!0},Object(a.createElement)(n.a,{className:o()("wc-block-components-product-price__value",s),currency:t,value:l,style:u})," — ",Object(a.createElement)(n.a,{className:o()("wc-block-components-product-price__value",s),currency:t,value:c,style:u})))},u=e=>{let{currency:t,regularPriceClassName:c,regularPriceStyle:l,regularPrice:i,priceClassName:s,priceStyle:u,price:m}=e;return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("span",{className:"screen-reader-text"},Object(r.__)("Previous price:","woo-gutenberg-products-block")),Object(a.createElement)(n.a,{currency:t,renderText:e=>Object(a.createElement)("del",{className:o()("wc-block-components-product-price__regular",c),style:l},e),value:i}),Object(a.createElement)("span",{className:"screen-reader-text"},Object(r.__)("Discounted price:","woo-gutenberg-products-block")),Object(a.createElement)(n.a,{currency:t,renderText:e=>Object(a.createElement)("ins",{className:o()("wc-block-components-product-price__value","is-discounted",s),style:u},e),value:m}))};t.a=e=>{let{align:t,className:c,currency:r,format:l="",maxPrice:i,minPrice:m,price:b,priceClassName:p,priceStyle:d,regularPrice:O,regularPriceClassName:j,regularPriceStyle:_}=e;const y=o()(c,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+t]:t});l.includes("")||(l="",console.error("Price formats need to include the `` tag."));const g=O&&b!==O;let f=Object(a.createElement)("span",{className:o()("wc-block-components-product-price__value",p)});return g?f=Object(a.createElement)(u,{currency:r,price:b,priceClassName:p,priceStyle:d,regularPrice:O,regularPriceClassName:j,regularPriceStyle:_}):void 0!==m&&void 0!==i?f=Object(a.createElement)(s,{currency:r,maxPrice:i,minPrice:m,priceClassName:p,priceStyle:d}):b&&(f=Object(a.createElement)(n.a,{className:o()("wc-block-components-product-price__value",p),currency:r,value:b,style:d})),Object(a.createElement)("span",{className:y},Object(a.createInterpolateElement)(l,{price:f}))}},287:function(e,t){},288:function(e,t,c){"use strict";var a=c(12),r=c.n(a),n=c(0),l=c(17),o=c(4),i=c.n(o);c(289),t.a=e=>{let{className:t="",disabled:c=!1,name:a,permalink:o="",target:s,rel:u,style:m,onClick:b,...p}=e;const d=i()("wc-block-components-product-name",t);if(c){const e=p;return Object(n.createElement)("span",r()({className:d},e,{dangerouslySetInnerHTML:{__html:Object(l.decodeEntities)(a)}}))}return Object(n.createElement)("a",r()({className:d,href:o,target:s},p,{dangerouslySetInnerHTML:{__html:Object(l.decodeEntities)(a)},style:m}))}},289:function(e,t){},295:function(e,t,c){"use strict";var a=c(0),r=c(115),n=c(116);const l=e=>{const t=e.indexOf("

");return-1===t?e:e.substr(0,t+4)},o=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),i=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,s=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…";const a=o(e),r=a.split(" ").splice(0,t).join(" ");return Object(n.autop)(i(r,c))},u=function(e,t){let c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…";const r=o(e),l=r.slice(0,t);if(c)return Object(n.autop)(i(l,a));const s=l.match(/([\s]+)/g),u=s?s.length:0,m=r.slice(0,t+u);return Object(n.autop)(i(m,a))};t.a=e=>{let{source:t,maxLength:c=15,countType:o="words",className:i="",style:m={}}=e;const b=Object(a.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const a=Object(n.autop)(e),o=Object(r.count)(a,c);if(o<=t)return a;const i=l(a),m=Object(r.count)(i,c);return m<=t?i:"words"===c?s(i,t):u(i,t,"characters_including_spaces"===c)}(t,c,o),[t,c,o]);return Object(a.createElement)(a.RawHTML,{style:m,className:i},b)}},309:function(e,t){},310:function(e,t){},311:function(e,t){},312:function(e,t){},334:function(e,t,c){"use strict";var a=c(12),r=c.n(a),n=c(0),l=c(17),o=c(2);c(309),t.a=e=>{let{image:t={},fallbackAlt:c=""}=e;const a=t.thumbnail?{src:t.thumbnail,alt:Object(l.decodeEntities)(t.alt)||c||"Product Image"}:{src:o.PLACEHOLDER_IMG_SRC,alt:""};return Object(n.createElement)("img",r()({className:"wc-block-components-product-image"},a,{alt:a.alt}))}},335:function(e,t,c){"use strict";var a=c(0),r=c(1),n=c(284);t.a=()=>Object(a.createElement)(n.a,{className:"wc-block-components-product-backorder-badge"},Object(r.__)("Available on backorder","woo-gutenberg-products-block"))},336:function(e,t,c){"use strict";var a=c(0),r=c(1),n=c(284);t.a=e=>{let{lowStockRemaining:t}=e;return t?Object(a.createElement)(n.a,{className:"wc-block-components-product-low-stock-badge"},Object(r.sprintf)( +/* translators: %d stock amount (number of items in stock for product) */ +Object(r.__)("%d left in stock","woo-gutenberg-products-block"),t)):null}},343:function(e,t,c){"use strict";var a=c(0),r=c(4),n=c.n(r),l=c(1),o=c(23),i=c(53),s=c(51);c(372);var u=e=>{let{className:t,quantity:c=1,minimum:r=1,maximum:u,onChange:m=(()=>{}),step:b=1,itemName:p="",disabled:d}=e;const O=n()("wc-block-components-quantity-selector",t),j=void 0!==u,_=c-b>=r,y=!j||c+b<=u,g=Object(a.useCallback)(e=>{let t=e;j&&(t=Math.min(t,Math.floor(u/b)*b)),t=Math.max(t,Math.ceil(r/b)*b),t=Math.floor(t/b)*b,t!==e&&m(t)},[j,u,r,m,b]),f=Object(s.a)(g,300);Object(a.useLayoutEffect)(()=>{g(c)},[c,g]);const k=Object(a.useCallback)(e=>{const t=void 0!==typeof e.key?"ArrowDown"===e.key:e.keyCode===i.DOWN,a=void 0!==typeof e.key?"ArrowUp"===e.key:e.keyCode===i.UP;t&&_&&(e.preventDefault(),m(c-b)),a&&y&&(e.preventDefault(),m(c+b))},[c,m,y,_,b]);return Object(a.createElement)("div",{className:O},Object(a.createElement)("input",{className:"wc-block-components-quantity-selector__input",disabled:d,type:"number",step:b,min:r,max:u,value:c,onKeyDown:k,onChange:e=>{let t=parseInt(e.target.value,10);t=isNaN(t)?c:t,t!==c&&(m(t),f(t))},"aria-label":Object(l.sprintf)( +/* translators: %s refers to the item name in the cart. */ +Object(l.__)("Quantity of %s in your cart.","woo-gutenberg-products-block"),p)}),Object(a.createElement)("button",{"aria-label":Object(l.__)("Reduce quantity","woo-gutenberg-products-block"),className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus",disabled:d||!_,onClick:()=>{const e=c-b;m(e),Object(o.speak)(Object(l.sprintf)( +/* translators: %s refers to the item name in the cart. */ +Object(l.__)("Quantity reduced to %s.","woo-gutenberg-products-block"),e)),g(e)}},"-"),Object(a.createElement)("button",{"aria-label":Object(l.__)("Increase quantity","woo-gutenberg-products-block"),disabled:d||!y,className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus",onClick:()=>{const e=c+b;m(e),Object(o.speak)(Object(l.sprintf)( +/* translators: %s refers to the item name in the cart. */ +Object(l.__)("Quantity increased to %s.","woo-gutenberg-products-block"),e)),g(e)}},"+"))},m=c(286),b=c(288),p=c(7),d=c(6),O=c(100),j=c(61),_=c(70),y=c(18),g=c(45),f=c(72),k=c(32),E=c(36);var w=c(59),v=c(334),N=c(335),h=c(336),C=c(102),x=c(284),P=e=>{let{currency:t,saleAmount:c,format:r=""}=e;if(!c||c<=0)return null;r.includes("")||(r="",console.error("Price formats need to include the `` tag."));const n=Object(l.sprintf)( +/* translators: %s will be replaced by the discount amount */ +Object(l.__)("Save %s","woo-gutenberg-products-block"),r);return Object(a.createElement)(x.a,{className:"wc-block-components-sale-badge"},Object(a.createInterpolateElement)(n,{price:Object(a.createElement)(C.a,{currency:t,value:c})}))},I=c(346),S=c(41),q=c(10),D=c(333),A=c(2);const R=(e,t)=>e.convertPrecision(t.minorUnit).getAmount(),T=e=>Object(q.mustContain)(e,"");var F=Object(a.forwardRef)((e,t)=>{let{lineItem:c,onRemove:r=(()=>{}),tabIndex:i=null}=e;const{name:s="",catalog_visibility:C="visible",short_description:x="",description:F="",low_stock_remaining:M=null,show_backorder_badge:L=!1,quantity_limits:U={minimum:1,maximum:99,multiple_of:1,editable:!0},sold_individually:Q=!1,permalink:V="",images:$=[],variation:H=[],item_data:B=[],prices:K={currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",price:"0",regular_price:"0",sale_price:"0",price_range:null,raw_prices:{precision:6,price:"0",regular_price:"0",sale_price:"0"}},totals:W={currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",line_subtotal:"0",line_subtotal_tax:"0"},extensions:J}=c,{quantity:Y,setItemQuantity:z,removeItem:G,isPendingDelete:X}=(e=>{const t={key:"",quantity:1};(e=>Object(y.a)(e)&&Object(y.b)(e,"key")&&Object(y.b)(e,"quantity")&&Object(g.a)(e.key)&&Object(f.a)(e.quantity))(e)&&(t.key=e.key,t.quantity=e.quantity);const{key:c="",quantity:r=1}=t,{cartErrors:n}=Object(k.a)(),{dispatchActions:l}=Object(E.b)(),[o,i]=Object(a.useState)(r),[s]=Object(O.a)(o,400),u=Object(j.a)(s),{removeItemFromCart:m,changeCartItemQuantity:b}=Object(p.useDispatch)(d.CART_STORE_KEY);Object(a.useEffect)(()=>i(r),[r]);const w=Object(p.useSelect)(e=>{if(!c)return{quantity:!1,delete:!1};const t=e(d.CART_STORE_KEY);return{quantity:t.isItemPendingQuantity(c),delete:t.isItemPendingDelete(c)}},[c]),v=Object(a.useCallback)(()=>c?m(c).then(()=>(Object(_.d)(),!0)):Promise.resolve(!1),[c,m]);return Object(a.useEffect)(()=>{c&&Object(f.a)(u)&&Number.isFinite(u)&&u!==s&&b(c,s)},[c,b,s,u]),Object(a.useEffect)(()=>(w.delete?l.incrementCalculating():l.decrementCalculating(),()=>{w.delete&&l.decrementCalculating()}),[l,w.delete]),Object(a.useEffect)(()=>(w.quantity||s!==o?l.incrementCalculating():l.decrementCalculating(),()=>{(w.quantity||s!==o)&&l.decrementCalculating()}),[l,w.quantity,s,o]),{isPendingDelete:w.delete,quantity:o,setItemQuantity:i,removeItem:v,cartItemQuantityErrors:n}})(c),{dispatchStoreEvent:Z}=Object(w.a)(),{receiveCart:ee,...te}=Object(k.a)(),ce=Object(a.useMemo)(()=>({context:"cart",cartItem:c,cart:te}),[c,te]),ae=Object(S.getCurrencyFromPriceResponse)(K),re=Object(q.__experimentalApplyCheckoutFilter)({filterName:"itemName",defaultValue:s,extensions:J,arg:ce}),ne=Object(D.a)({amount:parseInt(K.raw_prices.regular_price,10),precision:K.raw_prices.precision}),le=Object(D.a)({amount:parseInt(K.raw_prices.price,10),precision:K.raw_prices.precision}),oe=ne.subtract(le),ie=oe.multiply(Y),se=Object(S.getCurrencyFromPriceResponse)(W);let ue=parseInt(W.line_subtotal,10);Object(A.getSetting)("displayCartPricesIncludingTax",!1)&&(ue+=parseInt(W.line_subtotal_tax,10));const me=Object(D.a)({amount:ue,precision:se.minorUnit}),be=$.length?$[0]:{},pe="hidden"===C||"search"===C,de=Object(q.__experimentalApplyCheckoutFilter)({filterName:"cartItemClass",defaultValue:"",extensions:J,arg:ce}),Oe=Object(q.__experimentalApplyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"",extensions:J,arg:ce,validation:T}),je=Object(q.__experimentalApplyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"",extensions:J,arg:ce,validation:T}),_e=Object(q.__experimentalApplyCheckoutFilter)({filterName:"saleBadgePriceFormat",defaultValue:"",extensions:J,arg:ce,validation:T});return Object(a.createElement)("tr",{className:n()("wc-block-cart-items__row",de,{"is-disabled":X}),ref:t,tabIndex:i},Object(a.createElement)("td",{className:"wc-block-cart-item__image","aria-hidden":!Object(y.b)(be,"alt")||!be.alt},pe?Object(a.createElement)(v.a,{image:be,fallbackAlt:re}):Object(a.createElement)("a",{href:V,tabIndex:-1},Object(a.createElement)(v.a,{image:be,fallbackAlt:re}))),Object(a.createElement)("td",{className:"wc-block-cart-item__product"},Object(a.createElement)("div",{className:"wc-block-cart-item__wrap"},Object(a.createElement)(b.a,{disabled:X||pe,name:re,permalink:V}),L?Object(a.createElement)(N.a,null):!!M&&Object(a.createElement)(h.a,{lowStockRemaining:M}),Object(a.createElement)("div",{className:"wc-block-cart-item__prices"},Object(a.createElement)(m.a,{currency:ae,regularPrice:R(ne,ae),price:R(le,ae),format:je})),Object(a.createElement)(P,{currency:ae,saleAmount:R(oe,ae),format:_e}),Object(a.createElement)(I.a,{shortDescription:x,fullDescription:F,itemData:B,variation:H}),Object(a.createElement)("div",{className:"wc-block-cart-item__quantity"},!Q&&!!U.editable&&Object(a.createElement)(u,{disabled:X,quantity:Y,minimum:U.minimum,maximum:U.maximum,step:U.multiple_of,onChange:e=>{z(e),Z("cart-set-item-quantity",{product:c,quantity:e})},itemName:re}),Object(a.createElement)("button",{className:"wc-block-cart-item__remove-link",onClick:()=>{r(),G(),Z("cart-remove-item",{product:c,quantity:Y}),Object(o.speak)(Object(l.sprintf)( +/* translators: %s refers to the item name in the cart. */ +Object(l.__)("%s has been removed from your cart.","woo-gutenberg-products-block"),re))},disabled:X},Object(l.__)("Remove item","woo-gutenberg-products-block"))))),Object(a.createElement)("td",{className:"wc-block-cart-item__total"},Object(a.createElement)("div",{className:"wc-block-cart-item__total-price-and-sale-badge-wrapper"},Object(a.createElement)(m.a,{currency:se,format:Oe,price:me.getAmount()}),Y>1&&Object(a.createElement)(P,{currency:ae,saleAmount:R(ie,ae),format:_e}))))});const M=[...Array(3)].map((_x,e)=>Object(a.createElement)(F,{lineItem:{},key:e})),L=e=>{const t={};return e.forEach(e=>{let{key:c}=e;t[c]=Object(a.createRef)()}),t};t.a=e=>{let{lineItems:t=[],isLoading:c=!1,className:r}=e;const o=Object(a.useRef)(null),i=Object(a.useRef)(L(t));Object(a.useEffect)(()=>{i.current=L(t)},[t]);const s=e=>()=>{null!=i&&i.current&&e&&i.current[e].current instanceof HTMLElement?i.current[e].current.focus():o.current instanceof HTMLElement&&o.current.focus()},u=c?M:t.map((e,c)=>{const r=t.length>c+1?t[c+1].key:null;return Object(a.createElement)(F,{key:e.key,lineItem:e,onRemove:s(r),ref:i.current[e.key],tabIndex:-1})});return Object(a.createElement)("table",{className:n()("wc-block-cart-items",r),ref:o,tabIndex:-1},Object(a.createElement)("thead",null,Object(a.createElement)("tr",{className:"wc-block-cart-items__header"},Object(a.createElement)("th",{className:"wc-block-cart-items__header-image"},Object(a.createElement)("span",null,Object(l.__)("Product","woo-gutenberg-products-block"))),Object(a.createElement)("th",{className:"wc-block-cart-items__header-product"},Object(a.createElement)("span",null,Object(l.__)("Details","woo-gutenberg-products-block"))),Object(a.createElement)("th",{className:"wc-block-cart-items__header-total"},Object(a.createElement)("span",null,Object(l.__)("Total","woo-gutenberg-products-block"))))),Object(a.createElement)("tbody",null,u))}},346:function(e,t,c){"use strict";var a=c(0),r=c(3),n=c(17);c(312);var l=e=>{let{details:t=[]}=e;return Array.isArray(t)?(t=t.filter(e=>!e.hidden),0===t.length?null:Object(a.createElement)("ul",{className:"wc-block-components-product-details"},t.map(e=>{const t=(null==e?void 0:e.key)||e.name||"",c=t?"wc-block-components-product-details__"+Object(r.kebabCase)(t):"";return Object(a.createElement)("li",{key:t+(e.display||e.value),className:c},t&&Object(a.createElement)(a.Fragment,null,Object(a.createElement)("span",{className:"wc-block-components-product-details__name"},Object(n.decodeEntities)(t),":")," "),Object(a.createElement)("span",{className:"wc-block-components-product-details__value"},Object(n.decodeEntities)(e.display||e.value)))}))):null},o=c(295),i=c(48),s=e=>{let{className:t,shortDescription:c="",fullDescription:r=""}=e;const n=c||r;return n?Object(a.createElement)(o.a,{className:t,source:n,maxLength:15,countType:i.n.wordCountType||"words"}):null};c(311),t.a=e=>{let{shortDescription:t="",fullDescription:c="",itemData:r=[],variation:n=[]}=e;return Object(a.createElement)("div",{className:"wc-block-components-product-metadata"},Object(a.createElement)(s,{className:"wc-block-components-product-metadata__description",shortDescription:t,fullDescription:c}),Object(a.createElement)(l,{details:r}),Object(a.createElement)(l,{details:n.map(e=>{let{attribute:t="",value:c}=e;return{key:t,value:c}})}))}},372:function(e,t){}}]); \ No newline at end of file diff --git a/build/cart-blocks/cart-line-items-frontend.js b/build/cart-blocks/cart-line-items-frontend.js new file mode 100644 index 00000000000..470b0f55115 --- /dev/null +++ b/build/cart-blocks/cart-line-items-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[15],{100:function(t,n,e){"use strict";e.d(n,"a",(function(){return s}));var c=e(5),r=e(51);function u(t,n){return t===n}function a(t){return"function"==typeof t?function(){return t}:t}function s(t,n,e){var s=e&&e.equalityFn||u,o=function(t){var n=Object(c.useState)(a(t)),e=n[0],r=n[1];return[e,Object(c.useCallback)((function(t){return r(a(t))}),[])]}(t),i=o[0],f=o[1],l=Object(r.a)(Object(c.useCallback)((function(t){return f(t)}),[f]),n,e),b=Object(c.useRef)(t);return s(b.current,t)||(l(t),b.current=t),[i,l]}},449:function(t,n,e){"use strict";e.r(n);var c=e(0),r=e(32),u=e(343);n.default=t=>{let{className:n}=t;const{cartItems:e,cartIsLoading:a}=Object(r.a)();return Object(c.createElement)(u.a,{className:n,lineItems:e,isLoading:a})}}}]); \ No newline at end of file diff --git a/build/cart-blocks/cart-order-summary-frontend.js b/build/cart-blocks/cart-order-summary-frontend.js new file mode 100644 index 00000000000..7a893a5c927 --- /dev/null +++ b/build/cart-blocks/cart-order-summary-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[16],{102:function(e,t,a){"use strict";var c=a(12),n=a.n(c),r=a(0),o=a(137),l=a(4),s=a.n(l);a(197);const i=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:a,currency:c,onValueChange:l,displayType:u="text",...m}=e;const p="string"==typeof a?parseInt(a,10):a;if(!Number.isFinite(p))return null;const b=p/10**c.minorUnit;if(!Number.isFinite(b))return null;const d=s()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),f={...m,...i(c),value:void 0,currency:void 0,onValueChange:void 0},x=l?e=>{const t=+e.value*10**c.minorUnit;l(t)}:()=>{};return Object(r.createElement)(o.a,n()({className:d,displayType:u},f,{value:b,onValueChange:x}))}},197:function(e,t){},315:function(e,t){},379:function(e,t,a){"use strict";var c=a(0),n=a(1),r=a(4),o=a.n(r),l=a(102),s=a(10),i=a(32),u=a(2);a(315),t.a=e=>{let{currency:t,values:a,className:r}=e;const m=Object(u.getSetting)("taxesEnabled",!0)&&Object(u.getSetting)("displayCartPricesIncludingTax",!1),{total_price:p,total_tax:b}=a,{receiveCart:d,...f}=Object(i.a)(),x=Object(s.__experimentalApplyCheckoutFilter)({filterName:"totalLabel",defaultValue:Object(n.__)("Total","woo-gutenberg-products-block"),extensions:f.extensions,arg:{cart:f}}),O=parseInt(b,10);return Object(c.createElement)(s.TotalsItem,{className:o()("wc-block-components-totals-footer-item",r),currency:t,label:x,value:parseInt(p,10),description:m&&0!==O&&Object(c.createElement)("p",{className:"wc-block-components-totals-footer-item-tax"},Object(c.createInterpolateElement)(Object(n.__)("Including in taxes","woo-gutenberg-products-block"),{TaxAmount:Object(c.createElement)(l.a,{className:"wc-block-components-totals-footer-item-tax-value",currency:t,value:O})}))})}},452:function(e,t,a){"use strict";a.r(t);var c=a(0),n=a(379),r=a(41),o=a(32),l=a(10);const s=()=>{const{extensions:e,receiveCart:t,...a}=Object(o.a)(),n={extensions:e,cart:a,context:"woocommerce/cart"};return Object(c.createElement)(l.ExperimentalOrderMeta.Slot,n)};t.default=e=>{let{children:t,className:a=""}=e;const{cartTotals:l}=Object(o.a)(),i=Object(r.getCurrencyFromPriceResponse)(l);return Object(c.createElement)("div",{className:a},t,Object(c.createElement)("div",{className:"wc-block-components-totals-wrapper"},Object(c.createElement)(n.a,{currency:i,values:l})),Object(c.createElement)(s,null))}}}]); \ No newline at end of file diff --git a/build/cart-blocks/cart-totals-frontend.js b/build/cart-blocks/cart-totals-frontend.js new file mode 100644 index 00000000000..4e93b56717c --- /dev/null +++ b/build/cart-blocks/cart-totals-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[17],{373:function(e,c){},374:function(e,c,t){"use strict";var a=t(0),n=t(5),s=t(4),r=t.n(s);const l=Object(n.forwardRef)((e,c)=>{let{children:t,className:n=""}=e;return Object(a.createElement)("div",{ref:c,className:r()("wc-block-components-sidebar",n)},t)});c.a=l},418:function(e,c,t){"use strict";t.r(c);var a=t(0),n=t(4),s=t.n(n),r=t(374);t(373),c.default=e=>{let{children:c,className:t=""}=e;return Object(a.createElement)(r.a,{className:s()("wc-block-cart__sidebar",t)},c)}}}]); \ No newline at end of file diff --git a/build/cart-blocks/empty-cart-frontend.js b/build/cart-blocks/empty-cart-frontend.js new file mode 100644 index 00000000000..457f39f65d7 --- /dev/null +++ b/build/cart-blocks/empty-cart-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[18],{370:function(e,c){},416:function(e,c,t){"use strict";t.r(c);var n=t(0),o=t(32),s=t(70);t(370),c.default=e=>{let{children:c,className:t}=e;const{cartItems:l,cartIsLoading:r}=Object(o.a)();return Object(n.useEffect)(()=>{Object(s.a)("wc-blocks_render_blocks_frontend",{element:document.body.querySelector(".wp-block-woocommerce-cart")})},[]),r||0!==l.length?null:Object(n.createElement)("div",{className:t},c)}}}]); \ No newline at end of file diff --git a/build/cart-blocks/filled-cart-frontend.js b/build/cart-blocks/filled-cart-frontend.js new file mode 100644 index 00000000000..d8f1ac1992c --- /dev/null +++ b/build/cart-blocks/filled-cart-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[19],{205:function(e,t){},250:function(e,t,s){"use strict";s.d(t,"b",(function(){return l})),s.d(t,"a",(function(){return o}));var c=s(0),a=s(9),i=s(4),r=s.n(i);const n=Object(c.createContext)({hasContainerWidth:!1,containerClassName:"",isMobile:!1,isSmall:!1,isMedium:!1,isLarge:!1}),l=()=>Object(c.useContext)(n),o=e=>{let{children:t,className:s=""}=e;const[i,l]=(()=>{const[e,{width:t}]=Object(a.useResizeObserver)();let s="";return t>700?s="is-large":t>520?s="is-medium":t>400?s="is-small":t&&(s="is-mobile"),[e,s]})(),o={hasContainerWidth:""!==l,containerClassName:l,isMobile:"is-mobile"===l,isSmall:"is-small"===l,isMedium:"is-medium"===l,isLarge:"is-large"===l};return Object(c.createElement)(n.Provider,{value:o},Object(c.createElement)("div",{className:r()(s,l)},i,t))}},258:function(e,t,s){"use strict";var c=s(0),a=s(4),i=s.n(a),r=s(250);s(205),t.a=e=>{let{children:t,className:s}=e;return Object(c.createElement)(r.a,{className:i()("wc-block-components-sidebar-layout",s)},t)}},415:function(e,t,s){"use strict";s.r(t);var c=s(0),a=s(4),i=s.n(a),r=s(258),n=s(32),l=s(17),o=s(7),m=s(147);t.default=e=>{let{children:t,className:s}=e;const{cartItems:a,cartIsLoading:u,cartItemErrors:b}=Object(n.a)(),{hasDarkControls:d}=Object(m.b)(),{createErrorNotice:h}=Object(o.useDispatch)("core/notices");return Object(c.useEffect)(()=>{b.forEach(e=>{h(Object(l.decodeEntities)(e.message),{isDismissible:!0,id:e.code,context:"wc/cart"})})},[h,b]),u||a.length>=1?Object(c.createElement)(r.a,{className:i()("wc-block-cart",s,{"has-dark-controls":d})},t):null}}}]); \ No newline at end of file diff --git a/build/cart-blocks/order-summary-coupon-form-frontend.js b/build/cart-blocks/order-summary-coupon-form-frontend.js new file mode 100644 index 00000000000..563e9140d12 --- /dev/null +++ b/build/cart-blocks/order-summary-coupon-form-frontend.js @@ -0,0 +1,5 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[20],{22:function(e,t,o){"use strict";var n=o(0),c=o(4),a=o.n(c);t.a=e=>{let t,{label:o,screenReaderLabel:c,wrapperElement:r,wrapperProps:s={}}=e;const l=null!=o,i=null!=c;return!l&&i?(t=r||"span",s={...s,className:a()(s.className,"screen-reader-text")},Object(n.createElement)(t,s,c)):(t=r||n.Fragment,l&&i&&o!==c?Object(n.createElement)(t,s,Object(n.createElement)("span",{"aria-hidden":"true"},o),Object(n.createElement)("span",{className:"screen-reader-text"},c)):Object(n.createElement)(t,s,o))}},264:function(e,t){},265:function(e,t){},266:function(e,t,o){"use strict";var n=o(12),c=o.n(n),a=o(0),r=o(42),s=o(4),l=o.n(s),i=o(135);o(267),t.a=e=>{let{className:t,showSpinner:o=!1,children:n,variant:s="contained",...u}=e;const p=l()("wc-block-components-button",t,s,{"wc-block-components-button--loading":o});return Object(a.createElement)(r.a,c()({className:p},u),o&&Object(a.createElement)(i.a,null),Object(a.createElement)("span",{className:"wc-block-components-button__text"},n))}},267:function(e,t){},274:function(e,t,o){"use strict";o.d(t,"a",(function(){return i}));var n=o(1),c=o(7),a=o(6),r=o(17),s=o(32),l=o(199);const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{cartCoupons:t,cartIsLoading:o}=Object(s.a)(),{createErrorNotice:i}=Object(c.useDispatch)("core/notices"),{createNotice:u}=Object(c.useDispatch)("core/notices"),{setValidationErrors:p}=Object(l.b)(),{applyCoupon:b,removeCoupon:d,isApplyingCoupon:m,isRemovingCoupon:g}=Object(c.useSelect)((e,t)=>{let{dispatch:o}=t;const n=e(a.CART_STORE_KEY),c=o(a.CART_STORE_KEY);return{applyCoupon:c.applyCoupon,removeCoupon:c.removeCoupon,isApplyingCoupon:n.isApplyingCoupon(),isRemovingCoupon:n.isRemovingCoupon(),receiveApplyingCoupon:c.receiveApplyingCoupon}},[i,u]),O=t=>{b(t).then(o=>{!0===o&&u("info",Object(n.sprintf)( +/* translators: %s coupon code. */ +Object(n.__)('Coupon code "%s" has been applied to your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(e=>{p({coupon:{message:Object(r.decodeEntities)(e.message),hidden:!1}}),receiveApplyingCoupon("")})},j=t=>{d(t).then(o=>{!0===o&&u("info",Object(n.sprintf)( +/* translators: %s coupon code. */ +Object(n.__)('Coupon code "%s" has been removed from your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(t=>{i(t.message,{id:"coupon-form",context:e}),receiveApplyingCoupon("")})};return{appliedCoupons:t,isLoading:o,applyCoupon:O,removeCoupon:j,isApplyingCoupon:m,isRemovingCoupon:g}}},277:function(e,t,o){"use strict";o.d(t,"a",(function(){return a}));var n=o(0),c=o(199);o(264);const a=e=>{let{errorMessage:t="",propertyName:o="",elementId:a=""}=e;const{getValidationError:r,getValidationErrorId:s}=Object(c.b)();if(!t||"string"!=typeof t){const e=r(o)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:s(a)},t))}},302:function(e,t,o){"use strict";var n=o(12),c=o.n(n),a=o(0),r=o(1),s=o(5),l=o(4),i=o.n(l),u=o(199),p=o(277),b=o(9),d=o(45),m=o(22);o(265);var g=Object(s.forwardRef)((e,t)=>{let{className:o,id:n,type:r="text",ariaLabel:s,ariaDescribedBy:l,label:u,screenReaderLabel:p,disabled:b,help:d,autoCapitalize:g="off",autoComplete:O="off",value:j="",onChange:f,required:E=!1,onBlur:v=(()=>{}),feedback:h,...w}=e;const[C,_]=Object(a.useState)(!1);return Object(a.createElement)("div",{className:i()("wc-block-components-text-input",o,{"is-active":C||j})},Object(a.createElement)("input",c()({type:r,id:n,value:j,ref:t,autoCapitalize:g,autoComplete:O,onChange:e=>{f(e.target.value)},onFocus:()=>_(!0),onBlur:e=>{v(e.target.value),_(!1)},"aria-label":s||u,disabled:b,"aria-describedby":d&&!l?n+"__help":l,required:E},w)),Object(a.createElement)(m.a,{label:u,screenReaderLabel:p||u,wrapperElement:"label",wrapperProps:{htmlFor:n},htmlFor:n}),!!d&&Object(a.createElement)("p",{id:n+"__help",className:"wc-block-components-text-input__help"},d),h)});t.a=Object(b.withInstanceId)(e=>{let{className:t,instanceId:o,id:n,ariaDescribedBy:l,errorId:b,focusOnMount:m=!1,onChange:O,showError:j=!0,errorMessage:f="",value:E="",...v}=e;const[h,w]=Object(s.useState)(!0),C=Object(s.useRef)(null),{getValidationError:_,hideValidationError:y,setValidationErrors:k,clearValidationError:N,getValidationErrorId:R}=Object(u.b)(),I=void 0!==n?n:"textinput-"+o,A=void 0!==b?b:I,S=Object(s.useCallback)((function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=C.current||null;if(!t)return;t.value=t.value.trim();const o=t.checkValidity();o?N(A):k({[A]:{message:t.validationMessage||Object(r.__)("Invalid value.","woo-gutenberg-products-block"),hidden:e}})}),[N,A,k]);Object(s.useEffect)(()=>{var e;h&&m&&(null===(e=C.current)||void 0===e||e.focus()),w(!1)},[m,h,w]),Object(s.useEffect)(()=>{var e,t;(null===(e=C.current)||void 0===e||null===(t=e.ownerDocument)||void 0===t?void 0:t.activeElement)!==C.current&&S(!0)},[E,S]),Object(s.useEffect)(()=>()=>{N(A)},[N,A]);const L=_(A)||{};Object(d.a)(f)&&""!==f&&(L.message=f);const V=L.message&&!L.hidden,x=j&&V&&R(A)?R(A):l;return Object(a.createElement)(g,c()({className:i()(t,{"has-error":V}),"aria-invalid":!0===V,id:I,onBlur:()=>{S(!1)},feedback:j&&Object(a.createElement)(p.a,{errorMessage:f,propertyName:A}),ref:C,onChange:e=>{y(A),O(e)},ariaDescribedBy:x,value:E},v))})},317:function(e,t){},381:function(e,t,o){"use strict";var n=o(0),c=o(1),a=o(266),r=o(302),s=o(22),l=o(136),i=o(9),u=o(199),p=o(277),b=o(10);o(317),t.a=Object(i.withInstanceId)(e=>{let{instanceId:t,isLoading:o=!1,initialOpen:i=!1,onSubmit:d=(()=>{})}=e;const[m,g]=Object(n.useState)(""),O=Object(n.useRef)(!1),{getValidationError:j,getValidationErrorId:f}=Object(u.b)(),E=j("coupon");Object(n.useEffect)(()=>{O.current!==o&&(o||!m||E||g(""),O.current=o)},[o,m,E]);const v="wc-block-components-totals-coupon__input-"+t;return Object(n.createElement)(b.Panel,{className:"wc-block-components-totals-coupon",hasBorder:!1,initialOpen:i,title:Object(n.createElement)(s.a,{label:Object(c.__)("Coupon code","woo-gutenberg-products-block"),screenReaderLabel:Object(c.__)("Apply a coupon code","woo-gutenberg-products-block"),htmlFor:v})},Object(n.createElement)(l.a,{screenReaderLabel:Object(c.__)("Applying coupon…","woo-gutenberg-products-block"),isLoading:o,showSpinner:!1},Object(n.createElement)("div",{className:"wc-block-components-totals-coupon__content"},Object(n.createElement)("form",{className:"wc-block-components-totals-coupon__form"},Object(n.createElement)(r.a,{id:v,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:Object(c.__)("Enter code","woo-gutenberg-products-block"),value:m,ariaDescribedBy:f(v),onChange:e=>{g(e)},focusOnMount:!0,showError:!1}),Object(n.createElement)(a.a,{className:"wc-block-components-totals-coupon__button",disabled:o||!m,showSpinner:o,onClick:e=>{e.preventDefault(),d(m)},type:"submit"},Object(c.__)("Apply","woo-gutenberg-products-block"))),Object(n.createElement)(p.a,{propertyName:"coupon",elementId:v}))))})},456:function(e,t,o){"use strict";o.r(t);var n=o(0),c=o(381),a=o(274),r=o(2),s=o(10);t.default=e=>{let{className:t}=e;const o=Object(r.getSetting)("couponsEnabled",!0),{applyCoupon:l,isApplyingCoupon:i}=Object(a.a)("wc/cart");return o?Object(n.createElement)(s.TotalsWrapper,{className:t},Object(n.createElement)(c.a,{onSubmit:l,isLoading:i})):null}}}]); \ No newline at end of file diff --git a/build/cart-blocks/order-summary-discount-frontend.js b/build/cart-blocks/order-summary-discount-frontend.js new file mode 100644 index 00000000000..061e7ad4e77 --- /dev/null +++ b/build/cart-blocks/order-summary-discount-frontend.js @@ -0,0 +1,13 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[21],{117:function(e,t,o){"use strict";var c=o(0);t.a=function(e){let{icon:t,size:o=24,...n}=e;return Object(c.cloneElement)(t,{width:o,height:o,...n})}},201:function(e,t){},256:function(e,t,o){"use strict";var c=o(12),n=o.n(c),s=o(0),a=o(4),r=o.n(a),l=o(1),i=o(117),p=o(13),u=Object(s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(s.createElement)(p.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));o(201);var b=e=>{let{text:t,screenReaderText:o="",element:c="li",className:a="",radius:l="small",children:i=null,...p}=e;const u=c,b=r()(a,"wc-block-components-chip","wc-block-components-chip--radius-"+l),m=Boolean(o&&o!==t);return Object(s.createElement)(u,n()({className:b},p),Object(s.createElement)("span",{"aria-hidden":m,className:"wc-block-components-chip__text"},t),m&&Object(s.createElement)("span",{className:"screen-reader-text"},o),i)};t.a=e=>{let{ariaLabel:t="",className:o="",disabled:c=!1,onRemove:a=(()=>{}),removeOnAnyClick:p=!1,text:m,screenReaderText:d="",...g}=e;const O=p?"span":"button";if(!t){const e=d&&"string"==typeof d?d:m;t="string"!=typeof e? +/* translators: Remove chip. */ +Object(l.__)("Remove","woo-gutenberg-products-block"):Object(l.sprintf)( +/* translators: %s text of the chip to remove. */ +Object(l.__)('Remove "%s"',"woo-gutenberg-products-block"),e)}const j={"aria-label":t,disabled:c,onClick:a,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||a()}},C=p?j:{},v=p?{"aria-hidden":!0}:j;return Object(s.createElement)(b,n()({},g,C,{className:r()(o,"is-removable"),element:p?"button":g.element,screenReaderText:d,text:m}),Object(s.createElement)(O,n()({className:"wc-block-components-chip__remove"},v),Object(s.createElement)(i.a,{className:"wc-block-components-chip__remove-icon",icon:u,size:16})))}},274:function(e,t,o){"use strict";o.d(t,"a",(function(){return i}));var c=o(1),n=o(7),s=o(6),a=o(17),r=o(32),l=o(199);const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{cartCoupons:t,cartIsLoading:o}=Object(r.a)(),{createErrorNotice:i}=Object(n.useDispatch)("core/notices"),{createNotice:p}=Object(n.useDispatch)("core/notices"),{setValidationErrors:u}=Object(l.b)(),{applyCoupon:b,removeCoupon:m,isApplyingCoupon:d,isRemovingCoupon:g}=Object(n.useSelect)((e,t)=>{let{dispatch:o}=t;const c=e(s.CART_STORE_KEY),n=o(s.CART_STORE_KEY);return{applyCoupon:n.applyCoupon,removeCoupon:n.removeCoupon,isApplyingCoupon:c.isApplyingCoupon(),isRemovingCoupon:c.isRemovingCoupon(),receiveApplyingCoupon:n.receiveApplyingCoupon}},[i,p]),O=t=>{b(t).then(o=>{!0===o&&p("info",Object(c.sprintf)( +/* translators: %s coupon code. */ +Object(c.__)('Coupon code "%s" has been applied to your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(e=>{u({coupon:{message:Object(a.decodeEntities)(e.message),hidden:!1}}),receiveApplyingCoupon("")})},j=t=>{m(t).then(o=>{!0===o&&p("info",Object(c.sprintf)( +/* translators: %s coupon code. */ +Object(c.__)('Coupon code "%s" has been removed from your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(t=>{i(t.message,{id:"coupon-form",context:e}),receiveApplyingCoupon("")})};return{appliedCoupons:t,isLoading:o,applyCoupon:O,removeCoupon:j,isApplyingCoupon:d,isRemovingCoupon:g}}},316:function(e,t){},380:function(e,t,o){"use strict";var c=o(0),n=o(1),s=o(136),a=o(256),r=o(10),l=o(2);o(316);const i={context:"summary"};t.a=e=>{let{cartCoupons:t=[],currency:o,isRemovingCoupon:p,removeCoupon:u,values:b}=e;const{total_discount:m,total_discount_tax:d}=b,g=parseInt(m,10);if(!g&&0===t.length)return null;const O=parseInt(d,10),j=Object(l.getSetting)("displayCartPricesIncludingTax",!1)?g+O:g,C=Object(r.__experimentalApplyCheckoutFilter)({arg:i,filterName:"coupons",defaultValue:t});return Object(c.createElement)(r.TotalsItem,{className:"wc-block-components-totals-discount",currency:o,description:0!==C.length&&Object(c.createElement)(s.a,{screenReaderLabel:Object(n.__)("Removing coupon…","woo-gutenberg-products-block"),isLoading:p,showSpinner:!1},Object(c.createElement)("ul",{className:"wc-block-components-totals-discount__coupon-list"},C.map(e=>Object(c.createElement)(a.a,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:Object(n.sprintf)( +/* translators: %s Coupon code. */ +Object(n.__)("Coupon: %s","woo-gutenberg-products-block"),e.label),disabled:p,onRemove:()=>{u(e.code)},radius:"large",ariaLabel:Object(n.sprintf)( +/* translators: %s is a coupon code. */ +Object(n.__)('Remove coupon "%s"',"woo-gutenberg-products-block"),e.label)})))),label:j?Object(n.__)("Discount","woo-gutenberg-products-block"):Object(n.__)("Coupons","woo-gutenberg-products-block"),value:j?-1*j:"-"})}},455:function(e,t,o){"use strict";o.r(t);var c=o(0),n=o(380),s=o(41),a=o(32),r=o(274),l=o(10);const i=()=>{const{extensions:e,receiveCart:t,...o}=Object(a.a)(),n={extensions:e,cart:o,context:"woocommerce/cart"};return Object(c.createElement)(l.ExperimentalDiscountsMeta.Slot,n)};t.default=e=>{let{className:t}=e;const{cartTotals:o,cartCoupons:p}=Object(a.a)(),{removeCoupon:u,isRemovingCoupon:b}=Object(r.a)("wc/cart"),m=Object(s.getCurrencyFromPriceResponse)(o);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(l.TotalsWrapper,{className:t},Object(c.createElement)(n.a,{cartCoupons:p,currency:m,isRemovingCoupon:b,removeCoupon:u,values:o})),Object(c.createElement)(i,null))}}}]); \ No newline at end of file diff --git a/build/cart-blocks/order-summary-fee-frontend.js b/build/cart-blocks/order-summary-fee-frontend.js new file mode 100644 index 00000000000..4cc7ba41a13 --- /dev/null +++ b/build/cart-blocks/order-summary-fee-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[22],{454:function(e,c,t){"use strict";t.r(c);var s=t(0),a=t(10),r=t(41),n=t(32);c.default=e=>{let{className:c}=e;const{cartFees:t,cartTotals:o}=Object(n.a)(),l=Object(r.getCurrencyFromPriceResponse)(o);return Object(s.createElement)(a.TotalsWrapper,{className:c},Object(s.createElement)(a.TotalsFees,{currency:l,cartFees:t}))}}}]); \ No newline at end of file diff --git a/build/cart-blocks/order-summary-heading-frontend.js b/build/cart-blocks/order-summary-heading-frontend.js new file mode 100644 index 00000000000..965ffb5ba1b --- /dev/null +++ b/build/cart-blocks/order-summary-heading-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[23],{268:function(e,t,c){"use strict";var n=c(12),o=c.n(n),a=c(0),l=c(4),s=c.n(l);c(269),t.a=e=>{let{children:t,className:c,headingLevel:n,...l}=e;const r=s()("wc-block-components-title",c),i="h"+n;return Object(a.createElement)(i,o()({className:r},l),t)}},269:function(e,t){},439:function(e,t,c){"use strict";c.r(t);var n=c(119),o=c(0),a=c(268),l=c(4),s=c.n(l),r=c(1),i={content:{type:"string",default:Object(r.__)("Cart totals","woo-gutenberg-products-block")},lock:{type:"object",default:{remove:!1,move:!1}}};t.default=Object(n.withFilteredAttributes)(i)(e=>{let{className:t,content:c=""}=e;return Object(o.createElement)(a.a,{headingLevel:"2",className:s()(t,"wc-block-cart__totals-title")},c)})}}]); \ No newline at end of file diff --git a/build/cart-blocks/order-summary-shipping--checkout-blocks/order-summary-shipping-frontend.js b/build/cart-blocks/order-summary-shipping--checkout-blocks/order-summary-shipping-frontend.js new file mode 100644 index 00000000000..35186b63582 --- /dev/null +++ b/build/cart-blocks/order-summary-shipping--checkout-blocks/order-summary-shipping-frontend.js @@ -0,0 +1,11 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[5],{102:function(e,t,n){"use strict";var a=n(12),c=n.n(a),o=n(0),s=n(137),r=n(4),l=n.n(r);n(197);const i=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:n,currency:a,onValueChange:r,displayType:p="text",...u}=e;const d="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(d))return null;const b=d/10**a.minorUnit;if(!Number.isFinite(b))return null;const m=l()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),g={...u,...i(a),value:void 0,currency:void 0,onValueChange:void 0},O=r?e=>{const t=+e.value*10**a.minorUnit;r(t)}:()=>{};return Object(o.createElement)(s.a,c()({className:m,displayType:p},g,{value:b,onValueChange:O}))}},197:function(e,t){},22:function(e,t,n){"use strict";var a=n(0),c=n(4),o=n.n(c);t.a=e=>{let t,{label:n,screenReaderLabel:c,wrapperElement:s,wrapperProps:r={}}=e;const l=null!=n,i=null!=c;return!l&&i?(t=s||"span",r={...r,className:o()(r.className,"screen-reader-text")},Object(a.createElement)(t,r,c)):(t=s||a.Fragment,l&&i&&n!==c?Object(a.createElement)(t,r,Object(a.createElement)("span",{"aria-hidden":"true"},n),Object(a.createElement)("span",{className:"screen-reader-text"},c)):Object(a.createElement)(t,r,n))}},264:function(e,t){},265:function(e,t){},266:function(e,t,n){"use strict";var a=n(12),c=n.n(a),o=n(0),s=n(42),r=n(4),l=n.n(r),i=n(135);n(267),t.a=e=>{let{className:t,showSpinner:n=!1,children:a,variant:r="contained",...p}=e;const u=l()("wc-block-components-button",t,r,{"wc-block-components-button--loading":n});return Object(o.createElement)(s.a,c()({className:u},p),n&&Object(o.createElement)(i.a,null),Object(o.createElement)("span",{className:"wc-block-components-button__text"},a))}},267:function(e,t){},270:function(e,t,n){"use strict";var a=n(0),c=n(4),o=n.n(c),s=n(271);t.a=e=>{let{checked:t,name:n,onChange:c,option:r}=e;const{value:l,label:i,description:p,secondaryLabel:u,secondaryDescription:d}=r;return Object(a.createElement)("label",{className:o()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":t}),htmlFor:`${n}-${l}`},Object(a.createElement)("input",{id:`${n}-${l}`,className:"wc-block-components-radio-control__input",type:"radio",name:n,value:l,onChange:e=>c(e.target.value),checked:t,"aria-describedby":o()({[`${n}-${l}__label`]:i,[`${n}-${l}__secondary-label`]:u,[`${n}-${l}__description`]:p,[`${n}-${l}__secondary-description`]:d})}),Object(a.createElement)(s.a,{id:`${n}-${l}`,label:i,secondaryLabel:u,description:p,secondaryDescription:d}))}},271:function(e,t,n){"use strict";var a=n(0);t.a=e=>{let{label:t,secondaryLabel:n,description:c,secondaryDescription:o,id:s}=e;return Object(a.createElement)("div",{className:"wc-block-components-radio-control__option-layout"},Object(a.createElement)("div",{className:"wc-block-components-radio-control__label-group"},t&&Object(a.createElement)("span",{id:s&&s+"__label",className:"wc-block-components-radio-control__label"},t),n&&Object(a.createElement)("span",{id:s&&s+"__secondary-label",className:"wc-block-components-radio-control__secondary-label"},n)),Object(a.createElement)("div",{className:"wc-block-components-radio-control__description-group"},c&&Object(a.createElement)("span",{id:s&&s+"__description",className:"wc-block-components-radio-control__description"},c),o&&Object(a.createElement)("span",{id:s&&s+"__secondary-description",className:"wc-block-components-radio-control__secondary-description"},o)))}},277:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var a=n(0),c=n(199);n(264);const o=e=>{let{errorMessage:t="",propertyName:n="",elementId:o=""}=e;const{getValidationError:s,getValidationErrorId:r}=Object(c.b)();if(!t||"string"!=typeof t){const e=s(n)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(a.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(a.createElement)("p",{id:r(o)},t))}},292:function(e,t,n){"use strict";var a=n(0),c=n(4),o=n.n(c),s=n(9),r=n(270);n(293);const l=e=>{let{className:t="",id:n,selected:c,onChange:i,options:p=[]}=e;const u=Object(s.useInstanceId)(l),d=n||u;return p.length?Object(a.createElement)("div",{className:o()("wc-block-components-radio-control",t)},p.map(e=>Object(a.createElement)(r.a,{key:`${d}-${e.value}`,name:"radio-control-"+d,checked:e.value===c,option:e,onChange:t=>{i(t),"function"==typeof e.onChange&&e.onChange(t)}}))):null};t.a=l},293:function(e,t){},302:function(e,t,n){"use strict";var a=n(12),c=n.n(a),o=n(0),s=n(1),r=n(5),l=n(4),i=n.n(l),p=n(199),u=n(277),d=n(9),b=n(45),m=n(22);n(265);var g=Object(r.forwardRef)((e,t)=>{let{className:n,id:a,type:s="text",ariaLabel:r,ariaDescribedBy:l,label:p,screenReaderLabel:u,disabled:d,help:b,autoCapitalize:g="off",autoComplete:O="off",value:h="",onChange:j,required:f=!1,onBlur:E=(()=>{}),feedback:k,..._}=e;const[v,y]=Object(o.useState)(!1);return Object(o.createElement)("div",{className:i()("wc-block-components-text-input",n,{"is-active":v||h})},Object(o.createElement)("input",c()({type:s,id:a,value:h,ref:t,autoCapitalize:g,autoComplete:O,onChange:e=>{j(e.target.value)},onFocus:()=>y(!0),onBlur:e=>{E(e.target.value),y(!1)},"aria-label":r||p,disabled:d,"aria-describedby":b&&!l?a+"__help":l,required:f},_)),Object(o.createElement)(m.a,{label:p,screenReaderLabel:u||p,wrapperElement:"label",wrapperProps:{htmlFor:a},htmlFor:a}),!!b&&Object(o.createElement)("p",{id:a+"__help",className:"wc-block-components-text-input__help"},b),k)});t.a=Object(d.withInstanceId)(e=>{let{className:t,instanceId:n,id:a,ariaDescribedBy:l,errorId:d,focusOnMount:m=!1,onChange:O,showError:h=!0,errorMessage:j="",value:f="",...E}=e;const[k,_]=Object(r.useState)(!0),v=Object(r.useRef)(null),{getValidationError:y,hideValidationError:w,setValidationErrors:C,clearValidationError:N,getValidationErrorId:S}=Object(p.b)(),I=void 0!==a?a:"textinput-"+n,R=void 0!==d?d:I,x=Object(r.useCallback)((function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=v.current||null;if(!t)return;t.value=t.value.trim();const n=t.checkValidity();n?N(R):C({[R]:{message:t.validationMessage||Object(s.__)("Invalid value.","woo-gutenberg-products-block"),hidden:e}})}),[N,R,C]);Object(r.useEffect)(()=>{var e;k&&m&&(null===(e=v.current)||void 0===e||e.focus()),_(!1)},[m,k,_]),Object(r.useEffect)(()=>{var e,t;(null===(e=v.current)||void 0===e||null===(t=e.ownerDocument)||void 0===t?void 0:t.activeElement)!==v.current&&x(!0)},[f,x]),Object(r.useEffect)(()=>()=>{N(R)},[N,R]);const L=y(R)||{};Object(b.a)(j)&&""!==j&&(L.message=j);const M=L.message&&!L.hidden,$=h&&M&&S(R)?S(R):l;return Object(o.createElement)(g,c()({className:i()(t,{"has-error":M}),"aria-invalid":!0===M,id:I,onBlur:()=>{x(!1)},feedback:h&&Object(o.createElement)(u.a,{errorMessage:j,propertyName:R}),ref:v,onChange:e=>{w(R),O(e)},ariaDescribedBy:$,value:f},E))})},318:function(e,t){},319:function(e,t){},320:function(e,t){},321:function(e,t){},338:function(e,t){},345:function(e,t,n){"use strict";var a=n(0),c=n(1),o=n(23),s=n(136),r=n(10),l=n(383),i=n(32),p=n(29),u=n(4),d=n.n(u),b=n(17),m=n(22),g=n(69),O=n(292),h=n(271),j=n(41),f=n(102),E=n(2);const k=e=>{const t=Object(E.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(b.decodeEntities)(e.name),value:e.rate_id,description:Object(a.createElement)(a.Fragment,null,Number.isFinite(t)&&Object(a.createElement)(f.a,{currency:Object(j.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,Object(b.decodeEntities)(e.delivery_time))}};var _=e=>{let{className:t="",noResultsMessage:n,onSelectRate:c,rates:o,renderOption:s=k,selectedRate:r}=e;const l=(null==r?void 0:r.rate_id)||"",[i,p]=Object(a.useState)(l);if(Object(a.useEffect)(()=>{l&&p(l)},[l]),0===o.length)return n;if(o.length>1)return Object(a.createElement)(O.a,{className:t,onChange:e=>{p(e),c(e)},selected:i,options:o.map(s)});const{label:u,secondaryLabel:d,description:b,secondaryDescription:m}=s(o[0]);return Object(a.createElement)(h.a,{label:u,secondaryLabel:d,description:b,secondaryDescription:m})};n(321);var v=e=>{let{packageId:t,className:n="",noResultsMessage:o,renderOption:s,packageData:l,collapsible:i=!1,collapse:p=!1,showItems:u=!1}=e;const{selectShippingRate:O}=Object(g.a)(),h=Object(a.createElement)(a.Fragment,null,(u||i)&&Object(a.createElement)("div",{className:"wc-block-components-shipping-rates-control__package-title"},l.name),u&&Object(a.createElement)("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(l.items).map(e=>{const t=Object(b.decodeEntities)(e.name),n=e.quantity;return Object(a.createElement)("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},Object(a.createElement)(m.a,{label:n>1?`${t} × ${n}`:""+t,screenReaderLabel:Object(c.sprintf)( +/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */ +Object(c._n)("%1$s (%2$d unit)","%1$s (%2$d units)",n,"woo-gutenberg-products-block"),t,n)}))}))),j=Object(a.createElement)(_,{className:n,noResultsMessage:o,rates:l.shipping_rates,onSelectRate:e=>O(e,t),selectedRate:l.shipping_rates.find(e=>e.selected),renderOption:s});return i?Object(a.createElement)(r.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!p,title:h},j):Object(a.createElement)("div",{className:d()("wc-block-components-shipping-rates-control__package",n)},h,j)};const y=e=>{let{packages:t,collapse:n,showItems:c,collapsible:o,noResultsMessage:s,renderOption:r}=e;return t.length?Object(a.createElement)(a.Fragment,null,t.map(e=>{let{package_id:l,...i}=e;return Object(a.createElement)(v,{key:l,packageId:l,packageData:i,collapsible:!!o,collapse:!!n,showItems:c||t.length>1,noResultsMessage:s,renderOption:r})})):null};t.a=e=>{let{shippingRates:t,isLoadingRates:n,className:u,collapsible:d=!1,noResultsMessage:b,renderOption:m,context:g}=e;Object(a.useEffect)(()=>{if(n)return;const e=Object(l.a)(t),a=Object(l.b)(t);1===e?Object(o.speak)(Object(c.sprintf)( +/* translators: %d number of shipping options found. */ +Object(c._n)("%d shipping option was found.","%d shipping options were found.",a,"woo-gutenberg-products-block"),a)):Object(o.speak)(Object(c.sprintf)( +/* translators: %d number of shipping packages packages. */ +Object(c._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",e,"woo-gutenberg-products-block"),e)+" "+Object(c.sprintf)( +/* translators: %d number of shipping options available. */ +Object(c._n)("%d shipping option was found","%d shipping options were found",a,"woo-gutenberg-products-block"),a))},[n,t]);const{extensions:O,receiveCart:h,...j}=Object(i.a)(),f={className:u,collapsible:d,noResultsMessage:b,renderOption:m,extensions:O,cart:j,components:{ShippingRatesControlPackage:v},context:g,shippingRates:t},{isEditor:E}=Object(p.a)();return Object(a.createElement)(s.a,{isLoading:n,screenReaderLabel:Object(c.__)("Loading shipping rates…","woo-gutenberg-products-block"),showSpinner:!0},E?Object(a.createElement)(y,{packages:t,noResultsMessage:b,renderOption:m}):Object(a.createElement)(a.Fragment,null,Object(a.createElement)(r.ExperimentalOrderShippingPackages.Slot,f),Object(a.createElement)(r.ExperimentalOrderShippingPackages,null,Object(a.createElement)(y,{showItems:t.length>1,packages:t,noResultsMessage:b,renderOption:m}))))}},382:function(e,t){},383:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return c}));const a=e=>e.length,c=e=>e.reduce((function(e,t){return e+t.shipping_rates.length}),0)},396:function(e,t,n){"use strict";var a=n(0),c=n(302),o=n(12),s=n.n(o),r=n(48),l=n(1),i=n(17),p=n(4),u=n.n(p),d=n(9),b=n(437),m=n(199),g=n(277),O=n(18);n(319);var h=Object(d.withInstanceId)(e=>{let{id:t,className:n,label:c,onChange:o,options:s,value:r,required:i=!1,errorMessage:p=Object(l.__)("Please select a value.","woo-gutenberg-products-block"),errorId:d,instanceId:h="0",autoComplete:j="off"}=e;const{getValidationError:f,setValidationErrors:E,clearValidationError:k}=Object(m.b)(),_=Object(a.useRef)(null),v=t||"control-"+h,y=d||v,w=f(y)||{message:"",hidden:!1};return Object(a.useEffect)(()=>(!i||r?k(y):E({[y]:{message:p,hidden:!0}}),()=>{k(y)}),[k,r,y,p,i,E]),Object(a.createElement)("div",{id:v,className:u()("wc-block-components-combobox",n,{"is-active":r,"has-error":w.message&&!w.hidden}),ref:_},Object(a.createElement)(b.a,{className:"wc-block-components-combobox-control",label:c,onChange:o,onFilterValueChange:e=>{if(e.length){const t=Object(O.a)(_.current)?_.current.ownerDocument.activeElement:void 0;if(t&&Object(O.a)(_.current)&&_.current.contains(t))return;const n=e.toLocaleUpperCase(),a=s.find(e=>e.label.toLocaleUpperCase().startsWith(n)||e.value.toLocaleUpperCase()===n);a&&o(a.value)}},options:s,value:r||"",allowReset:!1,autoComplete:j,"aria-invalid":w.message&&!w.hidden}),Object(a.createElement)(g.a,{propertyName:y}))});n(318);var j=e=>{let{className:t,countries:n,id:c,label:o,onChange:s,value:r="",autoComplete:p="off",required:d=!1,errorId:b,errorMessage:m=Object(l.__)("Please select a country.","woo-gutenberg-products-block")}=e;const g=Object(a.useMemo)(()=>Object.entries(n).map(e=>{let[t,n]=e;return{value:t,label:Object(i.decodeEntities)(n)}}),[n]);return Object(a.createElement)("div",{className:u()(t,"wc-block-components-country-input")},Object(a.createElement)(h,{id:c,label:o,onChange:s,options:g,value:r,errorId:b,errorMessage:m,required:d,autoComplete:p}),"off"!==p&&Object(a.createElement)("input",{type:"text","aria-hidden":!0,autoComplete:p,value:r,onChange:e=>{const t=e.target.value.toLocaleUpperCase(),n=g.find(e=>2!==t.length&&e.label.toLocaleUpperCase()===t||2===t.length&&e.value.toLocaleUpperCase()===t);s(n?n.value:"")},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1}))},f=e=>Object(a.createElement)(j,s()({countries:r.g},e)),E=e=>Object(a.createElement)(j,s()({countries:r.a},e));n(320);const k=(e,t)=>{const n=t.find(t=>t.label.toLocaleUpperCase()===e.toLocaleUpperCase()||t.value.toLocaleUpperCase()===e.toLocaleUpperCase());return n?n.value:""};var _=e=>{let{className:t,id:n,states:o,country:s,label:r,onChange:p,autoComplete:d="off",value:b="",required:m=!1}=e;const g=o[s],O=Object(a.useMemo)(()=>g?Object.keys(g).map(e=>({value:e,label:Object(i.decodeEntities)(g[e])})):[],[g]),j=Object(a.useCallback)(e=>{p(O.length>0?k(e,O):e)},[p,O]),f=Object(a.useRef)(b);return Object(a.useEffect)(()=>{f.current!==b&&(f.current=b)},[b]),Object(a.useEffect)(()=>{if(O.length>0&&f.current){const e=k(f.current,O);e!==f.current&&j(e)}},[O,j]),O.length>0?Object(a.createElement)(a.Fragment,null,Object(a.createElement)(h,{className:u()(t,"wc-block-components-state-input"),id:n,label:r,onChange:j,options:O,value:b,errorMessage:Object(l.__)("Please select a state.","woo-gutenberg-products-block"),required:m,autoComplete:d}),"off"!==d&&Object(a.createElement)("input",{type:"text","aria-hidden":!0,autoComplete:d,value:b,onChange:e=>j(e.target.value),style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1})):Object(a.createElement)(c.a,{className:t,id:n,label:r,onChange:j,autoComplete:d,value:b,required:m})},v=e=>Object(a.createElement)(_,s()({states:r.h},e)),y=e=>Object(a.createElement)(_,s()({states:r.b},e)),w=n(31),C=n(2),N=n(49);t.a=Object(d.withInstanceId)(e=>{let{id:t="",fields:n=Object.keys(C.defaultAddressFields),fieldConfig:o={},instanceId:s,onChange:r,type:i="shipping",values:p}=e;const{getValidationError:u,setValidationErrors:d,clearValidationError:b}=Object(m.b)(),g=Object(w.a)(n),O=u("shipping-missing-country")||{},h=Object(a.useMemo)(()=>Object(N.a)(g,o,p.country),[g,o,p.country]);return Object(a.useEffect)(()=>{h.forEach(e=>{e.hidden&&p[e.key]&&r({...p,[e.key]:""})})},[h,r,p]),Object(a.useEffect)(()=>{"shipping"===i&&((e,t,n,a)=>{a||e.country||!(e.city||e.state||e.postcode)||t({"shipping-missing-country":{message:Object(l.__)("Please select a country to calculate rates.","woo-gutenberg-products-block"),hidden:!1}}),a&&e.country&&n("shipping-missing-country")})(p,d,b,!!O.message&&!O.hidden)},[p,O.message,O.hidden,d,b,i]),t=t||s,Object(a.createElement)("div",{id:t,className:"wc-block-components-address-form"},h.map(e=>{if(e.hidden)return null;if("country"===e.key){const n="shipping"===i?f:E;return Object(a.createElement)(n,{key:e.key,id:`${t}-${e.key}`,label:e.required?e.label:e.optionalLabel,value:p.country,autoComplete:e.autocomplete,onChange:e=>r({...p,country:e,state:""}),errorId:"shipping"===i?"shipping-missing-country":null,errorMessage:e.errorMessage,required:e.required})}if("state"===e.key){const n="shipping"===i?v:y;return Object(a.createElement)(n,{key:e.key,id:`${t}-${e.key}`,country:p.country,label:e.required?e.label:e.optionalLabel,value:p.state,autoComplete:e.autocomplete,onChange:e=>r({...p,state:e}),errorMessage:e.errorMessage,required:e.required})}return Object(a.createElement)(c.a,{key:e.key,id:`${t}-${e.key}`,className:"wc-block-components-address-form__"+e.key,label:e.required?e.label:e.optionalLabel,value:p[e.key],autoCapitalize:e.autocapitalize,autoComplete:e.autocomplete,onChange:t=>r({...p,[e.key]:t}),errorMessage:e.errorMessage,required:e.required})}))})},432:function(e,t,n){"use strict";var a=n(12),c=n.n(a),o=n(0),s=n(4),r=n.n(s),l=n(1),i=n(32),p=n(10),u=n(2),d=n(17);const b=e=>{let{selectedShippingRates:t}=e;return Object(o.createElement)("div",{className:"wc-block-components-totals-item__description wc-block-components-totals-shipping__via"},Object(l.__)("via","woo-gutenberg-products-block")," ",Object(d.decodeEntities)(t.join(", ")))};var m=n(76),g=n(345),O=e=>{let{hasRates:t,shippingRates:n,isLoadingRates:a}=e;const c=t?Object(l.__)("Shipping options","woo-gutenberg-products-block"):Object(l.__)("Choose a shipping option","woo-gutenberg-products-block");return Object(o.createElement)("fieldset",{className:"wc-block-components-totals-shipping__fieldset"},Object(o.createElement)("legend",{className:"screen-reader-text"},c),Object(o.createElement)(g.a,{className:"wc-block-components-totals-shipping__options",collapsible:!0,noResultsMessage:Object(o.createElement)(m.a,{isDismissible:!1,className:r()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(l.__)("No shipping options were found.","woo-gutenberg-products-block")),shippingRates:n,isLoadingRates:a,context:"woocommerce/cart"}))},h=n(67),j=n(266),f=n(11),E=n.n(f),k=n(199),_=(n(338),n(396)),v=e=>{let{address:t,onUpdate:n,addressFields:a}=e;const[c,s]=Object(o.useState)(t),{hasValidationErrors:r,showAllValidationErrors:i}=Object(k.b)();return Object(o.createElement)("form",{className:"wc-block-components-shipping-calculator-address"},Object(o.createElement)(_.a,{fields:a,onChange:s,values:c}),Object(o.createElement)(j.a,{className:"wc-block-components-shipping-calculator-address__button",disabled:E()(c,t),onClick:e=>{if(e.preventDefault(),i(),!r)return n(c)},type:"submit"},Object(l.__)("Update","woo-gutenberg-products-block")))},y=e=>{let{onUpdate:t=(()=>{}),addressFields:n=["country","state","city","postcode"]}=e;const{shippingAddress:a,setShippingAddress:c,setBillingAddress:s}=Object(h.a)();return Object(o.createElement)("div",{className:"wc-block-components-shipping-calculator"},Object(o.createElement)(v,{address:a,addressFields:n,onUpdate:e=>{c(e),s(e),t(e)}}))},w=e=>{let{address:t}=e;if(0===Object.values(t).length)return null;const n=Object(u.getSetting)("shippingCountries",{}),a=Object(u.getSetting)("shippingStates",{}),c="string"==typeof n[t.country]?Object(d.decodeEntities)(n[t.country]):"",s="object"==typeof a[t.country]&&"string"==typeof a[t.country][t.state]?Object(d.decodeEntities)(a[t.country][t.state]):t.state,r=[];r.push(t.postcode.toUpperCase()),r.push(t.city),r.push(s),r.push(c);const i=r.filter(Boolean).join(", ");return i?Object(o.createElement)("span",{className:"wc-block-components-shipping-address"},Object(l.sprintf)( +/* translators: %s location. */ +Object(l.__)("Shipping to %s","woo-gutenberg-products-block"),i)+" "):null};n(382);const C=e=>{let{label:t=Object(l.__)("Calculate","woo-gutenberg-products-block"),isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:a}=e;return Object(o.createElement)("button",{className:"wc-block-components-totals-shipping__change-address-button",onClick:()=>{a(!n)},"aria-expanded":n},t)},N=e=>{let{showCalculator:t,isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:a,shippingAddress:c}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(w,{address:c}),t&&Object(o.createElement)(C,{label:Object(l.__)("(change address)","woo-gutenberg-products-block"),isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:a}))},S=e=>{let{showCalculator:t,isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:a,isCheckout:c=!1}=e;return t?Object(o.createElement)(C,{isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:a}):Object(o.createElement)("em",null,c?Object(l.__)("No shipping options available","woo-gutenberg-products-block"):Object(l.__)("Calculated during checkout","woo-gutenberg-products-block"))};t.a=e=>{let{currency:t,values:n,showCalculator:a=!0,showRateSelector:s=!0,isCheckout:d=!1,className:m}=e;const[g,h]=Object(o.useState)(!1),{shippingAddress:j,cartHasCalculatedShipping:f,shippingRates:E,isLoadingRates:k}=Object(i.a)(),_=Object(u.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(n.total_shipping,10)+parseInt(n.total_shipping_tax,10):parseInt(n.total_shipping,10),v=E.some(e=>e.shipping_rates.length)||_,w={isShippingCalculatorOpen:g,setIsShippingCalculatorOpen:h},C=E.flatMap(e=>e.shipping_rates.filter(e=>e.selected).flatMap(e=>e.name));return Object(o.createElement)("div",{className:r()("wc-block-components-totals-shipping",m)},Object(o.createElement)(p.TotalsItem,{label:Object(l.__)("Shipping","woo-gutenberg-products-block"),value:v&&f?_:Object(o.createElement)(S,c()({showCalculator:a,isCheckout:d},w)),description:v&&f?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(b,{selectedShippingRates:C}),Object(o.createElement)(N,c()({shippingAddress:j,showCalculator:a},w))):null,currency:t}),a&&g&&Object(o.createElement)(y,{onUpdate:()=>{h(!1)}}),s&&f&&Object(o.createElement)(O,{hasRates:v,shippingRates:E,isLoadingRates:k}))}}}]); \ No newline at end of file diff --git a/build/cart-blocks/order-summary-shipping-frontend.js b/build/cart-blocks/order-summary-shipping-frontend.js new file mode 100644 index 00000000000..09a2a1cdc75 --- /dev/null +++ b/build/cart-blocks/order-summary-shipping-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[24],{440:function(e,t,a){"use strict";a.r(t);var c=a(119),l=a(0),r=a(432),o=a(41),n=a(32),s=a(10),i=a(2),p={isShippingCalculatorEnabled:{type:"boolean",default:Object(i.getSetting)("isShippingCalculatorEnabled",!0)},lock:{type:"object",default:{move:!1,remove:!0}}};t.default=Object(c.withFilteredAttributes)(p)(e=>{let{className:t,isShippingCalculatorEnabled:a}=e;const{cartTotals:c,cartNeedsShipping:i}=Object(n.a)();if(!i)return null;const p=Object(o.getCurrencyFromPriceResponse)(c);return Object(l.createElement)(s.TotalsWrapper,{className:t},Object(l.createElement)(r.a,{showCalculator:a,showRateSelector:!0,values:c,currency:p}))})}}]); \ No newline at end of file diff --git a/build/cart-blocks/order-summary-subtotal-frontend.js b/build/cart-blocks/order-summary-subtotal-frontend.js new file mode 100644 index 00000000000..2de5148c29a --- /dev/null +++ b/build/cart-blocks/order-summary-subtotal-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[25],{453:function(e,c,t){"use strict";t.r(c);var a=t(0),s=t(10),r=t(41),n=t(32);c.default=e=>{let{className:c=""}=e;const{cartTotals:t}=Object(n.a)(),o=Object(r.getCurrencyFromPriceResponse)(t);return Object(a.createElement)(s.TotalsWrapper,{className:c},Object(a.createElement)(s.Subtotal,{currency:o,values:t}))}}}]); \ No newline at end of file diff --git a/build/cart-blocks/order-summary-taxes-frontend.js b/build/cart-blocks/order-summary-taxes-frontend.js new file mode 100644 index 00000000000..ad804773bdc --- /dev/null +++ b/build/cart-blocks/order-summary-taxes-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[26],{441:function(e,t,a){"use strict";a.r(t);var c=a(119),r=a(0),s=a(10),l=a(41),n=a(32),o=a(2),i={showRateAfterTaxName:{type:"boolean",default:Object(o.getSetting)("displayCartPricesIncludingTax",!1)},lock:{type:"object",default:{remove:!0,move:!1}}};t.default=Object(c.withFilteredAttributes)(i)(e=>{let{className:t,showRateAfterTaxName:a}=e;const{cartTotals:c}=Object(n.a)();if(Object(o.getSetting)("displayCartPricesIncludingTax",!1)||parseInt(c.total_tax,10)<=0)return null;const i=Object(l.getCurrencyFromPriceResponse)(c);return Object(r.createElement)(s.TotalsWrapper,{className:t},Object(r.createElement)(s.TotalsTaxes,{showRateAfterTaxName:a,currency:i,values:c}))})}}]); \ No newline at end of file diff --git a/build/cart-blocks/proceed-to-checkout-frontend.js b/build/cart-blocks/proceed-to-checkout-frontend.js new file mode 100644 index 00000000000..ea5f98fe275 --- /dev/null +++ b/build/cart-blocks/proceed-to-checkout-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[27],{266:function(e,t,c){"use strict";var n=c(12),o=c.n(n),s=c(0),r=c(42),a=c(4),i=c.n(a),u=c(135);c(267),t.a=e=>{let{className:t,showSpinner:c=!1,children:n,variant:a="contained",...b}=e;const l=i()("wc-block-components-button",t,a,{"wc-block-components-button--loading":c});return Object(s.createElement)(r.a,o()({className:l},b),c&&Object(s.createElement)(u.a,null),Object(s.createElement)("span",{className:"wc-block-components-button__text"},n))}},267:function(e,t){},375:function(e,t,c){"use strict";(function(e){var n=c(0),o=c(1),s=c(4),r=c.n(s),a=c(266),i=c(48),u=c(36),b=c(419),l=c(2);c(377),t.a=t=>{let{checkoutPageId:c,className:s}=t;const d=Object(l.getSetting)("page-"+c,!1),{isCalculating:m}=Object(u.b)(),[f,w]=Object(b.a)(),[p,v]=Object(n.useState)(!1);Object(n.useEffect)(()=>{if("function"!=typeof e.addEventListener||"function"!=typeof e.removeEventListener)return;const t=()=>{v(!1)};return e.addEventListener("pageshow",t),()=>{e.removeEventListener("pageshow",t)}},[]);const j=Object(n.createElement)(a.a,{className:"wc-block-cart__submit-button",href:d||i.d,disabled:m,onClick:()=>v(!0),showSpinner:p},Object(o.__)("Proceed to Checkout","woo-gutenberg-products-block"));return Object(n.createElement)("div",{className:r()("wc-block-cart__submit",s)},f,Object(n.createElement)("div",{className:"wc-block-cart__submit-container"},j),"below"===w&&Object(n.createElement)("div",{className:"wc-block-cart__submit-container wc-block-cart__submit-container--sticky"},j))}}).call(this,c(376))},376:function(e,t){var c;c=function(){return this}();try{c=c||new Function("return this")()}catch(e){"object"==typeof window&&(c=window)}e.exports=c},377:function(e,t){},419:function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var n=c(0);const o={bottom:0,left:0,opacity:0,pointerEvents:"none",position:"absolute",right:0,top:0,zIndex:-1},s=()=>{const[e,t]=Object(n.useState)(""),c=Object(n.useRef)(null),s=Object(n.useRef)(new IntersectionObserver(e=>{e[0].isIntersecting?t("visible"):t(e[0].boundingClientRect.top>0?"below":"above")},{threshold:1}));return Object(n.useLayoutEffect)(()=>{const e=c.current,t=s.current;return e&&t.observe(e),()=>{t.unobserve(e)}},[]),[Object(n.createElement)("div",{"aria-hidden":!0,ref:c,style:o}),e]}},450:function(e,t,c){"use strict";c.r(t);var n=c(119),o=c(375);t.default=Object(n.withFilteredAttributes)({checkoutPageId:{type:"number",default:0},lock:{type:"object",default:{move:!0,remove:!0}}})(o.a)}}]); \ No newline at end of file diff --git a/build/cart-express-payment-block/block.json b/build/cart-express-payment-block/block.json new file mode 100644 index 00000000000..f9bfc5cc7dc --- /dev/null +++ b/build/cart-express-payment-block/block.json @@ -0,0 +1,28 @@ +{ + "name": "woocommerce/cart-express-payment-block", + "version": "1.0.0", + "title": "Express Checkout", + "description": "Provide an express payment option for your customers.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/cart-totals-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/cart-frontend.asset.php b/build/cart-frontend.asset.php new file mode 100644 index 00000000000..9d4564ccf29 --- /dev/null +++ b/build/cart-frontend.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '27e851f1ccbcea08fb33247dc82c418b'); \ No newline at end of file diff --git a/build/cart-frontend.js b/build/cart-frontend.js new file mode 100644 index 00000000000..5bbc6a160c0 --- /dev/null +++ b/build/cart-frontend.js @@ -0,0 +1,6 @@ +!function(e){function t(t){for(var r,o,s=t[0],a=t[1],c=0,l=[];c{let{imageUrl:t=i.l+"/block-error.svg",header:r=Object(c.__)("Oops!","woo-gutenberg-products-block"),text:n=Object(c.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:a=Object(c.__)("Error:","woo-gutenberg-products-block"),button:l,showErrorBlock:u=!0}=e;return u?Object(s.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(s.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(s.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(s.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),n&&Object(s.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},n),o&&Object(s.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},a?a+" ":"",o),l&&Object(s.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};r(35);class u extends a.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(s.createElement)(s.Fragment,null,Object(s.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:n=!0,text:o,errorMessagePrefix:a,renderError:c,button:i}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof c?c({errorMessage:u}):Object(s.createElement)(l,{showErrorBlock:n,errorMessage:r?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:a,button:i}):this.props.children}}t.a=u},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){e.exports=window.wp.htmlEntities},function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return o}));const n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return n(e)&&t in e}},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},,,,function(e,t){e.exports=window.wp.a11y},function(e,t,r){"use strict";(function(e){var n=r(0);r(37);const o=Object(n.createContext)({slots:{},fills:{},registerSlot:()=>{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,r(55))},function(e,t){e.exports=window.wp.deprecated},,function(e,t){e.exports=window.wp.apiFetch},,function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(0);r(7);const o=Object(n.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),s=()=>Object(n.useContext)(o)},function(e,t,r){"use strict";r.d(t,"c",(function(){return s})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return l})),r.d(t,"d",(function(){return d}));var n=r(18);let o,s;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(o||(o={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(s||(s={}));const a=(e,t)=>Object(n.a)(e)&&"type"in e&&e.type===t,c=e=>a(e,o.SUCCESS),i=e=>a(e,o.ERROR),l=e=>a(e,o.FAIL),u=e=>!Object(n.a)(e)||void 0===e.retry||!0===e.retry,d=()=>({responseTypes:o,noticeContexts:s,shouldRetry:u,isSuccessResponse:c,isErrorResponse:i,isFailResponse:l})},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(11),s=r.n(o);function a(e){const t=Object(n.useRef)(e);return s()(e,t.current)||(t.current=e),t.current}},function(e,t,r){"use strict";r.d(t,"a",(function(){return E}));var n=r(3),o=r(0),s=r(6),a=r(7),c=r(17),i=r(118),l=r(29),u=r(70);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(a.dispatch)(s.CART_STORE_KEY).invalidateResolutionForStore()},p=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},m=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.b)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.b)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),p),[])},f={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},h={...f,email:""},b={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:s.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},g=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,r]=e;return[t,Object(c.decodeEntities)(r)]})),y={cartCoupons:s.EMPTY_CART_COUPONS,cartItems:s.EMPTY_CART_ITEMS,cartFees:s.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:b,cartIsLoading:!0,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:f,shippingRates:s.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:s.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:s.EMPTY_EXTENSIONS},E=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:r}=Object(l.a)(),c=null==r?void 0:r.previewCart,{shouldSelect:u}=e,d=Object(o.useRef)();m();const p=Object(a.useSelect)((e,r)=>{let{dispatch:n}=r;if(!u)return y;if(t)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:c.totals,cartIsLoading:!1,cartErrors:s.EMPTY_CART_ERRORS,billingData:h,billingAddress:h,shippingAddress:f,extensions:s.EMPTY_EXTENSIONS,shippingRates:c.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:()=>{}};const o=e(s.CART_STORE_KEY),a=o.getCartData(),l=o.getCartErrors(),d=o.getCartTotals(),p=!o.hasFinishedResolution("getCartData"),m=o.isCustomerDataUpdating(),{receiveCart:b}=n(s.CART_STORE_KEY),E=g(a.billingAddress),_=a.needsShipping?g(a.shippingAddress):E,v=a.fees.length>0?a.fees.map(e=>g(e)):s.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map(e=>({...e,label:e.code})):s.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:v,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:d,cartIsLoading:p,cartErrors:l,billingData:Object(i.a)(E),billingAddress:Object(i.a)(E),shippingAddress:Object(i.a)(_),extensions:a.extensions,shippingRates:a.shippingRates,isLoadingRates:m,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:b}},[u]);return d.current&&Object(n.isEqual)(d.current,p)||(d.current=p),d.current}},,function(e,t,r){"use strict";var n=r(4),o=r.n(n),s=r(0);t.a=Object(s.forwardRef)((function({as:e="div",className:t,...r},n){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(s.createElement)(e,t)}({as:e,className:o()("components-visually-hidden",t),...r,ref:n})}))},function(e,t){},function(e,t,r){"use strict";r.d(t,"b",(function(){return x})),r.d(t,"a",(function(){return P}));var n=r(0),o=r(1),s=r(61),a=r(25),c=r.n(a),i=r(45),l=r(18),u=r(7);let d;!function(e){e.SET_IDLE="set_idle",e.SET_PRISTINE="set_pristine",e.SET_REDIRECT_URL="set_redirect_url",e.SET_COMPLETE="set_checkout_complete",e.SET_BEFORE_PROCESSING="set_before_processing",e.SET_AFTER_PROCESSING="set_after_processing",e.SET_PROCESSING_RESPONSE="set_processing_response",e.SET_PROCESSING="set_checkout_is_processing",e.SET_HAS_ERROR="set_checkout_has_error",e.SET_NO_ERROR="set_checkout_no_error",e.SET_CUSTOMER_ID="set_checkout_customer_id",e.SET_ORDER_ID="set_checkout_order_id",e.SET_ORDER_NOTES="set_checkout_order_notes",e.INCREMENT_CALCULATING="increment_calculating",e.DECREMENT_CALCULATING="decrement_calculating",e.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS="set_shipping_address_as_billing_address",e.SET_SHOULD_CREATE_ACCOUNT="set_should_create_account",e.SET_EXTENSION_DATA="set_extension_data"}(d||(d={}));const p=()=>({type:d.SET_IDLE}),m=e=>({type:d.SET_REDIRECT_URL,redirectUrl:e}),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:d.SET_COMPLETE,data:e}},h=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:e?d.SET_HAS_ERROR:d.SET_NO_ERROR}};var b=r(2),g=r(118);let y;!function(e){e.PRISTINE="pristine",e.IDLE="idle",e.PROCESSING="processing",e.COMPLETE="complete",e.BEFORE_PROCESSING="before_processing",e.AFTER_PROCESSING="after_processing"}(y||(y={}));const E={order_id:0,customer_id:0,billing_address:{},shipping_address:{},...Object(b.getSetting)("checkoutData",{})||{}},_={redirectUrl:"",status:y.PRISTINE,hasError:!1,calculatingCount:0,orderId:E.order_id,orderNotes:"",customerId:E.customer_id,useShippingAsBilling:Object(g.b)(E.billing_address,E.shipping_address),shouldCreateAccount:!1,processingResponse:null,extensionData:{}},v=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_,{redirectUrl:t,type:r,customerId:n,orderId:o,orderNotes:s,extensionData:a,useShippingAsBilling:c,shouldCreateAccount:i,data:l}=arguments.length>1?arguments[1]:void 0,u=e;switch(r){case d.SET_PRISTINE:u=_;break;case d.SET_IDLE:u=e.status!==y.IDLE?{...e,status:y.IDLE}:e;break;case d.SET_REDIRECT_URL:u=void 0!==t&&t!==e.redirectUrl?{...e,redirectUrl:t}:e;break;case d.SET_PROCESSING_RESPONSE:u={...e,processingResponse:l};break;case d.SET_COMPLETE:u=e.status!==y.COMPLETE?{...e,status:y.COMPLETE,redirectUrl:"string"==typeof(null==l?void 0:l.redirectUrl)?l.redirectUrl:e.redirectUrl}:e;break;case d.SET_PROCESSING:u=e.status!==y.PROCESSING?{...e,status:y.PROCESSING,hasError:!1}:e,u=!1===u.hasError?u:{...u,hasError:!1};break;case d.SET_BEFORE_PROCESSING:u=e.status!==y.BEFORE_PROCESSING?{...e,status:y.BEFORE_PROCESSING,hasError:!1}:e;break;case d.SET_AFTER_PROCESSING:u=e.status!==y.AFTER_PROCESSING?{...e,status:y.AFTER_PROCESSING}:e;break;case d.SET_HAS_ERROR:u=e.hasError?e:{...e,hasError:!0},u=e.status===y.PROCESSING||e.status===y.BEFORE_PROCESSING?{...u,status:y.IDLE}:u;break;case d.SET_NO_ERROR:u=e.hasError?{...e,hasError:!1}:e;break;case d.INCREMENT_CALCULATING:u={...e,calculatingCount:e.calculatingCount+1};break;case d.DECREMENT_CALCULATING:u={...e,calculatingCount:Math.max(0,e.calculatingCount-1)};break;case d.SET_CUSTOMER_ID:u=void 0!==n?{...e,customerId:n}:e;break;case d.SET_ORDER_ID:u=void 0!==o?{...e,orderId:o}:e;break;case d.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS:void 0!==c&&c!==e.useShippingAsBilling&&(u={...e,useShippingAsBilling:c});break;case d.SET_SHOULD_CREATE_ACCOUNT:void 0!==i&&i!==e.shouldCreateAccount&&(u={...e,shouldCreateAccount:i});break;case d.SET_ORDER_NOTES:void 0!==s&&e.orderNotes!==s&&(u={...e,orderNotes:s});break;case d.SET_EXTENSION_DATA:void 0!==a&&e.extensionData!==a&&(u={...e,extensionData:a})}return u!==e&&r!==d.SET_PRISTINE&&u.status===y.PRISTINE&&(u.status=y.IDLE),u};var O=r(17),S=r(94),k=r(204);var w=r(206),j=r(199),R=r(59),C=r(30),T=r(80);const A=Object(n.createContext)({dispatchActions:{resetCheckout:()=>{},setRedirectUrl:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},incrementCalculating:()=>{},decrementCalculating:()=>{},setCustomerId:e=>{},setOrderId:e=>{},setOrderNotes:e=>{},setExtensionData:e=>{}},onSubmit:()=>{},isComplete:!1,isIdle:!1,isCalculating:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,redirectUrl:"",orderId:0,orderNotes:"",customerId:0,onCheckoutAfterProcessingWithSuccess:()=>()=>{},onCheckoutAfterProcessingWithError:()=>()=>{},onCheckoutBeforeProcessing:()=>()=>{},onCheckoutValidationBeforeProcessing:()=>()=>{},hasOrder:!1,isCart:!1,useShippingAsBilling:!1,setUseShippingAsBilling:e=>{},shouldCreateAccount:!1,setShouldCreateAccount:e=>{},extensionData:{}}),x=()=>Object(n.useContext)(A),P=e=>{let{children:t,redirectUrl:r,isCart:a=!1}=e;_.redirectUrl=r;const[b,g]=Object(n.useReducer)(v,_),{setValidationErrors:E}=Object(j.b)(),{createErrorNotice:x}=Object(u.useDispatch)("core/notices"),{dispatchCheckoutEvent:P}=Object(R.a)(),M=b.calculatingCount>0,{isSuccessResponse:N,isErrorResponse:I,isFailResponse:D,shouldRetry:L}=Object(C.d)(),{checkoutNotices:F,paymentNotices:V,expressPaymentNotices:B}=(()=>{const{noticeContexts:e}=Object(C.d)();return{checkoutNotices:Object(u.useSelect)(e=>e("core/notices").getNotices("wc/checkout"),[]),expressPaymentNotices:Object(u.useSelect)(t=>t("core/notices").getNotices(e.EXPRESS_PAYMENTS),[e.EXPRESS_PAYMENTS]),paymentNotices:Object(u.useSelect)(t=>t("core/notices").getNotices(e.PAYMENTS),[e.PAYMENTS])}})(),[U,H]=Object(n.useReducer)(S.b,{}),G=Object(n.useRef)(U),{onCheckoutAfterProcessingWithSuccess:Y,onCheckoutAfterProcessingWithError:z,onCheckoutValidationBeforeProcessing:q}=(e=>Object(n.useMemo)(()=>({onCheckoutAfterProcessingWithSuccess:Object(k.a)("checkout_after_processing_with_success",e),onCheckoutAfterProcessingWithError:Object(k.a)("checkout_after_processing_with_error",e),onCheckoutValidationBeforeProcessing:Object(k.a)("checkout_validation_before_processing",e)}),[e]))(H);Object(n.useEffect)(()=>{G.current=U},[U]);const W=Object(n.useMemo)(()=>function(){return c()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidationBeforeProcessing",plugin:"WooCommerce Blocks"}),q(...arguments)},[q]),$=Object(n.useMemo)(()=>({resetCheckout:()=>{g({type:d.SET_PRISTINE})},setRedirectUrl:e=>{g(m(e))},setHasError:e=>{g(h(e))},incrementCalculating:()=>{g({type:d.INCREMENT_CALCULATING})},decrementCalculating:()=>{g({type:d.DECREMENT_CALCULATING})},setCustomerId:e=>{var t;g((t=e,{type:d.SET_CUSTOMER_ID,customerId:t}))},setOrderId:e=>{g((e=>({type:d.SET_ORDER_ID,orderId:e}))(e))},setOrderNotes:e=>{g((e=>({type:d.SET_ORDER_NOTES,orderNotes:e}))(e))},setExtensionData:e=>{g((e=>({type:d.SET_EXTENSION_DATA,extensionData:e}))(e))},setAfterProcessing:e=>{const t=(e=>{const t={message:"",paymentStatus:"",redirectUrl:"",paymentDetails:{}};return"payment_result"in e&&(t.paymentStatus=e.payment_result.payment_status,t.redirectUrl=e.payment_result.redirect_url,e.payment_result.hasOwnProperty("payment_details")&&Array.isArray(e.payment_result.payment_details)&&e.payment_result.payment_details.forEach(e=>{let{key:r,value:n}=e;t.paymentDetails[r]=Object(O.decodeEntities)(n)})),"message"in e&&(t.message=Object(O.decodeEntities)(e.message)),!t.message&&"data"in e&&"status"in e.data&&e.data.status>299&&(t.message=Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")),t})(e);var r;g(m((null==t?void 0:t.redirectUrl)||"")),g((r=t,{type:d.SET_PROCESSING_RESPONSE,data:r})),g({type:d.SET_AFTER_PROCESSING})}}),[]);Object(n.useEffect)(()=>{b.status===y.BEFORE_PROCESSING&&(Object(T.b)("error"),Object(w.a)(G.current,"checkout_validation_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:r}=e;x(t,{context:"wc/checkout"}),E(r)}),g(p()),g(h())):g({type:d.SET_PROCESSING})}))},[b.status,E,x,g]);const X=Object(s.a)(b.status),K=Object(s.a)(b.hasError);Object(n.useEffect)(()=>{if((b.status!==X||b.hasError!==K)&&b.status===y.AFTER_PROCESSING){const e={redirectUrl:b.redirectUrl,orderId:b.orderId,customerId:b.customerId,orderNotes:b.orderNotes,processingResponse:b.processingResponse};b.hasError?Object(w.b)(G.current,"checkout_after_processing_with_error",e).then(t=>{const r=(e=>{let t=null;return e.forEach(e=>{if((I(e)||D(e))&&e.message&&Object(i.a)(e.message)){const r=e.messageContext&&Object(i.a)(e.messageContent)?{context:e.messageContext}:void 0;t=e,x(e.message,r)}}),t})(t);if(null!==r)L(r)?g(p()):g(f(r));else{if(!(F.some(e=>"error"===e.status)||B.some(e=>"error"===e.status)||V.some(e=>"error"===e.status))){var n;const t=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");x(t,{id:"checkout",context:"wc/checkout"})}g(p())}}):Object(w.b)(G.current,"checkout_after_processing_with_success",e).then(e=>{let t=null,r=null;if(e.forEach(e=>{N(e)&&(t=e),(I(e)||D(e))&&(r=e)}),t&&!r)g(f(t));else if(Object(l.a)(r)){if(r.message&&Object(i.a)(r.message)){const e=r.messageContext&&Object(i.a)(r.messageContext)?{context:r.messageContext}:void 0;x(r.message,e)}L(r)?g(h(!0)):g(f(r))}else g(f())})}},[b.status,b.hasError,b.redirectUrl,b.orderId,b.customerId,b.orderNotes,b.processingResponse,X,K,$,x,I,D,N,L,F,B,V]);const J={onSubmit:Object(n.useCallback)(()=>{P("submit"),g({type:d.SET_BEFORE_PROCESSING})},[P]),isComplete:b.status===y.COMPLETE,isIdle:b.status===y.IDLE,isCalculating:M,isProcessing:b.status===y.PROCESSING,isBeforeProcessing:b.status===y.BEFORE_PROCESSING,isAfterProcessing:b.status===y.AFTER_PROCESSING,hasError:b.hasError,redirectUrl:b.redirectUrl,onCheckoutBeforeProcessing:W,onCheckoutValidationBeforeProcessing:q,onCheckoutAfterProcessingWithSuccess:Y,onCheckoutAfterProcessingWithError:z,dispatchActions:$,isCart:a,orderId:b.orderId,hasOrder:!!b.orderId,customerId:b.customerId,orderNotes:b.orderNotes,useShippingAsBilling:b.useShippingAsBilling,setUseShippingAsBilling:e=>{return g((t=e,{type:d.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS,useShippingAsBilling:t}));var t},shouldCreateAccount:b.shouldCreateAccount,setShouldCreateAccount:e=>{return g((t=e,{type:d.SET_SHOULD_CREATE_ACCOUNT,shouldCreateAccount:t}));var t},extensionData:b.extensionData};return Object(n.createElement)(A.Provider,{value:J},t)}},function(e,t){e.exports=window.wp.warning},function(e,t,r){"use strict";var n=r(8),o=r(0),s=r(13),a=function({icon:e,className:t,...r}){const s=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(o.createElement)("span",Object(n.a)({className:s},r))};t.a=function({icon:e=null,size:t=24,...r}){if("string"==typeof e)return Object(o.createElement)(a,Object(n.a)({icon:e},r));if(Object(o.isValidElement)(e)&&a===e.type)return Object(o.cloneElement)(e,{...r});if("function"==typeof e)return e.prototype instanceof o.Component?Object(o.createElement)(e,{size:t,...r}):e({size:t,...r});if(e&&("svg"===e.type||e.type===s.SVG)){const n={width:t,height:t,...e.props,...r};return Object(o.createElement)(s.SVG,n)}return Object(o.isValidElement)(e)?Object(o.cloneElement)(e,{size:t,...r}):e}},,,function(e,t){e.exports=window.wc.priceFormat},function(e,t,r){"use strict";var n=r(8),o=r(0),s=r(4),a=r.n(s),c=r(3),i=r(25),l=r.n(i),u=r(9),d=r(44),p=r(71),m=r(1);function f(e,t,r){const{defaultView:n}=t,{frameElement:o}=n;if(!o||t===r.ownerDocument)return e;const s=o.getBoundingClientRect();return new n.DOMRect(e.left+s.left,e.top+s.top,e.width,e.height)}let h=0;function b(e){const t=document.scrollingElement||document.body;e&&(h=t.scrollTop);const r=e?"add":"remove";t.classList[r]("lockscroll"),document.documentElement.classList[r]("lockscroll"),e||(t.scrollTop=h)}let g=0;function y(){return Object(o.useEffect)(()=>(0===g&&b(!0),++g,()=>{1===g&&b(!1),--g}),[]),null}var E=r(24);function _(e){const t=Object(o.useContext)(E.a),r=t.slots[e]||{},n=t.fills[e],s=Object(o.useMemo)(()=>n||[],[n]);return{...r,updateSlot:Object(o.useCallback)(r=>{t.updateSlot(e,r)},[e,t.updateSlot]),unregisterSlot:Object(o.useCallback)(r=>{t.unregisterSlot(e,r)},[e,t.unregisterSlot]),fills:s,registerFill:Object(o.useCallback)(r=>{t.registerFill(e,r)},[e,t.registerFill]),unregisterFill:Object(o.useCallback)(r=>{t.unregisterFill(e,r)},[e,t.unregisterFill])}}var v=Object(o.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function O({name:e,children:t,registerFill:r,unregisterFill:n}){const s=(e=>{const{getSlot:t,subscribe:r}=Object(o.useContext)(v),[n,s]=Object(o.useState)(t(e));return Object(o.useEffect)(()=>(s(t(e)),r(()=>{s(t(e))})),[e]),n})(e),a=Object(o.useRef)({name:e,children:t});return Object(o.useLayoutEffect)(()=>(r(e,a.current),()=>n(e,a.current)),[]),Object(o.useLayoutEffect)(()=>{a.current.children=t,s&&s.forceUpdate()},[t]),Object(o.useLayoutEffect)(()=>{e!==a.current.name&&(n(a.current.name,a.current),a.current.name=e,r(e,a.current))},[e]),s&&s.node?(Object(c.isFunction)(t)&&(t=t(s.props.fillProps)),Object(o.createPortal)(t,s.node)):null}var S=e=>Object(o.createElement)(v.Consumer,null,({registerFill:t,unregisterFill:r})=>Object(o.createElement)(O,Object(n.a)({},e,{registerFill:t,unregisterFill:r})));class k extends o.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:r,registerSlot:n}=this.props;e.name!==t&&(r(e.name),n(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:r={},getFills:n}=this.props,s=Object(c.map)(n(t,this),e=>{const t=Object(c.isFunction)(e.children)?e.children(r):e.children;return o.Children.map(t,(e,t)=>{if(!e||Object(c.isString)(e))return e;const r=e.key||t;return Object(o.cloneElement)(e,{key:r})})}).filter(Object(c.negate)(o.isEmptyElement));return Object(o.createElement)(o.Fragment,null,Object(c.isFunction)(e)?e(s):s)}}var w=e=>Object(o.createElement)(v.Consumer,null,({registerSlot:t,unregisterSlot:r,getFills:s})=>Object(o.createElement)(k,Object(n.a)({},e,{registerSlot:t,unregisterSlot:r,getFills:s})));function j(){const[,e]=Object(o.useState)({}),t=Object(o.useRef)(!0);return Object(o.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function R({name:e,children:t}){const r=_(e),n=Object(o.useRef)({rerender:j()});return Object(o.useEffect)(()=>(r.registerFill(n),()=>{r.unregisterFill(n)}),[r.registerFill,r.unregisterFill]),r.ref&&r.ref.current?("function"==typeof t&&(t=t(r.fillProps)),Object(o.createPortal)(t,r.ref.current)):null}var C=Object(o.forwardRef)((function({name:e,fillProps:t={},as:r="div",...s},a){const c=Object(o.useContext)(E.a),i=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(c.registerSlot(e,i,t),()=>{c.unregisterSlot(e,i)}),[c.registerSlot,c.unregisterSlot,e]),Object(o.useLayoutEffect)(()=>{c.updateSlot(e,t)}),Object(o.createElement)(r,Object(n.a)({ref:Object(u.useMergeRefs)([a,i])},s))}));function T(e){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(S,e),Object(o.createElement)(R,e))}r(11),o.Component;const A=Object(o.forwardRef)(({bubblesVirtually:e,...t},r)=>e?Object(o.createElement)(C,Object(n.a)({},t,{ref:r})):Object(o.createElement)(w,t));function x(e){return"appear"===e?"top":"left"}function P(e,t){const{paddingTop:r,paddingBottom:n,paddingLeft:o,paddingRight:s}=(a=t).ownerDocument.defaultView.getComputedStyle(a);var a;const c=r?parseInt(r,10):0,i=n?parseInt(n,10):0,l=o?parseInt(o,10):0,u=s?parseInt(s,10):0;return{x:e.left+l,y:e.top+c,width:e.width-l-u,height:e.height-c-i,left:e.left+l,right:e.right-u,top:e.top+c,bottom:e.bottom-i}}function M(e,t,r){r?e.getAttribute(t)!==r&&e.setAttribute(t,r):e.hasAttribute(t)&&e.removeAttribute(t)}function N(e,t,r=""){e.style[t]!==r&&(e.style[t]=r)}function I(e,t,r){r?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const D=Object(o.forwardRef)(({headerTitle:e,onClose:t,children:r,className:s,noArrow:c=!0,isAlternate:i,position:h="bottom right",range:b,focusOnMount:g="firstElement",anchorRef:E,shouldAnchorIncludePadding:v,anchorRect:O,getAnchorRect:S,expandOnMobile:k,animate:w=!0,onClickOutside:j,onFocusOutside:R,__unstableStickyBoundaryElement:C,__unstableSlotName:A="Popover",__unstableObserveElement:D,__unstableBoundaryParent:L,__unstableForcePosition:F,__unstableForceXAlignment:V,...B},U)=>{const H=Object(o.useRef)(null),G=Object(o.useRef)(null),Y=Object(o.useRef)(),z=Object(u.useViewportMatch)("medium","<"),[q,$]=Object(o.useState)(),X=_(A),K=k&&z,[J,Q]=Object(u.useResizeObserver)();c=K||c,Object(o.useLayoutEffect)(()=>{if(K)return I(Y.current,"is-without-arrow",c),I(Y.current,"is-alternate",i),M(Y.current,"data-x-axis"),M(Y.current,"data-y-axis"),N(Y.current,"top"),N(Y.current,"left"),N(G.current,"maxHeight"),void N(G.current,"maxWidth");const e=()=>{if(!Y.current||!G.current)return;let e=function(e,t,r,n=!1,o,s){if(t)return t;if(r){if(!e.current)return;const t=r(e.current);return f(t,t.ownerDocument||e.current.ownerDocument,s)}if(!1!==n){if(!(n&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==n?void 0:n.cloneRange))return f(Object(d.getRectangleFromRange)(n),n.endContainer.ownerDocument,s);if("function"==typeof(null==n?void 0:n.getBoundingClientRect)){const e=f(n.getBoundingClientRect(),n.ownerDocument,s);return o?e:P(e,n)}const{top:e,bottom:t}=n,r=e.getBoundingClientRect(),a=t.getBoundingClientRect(),c=f(new window.DOMRect(r.left,r.top,r.width,a.bottom-r.top),e.ownerDocument,s);return o?c:P(c,n)}if(!e.current)return;const{parentNode:a}=e.current,c=a.getBoundingClientRect();return o?c:P(c,a)}(H,O,S,E,v,Y.current);if(!e)return;const{offsetParent:t,ownerDocument:r}=Y.current;let n,o=0;if(t&&t!==r.body){const r=t.getBoundingClientRect();o=r.top,e=new window.DOMRect(e.left-r.left,e.top-r.top,e.width,e.height)}var s;L&&(n=null===(s=Y.current.closest(".popover-slot"))||void 0===s?void 0:s.parentNode);const a=Q.height?Q:G.current.getBoundingClientRect(),{popoverTop:l,popoverLeft:u,xAxis:p,yAxis:b,contentHeight:g,contentWidth:y}=function(e,t,r="top",n,o,s,a,c,i){const[l,u="center",d]=r.split(" "),p=function(e,t,r,n,o,s,a,c){const{height:i}=t;if(o){const t=o.getBoundingClientRect().top+i-a;if(e.top<=t)return{yAxis:r,popoverTop:Math.min(e.bottom,t)}}let l=e.top+e.height/2;"bottom"===n?l=e.bottom:"top"===n&&(l=e.top);const u={popoverTop:l,contentHeight:(l-i/2>0?i/2:l)+(l+i/2>window.innerHeight?window.innerHeight-l:i/2)},d={popoverTop:e.top,contentHeight:e.top-10-i>0?i:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+i>window.innerHeight?window.innerHeight-10-e.bottom:i};let m,f=r,h=null;if(!o&&!c)if("middle"===r&&u.contentHeight===i)f="middle";else if("top"===r&&d.contentHeight===i)f="top";else if("bottom"===r&&p.contentHeight===i)f="bottom";else{f=d.contentHeight>p.contentHeight?"top":"bottom";const e="top"===f?d.contentHeight:p.contentHeight;h=e!==i?e:null}return m="middle"===f?u.popoverTop:"top"===f?d.popoverTop:p.popoverTop,{yAxis:f,popoverTop:m,contentHeight:h}}(e,t,l,d,n,0,s,c);return{...function(e,t,r,n,o,s,a,c,i){const{width:l}=t;"left"===r&&Object(m.isRTL)()?r="right":"right"===r&&Object(m.isRTL)()&&(r="left"),"left"===n&&Object(m.isRTL)()?n="right":"right"===n&&Object(m.isRTL)()&&(n="left");const u=Math.round(e.left+e.width/2),d={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)};let p=e.left;"right"===n?p=e.right:"middle"===s||i||(p=u);let f=e.right;"left"===n?f=e.left:"middle"===s||i||(f=u);const h={popoverLeft:p,contentWidth:p-l>0?l:p},b={popoverLeft:f,contentWidth:f+l>window.innerWidth?window.innerWidth-f:l};let g,y=r,E=null;if(!o&&!c)if("center"===r&&d.contentWidth===l)y="center";else if("left"===r&&h.contentWidth===l)y="left";else if("right"===r&&b.contentWidth===l)y="right";else{y=h.contentWidth>b.contentWidth?"left":"right";const e="left"===y?h.contentWidth:b.contentWidth;l>window.innerWidth&&(E=window.innerWidth),e!==l&&(y="center",d.popoverLeft=window.innerWidth/2)}if(g="center"===y?d.popoverLeft:"left"===y?h.popoverLeft:b.popoverLeft,a){const e=a.getBoundingClientRect();g=Math.min(g,e.right-l),Object(m.isRTL)()||(g=Math.max(g,0))}return{xAxis:y,popoverLeft:g,contentWidth:E}}(e,t,u,d,n,p.yAxis,a,c,i),...p}}(e,a,h,C,Y.current,o,n,F,V);"number"==typeof l&&"number"==typeof u&&(N(Y.current,"top",l+"px"),N(Y.current,"left",u+"px")),I(Y.current,"is-without-arrow",c||"center"===p&&"middle"===b),I(Y.current,"is-alternate",i),M(Y.current,"data-x-axis",p),M(Y.current,"data-y-axis",b),N(G.current,"maxHeight","number"==typeof g?g+"px":""),N(G.current,"maxWidth","number"==typeof y?y+"px":""),$(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))};e();const{ownerDocument:t}=Y.current,{defaultView:r}=t,n=r.setInterval(e,500);let o;const s=()=>{r.cancelAnimationFrame(o),o=r.requestAnimationFrame(e)};r.addEventListener("click",s),r.addEventListener("resize",e),r.addEventListener("scroll",e,!0);const a=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(E);let l;return a&&a!==t&&(a.defaultView.addEventListener("resize",e),a.defaultView.addEventListener("scroll",e,!0)),D&&(l=new r.MutationObserver(e),l.observe(D,{attributes:!0})),()=>{r.clearInterval(n),r.removeEventListener("resize",e),r.removeEventListener("scroll",e,!0),r.removeEventListener("click",s),r.cancelAnimationFrame(o),a&&a!==t&&(a.defaultView.removeEventListener("resize",e),a.defaultView.removeEventListener("scroll",e,!0)),l&&l.disconnect()}},[K,O,S,E,v,h,Q,C,D,L]);const Z=(e,r)=>{if("focus-outside"===e&&R)R(r);else if("focus-outside"===e&&j){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>r.relatedTarget}),l()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),j(e)}else t&&t()},[ee,te]=Object(u.__experimentalUseDialog)({focusOnMount:g,__unstableOnClose:Z,onClose:Z}),re=Object(u.useMergeRefs)([Y,ee,U]),ne=Boolean(w&&q)&&function(e){if("loading"===e.type)return a()("components-animate__loading");const{type:t,origin:r=x(t)}=e;if("appear"===t){const[e,t="center"]=r.split(" ");return a()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?a()("components-animate__slide-in","is-from-"+r):void 0}({type:"appear",origin:q});let oe=Object(o.createElement)("div",Object(n.a)({className:a()("components-popover",s,ne,{"is-expanded":K,"is-without-arrow":c,"is-alternate":i})},B,{ref:re},te,{tabIndex:"-1"}),K&&Object(o.createElement)(y,null),K&&Object(o.createElement)("div",{className:"components-popover__header"},Object(o.createElement)("span",{className:"components-popover__header-title"},e),Object(o.createElement)(W,{className:"components-popover__close",icon:p.a,onClick:t})),Object(o.createElement)("div",{ref:G,className:"components-popover__content"},Object(o.createElement)("div",{style:{position:"relative"}},J,r)));return X.ref&&(oe=Object(o.createElement)(T,{name:A},oe)),E||O?oe:Object(o.createElement)("span",{ref:H},oe)});D.Slot=Object(o.forwardRef)((function({name:e="Popover"},t){return Object(o.createElement)(A,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var L=D,F=function({shortcut:e,className:t}){if(!e)return null;let r,n;return Object(c.isString)(e)&&(r=e),Object(c.isObject)(e)&&(r=e.display,n=e.ariaLabel),Object(o.createElement)("span",{className:t,"aria-label":n},r)};const V=Object(o.createElement)("div",{className:"event-catcher"}),B=({eventHandlers:e,child:t,childrenWithPopover:r})=>Object(o.cloneElement)(Object(o.createElement)("span",{className:"disabled-element-wrapper"},Object(o.cloneElement)(V,e),Object(o.cloneElement)(t,{children:r}),","),e),U=({child:e,eventHandlers:t,childrenWithPopover:r})=>Object(o.cloneElement)(e,{...t,children:r}),H=(e,t,r)=>{if(1!==o.Children.count(e))return;const n=o.Children.only(e);"function"==typeof n.props[t]&&n.props[t](r)};var G=function({children:e,position:t,text:r,shortcut:n}){const[s,a]=Object(o.useState)(!1),[i,l]=Object(o.useState)(!1),d=Object(u.useDebounce)(l,700),p=t=>{H(e,"onMouseDown",t),document.addEventListener("mouseup",h),a(!0)},m=t=>{H(e,"onMouseUp",t),document.removeEventListener("mouseup",h),a(!1)},f=e=>"mouseUp"===e?m:"mouseDown"===e?p:void 0,h=f("mouseUp"),b=(t,r)=>n=>{if(H(e,t,n),n.currentTarget.disabled)return;if("focus"===n.type&&s)return;d.cancel();const o=Object(c.includes)(["focus","mouseenter"],n.type);o!==i&&(r?d(o):l(o))},g=()=>{d.cancel(),document.removeEventListener("mouseup",h)};if(Object(o.useEffect)(()=>g,[]),1!==o.Children.count(e))return e;const y={onMouseEnter:b("onMouseEnter",!0),onMouseLeave:b("onMouseLeave"),onClick:b("onClick"),onFocus:b("onFocus"),onBlur:b("onBlur"),onMouseDown:f("mouseDown")},E=o.Children.only(e),{children:_,disabled:v}=E.props;return(v?B:U)({child:E,eventHandlers:y,childrenWithPopover:(({grandchildren:e,isOver:t,position:r,text:n,shortcut:s})=>Object(o.concatChildren)(e,t&&Object(o.createElement)(L,{focusOnMount:!1,position:r,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},n,Object(o.createElement)(F,{className:"components-tooltip__shortcut",shortcut:s}))))({grandchildren:_,isOver:i,position:t,text:r,shortcut:n})})},Y=r(38),z=r(34);const q=["onMouseDown","onClick"];var W=t.a=Object(o.forwardRef)((function(e,t){const{href:r,target:s,isSmall:i,isPressed:u,isBusy:d,isDestructive:p,className:m,disabled:f,icon:h,iconPosition:b="left",iconSize:g,showTooltip:y,tooltipPosition:E,shortcut:_,label:v,children:O,text:S,variant:k,__experimentalIsFocusable:w,describedBy:j,...R}=function({isDefault:e,isPrimary:t,isSecondary:r,isTertiary:n,isLink:o,variant:s,...a}){let c=s;var i,u,d,p,m;return t&&(null!==(i=c)&&void 0!==i||(c="primary")),n&&(null!==(u=c)&&void 0!==u||(c="tertiary")),r&&(null!==(d=c)&&void 0!==d||(c="secondary")),e&&(l()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(p=c)&&void 0!==p||(c="secondary")),o&&(null!==(m=c)&&void 0!==m||(c="link")),{...a,variant:c}}(e),C=a()("components-button",m,{"is-secondary":"secondary"===k,"is-primary":"primary"===k,"is-small":i,"is-tertiary":"tertiary"===k,"is-pressed":u,"is-busy":d,"is-link":"link"===k,"is-destructive":p,"has-text":!!h&&!!O,"has-icon":!!h}),T=f&&!w,A=void 0===r||T?"button":"a",x="a"===A?{href:r,target:s}:{type:"button",disabled:T,"aria-pressed":u};if(f&&w){x["aria-disabled"]=!0;for(const e of q)R[e]=e=>{e.stopPropagation(),e.preventDefault()}}const P=!T&&(y&&v||_||!!v&&(!O||Object(c.isArray)(O)&&!O.length)&&!1!==y),M=j?Object(c.uniqueId)():null,N=R["aria-describedby"]||M,I=Object(o.createElement)(A,Object(n.a)({},x,R,{className:C,"aria-label":R["aria-label"]||v,"aria-describedby":N,ref:t}),h&&"left"===b&&Object(o.createElement)(Y.a,{icon:h,size:g}),S&&Object(o.createElement)(o.Fragment,null,S),h&&"right"===b&&Object(o.createElement)(Y.a,{icon:h,size:g}),O);return P?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(G,{text:j||v,shortcut:_,position:E},I),j&&Object(o.createElement)(z.a,null,Object(o.createElement)("span",{id:M},j))):Object(o.createElement)(o.Fragment,null,I,j&&Object(o.createElement)(z.a,null,Object(o.createElement)("span",{id:M},j)))}))},function(e,t){e.exports=window.wp.hooks},function(e,t){e.exports=window.wp.dom},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"string"==typeof e},,,function(e,t,r){"use strict";r.d(t,"n",(function(){return s})),r.d(t,"l",(function(){return a})),r.d(t,"k",(function(){return c})),r.d(t,"m",(function(){return i})),r.d(t,"i",(function(){return l})),r.d(t,"d",(function(){return u})),r.d(t,"f",(function(){return d})),r.d(t,"j",(function(){return p})),r.d(t,"c",(function(){return m})),r.d(t,"e",(function(){return f})),r.d(t,"g",(function(){return h})),r.d(t,"a",(function(){return b})),r.d(t,"h",(function(){return g})),r.d(t,"b",(function(){return y}));var n,o=r(2);const s=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=s.pluginUrl+"images/",c=s.pluginUrl+"build/",i=s.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),m=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),f=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),h=Object(o.getSetting)("shippingCountries",{}),b=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),y=Object(o.getSetting)("allowedStates",{})},function(e,t,r){"use strict";var n=r(2),o=r(1),s=r(72),a=r(45);const c=Object(n.getSetting)("countryLocale",{}),i=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(o.sprintf)( +/* translators: %s Field label. */ +Object(o.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(s.a)(e.priority)&&(t.index=e.priority),Object(a.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},l=Object.entries(c).map(e=>{let[t,r]=e;return[t,Object.entries(r).map(e=>{let[t,r]=e;return[t,i(r)]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{})]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{});t.a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=r&&void 0!==l[r]?l[r]:{};return e.map(e=>({key:e,...n.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return c}));var n=r(0),o=r(67);const s=Object(n.createContext)({isInitialized:!1,billingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},setBillingAddress:()=>{},setShippingAddress:()=>{}}),a=()=>Object(n.useContext)(s),c=e=>{let{children:t}=e;const r=Object(o.a)();return Object(n.createElement)(s.Provider,{value:r},t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(5);function o(e,t,r){var o=this,s=Object(n.useRef)(null),a=Object(n.useRef)(0),c=Object(n.useRef)(null),i=Object(n.useRef)([]),l=Object(n.useRef)(),u=Object(n.useRef)(),d=Object(n.useRef)(e),p=Object(n.useRef)(!0);d.current=e;var m=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var f=!!(r=r||{}).leading,h=!("trailing"in r)||!!r.trailing,b="maxWait"in r,g=b?Math.max(+r.maxWait||0,t):null;return Object(n.useEffect)((function(){return p.current=!0,function(){p.current=!1}}),[]),Object(n.useMemo)((function(){var e=function(e){var t=i.current,r=l.current;return i.current=l.current=null,a.current=e,u.current=d.current.apply(r,t)},r=function(e,t){m&&cancelAnimationFrame(c.current),c.current=m?requestAnimationFrame(e):setTimeout(e,t)},n=function(e){if(!p.current)return!1;var r=e-s.current,n=e-a.current;return!s.current||r>=t||r<0||b&&n>=g},y=function(t){return c.current=null,h&&i.current?e(t):(i.current=l.current=null,u.current)},E=function(){var e=Date.now();if(n(e))return y(e);if(p.current){var o=e-s.current,c=e-a.current,i=t-o,l=b?Math.min(i,g-c):i;r(E,l)}},_=function(){for(var d=[],m=0;m{let{Block:t,containers:r,getProps:n=(()=>({})),getErrorBoundaryProps:c=(()=>({}))}=e;0!==r.length&&Array.prototype.forEach.call(r,(e,r)=>{const i=n(e,r),l=c(e,r),u={...e.dataset,...i.attributes||{}};(e=>{let{Block:t,container:r,attributes:n={},props:c={},errorBoundaryProps:i={}}=e;Object(s.render)(Object(s.createElement)(a.a,i,Object(s.createElement)(s.Suspense,{fallback:Object(s.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(s.createElement)(t,o()({},c,{attributes:n})))),r,()=>{r.classList&&r.classList.remove("is-loading")})})({Block:t,container:e,props:i,attributes:u,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(c.join(",")),{Block:r,getProps:n,getErrorBoundaryProps:o,selector:s}=e;(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrappers:s}=e;const a=document.body.querySelectorAll(o);s&&s.length>0&&Array.prototype.filter.call(a,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,s)),i({Block:t,containers:a,getProps:r,getErrorBoundaryProps:n})})({Block:r,getProps:n,getErrorBoundaryProps:o,selector:s,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrapper:s}=e;const a=s.querySelectorAll(o);i({Block:t,containers:a,getProps:r,getErrorBoundaryProps:n})})({...e,wrapper:t})})})}},function(e,t){e.exports=window.wp.keycodes},,function(e,t){var r,n,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(e){if(r===setTimeout)return setTimeout(e,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(e){r=s}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var i,l=[],u=!1,d=-1;function p(){u&&i&&(u=!1,i.length?l=i.concat(l):d=-1,l.length&&m())}function m(){if(!u){var e=c(p);u=!0;for(var t=l.length;t;){for(i=l,l=[];++d1)for(var r=1;r=16;e.exports={PRESERVE_CUSTOM_ATTRIBUTES:a,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var r,n,o="function"==typeof t,s={},a={};for(r in e)n=e[r],o&&(s=t(r,n))&&2===s.length?a[s[0]]=s[1]:"string"==typeof n&&(a[n]=r);return a},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){null!=e&&(t.style=o(e,s))}}},function(e,t,r){for(var n,o=r(93).CASE_SENSITIVE_TAG_NAMES,s={},a=0,c=o.length;a{const e=Object(s.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...r,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return a}));var n=r(0);const o=Object(n.createContext)({setIsSuppressed:e=>{},isSuppressed:!1}),s=()=>Object(n.useContext)(o),a=e=>{let{children:t}=e;const[r,s]=Object(n.useState)(!1),a={setIsSuppressed:s,isSuppressed:r};return Object(n.createElement)(o.Provider,{value:a},t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(5);function o(e,t){const r=Object(n.useRef)();return Object(n.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},function(e,t,r){var n=r(82),o=r(56),s=r(91),a={decodeEntities:!0,lowerCaseAttributeNames:!1};function c(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return""===e?[]:n(s(e,(t=t||{}).htmlparser2||a),t)}c.domToReact=n,c.htmlToDOM=s,c.attributesToProps=o,e.exports=c,e.exports.default=c},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return b}));var n=r(6),o=r(7),s=r(0),a=r(11),c=r.n(a),i=r(18),l=r(1),u=r(48),d=r(2);const p=[{destination:{address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},package_id:0,name:Object(l.__)("Shipping","woo-gutenberg-products-block"),items:[{key:"33e75ff09dd601bbe69f351039152189",name:Object(l._x)("Beanie with Logo","example product in Cart Block","woo-gutenberg-products-block"),quantity:2},{key:"6512bd43d9caa6e02c990b0a82652dca",name:Object(l._x)("Beanie","example product in Cart Block","woo-gutenberg-products-block"),quantity:1}],shipping_rates:[{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(l.__)("Free shipping","woo-gutenberg-products-block"),description:"",delivery_time:"",price:"000",taxes:"0",rate_id:"free_shipping:1",instance_id:0,meta_data:[],method_id:"flat_rate",selected:!0},{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(l.__)("Local pickup","woo-gutenberg-products-block"),description:"",delivery_time:"",price:"200",taxes:"0",rate_id:"local_pickup:1",instance_id:1,meta_data:[],method_id:"local_pickup",selected:!1}]}],m=Object(d.getSetting)("displayCartPricesIncludingTax",!1),f={coupons:[],shipping_rates:Object(d.getSetting)("shippingMethodsExist",!1)?p:[],items:[{key:"1",id:1,quantity:2,name:Object(l.__)("Beanie","woo-gutenberg-products-block"),short_description:Object(l.__)("Warm hat for winter","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-beanie",permalink:"https://example.org",low_stock_remaining:2,backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:10,src:u.l+"previews/beanie.jpg",thumbnail:u.l+"previews/beanie.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(l.__)("Color","woo-gutenberg-products-block"),value:Object(l.__)("Yellow","woo-gutenberg-products-block")},{attribute:Object(l.__)("Size","woo-gutenberg-products-block"),value:Object(l.__)("Small","woo-gutenberg-products-block")}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:m?"12000":"10000",regular_price:m?"12000":"10000",sale_price:m?"12000":"10000",raw_prices:{precision:6,price:m?"12000000":"10000000",regular_price:m?"12000000":"10000000",sale_price:m?"12000000":"10000000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:"2000",line_subtotal_tax:"400",line_total:"2000",line_total_tax:"400"},extensions:{}},{key:"2",id:2,quantity:1,name:Object(l.__)("Cap","woo-gutenberg-products-block"),short_description:Object(l.__)("Lightweight baseball cap","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-cap",permalink:"https://example.org",backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:11,src:u.l+"previews/cap.jpg",thumbnail:u.l+"previews/cap.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(l.__)("Color","woo-gutenberg-products-block"),value:Object(l.__)("Orange","woo-gutenberg-products-block")}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:m?"2400":"2000",regular_price:m?"2400":"2000",sale_price:m?"2400":"2000",raw_prices:{precision:6,price:m?"24000000":"20000000",regular_price:m?"24000000":"20000000",sale_price:m?"24000000":"20000000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:"2000",line_subtotal_tax:"400",line_total:"2000",line_total_tax:"400"},extensions:{}}],fees:[{id:"fee",name:Object(l.__)("Fee","woo-gutenberg-products-block"),totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total:"100",total_tax:"20",tax_lines:[{name:Object(l.__)("Sales tax","woo-gutenberg-products-block"),rate:"20%",price:"20"}]}}],items_count:3,items_weight:0,needs_payment:!0,needs_shipping:Object(d.getSetting)("shippingEnabled",!0),has_calculated_shipping:!0,shipping_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},billing_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total_items:"4000",total_items_tax:"800",total_fees:"100",total_fees_tax:"20",total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_tax:"820",total_price:"4920",tax_lines:[{name:Object(l.__)("Sales tax","woo-gutenberg-products-block"),rate:"20%",price:"820"}]},errors:[],payment_requirements:["products"],extensions:{}};var h=r(69);const b=()=>{const{shippingRates:e,needsShipping:t,hasCalculatedShipping:r,isLoadingRates:a}=Object(o.useSelect)(e=>{const t=!!e("core/editor"),r=e(n.CART_STORE_KEY);return{shippingRates:t?f.shipping_rates:r.getShippingRates(),needsShipping:t?f.needs_shipping:r.getNeedsShipping(),hasCalculatedShipping:t?f.has_calculated_shipping:r.getHasCalculatedShipping(),isLoadingRates:!t&&r.isCustomerDataUpdating()}}),{isSelectingRate:l,selectShippingRate:u}=Object(h.a)(),d=Object(s.useRef)({});return Object(s.useEffect)(()=>{const t=(e=>Object.fromEntries(e.map(e=>{var t;let{package_id:r,shipping_rates:n}=e;return[r,null===(t=n.find(e=>e.selected))||void 0===t?void 0:t.rate_id]})))(e);Object(i.a)(t)&&!c()(d.current,t)&&(d.current=t)},[e]),{isSelectingRate:l,selectedRates:d.current,selectShippingRate:u,shippingRates:e,needsShipping:t,hasCalculatedShipping:r,isLoadingRates:a}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(7),o=r(6);const s=()=>{const{customerData:e,isInitialized:t}=Object(n.useSelect)(e=>{const t=e(o.CART_STORE_KEY);return{customerData:t.getCustomerData(),isInitialized:t.hasFinishedResolution("getCartData")}}),{setShippingAddress:r,setBillingAddress:s}=Object(n.useDispatch)(o.CART_STORE_KEY);return{isInitialized:t,billingAddress:e.billingAddress,shippingAddress:e.shippingAddress,setBillingAddress:s,setShippingAddress:r}}},function(e,t,r){"use strict";r.d(t,"b",(function(){return _})),r.d(t,"a",(function(){return v}));var n=r(0);const o={NONE:"none",INVALID_ADDRESS:"invalid_address",UNKNOWN:"unknown_error"},s={INVALID_COUNTRY:"woocommerce_rest_cart_shipping_rates_invalid_country",MISSING_COUNTRY:"woocommerce_rest_cart_shipping_rates_missing_country",INVALID_STATE:"woocommerce_rest_cart_shipping_rates_invalid_state"},a={shippingErrorStatus:{isPristine:!0,isValid:!1,hasInvalidAddress:!1,hasError:!1},dispatchErrorStatus:()=>null,shippingErrorTypes:o,shippingRates:[],isLoadingRates:!1,selectedRates:[],setSelectedRates:()=>null,shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},setShippingAddress:()=>null,onShippingRateSuccess:()=>null,onShippingRateFail:()=>null,onShippingRateSelectSuccess:()=>null,onShippingRateSelectFail:()=>null,needsShipping:!1},c=(e,t)=>{let{type:r}=t;return Object.values(o).includes(r)?r:e};var i=r(94),l=r(204);const u=e=>({onSuccess:Object(l.a)("shipping_rates_success",e),onFail:Object(l.a)("shipping_rates_fail",e),onSelectSuccess:Object(l.a)("shipping_rate_select_success",e),onSelectFail:Object(l.a)("shipping_rate_select_fail",e)});var d=r(206),p=r(36),m=r(32),f=r(69),h=r(66);const{NONE:b,INVALID_ADDRESS:g,UNKNOWN:y}=o,E=Object(n.createContext)(a),_=()=>Object(n.useContext)(E),v=e=>{let{children:t}=e;const{dispatchActions:r}=Object(p.b)(),{shippingRates:a,isLoadingRates:l,cartErrors:_}=Object(m.a)(),{isSelectingRate:v}=Object(f.a)(),{selectedRates:O}=Object(h.a)(),[S,k]=Object(n.useReducer)(c,b),[w,j]=Object(n.useReducer)(i.b,{}),R=Object(n.useRef)(w),C=Object(n.useMemo)(()=>({onShippingRateSuccess:u(j).onSuccess,onShippingRateFail:u(j).onFail,onShippingRateSelectSuccess:u(j).onSelectSuccess,onShippingRateSelectFail:u(j).onSelectFail}),[j]);Object(n.useEffect)(()=>{R.current=w},[w]),Object(n.useEffect)(()=>{l?r.incrementCalculating():r.decrementCalculating()},[l,r]),Object(n.useEffect)(()=>{v?r.incrementCalculating():r.decrementCalculating()},[v,r]),Object(n.useEffect)(()=>{_.length>0&&_.some(e=>!(!e.code||!Object.values(s).includes(e.code)))?k({type:g}):k({type:b})},[_]);const T=Object(n.useMemo)(()=>({isPristine:S===b,isValid:S===b,hasInvalidAddress:S===g,hasError:S===y||S===g}),[S]);Object(n.useEffect)(()=>{l||0!==a.length&&!T.hasError||Object(d.a)(R.current,"shipping_rates_fail",{hasInvalidAddress:T.hasInvalidAddress,hasError:T.hasError})},[a,l,T.hasError,T.hasInvalidAddress]),Object(n.useEffect)(()=>{!l&&a.length>0&&!T.hasError&&Object(d.a)(R.current,"shipping_rates_success",a)},[a,l,T.hasError]),Object(n.useEffect)(()=>{v||(T.hasError?Object(d.a)(R.current,"shipping_rate_select_fail",{hasError:T.hasError,hasInvalidAddress:T.hasInvalidAddress}):Object(d.a)(R.current,"shipping_rate_select_success",O.current))},[O,v,T.hasError,T.hasInvalidAddress]);const A={shippingErrorStatus:T,dispatchErrorStatus:k,shippingErrorTypes:o,...C};return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(E.Provider,{value:A},t))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(7),o=r(0),s=r(6),a=r(73),c=r(59);const i=()=>{const e=Object(a.a)(),{dispatchCheckoutEvent:t}=Object(c.a)(),{selectShippingRate:r}=Object(n.useDispatch)(s.CART_STORE_KEY);return{selectShippingRate:Object(o.useCallback)((n,o)=>{r(n,o).then(()=>{t("set-selected-shipping-rate",{shippingRateId:n})}).catch(t=>{e(t)})},[r,t,e]),isSelectingRate:Object(n.useSelect)(e=>e(s.CART_STORE_KEY).isShippingRateBeingSelected(),[])}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"d",(function(){return a})),r.d(t,"c",(function(){return c})),r.d(t,"b",(function(){return i}));const n=window.CustomEvent||null,o=(e,t)=>{let{bubbles:r=!1,cancelable:o=!1,element:s,detail:a={}}=t;if(!n)return;s||(s=document.body);const c=new n(e,{bubbles:r,cancelable:o,detail:a});s.dispatchEvent(c)};let s;const a=()=>{s&&clearTimeout(s),s=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},c=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},i=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const s=()=>{o(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,s),()=>jQuery(document).off(e,s)}},function(e,t,r){"use strict";var n=r(0),o=r(13);const s=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=s},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"number"==typeof e},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const o=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},function(e,t,r){"use strict";var n=r(12),o=r.n(n),s=r(0);r(106);const a=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};t.a=e=>t=>{const r=Object(s.useRef)(null);return Object(s.createElement)(s.Fragment,null,Object(s.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:r,"aria-hidden":!0}),Object(s.createElement)(e,o()({},t,{scrollToTop:e=>{null!==r.current&&((e,t)=>{const{focusableSelector:r}=t||{};window&&Number.isFinite(window.innerHeight)&&(r?((e,t)=>{var r;const n=(null===(r=e.parentElement)||void 0===r?void 0:r.querySelectorAll(t))||[];if(n.length){const e=n[0];a(e),null==e||e.focus()}else a(e)})(e,r):a(e))})(r.current,e)}})))}},,function(e,t,r){"use strict";var n=r(0),o=r(3),s=r(4),a=r.n(s),c=r(1),i=r(23),l=r(71),u=r(42);function d(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}t.a=function({className:e,status:t="info",children:r,spokenMessage:s=r,onRemove:p=o.noop,isDismissible:m=!0,actions:f=[],politeness:h=d(t),__unstableHTML:b,onDismiss:g=o.noop}){!function(e,t){const r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)(()=>{r&&Object(i.speak)(r,t)},[r,t])}(s,h);const y=a()(e,"components-notice","is-"+t,{"is-dismissible":m});return b&&(r=Object(n.createElement)(n.RawHTML,null,r)),Object(n.createElement)("div",{className:y},Object(n.createElement)("div",{className:"components-notice__content"},r,Object(n.createElement)("div",{className:"components-notice__actions"},f.map(({className:e,label:t,isPrimary:r,variant:o,noDefaultClasses:s=!1,onClick:c,url:i},l)=>{let d=o;return"primary"===o||s||(d=i?"link":"secondary"),void 0===d&&r&&(d="primary"),Object(n.createElement)(u.a,{key:l,href:i,variant:d,onClick:i?void 0:c,className:a()("components-notice__action",e)},t)}))),m&&Object(n.createElement)(u.a,{className:"components-notice__dismiss",icon:l.a,label:Object(c.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),g(),p()},showTooltip:!1}))}},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return s}));var n=r(7);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;const r=Object(n.select)("core/notices").getNotices(e);return r.some(e=>e.type===t)},s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=Object(n.select)("core/notices").getNotices(),{removeNotice:o}=Object(n.dispatch)("core/notices"),s=r.filter(t=>t.status===e);s.forEach(e=>o(e.id,t))}},function(e,t){},function(e,t,r){var n=r(5),o=r(56),s=r(57),a=s.setStyleProp;function c(e){return s.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&s.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,r){for(var s,i,l,u,d=(r=r||{}).library||n,p=d.cloneElement,m=d.createElement,f=d.isValidElement,h=[],b="function"==typeof r.replace,g=r.trim,y=0,E=t.length;y1&&(i=p(i,{key:i.key||y})),h.push(i);else if("text"!==s.type){switch(l=s.attribs,c(s)?a(l.style,l):l&&(l=o(l)),u=null,s.type){case"script":case"style":s.children[0]&&(l.dangerouslySetInnerHTML={__html:s.children[0].data});break;case"tag":"textarea"===s.name&&s.children[0]?l.defaultValue=s.children[0].data:s.children&&s.children.length&&(u=e(s.children,r));break;default:continue}E>1&&(l.key=y),h.push(m(s.name,l,u))}else g?s.data.trim()&&h.push(s.data):h.push(s.data);return 1===h.length?h[0]:h}},function(e,t,r){var n=r(84),o=r(85),s=r(86),a=s.MUST_USE_PROPERTY,c=s.HAS_BOOLEAN_VALUE,i=s.HAS_NUMERIC_VALUE,l=s.HAS_POSITIVE_NUMERIC_VALUE,u=s.HAS_OVERLOADED_BOOLEAN_VALUE;function d(e,t){return(e&t)===t}function p(e,t,r){var n,o,s,p=e.Properties,m=e.DOMAttributeNames;for(o in p)n=m[o]||(r?o:o.toLowerCase()),s=p[o],t[n]={attributeName:n,propertyName:o,mustUseProperty:d(s,a),hasBooleanValue:d(s,c),hasNumericValue:d(s,i),hasPositiveNumericValue:d(s,l),hasOverloadedBooleanValue:d(s,u)}}var m={};p(n,m);var f={};p(o,f,!0);var h={};p(n,h),p(o,h,!0),e.exports={html:m,svg:f,properties:h,isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"))}},function(e,t){e.exports={Properties:{autoFocus:4,accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:4,allowTransparency:0,alt:0,as:0,async:4,autoComplete:0,autoPlay:4,capture:4,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:5,cite:0,classID:0,className:0,cols:24,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:4,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:4,defer:4,dir:0,disabled:4,download:32,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:4,formTarget:0,frameBorder:0,headers:0,height:0,hidden:4,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:4,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:5,muted:5,name:0,nonce:0,noValidate:4,open:4,optimum:0,pattern:0,placeholder:0,playsInline:4,poster:0,preload:0,profile:0,radioGroup:0,readOnly:4,referrerPolicy:0,rel:0,required:4,reversed:4,role:0,rows:24,rowSpan:8,sandbox:0,scope:0,scoped:4,scrolling:0,seamless:4,selected:5,shape:0,size:24,sizes:0,span:24,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:8,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:4,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"}}},function(e,t){e.exports={Properties:{accentHeight:0,accumulate:0,additive:0,alignmentBaseline:0,allowReorder:0,alphabetic:0,amplitude:0,arabicForm:0,ascent:0,attributeName:0,attributeType:0,autoReverse:0,azimuth:0,baseFrequency:0,baseProfile:0,baselineShift:0,bbox:0,begin:0,bias:0,by:0,calcMode:0,capHeight:0,clip:0,clipPath:0,clipRule:0,clipPathUnits:0,colorInterpolation:0,colorInterpolationFilters:0,colorProfile:0,colorRendering:0,contentScriptType:0,contentStyleType:0,cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:0,direction:0,display:0,divisor:0,dominantBaseline:0,dur:0,dx:0,dy:0,edgeMode:0,elevation:0,enableBackground:0,end:0,exponent:0,externalResourcesRequired:0,fill:0,fillOpacity:0,fillRule:0,filter:0,filterRes:0,filterUnits:0,floodColor:0,floodOpacity:0,focusable:0,fontFamily:0,fontSize:0,fontSizeAdjust:0,fontStretch:0,fontStyle:0,fontVariant:0,fontWeight:0,format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:0,glyphOrientationHorizontal:0,glyphOrientationVertical:0,glyphRef:0,gradientTransform:0,gradientUnits:0,hanging:0,horizAdvX:0,horizOriginX:0,ideographic:0,imageRendering:0,in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:0,kernelUnitLength:0,kerning:0,keyPoints:0,keySplines:0,keyTimes:0,lengthAdjust:0,letterSpacing:0,lightingColor:0,limitingConeAngle:0,local:0,markerEnd:0,markerMid:0,markerStart:0,markerHeight:0,markerUnits:0,markerWidth:0,mask:0,maskContentUnits:0,maskUnits:0,mathematical:0,mode:0,numOctaves:0,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:0,overlineThickness:0,paintOrder:0,panose1:0,pathLength:0,patternContentUnits:0,patternTransform:0,patternUnits:0,pointerEvents:0,points:0,pointsAtX:0,pointsAtY:0,pointsAtZ:0,preserveAlpha:0,preserveAspectRatio:0,primitiveUnits:0,r:0,radius:0,refX:0,refY:0,renderingIntent:0,repeatCount:0,repeatDur:0,requiredExtensions:0,requiredFeatures:0,restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:0,slope:0,spacing:0,specularConstant:0,specularExponent:0,speed:0,spreadMethod:0,startOffset:0,stdDeviation:0,stemh:0,stemv:0,stitchTiles:0,stopColor:0,stopOpacity:0,strikethroughPosition:0,strikethroughThickness:0,string:0,stroke:0,strokeDasharray:0,strokeDashoffset:0,strokeLinecap:0,strokeLinejoin:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0,surfaceScale:0,systemLanguage:0,tableValues:0,targetX:0,targetY:0,textAnchor:0,textDecoration:0,textRendering:0,textLength:0,to:0,transform:0,u1:0,u2:0,underlinePosition:0,underlineThickness:0,unicode:0,unicodeBidi:0,unicodeRange:0,unitsPerEm:0,vAlphabetic:0,vHanging:0,vIdeographic:0,vMathematical:0,values:0,vectorEffect:0,version:0,vertAdvY:0,vertOriginX:0,vertOriginY:0,viewBox:0,viewTarget:0,visibility:0,widths:0,wordSpacing:0,writingMode:0,x:0,xHeight:0,x1:0,x2:0,xChannelSelector:0,xlinkActuate:0,xlinkArcrole:0,xlinkHref:0,xlinkRole:0,xlinkShow:0,xlinkTitle:0,xlinkType:0,xmlBase:0,xmlns:0,xmlnsXlink:0,xmlLang:0,xmlSpace:0,y:0,y1:0,y2:0,yChannelSelector:0,z:0,zoomAndPan:0},DOMAttributeNames:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space"}}},function(e,t){e.exports={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=n(r(88)),s=r(90);t.default=function(e,t){var r={};return e&&"string"==typeof e?(o.default(e,(function(e,n){e&&n&&(r[s.camelCase(e,t)]=n)})),r):r}},function(e,t,r){var n=r(89);e.exports=function(e,t){var r,o=null;if(!e||"string"!=typeof e)return o;for(var s,a,c=n(e),i="function"==typeof t,l=0,u=c.length;l/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t,r=e.match(c);return r&&r[1]&&(t=r[1],a&&(e=e.replace(r[0],""))),s(n(e),null,t)}},function(e,t,r){var n=r(58),o=/<([a-zA-Z]+[0-9]?)/,s=//i,a=//i,c=/<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\/?>/gi,i=n.isIE(9),l=i||n.isIE(),u=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},d=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")};if("function"==typeof window.DOMParser){var p=new window.DOMParser,m=i?"text/xml":"text/html";u=d=function(e,t){return t&&(e="<"+t+">"+e+""),i&&(e=e.replace(c,"<$1$2$3/>")),p.parseFromString(e,m)}}if(document.implementation){var f=document.implementation.createHTMLDocument(l?"html-dom-parser":void 0);u=function(e,t){if(t)return f.documentElement.getElementsByTagName(t)[0].innerHTML=e,f;try{return f.documentElement.innerHTML=e,f}catch(t){if(d)return d(e)}}}var h,b=document.createElement("template");b.content&&(h=function(e){return b.innerHTML=e,b.content.childNodes}),e.exports=function(e){var t,r,n,c,i=e.match(o);switch(i&&i[1]&&(t=i[1].toLowerCase()),t){case"html":return r=d(e),s.test(e)||(n=r.getElementsByTagName("head")[0])&&n.parentNode.removeChild(n),a.test(e)||(n=r.getElementsByTagName("body")[0])&&n.parentNode.removeChild(n),r.getElementsByTagName("html");case"head":case"body":return c=u(e).getElementsByTagName(t),a.test(e)&&s.test(e)?c[0].parentNode.childNodes:c;default:return h?h(e):u(e,"body").getElementsByTagName("body")[0].childNodes}}},function(e,t){e.exports={CASE_SENSITIVE_TAG_NAMES:["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return c}));var n=r(3);let o;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(o||(o={}));const s={addEventCallback:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(n.uniqueId)(),type:o.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:(e,t)=>({id:t,type:o.REMOVE_EVENT_CALLBACK,eventType:e})},a={},c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,{type:t,eventType:r,id:n,callback:s,priority:c}=arguments.length>1?arguments[1]:void 0;const i=e.hasOwnProperty(r)?new Map(e[r]):new Map;switch(t){case o.ADD_EVENT_CALLBACK:return i.set(n,{priority:c,callback:s}),{...e,[r]:i};case o.REMOVE_EVENT_CALLBACK:return i.delete(n),{...e,[r]:i}}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return a}));var n=r(1),o=r(17);const s=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},a=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(o.decodeEntities)(e.message):Object(n.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(12)),s=n(r(128)),a=r(5),c=n(a),i=n(r(129)),l=n(r(131)),u={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!=typeof t)return!1;if(u.str(e)||u.num(e))return e===t;if(u.obj(e)&&u.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var r;for(r in e)if(!(r in t))return!1;for(r in t)if(e[r]!==t[r])return!1;return!u.und(r)||e===t}};function d(){var e=a.useState(!1)[1];return a.useCallback((function(){return e((function(e){return!e}))}),[])}function p(e,t){return u.und(e)||u.nul(e)?t:e}function m(e){return u.und(e)?[]:u.arr(e)?e:[e]}function f(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n=r.length)break;s=r[o++]}else{if((o=r.next()).done)break;s=o.value}for(var a=s,c=!1,i=0;i=m.startTime+l.duration;else if(l.decay)b=f+E/(1-.998)*(1-Math.exp(-(1-.998)*(t-m.startTime))),(u=Math.abs(m.lastPosition-b)<.1)&&(h=b);else{d=void 0!==m.lastTime?m.lastTime:t,E=void 0!==m.lastVelocity?m.lastVelocity:l.initialVelocity,t>d+64&&(d=t);for(var _=Math.floor(t-d),v=0;v<_;++v)b+=1*(E+=(-l.tension*(b-h)+-l.friction*E)/l.mass*1/1e3)/1e3;var O=!(!l.clamp||0===l.tension)&&(fh:b=e);++r);return r-1}(e,s);return function(e,t,r,n,o,s,a,c,i){var l=i?i(e):e;if(lr){if("identity"===c)return l;"clamp"===c&&(l=r)}return n===o?n:t===r?e<=t?n:o:(t===-1/0?l=-l:r===1/0?l-=t:l=(l-t)/(r-t),l=s(l),n===-1/0?l=-l:o===1/0?l+=n:l=l*(o-n)+n,l)}(e,s[t],s[t+1],o[t],o[t+1],i,a,c,n.map)}}var B=function(e){function t(r,n,o,s){var a;return(a=e.call(this)||this).calc=void 0,a.payload=r instanceof E&&!(r instanceof t)?r.getPayload():Array.isArray(r)?r:[r],a.calc=V(n,o,s),a}i(t,e);var r=t.prototype;return r.getValue=function(){return this.calc.apply(this,this.payload.map((function(e){return e.getValue()})))},r.updateConfig=function(e,t,r){this.calc=V(e,t,r)},r.interpolate=function(e,r,n){return new t(this,e,r,n)},t}(E),U=function(e){function t(t){var r;return(r=e.call(this)||this).animatedStyles=new Set,r.value=void 0,r.startPosition=void 0,r.lastPosition=void 0,r.lastVelocity=void 0,r.startTime=void 0,r.lastTime=void 0,r.done=!1,r.setValue=function(e,t){void 0===t&&(t=!0),r.value=e,t&&r.flush()},r.value=t,r.startPosition=t,r.lastPosition=t,r}i(t,e);var r=t.prototype;return r.flush=function(){0===this.animatedStyles.size&&function e(t,r){"update"in t?r.add(t):t.getChildren().forEach((function(t){return e(t,r)}))}(this,this.animatedStyles),this.animatedStyles.forEach((function(e){return e.update()}))},r.clearStyles=function(){this.animatedStyles.clear()},r.getValue=function(){return this.value},r.interpolate=function(e,t,r){return new B(this,e,t,r)},t}(y),H=function(e){function t(t){var r;return(r=e.call(this)||this).payload=t.map((function(e){return new U(e)})),r}i(t,e);var r=t.prototype;return r.setValue=function(e,t){var r=this;void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((function(e,n){return r.payload[n].setValue(e,t)})):this.payload.forEach((function(r){return r.setValue(e,t)}))},r.getValue=function(){return this.payload.map((function(e){return e.getValue()}))},r.interpolate=function(e,t){return new B(this,e,t)},t}(E),G=0,Y=function(){function e(){var e=this;this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=function(){return e.interpolations},this.id=G++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=h(e),r=t.delay,n=void 0===r?0:r,a=t.to,c=s(t,["delay","to"]);if(u.arr(a)||u.fun(a))this.queue.push(o({},c,{delay:n,to:a}));else if(a){var i={};Object.entries(a).forEach((function(e){var t,r=e[0],s=e[1],a=o({to:(t={},t[r]=s,t),delay:f(n,r)},c),l=i[a.delay]&&i[a.delay].to;i[a.delay]=o({},i[a.delay],a,{to:o({},l,a.to)})})),this.queue=Object.values(i)}return this.queue=this.queue.sort((function(e,t){return e.delay-t.delay})),this.diff(c),this},t.start=function(e){var t=this;if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((function(e){var r=e.from,n=void 0===r?{}:r,s=e.to,a=void 0===s?{}:s;u.obj(n)&&(t.merged=o({},n,t.merged)),u.obj(a)&&(t.merged=o({},t.merged,a))}));var r=this.local=++this.guid,n=this.localQueue=this.queue;this.queue=[],n.forEach((function(o,a){var c=o.delay,i=s(o,["delay"]),l=function(o){a===n.length-1&&r===t.guid&&o&&(t.idle=!0,t.props.onRest&&t.props.onRest(t.merged)),e&&e()},d=u.arr(i.to)||u.fun(i.to);c?setTimeout((function(){r===t.guid&&(d?t.runAsync(i,l):t.diff(i).start(l))}),c):d?t.runAsync(i,l):t.diff(i).start(l)}))}else u.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),this,L.has(this)||L.add(this),D||(D=!0,k(x||F));return this},t.stop=function(e){return this.listeners.forEach((function(t){return t(e)})),this.listeners=[],this},t.pause=function(e){return this.stop(!0),e&&(this,L.has(this)&&L.delete(this)),this},t.runAsync=function(e,t){var r=this,n=(e.delay,s(e,["delay"])),a=this.local,c=Promise.resolve(void 0);if(u.arr(n.to))for(var i=function(e){var t=e,s=o({},n,h(n.to[t]));u.arr(s.config)&&(s.config=s.config[t]),c=c.then((function(){if(a===r.guid)return new Promise((function(e){return r.diff(s).start(e)}))}))},l=0;l=n.length)return"break";a=n[s++]}else{if((s=n.next()).done)return"break";a=s.value}var r=a.key,c=function(e){return e.key!==r};(u.und(t)||t===r)&&(e.current.instances.delete(r),e.current.transitions=e.current.transitions.filter(c),e.current.deleted=e.current.deleted.filter(c))},n=e.current.deleted,o=Array.isArray(n),s=0;for(n=o?n:n[Symbol.iterator]();;){var a;if("break"===r())break}e.current.forceUpdate()}var K=function(e){function t(t){var r;return void 0===t&&(t={}),r=e.call(this)||this,!t.transform||t.transform instanceof y||(t=b.transform(t)),r.payload=t,r}return i(t,e),t}(_),J={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Q="[-+]?\\d*\\.?\\d+";function Z(){for(var e=arguments.length,t=new Array(e),r=0;r1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function le(e,t,r){var n=r<.5?r*(1+t):r+t-r*t,o=2*r-n,s=ie(o,n,e+1/3),a=ie(o,n,e),c=ie(o,n,e-1/3);return Math.round(255*s)<<24|Math.round(255*a)<<16|Math.round(255*c)<<8}function ue(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function de(e){return(parseFloat(e)%360+360)%360/360}function pe(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function me(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function fe(e){var t,r,n="number"==typeof(t=e)?t>>>0===t&&t>=0&&t<=4294967295?t:null:(r=ae.exec(t))?parseInt(r[1]+"ff",16)>>>0:J.hasOwnProperty(t)?J[t]:(r=ee.exec(t))?(ue(r[1])<<24|ue(r[2])<<16|ue(r[3])<<8|255)>>>0:(r=te.exec(t))?(ue(r[1])<<24|ue(r[2])<<16|ue(r[3])<<8|pe(r[4]))>>>0:(r=oe.exec(t))?parseInt(r[1]+r[1]+r[2]+r[2]+r[3]+r[3]+"ff",16)>>>0:(r=ce.exec(t))?parseInt(r[1],16)>>>0:(r=se.exec(t))?parseInt(r[1]+r[1]+r[2]+r[2]+r[3]+r[3]+r[4]+r[4],16)>>>0:(r=re.exec(t))?(255|le(de(r[1]),me(r[2]),me(r[3])))>>>0:(r=ne.exec(t))?(le(de(r[1]),me(r[2]),me(r[3]))|pe(r[4]))>>>0:null;return null===n?e:"rgba("+((4278190080&(n=n||0))>>>24)+", "+((16711680&n)>>>16)+", "+((65280&n)>>>8)+", "+(255&n)/255+")"}var he=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,be=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ge=new RegExp("("+Object.keys(J).join("|")+")","g"),ye={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ee=["Webkit","Ms","Moz","O"];function _e(e,t,r){return null==t||"boolean"==typeof t||""===t?"":r||"number"!=typeof t||0===t||ye.hasOwnProperty(e)&&ye[e]?(""+t).trim():t+"px"}ye=Object.keys(ye).reduce((function(e,t){return Ee.forEach((function(r){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(r,t)]=e[t]})),e}),ye);var ve={};M((function(e){return new K(e)})),T("div"),j((function(e){var t=e.output.map((function(e){return e.replace(be,fe)})).map((function(e){return e.replace(ge,fe)})),r=t[0].match(he).map((function(){return[]}));t.forEach((function(e){e.match(he).forEach((function(e,t){return r[t].push(+e)}))}));var n=t[0].match(he).map((function(t,n){return V(o({},e,{output:r[n]}))}));return function(e){var r=0;return t[0].replace(he,(function(){return n[r++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,r,n,o){return"rgba("+Math.round(t)+", "+Math.round(r)+", "+Math.round(n)+", "+o+")"}))}})),O(J),v((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var r=t.style,n=t.children,o=t.scrollTop,a=t.scrollLeft,c=s(t,["style","children","scrollTop","scrollLeft"]),i="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var l in void 0!==o&&(e.scrollTop=o),void 0!==a&&(e.scrollLeft=a),void 0!==n&&(e.textContent=n),r)if(r.hasOwnProperty(l)){var u=0===l.indexOf("--"),d=_e(l,r[l],u);"float"===l&&(l="cssFloat"),u?e.style.setProperty(l,d):e.style[l]=d}for(var p in c){var m=i?p:ve[p]||(ve[p]=p.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));void 0!==e.getAttribute(m)&&e.setAttribute(m,c[p])}}),(function(e){return e}));var Oe,Se,ke=(Oe=function(e){return a.forwardRef((function(t,r){var n=d(),i=a.useRef(!0),l=a.useRef(null),p=a.useRef(null),m=a.useCallback((function(e){var t=l.current;l.current=new I(e,(function(){var e=!1;p.current&&(e=b.fn(p.current,l.current.getAnimatedValue())),p.current&&!1!==e||n()})),t&&t.detach()}),[]);a.useEffect((function(){return function(){i.current=!1,l.current&&l.current.detach()}}),[]),a.useImperativeHandle(r,(function(){return P(p,i,n)})),m(t);var f,h=l.current.getValue(),g=(h.scrollTop,h.scrollLeft,s(h,["scrollTop","scrollLeft"])),y=(f=e,!u.fun(f)||f.prototype instanceof c.Component?function(e){return p.current=function(e,t){return t&&(u.fun(t)?t(e):u.obj(t)&&(t.current=e)),e}(e,r)}:void 0);return c.createElement(e,o({},g,{ref:y}))}))},void 0===(Se=!1)&&(Se=!0),function(e){return(u.arr(e)?e:Object.keys(e)).reduce((function(e,t){var r=Se?t[0].toLowerCase()+t.substring(1):t;return e[r]=Oe(r),e}),Oe)}),we=ke(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);t.apply=ke,t.config={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},t.update=F,t.animated=we,t.a=we,t.interpolate=function(e,t,r){return e&&new B(e,t,r)},t.Globals=N,t.useSpring=function(e){var t=u.fun(e),r=z(1,t?e:[e]),n=r[0],o=r[1],s=r[2];return t?[n[0],o,s]:n},t.useTrail=function(e,t){var r=a.useRef(!1),n=u.fun(t),s=f(t),c=a.useRef(),i=z(e,(function(e,t){return 0===e&&(c.current=[]),c.current.push(t),o({},s,{config:f(s.config,e),attach:e>0&&function(){return c.current[e-1]}})})),l=i[0],d=i[1],p=i[2],m=a.useMemo((function(){return function(e){return d((function(t,r){e.reverse;var n=e.reverse?t+1:t-1,a=c.current[n];return o({},e,{config:f(e.config||s.config,t),attach:a&&function(){return a}})}))}}),[e,s.reverse]);return a.useEffect((function(){r.current&&!n&&m(t)})),a.useEffect((function(){r.current=!0}),[]),n?[l,m,p]:l},t.useTransition=function(e,t,r){var n=o({items:e,keys:t||function(e){return e}},r),c=$(n),i=c.lazy,l=void 0!==i&&i,u=(c.unique,c.reset),p=void 0!==u&&u,m=(c.enter,c.leave,c.update,c.onDestroyed),h=(c.keys,c.items,c.onFrame),b=c.onRest,g=c.onStart,y=c.ref,E=s(c,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),_=d(),v=a.useRef(!1),O=a.useRef({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!n.ref,instances:!v.current&&new Map,forceUpdate:_});return a.useImperativeHandle(n.ref,(function(){return{start:function(){return Promise.all(Array.from(O.current.instances).map((function(e){var t=e[1];return new Promise((function(e){return t.start(e)}))})))},stop:function(e){return Array.from(O.current.instances).forEach((function(t){return t[1].stop(e)}))},get controllers(){return Array.from(O.current.instances).map((function(e){return e[1]}))}}})),O.current=function(e,t){for(var r=e.first,n=e.prevProps,a=s(e,["first","prevProps"]),c=$(t),i=c.items,l=c.keys,u=c.initial,d=c.from,p=c.enter,m=c.leave,h=c.update,b=c.trail,g=void 0===b?0:b,y=c.unique,E=c.config,_=c.order,v=void 0===_?["enter","leave","update"]:_,O=$(n),S=O.keys,k=O.items,w=o({},a.current),j=[].concat(a.deleted),R=Object.keys(w),C=new Set(R),T=new Set(l),A=l.filter((function(e){return!C.has(e)})),x=a.transitions.filter((function(e){return!e.destroyed&&!T.has(e.originalKey)})).map((function(e){return e.originalKey})),P=l.filter((function(e){return C.has(e)})),M=-g;v.length;)switch(v.shift()){case"enter":A.forEach((function(e,t){y&&j.find((function(t){return t.originalKey===e}))&&(j=j.filter((function(t){return t.originalKey!==e})));var n=l.indexOf(e),o=i[n],s=r&&void 0!==u?"initial":"enter";w[e]={slot:s,originalKey:e,key:y?String(e):q++,item:o,trail:M+=g,config:f(E,o,s),from:f(r&&void 0!==u?u||{}:d,o),to:f(p,o)}}));break;case"leave":x.forEach((function(e){var t=S.indexOf(e),r=k[t];j.unshift(o({},w[e],{slot:"leave",destroyed:!0,left:S[Math.max(0,t-1)],right:S[Math.min(S.length,t+1)],trail:M+=g,config:f(E,r,"leave"),to:f(m,r)})),delete w[e]}));break;case"update":P.forEach((function(e){var t=l.indexOf(e),r=i[t];w[e]=o({},w[e],{item:r,slot:"update",trail:M+=g,config:f(E,r,"update"),to:f(h,r)})}))}var N=l.map((function(e){return w[e]}));return j.forEach((function(e){var t,r=e.left,n=(e.right,s(e,["left","right"]));-1!==(t=N.findIndex((function(e){return e.originalKey===r})))&&(t+=1),t=Math.max(0,t),N=[].concat(N.slice(0,t),[n],N.slice(t))})),o({},a,{changed:A.length||x.length||P.length,first:r&&0===A.length,transitions:N,current:w,deleted:j,prevProps:t})}(O.current,n),O.current.changed&&O.current.transitions.forEach((function(e){var t=e.slot,r=e.from,n=e.to,s=e.config,a=e.trail,c=e.key,i=e.item;O.current.instances.has(c)||O.current.instances.set(c,new Y);var u=O.current.instances.get(c),d=o({},E,{to:n,from:r,config:s,ref:y,onRest:function(r){O.current.mounted&&(e.destroyed&&(y||l||X(O,c),m&&m(i)),!Array.from(O.current.instances).some((function(e){return!e[1].idle}))&&(y||l)&&O.current.deleted.length>0&&X(O),b&&b(i,t,r))},onStart:g&&function(){return g(i,t)},onFrame:h&&function(e){return h(i,t,e)},delay:a,reset:p&&"enter"===t});u.update(d),O.current.paused||u.start()})),a.useEffect((function(){return O.current.mounted=v.current=!0,function(){O.current.mounted=v.current=!1,Array.from(O.current.instances).map((function(e){return e[1].destroy()})),O.current.instances.clear()}}),[]),O.current.transitions.map((function(e){var t=e.item,r=e.slot,n=e.key;return{item:t,key:n,state:r,props:O.current.instances.get(n).getValues()}}))},t.useChain=function(e,t,r){void 0===r&&(r=1e3);var n=a.useRef();a.useEffect((function(){u.equ(e,n.current)?e.forEach((function(e){var t=e.current;return t&&t.start()})):t?e.forEach((function(e,n){var s=e.current;if(s){var a=s.controllers;if(a.length){var c=r*t[n];a.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+c})})),e.start()}))}}})):e.reduce((function(e,t,r){var n=t.current;return e.then((function(){return n.start()}))}),Promise.resolve()),n.current=e}))},t.useSprings=z},,,,,,,,,,function(e,t){},,,,,function(e,t,r){"use strict";(function(e){var n=r(0),o=r(3),s=r(4),a=r.n(s),c=r(23),i=r(1),l=(r(37),r(42));t.a=Object(n.forwardRef)((function({className:t,children:r,spokenMessage:s=r,politeness:u="polite",actions:d=[],onRemove:p=o.noop,icon:m=null,explicitDismiss:f=!1,onDismiss:h=o.noop},b){function g(e){e&&e.preventDefault&&e.preventDefault(),h(),p()}h=h||o.noop,function(e,t){const r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)(()=>{r&&Object(c.speak)(r,t)},[r,t])}(s,u),Object(n.useEffect)(()=>{const e=setTimeout(()=>{f||(h(),p())},1e4);return()=>clearTimeout(e)},[h,p]);const y=a()(t,"components-snackbar",{"components-snackbar-explicit-dismiss":!!f});d&&d.length>1&&(void 0!==e&&e.env,d=[d[0]]);const E=a()("components-snackbar__content",{"components-snackbar__content-with-icon":!!m});return Object(n.createElement)("div",{ref:b,className:y,onClick:f?o.noop:g,tabIndex:"0",role:f?"":"button",onKeyPress:f?o.noop:g,"aria-label":f?"":Object(i.__)("Dismiss this notice")},Object(n.createElement)("div",{className:E},m&&Object(n.createElement)("div",{className:"components-snackbar__icon"},m),r,d.map(({label:e,onClick:t,url:r},o)=>Object(n.createElement)(l.a,{key:o,href:r,variant:"tertiary",onClick:e=>function(e,t){e.stopPropagation(),p(),t&&t(e)}(e,t),className:"components-snackbar__action"},e)),f&&Object(n.createElement)("span",{role:"button","aria-label":"Dismiss this notice",tabIndex:"0",className:"components-snackbar__dismiss-button",onClick:g,onKeyPress:g},"✕")))}))}).call(this,r(55))},function(e,t){e.exports=window.wp.plugins},,,function(e,t){e.exports=window.wp.wordcount},function(e,t){e.exports=window.wp.autop},,function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return a}));var n=r(49),o=(r(14),r(2));const s=(e,t)=>Object.keys(o.defaultAddressFields).every(r=>e[r]===t[r]),a=e=>{const t=Object.keys(o.defaultAddressFields),r=Object(n.a)(t,{},e.country),s=Object.assign({},e);return r.forEach(t=>{let{key:r="",hidden:n=!1}=t;n&&((e,t)=>e in t)(r,e)&&(s[r]="")}),s}},function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(12),o=r.n(n),s=r(0),a=r(4),c=r.n(a),i=r(76),l=r(7),u=(r(81),r(60));const d=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""},p=e=>{let{className:t,context:r="default",additionalNotices:n=[]}=e;const{isSuppressed:a}=Object(u.b)(),{notices:p}=Object(l.useSelect)(e=>({notices:e("core/notices").getNotices(r)})),{removeNotice:m}=Object(l.useDispatch)("core/notices"),f=p.filter(e=>"snackbar"!==e.type).concat(n);if(!f.length)return null;const h=c()(t,"wc-block-components-notices");return a?null:Object(s.createElement)("div",{className:h},f.map(e=>Object(s.createElement)(i.a,o()({key:"store-notice-"+e.id},e,{className:c()("wc-block-components-notices__notice",d(e)),onRemove:()=>{e.isDismissible&&m(e.id,r)}}),e.content)))}},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(0),o=r(52),s=r(2),a=r(62),c=r.n(a),i=r(10),l=r(15);const u=(e,t)=>e&&t[e]?t[e]:null,d=e=>{let{block:t,blockMap:r,blockWrapper:o,children:a,depth:p=1}=e;return a&&0!==a.length?Array.from(a).map((e,a)=>{const{blockName:m="",...f}={key:`${t}_${p}_${a}`,...e instanceof HTMLElement?e.dataset:{},className:e instanceof Element?null==e?void 0:e.className:""},h=u(m,r);if(!h){const s=c()(e instanceof Element&&(null==e?void 0:e.outerHTML)||(null==e?void 0:e.textContent)||"");if("string"==typeof s&&s)return s;if(!Object(n.isValidElement)(s))return null;const a=e.childNodes.length?d({block:t,blockMap:r,children:e.childNodes,depth:p+1,blockWrapper:o}):void 0;return a?Object(n.cloneElement)(s,f,a):Object(n.cloneElement)(s,f)}const b=o||n.Fragment;return Object(n.createElement)(n.Suspense,{key:`${t}_${p}_${a}_suspense`,fallback:Object(n.createElement)("div",{className:"wc-block-placeholder"})},Object(n.createElement)(l.a,{text:"Unexpected error in: "+m,showErrorBlock:s.CURRENT_USER_IS_ADMIN},Object(n.createElement)(b,null,Object(n.createElement)(h,f,d({block:t,blockMap:r,children:e.childNodes,depth:p+1,blockWrapper:o}),((e,t,r,o)=>{if(!Object(i.hasInnerBlocks)(e))return null;const a=r?Array.from(r).map(e=>e instanceof HTMLElement&&(null==e?void 0:e.dataset.blockName)||null).filter(Boolean):[],c=Object(i.getRegisteredBlocks)(e).filter(e=>{let{blockName:t,force:r}=e;return!0===r&&!a.includes(t)}),d=o||n.Fragment;return Object(n.createElement)(n.Fragment,null,c.map((e,r)=>{let{blockName:o,component:a}=e;const c=a||u(o,t);return c?Object(n.createElement)(l.a,{key:o+"_blockerror",text:"Unexpected error in: "+o,showErrorBlock:s.CURRENT_USER_IS_ADMIN},Object(n.createElement)(d,null,Object(n.createElement)(c,{key:`${o}_forced_${r}`}))):null}))})(m,r,e.childNodes,o)))))}):null},p=e=>{let{Block:t,selector:r,blockName:n,getProps:s=(()=>({})),blockMap:a,blockWrapper:c}=e;Object(o.a)({Block:t,selector:r,getProps:(e,t)=>{const r=d({block:n,blockMap:a,children:e.children||[],blockWrapper:c});return{...s(e,t),children:r}}})}},function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},s=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(130);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t,n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";r.d(t,"a",(function(){return S}));var n=r(0),o=r(112),s=r(2),a=r(15),c=r(207),i=r(68),l=r(50),u=r(36),d=r(1),p=r(27),m=r.n(p),f=r(118),h=r(95),b=r(7);const g=(e,t,r)=>{const n=Object.keys(e).map(t=>({key:t,value:e[t]}),[]),o=`wc-${r}-new-payment-method`;return n.push({key:o,value:t}),n},y=(e,t)=>{m.a.setNonce&&"function"==typeof m.a.setNonce&&m.a.setNonce(e),null!=e&&e.get("User-ID")&&t.setCustomerId(parseInt(e.get("User-ID")||"0",10))};var E=r(199),_=r(32),v=r(60),O=()=>{const{hasError:e,onCheckoutValidationBeforeProcessing:t,dispatchActions:r,redirectUrl:o,isProcessing:s,isBeforeProcessing:a,isComplete:p,orderNotes:O,shouldCreateAccount:S,extensionData:k}=Object(u.b)(),{hasValidationErrors:w}=Object(E.b)(),{shippingErrorStatus:j}=Object(i.b)(),{billingAddress:R,shippingAddress:C}=Object(l.b)(),{cartNeedsPayment:T,cartNeedsShipping:A,receiveCart:x}=Object(_.a)(),{activePaymentMethod:P,isExpressPaymentMethodActive:M,currentStatus:N,paymentMethodData:I,expressPaymentMethods:D,paymentMethods:L,shouldSavePayment:F}=Object(c.b)(),{setIsSuppressed:V}=Object(v.b)(),{createErrorNotice:B,removeNotice:U}=Object(b.useDispatch)("core/notices"),H=Object(n.useRef)(R),G=Object(n.useRef)(C),Y=Object(n.useRef)(o),[z,q]=Object(n.useState)(!1),W=Object(n.useMemo)(()=>{var e;const t={...D,...L};return null==t||null===(e=t[P])||void 0===e?void 0:e.paymentMethodId},[P,D,L]),$=w&&!M||N.hasError||j.hasError,X=!e&&!$&&(N.isSuccessful||!T)&&s;Object(n.useEffect)(()=>{V(M)},[M,V]),Object(n.useEffect)(()=>{$===e||!s&&!a||M||r.setHasError($)},[$,e,s,a,M,r]),Object(n.useEffect)(()=>{H.current=R,G.current=C,Y.current=o},[R,C,o]);const K=Object(n.useCallback)(()=>!w&&(N.hasError?{errorMessage:Object(d.__)("There was a problem with your payment option.","woo-gutenberg-products-block")}:!j.hasError||{errorMessage:Object(d.__)("There was a problem with your shipping option.","woo-gutenberg-products-block")}),[w,N.hasError,j.hasError]);Object(n.useEffect)(()=>{let e;return M||(e=t(K,0)),()=>{M||e()}},[t,K,M]),Object(n.useEffect)(()=>{Y.current&&(window.location.href=Y.current)},[p]);const J=Object(n.useCallback)(async()=>{if(z)return;q(!0),U("checkout");const e=T?{payment_method:W,payment_data:g(I,F,P)}:{},t={billing_address:Object(f.a)(H.current),customer_note:O,create_account:S,...e,extensions:{...k}};A&&(t.shipping_address=Object(f.a)(G.current)),m()({path:"/wc/store/v1/checkout",method:"POST",data:t,cache:"no-store",parse:!1}).then(e=>{if(y(e.headers,r),!e.ok)throw new Error(e);return e.json()}).then(e=>{r.setAfterProcessing(e),q(!1)}).catch(e=>{try{null!=e&&e.headers&&y(e.headers,r),e.json().then(e=>{var t,n,o;null!==(t=e.data)&&void 0!==t&&t.cart&&x(e.data.cart),B(Object(h.b)(e),{id:"checkout",context:"wc/checkout"}),null==e||null===(n=e.additional_errors)||void 0===n||null===(o=n.forEach)||void 0===o||o.call(n,e=>{B(e.message,{id:e.error_code,context:"wc/checkout"})}),r.setAfterProcessing(e)})}catch{var t;B(Object(d.sprintf)(// Translators: %s Error text. +Object(d.__)("%s Please try placing your order again.","woo-gutenberg-products-block"),null!==(t=null==e?void 0:e.message)&&void 0!==t?t:Object(d.__)("Something went wrong.","woo-gutenberg-products-block")),{id:"checkout",context:"wc/checkout"})}r.setHasError(!0),q(!1)})},[z,U,T,W,I,F,P,O,S,k,A,r,B,x]);return Object(n.useEffect)(()=>{X&&!z&&J()},[J,X,z]),null};const S=e=>{let{children:t,isCart:r=!1,redirectUrl:d}=e;return Object(n.createElement)(u.a,{redirectUrl:d,isCart:r},Object(n.createElement)(l.a,null,Object(n.createElement)(i.a,null,Object(n.createElement)(c.a,null,t,Object(n.createElement)(a.a,{renderError:s.CURRENT_USER_IS_ADMIN?null:()=>null},Object(n.createElement)(o.PluginArea,{scope:"woocommerce-checkout"})),Object(n.createElement)(O,null)))))}},,,function(e,t,r){"use strict";var n=r(0);r(196),t.a=()=>Object(n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},function(e,t,r){"use strict";var n=r(0),o=r(1),s=r(4),a=r.n(s),c=(r(198),r(135));t.a=e=>{let{children:t,className:r,screenReaderLabel:s,showSpinner:i=!1,isLoading:l=!0}=e;return Object(n.createElement)("div",{className:a()(r,{"wc-block-components-loading-mask":l})},l&&i&&Object(n.createElement)(c.a,null),Object(n.createElement)("div",{className:a()({"wc-block-components-loading-mask__children":l}),"aria-hidden":l},t),l&&Object(n.createElement)("span",{className:"screen-reader-text"},s||Object(o.__)("Loading…","woo-gutenberg-products-block")))}},,,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=(e,t)=>{const r=[];return Object.keys(e).forEach(n=>{if(void 0!==t[n])switch(e[n].type){case"boolean":r[n]="false"!==t[n]&&!1!==t[n];break;case"number":r[n]=parseInt(t[n],10);break;case"array":case"object":r[n]=JSON.parse(t[n]);break;default:r[n]=t[n]}else r[n]=e[n].default}),r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return s}));var n=r(0);const o=Object(n.createContext)({hasDarkControls:!1}),s=()=>Object(n.useContext)(o)},,,,,function(e){e.exports=JSON.parse('{"name":"woocommerce/filled-cart-block","version":"1.0.0","title":"Filled Cart","description":"Contains blocks that are displayed when the cart contains products.","category":"woocommerce","supports":{"align":["wide"],"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/empty-cart-block","version":"1.0.0","title":"Empty Cart","description":"Contains blocks that are displayed when the cart is empty.","category":"woocommerce","supports":{"align":["wide"],"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-items-block","version":"1.0.0","title":"Cart Items block","description":"Column containing cart items.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/filled-cart-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-express-payment-block","version":"1.0.0","title":"Express Checkout","description":"Provide an express payment option for your customers.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-line-items-block","version":"1.0.0","title":"Cart Line Items","description":"Block containing current line items in Cart.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-items-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-totals-block","version":"1.0.0","title":"Cart Totals","description":"Column containing the cart totals.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"checkbox":{"type":"boolean","default":false},"text":{"type":"string","required":false},"lock":{"type":"object","default":{"remove":true}}},"parent":["woocommerce/filled-cart-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/proceed-to-checkout-block","version":"1.0.0","title":"Proceed to checkout","description":"Allow customers proceed to Checkout.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-accepted-payment-methods-block","version":"1.0.0","title":"Accepted Payment Methods","description":"Display accepted payment methods.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":true},"parent":["woocommerce/cart-totals-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-block","version":"1.0.0","title":"Order Summary","description":"Show customers a summary of their order.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-subtotal-block","version":"1.0.0","title":"Subtotal","description":"Shows the cart subtotal row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"lock":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-fee-block","version":"1.0.0","title":"Fees","description":"Shows the cart fee row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"lock":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-discount-block","version":"1.0.0","title":"Discount","description":"Shows the cart discount row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"lock":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-shipping-block","version":"1.0.0","title":"Shipping","description":"Shows the cart shipping row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-coupon-form-block","version":"1.0.0","title":"Coupon Form","description":"Shows the apply coupon form.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":false,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-taxes-block","version":"1.0.0","title":"Taxes","description":"Shows the cart taxes row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"lock":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-heading-block","version":"1.0.0","title":"Heading","description":"Shows the heading row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"className":{"type":"string","default":""},"content":{"type":"string","default":"Cart totals"},"lock":{"type":"object","default":{"remove":false,"move":false}}},"parent":["woocommerce/cart-order-summary-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},,function(e,t){},function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return l}));var n=r(0),o=r(3),s=r(11),a=r.n(s);const c=Object(n.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),i=()=>Object(n.useContext)(c),l=e=>{let{children:t}=e;const[r,s]=Object(n.useState)({}),i=Object(n.useCallback)(e=>r[e],[r]),l=Object(n.useCallback)(e=>{const t=r[e];return!t||t.hidden?"":"validate-error-"+e},[r]),u=Object(n.useCallback)(e=>{s(t=>{if(!t[e])return t;const{[e]:r,...n}=t;return n})},[]),d=Object(n.useCallback)(()=>{s({})},[]),p=Object(n.useCallback)(e=>{e&&s(t=>(e=Object(o.pickBy)(e,(e,r)=>!("string"!=typeof e.message||t.hasOwnProperty(r)&&a()(t[r],e))),0===Object.values(e).length?t:{...t,...e}))},[]),m=Object(n.useCallback)((e,t)=>{s(r=>{if(!r.hasOwnProperty(e))return r;const n={...r[e],...t};return a()(r[e],n)?r:{...r,[e]:n}})},[]),f={getValidationError:i,setValidationErrors:p,clearValidationError:u,clearAllValidationErrors:d,hideValidationError:Object(n.useCallback)(e=>{m(e,{hidden:!0})},[m]),showValidationError:Object(n.useCallback)(e=>{m(e,{hidden:!1})},[m]),showAllValidationErrors:Object(n.useCallback)(()=>{s(e=>{const t={};return Object.keys(e).forEach(r=>{e[r].hidden&&(t[r]={...e[r],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(r).length>0,getValidationErrorId:l};return Object(n.createElement)(c.Provider,{value:f},t)}},,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(94);const o=(e,t)=>function(r){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const s=n.a.addEventCallback(e,r,o);return t(s),()=>{t(n.a.removeEventCallback(e,s.id))}}},,function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return a}));const n=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var o=r(30);const s=async(e,t,r)=>{const o=n(e,t),s=[];for(const e of o)try{const t=await Promise.resolve(e.callback(r));"object"==typeof t&&s.push(t)}catch(e){console.error(e)}return!s.length||s},a=async(e,t,r)=>{const s=[],a=n(e,t);for(const e of a)try{const t=await Promise.resolve(e.callback(r));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(o.a)(t)||Object(o.b)(t))return s.push(t),s;s.push(t)}catch(e){return console.error(e),s.push({type:"error"}),s}return s}},function(e,t,r){"use strict";r.d(t,"b",(function(){return V})),r.d(t,"a",(function(){return B}));var n=r(0),o=r(18),s=r(7);let a,c;!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(a||(a={})),function(e){e.SET_REGISTERED_PAYMENT_METHODS="set_registered_payment_methods",e.SET_REGISTERED_EXPRESS_PAYMENT_METHODS="set_registered_express_payment_methods",e.SET_SHOULD_SAVE_PAYMENT_METHOD="set_should_save_payment_method",e.SET_ACTIVE_PAYMENT_METHOD="set_active_payment_method"}(c||(c={}));const i={currentStatus:a.PRISTINE,shouldSavePaymentMethod:!1,activePaymentMethod:"",paymentMethodData:{payment_method:""},errorMessage:"",paymentMethods:{},expressPaymentMethods:{}},l={setPaymentStatus:()=>({pristine:()=>{},started:()=>{},processing:()=>{},completed:()=>{},error:e=>{},failed:(e,t)=>{},success:(e,t)=>{}}),currentStatus:{isPristine:!0,isStarted:!1,isProcessing:!1,isFinished:!1,hasError:!1,hasFailed:!1,isSuccessful:!1,isDoingExpressPayment:!1},paymentStatuses:a,paymentMethodData:{},errorMessage:"",activePaymentMethod:"",activeSavedToken:"",setActivePaymentMethod:()=>{},customerPaymentMethods:{},paymentMethods:{},expressPaymentMethods:{},paymentMethodsInitialized:!1,expressPaymentMethodsInitialized:!1,onPaymentProcessing:()=>()=>()=>{},setExpressPaymentError:()=>{},isExpressPaymentMethodActive:!1,setShouldSavePayment:()=>{},shouldSavePayment:!1};var u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,{type:t,paymentMethodData:r,shouldSavePaymentMethod:n=!1,errorMessage:o="",paymentMethods:s={},paymentMethod:l=""}=arguments.length>1?arguments[1]:void 0;switch(t){case a.PRISTINE:return{...i,...e,errorMessage:"",currentStatus:a.PRISTINE};case a.STARTED:return{...e,currentStatus:a.STARTED};case a.ERROR:return e.currentStatus!==a.ERROR?{...e,currentStatus:a.ERROR,errorMessage:o||e.errorMessage}:e;case a.FAILED:return e.currentStatus!==a.FAILED?{...e,currentStatus:a.FAILED,paymentMethodData:r||e.paymentMethodData,errorMessage:o||e.errorMessage}:e;case a.SUCCESS:return e.currentStatus!==a.SUCCESS?{...e,currentStatus:a.SUCCESS,paymentMethodData:r||e.paymentMethodData}:e;case a.PROCESSING:return e.currentStatus!==a.PROCESSING?{...e,currentStatus:a.PROCESSING,errorMessage:""}:e;case a.COMPLETE:return e.currentStatus!==a.COMPLETE?{...e,currentStatus:a.COMPLETE}:e;case c.SET_REGISTERED_PAYMENT_METHODS:return{...e,paymentMethods:s};case c.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:return{...e,expressPaymentMethods:s};case c.SET_SHOULD_SAVE_PAYMENT_METHOD:return{...e,shouldSavePaymentMethod:n};case c.SET_ACTIVE_PAYMENT_METHOD:return{...e,activePaymentMethod:l,paymentMethodData:r||e.paymentMethodData}}},d=r(1),p=r(16),m=r(31),f=r(2),h=r(51),b=r(25),g=r.n(b),y=r(29),E=r(50),_=r(32),v=r(30),O=r(66);const S=(e,t,r,o)=>{const[a,c]=Object(n.useState)(!1),{isEditor:i}=Object(y.a)(),{selectedRates:l}=Object(O.a)(),{billingAddress:u,shippingAddress:p}=Object(E.b)(),b=Object(m.a)(l),v=Object(m.a)(r),S=Object(_.a)(),{cartTotals:k,cartIsLoading:w,cartNeedsShipping:j,paymentRequirements:R}=S,C=Object(n.useRef)({cart:S,cartTotals:k,cartNeedsShipping:j,billingData:u,billingAddress:u,shippingAddress:p,selectedShippingMethods:b,paymentRequirements:R}),{createErrorNotice:T}=Object(s.useDispatch)("core/notices");Object(n.useEffect)(()=>{C.current={cart:S,cartTotals:k,cartNeedsShipping:j,get billingData(){return g()("billingData",{alternative:"billingAddress",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-blocks/pull/6369"}),this.billingAddress},billingAddress:u,shippingAddress:p,selectedShippingMethods:b,paymentRequirements:R}},[S,k,j,u,p,b,R]);const A=Object(n.useCallback)(async()=>{let r={};const n=e=>{r={...r,[e.name]:e}};for(let e=0;e{w||x()},[x,S,b,u,w]),a},k=e=>({type:e}),w=e=>({type:a.ERROR,errorMessage:e}),j=e=>{let{errorMessage:t,paymentMethodData:r}=e;return{type:a.FAILED,errorMessage:t,paymentMethodData:r}},R=e=>{let{paymentMethodData:t}=e;return{type:a.SUCCESS,paymentMethodData:t}},C=e=>({type:c.SET_REGISTERED_PAYMENT_METHODS,paymentMethods:e}),T=e=>({type:c.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,paymentMethods:e}),A=e=>({type:c.SET_SHOULD_SAVE_PAYMENT_METHOD,shouldSavePaymentMethod:e}),x=(e,t)=>({type:c.SET_ACTIVE_PAYMENT_METHOD,paymentMethod:e,paymentMethodData:t});var P=r(67),M=r(36),N=r(94),I=r(204);var D=r(206),L=r(199);const F=Object(n.createContext)(l),V=()=>Object(n.useContext)(F),B=e=>{let{children:t}=e;const{isProcessing:r,isIdle:c,isCalculating:l,hasError:d}=Object(M.b)(),{isEditor:m,getPreviewData:h}=Object(y.a)(),{setValidationErrors:b}=Object(L.b)(),{createErrorNotice:g,removeNotice:E}=Object(s.useDispatch)("core/notices"),{isSuccessResponse:_,isErrorResponse:O,isFailResponse:V,noticeContexts:B}=Object(v.d)(),[U,H]=Object(n.useReducer)(N.b,{}),{onPaymentProcessing:G}=(e=>Object(n.useMemo)(()=>({onPaymentProcessing:Object(I.a)("payment_processing",e)}),[e]))(H),Y=Object(n.useRef)(U);Object(n.useEffect)(()=>{Y.current=U},[U]);const[z,q]=Object(n.useReducer)(u,i),{dispatchActions:W,setPaymentStatus:$}=(e=>{const{setBillingAddress:t,setShippingAddress:r}=Object(P.a)();return{dispatchActions:Object(n.useMemo)(()=>({setRegisteredPaymentMethods:t=>{e(C(t))},setRegisteredExpressPaymentMethods:t=>{e(T(t))},setShouldSavePayment:t=>{e(A(t))},setActivePaymentMethod:function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e(x(t,r))}}),[e]),setPaymentStatus:Object(n.useCallback)(()=>({pristine:()=>e(k(a.PRISTINE)),started:()=>e(k(a.STARTED)),processing:()=>e(k(a.PROCESSING)),completed:()=>e(k(a.COMPLETE)),error:t=>e(w(t)),failed:function(r,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;o&&t(o),e(j({errorMessage:r||"",paymentMethodData:n||{}}))},success:function(n){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;o&&t(o),void 0!==typeof s&&null!=s&&s.address&&r(s.address),e(R({paymentMethodData:n}))}}),[e,t,r])}})(q),X=(e=>{const t=Object(p.getPaymentMethods)(),{noticeContexts:r}=Object(v.d)(),n=new Set([...Object(f.getSetting)("paymentGatewaySortOrder",[]),...Object.keys(t)]);return S(e,t,Array.from(n),r.PAYMENTS)})(W.setRegisteredPaymentMethods),K=(e=>{const t=Object(p.getExpressPaymentMethods)(),{noticeContexts:r}=Object(v.d)();return S(e,t,Object.keys(t),r.EXPRESS_PAYMENTS)})(W.setRegisteredExpressPaymentMethods),J=Object(n.useMemo)(()=>m?h("previewSavedPaymentMethods"):X?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===Object.keys(e).length)return{};const t=Object(f.getSetting)("customerPaymentMethods",{}),r=Object.keys(t),n={};return r.forEach(r=>{const o=t[r].filter(t=>{var r;let{method:{gateway:n}}=t;return n in e&&(null===(r=e[n].supports)||void 0===r?void 0:r.showSavedCards)});o.length&&(n[r]=o)}),n}(z.paymentMethods):{},[m,h,X,z.paymentMethods]),Q=Object(n.useCallback)(e=>{e?g(e,{id:"wc-express-payment-error",context:B.EXPRESS_PAYMENTS}):E("wc-express-payment-error",B.EXPRESS_PAYMENTS)},[g,B.EXPRESS_PAYMENTS,E]),Z=Object.keys(z.expressPaymentMethods).includes(z.activePaymentMethod),ee=Object(n.useMemo)(()=>({isPristine:z.currentStatus===a.PRISTINE,isStarted:z.currentStatus===a.STARTED,isProcessing:z.currentStatus===a.PROCESSING,isFinished:[a.ERROR,a.FAILED,a.SUCCESS].includes(z.currentStatus),hasError:z.currentStatus===a.ERROR,hasFailed:z.currentStatus===a.FAILED,isSuccessful:z.currentStatus===a.SUCCESS,isDoingExpressPayment:z.currentStatus!==a.PRISTINE&&Z}),[z.currentStatus,Z]);Object(n.useEffect)(()=>{const e=Object.keys(z.paymentMethods);if(!X||!e.length)return;const t=[...e,...Object.keys(z.expressPaymentMethods)];if(z.activePaymentMethod&&t.includes(z.activePaymentMethod))return;$().pristine();const r=Object.keys(J).flatMap(e=>J[e])[0]||void 0;if(r){const e=r.tokenId.toString(),t=r.method.gateway,n=`wc-${t}-payment-token`;W.setActivePaymentMethod(t,{token:e,payment_method:t,[n]:e,isSavedToken:!0})}else W.setActivePaymentMethod(Object.keys(z.paymentMethods)[0])},[X,z.paymentMethods,z.expressPaymentMethods,W,$,z.activePaymentMethod,J]),Object(n.useEffect)(()=>{!r||d||l||ee.isFinished||$().processing()},[r,d,l,ee.isFinished,$]),Object(n.useEffect)(()=>{c&&!ee.isSuccessful&&$().pristine()},[c,ee.isSuccessful,$]),Object(n.useEffect)(()=>{d&&ee.isSuccessful&&$().pristine()},[d,ee.isSuccessful,$]),Object(n.useEffect)(()=>{ee.isProcessing&&(E("wc-payment-error",B.PAYMENTS),Object(D.b)(Y.current,"payment_processing",{}).then(e=>{let t,r;var n,o,s,a,c,i;if(e.forEach(e=>{_(e)&&(t=e),(O(e)||V(e))&&(r=e)}),t&&!r)$().success(null===(n=t)||void 0===n||null===(o=n.meta)||void 0===o?void 0:o.paymentMethodData,null===(s=t)||void 0===s||null===(a=s.meta)||void 0===a?void 0:a.billingAddress,null===(c=t)||void 0===c||null===(i=c.meta)||void 0===i?void 0:i.shippingData);else if(r&&V(r)){var l,u,d,p,m,f;r.message&&r.message.length&&g(r.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(f=r)||void 0===f?void 0:f.messageContext)||B.PAYMENTS}),$().failed(null===(l=r)||void 0===l?void 0:l.message,null===(u=r)||void 0===u||null===(d=u.meta)||void 0===d?void 0:d.paymentMethodData,null===(p=r)||void 0===p||null===(m=p.meta)||void 0===m?void 0:m.billingAddress)}else if(r){var h,y;r.message&&r.message.length&&g(r.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(y=r)||void 0===y?void 0:y.messageContext)||B.PAYMENTS}),$().error(r.message),b(null===(h=r)||void 0===h?void 0:h.validationErrors)}else $().success()}))},[ee.isProcessing,b,$,E,B.PAYMENTS,_,V,O,g]);const te="object"==typeof z.paymentMethodData&&Object(o.b)(z.paymentMethodData,"token")?z.paymentMethodData.token+"":"",re={setPaymentStatus:$,currentStatus:ee,paymentStatuses:a,paymentMethodData:z.paymentMethodData,errorMessage:z.errorMessage,activePaymentMethod:z.activePaymentMethod,activeSavedToken:te,setActivePaymentMethod:W.setActivePaymentMethod,onPaymentProcessing:G,customerPaymentMethods:J,paymentMethods:z.paymentMethods,expressPaymentMethods:z.expressPaymentMethods,paymentMethodsInitialized:X,expressPaymentMethodsInitialized:K,setExpressPaymentError:Q,isExpressPaymentMethodActive:Z,shouldSavePayment:z.shouldSavePaymentMethod,setShouldSavePayment:W.setShouldSavePayment};return Object(n.createElement)(F.Provider,{value:re},t)}},,,,,,,,,,,,,,,,,,,,,,function(e,t,r){e.exports=r(247)},function(e,t){},,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.r(t);var n=r(146),o=r(0),s=r(32),a=r(16),c=r(127),i=r(48),l=r(10),u={FILLED_CART:r(152),EMPTY_CART:r(153),CART_ITEMS:r(154),CART_EXPRESS_PAYMENT:r(155),CART_LINE_ITEMS:r(156),CART_TOTALS:r(157),PROCEED_TO_CHECKOUT:r(158),CART_ACCEPTED_PAYMENT_METHODS:r(159),CART_ORDER_SUMMARY:r(160),CART_ORDER_SUMMARY_SUBTOTAL:r(161),CART_ORDER_SUMMARY_FEE:r(162),CART_ORDER_SUMMARY_DISCOUNT:r(163),CART_ORDER_SUMMARY_SHIPPING:r(164),CART_ORDER_SUMMARY_COUPON_FORM:r(165),CART_ORDER_SUMMARY_TAXES:r(166),CART_ORDER_SUMMARY_HEADING:r(167)};r.p=i.k,Object(l.registerCheckoutBlock)({metadata:u.FILLED_CART,component:Object(o.lazy)(()=>r.e(19).then(r.bind(null,415)))}),Object(l.registerCheckoutBlock)({metadata:u.EMPTY_CART,component:Object(o.lazy)(()=>r.e(18).then(r.bind(null,416)))}),Object(l.registerCheckoutBlock)({metadata:u.CART_ITEMS,component:Object(o.lazy)(()=>r.e(14).then(r.bind(null,417)))}),Object(l.registerCheckoutBlock)({metadata:u.CART_LINE_ITEMS,component:Object(o.lazy)(()=>Promise.all([r.e(0),r.e(3),r.e(4),r.e(15)]).then(r.bind(null,449)))}),Object(l.registerCheckoutBlock)({metadata:u.CART_TOTALS,component:Object(o.lazy)(()=>r.e(17).then(r.bind(null,418)))}),Object(l.registerCheckoutBlock)({metadata:u.CART_EXPRESS_PAYMENT,component:Object(o.lazy)(()=>r.e(13).then(r.bind(null,438)))}),Object(l.registerCheckoutBlock)({metadata:u.PROCEED_TO_CHECKOUT,component:Object(o.lazy)(()=>r.e(27).then(r.bind(null,450)))}),Object(l.registerCheckoutBlock)({metadata:u.CART_ACCEPTED_PAYMENT_METHODS,component:Object(o.lazy)(()=>r.e(12).then(r.bind(null,451)))}),Object(l.registerCheckoutBlock)({metadata:u.CART_ORDER_SUMMARY,component:Object(o.lazy)(()=>Promise.all([r.e(0),r.e(16)]).then(r.bind(null,452)))}),Object(l.registerCheckoutBlock)({metadata:u.CART_ORDER_SUMMARY_HEADING,component:Object(o.lazy)(()=>r.e(23).then(r.bind(null,439)))}),Object(l.registerCheckoutBlock)({metadata:u.CART_ORDER_SUMMARY_SUBTOTAL,component:Object(o.lazy)(()=>r.e(25).then(r.bind(null,453)))}),Object(l.registerCheckoutBlock)({metadata:u.CART_ORDER_SUMMARY_FEE,component:Object(o.lazy)(()=>r.e(22).then(r.bind(null,454)))}),Object(l.registerCheckoutBlock)({metadata:u.CART_ORDER_SUMMARY_DISCOUNT,component:Object(o.lazy)(()=>r.e(21).then(r.bind(null,455)))}),Object(l.registerCheckoutBlock)({metadata:u.CART_ORDER_SUMMARY_COUPON_FORM,component:Object(o.lazy)(()=>r.e(20).then(r.bind(null,456)))}),Object(l.registerCheckoutBlock)({metadata:u.CART_ORDER_SUMMARY_SHIPPING,component:Object(o.lazy)(()=>Promise.all([r.e(0),r.e(1),r.e(2),r.e(5),r.e(24)]).then(r.bind(null,440)))}),Object(l.registerCheckoutBlock)({metadata:u.CART_ORDER_SUMMARY_TAXES,component:Object(o.lazy)(()=>r.e(26).then(r.bind(null,441)))}),Object(l.registerCheckoutBlock)({metadata:u.CART_ORDER_SUMMARY_HEADING,component:Object(o.lazy)(()=>r.e(23).then(r.bind(null,439)))});var d=r(1),p=r(136),m=r(199),f=r(251),h=r(123),b=r(2),g=r(15),y=r(70),E=r(74),_=r(60),v=r(132);const O=e=>{let{children:t,redirectUrl:r}=e;return Object(o.createElement)(v.a,{isCart:!0,redirectUrl:r},t)};var S=r(147);r(230);const k=()=>{window.location.reload(!0)},w=e=>{let{children:t,attributes:r={}}=e;const{cartIsLoading:n}=Object(s.a)(),{hasDarkControls:a}=r;return Object(o.createElement)(p.a,{showSpinner:!0,isLoading:n},Object(o.createElement)(S.a.Provider,{value:{hasDarkControls:a}},Object(o.createElement)(m.a,null,t)))},j=e=>{let{scrollToTop:t}=e;return Object(o.useEffect)(()=>{const e=Object(y.b)("added_to_cart","wc-blocks_added_to_cart");return document.body.addEventListener("wc-blocks_added_to_cart",t),()=>{e(),document.body.removeEventListener("wc-blocks_added_to_cart",t)}},[t]),null};var R=Object(E.a)(e=>{let{attributes:t,children:r,scrollToTop:n}=e;return Object(o.createElement)(g.a,{header:Object(d.__)("Something went wrong…","woo-gutenberg-products-block"),text:Object(d.__)("The cart has encountered an unexpected error. If the error persists, please get in touch with us for help.","woo-gutenberg-products-block"),button:Object(o.createElement)("button",{className:"wc-block-button",onClick:k},Object(d.__)("Reload the page","woo-gutenberg-products-block")),showErrorMessage:b.CURRENT_USER_IS_ADMIN},Object(o.createElement)(f.a,{context:"wc/cart"}),Object(o.createElement)(_.a,null,Object(o.createElement)(h.a,{context:"wc/cart"}),Object(o.createElement)(l.SlotFillProvider,null,Object(o.createElement)(O,null,Object(o.createElement)(w,{attributes:t},r),Object(o.createElement)(j,{scrollToTop:n})))))});const C={isPreview:{type:"boolean",default:!1,save:!1},hasDarkControls:{type:"boolean",default:Object(b.getSetting)("hasDarkEditorStyleSupport",!1)},isShippingCalculatorEnabled:{type:"boolean",default:Object(b.getSetting)("isShippingCalculatorEnabled",!0)},checkoutPageId:{type:"number",default:0},showRateAfterTaxName:{type:"boolean",default:!0},align:{type:"string"}};Object(c.a)({Block:R,blockName:"woocommerce/cart",selector:".wp-block-woocommerce-cart",getProps:e=>({attributes:Object(n.a)(C,e?e.dataset:{})}),blockMap:Object(a.getRegisteredBlockComponents)("woocommerce/cart"),blockWrapper:e=>{let{children:t}=e;const{extensions:r,receiveCart:n,...a}=Object(s.a)();return o.Children.map(t,e=>{if(Object(o.isValidElement)(e)){const t={extensions:r,cart:a};return Object(o.cloneElement)(e,t)}return e})}})},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return b}));var n=r(0),o=r(8),s=r(4),a=r.n(s),c=r(3),i=r(96),l=r(9),u=r(111),d=function({notices:e,className:t,children:r,onRemove:s=c.noop}){const d=Object(l.useReducedMotion)(),[p]=Object(n.useState)(()=>new WeakMap),m=Object(i.useTransition)(e,e=>e.id,{from:{opacity:0,height:0},enter:e=>async t=>await t({opacity:1,height:p.get(e).offsetHeight}),leave:()=>async e=>{await e({opacity:0}),await e({height:0})},immediate:d});t=a()("components-snackbar-list",t);const f=e=>()=>s(e.id);return Object(n.createElement)("div",{className:t},r,m.map(({item:e,key:t,props:r})=>Object(n.createElement)(i.animated.div,{key:t,style:r},Object(n.createElement)("div",{className:"components-snackbar-list__notice-container",ref:t=>t&&p.set(e,t)},Object(n.createElement)(u.a,Object(o.a)({},Object(c.omit)(e,["content"]),{onRemove:f(e)}),e.content)))))},p=r(10),m=r(7),f=r(29);const h={},b=e=>{let{className:t,context:r="default"}=e;const{isEditor:o}=Object(f.a)(),{notices:s}=Object(m.useSelect)(e=>({notices:e("core/notices").getNotices(r)})),{removeNotice:c}=Object(m.useDispatch)("core/notices");if(o)return null;const i=s.filter(e=>"snackbar"===e.type),l=i.length>0?i.reduce((e,t)=>{let{content:r}=t;return e[r]=!0,e},{}):h,u=Object(p.__experimentalApplyCheckoutFilter)({filterName:"snackbarNoticeVisibility",defaultValue:l}),b=i.filter(e=>!0===u[e.content]),g=a()(t,"wc-block-components-notices__snackbar");return Object(n.createElement)(d,{notices:b,className:g,onRemove:()=>{b.forEach(e=>c(e.id,r))}})}}]); \ No newline at end of file diff --git a/build/cart-items-block/block.json b/build/cart-items-block/block.json new file mode 100644 index 00000000000..f99f18d904e --- /dev/null +++ b/build/cart-items-block/block.json @@ -0,0 +1,28 @@ +{ + "name": "woocommerce/cart-items-block", + "version": "1.0.0", + "title": "Cart Items block", + "description": "Column containing cart items.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/filled-cart-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/cart-line-items-block/block.json b/build/cart-line-items-block/block.json new file mode 100644 index 00000000000..ed6ea836d93 --- /dev/null +++ b/build/cart-line-items-block/block.json @@ -0,0 +1,28 @@ +{ + "name": "woocommerce/cart-line-items-block", + "version": "1.0.0", + "title": "Cart Line Items", + "description": "Block containing current line items in Cart.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/cart-items-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/cart-order-summary-block/block.json b/build/cart-order-summary-block/block.json new file mode 100644 index 00000000000..fd5fcceeb2b --- /dev/null +++ b/build/cart-order-summary-block/block.json @@ -0,0 +1,28 @@ +{ + "name": "woocommerce/cart-order-summary-block", + "version": "1.0.0", + "title": "Order Summary", + "description": "Show customers a summary of their order.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/cart-totals-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/cart-order-summary-coupon-form-block/block.json b/build/cart-order-summary-coupon-form-block/block.json new file mode 100644 index 00000000000..9eac4544983 --- /dev/null +++ b/build/cart-order-summary-coupon-form-block/block.json @@ -0,0 +1,30 @@ +{ + "name": "woocommerce/cart-order-summary-coupon-form-block", + "version": "1.0.0", + "title": "Coupon Form", + "description": "Shows the apply coupon form.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "lock": { + "type": "object", + "default": { + "remove": false, + "move": false + } + } + }, + "parent": [ "woocommerce/cart-order-summary-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/cart-order-summary-discount-block/block.json b/build/cart-order-summary-discount-block/block.json new file mode 100644 index 00000000000..cfb3d6c6cb2 --- /dev/null +++ b/build/cart-order-summary-discount-block/block.json @@ -0,0 +1,31 @@ +{ + "name": "woocommerce/cart-order-summary-discount-block", + "version": "1.0.0", + "title": "Discount", + "description": "Shows the cart discount row.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "lock": false + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "lock": { + "type": "object", + "default": { + "remove": true, + "move": false + } + } + }, + "parent": [ "woocommerce/cart-order-summary-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/cart-order-summary-fee-block/block.json b/build/cart-order-summary-fee-block/block.json new file mode 100644 index 00000000000..27175d16395 --- /dev/null +++ b/build/cart-order-summary-fee-block/block.json @@ -0,0 +1,31 @@ +{ + "name": "woocommerce/cart-order-summary-fee-block", + "version": "1.0.0", + "title": "Fees", + "description": "Shows the cart fee row.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "lock": false + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "lock": { + "type": "object", + "default": { + "remove": true, + "move": false + } + } + }, + "parent": [ "woocommerce/cart-order-summary-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/cart-order-summary-heading-block/block.json b/build/cart-order-summary-heading-block/block.json new file mode 100644 index 00000000000..3d69bce2450 --- /dev/null +++ b/build/cart-order-summary-heading-block/block.json @@ -0,0 +1,34 @@ +{ + "name": "woocommerce/cart-order-summary-heading-block", + "version": "1.0.0", + "title": "Heading", + "description": "Shows the heading row.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "content": { + "type": "string", + "default": "Cart totals" + }, + "lock": { + "type": "object", + "default": { + "remove": false, + "move": false + } + } + }, + "parent": [ "woocommerce/cart-order-summary-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/cart-order-summary-shipping-block/block.json b/build/cart-order-summary-shipping-block/block.json new file mode 100644 index 00000000000..e6a61cf07c1 --- /dev/null +++ b/build/cart-order-summary-shipping-block/block.json @@ -0,0 +1,27 @@ +{ + "name": "woocommerce/cart-order-summary-shipping-block", + "version": "1.0.0", + "title": "Shipping", + "description": "Shows the cart shipping row.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": false + } + } + }, + "parent": [ "woocommerce/cart-order-summary-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/cart-order-summary-subtotal-block/block.json b/build/cart-order-summary-subtotal-block/block.json new file mode 100644 index 00000000000..aee05b8d5b0 --- /dev/null +++ b/build/cart-order-summary-subtotal-block/block.json @@ -0,0 +1,31 @@ +{ + "name": "woocommerce/cart-order-summary-subtotal-block", + "version": "1.0.0", + "title": "Subtotal", + "description": "Shows the cart subtotal row.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "lock": false + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "lock": { + "type": "object", + "default": { + "remove": true, + "move": false + } + } + }, + "parent": [ "woocommerce/cart-order-summary-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/cart-order-summary-taxes-block/block.json b/build/cart-order-summary-taxes-block/block.json new file mode 100644 index 00000000000..289675f7405 --- /dev/null +++ b/build/cart-order-summary-taxes-block/block.json @@ -0,0 +1,31 @@ +{ + "name": "woocommerce/cart-order-summary-taxes-block", + "version": "1.0.0", + "title": "Taxes", + "description": "Shows the cart taxes row.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "lock": false + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "lock": { + "type": "object", + "default": { + "remove": true, + "move": false + } + } + }, + "parent": [ "woocommerce/cart-order-summary-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/cart-totals-block/block.json b/build/cart-totals-block/block.json new file mode 100644 index 00000000000..80746cb3c4e --- /dev/null +++ b/build/cart-totals-block/block.json @@ -0,0 +1,35 @@ +{ + "name": "woocommerce/cart-totals-block", + "version": "1.0.0", + "title": "Cart Totals", + "description": "Column containing the cart totals.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "checkbox": { + "type": "boolean", + "default": false + }, + "text": { + "type": "string", + "required": false + }, + "lock": { + "type": "object", + "default": { + "remove": true + } + } + }, + "parent": [ "woocommerce/filled-cart-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/cart.asset.php b/build/cart.asset.php new file mode 100644 index 00000000000..c6511aa65be --- /dev/null +++ b/build/cart.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'eca5dddfd4ad3527250558e061f74923'); \ No newline at end of file diff --git a/build/cart.js b/build/cart.js new file mode 100644 index 00000000000..533d1f73767 --- /dev/null +++ b/build/cart.js @@ -0,0 +1,46 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks.cart=function(e){function t(t){for(var r,a,s=t[0],i=t[1],l=t[2],d=0,p=[];d{let{selected:t=[],search:c="",queryArgs:n={}}=e;const s=(e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const o=i.o.productCount>100,a={per_page:o?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},s=[Object(r.addQueryArgs)("/wc/store/v1/products",{...a,...n})];return o&&t.length&&s.push(Object(r.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),s})({selected:t,search:c,queryArgs:n});return Promise.all(s.map(e=>o()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>o()({path:"/wc/store/v1/products/"+e}),d=()=>o()({path:"wc/store/v1/products/attributes"}),p=e=>o()({path:`wc/store/v1/products/attributes/${e}/terms`}),b=e=>{let{selected:t=[],search:c}=e;const n=(e=>{let{selected:t=[],search:c}=e;const n=Object(s.getSetting)("limitTags",!1),o=[Object(r.addQueryArgs)("wc/store/v1/products/tags",{per_page:n?100:0,orderby:n?"count":"name",order:n?"desc":"asc",search:c})];return n&&t.length&&o.push(Object(r.addQueryArgs)("wc/store/v1/products/tags",{include:t})),o})({selected:t,search:c});return Promise.all(n.map(e=>o()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id"))},m=e=>o()({path:Object(r.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),g=e=>o()({path:"wc/store/v1/products/categories/"+e}),O=e=>o()({path:Object(r.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),h=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},function(e,t){e.exports=window.wc.priceFormat},function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return a}));var r=c(1),n=c(13);const o=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},a=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(n.decodeEntities)(e.message):Object(r.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},function(e,t,c){"use strict";var r=c(0),n=c(4),o=c.n(n);t.a=e=>{let t,{label:c,screenReaderLabel:n,wrapperElement:a,wrapperProps:s={}}=e;const i=null!=c,l=null!=n;return!i&&l?(t=a||"span",s={...s,className:o()(s.className,"screen-reader-text")},Object(r.createElement)(t,s,n)):(t=a||r.Fragment,i&&l&&c!==n?Object(r.createElement)(t,s,Object(r.createElement)("span",{"aria-hidden":"true"},c),Object(r.createElement)("span",{className:"screen-reader-text"},n)):Object(r.createElement)(t,s,c))}},,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return n}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function n(e,t){return r(e)&&t in e}},,function(e,t,c){"use strict";c.d(t,"c",(function(){return o})),c.d(t,"a",(function(){return i})),c.d(t,"b",(function(){return l})),c.d(t,"d",(function(){return d}));var r=c(35);let n,o;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(o||(o={}));const a=(e,t)=>Object(r.a)(e)&&"type"in e&&e.type===t,s=e=>a(e,n.SUCCESS),i=e=>a(e,n.ERROR),l=e=>a(e,n.FAIL),u=e=>!Object(r.a)(e)||void 0===e.retry||!0===e.retry,d=()=>({responseTypes:n,noticeContexts:o,shouldRetry:u,isSuccessResponse:s,isErrorResponse:i,isFailResponse:l})},function(e,t,c){"use strict";var r=c(6),n=c.n(r),o=c(0),a=c(126),s=c(4),i=c.n(s);c(131);const l=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:c,currency:r,onValueChange:s,displayType:u="text",...d}=e;const p="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(p))return null;const b=p/10**r.minorUnit;if(!Number.isFinite(b))return null;const m=i()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),g={...d,...l(r),value:void 0,currency:void 0,onValueChange:void 0},O=s?e=>{const t=+e.value*10**r.minorUnit;s(t)}:()=>{};return Object(o.createElement)(a.a,n()({className:m,displayType:u},g,{value:b,onValueChange:O}))}},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return E}));var r=c(7),n=c(0),o=c(17),a=c(9),s=c(13),i=c(237),l=c(59),u=c(236);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(a.dispatch)(o.CART_STORE_KEY).invalidateResolutionForStore()},p=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},b=()=>{Object(n.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.a)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.a)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),p),[])},m={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},g={...m,email:""},O={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:o.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},h=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,c]=e;return[t,Object(s.decodeEntities)(c)]})),j={cartCoupons:o.EMPTY_CART_COUPONS,cartItems:o.EMPTY_CART_ITEMS,cartFees:o.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:o.EMPTY_CART_ITEM_ERRORS,cartTotals:O,cartIsLoading:!0,cartErrors:o.EMPTY_CART_ERRORS,billingAddress:g,shippingAddress:m,shippingRates:o.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:o.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:o.EMPTY_EXTENSIONS},E=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:c}=Object(l.b)(),s=null==c?void 0:c.previewCart,{shouldSelect:u}=e,d=Object(n.useRef)();b();const p=Object(a.useSelect)((e,c)=>{let{dispatch:r}=c;if(!u)return j;if(t)return{cartCoupons:s.coupons,cartItems:s.items,cartFees:s.fees,cartItemsCount:s.items_count,cartItemsWeight:s.items_weight,cartNeedsPayment:s.needs_payment,cartNeedsShipping:s.needs_shipping,cartItemErrors:o.EMPTY_CART_ITEM_ERRORS,cartTotals:s.totals,cartIsLoading:!1,cartErrors:o.EMPTY_CART_ERRORS,billingData:g,billingAddress:g,shippingAddress:m,extensions:o.EMPTY_EXTENSIONS,shippingRates:s.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:s.has_calculated_shipping,paymentRequirements:s.paymentRequirements,receiveCart:"function"==typeof(null==s?void 0:s.receiveCart)?s.receiveCart:()=>{}};const n=e(o.CART_STORE_KEY),a=n.getCartData(),l=n.getCartErrors(),d=n.getCartTotals(),p=!n.hasFinishedResolution("getCartData"),b=n.isCustomerDataUpdating(),{receiveCart:O}=r(o.CART_STORE_KEY),E=h(a.billingAddress),_=a.needsShipping?h(a.shippingAddress):E,y=a.fees.length>0?a.fees.map(e=>h(e)):o.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map(e=>({...e,label:e.code})):o.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:y,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:d,cartIsLoading:p,cartErrors:l,billingData:Object(i.a)(E),billingAddress:Object(i.a)(E),shippingAddress:Object(i.a)(_),extensions:a.extensions,shippingRates:a.shippingRates,isLoadingRates:b,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:O}},[u]);return d.current&&Object(r.isEqual)(d.current,p)||(d.current=p),d.current}},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t,c){"use strict";var r=c(6),n=c.n(r),o=c(0),a=c(71),s=c(112);const i=["BUTTON","FIELDSET","INPUT","OPTGROUP","OPTION","SELECT","TEXTAREA","A"];t.a=e=>{let{children:t,style:c={},...r}=e;const l=Object(o.useRef)(null),u=()=>{l.current&&a.focus.focusable.find(l.current).forEach(e=>{i.includes(e.nodeName)&&e.setAttribute("tabindex","-1"),e.hasAttribute("contenteditable")&&e.setAttribute("contenteditable","false")})},d=Object(s.a)(u,0,{leading:!0});return Object(o.useLayoutEffect)(()=>{let e;return u(),l.current&&(e=new window.MutationObserver(d),e.observe(l.current,{childList:!0,attributes:!0,subtree:!0})),()=>{e&&e.disconnect(),d.cancel()}},[d]),Object(o.createElement)("div",n()({ref:l,"aria-disabled":"true",style:{userSelect:"none",pointerEvents:"none",cursor:"normal",...c}},r),t)}},,function(e,t){e.exports=window.wp.a11y},,,function(e,t){e.exports=window.wp.hooks},function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(0),n=c(22),o=c.n(n);function a(e){const t=Object(r.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},,function(e,t){e.exports=window.wp.deprecated},,function(e,t){e.exports=window.wp.keycodes},function(e,t,c){"use strict";c.d(t,"b",(function(){return M})),c.d(t,"a",(function(){return P}));var r=c(0),n=c(1),o=c(109),a=c(51),s=c.n(a),i=c(100),l=c(35),u=c(9);let d;!function(e){e.SET_IDLE="set_idle",e.SET_PRISTINE="set_pristine",e.SET_REDIRECT_URL="set_redirect_url",e.SET_COMPLETE="set_checkout_complete",e.SET_BEFORE_PROCESSING="set_before_processing",e.SET_AFTER_PROCESSING="set_after_processing",e.SET_PROCESSING_RESPONSE="set_processing_response",e.SET_PROCESSING="set_checkout_is_processing",e.SET_HAS_ERROR="set_checkout_has_error",e.SET_NO_ERROR="set_checkout_no_error",e.SET_CUSTOMER_ID="set_checkout_customer_id",e.SET_ORDER_ID="set_checkout_order_id",e.SET_ORDER_NOTES="set_checkout_order_notes",e.INCREMENT_CALCULATING="increment_calculating",e.DECREMENT_CALCULATING="decrement_calculating",e.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS="set_shipping_address_as_billing_address",e.SET_SHOULD_CREATE_ACCOUNT="set_should_create_account",e.SET_EXTENSION_DATA="set_extension_data"}(d||(d={}));const p=()=>({type:d.SET_IDLE}),b=e=>({type:d.SET_REDIRECT_URL,redirectUrl:e}),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:d.SET_COMPLETE,data:e}},g=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:e?d.SET_HAS_ERROR:d.SET_NO_ERROR}};var O=c(2),h=c(237);let j;!function(e){e.PRISTINE="pristine",e.IDLE="idle",e.PROCESSING="processing",e.COMPLETE="complete",e.BEFORE_PROCESSING="before_processing",e.AFTER_PROCESSING="after_processing"}(j||(j={}));const E={order_id:0,customer_id:0,billing_address:{},shipping_address:{},...Object(O.getSetting)("checkoutData",{})||{}},_={redirectUrl:"",status:j.PRISTINE,hasError:!1,calculatingCount:0,orderId:E.order_id,orderNotes:"",customerId:E.customer_id,useShippingAsBilling:Object(h.b)(E.billing_address,E.shipping_address),shouldCreateAccount:!1,processingResponse:null,extensionData:{}},y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_,{redirectUrl:t,type:c,customerId:r,orderId:n,orderNotes:o,extensionData:a,useShippingAsBilling:s,shouldCreateAccount:i,data:l}=arguments.length>1?arguments[1]:void 0,u=e;switch(c){case d.SET_PRISTINE:u=_;break;case d.SET_IDLE:u=e.status!==j.IDLE?{...e,status:j.IDLE}:e;break;case d.SET_REDIRECT_URL:u=void 0!==t&&t!==e.redirectUrl?{...e,redirectUrl:t}:e;break;case d.SET_PROCESSING_RESPONSE:u={...e,processingResponse:l};break;case d.SET_COMPLETE:u=e.status!==j.COMPLETE?{...e,status:j.COMPLETE,redirectUrl:"string"==typeof(null==l?void 0:l.redirectUrl)?l.redirectUrl:e.redirectUrl}:e;break;case d.SET_PROCESSING:u=e.status!==j.PROCESSING?{...e,status:j.PROCESSING,hasError:!1}:e,u=!1===u.hasError?u:{...u,hasError:!1};break;case d.SET_BEFORE_PROCESSING:u=e.status!==j.BEFORE_PROCESSING?{...e,status:j.BEFORE_PROCESSING,hasError:!1}:e;break;case d.SET_AFTER_PROCESSING:u=e.status!==j.AFTER_PROCESSING?{...e,status:j.AFTER_PROCESSING}:e;break;case d.SET_HAS_ERROR:u=e.hasError?e:{...e,hasError:!0},u=e.status===j.PROCESSING||e.status===j.BEFORE_PROCESSING?{...u,status:j.IDLE}:u;break;case d.SET_NO_ERROR:u=e.hasError?{...e,hasError:!1}:e;break;case d.INCREMENT_CALCULATING:u={...e,calculatingCount:e.calculatingCount+1};break;case d.DECREMENT_CALCULATING:u={...e,calculatingCount:Math.max(0,e.calculatingCount-1)};break;case d.SET_CUSTOMER_ID:u=void 0!==r?{...e,customerId:r}:e;break;case d.SET_ORDER_ID:u=void 0!==n?{...e,orderId:n}:e;break;case d.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS:void 0!==s&&s!==e.useShippingAsBilling&&(u={...e,useShippingAsBilling:s});break;case d.SET_SHOULD_CREATE_ACCOUNT:void 0!==i&&i!==e.shouldCreateAccount&&(u={...e,shouldCreateAccount:i});break;case d.SET_ORDER_NOTES:void 0!==o&&e.orderNotes!==o&&(u={...e,orderNotes:o});break;case d.SET_EXTENSION_DATA:void 0!==a&&e.extensionData!==a&&(u={...e,extensionData:a})}return u!==e&&c!==d.SET_PRISTINE&&u.status===j.PRISTINE&&(u.status=j.IDLE),u};var f=c(13),k=c(94),v=c(238);var w=c(239),S=c(102),C=c(78),N=c(37),I=c(116);const R=Object(r.createContext)({dispatchActions:{resetCheckout:()=>{},setRedirectUrl:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},incrementCalculating:()=>{},decrementCalculating:()=>{},setCustomerId:e=>{},setOrderId:e=>{},setOrderNotes:e=>{},setExtensionData:e=>{}},onSubmit:()=>{},isComplete:!1,isIdle:!1,isCalculating:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,redirectUrl:"",orderId:0,orderNotes:"",customerId:0,onCheckoutAfterProcessingWithSuccess:()=>()=>{},onCheckoutAfterProcessingWithError:()=>()=>{},onCheckoutBeforeProcessing:()=>()=>{},onCheckoutValidationBeforeProcessing:()=>()=>{},hasOrder:!1,isCart:!1,useShippingAsBilling:!1,setUseShippingAsBilling:e=>{},shouldCreateAccount:!1,setShouldCreateAccount:e=>{},extensionData:{}}),M=()=>Object(r.useContext)(R),P=e=>{let{children:t,redirectUrl:c,isCart:a=!1}=e;_.redirectUrl=c;const[O,h]=Object(r.useReducer)(y,_),{setValidationErrors:E}=Object(S.b)(),{createErrorNotice:M}=Object(u.useDispatch)("core/notices"),{dispatchCheckoutEvent:P}=Object(C.a)(),T=O.calculatingCount>0,{isSuccessResponse:A,isErrorResponse:x,isFailResponse:D,shouldRetry:L}=Object(N.d)(),{checkoutNotices:B,paymentNotices:U,expressPaymentNotices:F}=(()=>{const{noticeContexts:e}=Object(N.d)();return{checkoutNotices:Object(u.useSelect)(e=>e("core/notices").getNotices("wc/checkout"),[]),expressPaymentNotices:Object(u.useSelect)(t=>t("core/notices").getNotices(e.EXPRESS_PAYMENTS),[e.EXPRESS_PAYMENTS]),paymentNotices:Object(u.useSelect)(t=>t("core/notices").getNotices(e.PAYMENTS),[e.PAYMENTS])}})(),[z,V]=Object(r.useReducer)(k.b,{}),Y=Object(r.useRef)(z),{onCheckoutAfterProcessingWithSuccess:G,onCheckoutAfterProcessingWithError:q,onCheckoutValidationBeforeProcessing:H}=(e=>Object(r.useMemo)(()=>({onCheckoutAfterProcessingWithSuccess:Object(v.a)("checkout_after_processing_with_success",e),onCheckoutAfterProcessingWithError:Object(v.a)("checkout_after_processing_with_error",e),onCheckoutValidationBeforeProcessing:Object(v.a)("checkout_validation_before_processing",e)}),[e]))(V);Object(r.useEffect)(()=>{Y.current=z},[z]);const $=Object(r.useMemo)(()=>function(){return s()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidationBeforeProcessing",plugin:"WooCommerce Blocks"}),H(...arguments)},[H]),W=Object(r.useMemo)(()=>({resetCheckout:()=>{h({type:d.SET_PRISTINE})},setRedirectUrl:e=>{h(b(e))},setHasError:e=>{h(g(e))},incrementCalculating:()=>{h({type:d.INCREMENT_CALCULATING})},decrementCalculating:()=>{h({type:d.DECREMENT_CALCULATING})},setCustomerId:e=>{var t;h((t=e,{type:d.SET_CUSTOMER_ID,customerId:t}))},setOrderId:e=>{h((e=>({type:d.SET_ORDER_ID,orderId:e}))(e))},setOrderNotes:e=>{h((e=>({type:d.SET_ORDER_NOTES,orderNotes:e}))(e))},setExtensionData:e=>{h((e=>({type:d.SET_EXTENSION_DATA,extensionData:e}))(e))},setAfterProcessing:e=>{const t=(e=>{const t={message:"",paymentStatus:"",redirectUrl:"",paymentDetails:{}};return"payment_result"in e&&(t.paymentStatus=e.payment_result.payment_status,t.redirectUrl=e.payment_result.redirect_url,e.payment_result.hasOwnProperty("payment_details")&&Array.isArray(e.payment_result.payment_details)&&e.payment_result.payment_details.forEach(e=>{let{key:c,value:r}=e;t.paymentDetails[c]=Object(f.decodeEntities)(r)})),"message"in e&&(t.message=Object(f.decodeEntities)(e.message)),!t.message&&"data"in e&&"status"in e.data&&e.data.status>299&&(t.message=Object(n.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")),t})(e);var c;h(b((null==t?void 0:t.redirectUrl)||"")),h((c=t,{type:d.SET_PROCESSING_RESPONSE,data:c})),h({type:d.SET_AFTER_PROCESSING})}}),[]);Object(r.useEffect)(()=>{O.status===j.BEFORE_PROCESSING&&(Object(I.a)("error"),Object(w.a)(Y.current,"checkout_validation_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:c}=e;M(t,{context:"wc/checkout"}),E(c)}),h(p()),h(g())):h({type:d.SET_PROCESSING})}))},[O.status,E,M,h]);const Q=Object(o.a)(O.status),K=Object(o.a)(O.hasError);Object(r.useEffect)(()=>{if((O.status!==Q||O.hasError!==K)&&O.status===j.AFTER_PROCESSING){const e={redirectUrl:O.redirectUrl,orderId:O.orderId,customerId:O.customerId,orderNotes:O.orderNotes,processingResponse:O.processingResponse};O.hasError?Object(w.b)(Y.current,"checkout_after_processing_with_error",e).then(t=>{const c=(e=>{let t=null;return e.forEach(e=>{if((x(e)||D(e))&&e.message&&Object(i.a)(e.message)){const c=e.messageContext&&Object(i.a)(e.messageContent)?{context:e.messageContext}:void 0;t=e,M(e.message,c)}}),t})(t);if(null!==c)L(c)?h(p()):h(m(c));else{if(!(B.some(e=>"error"===e.status)||F.some(e=>"error"===e.status)||U.some(e=>"error"===e.status))){var r;const t=(null===(r=e.processingResponse)||void 0===r?void 0:r.message)||Object(n.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");M(t,{id:"checkout",context:"wc/checkout"})}h(p())}}):Object(w.b)(Y.current,"checkout_after_processing_with_success",e).then(e=>{let t=null,c=null;if(e.forEach(e=>{A(e)&&(t=e),(x(e)||D(e))&&(c=e)}),t&&!c)h(m(t));else if(Object(l.a)(c)){if(c.message&&Object(i.a)(c.message)){const e=c.messageContext&&Object(i.a)(c.messageContext)?{context:c.messageContext}:void 0;M(c.message,e)}L(c)?h(g(!0)):h(m(c))}else h(m())})}},[O.status,O.hasError,O.redirectUrl,O.orderId,O.customerId,O.orderNotes,O.processingResponse,Q,K,W,M,x,D,A,L,B,F,U]);const X={onSubmit:Object(r.useCallback)(()=>{P("submit"),h({type:d.SET_BEFORE_PROCESSING})},[P]),isComplete:O.status===j.COMPLETE,isIdle:O.status===j.IDLE,isCalculating:T,isProcessing:O.status===j.PROCESSING,isBeforeProcessing:O.status===j.BEFORE_PROCESSING,isAfterProcessing:O.status===j.AFTER_PROCESSING,hasError:O.hasError,redirectUrl:O.redirectUrl,onCheckoutBeforeProcessing:$,onCheckoutValidationBeforeProcessing:H,onCheckoutAfterProcessingWithSuccess:G,onCheckoutAfterProcessingWithError:q,dispatchActions:W,isCart:a,orderId:O.orderId,hasOrder:!!O.orderId,customerId:O.customerId,orderNotes:O.orderNotes,useShippingAsBilling:O.useShippingAsBilling,setUseShippingAsBilling:e=>{return h((t=e,{type:d.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS,useShippingAsBilling:t}));var t},shouldCreateAccount:O.shouldCreateAccount,setShouldCreateAccount:e=>{return h((t=e,{type:d.SET_SHOULD_CREATE_ACCOUNT,shouldCreateAccount:t}));var t},extensionData:O.extensionData};return Object(r.createElement)(R.Provider,{value:X},t)}},,,,,function(e,t,c){"use strict";c.d(t,"b",(function(){return a})),c.d(t,"a",(function(){return s}));var r=c(0),n=c(9);const o=Object(r.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),a=()=>Object(r.useContext)(o),s=e=>{let{children:t,currentPostId:c=0,currentView:a="",previewData:s={}}=e;const i=Object(n.useSelect)(e=>c||e("core/editor").getCurrentPostId(),[c]),l=Object(r.useCallback)(e=>e in s?s[e]:{},[s]),u={isEditor:!0,currentPostId:i,currentView:a,previewData:s,getPreviewData:l};return Object(r.createElement)(o.Provider,{value:u},t)}},function(e,t){e.exports=window.wp.autop},,,,,,,,function(e,t,c){"use strict";var r=c(6),n=c.n(r),o=c(0),a=c(130),s=c(4),i=c.n(s),l=c(91);c(153),t.a=e=>{let{className:t,showSpinner:c=!1,children:r,variant:s="contained",...u}=e;const d=i()("wc-block-components-button",t,s,{"wc-block-components-button--loading":c});return Object(o.createElement)(a.a,n()({className:d},u),c&&Object(o.createElement)(l.a,null),Object(o.createElement)("span",{className:"wc-block-components-button__text"},r))}},function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(4),a=c.n(o),s=(c(251),c(91));t.a=e=>{let{children:t,className:c,screenReaderLabel:o,showSpinner:i=!1,isLoading:l=!0}=e;return Object(r.createElement)("div",{className:a()(c,{"wc-block-components-loading-mask":l})},l&&i&&Object(r.createElement)(s.a,null),Object(r.createElement)("div",{className:a()({"wc-block-components-loading-mask__children":l}),"aria-hidden":l},t),l&&Object(r.createElement)("span",{className:"screen-reader-text"},o||Object(n.__)("Loading…","woo-gutenberg-products-block")))}},,function(e,t){e.exports=window.wp.dom},function(e,t,c){"use strict";c.d(t,"b",(function(){return a})),c.d(t,"a",(function(){return s}));var r=c(0),n=c(88);const o=Object(r.createContext)({isInitialized:!1,billingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},setBillingAddress:()=>{},setShippingAddress:()=>{}}),a=()=>Object(r.useContext)(o),s=e=>{let{children:t}=e;const c=Object(n.a)();return Object(r.createElement)(o.Provider,{value:c},t)}},,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(48),n=c(0),o=c(41);const a=()=>{const e=Object(o.a)(),t=Object(n.useRef)(e);return Object(n.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(n.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(n.useCallback)((function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...c,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},function(e,t,c){"use strict";var r=c(0),n=c(4),o=c.n(n);c(186),t.a=e=>{let{children:t,className:c}=e;return Object(r.createElement)("div",{className:o()("wc-block-components-product-badge",c)},t)}},function(e,t,c){"use strict";c.d(t,"a",(function(){return d}));var r=c(17),n=c(9),o=c(0),a=c(22),s=c.n(a),i=c(35),l=c(312),u=c(110);const d=()=>{const{shippingRates:e,needsShipping:t,hasCalculatedShipping:c,isLoadingRates:a}=Object(n.useSelect)(e=>{const t=!!e("core/editor"),c=e(r.CART_STORE_KEY);return{shippingRates:t?l.a.shipping_rates:c.getShippingRates(),needsShipping:t?l.a.needs_shipping:c.getNeedsShipping(),hasCalculatedShipping:t?l.a.has_calculated_shipping:c.getHasCalculatedShipping(),isLoadingRates:!t&&c.isCustomerDataUpdating()}}),{isSelectingRate:d,selectShippingRate:p}=Object(u.a)(),b=Object(o.useRef)({});return Object(o.useEffect)(()=>{const t=(e=>Object.fromEntries(e.map(e=>{var t;let{package_id:c,shipping_rates:r}=e;return[c,null===(t=r.find(e=>e.selected))||void 0===t?void 0:t.rate_id]})))(e);Object(i.a)(t)&&!s()(b.current,t)&&(b.current=t)},[e]),{isSelectingRate:d,selectedRates:b.current,selectShippingRate:p,shippingRates:e,needsShipping:t,hasCalculatedShipping:c,isLoadingRates:a}}},,,,,,,function(e,t){e.exports=window.wp.wordcount},function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(9),n=c(17);const o=()=>{const{customerData:e,isInitialized:t}=Object(r.useSelect)(e=>{const t=e(n.CART_STORE_KEY);return{customerData:t.getCustomerData(),isInitialized:t.hasFinishedResolution("getCartData")}}),{setShippingAddress:c,setBillingAddress:o}=Object(r.useDispatch)(n.CART_STORE_KEY);return{isInitialized:t,billingAddress:e.billingAddress,shippingAddress:e.shippingAddress,setBillingAddress:o,setShippingAddress:c}}},,function(e,t,c){"use strict";var r=c(2),n=c(1),o=c(159),a=c(100);const s=Object(r.getSetting)("countryLocale",{}),i=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(n.sprintf)( +/* translators: %s Field label. */ +Object(n.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(o.a)(e.priority)&&(t.index=e.priority),Object(a.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},l=Object.entries(s).map(e=>{let[t,c]=e;return[t,Object.entries(c).map(e=>{let[t,c]=e;return[t,i(c)]}).reduce((e,t)=>{let[c,r]=t;return e[c]=r,e},{})]}).reduce((e,t)=>{let[c,r]=t;return e[c]=r,e},{});t.a=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=c&&void 0!==l[c]?l[c]:{};return e.map(e=>({key:e,...r.defaultAddressFields[e]||{},...n[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},function(e,t,c){"use strict";var r=c(0);c(154),t.a=()=>Object(r.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(38),a=c(4),s=c.n(a),i=c(26);c(152);const l=e=>{let{currency:t,maxPrice:c,minPrice:a,priceClassName:l,priceStyle:u={}}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(n.sprintf)( +/* translators: %1$s min price, %2$s max price */ +Object(n.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(i.formatPrice)(a),Object(i.formatPrice)(c))),Object(r.createElement)("span",{"aria-hidden":!0},Object(r.createElement)(o.a,{className:s()("wc-block-components-product-price__value",l),currency:t,value:a,style:u})," — ",Object(r.createElement)(o.a,{className:s()("wc-block-components-product-price__value",l),currency:t,value:c,style:u})))},u=e=>{let{currency:t,regularPriceClassName:c,regularPriceStyle:a,regularPrice:i,priceClassName:l,priceStyle:u,price:d}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(n.__)("Previous price:","woo-gutenberg-products-block")),Object(r.createElement)(o.a,{currency:t,renderText:e=>Object(r.createElement)("del",{className:s()("wc-block-components-product-price__regular",c),style:a},e),value:i}),Object(r.createElement)("span",{className:"screen-reader-text"},Object(n.__)("Discounted price:","woo-gutenberg-products-block")),Object(r.createElement)(o.a,{currency:t,renderText:e=>Object(r.createElement)("ins",{className:s()("wc-block-components-product-price__value","is-discounted",l),style:u},e),value:d}))};t.a=e=>{let{align:t,className:c,currency:n,format:a="",maxPrice:i,minPrice:d,price:p,priceClassName:b,priceStyle:m,regularPrice:g,regularPriceClassName:O,regularPriceStyle:h}=e;const j=s()(c,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+t]:t});a.includes("")||(a="",console.error("Price formats need to include the `` tag."));const E=g&&p!==g;let _=Object(r.createElement)("span",{className:s()("wc-block-components-product-price__value",b)});return E?_=Object(r.createElement)(u,{currency:n,price:p,priceClassName:b,priceStyle:m,regularPrice:g,regularPriceClassName:O,regularPriceStyle:h}):void 0!==d&&void 0!==i?_=Object(r.createElement)(l,{currency:n,maxPrice:i,minPrice:d,priceClassName:b,priceStyle:m}):p&&(_=Object(r.createElement)(o.a,{className:s()("wc-block-components-product-price__value",b),currency:n,value:p,style:m})),Object(r.createElement)("span",{className:j},Object(r.createInterpolateElement)(a,{price:_}))}},,function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return s}));var r=c(7);let n;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));const o={addEventCallback:function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(r.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:c}},removeEventCallback:(e,t)=>({id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e})},a={},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,{type:t,eventType:c,id:r,callback:o,priority:s}=arguments.length>1?arguments[1]:void 0;const i=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(t){case n.ADD_EVENT_CALLBACK:return i.set(r,{priority:s,callback:o}),{...e,[c]:i};case n.REMOVE_EVENT_CALLBACK:return i.delete(r),{...e,[c]:i}}}},,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r=e=>"string"==typeof e},function(e,t){e.exports=window.wp.warning},function(e,t,c){"use strict";c.d(t,"b",(function(){return i})),c.d(t,"a",(function(){return l}));var r=c(0),n=c(7),o=c(22),a=c.n(o);const s=Object(r.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),i=()=>Object(r.useContext)(s),l=e=>{let{children:t}=e;const[c,o]=Object(r.useState)({}),i=Object(r.useCallback)(e=>c[e],[c]),l=Object(r.useCallback)(e=>{const t=c[e];return!t||t.hidden?"":"validate-error-"+e},[c]),u=Object(r.useCallback)(e=>{o(t=>{if(!t[e])return t;const{[e]:c,...r}=t;return r})},[]),d=Object(r.useCallback)(()=>{o({})},[]),p=Object(r.useCallback)(e=>{e&&o(t=>(e=Object(n.pickBy)(e,(e,c)=>!("string"!=typeof e.message||t.hasOwnProperty(c)&&a()(t[c],e))),0===Object.values(e).length?t:{...t,...e}))},[]),b=Object(r.useCallback)((e,t)=>{o(c=>{if(!c.hasOwnProperty(e))return c;const r={...c[e],...t};return a()(c[e],r)?c:{...c,[e]:r}})},[]),m={getValidationError:i,setValidationErrors:p,clearValidationError:u,clearAllValidationErrors:d,hideValidationError:Object(r.useCallback)(e=>{b(e,{hidden:!0})},[b]),showValidationError:Object(r.useCallback)(e=>{b(e,{hidden:!1})},[b]),showAllValidationErrors:Object(r.useCallback)(()=>{o(e=>{const t={};return Object.keys(e).forEach(c=>{e[c].hidden&&(t[c]={...e[c],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:l};return Object(r.createElement)(s.Provider,{value:m},t)}},,function(e,t,c){"use strict";c.d(t,"b",(function(){return _})),c.d(t,"a",(function(){return y}));var r=c(0);const n={NONE:"none",INVALID_ADDRESS:"invalid_address",UNKNOWN:"unknown_error"},o={INVALID_COUNTRY:"woocommerce_rest_cart_shipping_rates_invalid_country",MISSING_COUNTRY:"woocommerce_rest_cart_shipping_rates_missing_country",INVALID_STATE:"woocommerce_rest_cart_shipping_rates_invalid_state"},a={shippingErrorStatus:{isPristine:!0,isValid:!1,hasInvalidAddress:!1,hasError:!1},dispatchErrorStatus:()=>null,shippingErrorTypes:n,shippingRates:[],isLoadingRates:!1,selectedRates:[],setSelectedRates:()=>null,shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},setShippingAddress:()=>null,onShippingRateSuccess:()=>null,onShippingRateFail:()=>null,onShippingRateSelectSuccess:()=>null,onShippingRateSelectFail:()=>null,needsShipping:!1},s=(e,t)=>{let{type:c}=t;return Object.values(n).includes(c)?c:e};var i=c(94),l=c(238);const u=e=>({onSuccess:Object(l.a)("shipping_rates_success",e),onFail:Object(l.a)("shipping_rates_fail",e),onSelectSuccess:Object(l.a)("shipping_rate_select_success",e),onSelectFail:Object(l.a)("shipping_rate_select_fail",e)});var d=c(239),p=c(54),b=c(41),m=c(110),g=c(80);const{NONE:O,INVALID_ADDRESS:h,UNKNOWN:j}=n,E=Object(r.createContext)(a),_=()=>Object(r.useContext)(E),y=e=>{let{children:t}=e;const{dispatchActions:c}=Object(p.b)(),{shippingRates:a,isLoadingRates:l,cartErrors:_}=Object(b.a)(),{isSelectingRate:y}=Object(m.a)(),{selectedRates:f}=Object(g.a)(),[k,v]=Object(r.useReducer)(s,O),[w,S]=Object(r.useReducer)(i.b,{}),C=Object(r.useRef)(w),N=Object(r.useMemo)(()=>({onShippingRateSuccess:u(S).onSuccess,onShippingRateFail:u(S).onFail,onShippingRateSelectSuccess:u(S).onSelectSuccess,onShippingRateSelectFail:u(S).onSelectFail}),[S]);Object(r.useEffect)(()=>{C.current=w},[w]),Object(r.useEffect)(()=>{l?c.incrementCalculating():c.decrementCalculating()},[l,c]),Object(r.useEffect)(()=>{y?c.incrementCalculating():c.decrementCalculating()},[y,c]),Object(r.useEffect)(()=>{_.length>0&&_.some(e=>!(!e.code||!Object.values(o).includes(e.code)))?v({type:h}):v({type:O})},[_]);const I=Object(r.useMemo)(()=>({isPristine:k===O,isValid:k===O,hasInvalidAddress:k===h,hasError:k===j||k===h}),[k]);Object(r.useEffect)(()=>{l||0!==a.length&&!I.hasError||Object(d.a)(C.current,"shipping_rates_fail",{hasInvalidAddress:I.hasInvalidAddress,hasError:I.hasError})},[a,l,I.hasError,I.hasInvalidAddress]),Object(r.useEffect)(()=>{!l&&a.length>0&&!I.hasError&&Object(d.a)(C.current,"shipping_rates_success",a)},[a,l,I.hasError]),Object(r.useEffect)(()=>{y||(I.hasError?Object(d.a)(C.current,"shipping_rate_select_fail",{hasError:I.hasError,hasInvalidAddress:I.hasInvalidAddress}):Object(d.a)(C.current,"shipping_rate_select_success",f.current))},[f,y,I.hasError,I.hasInvalidAddress]);const R={shippingErrorStatus:I,dispatchErrorStatus:v,shippingErrorTypes:n,...N};return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(E.Provider,{value:R},t))}},,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(12);function n(e,t){const c=Object(r.useRef)();return Object(r.useEffect)(()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)},[e,t]),c.current}},function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var r=c(9),n=c(0),o=c(17),a=c(124),s=c(78);const i=()=>{const e=Object(a.a)(),{dispatchCheckoutEvent:t}=Object(s.a)(),{selectShippingRate:c}=Object(r.useDispatch)(o.CART_STORE_KEY);return{selectShippingRate:Object(n.useCallback)((r,n)=>{c(r,n).then(()=>{t("set-selected-shipping-rate",{shippingRateId:r})}).catch(t=>{e(t)})},[c,t,e]),isSelectingRate:Object(r.useSelect)(e=>e(o.CART_STORE_KEY).isShippingRateBeingSelected(),[])}}},,,,,function(e,t,c){"use strict";var r=c(6),n=c.n(r),o=c(0),a=c(13),s=c(4),i=c.n(s);c(151),t.a=e=>{let{className:t="",disabled:c=!1,name:r,permalink:s="",target:l,rel:u,style:d,onClick:p,...b}=e;const m=i()("wc-block-components-product-name",t);if(c){const e=b;return Object(o.createElement)("span",n()({className:m},e,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(r)}}))}return Object(o.createElement)("a",n()({className:m,href:s,target:l},b,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(r)},style:d}))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(9);const n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const c=Object(r.select)("core/notices").getNotices(),{removeNotice:n}=Object(r.dispatch)("core/notices"),o=c.filter(t=>t.status===e);o.forEach(e=>n(e.id,t))}},function(e,t,c){"use strict";var r=c(0),n=c(87),o=c(60);const a=e=>{const t=e.indexOf("

");return-1===t?e:e.substr(0,t+4)},s=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),i=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,l=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…";const r=s(e),n=r.split(" ").splice(0,t).join(" ");return Object(o.autop)(i(n,c))},u=function(e,t){let c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…";const n=s(e),a=n.slice(0,t);if(c)return Object(o.autop)(i(a,r));const l=a.match(/([\s]+)/g),u=l?l.length:0,d=n.slice(0,t+u);return Object(o.autop)(i(d,r))};t.a=e=>{let{source:t,maxLength:c=15,countType:s="words",className:i="",style:d={}}=e;const p=Object(r.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const r=Object(o.autop)(e),s=Object(n.count)(r,c);if(s<=t)return r;const i=a(r),d=Object(n.count)(i,c);return d<=t?i:"words"===c?l(i,t):u(i,t,"characters_including_spaces"===c)}(t,c,s),[t,c,s]);return Object(r.createElement)(r.RawHTML,{style:d,className:i},p)}},function(e,t,c){"use strict";var r=c(0),n=c(4),o=c.n(n),a=c(135);t.a=e=>{let{checked:t,name:c,onChange:n,option:s}=e;const{value:i,label:l,description:u,secondaryLabel:d,secondaryDescription:p}=s;return Object(r.createElement)("label",{className:o()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":t}),htmlFor:`${c}-${i}`},Object(r.createElement)("input",{id:`${c}-${i}`,className:"wc-block-components-radio-control__input",type:"radio",name:c,value:i,onChange:e=>n(e.target.value),checked:t,"aria-describedby":o()({[`${c}-${i}__label`]:l,[`${c}-${i}__secondary-label`]:d,[`${c}-${i}__description`]:u,[`${c}-${i}__secondary-description`]:p})}),Object(r.createElement)(a.a,{id:`${c}-${i}`,label:l,secondaryLabel:d,description:u,secondaryDescription:p}))}},,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(0);const n=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},,,function(e,t,c){"use strict";var r=c(24),n=c.n(r),o=c(0),a=c(12),s=c(1),i=c(23),l=e=>{let{imageUrl:t=i.m+"/block-error.svg",header:c=Object(s.__)("Oops!","woo-gutenberg-products-block"),text:r=Object(s.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:n,errorMessagePrefix:a=Object(s.__)("Error:","woo-gutenberg-products-block"),button:l,showErrorBlock:u=!0}=e;return u?Object(o.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(o.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(o.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},c&&Object(o.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},c),r&&Object(o.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},r),n&&Object(o.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},a?a+" ":"",n),l&&Object(o.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};c(192);class u extends a.Component{constructor(){super(...arguments),n()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(o.createElement)(o.Fragment,null,Object(o.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:c=!0,showErrorBlock:r=!0,text:n,errorMessagePrefix:a,renderError:s,button:i}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof s?s({errorMessage:u}):Object(o.createElement)(l,{showErrorBlock:r,errorMessage:c?u:null,header:e,imageUrl:t,text:n,errorMessagePrefix:a,button:i}):this.props.children}}t.a=u},,,,function(e,t){},,,,function(e,t,c){"use strict";var r=c(0);t.a=e=>{let{label:t,secondaryLabel:c,description:n,secondaryDescription:o,id:a}=e;return Object(r.createElement)("div",{className:"wc-block-components-radio-control__option-layout"},Object(r.createElement)("div",{className:"wc-block-components-radio-control__label-group"},t&&Object(r.createElement)("span",{id:a&&a+"__label",className:"wc-block-components-radio-control__label"},t),c&&Object(r.createElement)("span",{id:a&&a+"__secondary-label",className:"wc-block-components-radio-control__secondary-label"},c)),Object(r.createElement)("div",{className:"wc-block-components-radio-control__description-group"},n&&Object(r.createElement)("span",{id:a&&a+"__description",className:"wc-block-components-radio-control__description"},n),o&&Object(r.createElement)("span",{id:a&&a+"__secondary-description",className:"wc-block-components-radio-control__secondary-description"},o)))}},function(e,t,c){"use strict";var r=c(6),n=c.n(r),o=c(0),a=c(4),s=c.n(a);c(262),t.a=e=>{let{children:t,className:c,headingLevel:r,...a}=e;const i=s()("wc-block-components-title",c),l="h"+r;return Object(o.createElement)(l,n()({className:i},a),t)}},,,,,,,,,function(e,t,c){"use strict";c.d(t,"b",(function(){return o})),c.d(t,"a",(function(){return a}));var r=c(0);const n=Object(r.createContext)({setIsSuppressed:e=>{},isSuppressed:!1}),o=()=>Object(r.useContext)(n),a=e=>{let{children:t}=e;const[c,o]=Object(r.useState)(!1),a={setIsSuppressed:o,isSuppressed:c};return Object(r.createElement)(n.Provider,{value:a},t)}},,,function(e,t,c){"use strict";var r=c(6),n=c.n(r),o=c(0),a=c(4),s=c.n(a);const i=e=>"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--"+e;var l=e=>{let{id:t,src:c=null,alt:r=""}=e;return c?Object(o.createElement)("img",{className:i(t),src:c,alt:r}):null},u=c(23);const d=[{id:"alipay",alt:"Alipay",src:u.m+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:u.m+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:u.m+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:u.m+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:u.m+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:u.m+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:u.m+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:u.m+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:u.m+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:u.m+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:u.m+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:u.m+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:u.m+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:u.m+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:u.m+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:u.m+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:u.m+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:u.m+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:u.m+"payment-methods/wechat.svg"}];var p=c(100);c(189),t.a=e=>{let{icons:t=[],align:c="center",className:r}=e;const a=(e=>{const t={};return e.forEach(e=>{let c={};"string"==typeof e&&(c={id:e,alt:e,src:null}),"object"==typeof e&&(c={id:e.id||"",alt:e.alt||"",src:e.src||null}),c.id&&Object(p.a)(c.id)&&!t[c.id]&&(t[c.id]=c)}),Object.values(t)})(t);if(0===a.length)return null;const i=s()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===c,"wc-block-components-payment-method-icons--align-right":"right"===c},r);return Object(o.createElement)("div",{className:i},a.map(e=>{const t={...e,...(c=e.id,d.find(e=>e.id===c)||{})};var c;return Object(o.createElement)(l,n()({key:"payment-method-icon-"+e.id},t))}))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var r=c(0),n=c(1),o=c(113),a=c(329),s=c(235);c(266);const i=e=>{let{text:t,url:c="https://ideas.woocommerce.com/forums/133476-woocommerce?category_id=384565"}=e;const[i,l]=Object(r.useState)(!1);return Object(r.useEffect)(()=>{l(!0)},[]),i&&Object(r.createElement)("div",{className:"wc-block-feedback-prompt"},Object(r.createElement)(o.a,{icon:a.a}),Object(r.createElement)("h2",{className:"wc-block-feedback-prompt__title"},Object(n.__)("Feedback?","woo-gutenberg-products-block")),Object(r.createElement)("p",{className:"wc-block-feedback-prompt__text"},t),Object(r.createElement)("a",{href:c,className:"wc-block-feedback-prompt__link",rel:"noreferrer noopener",target:"_blank"},Object(n.__)("Give us your feedback.","woo-gutenberg-products-block"),Object(r.createElement)(o.a,{icon:s.a,size:16})))},l=()=>Object(r.createElement)(i,{text:Object(n.__)("We are currently working on improving our cart and checkout blocks to provide merchants with the tools and customization options they need.","woo-gutenberg-products-block"),url:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/new?template=--cart-checkout-feedback.md"})},,function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r=e=>"number"==typeof e},function(e,t,c){"use strict";var r=c(24),n=c.n(r),o=c(0),a=c(1),s=c(12),i=c(2),l=c(228),u=c(37);class d extends s.Component{constructor(){super(...arguments),n()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return{errorMessage:e.message,hasError:!0}}render(){const{hasError:e,errorMessage:t}=this.state,{isEditor:c}=this.props;if(e){let e=Object(a.__)("This site is experiencing difficulties with this payment method. Please contact the owner of the site for assistance.","woo-gutenberg-products-block");(c||i.CURRENT_USER_IS_ADMIN)&&(e=t||Object(a.__)("There was an error with this payment method. Please verify it's configured correctly.","woo-gutenberg-products-block"));const r=[{id:"0",content:e,isDismissible:!1,status:"error"}];return Object(o.createElement)(l.a,{additionalNotices:r,context:u.c.PAYMENTS})}return this.props.children}}d.defaultProps={isEditor:!1},t.a=d},function(e,t,c){"use strict";var r=c(0),n=c(4),o=c.n(n),a=c(10),s=c(118);c(260);const i=e=>{let{className:t="",id:c,selected:n,onChange:l,options:u=[]}=e;const d=Object(a.useInstanceId)(i),p=c||d;return u.length?Object(r.createElement)("div",{className:o()("wc-block-components-radio-control",t)},u.map(e=>Object(r.createElement)(s.a,{key:`${p}-${e.value}`,name:"radio-control-"+p,checked:e.value===n,option:e,onChange:t=>{l(t),"function"==typeof e.onChange&&e.onChange(t)}}))):null};t.a=i},,,function(e,t,c){"use strict";c.d(t,"b",(function(){return U})),c.d(t,"a",(function(){return F}));var r=c(0),n=c(35),o=c(9);let a,s;!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(a||(a={})),function(e){e.SET_REGISTERED_PAYMENT_METHODS="set_registered_payment_methods",e.SET_REGISTERED_EXPRESS_PAYMENT_METHODS="set_registered_express_payment_methods",e.SET_SHOULD_SAVE_PAYMENT_METHOD="set_should_save_payment_method",e.SET_ACTIVE_PAYMENT_METHOD="set_active_payment_method"}(s||(s={}));const i={currentStatus:a.PRISTINE,shouldSavePaymentMethod:!1,activePaymentMethod:"",paymentMethodData:{payment_method:""},errorMessage:"",paymentMethods:{},expressPaymentMethods:{}},l={setPaymentStatus:()=>({pristine:()=>{},started:()=>{},processing:()=>{},completed:()=>{},error:e=>{},failed:(e,t)=>{},success:(e,t)=>{}}),currentStatus:{isPristine:!0,isStarted:!1,isProcessing:!1,isFinished:!1,hasError:!1,hasFailed:!1,isSuccessful:!1,isDoingExpressPayment:!1},paymentStatuses:a,paymentMethodData:{},errorMessage:"",activePaymentMethod:"",activeSavedToken:"",setActivePaymentMethod:()=>{},customerPaymentMethods:{},paymentMethods:{},expressPaymentMethods:{},paymentMethodsInitialized:!1,expressPaymentMethodsInitialized:!1,onPaymentProcessing:()=>()=>()=>{},setExpressPaymentError:()=>{},isExpressPaymentMethodActive:!1,setShouldSavePayment:()=>{},shouldSavePayment:!1};var u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,{type:t,paymentMethodData:c,shouldSavePaymentMethod:r=!1,errorMessage:n="",paymentMethods:o={},paymentMethod:l=""}=arguments.length>1?arguments[1]:void 0;switch(t){case a.PRISTINE:return{...i,...e,errorMessage:"",currentStatus:a.PRISTINE};case a.STARTED:return{...e,currentStatus:a.STARTED};case a.ERROR:return e.currentStatus!==a.ERROR?{...e,currentStatus:a.ERROR,errorMessage:n||e.errorMessage}:e;case a.FAILED:return e.currentStatus!==a.FAILED?{...e,currentStatus:a.FAILED,paymentMethodData:c||e.paymentMethodData,errorMessage:n||e.errorMessage}:e;case a.SUCCESS:return e.currentStatus!==a.SUCCESS?{...e,currentStatus:a.SUCCESS,paymentMethodData:c||e.paymentMethodData}:e;case a.PROCESSING:return e.currentStatus!==a.PROCESSING?{...e,currentStatus:a.PROCESSING,errorMessage:""}:e;case a.COMPLETE:return e.currentStatus!==a.COMPLETE?{...e,currentStatus:a.COMPLETE}:e;case s.SET_REGISTERED_PAYMENT_METHODS:return{...e,paymentMethods:o};case s.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:return{...e,expressPaymentMethods:o};case s.SET_SHOULD_SAVE_PAYMENT_METHOD:return{...e,shouldSavePaymentMethod:r};case s.SET_ACTIVE_PAYMENT_METHOD:return{...e,activePaymentMethod:l,paymentMethodData:c||e.paymentMethodData}}},d=c(1),p=c(42),b=c(49),m=c(2),g=c(112),O=c(51),h=c.n(O),j=c(59),E=c(72),_=c(41),y=c(37),f=c(80);const k=(e,t,c,n)=>{const[a,s]=Object(r.useState)(!1),{isEditor:i}=Object(j.b)(),{selectedRates:l}=Object(f.a)(),{billingAddress:u,shippingAddress:p}=Object(E.b)(),O=Object(b.a)(l),y=Object(b.a)(c),k=Object(_.a)(),{cartTotals:v,cartIsLoading:w,cartNeedsShipping:S,paymentRequirements:C}=k,N=Object(r.useRef)({cart:k,cartTotals:v,cartNeedsShipping:S,billingData:u,billingAddress:u,shippingAddress:p,selectedShippingMethods:O,paymentRequirements:C}),{createErrorNotice:I}=Object(o.useDispatch)("core/notices");Object(r.useEffect)(()=>{N.current={cart:k,cartTotals:v,cartNeedsShipping:S,get billingData(){return h()("billingData",{alternative:"billingAddress",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-blocks/pull/6369"}),this.billingAddress},billingAddress:u,shippingAddress:p,selectedShippingMethods:O,paymentRequirements:C}},[k,v,S,u,p,O,C]);const R=Object(r.useCallback)(async()=>{let c={};const r=e=>{c={...c,[e.name]:e}};for(let e=0;e{w||M()},[M,k,O,u,w]),a},v=e=>({type:e}),w=e=>({type:a.ERROR,errorMessage:e}),S=e=>{let{errorMessage:t,paymentMethodData:c}=e;return{type:a.FAILED,errorMessage:t,paymentMethodData:c}},C=e=>{let{paymentMethodData:t}=e;return{type:a.SUCCESS,paymentMethodData:t}},N=e=>({type:s.SET_REGISTERED_PAYMENT_METHODS,paymentMethods:e}),I=e=>({type:s.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,paymentMethods:e}),R=e=>({type:s.SET_SHOULD_SAVE_PAYMENT_METHOD,shouldSavePaymentMethod:e}),M=(e,t)=>({type:s.SET_ACTIVE_PAYMENT_METHOD,paymentMethod:e,paymentMethodData:t});var P=c(88),T=c(54),A=c(94),x=c(238);var D=c(239),L=c(102);const B=Object(r.createContext)(l),U=()=>Object(r.useContext)(B),F=e=>{let{children:t}=e;const{isProcessing:c,isIdle:s,isCalculating:l,hasError:d}=Object(T.b)(),{isEditor:b,getPreviewData:g}=Object(j.b)(),{setValidationErrors:O}=Object(L.b)(),{createErrorNotice:h,removeNotice:E}=Object(o.useDispatch)("core/notices"),{isSuccessResponse:_,isErrorResponse:f,isFailResponse:U,noticeContexts:F}=Object(y.d)(),[z,V]=Object(r.useReducer)(A.b,{}),{onPaymentProcessing:Y}=(e=>Object(r.useMemo)(()=>({onPaymentProcessing:Object(x.a)("payment_processing",e)}),[e]))(V),G=Object(r.useRef)(z);Object(r.useEffect)(()=>{G.current=z},[z]);const[q,H]=Object(r.useReducer)(u,i),{dispatchActions:$,setPaymentStatus:W}=(e=>{const{setBillingAddress:t,setShippingAddress:c}=Object(P.a)();return{dispatchActions:Object(r.useMemo)(()=>({setRegisteredPaymentMethods:t=>{e(N(t))},setRegisteredExpressPaymentMethods:t=>{e(I(t))},setShouldSavePayment:t=>{e(R(t))},setActivePaymentMethod:function(t){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e(M(t,c))}}),[e]),setPaymentStatus:Object(r.useCallback)(()=>({pristine:()=>e(v(a.PRISTINE)),started:()=>e(v(a.STARTED)),processing:()=>e(v(a.PROCESSING)),completed:()=>e(v(a.COMPLETE)),error:t=>e(w(t)),failed:function(c,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;n&&t(n),e(S({errorMessage:c||"",paymentMethodData:r||{}}))},success:function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;n&&t(n),void 0!==typeof o&&null!=o&&o.address&&c(o.address),e(C({paymentMethodData:r}))}}),[e,t,c])}})(H),Q=(e=>{const t=Object(p.getPaymentMethods)(),{noticeContexts:c}=Object(y.d)(),r=new Set([...Object(m.getSetting)("paymentGatewaySortOrder",[]),...Object.keys(t)]);return k(e,t,Array.from(r),c.PAYMENTS)})($.setRegisteredPaymentMethods),K=(e=>{const t=Object(p.getExpressPaymentMethods)(),{noticeContexts:c}=Object(y.d)();return k(e,t,Object.keys(t),c.EXPRESS_PAYMENTS)})($.setRegisteredExpressPaymentMethods),X=Object(r.useMemo)(()=>b?g("previewSavedPaymentMethods"):Q?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===Object.keys(e).length)return{};const t=Object(m.getSetting)("customerPaymentMethods",{}),c=Object.keys(t),r={};return c.forEach(c=>{const n=t[c].filter(t=>{var c;let{method:{gateway:r}}=t;return r in e&&(null===(c=e[r].supports)||void 0===c?void 0:c.showSavedCards)});n.length&&(r[c]=n)}),r}(q.paymentMethods):{},[b,g,Q,q.paymentMethods]),Z=Object(r.useCallback)(e=>{e?h(e,{id:"wc-express-payment-error",context:F.EXPRESS_PAYMENTS}):E("wc-express-payment-error",F.EXPRESS_PAYMENTS)},[h,F.EXPRESS_PAYMENTS,E]),J=Object.keys(q.expressPaymentMethods).includes(q.activePaymentMethod),ee=Object(r.useMemo)(()=>({isPristine:q.currentStatus===a.PRISTINE,isStarted:q.currentStatus===a.STARTED,isProcessing:q.currentStatus===a.PROCESSING,isFinished:[a.ERROR,a.FAILED,a.SUCCESS].includes(q.currentStatus),hasError:q.currentStatus===a.ERROR,hasFailed:q.currentStatus===a.FAILED,isSuccessful:q.currentStatus===a.SUCCESS,isDoingExpressPayment:q.currentStatus!==a.PRISTINE&&J}),[q.currentStatus,J]);Object(r.useEffect)(()=>{const e=Object.keys(q.paymentMethods);if(!Q||!e.length)return;const t=[...e,...Object.keys(q.expressPaymentMethods)];if(q.activePaymentMethod&&t.includes(q.activePaymentMethod))return;W().pristine();const c=Object.keys(X).flatMap(e=>X[e])[0]||void 0;if(c){const e=c.tokenId.toString(),t=c.method.gateway,r=`wc-${t}-payment-token`;$.setActivePaymentMethod(t,{token:e,payment_method:t,[r]:e,isSavedToken:!0})}else $.setActivePaymentMethod(Object.keys(q.paymentMethods)[0])},[Q,q.paymentMethods,q.expressPaymentMethods,$,W,q.activePaymentMethod,X]),Object(r.useEffect)(()=>{!c||d||l||ee.isFinished||W().processing()},[c,d,l,ee.isFinished,W]),Object(r.useEffect)(()=>{s&&!ee.isSuccessful&&W().pristine()},[s,ee.isSuccessful,W]),Object(r.useEffect)(()=>{d&&ee.isSuccessful&&W().pristine()},[d,ee.isSuccessful,W]),Object(r.useEffect)(()=>{ee.isProcessing&&(E("wc-payment-error",F.PAYMENTS),Object(D.b)(G.current,"payment_processing",{}).then(e=>{let t,c;var r,n,o,a,s,i;if(e.forEach(e=>{_(e)&&(t=e),(f(e)||U(e))&&(c=e)}),t&&!c)W().success(null===(r=t)||void 0===r||null===(n=r.meta)||void 0===n?void 0:n.paymentMethodData,null===(o=t)||void 0===o||null===(a=o.meta)||void 0===a?void 0:a.billingAddress,null===(s=t)||void 0===s||null===(i=s.meta)||void 0===i?void 0:i.shippingData);else if(c&&U(c)){var l,u,d,p,b,m;c.message&&c.message.length&&h(c.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(m=c)||void 0===m?void 0:m.messageContext)||F.PAYMENTS}),W().failed(null===(l=c)||void 0===l?void 0:l.message,null===(u=c)||void 0===u||null===(d=u.meta)||void 0===d?void 0:d.paymentMethodData,null===(p=c)||void 0===p||null===(b=p.meta)||void 0===b?void 0:b.billingAddress)}else if(c){var g,j;c.message&&c.message.length&&h(c.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(j=c)||void 0===j?void 0:j.messageContext)||F.PAYMENTS}),W().error(c.message),O(null===(g=c)||void 0===g?void 0:g.validationErrors)}else W().success()}))},[ee.isProcessing,O,W,E,F.PAYMENTS,_,U,f,h]);const te="object"==typeof q.paymentMethodData&&Object(n.b)(q.paymentMethodData,"token")?q.paymentMethodData.token+"":"",ce={setPaymentStatus:W,currentStatus:ee,paymentStatuses:a,paymentMethodData:q.paymentMethodData,errorMessage:q.errorMessage,activePaymentMethod:q.activePaymentMethod,activeSavedToken:te,setActivePaymentMethod:$.setActivePaymentMethod,onPaymentProcessing:Y,customerPaymentMethods:X,paymentMethods:q.paymentMethods,expressPaymentMethods:q.expressPaymentMethods,paymentMethodsInitialized:Q,expressPaymentMethodsInitialized:K,setExpressPaymentError:Z,isExpressPaymentMethodActive:J,shouldSavePayment:q.shouldSavePaymentMethod,setShouldSavePayment:$.setShouldSavePayment};return Object(r.createElement)(B.Provider,{value:ce},t)}},,,,,,,function(e,t,c){"use strict";c.d(t,"b",(function(){return a})),c.d(t,"a",(function(){return s}));var r=c(49),n=c(164);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{paymentMethods:t,expressPaymentMethods:c,paymentMethodsInitialized:o,expressPaymentMethodsInitialized:a}=Object(n.b)(),s=Object(r.a)(t),i=Object(r.a)(c);return{paymentMethods:e?i:s,isInitialized:e?a:o}},a=()=>o(!1),s=()=>o(!0)},,function(e,t){},,,,,,,,,function(e,t){},,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(280),a=c(171),s=c(59),i=c(164),l=c(51),u=c.n(l),d=c(160);t.a=()=>{const{isEditor:e}=Object(s.b)(),{setActivePaymentMethod:t,setExpressPaymentError:c,activePaymentMethod:l,paymentMethodData:p,setPaymentStatus:b}=Object(i.b)(),m=Object(o.a)(),{paymentMethods:g}=Object(a.a)(),O=Object(r.useRef)(l),h=Object(r.useRef)(p),j=Object(r.useCallback)(e=>()=>{O.current=l,h.current=p,b().started(),t(e)},[l,p,t,b]),E=Object(r.useCallback)(()=>{b().pristine(),t(O.current,h.current)},[t,b]),_=Object(r.useCallback)(e=>{b().error(e),c(e),t(O.current,h.current)},[t,b,c]),y=Object(r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";u()("Express Payment Methods should use the provided onError handler instead.",{alternative:"onError",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),e?_(e):c("")}),[c,_]),f=Object.entries(g),k=f.length>0?f.map(t=>{let[c,n]=t;const o=e?n.edit:n.content;return Object(r.isValidElement)(o)?Object(r.createElement)("li",{key:c,id:"express-payment-method-"+c},Object(r.cloneElement)(o,{...m,onClick:j(c),onClose:E,onError:_,setExpressPaymentError:y})):null}):Object(r.createElement)("li",{key:"noneRegistered"},Object(n.__)("No registered Payment Methods","woo-gutenberg-products-block"));return Object(r.createElement)(d.a,{isEditor:e},Object(r.createElement)("ul",{className:"wc-block-components-express-payment__event-buttons"},k))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var r=c(1),n=c(9),o=c(17),a=c(13),s=c(41),i=c(102);const l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{cartCoupons:t,cartIsLoading:c}=Object(s.a)(),{createErrorNotice:l}=Object(n.useDispatch)("core/notices"),{createNotice:u}=Object(n.useDispatch)("core/notices"),{setValidationErrors:d}=Object(i.b)(),{applyCoupon:p,removeCoupon:b,isApplyingCoupon:m,isRemovingCoupon:g}=Object(n.useSelect)((e,t)=>{let{dispatch:c}=t;const r=e(o.CART_STORE_KEY),n=c(o.CART_STORE_KEY);return{applyCoupon:n.applyCoupon,removeCoupon:n.removeCoupon,isApplyingCoupon:r.isApplyingCoupon(),isRemovingCoupon:r.isRemovingCoupon(),receiveApplyingCoupon:n.receiveApplyingCoupon}},[l,u]),O=t=>{p(t).then(c=>{!0===c&&u("info",Object(r.sprintf)( +/* translators: %s coupon code. */ +Object(r.__)('Coupon code "%s" has been applied to your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(e=>{d({coupon:{message:Object(a.decodeEntities)(e.message),hidden:!1}}),receiveApplyingCoupon("")})},h=t=>{b(t).then(c=>{!0===c&&u("info",Object(r.sprintf)( +/* translators: %s coupon code. */ +Object(r.__)('Coupon code "%s" has been removed from your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(t=>{l(t.message,{id:"coupon-form",context:e}),receiveApplyingCoupon("")})};return{appliedCoupons:t,isLoading:c,applyCoupon:O,removeCoupon:h,isApplyingCoupon:m,isRemovingCoupon:g}}},function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(3),a=c(9),s=c(25);t.a=e=>{let{setPageId:t,pageId:c,labels:i}=e;const l=Object(a.useSelect)(e=>e("core").getEntityRecords("postType","page",{status:"publish",orderby:"title",order:"asc",per_page:100}),[])||null;return l?Object(r.createElement)(o.PanelBody,{title:i.title},Object(r.createElement)(o.SelectControl,{label:Object(n.__)("Link to","woo-gutenberg-products-block"),value:c,options:[{label:i.default,value:0},...l.map(e=>({label:Object(s.a)(e,l),value:parseInt(e.id,10)}))],onChange:e=>t(parseInt(e,10))})):null}},function(e,t){e.exports=window.wp.plugins},function(e,t,c){"use strict";var r=c(0),n=c(4),o=c.n(n),a=c(1),s=c(45),i=c(53),l=c(112);c(249);var u=e=>{let{className:t,quantity:c=1,minimum:n=1,maximum:u,onChange:d=(()=>{}),step:p=1,itemName:b="",disabled:m}=e;const g=o()("wc-block-components-quantity-selector",t),O=void 0!==u,h=c-p>=n,j=!O||c+p<=u,E=Object(r.useCallback)(e=>{let t=e;O&&(t=Math.min(t,Math.floor(u/p)*p)),t=Math.max(t,Math.ceil(n/p)*p),t=Math.floor(t/p)*p,t!==e&&d(t)},[O,u,n,d,p]),_=Object(l.a)(E,300);Object(r.useLayoutEffect)(()=>{E(c)},[c,E]);const y=Object(r.useCallback)(e=>{const t=void 0!==typeof e.key?"ArrowDown"===e.key:e.keyCode===i.DOWN,r=void 0!==typeof e.key?"ArrowUp"===e.key:e.keyCode===i.UP;t&&h&&(e.preventDefault(),d(c-p)),r&&j&&(e.preventDefault(),d(c+p))},[c,d,j,h,p]);return Object(r.createElement)("div",{className:g},Object(r.createElement)("input",{className:"wc-block-components-quantity-selector__input",disabled:m,type:"number",step:p,min:n,max:u,value:c,onKeyDown:y,onChange:e=>{let t=parseInt(e.target.value,10);t=isNaN(t)?c:t,t!==c&&(d(t),_(t))},"aria-label":Object(a.sprintf)( +/* translators: %s refers to the item name in the cart. */ +Object(a.__)("Quantity of %s in your cart.","woo-gutenberg-products-block"),b)}),Object(r.createElement)("button",{"aria-label":Object(a.__)("Reduce quantity","woo-gutenberg-products-block"),className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus",disabled:m||!h,onClick:()=>{const e=c-p;d(e),Object(s.speak)(Object(a.sprintf)( +/* translators: %s refers to the item name in the cart. */ +Object(a.__)("Quantity reduced to %s.","woo-gutenberg-products-block"),e)),E(e)}},"-"),Object(r.createElement)("button",{"aria-label":Object(a.__)("Increase quantity","woo-gutenberg-products-block"),disabled:m||!j,className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus",onClick:()=>{const e=c+p;d(e),Object(s.speak)(Object(a.sprintf)( +/* translators: %s refers to the item name in the cart. */ +Object(a.__)("Quantity increased to %s.","woo-gutenberg-products-block"),e)),E(e)}},"+"))},d=c(92),p=c(115),b=c(9),m=c(17),g=c(284),O=c(109),h=c(236),j=c(35),E=c(100),_=c(159),y=c(41),f=c(54);var k=c(78),v=c(222),w=c(223),S=c(224),C=c(38),N=c(79),I=e=>{let{currency:t,saleAmount:c,format:n=""}=e;if(!c||c<=0)return null;n.includes("")||(n="",console.error("Price formats need to include the `` tag."));const o=Object(a.sprintf)( +/* translators: %s will be replaced by the discount amount */ +Object(a.__)("Save %s","woo-gutenberg-products-block"),n);return Object(r.createElement)(N.a,{className:"wc-block-components-sale-badge"},Object(r.createInterpolateElement)(o,{price:Object(r.createElement)(C.a,{currency:t,value:c})}))},R=c(225),M=c(26),P=c(18),T=c(111),A=c(2);const x=(e,t)=>e.convertPrecision(t.minorUnit).getAmount(),D=e=>Object(P.mustContain)(e,"");var L=Object(r.forwardRef)((e,t)=>{let{lineItem:c,onRemove:n=(()=>{}),tabIndex:i=null}=e;const{name:l="",catalog_visibility:C="visible",short_description:N="",description:L="",low_stock_remaining:B=null,show_backorder_badge:U=!1,quantity_limits:F={minimum:1,maximum:99,multiple_of:1,editable:!0},sold_individually:z=!1,permalink:V="",images:Y=[],variation:G=[],item_data:q=[],prices:H={currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",price:"0",regular_price:"0",sale_price:"0",price_range:null,raw_prices:{precision:6,price:"0",regular_price:"0",sale_price:"0"}},totals:$={currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",line_subtotal:"0",line_subtotal_tax:"0"},extensions:W}=c,{quantity:Q,setItemQuantity:K,removeItem:X,isPendingDelete:Z}=(e=>{const t={key:"",quantity:1};(e=>Object(j.a)(e)&&Object(j.b)(e,"key")&&Object(j.b)(e,"quantity")&&Object(E.a)(e.key)&&Object(_.a)(e.quantity))(e)&&(t.key=e.key,t.quantity=e.quantity);const{key:c="",quantity:n=1}=t,{cartErrors:o}=Object(y.a)(),{dispatchActions:a}=Object(f.b)(),[s,i]=Object(r.useState)(n),[l]=Object(g.a)(s,400),u=Object(O.a)(l),{removeItemFromCart:d,changeCartItemQuantity:p}=Object(b.useDispatch)(m.CART_STORE_KEY);Object(r.useEffect)(()=>i(n),[n]);const k=Object(b.useSelect)(e=>{if(!c)return{quantity:!1,delete:!1};const t=e(m.CART_STORE_KEY);return{quantity:t.isItemPendingQuantity(c),delete:t.isItemPendingDelete(c)}},[c]),v=Object(r.useCallback)(()=>c?d(c).then(()=>(Object(h.c)(),!0)):Promise.resolve(!1),[c,d]);return Object(r.useEffect)(()=>{c&&Object(_.a)(u)&&Number.isFinite(u)&&u!==l&&p(c,l)},[c,p,l,u]),Object(r.useEffect)(()=>(k.delete?a.incrementCalculating():a.decrementCalculating(),()=>{k.delete&&a.decrementCalculating()}),[a,k.delete]),Object(r.useEffect)(()=>(k.quantity||l!==s?a.incrementCalculating():a.decrementCalculating(),()=>{(k.quantity||l!==s)&&a.decrementCalculating()}),[a,k.quantity,l,s]),{isPendingDelete:k.delete,quantity:s,setItemQuantity:i,removeItem:v,cartItemQuantityErrors:o}})(c),{dispatchStoreEvent:J}=Object(k.a)(),{receiveCart:ee,...te}=Object(y.a)(),ce=Object(r.useMemo)(()=>({context:"cart",cartItem:c,cart:te}),[c,te]),re=Object(M.getCurrencyFromPriceResponse)(H),ne=Object(P.__experimentalApplyCheckoutFilter)({filterName:"itemName",defaultValue:l,extensions:W,arg:ce}),oe=Object(T.a)({amount:parseInt(H.raw_prices.regular_price,10),precision:H.raw_prices.precision}),ae=Object(T.a)({amount:parseInt(H.raw_prices.price,10),precision:H.raw_prices.precision}),se=oe.subtract(ae),ie=se.multiply(Q),le=Object(M.getCurrencyFromPriceResponse)($);let ue=parseInt($.line_subtotal,10);Object(A.getSetting)("displayCartPricesIncludingTax",!1)&&(ue+=parseInt($.line_subtotal_tax,10));const de=Object(T.a)({amount:ue,precision:le.minorUnit}),pe=Y.length?Y[0]:{},be="hidden"===C||"search"===C,me=Object(P.__experimentalApplyCheckoutFilter)({filterName:"cartItemClass",defaultValue:"",extensions:W,arg:ce}),ge=Object(P.__experimentalApplyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"",extensions:W,arg:ce,validation:D}),Oe=Object(P.__experimentalApplyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"",extensions:W,arg:ce,validation:D}),he=Object(P.__experimentalApplyCheckoutFilter)({filterName:"saleBadgePriceFormat",defaultValue:"",extensions:W,arg:ce,validation:D});return Object(r.createElement)("tr",{className:o()("wc-block-cart-items__row",me,{"is-disabled":Z}),ref:t,tabIndex:i},Object(r.createElement)("td",{className:"wc-block-cart-item__image","aria-hidden":!Object(j.b)(pe,"alt")||!pe.alt},be?Object(r.createElement)(v.a,{image:pe,fallbackAlt:ne}):Object(r.createElement)("a",{href:V,tabIndex:-1},Object(r.createElement)(v.a,{image:pe,fallbackAlt:ne}))),Object(r.createElement)("td",{className:"wc-block-cart-item__product"},Object(r.createElement)("div",{className:"wc-block-cart-item__wrap"},Object(r.createElement)(p.a,{disabled:Z||be,name:ne,permalink:V}),U?Object(r.createElement)(w.a,null):!!B&&Object(r.createElement)(S.a,{lowStockRemaining:B}),Object(r.createElement)("div",{className:"wc-block-cart-item__prices"},Object(r.createElement)(d.a,{currency:re,regularPrice:x(oe,re),price:x(ae,re),format:Oe})),Object(r.createElement)(I,{currency:re,saleAmount:x(se,re),format:he}),Object(r.createElement)(R.a,{shortDescription:N,fullDescription:L,itemData:q,variation:G}),Object(r.createElement)("div",{className:"wc-block-cart-item__quantity"},!z&&!!F.editable&&Object(r.createElement)(u,{disabled:Z,quantity:Q,minimum:F.minimum,maximum:F.maximum,step:F.multiple_of,onChange:e=>{K(e),J("cart-set-item-quantity",{product:c,quantity:e})},itemName:ne}),Object(r.createElement)("button",{className:"wc-block-cart-item__remove-link",onClick:()=>{n(),X(),J("cart-remove-item",{product:c,quantity:Q}),Object(s.speak)(Object(a.sprintf)( +/* translators: %s refers to the item name in the cart. */ +Object(a.__)("%s has been removed from your cart.","woo-gutenberg-products-block"),ne))},disabled:Z},Object(a.__)("Remove item","woo-gutenberg-products-block"))))),Object(r.createElement)("td",{className:"wc-block-cart-item__total"},Object(r.createElement)("div",{className:"wc-block-cart-item__total-price-and-sale-badge-wrapper"},Object(r.createElement)(d.a,{currency:le,format:ge,price:de.getAmount()}),Q>1&&Object(r.createElement)(I,{currency:re,saleAmount:x(ie,re),format:he}))))});const B=[...Array(3)].map((_x,e)=>Object(r.createElement)(L,{lineItem:{},key:e})),U=e=>{const t={};return e.forEach(e=>{let{key:c}=e;t[c]=Object(r.createRef)()}),t};t.a=e=>{let{lineItems:t=[],isLoading:c=!1,className:n}=e;const s=Object(r.useRef)(null),i=Object(r.useRef)(U(t));Object(r.useEffect)(()=>{i.current=U(t)},[t]);const l=e=>()=>{null!=i&&i.current&&e&&i.current[e].current instanceof HTMLElement?i.current[e].current.focus():s.current instanceof HTMLElement&&s.current.focus()},u=c?B:t.map((e,c)=>{const n=t.length>c+1?t[c+1].key:null;return Object(r.createElement)(L,{key:e.key,lineItem:e,onRemove:l(n),ref:i.current[e.key],tabIndex:-1})});return Object(r.createElement)("table",{className:o()("wc-block-cart-items",n),ref:s,tabIndex:-1},Object(r.createElement)("thead",null,Object(r.createElement)("tr",{className:"wc-block-cart-items__header"},Object(r.createElement)("th",{className:"wc-block-cart-items__header-image"},Object(r.createElement)("span",null,Object(a.__)("Product","woo-gutenberg-products-block"))),Object(r.createElement)("th",{className:"wc-block-cart-items__header-product"},Object(r.createElement)("span",null,Object(a.__)("Details","woo-gutenberg-products-block"))),Object(r.createElement)("th",{className:"wc-block-cart-items__header-total"},Object(r.createElement)("span",null,Object(a.__)("Total","woo-gutenberg-products-block"))))),Object(r.createElement)("tbody",null,u))}},,function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(45),a=c(69),s=c(18),i=c(420),l=c(41),u=c(59),d=c(4),p=c.n(d),b=c(13),m=c(28),g=c(110),O=c(161),h=c(135),j=c(26),E=c(38),_=c(2);const y=e=>{const t=Object(_.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(b.decodeEntities)(e.name),value:e.rate_id,description:Object(r.createElement)(r.Fragment,null,Number.isFinite(t)&&Object(r.createElement)(E.a,{currency:Object(j.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,Object(b.decodeEntities)(e.delivery_time))}};var f=e=>{let{className:t="",noResultsMessage:c,onSelectRate:n,rates:o,renderOption:a=y,selectedRate:s}=e;const i=(null==s?void 0:s.rate_id)||"",[l,u]=Object(r.useState)(i);if(Object(r.useEffect)(()=>{i&&u(i)},[i]),0===o.length)return c;if(o.length>1)return Object(r.createElement)(O.a,{className:t,onChange:e=>{u(e),n(e)},selected:l,options:o.map(a)});const{label:d,secondaryLabel:p,description:b,secondaryDescription:m}=a(o[0]);return Object(r.createElement)(h.a,{label:d,secondaryLabel:p,description:b,secondaryDescription:m})};c(259);var k=e=>{let{packageId:t,className:c="",noResultsMessage:o,renderOption:a,packageData:i,collapsible:l=!1,collapse:u=!1,showItems:d=!1}=e;const{selectShippingRate:O}=Object(g.a)(),h=Object(r.createElement)(r.Fragment,null,(d||l)&&Object(r.createElement)("div",{className:"wc-block-components-shipping-rates-control__package-title"},i.name),d&&Object(r.createElement)("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(i.items).map(e=>{const t=Object(b.decodeEntities)(e.name),c=e.quantity;return Object(r.createElement)("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},Object(r.createElement)(m.a,{label:c>1?`${t} × ${c}`:""+t,screenReaderLabel:Object(n.sprintf)( +/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */ +Object(n._n)("%1$s (%2$d unit)","%1$s (%2$d units)",c,"woo-gutenberg-products-block"),t,c)}))}))),j=Object(r.createElement)(f,{className:c,noResultsMessage:o,rates:i.shipping_rates,onSelectRate:e=>O(e,t),selectedRate:i.shipping_rates.find(e=>e.selected),renderOption:a});return l?Object(r.createElement)(s.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!u,title:h},j):Object(r.createElement)("div",{className:p()("wc-block-components-shipping-rates-control__package",c)},h,j)};const v=e=>{let{packages:t,collapse:c,showItems:n,collapsible:o,noResultsMessage:a,renderOption:s}=e;return t.length?Object(r.createElement)(r.Fragment,null,t.map(e=>{let{package_id:i,...l}=e;return Object(r.createElement)(k,{key:i,packageId:i,packageData:l,collapsible:!!o,collapse:!!c,showItems:n||t.length>1,noResultsMessage:a,renderOption:s})})):null};t.a=e=>{let{shippingRates:t,isLoadingRates:c,className:d,collapsible:p=!1,noResultsMessage:b,renderOption:m,context:g}=e;Object(r.useEffect)(()=>{if(c)return;const e=Object(i.a)(t),r=Object(i.b)(t);1===e?Object(o.speak)(Object(n.sprintf)( +/* translators: %d number of shipping options found. */ +Object(n._n)("%d shipping option was found.","%d shipping options were found.",r,"woo-gutenberg-products-block"),r)):Object(o.speak)(Object(n.sprintf)( +/* translators: %d number of shipping packages packages. */ +Object(n._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",e,"woo-gutenberg-products-block"),e)+" "+Object(n.sprintf)( +/* translators: %d number of shipping options available. */ +Object(n._n)("%d shipping option was found","%d shipping options were found",r,"woo-gutenberg-products-block"),r))},[c,t]);const{extensions:O,receiveCart:h,...j}=Object(l.a)(),E={className:d,collapsible:p,noResultsMessage:b,renderOption:m,extensions:O,cart:j,components:{ShippingRatesControlPackage:k},context:g,shippingRates:t},{isEditor:_}=Object(u.b)();return Object(r.createElement)(a.a,{isLoading:c,screenReaderLabel:Object(n.__)("Loading shipping rates…","woo-gutenberg-products-block"),showSpinner:!0},_?Object(r.createElement)(v,{packages:t,noResultsMessage:b,renderOption:m}):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(s.ExperimentalOrderShippingPackages.Slot,E),Object(r.createElement)(s.ExperimentalOrderShippingPackages,null,Object(r.createElement)(v,{showItems:t.length>1,packages:t,noResultsMessage:b,renderOption:m}))))}},,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(0),n=c(102);c(173);const o=e=>{let{errorMessage:t="",propertyName:c="",elementId:o=""}=e;const{getValidationError:a,getValidationErrorId:s}=Object(n.b)();if(!t||"string"!=typeof t){const e=a(c)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(r.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(r.createElement)("p",{id:s(o)},t))}},function(e,t,c){"use strict";var r=c(6),n=c.n(r),o=c(0),a=c(13),s=c(2);c(185),t.a=e=>{let{image:t={},fallbackAlt:c=""}=e;const r=t.thumbnail?{src:t.thumbnail,alt:Object(a.decodeEntities)(t.alt)||c||"Product Image"}:{src:s.PLACEHOLDER_IMG_SRC,alt:""};return Object(o.createElement)("img",n()({className:"wc-block-components-product-image"},r,{alt:r.alt}))}},function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(79);t.a=()=>Object(r.createElement)(o.a,{className:"wc-block-components-product-backorder-badge"},Object(n.__)("Available on backorder","woo-gutenberg-products-block"))},function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(79);t.a=e=>{let{lowStockRemaining:t}=e;return t?Object(r.createElement)(o.a,{className:"wc-block-components-product-low-stock-badge"},Object(n.sprintf)( +/* translators: %d stock amount (number of items in stock for product) */ +Object(n.__)("%d left in stock","woo-gutenberg-products-block"),t)):null}},function(e,t,c){"use strict";var r=c(0),n=c(7),o=c(13);c(188);var a=e=>{let{details:t=[]}=e;return Array.isArray(t)?(t=t.filter(e=>!e.hidden),0===t.length?null:Object(r.createElement)("ul",{className:"wc-block-components-product-details"},t.map(e=>{const t=(null==e?void 0:e.key)||e.name||"",c=t?"wc-block-components-product-details__"+Object(n.kebabCase)(t):"";return Object(r.createElement)("li",{key:t+(e.display||e.value),className:c},t&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"wc-block-components-product-details__name"},Object(o.decodeEntities)(t),":")," "),Object(r.createElement)("span",{className:"wc-block-components-product-details__value"},Object(o.decodeEntities)(e.display||e.value)))}))):null},s=c(117),i=c(23),l=e=>{let{className:t,shortDescription:c="",fullDescription:n=""}=e;const o=c||n;return o?Object(r.createElement)(s.a,{className:t,source:o,maxLength:15,countType:i.o.wordCountType||"words"}):null};c(187),t.a=e=>{let{shortDescription:t="",fullDescription:c="",itemData:n=[],variation:o=[]}=e;return Object(r.createElement)("div",{className:"wc-block-components-product-metadata"},Object(r.createElement)(l,{className:"wc-block-components-product-metadata__description",shortDescription:t,fullDescription:c}),Object(r.createElement)(a,{details:n}),Object(r.createElement)(a,{details:o.map(e=>{let{attribute:t="",value:c}=e;return{key:t,value:c}})}))}},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return p}));var r=c(6),n=c.n(r),o=c(0),a=c(4),s=c.n(a),i=c(283),l=c(9),u=(c(182),c(145));const d=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""},p=e=>{let{className:t,context:c="default",additionalNotices:r=[]}=e;const{isSuppressed:a}=Object(u.b)(),{notices:p}=Object(l.useSelect)(e=>({notices:e("core/notices").getNotices(c)})),{removeNotice:b}=Object(l.useDispatch)("core/notices"),m=p.filter(e=>"snackbar"!==e.type).concat(r);if(!m.length)return null;const g=s()(t,"wc-block-components-notices");return a?null:Object(o.createElement)("div",{className:g},m.map(e=>Object(o.createElement)(i.a,n()({key:"store-notice-"+e.id},e,{className:s()("wc-block-components-notices__notice",d(e)),onRemove:()=>{e.isDismissible&&b(e.id,c)}}),e.content)))}},,,,function(e,t,c){"use strict";var r=c(6),n=c.n(r),o=c(0),a=c(4),s=c.n(a),i=c(1),l=c(113),u=c(521);c(184);var d=e=>{let{text:t,screenReaderText:c="",element:r="li",className:a="",radius:i="small",children:l=null,...u}=e;const d=r,p=s()(a,"wc-block-components-chip","wc-block-components-chip--radius-"+i),b=Boolean(c&&c!==t);return Object(o.createElement)(d,n()({className:p},u),Object(o.createElement)("span",{"aria-hidden":b,className:"wc-block-components-chip__text"},t),b&&Object(o.createElement)("span",{className:"screen-reader-text"},c),l)};t.a=e=>{let{ariaLabel:t="",className:c="",disabled:r=!1,onRemove:a=(()=>{}),removeOnAnyClick:p=!1,text:b,screenReaderText:m="",...g}=e;const O=p?"span":"button";if(!t){const e=m&&"string"==typeof m?m:b;t="string"!=typeof e? +/* translators: Remove chip. */ +Object(i.__)("Remove","woo-gutenberg-products-block"):Object(i.sprintf)( +/* translators: %s text of the chip to remove. */ +Object(i.__)('Remove "%s"',"woo-gutenberg-products-block"),e)}const h={"aria-label":t,disabled:r,onClick:a,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||a()}},j=p?h:{},E=p?{"aria-hidden":!0}:h;return Object(o.createElement)(d,n()({},g,j,{className:s()(c,"is-removable"),element:p?"button":g.element,screenReaderText:m,text:b}),Object(o.createElement)(O,n()({className:"wc-block-components-chip__remove"},E),Object(o.createElement)(l.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},,,,function(e,t,c){"use strict";c.d(t,"c",(function(){return a})),c.d(t,"b",(function(){return s})),c.d(t,"a",(function(){return i}));const r=window.CustomEvent||null,n=(e,t)=>{let{bubbles:c=!1,cancelable:n=!1,element:o,detail:a={}}=t;if(!r)return;o||(o=document.body);const s=new r(e,{bubbles:c,cancelable:n,detail:a});o.dispatchEvent(s)};let o;const a=()=>{o&&clearTimeout(o),o=setTimeout(()=>{n("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},s=e=>{let{preserveCartData:t=!1}=e;n("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},i=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const o=()=>{n(t,{bubbles:c,cancelable:r})};return jQuery(document).on(e,o),()=>jQuery(document).off(e,o)}},function(e,t,c){"use strict";c.d(t,"b",(function(){return o})),c.d(t,"a",(function(){return a}));var r=c(90),n=(c(15),c(2));const o=(e,t)=>Object.keys(n.defaultAddressFields).every(c=>e[c]===t[c]),a=e=>{const t=Object.keys(n.defaultAddressFields),c=Object(r.a)(t,{},e.country),o=Object.assign({},e);return c.forEach(t=>{let{key:c="",hidden:r=!1}=t;r&&((e,t)=>e in t)(c,e)&&(o[c]="")}),o}},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(94);const n=(e,t)=>function(c){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const o=r.a.addEventCallback(e,c,n);return t(o),()=>{t(r.a.removeEventCallback(e,o.id))}}},function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return a}));const r=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var n=c(37);const o=async(e,t,c)=>{const n=r(e,t),o=[];for(const e of n)try{const t=await Promise.resolve(e.callback(c));"object"==typeof t&&o.push(t)}catch(e){console.error(e)}return!o.length||o},a=async(e,t,c)=>{const o=[],a=r(e,t);for(const e of a)try{const t=await Promise.resolve(e.callback(c));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(n.a)(t)||Object(n.b)(t))return o.push(t),o;o.push(t)}catch(e){return console.error(e),o.push({type:"error"}),o}return o}},,,,,function(e,t,c){"use strict";var r=c(0),n=c(11);const o=Object(r.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));t.a=o},,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,c){"use strict";var r=c(0),n=c(10),o=c(5),a=c(48),s=c(3),i=c(1);c(264);const l=[],u=e=>{let{block:t}=e;const[c,n]=(e=>{const[t,c]=((e,t)=>{const[c,n]=Object(r.useState)(()=>{const c=window.localStorage.getItem(e);if(c)try{return JSON.parse(c)}catch{console.error(`Value for key '${e}' could not be retrieved from localStorage because it can't be parsed.`)}return t});return Object(r.useEffect)(()=>{try{window.localStorage.setItem(e,JSON.stringify(c))}catch{console.error(`Value for key '${e}' could not be saved in localStorage because it can't be converted into a string.`)}},[e,c]),[c,n]})("wc-blocks_dismissed_sidebar_compatibility_notices",l),[n,o]=Object(r.useState)(!1),a=t.includes(e);return Object(r.useEffect)(()=>{o(!a)},[a]),[n,()=>{const r=new Set(t);r.add(e),c([...r])}]})(t),o=Object(r.createInterpolateElement)(Object(i.__)("The Cart & Checkout Blocks are a beta feature to optimize for faster checkout. To make sure this feature is right for your store, review the list of compatible extensions.","woo-gutenberg-products-block"),{a:Object(r.createElement)(s.ExternalLink,{href:"https://woocommerce.com/document/cart-checkout-blocks-support-status/#section-3"})});return Object(r.createElement)("div",{className:"wc-blocks-sidebar-compatibility-notice",style:{display:c?"block":"none"}},Object(r.createElement)(s.Notice,{onRemove:n,className:"wc-blocks-sidebar-compatibility-notice__notice"},o))};var d=c(9),p=c(149),b=(c(263),c(2)),m=c(23);function g(e){const t="cart"===e.block?m.c:m.e;return Object(d.useSelect)(e=>e("core/editor").getCurrentPostId())!==t?Object(r.createElement)(s.Notice,{className:"wc-block-cart__page-notice",isDismissible:!1,status:"warning"},Object(r.createInterpolateElement)(Object(i.sprintf)( +/* translators: %s is the block name. It will be cart or checkout. */ +Object(i.__)("If you would like to use this block as your default %s you must update your page settings in WooCommerce.","woo-gutenberg-products-block"),e.block),{a:Object(r.createElement)("a",{href:Object(b.getAdminLink)("admin.php?page=wc-settings&tab=advanced"),target:"_blank",rel:"noopener noreferrer"})})):null}c(265);const O=Object(n.createHigherOrderComponent)(e=>t=>{const c=["woocommerce/checkout-shipping-address-block","woocommerce/checkout-billing-address-block","woocommerce/checkout-contact-information-block","woocommerce/checkout-fields-block"],{clientId:n}=t,{isCart:a,isCheckout:s,isAddressFieldBlock:i}=Object(d.useSelect)(e=>{const{getBlockParentsByBlockName:t,getBlockName:r}=e(o.store),a=t(n,["woocommerce/cart","woocommerce/checkout"]).map(r),s=r(n);return{isCart:a.includes("woocommerce/cart")||"woocommerce/cart"===s,isCheckout:a.includes("woocommerce/checkout")||"woocommerce/checkout"===s,isAddressFieldBlock:c.includes(s)}});return Object(r.createElement)(r.Fragment,null,(a||s)&&Object(r.createElement)(o.InspectorControls,null,Object(r.createElement)(u,{block:s?"checkout":"cart"}),Object(r.createElement)(g,{block:s?"checkout":"cart"}),i?null:Object(r.createElement)(p.a,null)),Object(r.createElement)(e,t))},"withSidebarNotices");Object(a.hasFilter)("editor.BlockEdit","woocommerce/add/sidebar-compatibility-notice")||Object(a.addFilter)("editor.BlockEdit","woocommerce/add/sidebar-compatibility-notice",O,11)},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return k}));var r=c(0),n=c(208),o=c(2),a=c(127),s=c(164),i=c(104),l=c(72),u=c(54),d=c(1),p=c(14),b=c.n(p),m=c(237),g=c(27),O=c(9);const h=(e,t,c)=>{const r=Object.keys(e).map(t=>({key:t,value:e[t]}),[]),n=`wc-${c}-new-payment-method`;return r.push({key:n,value:t}),r},j=(e,t)=>{b.a.setNonce&&"function"==typeof b.a.setNonce&&b.a.setNonce(e),null!=e&&e.get("User-ID")&&t.setCustomerId(parseInt(e.get("User-ID")||"0",10))};var E=c(102),_=c(41),y=c(145),f=()=>{const{hasError:e,onCheckoutValidationBeforeProcessing:t,dispatchActions:c,redirectUrl:n,isProcessing:o,isBeforeProcessing:a,isComplete:p,orderNotes:f,shouldCreateAccount:k,extensionData:v}=Object(u.b)(),{hasValidationErrors:w}=Object(E.b)(),{shippingErrorStatus:S}=Object(i.b)(),{billingAddress:C,shippingAddress:N}=Object(l.b)(),{cartNeedsPayment:I,cartNeedsShipping:R,receiveCart:M}=Object(_.a)(),{activePaymentMethod:P,isExpressPaymentMethodActive:T,currentStatus:A,paymentMethodData:x,expressPaymentMethods:D,paymentMethods:L,shouldSavePayment:B}=Object(s.b)(),{setIsSuppressed:U}=Object(y.b)(),{createErrorNotice:F,removeNotice:z}=Object(O.useDispatch)("core/notices"),V=Object(r.useRef)(C),Y=Object(r.useRef)(N),G=Object(r.useRef)(n),[q,H]=Object(r.useState)(!1),$=Object(r.useMemo)(()=>{var e;const t={...D,...L};return null==t||null===(e=t[P])||void 0===e?void 0:e.paymentMethodId},[P,D,L]),W=w&&!T||A.hasError||S.hasError,Q=!e&&!W&&(A.isSuccessful||!I)&&o;Object(r.useEffect)(()=>{U(T)},[T,U]),Object(r.useEffect)(()=>{W===e||!o&&!a||T||c.setHasError(W)},[W,e,o,a,T,c]),Object(r.useEffect)(()=>{V.current=C,Y.current=N,G.current=n},[C,N,n]);const K=Object(r.useCallback)(()=>!w&&(A.hasError?{errorMessage:Object(d.__)("There was a problem with your payment option.","woo-gutenberg-products-block")}:!S.hasError||{errorMessage:Object(d.__)("There was a problem with your shipping option.","woo-gutenberg-products-block")}),[w,A.hasError,S.hasError]);Object(r.useEffect)(()=>{let e;return T||(e=t(K,0)),()=>{T||e()}},[t,K,T]),Object(r.useEffect)(()=>{G.current&&(window.location.href=G.current)},[p]);const X=Object(r.useCallback)(async()=>{if(q)return;H(!0),z("checkout");const e=I?{payment_method:$,payment_data:h(x,B,P)}:{},t={billing_address:Object(m.a)(V.current),customer_note:f,create_account:k,...e,extensions:{...v}};R&&(t.shipping_address=Object(m.a)(Y.current)),b()({path:"/wc/store/v1/checkout",method:"POST",data:t,cache:"no-store",parse:!1}).then(e=>{if(j(e.headers,c),!e.ok)throw new Error(e);return e.json()}).then(e=>{c.setAfterProcessing(e),H(!1)}).catch(e=>{try{null!=e&&e.headers&&j(e.headers,c),e.json().then(e=>{var t,r,n;null!==(t=e.data)&&void 0!==t&&t.cart&&M(e.data.cart),F(Object(g.b)(e),{id:"checkout",context:"wc/checkout"}),null==e||null===(r=e.additional_errors)||void 0===r||null===(n=r.forEach)||void 0===n||n.call(r,e=>{F(e.message,{id:e.error_code,context:"wc/checkout"})}),c.setAfterProcessing(e)})}catch{var t;F(Object(d.sprintf)(// Translators: %s Error text. +Object(d.__)("%s Please try placing your order again.","woo-gutenberg-products-block"),null!==(t=null==e?void 0:e.message)&&void 0!==t?t:Object(d.__)("Something went wrong.","woo-gutenberg-products-block")),{id:"checkout",context:"wc/checkout"})}c.setHasError(!0),H(!1)})},[q,z,I,$,x,B,P,f,k,v,R,c,F,M]);return Object(r.useEffect)(()=>{Q&&!q&&X()},[X,Q,q]),null};const k=e=>{let{children:t,isCart:c=!1,redirectUrl:d}=e;return Object(r.createElement)(u.a,{redirectUrl:d,isCart:c},Object(r.createElement)(l.a,null,Object(r.createElement)(i.a,null,Object(r.createElement)(s.a,null,t,Object(r.createElement)(a.a,{renderError:o.CURRENT_USER_IS_ADMIN?null:()=>null},Object(r.createElement)(n.PluginArea,{scope:"woocommerce-checkout"})),Object(r.createElement)(f,null)))))}},,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return T}));var r=c(1),n=c(26),o=c(0),a=c(4),s=c.n(a),i=c(11),l=Object(o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(o.createElement)("path",{d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{fill:"#000",fillRule:"nonzero",d:"M17.3 8v1c1 .2 1.4.9 1.4 1.7h-1c0-.6-.3-1-1-1-.8 0-1.3.4-1.3.9 0 .4.3.6 1.4 1 1 .2 2 .6 2 1.9 0 .9-.6 1.4-1.5 1.5v1H16v-1c-.9-.1-1.6-.7-1.7-1.7h1c0 .6.4 1 1.3 1 1 0 1.2-.5 1.2-.8 0-.4-.2-.8-1.3-1.1-1.3-.3-2.1-.8-2.1-1.8 0-.9.7-1.5 1.6-1.6V8h1.3zM12 10v1H6v-1h6zm2-2v1H6V8h8zM2 4v16h20V4H2zm2 14V6h16v12H4z"}),Object(o.createElement)("path",{stroke:"#000",strokeLinecap:"round",d:"M6 16c2.6 0 3.9-3 1.7-3-2 0-1 3 1.5 3 1 0 1-.8 2.8-.8"}))),u=c(524),d=c(511),p=c(523),b=c(113),m=c(100),g=c(35);c(252);const O={bank:u.a,bill:d.a,card:p.a,checkPayment:l};var h=e=>{let{icon:t="",text:c=""}=e;const r=!!t,n=Object(o.useCallback)(e=>r&&Object(m.a)(e)&&Object(g.b)(O,e),[r]),a=s()("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":r});return Object(o.createElement)("span",{className:a},n(t)?Object(o.createElement)(b.a,{icon:O[t]}):t,c)},j=c(148),E=c(2),_=c(51),y=c.n(_),f=c(69),k=c(221),v=c(41),w=c(206),S=c(37),C=c(54),N=c(164),I=c(104),R=c(72);const M=(e,t)=>{const c=[],n=(t,c)=>{const r=c+"_tax",n=Object(g.b)(e,c)&&Object(m.a)(e[c])?parseInt(e[c],10):0;return{key:c,label:t,value:n,valueWithTax:n+(Object(g.b)(e,r)&&Object(m.a)(e[r])?parseInt(e[r],10):0)}};return c.push(n(Object(r.__)("Subtotal:","woo-gutenberg-products-block"),"total_items")),c.push(n(Object(r.__)("Fees:","woo-gutenberg-products-block"),"total_fees")),c.push(n(Object(r.__)("Discount:","woo-gutenberg-products-block"),"total_discount")),c.push({key:"total_tax",label:Object(r.__)("Taxes:","woo-gutenberg-products-block"),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&c.push(n(Object(r.__)("Shipping:","woo-gutenberg-products-block"),"total_shipping")),c};var P=c(80);const T=()=>{const{isCalculating:e,isComplete:t,isIdle:c,isProcessing:a,onCheckoutBeforeProcessing:s,onCheckoutValidationBeforeProcessing:i,onCheckoutAfterProcessingWithSuccess:l,onCheckoutAfterProcessingWithError:u,onSubmit:d,customerId:p}=Object(C.b)(),{currentStatus:b,activePaymentMethod:m,onPaymentProcessing:g,setExpressPaymentError:O,shouldSavePayment:_}=Object(N.b)(),{shippingErrorStatus:T,shippingErrorTypes:A,onShippingRateSuccess:x,onShippingRateFail:D,onShippingRateSelectSuccess:L,onShippingRateSelectFail:B}=Object(I.b)(),{shippingRates:U,isLoadingRates:F,selectedRates:z,isSelectingRate:V,selectShippingRate:Y,needsShipping:G}=Object(P.a)(),{billingAddress:q,shippingAddress:H,setShippingAddress:$}=Object(R.b)(),{cartItems:W,cartFees:Q,cartTotals:K,extensions:X}=Object(v.a)(),{appliedCoupons:Z}=Object(w.a)(),{noticeContexts:J,responseTypes:ee}=Object(S.d)(),te=Object(o.useRef)(M(K,G)),ce=Object(o.useRef)({label:Object(r.__)("Total","woo-gutenberg-products-block"),value:parseInt(K.total_price,10)});Object(o.useEffect)(()=>{te.current=M(K,G),ce.current={label:Object(r.__)("Total","woo-gutenberg-products-block"),value:parseInt(K.total_price,10)}},[K,G]);const re=Object(o.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";y()("setExpressPaymentError should only be used by Express Payment Methods (using the provided onError handler).",{alternative:"",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),O(e)}),[O]);return{activePaymentMethod:m,billing:{appliedCoupons:Z,billingAddress:q,billingData:q,cartTotal:ce.current,cartTotalItems:te.current,currency:Object(n.getCurrencyFromPriceResponse)(K),customerId:p,displayPricesIncludingTax:Object(E.getSetting)("displayCartPricesIncludingTax",!1)},cartData:{cartItems:W,cartFees:Q,extensions:X},checkoutStatus:{isCalculating:e,isComplete:t,isIdle:c,isProcessing:a},components:{LoadingMask:f.a,PaymentMethodIcons:j.a,PaymentMethodLabel:h,ValidationInputError:k.a},emitResponse:{noticeContexts:J,responseTypes:ee},eventRegistration:{onCheckoutAfterProcessingWithError:u,onCheckoutAfterProcessingWithSuccess:l,onCheckoutBeforeProcessing:s,onCheckoutValidationBeforeProcessing:i,onPaymentProcessing:g,onShippingRateFail:D,onShippingRateSelectFail:B,onShippingRateSelectSuccess:L,onShippingRateSuccess:x},onSubmit:d,paymentStatus:b,setExpressPaymentError:re,shippingData:{isSelectingRate:V,needsShipping:G,selectedRates:z,setSelectedRates:Y,setShippingAddress:$,shippingAddress:H,shippingRates:U,shippingRatesLoading:F},shippingStatus:{shippingErrorStatus:T,shippingErrorTypes:A},shouldSavePayment:_}}},function(e,t,c){"use strict";c.d(t,"b",(function(){return i})),c.d(t,"a",(function(){return l}));var r=c(0),n=c(10),o=c(4),a=c.n(o);const s=Object(r.createContext)({hasContainerWidth:!1,containerClassName:"",isMobile:!1,isSmall:!1,isMedium:!1,isLarge:!1}),i=()=>Object(r.useContext)(s),l=e=>{let{children:t,className:c=""}=e;const[o,i]=(()=>{const[e,{width:t}]=Object(n.useResizeObserver)();let c="";return t>700?c="is-large":t>520?c="is-medium":t>400?c="is-small":t&&(c="is-mobile"),[e,c]})(),l={hasContainerWidth:""!==i,containerClassName:i,isMobile:"is-mobile"===i,isSmall:"is-small"===i,isMedium:"is-medium"===i,isLarge:"is-large"===i};return Object(r.createElement)(s.Provider,{value:l},Object(r.createElement)("div",{className:a()(c,i)},o,t))}},function(e,t,c){"use strict";var r=c(6),n=c.n(r),o=c(0),a=c(1),s=c(12),i=c(4),l=c.n(i),u=c(102),d=c(221),p=c(10),b=c(100),m=c(28);c(191);var g=Object(s.forwardRef)((e,t)=>{let{className:c,id:r,type:a="text",ariaLabel:s,ariaDescribedBy:i,label:u,screenReaderLabel:d,disabled:p,help:b,autoCapitalize:g="off",autoComplete:O="off",value:h="",onChange:j,required:E=!1,onBlur:_=(()=>{}),feedback:y,...f}=e;const[k,v]=Object(o.useState)(!1);return Object(o.createElement)("div",{className:l()("wc-block-components-text-input",c,{"is-active":k||h})},Object(o.createElement)("input",n()({type:a,id:r,value:h,ref:t,autoCapitalize:g,autoComplete:O,onChange:e=>{j(e.target.value)},onFocus:()=>v(!0),onBlur:e=>{_(e.target.value),v(!1)},"aria-label":s||u,disabled:p,"aria-describedby":b&&!i?r+"__help":i,required:E},f)),Object(o.createElement)(m.a,{label:u,screenReaderLabel:d||u,wrapperElement:"label",wrapperProps:{htmlFor:r},htmlFor:r}),!!b&&Object(o.createElement)("p",{id:r+"__help",className:"wc-block-components-text-input__help"},b),y)});t.a=Object(p.withInstanceId)(e=>{let{className:t,instanceId:c,id:r,ariaDescribedBy:i,errorId:p,focusOnMount:m=!1,onChange:O,showError:h=!0,errorMessage:j="",value:E="",..._}=e;const[y,f]=Object(s.useState)(!0),k=Object(s.useRef)(null),{getValidationError:v,hideValidationError:w,setValidationErrors:S,clearValidationError:C,getValidationErrorId:N}=Object(u.b)(),I=void 0!==r?r:"textinput-"+c,R=void 0!==p?p:I,M=Object(s.useCallback)((function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=k.current||null;if(!t)return;t.value=t.value.trim();const c=t.checkValidity();c?C(R):S({[R]:{message:t.validationMessage||Object(a.__)("Invalid value.","woo-gutenberg-products-block"),hidden:e}})}),[C,R,S]);Object(s.useEffect)(()=>{var e;y&&m&&(null===(e=k.current)||void 0===e||e.focus()),f(!1)},[m,y,f]),Object(s.useEffect)(()=>{var e,t;(null===(e=k.current)||void 0===e||null===(t=e.ownerDocument)||void 0===t?void 0:t.activeElement)!==k.current&&M(!0)},[E,M]),Object(s.useEffect)(()=>()=>{C(R)},[C,R]);const P=v(R)||{};Object(b.a)(j)&&""!==j&&(P.message=j);const T=P.message&&!P.hidden,A=h&&T&&N(R)?N(R):i;return Object(o.createElement)(g,n()({className:l()(t,{"has-error":T}),"aria-invalid":!0===T,id:I,onBlur:()=>{M(!1)},feedback:h&&Object(o.createElement)(d.a,{errorMessage:j,propertyName:R}),ref:k,onChange:e=>{w(R),O(e)},ariaDescribedBy:A,value:E},_))})},,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(8);const n=["core/paragraph","core/image","core/separator"],o=e=>[...Object(r.getBlockTypes)().filter(t=>((null==t?void 0:t.parent)||[]).includes(e)).map(e=>{let{name:t}=e;return t}),...n]},function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var r=c(0),n=c(9),o=c(8),a=c(7);const s=e=>{let{clientId:t,registeredBlocks:c,defaultTemplate:s=[]}=e;const i=Object(r.useRef)(c),l=Object(r.useRef)(s),{insertBlock:u,replaceInnerBlocks:d}=Object(n.useDispatch)("core/block-editor"),{innerBlocks:p,registeredBlockTypes:b}=Object(n.useSelect)(e=>({innerBlocks:e("core/block-editor").getBlocks(t),registeredBlockTypes:i.current.map(e=>Object(o.getBlockType)(e))}),[t,i.current]),m=Object(r.useCallback)((e,c)=>{const r=Object(o.createBlock)(e.name);u(r,c,t,!1)},[t,u]),g=Object(r.useMemo)(()=>b.filter(e=>e&&(e=>{var t,c,r;let{attributes:n}=e;return Boolean((null===(t=n.lock)||void 0===t?void 0:t.remove)||(null===(c=n.lock)||void 0===c||null===(r=c.default)||void 0===r?void 0:r.remove))})(e)),[b]);Object(r.useLayoutEffect)(()=>{if(t){if(0===p.length&&l.current.length>0){const e=Object(o.createBlocksFromInnerBlocksTemplate)(l.current);if(!Object(a.isEqual)(e,p))return void d(t,e)}g.forEach(e=>{if(p.find(t=>{let{name:c}=t;return c===e.name}))return;const t=l.current.findIndex(t=>{let[c]=t;return c===e.name});switch(t){case-1:m(e,p.length);break;case 0:m(e,0);break;default:const c=l.current[t-1],r=p.findIndex(e=>{let{name:t}=e;return t===c[0]});m(e,-1===r?t:r+1)}})}},[t,p,g,d,m])}},function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var r=c(1),n=c(23),o=c(2);const a=[{destination:{address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},package_id:0,name:Object(r.__)("Shipping","woo-gutenberg-products-block"),items:[{key:"33e75ff09dd601bbe69f351039152189",name:Object(r._x)("Beanie with Logo","example product in Cart Block","woo-gutenberg-products-block"),quantity:2},{key:"6512bd43d9caa6e02c990b0a82652dca",name:Object(r._x)("Beanie","example product in Cart Block","woo-gutenberg-products-block"),quantity:1}],shipping_rates:[{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(r.__)("Free shipping","woo-gutenberg-products-block"),description:"",delivery_time:"",price:"000",taxes:"0",rate_id:"free_shipping:1",instance_id:0,meta_data:[],method_id:"flat_rate",selected:!0},{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(r.__)("Local pickup","woo-gutenberg-products-block"),description:"",delivery_time:"",price:"200",taxes:"0",rate_id:"local_pickup:1",instance_id:1,meta_data:[],method_id:"local_pickup",selected:!1}]}],s=Object(o.getSetting)("displayCartPricesIncludingTax",!1),i={coupons:[],shipping_rates:Object(o.getSetting)("shippingMethodsExist",!1)?a:[],items:[{key:"1",id:1,quantity:2,name:Object(r.__)("Beanie","woo-gutenberg-products-block"),short_description:Object(r.__)("Warm hat for winter","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-beanie",permalink:"https://example.org",low_stock_remaining:2,backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:10,src:n.m+"previews/beanie.jpg",thumbnail:n.m+"previews/beanie.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(r.__)("Color","woo-gutenberg-products-block"),value:Object(r.__)("Yellow","woo-gutenberg-products-block")},{attribute:Object(r.__)("Size","woo-gutenberg-products-block"),value:Object(r.__)("Small","woo-gutenberg-products-block")}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:s?"12000":"10000",regular_price:s?"12000":"10000",sale_price:s?"12000":"10000",raw_prices:{precision:6,price:s?"12000000":"10000000",regular_price:s?"12000000":"10000000",sale_price:s?"12000000":"10000000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:"2000",line_subtotal_tax:"400",line_total:"2000",line_total_tax:"400"},extensions:{}},{key:"2",id:2,quantity:1,name:Object(r.__)("Cap","woo-gutenberg-products-block"),short_description:Object(r.__)("Lightweight baseball cap","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-cap",permalink:"https://example.org",backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:11,src:n.m+"previews/cap.jpg",thumbnail:n.m+"previews/cap.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(r.__)("Color","woo-gutenberg-products-block"),value:Object(r.__)("Orange","woo-gutenberg-products-block")}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:s?"2400":"2000",regular_price:s?"2400":"2000",sale_price:s?"2400":"2000",raw_prices:{precision:6,price:s?"24000000":"20000000",regular_price:s?"24000000":"20000000",sale_price:s?"24000000":"20000000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:"2000",line_subtotal_tax:"400",line_total:"2000",line_total_tax:"400"},extensions:{}}],fees:[{id:"fee",name:Object(r.__)("Fee","woo-gutenberg-products-block"),totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total:"100",total_tax:"20",tax_lines:[{name:Object(r.__)("Sales tax","woo-gutenberg-products-block"),rate:"20%",price:"20"}]}}],items_count:3,items_weight:0,needs_payment:!0,needs_shipping:Object(o.getSetting)("shippingEnabled",!0),has_calculated_shipping:!0,shipping_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},billing_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total_items:"4000",total_items_tax:"800",total_fees:"100",total_fees_tax:"20",total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_tax:"820",total_price:"4920",tax_lines:[{name:Object(r.__)("Sales tax","woo-gutenberg-products-block"),rate:"20%",price:"820"}]},errors:[],payment_requirements:["products"],extensions:{}}},,,,,,,,function(e,t,c){"use strict";(function(e){var r=c(0),n=c(1),o=c(4),a=c.n(o),s=c(68),i=c(23),l=c(54),u=c(489),d=c(2);c(413),t.a=t=>{let{checkoutPageId:c,className:o}=t;const p=Object(d.getSetting)("page-"+c,!1),{isCalculating:b}=Object(l.b)(),[m,g]=Object(u.a)(),[O,h]=Object(r.useState)(!1);Object(r.useEffect)(()=>{if("function"!=typeof e.addEventListener||"function"!=typeof e.removeEventListener)return;const t=()=>{h(!1)};return e.addEventListener("pageshow",t),()=>{e.removeEventListener("pageshow",t)}},[]);const j=Object(r.createElement)(s.a,{className:"wc-block-cart__submit-button",href:p||i.f,disabled:b,onClick:()=>h(!0),showSpinner:O},Object(n.__)("Proceed to Checkout","woo-gutenberg-products-block"));return Object(r.createElement)("div",{className:a()("wc-block-cart__submit",o)},m,Object(r.createElement)("div",{className:"wc-block-cart__submit-container"},j),"below"===g&&Object(r.createElement)("div",{className:"wc-block-cart__submit-container wc-block-cart__submit-container--sticky"},j))}}).call(this,c(412))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){e.exports=c(455)},function(e,t){},function(e,t,c){"use strict";var r=c(0),n=c(11);const o=Object(r.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(r.createElement)("path",{d:"M0 0h24v24H0z"}),Object(r.createElement)("path",{fill:"currentColor",fillRule:"nonzero",d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49A.996.996 0 0 0 20.01 4H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45ZM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2Zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2Z"}))," ");t.a=o},function(e,t){},function(e,t,c){"use strict";var r=c(0),n=c(4),o=c.n(n),a=c(281);c(248),t.a=e=>{let{children:t,className:c}=e;return Object(r.createElement)(a.a,{className:o()("wc-block-components-sidebar-layout",c)},t)}},function(e,t,c){"use strict";var r=c(0),n=c(12),o=c(4),a=c.n(o);const s=Object(n.forwardRef)((e,t)=>{let{children:c,className:n=""}=e;return Object(r.createElement)("div",{ref:t,className:a()("wc-block-components-main",n)},c)});t.a=s},function(e,t){},function(e,t,c){"use strict";var r=c(0),n=c(12),o=c(4),a=c.n(o);const s=Object(n.forwardRef)((e,t)=>{let{children:c,className:n=""}=e;return Object(r.createElement)("div",{ref:t,className:a()("wc-block-components-sidebar",n)},c)});t.a=s},function(e,t){},,function(e,t){},function(e,t,c){"use strict";var r=c(0),n=c(11);const o=Object(r.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{d:"M22.7 22.7l-20-20L2 2l-.7-.7L0 2.5 4.4 7l2.2 4.7L5.2 14A2 2 0 007 17h7.5l1.3 1.4a2 2 0 102.8 2.8l2.9 2.8 1.2-1.3zM7.4 15a.2.2 0 01-.2-.3l.9-1.7h2.4l2 2h-5zm8.2-2a2 2 0 001.7-1l3.6-6.5.1-.5c0-.6-.4-1-1-1H6.5l9 9zM7 18a2 2 0 100 4 2 2 0 000-4z"}),Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}));t.a=o},function(e,t){},function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r=e=>Object.values(e).reduce((e,t)=>(null!==t.icons&&(e=e.concat(t.icons)),e),[])},function(e,t,c){"use strict";var r=c(0),n=c(11);const o=Object(r.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24",fill:"none"},Object(r.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",d:"M6 3.75h12c.69 0 1.25.56 1.25 1.25v14c0 .69-.56 1.25-1.25 1.25H6c-.69 0-1.25-.56-1.25-1.25V5c0-.69.56-1.25 1.25-1.25z"}),Object(r.createElement)("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.9 7.5A1.1 1.1 0 018 6.4h8a1.1 1.1 0 011.1 1.1v2a1.1 1.1 0 01-1.1 1.1H8a1.1 1.1 0 01-1.1-1.1v-2zm1.2.1v1.8h7.8V7.6H8.1z",clipRule:"evenodd"}),Object(r.createElement)("path",{fill:"currentColor",d:"M8.5 12h1v1h-1v-1zM8.5 14h1v1h-1v-1zM8.5 16h1v1h-1v-1zM11.5 12h1v1h-1v-1zM11.5 14h1v1h-1v-1zM11.5 16h1v1h-1v-1zM14.5 12h1v1h-1v-1zM14.5 14h1v1h-1v-1zM14.5 16h1v1h-1v-1z"}));t.a=o},function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(4),a=c.n(o),s=c(38),i=c(18),l=c(41),u=c(2);c(253),t.a=e=>{let{currency:t,values:c,className:o}=e;const d=Object(u.getSetting)("taxesEnabled",!0)&&Object(u.getSetting)("displayCartPricesIncludingTax",!1),{total_price:p,total_tax:b}=c,{receiveCart:m,...g}=Object(l.a)(),O=Object(i.__experimentalApplyCheckoutFilter)({filterName:"totalLabel",defaultValue:Object(n.__)("Total","woo-gutenberg-products-block"),extensions:g.extensions,arg:{cart:g}}),h=parseInt(b,10);return Object(r.createElement)(i.TotalsItem,{className:a()("wc-block-components-totals-footer-item",o),currency:t,label:O,value:parseInt(p,10),description:d&&0!==h&&Object(r.createElement)("p",{className:"wc-block-components-totals-footer-item-tax"},Object(r.createInterpolateElement)(Object(n.__)("Including in taxes","woo-gutenberg-products-block"),{TaxAmount:Object(r.createElement)(s.a,{className:"wc-block-components-totals-footer-item-tax-value",currency:t,value:h})}))})}},function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(69),a=c(232),s=c(18),i=c(2);c(254);const l={context:"summary"};t.a=e=>{let{cartCoupons:t=[],currency:c,isRemovingCoupon:u,removeCoupon:d,values:p}=e;const{total_discount:b,total_discount_tax:m}=p,g=parseInt(b,10);if(!g&&0===t.length)return null;const O=parseInt(m,10),h=Object(i.getSetting)("displayCartPricesIncludingTax",!1)?g+O:g,j=Object(s.__experimentalApplyCheckoutFilter)({arg:l,filterName:"coupons",defaultValue:t});return Object(r.createElement)(s.TotalsItem,{className:"wc-block-components-totals-discount",currency:c,description:0!==j.length&&Object(r.createElement)(o.a,{screenReaderLabel:Object(n.__)("Removing coupon…","woo-gutenberg-products-block"),isLoading:u,showSpinner:!1},Object(r.createElement)("ul",{className:"wc-block-components-totals-discount__coupon-list"},j.map(e=>Object(r.createElement)(a.a,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:Object(n.sprintf)( +/* translators: %s Coupon code. */ +Object(n.__)("Coupon: %s","woo-gutenberg-products-block"),e.label),disabled:u,onRemove:()=>{d(e.code)},radius:"large",ariaLabel:Object(n.sprintf)( +/* translators: %s is a coupon code. */ +Object(n.__)('Remove coupon "%s"',"woo-gutenberg-products-block"),e.label)})))),label:h?Object(n.__)("Discount","woo-gutenberg-products-block"):Object(n.__)("Coupons","woo-gutenberg-products-block"),value:h?-1*h:"-"})}},function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return n}));const r=e=>e.length,n=e=>e.reduce((function(e,t){return e+t.shipping_rates.length}),0)},function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(68),a=c(282),s=c(28),i=c(69),l=c(10),u=c(102),d=c(221),p=c(18);c(261),t.a=Object(l.withInstanceId)(e=>{let{instanceId:t,isLoading:c=!1,initialOpen:l=!1,onSubmit:b=(()=>{})}=e;const[m,g]=Object(r.useState)(""),O=Object(r.useRef)(!1),{getValidationError:h,getValidationErrorId:j}=Object(u.b)(),E=h("coupon");Object(r.useEffect)(()=>{O.current!==c&&(c||!m||E||g(""),O.current=c)},[c,m,E]);const _="wc-block-components-totals-coupon__input-"+t;return Object(r.createElement)(p.Panel,{className:"wc-block-components-totals-coupon",hasBorder:!1,initialOpen:l,title:Object(r.createElement)(s.a,{label:Object(n.__)("Coupon code","woo-gutenberg-products-block"),screenReaderLabel:Object(n.__)("Apply a coupon code","woo-gutenberg-products-block"),htmlFor:_})},Object(r.createElement)(i.a,{screenReaderLabel:Object(n.__)("Applying coupon…","woo-gutenberg-products-block"),isLoading:c,showSpinner:!1},Object(r.createElement)("div",{className:"wc-block-components-totals-coupon__content"},Object(r.createElement)("form",{className:"wc-block-components-totals-coupon__form"},Object(r.createElement)(a.a,{id:_,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:Object(n.__)("Enter code","woo-gutenberg-products-block"),value:m,ariaDescribedBy:j(_),onChange:e=>{g(e)},focusOnMount:!0,showError:!1}),Object(r.createElement)(o.a,{className:"wc-block-components-totals-coupon__button",disabled:c||!m,showSpinner:c,onClick:e=>{e.preventDefault(),b(m)},type:"submit"},Object(n.__)("Apply","woo-gutenberg-products-block"))),Object(r.createElement)(d.a,{propertyName:"coupon",elementId:_}))))})},function(e,t){},function(e,t){},function(e,t,c){"use strict";c.d(t,"a",(function(){return d})),c.d(t,"b",(function(){return b}));var r=c(5),n=c(71),o=c(9),a=c(0),s=c(53),i=c(48),l=c(8);const u=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t?window.document.body.classList.add(e):window.document.body.classList.remove(e)},d=()=>{Object(i.hasFilter)("blocks.registerBlockType","core/lock/addAttribute")||Object(o.subscribe)(()=>{var e,t,c,n;const a=Object(o.select)(r.store);if(!a)return;const s=a.getSelectedBlock();s&&(u("wc-lock-selected-block--remove",!(null==s||null===(e=s.attributes)||void 0===e||null===(t=e.lock)||void 0===t||!t.remove)),u("wc-lock-selected-block--move",!(null==s||null===(c=s.attributes)||void 0===c||null===(n=c.lock)||void 0===n||!n.move)))})},p=e=>{let{ref:t}=e;const c=Object(i.hasFilter)("blocks.registerBlockType","core/lock/addAttribute"),u=t.current;return Object(a.useEffect)(()=>{if(u&&!c)return u.addEventListener("keydown",e,{capture:!0,passive:!1}),()=>{u.removeEventListener("keydown",e,{capture:!0})};function e(e){const{keyCode:t,target:c}=e;if(!(c instanceof HTMLElement))return;if(t!==s.BACKSPACE&&t!==s.DELETE)return;if(Object(n.isTextField)(c))return;const a=c;void 0!==a.dataset.block&&(e=>{var t,c,n,a,s;if(!e)return!1;const{getBlock:i}=Object(o.select)(r.store),u=i(e);if("boolean"==typeof(null==u||null===(t=u.attributes)||void 0===t||null===(c=t.lock)||void 0===c?void 0:c.remove))return u.attributes.lock.remove;const d=Object(l.getBlockType)(u.name);var p,b,m;return"boolean"==typeof(null==d||null===(n=d.attributes)||void 0===n||null===(a=n.lock)||void 0===a||null===(s=a.default)||void 0===s?void 0:s.remove)&&(null==d||null===(p=d.attributes)||void 0===p||null===(b=p.lock)||void 0===b||null===(m=b.default)||void 0===m?void 0:m.remove)})(a.dataset.block)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())}},[u,c])},b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object(a.useRef)(),c=Object(r.useBlockProps)({ref:t,...e});return p({ref:t}),c}},function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var r=c(0),n=c(5),o=c(3),a=c(1);const s=e=>{let{attributes:t,setAttributes:c}=e;const{hasDarkControls:s}=t;return Object(r.createElement)(n.InspectorControls,null,Object(r.createElement)(o.PanelBody,{title:Object(a.__)("Style","woo-gutenberg-products-block")},Object(r.createElement)(o.ToggleControl,{label:Object(a.__)("Dark mode inputs","woo-gutenberg-products-block"),help:Object(a.__)("Inputs styled specifically for use on dark background colors.","woo-gutenberg-products-block"),checked:s,onChange:()=>c({hasDarkControls:!s})})))}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.r(t);var r=c(0),n=c(1),o=c(4),a=c.n(o),s=c(5),i=c(244),l=c(113),u=c(8),d=c(127),p=c(59),b=c(270);const m=e=>{let{children:t,redirectUrl:c}=e;return Object(r.createElement)(b.a,{isCart:!0,redirectUrl:c},t)};var g=c(312),O=c(405),h=c(414),j=c(6),E=c.n(j),_=c(18),y=c(407),f=c(310),k=c(311);c(406);const v=Object(r.createContext)({hasDarkControls:!1});Object(u.registerBlockType)("woocommerce/filled-cart-block",{icon:{src:Object(r.createElement)(l.a,{icon:O.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{clientId:t}=e;const c=Object(s.useBlockProps)(),{currentView:n}=Object(p.b)(),{hasDarkControls:o}=Object(r.useContext)(v),i=Object(f.a)(_.innerBlockAreas.FILLED_CART),l=[["woocommerce/cart-items-block",{},[]],["woocommerce/cart-totals-block",{},[]]];return Object(k.a)({clientId:t,registeredBlocks:i,defaultTemplate:l}),Object(r.createElement)("div",E()({},c,{hidden:"woocommerce/filled-cart-block"!==n}),Object(r.createElement)(y.a,{className:a()("wc-block-cart",{"has-dark-controls":o})},Object(r.createElement)(s.InnerBlocks,{allowedBlocks:i,template:l,templateLock:"insert"})))},save:()=>Object(r.createElement)("div",s.useBlockProps.save(),Object(r.createElement)(s.InnerBlocks.Content,null))});var w=c(522),S=c(408);Object(u.registerBlockType)("woocommerce/cart-items-block",{icon:{src:Object(r.createElement)(l.a,{icon:w.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{clientId:t}=e;const c=Object(s.useBlockProps)({className:"wc-block-cart__main"}),n=Object(f.a)(_.innerBlockAreas.CART_ITEMS),o=[["woocommerce/cart-line-items-block",{},[]]];return Object(k.a)({clientId:t,registeredBlocks:n,defaultTemplate:o}),Object(r.createElement)(S.a,c,Object(r.createElement)(s.InnerBlocks,{allowedBlocks:n,template:o,templateLock:!1,renderAppender:s.InnerBlocks.ButtonBlockAppender}))},save:()=>Object(r.createElement)("div",s.useBlockProps.save(),Object(r.createElement)(s.InnerBlocks.Content,null))});var C=c(43),N=c(41),I=c(209),R=e=>{let{className:t}=e;const{cartItems:c,cartIsLoading:n}=Object(N.a)();return Object(r.createElement)(I.a,{className:t,lineItems:c,isLoading:n})};Object(u.registerBlockType)("woocommerce/cart-line-items-block",{icon:{src:Object(r.createElement)(l.a,{icon:w.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,n=Object(s.useBlockProps)();return Object(r.createElement)("div",n,Object(r.createElement)(C.a,null,Object(r.createElement)(R,{className:c})))},save:()=>Object(r.createElement)("div",s.useBlockProps.save())});var M=c(410);c(409),Object(u.registerBlockType)("woocommerce/cart-totals-block",{icon:{src:Object(r.createElement)(l.a,{icon:w.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{clientId:t}=e;const c=Object(s.useBlockProps)({className:"wc-block-cart__sidebar"}),n=Object(f.a)(_.innerBlockAreas.CART_TOTALS),o=[["woocommerce/cart-order-summary-block",{},[]],["woocommerce/cart-express-payment-block",{},[]],["woocommerce/proceed-to-checkout-block",{},[]],["woocommerce/cart-accepted-payment-methods-block",{},[]]];return Object(k.a)({clientId:t,registeredBlocks:n,defaultTemplate:o}),Object(r.createElement)(M.a,c,Object(r.createElement)(s.InnerBlocks,{allowedBlocks:n,template:o,templateLock:!1,renderAppender:s.InnerBlocks.ButtonBlockAppender}))},save:()=>Object(r.createElement)("div",s.useBlockProps.save(),Object(r.createElement)(s.InnerBlocks.Content,null))});var P=c(523),T=c(519),A=c(130),x=c(171),D=c(2),L=c(37),B=c(54),U=c(164),F=c(228),z=c(69),V=c(205);c(250);var Y=()=>{const{paymentMethods:e,isInitialized:t}=Object(x.a)(),{noticeContexts:c}=Object(L.d)(),{isCalculating:o,isProcessing:a,isAfterProcessing:s,isBeforeProcessing:i,isComplete:l,hasError:u}=Object(B.b)(),{currentStatus:d}=Object(U.b)();if(!t||t&&0===Object.keys(e).length)return null;const p=a||s||i||l&&!u;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(z.a,{isLoading:o||p||d.isDoingExpressPayment},Object(r.createElement)("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--cart"},Object(r.createElement)("div",{className:"wc-block-components-express-payment__content"},Object(r.createElement)(F.a,{context:c.EXPRESS_PAYMENTS}),Object(r.createElement)(V.a,null)))),Object(r.createElement)("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--cart"},Object(n.__)("Or","woo-gutenberg-products-block")))},G=e=>{let{className:t}=e;const{cartNeedsPayment:c}=Object(N.a)();return c?Object(r.createElement)("div",{className:a()("wc-block-cart__payment-options",t)},Object(r.createElement)(Y,null)):null};c(411);const q=()=>Object(r.createElement)(T.a,{icon:Object(r.createElement)(l.a,{icon:P.a}),label:Object(n.__)("Express Checkout","woo-gutenberg-products-block"),className:"wp-block-woocommerce-checkout-express-payment-block-placeholder"},Object(r.createElement)("span",{className:"wp-block-woocommerce-checkout-express-payment-block-placeholder__description"},Object(n.__)("Your store doesn't have any Payment Methods that support the Express Checkout Block. If they are added, they will be shown here.","woo-gutenberg-products-block")),Object(r.createElement)(A.a,{isPrimary:!0,href:D.ADMIN_URL+"admin.php?page=wc-settings&tab=checkout",target:"_blank",rel:"noopener noreferrer",className:"wp-block-woocommerce-checkout-express-payment-block-placeholder__button"},Object(n.__)("Configure Payment Methods","woo-gutenberg-products-block")));Object(u.registerBlockType)("woocommerce/cart-express-payment-block",{icon:{src:Object(r.createElement)(l.a,{icon:P.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{paymentMethods:c,isInitialized:n}=Object(x.a)(),o=Object.keys(c).length>0,i=Object(s.useBlockProps)({className:a()({"wp-block-woocommerce-cart-express-payment-block--has-express-payment-methods":o})}),{className:l}=t;return n?Object(r.createElement)("div",i,o?Object(r.createElement)(G,{className:l}):Object(r.createElement)(q,null)):null},save:()=>Object(r.createElement)("div",s.useBlockProps.save())});var H=c(513),$=c(9),W=c(207),Q=c(23),K=c(320);Object(u.registerBlockType)("woocommerce/proceed-to-checkout-block",{icon:{src:Object(r.createElement)(l.a,{icon:H.a,className:"wc-block-editor-components-block-icon"})},attributes:{checkoutPageId:{type:"number",default:0},lock:{type:"object",default:{move:!0,remove:!0}}},edit:e=>{let{attributes:t,setAttributes:c}=e;const o=Object(s.useBlockProps)(),{checkoutPageId:a=0,className:i}=t,{current:l}=Object(r.useRef)(a),u=Object($.useSelect)(e=>l||e("core/editor").getCurrentPostId(),[l]);return Object(r.createElement)("div",o,Object(r.createElement)(s.InspectorControls,null,!(u===Q.c&&0===l)&&Object(r.createElement)(W.a,{pageId:a,setPageId:e=>c({checkoutPageId:e}),labels:{title:Object(n.__)("Proceed to Checkout button","woo-gutenberg-products-block"),default:Object(n.__)("WooCommerce Checkout Page","woo-gutenberg-products-block")}})),Object(r.createElement)(C.a,null,Object(r.createElement)(K.a,{checkoutPageId:a,className:i})))},save:()=>Object(r.createElement)("div",s.useBlockProps.save())}),c(415);const X=Q.j?["core/paragraph",{align:"center",content:Object(n.sprintf)( +/* translators: %s is the link to the store product directory. */ +Object(n.__)('Browse store.',"woo-gutenberg-products-block"),Q.j),dropCap:!1}]:null,Z=[["core/image",{align:"center",url:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE5IDBDOC41MDQwMyAwIDAgOC41MDQwMyAwIDE5QzAgMjkuNDk2IDguNTA0MDMgMzggMTkgMzhDMjkuNDk2IDM4IDM4IDI5LjQ5NiAzOCAxOUMzOCA4LjUwNDAzIDI5LjQ5NiAwIDE5IDBaTTI1LjEyOSAxMi44NzFDMjYuNDg1MSAxMi44NzEgMjcuNTgwNiAxMy45NjY1IDI3LjU4MDYgMTUuMzIyNkMyNy41ODA2IDE2LjY3ODYgMjYuNDg1MSAxNy43NzQyIDI1LjEyOSAxNy43NzQyQzIzLjc3MyAxNy43NzQyIDIyLjY3NzQgMTYuNjc4NiAyMi42Nzc0IDE1LjMyMjZDMjIuNjc3NCAxMy45NjY1IDIzLjc3MyAxMi44NzEgMjUuMTI5IDEyLjg3MVpNMTEuNjQ1MiAzMS4yNTgxQzkuNjE0OTIgMzEuMjU4MSA3Ljk2Nzc0IDI5LjY0OTIgNy45Njc3NCAyNy42NTczQzcuOTY3NzQgMjYuMTI1IDEwLjE1MTIgMjMuMDI5OCAxMS4xNTQ4IDIxLjY5NjhDMTEuNCAyMS4zNjczIDExLjg5MDMgMjEuMzY3MyAxMi4xMzU1IDIxLjY5NjhDMTMuMTM5MSAyMy4wMjk4IDE1LjMyMjYgMjYuMTI1IDE1LjMyMjYgMjcuNjU3M0MxNS4zMjI2IDI5LjY0OTIgMTMuNjc1NCAzMS4yNTgxIDExLjY0NTIgMzEuMjU4MVpNMTIuODcxIDE3Ljc3NDJDMTEuNTE0OSAxNy43NzQyIDEwLjQxOTQgMTYuNjc4NiAxMC40MTk0IDE1LjMyMjZDMTAuNDE5NCAxMy45NjY1IDExLjUxNDkgMTIuODcxIDEyLjg3MSAxMi44NzFDMTQuMjI3IDEyLjg3MSAxNS4zMjI2IDEzLjk2NjUgMTUuMzIyNiAxNS4zMjI2QzE1LjMyMjYgMTYuNjc4NiAxNC4yMjcgMTcuNzc0MiAxMi44NzEgMTcuNzc0MlpNMjUuOTEwNSAyOS41ODc5QzI0LjE5NDQgMjcuNTM0NyAyMS42NzM4IDI2LjM1NDggMTkgMjYuMzU0OEMxNy4zNzU4IDI2LjM1NDggMTcuMzc1OCAyMy45MDMyIDE5IDIzLjkwMzJDMjIuNDAxNiAyMy45MDMyIDI1LjYxMTcgMjUuNDA0OCAyNy43ODc1IDI4LjAyNUMyOC44NDQ4IDI5LjI4MTUgMjYuOTI5NCAzMC44MjE0IDI1LjkxMDUgMjkuNTg3OVoiIGZpbGw9ImJsYWNrIi8+Cjwvc3ZnPgo=",sizeSlug:"small"}],["core/heading",{textAlign:"center",content:Object(n.__)("Your cart is currently empty!","woo-gutenberg-products-block"),level:2,className:"wc-block-cart__empty-cart__title"}],X,["core/separator",{className:"is-style-dots"}],["core/heading",{textAlign:"center",content:Object(n.__)("New in store","woo-gutenberg-products-block"),level:2}],["woocommerce/product-new",{columns:3,rows:1}]].filter(Boolean);Object(u.registerBlockType)("woocommerce/empty-cart-block",{icon:{src:Object(r.createElement)(l.a,{icon:h.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{clientId:t}=e;const c=Object(s.useBlockProps)(),{currentView:n}=Object(p.b)(),o=Object(f.a)(_.innerBlockAreas.EMPTY_CART);return Object(k.a)({clientId:t,registeredBlocks:o,defaultTemplate:Z}),Object(r.createElement)("div",E()({},c,{hidden:"woocommerce/empty-cart-block"!==n}),Object(r.createElement)(s.InnerBlocks,{template:Z,templateLock:!1,renderAppender:s.InnerBlocks.ButtonBlockAppender}))},save:()=>Object(r.createElement)("div",s.useBlockProps.save(),Object(r.createElement)(s.InnerBlocks.Content,null))});var J=c(148),ee=c(416),te=e=>{let{className:t}=e;const{paymentMethods:c}=Object(x.b)();return Object(r.createElement)(J.a,{className:t,icons:Object(ee.a)(c)})};Object(u.registerBlockType)("woocommerce/cart-accepted-payment-methods-block",{icon:{src:Object(r.createElement)(l.a,{icon:P.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,n=Object(s.useBlockProps)();return Object(r.createElement)("div",n,Object(r.createElement)(te,{className:c}))},save:()=>Object(r.createElement)("div",s.useBlockProps.save())});var ce=c(417),re=c(418),ne=c(26);const oe=()=>{const{extensions:e,receiveCart:t,...c}=Object(N.a)(),n={extensions:e,cart:c,context:"woocommerce/cart"};return Object(r.createElement)(_.ExperimentalOrderMeta.Slot,n)};Object(u.registerBlockType)("woocommerce/cart-order-summary-block",{icon:{src:Object(r.createElement)(l.a,{icon:ce.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{clientId:t}=e;const c=Object(s.useBlockProps)(),{cartTotals:o}=Object(N.a)(),a=Object(ne.getCurrencyFromPriceResponse)(o),i=Object(f.a)(_.innerBlockAreas.CART_ORDER_SUMMARY),l=[["woocommerce/cart-order-summary-heading-block",{content:Object(n.__)("Cart totals","woo-gutenberg-products-block")},[]],["woocommerce/cart-order-summary-subtotal-block",{},[]],["woocommerce/cart-order-summary-fee-block",{},[]],["woocommerce/cart-order-summary-discount-block",{},[]],["woocommerce/cart-order-summary-coupon-form-block",{},[]],["woocommerce/cart-order-summary-shipping-block",{},[]],["woocommerce/cart-order-summary-taxes-block",{},[]]];return Object(k.a)({clientId:t,registeredBlocks:i,defaultTemplate:l}),Object(r.createElement)("div",c,Object(r.createElement)(s.InnerBlocks,{allowedBlocks:i,template:l}),Object(r.createElement)("div",{className:"wc-block-components-totals-wrapper"},Object(r.createElement)(re.a,{currency:a,values:o})),Object(r.createElement)(oe,null))},save:()=>Object(r.createElement)("div",s.useBlockProps.save(),Object(r.createElement)(s.InnerBlocks.Content,null))});var ae=e=>{let{className:t=""}=e;const{cartTotals:c}=Object(N.a)(),n=Object(ne.getCurrencyFromPriceResponse)(c);return Object(r.createElement)(_.TotalsWrapper,{className:t},Object(r.createElement)(_.Subtotal,{currency:n,values:c}))};Object(u.registerBlockType)("woocommerce/cart-order-summary-subtotal-block",{icon:{src:Object(r.createElement)(l.a,{icon:ce.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,n=Object(s.useBlockProps)();return Object(r.createElement)("div",n,Object(r.createElement)(ae,{className:c}))},save:()=>Object(r.createElement)("div",s.useBlockProps.save())});var se=e=>{let{className:t}=e;const{cartFees:c,cartTotals:n}=Object(N.a)(),o=Object(ne.getCurrencyFromPriceResponse)(n);return Object(r.createElement)(_.TotalsWrapper,{className:t},Object(r.createElement)(_.TotalsFees,{currency:o,cartFees:c}))};Object(u.registerBlockType)("woocommerce/cart-order-summary-fee-block",{icon:{src:Object(r.createElement)(l.a,{icon:ce.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,n=Object(s.useBlockProps)();return Object(r.createElement)("div",n,Object(r.createElement)(se,{className:c}))},save:()=>Object(r.createElement)("div",s.useBlockProps.save())});var ie=c(419),le=c(206);const ue=()=>{const{extensions:e,receiveCart:t,...c}=Object(N.a)(),n={extensions:e,cart:c,context:"woocommerce/cart"};return Object(r.createElement)(_.ExperimentalDiscountsMeta.Slot,n)};var de=e=>{let{className:t}=e;const{cartTotals:c,cartCoupons:n}=Object(N.a)(),{removeCoupon:o,isRemovingCoupon:a}=Object(le.a)("wc/cart"),s=Object(ne.getCurrencyFromPriceResponse)(c);return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(_.TotalsWrapper,{className:t},Object(r.createElement)(ie.a,{cartCoupons:n,currency:s,isRemovingCoupon:a,removeCoupon:o,values:c})),Object(r.createElement)(ue,null))};Object(u.registerBlockType)("woocommerce/cart-order-summary-discount-block",{icon:{src:Object(r.createElement)(l.a,{icon:ce.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,n=Object(s.useBlockProps)();return Object(r.createElement)("div",n,Object(r.createElement)(de,{className:c}))},save:()=>Object(r.createElement)("div",s.useBlockProps.save())});var pe=c(3),be=c(463),me=e=>{let{className:t,isShippingCalculatorEnabled:c}=e;const{cartTotals:n,cartNeedsShipping:o}=Object(N.a)();if(!o)return null;const a=Object(ne.getCurrencyFromPriceResponse)(n);return Object(r.createElement)(_.TotalsWrapper,{className:t},Object(r.createElement)(be.a,{showCalculator:c,showRateSelector:!0,values:n,currency:a}))},ge={isShippingCalculatorEnabled:{type:"boolean",default:Object(D.getSetting)("isShippingCalculatorEnabled",!0)},lock:{type:"object",default:{move:!1,remove:!0}}};Object(u.registerBlockType)("woocommerce/cart-order-summary-shipping-block",{icon:{src:Object(r.createElement)(l.a,{icon:ce.a,className:"wc-block-editor-components-block-icon"})},attributes:ge,edit:e=>{let{attributes:t,setAttributes:c}=e;const{isShippingCalculatorEnabled:o,className:a}=t,i=Object(D.getSetting)("shippingEnabled",!0),l=Object(s.useBlockProps)();return Object(r.createElement)("div",l,Object(r.createElement)(s.InspectorControls,null,!!i&&Object(r.createElement)(pe.PanelBody,{title:Object(n.__)("Shipping rates","woo-gutenberg-products-block")},Object(r.createElement)(pe.ToggleControl,{label:Object(n.__)("Shipping calculator","woo-gutenberg-products-block"),help:Object(n.__)("Allow customers to estimate shipping by entering their address.","woo-gutenberg-products-block"),checked:o,onChange:()=>c({isShippingCalculatorEnabled:!o})}))),Object(r.createElement)(C.a,null,Object(r.createElement)(me,{className:a,isShippingCalculatorEnabled:o})))},save:()=>Object(r.createElement)("div",s.useBlockProps.save())});var Oe=c(508),he=c(421),je=e=>{let{className:t}=e;const c=Object(D.getSetting)("couponsEnabled",!0),{applyCoupon:n,isApplyingCoupon:o}=Object(le.a)("wc/cart");return c?Object(r.createElement)(_.TotalsWrapper,{className:t},Object(r.createElement)(he.a,{onSubmit:n,isLoading:o})):null};Object(u.registerBlockType)("woocommerce/cart-order-summary-coupon-form-block",{icon:{src:Object(r.createElement)(l.a,{icon:Oe.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,n=Object(s.useBlockProps)();return Object(r.createElement)("div",n,Object(r.createElement)(C.a,null,Object(r.createElement)(je,{className:c})))},save:()=>Object(r.createElement)("div",s.useBlockProps.save())});var Ee=e=>{let{className:t,showRateAfterTaxName:c}=e;const{cartTotals:n}=Object(N.a)();if(Object(D.getSetting)("displayCartPricesIncludingTax",!1)||parseInt(n.total_tax,10)<=0)return null;const o=Object(ne.getCurrencyFromPriceResponse)(n);return Object(r.createElement)(_.TotalsWrapper,{className:t},Object(r.createElement)(_.TotalsTaxes,{showRateAfterTaxName:c,currency:o,values:n}))},_e={showRateAfterTaxName:{type:"boolean",default:Object(D.getSetting)("displayCartPricesIncludingTax",!1)},lock:{type:"object",default:{remove:!0,move:!1}}};Object(u.registerBlockType)("woocommerce/cart-order-summary-taxes-block",{icon:{src:Object(r.createElement)(l.a,{icon:ce.a,className:"wc-block-editor-components-block-icon"})},attributes:_e,edit:e=>{let{attributes:t,setAttributes:c}=e;const{className:o,showRateAfterTaxName:a}=t,i=Object(s.useBlockProps)(),l=Object(D.getSetting)("taxesEnabled"),u=Object(D.getSetting)("displayItemizedTaxes",!1),d=Object(D.getSetting)("displayCartPricesIncludingTax",!1);return Object(r.createElement)("div",i,Object(r.createElement)(s.InspectorControls,null,l&&u&&!d&&Object(r.createElement)(pe.PanelBody,{title:Object(n.__)("Taxes","woo-gutenberg-products-block")},Object(r.createElement)(pe.ToggleControl,{label:Object(n.__)("Show rate after tax name","woo-gutenberg-products-block"),help:Object(n.__)("Show the percentage rate alongside each tax line in the summary.","woo-gutenberg-products-block"),checked:a,onChange:()=>c({showRateAfterTaxName:!a})}))),Object(r.createElement)(Ee,{className:o,showRateAfterTaxName:a}))},save:()=>Object(r.createElement)("div",s.useBlockProps.save())});var ye=c(136);c(422),Object(u.registerBlockType)("woocommerce/cart-order-summary-heading-block",{icon:{src:Object(r.createElement)(l.a,{icon:ce.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t,setAttributes:c}=e;const{content:n="",className:o=""}=t,i=Object(s.useBlockProps)();return Object(r.createElement)("div",i,Object(r.createElement)(ye.a,{headingLevel:"2",className:a()(o,"wc-block-cart__totals-title")},Object(r.createElement)(s.PlainText,{className:"",value:n,onChange:e=>c({content:e})})))},save:()=>Object(r.createElement)("div",s.useBlockProps.save())}),c(423);var fe=c(424),ke=c(483),ve=c(425);c(267),Object(fe.a)();const we=["woocommerce/filled-cart-block","woocommerce/empty-cart-block"],Se=[{view:"woocommerce/filled-cart-block",label:Object(n.__)("Filled Cart","woo-gutenberg-products-block"),icon:Object(r.createElement)(l.a,{icon:O.a})},{view:"woocommerce/empty-cart-block",label:Object(n.__)("Empty Cart","woo-gutenberg-products-block"),icon:Object(r.createElement)(l.a,{icon:h.a})}];c(404);const Ce={isPreview:{type:"boolean",default:!1,save:!1},hasDarkControls:{type:"boolean",default:Object(D.getSetting)("hasDarkEditorStyleSupport",!1)},isShippingCalculatorEnabled:{type:"boolean",default:Object(D.getSetting)("isShippingCalculatorEnabled",!0)},checkoutPageId:{type:"number",default:0},showRateAfterTaxName:{type:"boolean",default:!0},align:{type:"string"}},Ne={title:Object(n.__)("Cart","woo-gutenberg-products-block"),icon:{src:Object(r.createElement)(l.a,{icon:i.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(n.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(n.__)("Shopping cart.","woo-gutenberg-products-block"),supports:{align:["wide"],html:!1,multiple:!1,__experimentalExposeControlsToChildren:!0},example:{attributes:{isPreview:!0}},attributes:Ce,edit:e=>{let{className:t,attributes:c,setAttributes:o,clientId:i}=e;const{hasDarkControls:l}=c,{currentView:u,component:b}=Object(ke.a)(i,Se),O=[["woocommerce/filled-cart-block",{},[]],["woocommerce/empty-cart-block",{},[]]],h=Object(fe.b)({className:a()(t,"wp-block-woocommerce-cart",{"is-editor-preview":c.isPreview})});return Object(k.a)({clientId:i,registeredBlocks:we,defaultTemplate:O}),Object(r.createElement)("div",h,Object(r.createElement)(s.InspectorControls,null,Object(r.createElement)(ve.a,{attributes:c,setAttributes:o})),Object(r.createElement)(d.a,{header:Object(n.__)("Cart Block Error","woo-gutenberg-products-block"),text:Object(n.__)("There was an error whilst rendering the cart block. If this problem continues, try re-creating the block.","woo-gutenberg-products-block"),showErrorMessage:!0,errorMessagePrefix:Object(n.__)("Error message:","woo-gutenberg-products-block")},Object(r.createElement)(p.a,{currentView:u,previewData:{previewCart:g.a}},Object(r.createElement)(s.BlockControls,{__experimentalShareWithChildBlocks:!0},b),Object(r.createElement)(v.Provider,{value:{hasDarkControls:l}},Object(r.createElement)(m,null,Object(r.createElement)(s.InnerBlocks,{allowedBlocks:we,template:O,templateLock:!1}))))))},save:()=>Object(r.createElement)("div",s.useBlockProps.save({className:"is-loading"}),Object(r.createElement)(s.InnerBlocks.Content,null)),deprecated:[{attributes:Ce,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",{className:a()("is-loading",t.className)},Object(r.createElement)(s.InnerBlocks.Content,null))},migrate:(e,t)=>{const{checkoutPageId:c,align:r}=e;return[e,[Object(u.createBlock)("woocommerce/filled-cart-block",{align:r},[Object(u.createBlock)("woocommerce/cart-items-block"),Object(u.createBlock)("woocommerce/cart-totals-block",{},[Object(u.createBlock)("woocommerce/cart-order-summary-block",{}),Object(u.createBlock)("woocommerce/cart-express-payment-block"),Object(u.createBlock)("woocommerce/proceed-to-checkout-block",{checkoutPageId:c}),Object(u.createBlock)("woocommerce/cart-accepted-payment-methods-block")])]),Object(u.createBlock)("woocommerce/empty-cart-block",{align:r},t)]]},isEligible:(e,t)=>!t.find(e=>"woocommerce/filled-cart-block"===e.name)}]};Object(u.registerBlockType)("woocommerce/cart",Ne)},,,,,function(e,t,c){"use strict";var r=c(0),n=c(282),o=c(6),a=c.n(o),s=c(23),i=c(1),l=c(13),u=c(4),d=c.n(u),p=c(10),b=c(534),m=c(102),g=c(221),O=c(35);c(257);var h=Object(p.withInstanceId)(e=>{let{id:t,className:c,label:n,onChange:o,options:a,value:s,required:l=!1,errorMessage:u=Object(i.__)("Please select a value.","woo-gutenberg-products-block"),errorId:p,instanceId:h="0",autoComplete:j="off"}=e;const{getValidationError:E,setValidationErrors:_,clearValidationError:y}=Object(m.b)(),f=Object(r.useRef)(null),k=t||"control-"+h,v=p||k,w=E(v)||{message:"",hidden:!1};return Object(r.useEffect)(()=>(!l||s?y(v):_({[v]:{message:u,hidden:!0}}),()=>{y(v)}),[y,s,v,u,l,_]),Object(r.createElement)("div",{id:k,className:d()("wc-block-components-combobox",c,{"is-active":s,"has-error":w.message&&!w.hidden}),ref:f},Object(r.createElement)(b.a,{className:"wc-block-components-combobox-control",label:n,onChange:o,onFilterValueChange:e=>{if(e.length){const t=Object(O.a)(f.current)?f.current.ownerDocument.activeElement:void 0;if(t&&Object(O.a)(f.current)&&f.current.contains(t))return;const c=e.toLocaleUpperCase(),r=a.find(e=>e.label.toLocaleUpperCase().startsWith(c)||e.value.toLocaleUpperCase()===c);r&&o(r.value)}},options:a,value:s||"",allowReset:!1,autoComplete:j,"aria-invalid":w.message&&!w.hidden}),Object(r.createElement)(g.a,{propertyName:v}))});c(256);var j=e=>{let{className:t,countries:c,id:n,label:o,onChange:a,value:s="",autoComplete:u="off",required:p=!1,errorId:b,errorMessage:m=Object(i.__)("Please select a country.","woo-gutenberg-products-block")}=e;const g=Object(r.useMemo)(()=>Object.entries(c).map(e=>{let[t,c]=e;return{value:t,label:Object(l.decodeEntities)(c)}}),[c]);return Object(r.createElement)("div",{className:d()(t,"wc-block-components-country-input")},Object(r.createElement)(h,{id:n,label:o,onChange:a,options:g,value:s,errorId:b,errorMessage:m,required:p,autoComplete:u}),"off"!==u&&Object(r.createElement)("input",{type:"text","aria-hidden":!0,autoComplete:u,value:s,onChange:e=>{const t=e.target.value.toLocaleUpperCase(),c=g.find(e=>2!==t.length&&e.label.toLocaleUpperCase()===t||2===t.length&&e.value.toLocaleUpperCase()===t);a(c?c.value:"")},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1}))},E=e=>Object(r.createElement)(j,a()({countries:s.h},e)),_=e=>Object(r.createElement)(j,a()({countries:s.a},e));c(258);const y=(e,t)=>{const c=t.find(t=>t.label.toLocaleUpperCase()===e.toLocaleUpperCase()||t.value.toLocaleUpperCase()===e.toLocaleUpperCase());return c?c.value:""};var f=e=>{let{className:t,id:c,states:o,country:a,label:s,onChange:u,autoComplete:p="off",value:b="",required:m=!1}=e;const g=o[a],O=Object(r.useMemo)(()=>g?Object.keys(g).map(e=>({value:e,label:Object(l.decodeEntities)(g[e])})):[],[g]),j=Object(r.useCallback)(e=>{u(O.length>0?y(e,O):e)},[u,O]),E=Object(r.useRef)(b);return Object(r.useEffect)(()=>{E.current!==b&&(E.current=b)},[b]),Object(r.useEffect)(()=>{if(O.length>0&&E.current){const e=y(E.current,O);e!==E.current&&j(e)}},[O,j]),O.length>0?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(h,{className:d()(t,"wc-block-components-state-input"),id:c,label:s,onChange:j,options:O,value:b,errorMessage:Object(i.__)("Please select a state.","woo-gutenberg-products-block"),required:m,autoComplete:p}),"off"!==p&&Object(r.createElement)("input",{type:"text","aria-hidden":!0,autoComplete:p,value:b,onChange:e=>j(e.target.value),style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1})):Object(r.createElement)(n.a,{className:t,id:c,label:s,onChange:j,autoComplete:p,value:b,required:m})},k=e=>Object(r.createElement)(f,a()({states:s.i},e)),v=e=>Object(r.createElement)(f,a()({states:s.b},e)),w=c(49),S=c(2),C=c(90);t.a=Object(p.withInstanceId)(e=>{let{id:t="",fields:c=Object.keys(S.defaultAddressFields),fieldConfig:o={},instanceId:a,onChange:s,type:l="shipping",values:u}=e;const{getValidationError:d,setValidationErrors:p,clearValidationError:b}=Object(m.b)(),g=Object(w.a)(c),O=d("shipping-missing-country")||{},h=Object(r.useMemo)(()=>Object(C.a)(g,o,u.country),[g,o,u.country]);return Object(r.useEffect)(()=>{h.forEach(e=>{e.hidden&&u[e.key]&&s({...u,[e.key]:""})})},[h,s,u]),Object(r.useEffect)(()=>{"shipping"===l&&((e,t,c,r)=>{r||e.country||!(e.city||e.state||e.postcode)||t({"shipping-missing-country":{message:Object(i.__)("Please select a country to calculate rates.","woo-gutenberg-products-block"),hidden:!1}}),r&&e.country&&c("shipping-missing-country")})(u,p,b,!!O.message&&!O.hidden)},[u,O.message,O.hidden,p,b,l]),t=t||a,Object(r.createElement)("div",{id:t,className:"wc-block-components-address-form"},h.map(e=>{if(e.hidden)return null;if("country"===e.key){const c="shipping"===l?E:_;return Object(r.createElement)(c,{key:e.key,id:`${t}-${e.key}`,label:e.required?e.label:e.optionalLabel,value:u.country,autoComplete:e.autocomplete,onChange:e=>s({...u,country:e,state:""}),errorId:"shipping"===l?"shipping-missing-country":null,errorMessage:e.errorMessage,required:e.required})}if("state"===e.key){const c="shipping"===l?k:v;return Object(r.createElement)(c,{key:e.key,id:`${t}-${e.key}`,country:u.country,label:e.required?e.label:e.optionalLabel,value:u.state,autoComplete:e.autocomplete,onChange:e=>s({...u,state:e}),errorMessage:e.errorMessage,required:e.required})}return Object(r.createElement)(n.a,{key:e.key,id:`${t}-${e.key}`,className:"wc-block-components-address-form__"+e.key,label:e.required?e.label:e.optionalLabel,value:u[e.key],autoCapitalize:e.autocapitalize,autoComplete:e.autocomplete,onChange:t=>s({...u,[e.key]:t}),errorMessage:e.errorMessage,required:e.required})}))})},,,function(e,t,c){"use strict";var r=c(6),n=c.n(r),o=c(0),a=c(4),s=c.n(a),i=c(1),l=c(41),u=c(18),d=c(2),p=c(13);const b=e=>{let{selectedShippingRates:t}=e;return Object(o.createElement)("div",{className:"wc-block-components-totals-item__description wc-block-components-totals-shipping__via"},Object(i.__)("via","woo-gutenberg-products-block")," ",Object(p.decodeEntities)(t.join(", ")))};var m=c(283),g=c(211),O=e=>{let{hasRates:t,shippingRates:c,isLoadingRates:r}=e;const n=t?Object(i.__)("Shipping options","woo-gutenberg-products-block"):Object(i.__)("Choose a shipping option","woo-gutenberg-products-block");return Object(o.createElement)("fieldset",{className:"wc-block-components-totals-shipping__fieldset"},Object(o.createElement)("legend",{className:"screen-reader-text"},n),Object(o.createElement)(g.a,{className:"wc-block-components-totals-shipping__options",collapsible:!0,noResultsMessage:Object(o.createElement)(m.a,{isDismissible:!1,className:s()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(i.__)("No shipping options were found.","woo-gutenberg-products-block")),shippingRates:c,isLoadingRates:r,context:"woocommerce/cart"}))},h=c(88),j=c(68),E=c(22),_=c.n(E),y=c(102),f=(c(190),c(460)),k=e=>{let{address:t,onUpdate:c,addressFields:r}=e;const[n,a]=Object(o.useState)(t),{hasValidationErrors:s,showAllValidationErrors:l}=Object(y.b)();return Object(o.createElement)("form",{className:"wc-block-components-shipping-calculator-address"},Object(o.createElement)(f.a,{fields:r,onChange:a,values:n}),Object(o.createElement)(j.a,{className:"wc-block-components-shipping-calculator-address__button",disabled:_()(n,t),onClick:e=>{if(e.preventDefault(),l(),!s)return c(n)},type:"submit"},Object(i.__)("Update","woo-gutenberg-products-block")))},v=e=>{let{onUpdate:t=(()=>{}),addressFields:c=["country","state","city","postcode"]}=e;const{shippingAddress:r,setShippingAddress:n,setBillingAddress:a}=Object(h.a)();return Object(o.createElement)("div",{className:"wc-block-components-shipping-calculator"},Object(o.createElement)(k,{address:r,addressFields:c,onUpdate:e=>{n(e),a(e),t(e)}}))},w=e=>{let{address:t}=e;if(0===Object.values(t).length)return null;const c=Object(d.getSetting)("shippingCountries",{}),r=Object(d.getSetting)("shippingStates",{}),n="string"==typeof c[t.country]?Object(p.decodeEntities)(c[t.country]):"",a="object"==typeof r[t.country]&&"string"==typeof r[t.country][t.state]?Object(p.decodeEntities)(r[t.country][t.state]):t.state,s=[];s.push(t.postcode.toUpperCase()),s.push(t.city),s.push(a),s.push(n);const l=s.filter(Boolean).join(", ");return l?Object(o.createElement)("span",{className:"wc-block-components-shipping-address"},Object(i.sprintf)( +/* translators: %s location. */ +Object(i.__)("Shipping to %s","woo-gutenberg-products-block"),l)+" "):null};c(255);const S=e=>{let{label:t=Object(i.__)("Calculate","woo-gutenberg-products-block"),isShippingCalculatorOpen:c,setIsShippingCalculatorOpen:r}=e;return Object(o.createElement)("button",{className:"wc-block-components-totals-shipping__change-address-button",onClick:()=>{r(!c)},"aria-expanded":c},t)},C=e=>{let{showCalculator:t,isShippingCalculatorOpen:c,setIsShippingCalculatorOpen:r,shippingAddress:n}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(w,{address:n}),t&&Object(o.createElement)(S,{label:Object(i.__)("(change address)","woo-gutenberg-products-block"),isShippingCalculatorOpen:c,setIsShippingCalculatorOpen:r}))},N=e=>{let{showCalculator:t,isShippingCalculatorOpen:c,setIsShippingCalculatorOpen:r,isCheckout:n=!1}=e;return t?Object(o.createElement)(S,{isShippingCalculatorOpen:c,setIsShippingCalculatorOpen:r}):Object(o.createElement)("em",null,n?Object(i.__)("No shipping options available","woo-gutenberg-products-block"):Object(i.__)("Calculated during checkout","woo-gutenberg-products-block"))};t.a=e=>{let{currency:t,values:c,showCalculator:r=!0,showRateSelector:a=!0,isCheckout:p=!1,className:m}=e;const[g,h]=Object(o.useState)(!1),{shippingAddress:j,cartHasCalculatedShipping:E,shippingRates:_,isLoadingRates:y}=Object(l.a)(),f=Object(d.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(c.total_shipping,10)+parseInt(c.total_shipping_tax,10):parseInt(c.total_shipping,10),k=_.some(e=>e.shipping_rates.length)||f,w={isShippingCalculatorOpen:g,setIsShippingCalculatorOpen:h},S=_.flatMap(e=>e.shipping_rates.filter(e=>e.selected).flatMap(e=>e.name));return Object(o.createElement)("div",{className:s()("wc-block-components-totals-shipping",m)},Object(o.createElement)(u.TotalsItem,{label:Object(i.__)("Shipping","woo-gutenberg-products-block"),value:k&&E?f:Object(o.createElement)(N,n()({showCalculator:r,isCheckout:p},w)),description:k&&E?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(b,{selectedShippingRates:S}),Object(o.createElement)(C,n()({shippingAddress:j,showCalculator:r},w))):null,currency:t}),r&&g&&Object(o.createElement)(v,{onUpdate:()=>{h(!1)}}),a&&E&&Object(o.createElement)(O,{hasRates:k,shippingRates:_,isLoadingRates:y}))}},,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return p}));var r=c(0),n=c(1),o=c(9),a=c(3),s=c(11),i=Object(r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M12 6a9.77 9.77 0 0 1 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0 1 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"})),l=c(113),u=c(5);function d(e,t){return t.find(t=>t.view===e)}const p=(e,t)=>{const c=t[0],[s,p]=Object(r.useState)(c),{selectBlock:b}=Object(o.useDispatch)("core/block-editor"),{getBlock:m,getSelectedBlockClientId:g,getBlockParentsByBlockName:O}=Object(o.select)(u.store),h=g();Object(r.useEffect)(()=>{const e=m(h);if(!e)return;if(s.view===e.name)return;const c=t.map(e=>{let{view:t}=e;return t});if(c.includes(e.name)){const c=d(e.name,t);if(c)return p(c)}const r=O(h,c);if(1!==r.length)return;const n=m(r[0]);if(s.view===n.name)return;const o=d(n.name,t);o&&p(o)},[O,h,m,s.view,t]);const j=Object(r.createElement)(a.ToolbarGroup,null,Object(r.createElement)(a.ToolbarDropdownMenu,{label:Object(n.__)("Switch view","woo-gutenberg-products-block"),text:s.label,icon:Object(r.createElement)(l.a,{icon:i,style:{marginRight:"8px"}}),controls:t.map(t=>({...t,title:Object(r.createElement)("span",null,t.label),isActive:t.view===s.view,onClick:()=>{var c;p(t),b((null===(c=m(e).innerBlocks.find(e=>e.name===t.view))||void 0===c?void 0:c.clientId)||e)}}))}));return{currentView:s.view,component:j}}},,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(0);const n={bottom:0,left:0,opacity:0,pointerEvents:"none",position:"absolute",right:0,top:0,zIndex:-1},o=()=>{const[e,t]=Object(r.useState)(""),c=Object(r.useRef)(null),o=Object(r.useRef)(new IntersectionObserver(e=>{e[0].isIntersecting?t("visible"):t(e[0].boundingClientRect.top>0?"below":"above")},{threshold:1}));return Object(r.useLayoutEffect)(()=>{const e=c.current,t=o.current;return e&&t.observe(e),()=>{t.unobserve(e)}},[]),[Object(r.createElement)("div",{"aria-hidden":!0,ref:c,style:n}),e]}}]); \ No newline at end of file diff --git a/build/checkout-actions-block/block.json b/build/checkout-actions-block/block.json new file mode 100644 index 00000000000..79ff5324e61 --- /dev/null +++ b/build/checkout-actions-block/block.json @@ -0,0 +1,28 @@ +{ + "name": "woocommerce/checkout-actions-block", + "version": "1.0.0", + "title": "Actions", + "description": "Allow customers to place their order.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/checkout-fields-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-billing-address-block/block.json b/build/checkout-billing-address-block/block.json new file mode 100644 index 00000000000..c815c0f535e --- /dev/null +++ b/build/checkout-billing-address-block/block.json @@ -0,0 +1,28 @@ +{ + "name": "woocommerce/checkout-billing-address-block", + "version": "1.0.0", + "title": "Billing Address", + "description": "Collect your customer's billing address.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/checkout-fields-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-blocks/actions-frontend.js b/build/checkout-blocks/actions-frontend.js new file mode 100644 index 00000000000..bb07c0fbd42 --- /dev/null +++ b/build/checkout-blocks/actions-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[29],{135:function(e,t,n){"use strict";var c=n(0);n(196),t.a=()=>Object(c.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},196:function(e,t){},266:function(e,t,n){"use strict";var c=n(12),o=n.n(c),a=n(0),s=n(42),r=n(4),i=n.n(r),l=n(135);n(267),t.a=e=>{let{className:t,showSpinner:n=!1,children:c,variant:r="contained",...u}=e;const b=i()("wc-block-components-button",t,r,{"wc-block-components-button--loading":n});return Object(a.createElement)(s.a,o()({className:b},u),n&&Object(a.createElement)(l.a,null),Object(a.createElement)("span",{className:"wc-block-components-button__text"},c))}},267:function(e,t){},278:function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return r}));var c=n(31),o=n(207);const a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{paymentMethods:t,expressPaymentMethods:n,paymentMethodsInitialized:a,expressPaymentMethodsInitialized:s}=Object(o.b)(),r=Object(c.a)(t),i=Object(c.a)(n);return{paymentMethods:e?i:r,isInitialized:e?s:a}},s=()=>a(!1),r=()=>a(!0)},362:function(e,t,n){"use strict";var c=n(0),o=n(13);const a=Object(c.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(o.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));t.a=a},391:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var c=n(1),o=n(36),a=n(207),s=n(278);const r=()=>{const{onSubmit:e,isCalculating:t,isBeforeProcessing:n,isProcessing:r,isAfterProcessing:i,isComplete:l,hasError:u}=Object(o.b)(),{paymentMethods:b={}}=Object(s.b)(),{activePaymentMethod:m,currentStatus:d}=Object(a.b)(),p=b[m]||{},w=r||i||n,g=l&&!u;return{submitButtonText:(null==p?void 0:p.placeOrderButtonLabel)||Object(c.__)("Place Order","woo-gutenberg-products-block"),onSubmit:e,isCalculating:t,isDisabled:r||d.isDoingExpressPayment,waitingForProcessing:w,waitingForRedirect:g}}},392:function(e,t){},393:function(e,t){},433:function(e,t,n){"use strict";n.r(t);var c=n(119),o=n(0),a=n(4),s=n.n(a),r=n(2),i=n(1),l=n(48),u=n(117),b=n(13),m=Object(o.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(b.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));n(393);var d=e=>{let{link:t}=e;const n=t||l.c;return n?Object(o.createElement)("a",{href:n,className:"wc-block-components-checkout-return-to-cart-button"},Object(o.createElement)(u.a,{icon:m}),Object(i.__)("Return to Cart","woo-gutenberg-products-block")):null},p=n(391),w=n(362),g=n(266),O=()=>{const{submitButtonText:e,onSubmit:t,isCalculating:n,isDisabled:c,waitingForProcessing:a,waitingForRedirect:s}=Object(p.a)();return Object(o.createElement)(g.a,{className:"wc-block-components-checkout-place-order-button",onClick:t,disabled:n||c||a||s,showSpinner:a},s?Object(o.createElement)(u.a,{icon:w.a}):e)};n(392);t.default=Object(c.withFilteredAttributes)({cartPageId:{type:"number",default:0},showReturnToCart:{type:"boolean",default:!0},className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}})(e=>{let{cartPageId:t,showReturnToCart:n,className:c}=e;return Object(o.createElement)("div",{className:s()("wc-block-checkout__actions",c)},n&&Object(o.createElement)(d,{link:Object(r.getSetting)("page-"+t,!1)}),Object(o.createElement)(O,null))})}}]); \ No newline at end of file diff --git a/build/checkout-blocks/billing-address--checkout-blocks/shipping-address-frontend.js b/build/checkout-blocks/billing-address--checkout-blocks/shipping-address-frontend.js new file mode 100644 index 00000000000..bb85eedb49c --- /dev/null +++ b/build/checkout-blocks/billing-address--checkout-blocks/shipping-address-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[6],{22:function(e,t,a){"use strict";var n=a(0),r=a(4),c=a.n(r);t.a=e=>{let t,{label:a,screenReaderLabel:r,wrapperElement:o,wrapperProps:s={}}=e;const l=null!=a,i=null!=r;return!l&&i?(t=o||"span",s={...s,className:c()(s.className,"screen-reader-text")},Object(n.createElement)(t,s,r)):(t=o||n.Fragment,l&&i&&a!==r?Object(n.createElement)(t,s,Object(n.createElement)("span",{"aria-hidden":"true"},a),Object(n.createElement)("span",{className:"screen-reader-text"},r)):Object(n.createElement)(t,s,a))}},264:function(e,t){},265:function(e,t){},268:function(e,t,a){"use strict";var n=a(12),r=a.n(n),c=a(0),o=a(4),s=a.n(o);a(269),t.a=e=>{let{children:t,className:a,headingLevel:n,...o}=e;const l=s()("wc-block-components-title",a),i="h"+n;return Object(c.createElement)(i,r()({className:l},o),t)}},269:function(e,t){},276:function(e,t){},277:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(0),r=a(199);a(264);const c=e=>{let{errorMessage:t="",propertyName:a="",elementId:c=""}=e;const{getValidationError:o,getValidationErrorId:s}=Object(r.b)();if(!t||"string"!=typeof t){const e=o(a)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:s(c)},t))}},279:function(e,t,a){"use strict";var n=a(1);t.a=e=>{let{defaultTitle:t=Object(n.__)("Step","woo-gutenberg-products-block"),defaultDescription:a=Object(n.__)("Step description text.","woo-gutenberg-products-block"),defaultShowStepNumber:r=!0}=e;return{title:{type:"string",default:t},description:{type:"string",default:a},showStepNumber:{type:"boolean",default:r}}}},298:function(e,t,a){"use strict";var n=a(0),r=a(4),c=a.n(r),o=a(268);a(276);const s=e=>{let{title:t,stepHeadingContent:a}=e;return Object(n.createElement)("div",{className:"wc-block-components-checkout-step__heading"},Object(n.createElement)(o.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!a&&Object(n.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},a))};t.a=e=>{let{id:t,className:a,title:r,legend:o,description:l,children:i,disabled:u=!1,showStepNumber:d=!0,stepHeadingContent:b=(()=>{})}=e;const p=o||r?"fieldset":"div";return Object(n.createElement)(p,{className:c()(a,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":d,"wc-block-components-checkout-step--disabled":u}),id:t,disabled:u},!(!o&&!r)&&Object(n.createElement)("legend",{className:"screen-reader-text"},o||r),!!r&&Object(n.createElement)(s,{title:r,stepHeadingContent:b()}),Object(n.createElement)("div",{className:"wc-block-components-checkout-step__container"},!!l&&Object(n.createElement)("p",{className:"wc-block-components-checkout-step__description"},l),Object(n.createElement)("div",{className:"wc-block-components-checkout-step__content"},i)))}},302:function(e,t,a){"use strict";var n=a(12),r=a.n(n),c=a(0),o=a(1),s=a(5),l=a(4),i=a.n(l),u=a(199),d=a(277),b=a(9),p=a(45),m=a(22);a(265);var g=Object(s.forwardRef)((e,t)=>{let{className:a,id:n,type:o="text",ariaLabel:s,ariaDescribedBy:l,label:u,screenReaderLabel:d,disabled:b,help:p,autoCapitalize:g="off",autoComplete:h="off",value:O="",onChange:f,required:j=!1,onBlur:v=(()=>{}),feedback:E,...k}=e;const[y,C]=Object(c.useState)(!1);return Object(c.createElement)("div",{className:i()("wc-block-components-text-input",a,{"is-active":y||O})},Object(c.createElement)("input",r()({type:o,id:n,value:O,ref:t,autoCapitalize:g,autoComplete:h,onChange:e=>{f(e.target.value)},onFocus:()=>C(!0),onBlur:e=>{v(e.target.value),C(!1)},"aria-label":s||u,disabled:b,"aria-describedby":p&&!l?n+"__help":l,required:j},k)),Object(c.createElement)(m.a,{label:u,screenReaderLabel:d||u,wrapperElement:"label",wrapperProps:{htmlFor:n},htmlFor:n}),!!p&&Object(c.createElement)("p",{id:n+"__help",className:"wc-block-components-text-input__help"},p),E)});t.a=Object(b.withInstanceId)(e=>{let{className:t,instanceId:a,id:n,ariaDescribedBy:l,errorId:b,focusOnMount:m=!1,onChange:h,showError:O=!0,errorMessage:f="",value:j="",...v}=e;const[E,k]=Object(s.useState)(!0),y=Object(s.useRef)(null),{getValidationError:C,hideValidationError:w,setValidationErrors:N,clearValidationError:_,getValidationErrorId:I}=Object(u.b)(),L=void 0!==n?n:"textinput-"+a,A=void 0!==b?b:L,S=Object(s.useCallback)((function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=y.current||null;if(!t)return;t.value=t.value.trim();const a=t.checkValidity();a?_(A):N({[A]:{message:t.validationMessage||Object(o.__)("Invalid value.","woo-gutenberg-products-block"),hidden:e}})}),[_,A,N]);Object(s.useEffect)(()=>{var e;E&&m&&(null===(e=y.current)||void 0===e||e.focus()),k(!1)},[m,E,k]),Object(s.useEffect)(()=>{var e,t;(null===(e=y.current)||void 0===e||null===(t=e.ownerDocument)||void 0===t?void 0:t.activeElement)!==y.current&&S(!0)},[j,S]),Object(s.useEffect)(()=>()=>{_(A)},[_,A]);const q=C(A)||{};Object(p.a)(f)&&""!==f&&(q.message=f);const M=q.message&&!q.hidden,B=O&&M&&I(A)?I(A):l;return Object(c.createElement)(g,r()({className:i()(t,{"has-error":M}),"aria-invalid":!0===M,id:L,onBlur:()=>{S(!1)},feedback:O&&Object(c.createElement)(d.a,{errorMessage:f,propertyName:A}),ref:y,onChange:e=>{w(A),h(e)},ariaDescribedBy:B,value:j},v))})},318:function(e,t){},319:function(e,t){},320:function(e,t){},339:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));var n=a(2),r=a(0),c=a(36),o=a(67),s=a(66);const l=()=>{const{needsShipping:e}=Object(s.a)(),{useShippingAsBilling:t,setUseShippingAsBilling:a}=Object(c.b)(),{billingAddress:l,setBillingAddress:i,shippingAddress:u,setShippingAddress:d}=Object(o.a)(),b=Object(r.useCallback)(e=>{i({email:e})},[i]),p=Object(r.useCallback)(e=>{i({phone:e})},[i]),m=Object(r.useCallback)(e=>{d({phone:e})},[d]);return{shippingAddress:u,billingAddress:l,setShippingAddress:d,setBillingAddress:i,setEmail:b,setBillingPhone:p,setShippingPhone:m,defaultAddressFields:n.defaultAddressFields,useShippingAsBilling:t,setUseShippingAsBilling:a,showShippingFields:e,showBillingFields:!e||!t}}},340:function(e,t,a){"use strict";var n=a(12),r=a.n(n),c=a(0),o=a(44),s=a(51);const l=["BUTTON","FIELDSET","INPUT","OPTGROUP","OPTION","SELECT","TEXTAREA","A"];t.a=e=>{let{children:t,style:a={},...n}=e;const i=Object(c.useRef)(null),u=()=>{i.current&&o.focus.focusable.find(i.current).forEach(e=>{l.includes(e.nodeName)&&e.setAttribute("tabindex","-1"),e.hasAttribute("contenteditable")&&e.setAttribute("contenteditable","false")})},d=Object(s.a)(u,0,{leading:!0});return Object(c.useLayoutEffect)(()=>{let e;return u(),i.current&&(e=new window.MutationObserver(d),e.observe(i.current,{childList:!0,attributes:!0,subtree:!0})),()=>{e&&e.disconnect(),d.cancel()}},[d]),Object(c.createElement)("div",r()({ref:i,"aria-disabled":"true",style:{userSelect:"none",pointerEvents:"none",cursor:"normal",...a}},n),t)}},341:function(e,t,a){"use strict";var n=a(0),r=a(1),c=a(302);t.a=e=>{let{id:t="phone",isRequired:a=!1,value:o="",onChange:s}=e;return Object(n.createElement)(c.a,{id:t,type:"tel",autoComplete:"tel",required:a,label:a?Object(r.__)("Phone","woo-gutenberg-products-block"):Object(r.__)("Phone (optional)","woo-gutenberg-products-block"),value:o,onChange:s})}},396:function(e,t,a){"use strict";var n=a(0),r=a(302),c=a(12),o=a.n(c),s=a(48),l=a(1),i=a(17),u=a(4),d=a.n(u),b=a(9),p=a(437),m=a(199),g=a(277),h=a(18);a(319);var O=Object(b.withInstanceId)(e=>{let{id:t,className:a,label:r,onChange:c,options:o,value:s,required:i=!1,errorMessage:u=Object(l.__)("Please select a value.","woo-gutenberg-products-block"),errorId:b,instanceId:O="0",autoComplete:f="off"}=e;const{getValidationError:j,setValidationErrors:v,clearValidationError:E}=Object(m.b)(),k=Object(n.useRef)(null),y=t||"control-"+O,C=b||y,w=j(C)||{message:"",hidden:!1};return Object(n.useEffect)(()=>(!i||s?E(C):v({[C]:{message:u,hidden:!0}}),()=>{E(C)}),[E,s,C,u,i,v]),Object(n.createElement)("div",{id:y,className:d()("wc-block-components-combobox",a,{"is-active":s,"has-error":w.message&&!w.hidden}),ref:k},Object(n.createElement)(p.a,{className:"wc-block-components-combobox-control",label:r,onChange:c,onFilterValueChange:e=>{if(e.length){const t=Object(h.a)(k.current)?k.current.ownerDocument.activeElement:void 0;if(t&&Object(h.a)(k.current)&&k.current.contains(t))return;const a=e.toLocaleUpperCase(),n=o.find(e=>e.label.toLocaleUpperCase().startsWith(a)||e.value.toLocaleUpperCase()===a);n&&c(n.value)}},options:o,value:s||"",allowReset:!1,autoComplete:f,"aria-invalid":w.message&&!w.hidden}),Object(n.createElement)(g.a,{propertyName:C}))});a(318);var f=e=>{let{className:t,countries:a,id:r,label:c,onChange:o,value:s="",autoComplete:u="off",required:b=!1,errorId:p,errorMessage:m=Object(l.__)("Please select a country.","woo-gutenberg-products-block")}=e;const g=Object(n.useMemo)(()=>Object.entries(a).map(e=>{let[t,a]=e;return{value:t,label:Object(i.decodeEntities)(a)}}),[a]);return Object(n.createElement)("div",{className:d()(t,"wc-block-components-country-input")},Object(n.createElement)(O,{id:r,label:c,onChange:o,options:g,value:s,errorId:p,errorMessage:m,required:b,autoComplete:u}),"off"!==u&&Object(n.createElement)("input",{type:"text","aria-hidden":!0,autoComplete:u,value:s,onChange:e=>{const t=e.target.value.toLocaleUpperCase(),a=g.find(e=>2!==t.length&&e.label.toLocaleUpperCase()===t||2===t.length&&e.value.toLocaleUpperCase()===t);o(a?a.value:"")},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1}))},j=e=>Object(n.createElement)(f,o()({countries:s.g},e)),v=e=>Object(n.createElement)(f,o()({countries:s.a},e));a(320);const E=(e,t)=>{const a=t.find(t=>t.label.toLocaleUpperCase()===e.toLocaleUpperCase()||t.value.toLocaleUpperCase()===e.toLocaleUpperCase());return a?a.value:""};var k=e=>{let{className:t,id:a,states:c,country:o,label:s,onChange:u,autoComplete:b="off",value:p="",required:m=!1}=e;const g=c[o],h=Object(n.useMemo)(()=>g?Object.keys(g).map(e=>({value:e,label:Object(i.decodeEntities)(g[e])})):[],[g]),f=Object(n.useCallback)(e=>{u(h.length>0?E(e,h):e)},[u,h]),j=Object(n.useRef)(p);return Object(n.useEffect)(()=>{j.current!==p&&(j.current=p)},[p]),Object(n.useEffect)(()=>{if(h.length>0&&j.current){const e=E(j.current,h);e!==j.current&&f(e)}},[h,f]),h.length>0?Object(n.createElement)(n.Fragment,null,Object(n.createElement)(O,{className:d()(t,"wc-block-components-state-input"),id:a,label:s,onChange:f,options:h,value:p,errorMessage:Object(l.__)("Please select a state.","woo-gutenberg-products-block"),required:m,autoComplete:b}),"off"!==b&&Object(n.createElement)("input",{type:"text","aria-hidden":!0,autoComplete:b,value:p,onChange:e=>f(e.target.value),style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1})):Object(n.createElement)(r.a,{className:t,id:a,label:s,onChange:f,autoComplete:b,value:p,required:m})},y=e=>Object(n.createElement)(k,o()({states:s.h},e)),C=e=>Object(n.createElement)(k,o()({states:s.b},e)),w=a(31),N=a(2),_=a(49);t.a=Object(b.withInstanceId)(e=>{let{id:t="",fields:a=Object.keys(N.defaultAddressFields),fieldConfig:c={},instanceId:o,onChange:s,type:i="shipping",values:u}=e;const{getValidationError:d,setValidationErrors:b,clearValidationError:p}=Object(m.b)(),g=Object(w.a)(a),h=d("shipping-missing-country")||{},O=Object(n.useMemo)(()=>Object(_.a)(g,c,u.country),[g,c,u.country]);return Object(n.useEffect)(()=>{O.forEach(e=>{e.hidden&&u[e.key]&&s({...u,[e.key]:""})})},[O,s,u]),Object(n.useEffect)(()=>{"shipping"===i&&((e,t,a,n)=>{n||e.country||!(e.city||e.state||e.postcode)||t({"shipping-missing-country":{message:Object(l.__)("Please select a country to calculate rates.","woo-gutenberg-products-block"),hidden:!1}}),n&&e.country&&a("shipping-missing-country")})(u,b,p,!!h.message&&!h.hidden)},[u,h.message,h.hidden,b,p,i]),t=t||o,Object(n.createElement)("div",{id:t,className:"wc-block-components-address-form"},O.map(e=>{if(e.hidden)return null;if("country"===e.key){const a="shipping"===i?j:v;return Object(n.createElement)(a,{key:e.key,id:`${t}-${e.key}`,label:e.required?e.label:e.optionalLabel,value:u.country,autoComplete:e.autocomplete,onChange:e=>s({...u,country:e,state:""}),errorId:"shipping"===i?"shipping-missing-country":null,errorMessage:e.errorMessage,required:e.required})}if("state"===e.key){const a="shipping"===i?y:C;return Object(n.createElement)(a,{key:e.key,id:`${t}-${e.key}`,country:u.country,label:e.required?e.label:e.optionalLabel,value:u.state,autoComplete:e.autocomplete,onChange:e=>s({...u,state:e}),errorMessage:e.errorMessage,required:e.required})}return Object(n.createElement)(r.a,{key:e.key,id:`${t}-${e.key}`,className:"wc-block-components-address-form__"+e.key,label:e.required?e.label:e.optionalLabel,value:u[e.key],autoCapitalize:e.autocapitalize,autoComplete:e.autocomplete,onChange:t=>s({...u,[e.key]:t}),errorMessage:e.errorMessage,required:e.required})}))})}}]); \ No newline at end of file diff --git a/build/checkout-blocks/billing-address-frontend.js b/build/checkout-blocks/billing-address-frontend.js new file mode 100644 index 00000000000..2b1f16962e7 --- /dev/null +++ b/build/checkout-blocks/billing-address-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[30],{443:function(e,t,i){"use strict";i.r(t);var l=i(0),s=i(4),n=i.n(s),o=i(119),d=i(298),r=i(36),c=i(339),a=i(59),b=i(29),u=i(396),h=i(340),p=i(341),m=e=>{let{showCompanyField:t=!1,showApartmentField:i=!1,showPhoneField:s=!1,requireCompanyField:n=!1,requirePhoneField:o=!1}=e;const{defaultAddressFields:d,billingAddress:r,setBillingAddress:m,setBillingPhone:w}=Object(c.a)(),{dispatchCheckoutEvent:g}=Object(a.a)(),{isEditor:j}=Object(b.a)();Object(l.useEffect)(()=>{s||w("")},[s,w]);const F=Object(l.useMemo)(()=>({company:{hidden:!t,required:n},address_2:{hidden:!i}}),[t,n,i]),O=j?h.a:l.Fragment;return Object(l.createElement)(O,null,Object(l.createElement)(u.a,{id:"billing",type:"billing",onChange:e=>{m(e),g("set-billing-address")},values:r,fields:Object.keys(d),fieldConfig:F}),s&&Object(l.createElement)(p.a,{isRequired:o,value:r.phone,onChange:e=>{w(e),g("set-phone-number",{step:"billing"})}}))},w=i(1),g=i(279),j={...Object(g.a)({defaultTitle:Object(w.__)("Billing address","woo-gutenberg-products-block"),defaultDescription:Object(w.__)("Enter the address that matches your card or payment method.","woo-gutenberg-products-block")}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}},F=i(139);t.default=Object(o.withFilteredAttributes)(j)(e=>{let{title:t,description:i,showStepNumber:s,children:o,className:a}=e;const{isProcessing:b}=Object(r.b)(),{requireCompanyField:u,requirePhoneField:h,showApartmentField:p,showCompanyField:w,showPhoneField:g}=Object(F.b)(),{showBillingFields:j}=Object(c.a)();return j?Object(l.createElement)(d.a,{id:"billing-fields",disabled:b,className:n()("wc-block-checkout__billing-fields",a),title:t,description:i,showStepNumber:s},Object(l.createElement)(m,{requireCompanyField:u,showApartmentField:p,showCompanyField:w,showPhoneField:g,requirePhoneField:h}),o):null})}}]); \ No newline at end of file diff --git a/build/checkout-blocks/contact-information-frontend.js b/build/checkout-blocks/contact-information-frontend.js new file mode 100644 index 00000000000..11e1e5bf0d9 --- /dev/null +++ b/build/checkout-blocks/contact-information-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[31],{22:function(e,t,c){"use strict";var n=c(0),a=c(4),l=c.n(a);t.a=e=>{let t,{label:c,screenReaderLabel:a,wrapperElement:r,wrapperProps:s={}}=e;const o=null!=c,i=null!=a;return!o&&i?(t=r||"span",s={...s,className:l()(s.className,"screen-reader-text")},Object(n.createElement)(t,s,a)):(t=r||n.Fragment,o&&i&&c!==a?Object(n.createElement)(t,s,Object(n.createElement)("span",{"aria-hidden":"true"},c),Object(n.createElement)("span",{className:"screen-reader-text"},a)):Object(n.createElement)(t,s,c))}},264:function(e,t){},265:function(e,t){},268:function(e,t,c){"use strict";var n=c(12),a=c.n(n),l=c(0),r=c(4),s=c.n(r);c(269),t.a=e=>{let{children:t,className:c,headingLevel:n,...r}=e;const o=s()("wc-block-components-title",c),i="h"+n;return Object(l.createElement)(i,a()({className:o},r),t)}},269:function(e,t){},276:function(e,t){},277:function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var n=c(0),a=c(199);c(264);const l=e=>{let{errorMessage:t="",propertyName:c="",elementId:l=""}=e;const{getValidationError:r,getValidationErrorId:s}=Object(a.b)();if(!t||"string"!=typeof t){const e=r(c)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:s(l)},t))}},279:function(e,t,c){"use strict";var n=c(1);t.a=e=>{let{defaultTitle:t=Object(n.__)("Step","woo-gutenberg-products-block"),defaultDescription:c=Object(n.__)("Step description text.","woo-gutenberg-products-block"),defaultShowStepNumber:a=!0}=e;return{title:{type:"string",default:t},description:{type:"string",default:c},showStepNumber:{type:"boolean",default:a}}}},298:function(e,t,c){"use strict";var n=c(0),a=c(4),l=c.n(a),r=c(268);c(276);const s=e=>{let{title:t,stepHeadingContent:c}=e;return Object(n.createElement)("div",{className:"wc-block-components-checkout-step__heading"},Object(n.createElement)(r.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!c&&Object(n.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},c))};t.a=e=>{let{id:t,className:c,title:a,legend:r,description:o,children:i,disabled:d=!1,showStepNumber:u=!0,stepHeadingContent:b=(()=>{})}=e;const p=r||a?"fieldset":"div";return Object(n.createElement)(p,{className:l()(c,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":u,"wc-block-components-checkout-step--disabled":d}),id:t,disabled:d},!(!r&&!a)&&Object(n.createElement)("legend",{className:"screen-reader-text"},r||a),!!a&&Object(n.createElement)(s,{title:a,stepHeadingContent:b()}),Object(n.createElement)("div",{className:"wc-block-components-checkout-step__container"},!!o&&Object(n.createElement)("p",{className:"wc-block-components-checkout-step__description"},o),Object(n.createElement)("div",{className:"wc-block-components-checkout-step__content"},i)))}},302:function(e,t,c){"use strict";var n=c(12),a=c.n(n),l=c(0),r=c(1),s=c(5),o=c(4),i=c.n(o),d=c(199),u=c(277),b=c(9),p=c(45),m=c(22);c(265);var g=Object(s.forwardRef)((e,t)=>{let{className:c,id:n,type:r="text",ariaLabel:s,ariaDescribedBy:o,label:d,screenReaderLabel:u,disabled:b,help:p,autoCapitalize:g="off",autoComplete:h="off",value:j="",onChange:O,required:f=!1,onBlur:w=(()=>{}),feedback:k,...E}=e;const[v,_]=Object(l.useState)(!1);return Object(l.createElement)("div",{className:i()("wc-block-components-text-input",c,{"is-active":v||j})},Object(l.createElement)("input",a()({type:r,id:n,value:j,ref:t,autoCapitalize:g,autoComplete:h,onChange:e=>{O(e.target.value)},onFocus:()=>_(!0),onBlur:e=>{w(e.target.value),_(!1)},"aria-label":s||d,disabled:b,"aria-describedby":p&&!o?n+"__help":o,required:f},E)),Object(l.createElement)(m.a,{label:d,screenReaderLabel:u||d,wrapperElement:"label",wrapperProps:{htmlFor:n},htmlFor:n}),!!p&&Object(l.createElement)("p",{id:n+"__help",className:"wc-block-components-text-input__help"},p),k)});t.a=Object(b.withInstanceId)(e=>{let{className:t,instanceId:c,id:n,ariaDescribedBy:o,errorId:b,focusOnMount:m=!1,onChange:h,showError:j=!0,errorMessage:O="",value:f="",...w}=e;const[k,E]=Object(s.useState)(!0),v=Object(s.useRef)(null),{getValidationError:_,hideValidationError:N,setValidationErrors:C,clearValidationError:S,getValidationErrorId:A}=Object(d.b)(),y=void 0!==n?n:"textinput-"+c,B=void 0!==b?b:y,F=Object(s.useCallback)((function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=v.current||null;if(!t)return;t.value=t.value.trim();const c=t.checkValidity();c?S(B):C({[B]:{message:t.validationMessage||Object(r.__)("Invalid value.","woo-gutenberg-products-block"),hidden:e}})}),[S,B,C]);Object(s.useEffect)(()=>{var e;k&&m&&(null===(e=v.current)||void 0===e||e.focus()),E(!1)},[m,k,E]),Object(s.useEffect)(()=>{var e,t;(null===(e=v.current)||void 0===e||null===(t=e.ownerDocument)||void 0===t?void 0:t.activeElement)!==v.current&&F(!0)},[f,F]),Object(s.useEffect)(()=>()=>{S(B)},[S,B]);const I=_(B)||{};Object(p.a)(O)&&""!==O&&(I.message=O);const x=I.message&&!I.hidden,L=j&&x&&A(B)?A(B):o;return Object(l.createElement)(g,a()({className:i()(t,{"has-error":x}),"aria-invalid":!0===x,id:y,onBlur:()=>{F(!1)},feedback:j&&Object(l.createElement)(u.a,{errorMessage:O,propertyName:B}),ref:v,onChange:e=>{N(B),h(e)},ariaDescribedBy:L,value:f},w))})},339:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var n=c(2),a=c(0),l=c(36),r=c(67),s=c(66);const o=()=>{const{needsShipping:e}=Object(s.a)(),{useShippingAsBilling:t,setUseShippingAsBilling:c}=Object(l.b)(),{billingAddress:o,setBillingAddress:i,shippingAddress:d,setShippingAddress:u}=Object(r.a)(),b=Object(a.useCallback)(e=>{i({email:e})},[i]),p=Object(a.useCallback)(e=>{i({phone:e})},[i]),m=Object(a.useCallback)(e=>{u({phone:e})},[u]);return{shippingAddress:d,billingAddress:o,setShippingAddress:u,setBillingAddress:i,setEmail:b,setBillingPhone:p,setShippingPhone:m,defaultAddressFields:n.defaultAddressFields,useShippingAsBilling:t,setUseShippingAsBilling:c,showShippingFields:e,showBillingFields:!e||!t}}},435:function(e,t,c){"use strict";c.r(t);var n=c(0),a=c(4),l=c.n(a),r=c(119),s=c(298),o=c(36),i=c(1),d=c(302),u=c(339),b=c(59),p=c(2),m=c(10),g=e=>{let{allowCreateAccount:t}=e;const{customerId:c,shouldCreateAccount:a,setShouldCreateAccount:l}=Object(o.b)(),{billingAddress:r,setEmail:s}=Object(u.a)(),{dispatchCheckoutEvent:g}=Object(b.a)(),h=!c&&t&&Object(p.getSetting)("checkoutAllowsGuest",!1)&&Object(p.getSetting)("checkoutAllowsSignup",!1)&&Object(n.createElement)(m.CheckboxControl,{className:"wc-block-checkout__create-account",label:Object(i.__)("Create an account?","woo-gutenberg-products-block"),checked:a,onChange:e=>l(e)});return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(d.a,{id:"email",type:"email",label:Object(i.__)("Email address","woo-gutenberg-products-block"),value:r.email,autoComplete:"email",onChange:e=>{s(e),g("set-email-address")},required:!0}),h)},h=c(279),j={...Object(h.a)({defaultTitle:Object(i.__)("Contact information","woo-gutenberg-products-block"),defaultDescription:Object(i.__)("We'll use this email to send you details and updates about your order.","woo-gutenberg-products-block")}),className:{type:"string",default:""},lock:{type:"object",default:{remove:!0,move:!0}}};const O=`${c(48).e}?redirect_to=${encodeURIComponent(window.location.href)}`;var f=()=>{const{customerId:e}=Object(o.b)();return!Object(p.getSetting)("checkoutShowLoginReminder",!0)||e?null:Object(n.createElement)(n.Fragment,null,Object(i.__)("Already have an account? ","woo-gutenberg-products-block"),Object(n.createElement)("a",{href:O},Object(i.__)("Log in.","woo-gutenberg-products-block")))},w=c(139);t.default=Object(r.withFilteredAttributes)(j)(e=>{let{title:t,description:c,showStepNumber:a,children:r,className:i}=e;const{isProcessing:d}=Object(o.b)(),{allowCreateAccount:u}=Object(w.b)();return Object(n.createElement)(s.a,{id:"contact-fields",disabled:d,className:l()("wc-block-checkout__contact-fields",i),title:t,description:c,showStepNumber:a,stepHeadingContent:()=>Object(n.createElement)(f,null)},Object(n.createElement)(g,{allowCreateAccount:u}),r)})}}]); \ No newline at end of file diff --git a/build/checkout-blocks/express-payment-frontend.js b/build/checkout-blocks/express-payment-frontend.js new file mode 100644 index 00000000000..444843ff089 --- /dev/null +++ b/build/checkout-blocks/express-payment-frontend.js @@ -0,0 +1,5 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[32],{135:function(e,t,n){"use strict";var c=n(0);n(196),t.a=()=>Object(c.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},136:function(e,t,n){"use strict";var c=n(0),o=n(1),s=n(4),a=n.n(s),r=(n(198),n(135));t.a=e=>{let{children:t,className:n,screenReaderLabel:s,showSpinner:i=!1,isLoading:l=!0}=e;return Object(c.createElement)("div",{className:a()(n,{"wc-block-components-loading-mask":l})},l&&i&&Object(c.createElement)(r.a,null),Object(c.createElement)("div",{className:a()({"wc-block-components-loading-mask__children":l}),"aria-hidden":l},t),l&&Object(c.createElement)("span",{className:"screen-reader-text"},s||Object(o.__)("Loading…","woo-gutenberg-products-block")))}},196:function(e,t){},198:function(e,t){},264:function(e,t){},268:function(e,t,n){"use strict";var c=n(12),o=n.n(c),s=n(0),a=n(4),r=n.n(a);n(269),t.a=e=>{let{children:t,className:n,headingLevel:c,...a}=e;const i=r()("wc-block-components-title",n),l="h"+c;return Object(s.createElement)(l,o()({className:i},a),t)}},269:function(e,t){},274:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var c=n(1),o=n(7),s=n(6),a=n(17),r=n(32),i=n(199);const l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{cartCoupons:t,cartIsLoading:n}=Object(r.a)(),{createErrorNotice:l}=Object(o.useDispatch)("core/notices"),{createNotice:p}=Object(o.useDispatch)("core/notices"),{setValidationErrors:u}=Object(i.b)(),{applyCoupon:m,removeCoupon:d,isApplyingCoupon:b,isRemovingCoupon:h}=Object(o.useSelect)((e,t)=>{let{dispatch:n}=t;const c=e(s.CART_STORE_KEY),o=n(s.CART_STORE_KEY);return{applyCoupon:o.applyCoupon,removeCoupon:o.removeCoupon,isApplyingCoupon:c.isApplyingCoupon(),isRemovingCoupon:c.isRemovingCoupon(),receiveApplyingCoupon:o.receiveApplyingCoupon}},[l,p]),g=t=>{m(t).then(n=>{!0===n&&p("info",Object(c.sprintf)( +/* translators: %s coupon code. */ +Object(c.__)('Coupon code "%s" has been applied to your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(e=>{u({coupon:{message:Object(a.decodeEntities)(e.message),hidden:!1}}),receiveApplyingCoupon("")})},v=t=>{d(t).then(n=>{!0===n&&p("info",Object(c.sprintf)( +/* translators: %s coupon code. */ +Object(c.__)('Coupon code "%s" has been removed from your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(t=>{l(t.message,{id:"coupon-form",context:e}),receiveApplyingCoupon("")})};return{appliedCoupons:t,isLoading:n,applyCoupon:g,removeCoupon:v,isApplyingCoupon:b,isRemovingCoupon:h}}},275:function(e,t){},277:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var c=n(0),o=n(199);n(264);const s=e=>{let{errorMessage:t="",propertyName:n="",elementId:s=""}=e;const{getValidationError:a,getValidationErrorId:r}=Object(o.b)();if(!t||"string"!=typeof t){const e=a(n)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(c.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(c.createElement)("p",{id:r(s)},t))}},278:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}));var c=n(31),o=n(207);const s=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{paymentMethods:t,expressPaymentMethods:n,paymentMethodsInitialized:s,expressPaymentMethodsInitialized:a}=Object(o.b)(),r=Object(c.a)(t),i=Object(c.a)(n);return{paymentMethods:e?i:r,isInitialized:e?a:s}},a=()=>s(!1),r=()=>s(!0)},280:function(e,t,n){"use strict";var c=n(12),o=n.n(c),s=n(0),a=n(4),r=n.n(a);const i=e=>"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--"+e;var l=e=>{let{id:t,src:n=null,alt:c=""}=e;return n?Object(s.createElement)("img",{className:i(t),src:n,alt:c}):null},p=n(48);const u=[{id:"alipay",alt:"Alipay",src:p.l+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:p.l+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:p.l+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:p.l+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:p.l+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:p.l+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:p.l+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:p.l+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:p.l+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:p.l+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:p.l+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:p.l+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:p.l+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:p.l+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:p.l+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:p.l+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:p.l+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:p.l+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:p.l+"payment-methods/wechat.svg"}];var m=n(45);n(275),t.a=e=>{let{icons:t=[],align:n="center",className:c}=e;const a=(e=>{const t={};return e.forEach(e=>{let n={};"string"==typeof e&&(n={id:e,alt:e,src:null}),"object"==typeof e&&(n={id:e.id||"",alt:e.alt||"",src:e.src||null}),n.id&&Object(m.a)(n.id)&&!t[n.id]&&(t[n.id]=n)}),Object.values(t)})(t);if(0===a.length)return null;const i=r()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===n,"wc-block-components-payment-method-icons--align-right":"right"===n},c);return Object(s.createElement)("div",{className:i},a.map(e=>{const t={...e,...(n=e.id,u.find(e=>e.id===n)||{})};var n;return Object(s.createElement)(l,o()({key:"payment-method-icon-"+e.id},t))}))}},290:function(e,t){},291:function(e,t,n){"use strict";var c=n(19),o=n.n(c),s=n(0),a=n(1),r=n(5),i=n(2),l=n(123),p=n(30);class u extends r.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return{errorMessage:e.message,hasError:!0}}render(){const{hasError:e,errorMessage:t}=this.state,{isEditor:n}=this.props;if(e){let e=Object(a.__)("This site is experiencing difficulties with this payment method. Please contact the owner of the site for assistance.","woo-gutenberg-products-block");(n||i.CURRENT_USER_IS_ADMIN)&&(e=t||Object(a.__)("There was an error with this payment method. Please verify it's configured correctly.","woo-gutenberg-products-block"));const c=[{id:"0",content:e,isDismissible:!1,status:"error"}];return Object(s.createElement)(l.a,{additionalNotices:c,context:p.c.PAYMENTS})}return this.props.children}}u.defaultProps={isEditor:!1},t.a=u},313:function(e,t){},314:function(e,t,n){"use strict";var c=n(0),o=n(1),s=n(342),a=n(278),r=n(29),i=n(207),l=n(25),p=n.n(l),u=n(291);t.a=()=>{const{isEditor:e}=Object(r.a)(),{setActivePaymentMethod:t,setExpressPaymentError:n,activePaymentMethod:l,paymentMethodData:m,setPaymentStatus:d}=Object(i.b)(),b=Object(s.a)(),{paymentMethods:h}=Object(a.a)(),g=Object(c.useRef)(l),v=Object(c.useRef)(m),y=Object(c.useCallback)(e=>()=>{g.current=l,v.current=m,d().started(),t(e)},[l,m,t,d]),j=Object(c.useCallback)(()=>{d().pristine(),t(g.current,v.current)},[t,d]),O=Object(c.useCallback)(e=>{d().error(e),n(e),t(g.current,v.current)},[t,d,n]),E=Object(c.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";p()("Express Payment Methods should use the provided onError handler instead.",{alternative:"onError",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),e?O(e):n("")}),[n,O]),f=Object.entries(h),k=f.length>0?f.map(t=>{let[n,o]=t;const s=e?o.edit:o.content;return Object(c.isValidElement)(s)?Object(c.createElement)("li",{key:n,id:"express-payment-method-"+n},Object(c.cloneElement)(s,{...b,onClick:y(n),onClose:j,onError:O,setExpressPaymentError:E})):null}):Object(c.createElement)("li",{key:"noneRegistered"},Object(o.__)("No registered Payment Methods","woo-gutenberg-products-block"));return Object(c.createElement)(u.a,{isEditor:e},Object(c.createElement)("ul",{className:"wc-block-components-express-payment__event-buttons"},k))}},337:function(e,t,n){"use strict";var c=n(0),o=n(13);const s=Object(c.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(o.Path,{fillRule:"evenodd",d:"M5.5 9.5v-2h13v2h-13zm0 3v4h13v-4h-13zM4 7a1 1 0 011-1h14a1 1 0 011 1v10a1 1 0 01-1 1H5a1 1 0 01-1-1V7z",clipRule:"evenodd"}));t.a=s},342:function(e,t,n){"use strict";n.d(t,"a",(function(){return A}));var c=n(1),o=n(41),s=n(0),a=n(4),r=n.n(a),i=n(13),l=Object(s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(s.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(s.createElement)("path",{d:"M0 0h24v24H0z"}),Object(s.createElement)("path",{fill:"#000",fillRule:"nonzero",d:"M17.3 8v1c1 .2 1.4.9 1.4 1.7h-1c0-.6-.3-1-1-1-.8 0-1.3.4-1.3.9 0 .4.3.6 1.4 1 1 .2 2 .6 2 1.9 0 .9-.6 1.4-1.5 1.5v1H16v-1c-.9-.1-1.6-.7-1.7-1.7h1c0 .6.4 1 1.3 1 1 0 1.2-.5 1.2-.8 0-.4-.2-.8-1.3-1.1-1.3-.3-2.1-.8-2.1-1.8 0-.9.7-1.5 1.6-1.6V8h1.3zM12 10v1H6v-1h6zm2-2v1H6V8h8zM2 4v16h20V4H2zm2 14V6h16v12H4z"}),Object(s.createElement)("path",{stroke:"#000",strokeLinecap:"round",d:"M6 16c2.6 0 3.9-3 1.7-3-2 0-1 3 1.5 3 1 0 1-.8 2.8-.8"}))),p=Object(s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(s.createElement)(i.Path,{fillRule:"evenodd",d:"M18.646 9H20V8l-1-.5L12 4 5 7.5 4 8v1h14.646zm-3-1.5L12 5.677 8.354 7.5h7.292zm-7.897 9.44v-6.5h-1.5v6.5h1.5zm5-6.5v6.5h-1.5v-6.5h1.5zm5 0v6.5h-1.5v-6.5h1.5zm2.252 8.81c0 .414-.334.75-.748.75H4.752a.75.75 0 010-1.5h14.5a.75.75 0 01.749.75z",clipRule:"evenodd"})),u=Object(s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(s.createElement)(i.Path,{d:"M3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zm-1.338 4.877c-.314.22-.412.452-.412.623 0 .171.098.403.412.623.312.218.783.377 1.338.377.825 0 1.605.233 2.198.648.59.414 1.052 1.057 1.052 1.852 0 .795-.461 1.438-1.052 1.852-.41.286-.907.486-1.448.582v.316a.75.75 0 01-1.5 0v-.316a3.64 3.64 0 01-1.448-.582c-.59-.414-1.052-1.057-1.052-1.852a.75.75 0 011.5 0c0 .171.098.403.412.623.312.218.783.377 1.338.377s1.026-.159 1.338-.377c.314-.22.412-.452.412-.623 0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377-.825 0-1.605-.233-2.198-.648-.59-.414-1.052-1.057-1.052-1.852 0-.795.461-1.438 1.052-1.852a3.64 3.64 0 011.448-.582V7.5a.75.75 0 011.5 0v.316c.54.096 1.039.296 1.448.582.59.414 1.052 1.057 1.052 1.852a.75.75 0 01-1.5 0c0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377s-1.026.159-1.338.377z"})),m=n(337),d=n(117),b=n(45),h=n(18);n(290);const g={bank:p,bill:u,card:m.a,checkPayment:l};var v=e=>{let{icon:t="",text:n=""}=e;const c=!!t,o=Object(s.useCallback)(e=>c&&Object(b.a)(e)&&Object(h.b)(g,e),[c]),a=r()("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":c});return Object(s.createElement)("span",{className:a},o(t)?Object(s.createElement)(d.a,{icon:g[t]}):t,n)},y=n(280),j=n(2),O=n(25),E=n.n(O),f=n(136),k=n(277),w=n(32),S=n(274),_=n(30),C=n(36),x=n(207),P=n(68),R=n(50);const M=(e,t)=>{const n=[],o=(t,n)=>{const c=n+"_tax",o=Object(h.b)(e,n)&&Object(b.a)(e[n])?parseInt(e[n],10):0;return{key:n,label:t,value:o,valueWithTax:o+(Object(h.b)(e,c)&&Object(b.a)(e[c])?parseInt(e[c],10):0)}};return n.push(o(Object(c.__)("Subtotal:","woo-gutenberg-products-block"),"total_items")),n.push(o(Object(c.__)("Fees:","woo-gutenberg-products-block"),"total_fees")),n.push(o(Object(c.__)("Discount:","woo-gutenberg-products-block"),"total_discount")),n.push({key:"total_tax",label:Object(c.__)("Taxes:","woo-gutenberg-products-block"),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&n.push(o(Object(c.__)("Shipping:","woo-gutenberg-products-block"),"total_shipping")),n};var N=n(66);const A=()=>{const{isCalculating:e,isComplete:t,isIdle:n,isProcessing:a,onCheckoutBeforeProcessing:r,onCheckoutValidationBeforeProcessing:i,onCheckoutAfterProcessingWithSuccess:l,onCheckoutAfterProcessingWithError:p,onSubmit:u,customerId:m}=Object(C.b)(),{currentStatus:d,activePaymentMethod:b,onPaymentProcessing:h,setExpressPaymentError:g,shouldSavePayment:O}=Object(x.b)(),{shippingErrorStatus:A,shippingErrorTypes:I,onShippingRateSuccess:T,onShippingRateFail:z,onShippingRateSelectSuccess:V,onShippingRateSelectFail:L}=Object(P.b)(),{shippingRates:D,isLoadingRates:B,selectedRates:F,isSelectingRate:H,selectShippingRate:W,needsShipping:U}=Object(N.a)(),{billingAddress:G,shippingAddress:Y,setShippingAddress:J}=Object(R.b)(),{cartItems:K,cartFees:X,cartTotals:q,extensions:Q}=Object(w.a)(),{appliedCoupons:Z}=Object(S.a)(),{noticeContexts:$,responseTypes:ee}=Object(_.d)(),te=Object(s.useRef)(M(q,U)),ne=Object(s.useRef)({label:Object(c.__)("Total","woo-gutenberg-products-block"),value:parseInt(q.total_price,10)});Object(s.useEffect)(()=>{te.current=M(q,U),ne.current={label:Object(c.__)("Total","woo-gutenberg-products-block"),value:parseInt(q.total_price,10)}},[q,U]);const ce=Object(s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";E()("setExpressPaymentError should only be used by Express Payment Methods (using the provided onError handler).",{alternative:"",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),g(e)}),[g]);return{activePaymentMethod:b,billing:{appliedCoupons:Z,billingAddress:G,billingData:G,cartTotal:ne.current,cartTotalItems:te.current,currency:Object(o.getCurrencyFromPriceResponse)(q),customerId:m,displayPricesIncludingTax:Object(j.getSetting)("displayCartPricesIncludingTax",!1)},cartData:{cartItems:K,cartFees:X,extensions:Q},checkoutStatus:{isCalculating:e,isComplete:t,isIdle:n,isProcessing:a},components:{LoadingMask:f.a,PaymentMethodIcons:y.a,PaymentMethodLabel:v,ValidationInputError:k.a},emitResponse:{noticeContexts:$,responseTypes:ee},eventRegistration:{onCheckoutAfterProcessingWithError:p,onCheckoutAfterProcessingWithSuccess:l,onCheckoutBeforeProcessing:r,onCheckoutValidationBeforeProcessing:i,onPaymentProcessing:h,onShippingRateFail:z,onShippingRateSelectFail:L,onShippingRateSelectSuccess:V,onShippingRateSuccess:T},onSubmit:u,paymentStatus:d,setExpressPaymentError:ce,shippingData:{isSelectingRate:H,needsShipping:U,selectedRates:F,setSelectedRates:W,setShippingAddress:J,shippingAddress:Y,shippingRates:D,shippingRatesLoading:B},shippingStatus:{shippingErrorStatus:A,shippingErrorTypes:I},shouldSavePayment:O}}},457:function(e,t,n){"use strict";n.r(t);var c=n(0),o=n(32),s=n(1),a=n(278),r=n(30),i=n(36),l=n(207),p=n(29),u=n(123),m=n(268),d=n(136),b=n(2),h=n(314);n(313);var g=()=>{const{isCalculating:e,isProcessing:t,isAfterProcessing:n,isBeforeProcessing:o,isComplete:g,hasError:v}=Object(i.b)(),{currentStatus:y}=Object(l.b)(),{paymentMethods:j,isInitialized:O}=Object(a.a)(),{isEditor:E}=Object(p.a)(),{noticeContexts:f}=Object(r.d)();if(!O||O&&0===Object.keys(j).length)return E||b.CURRENT_USER_IS_ADMIN?Object(c.createElement)(u.a,{context:f.EXPRESS_PAYMENTS}):null;const k=t||n||o||g&&!v;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(d.a,{isLoading:e||k||y.isDoingExpressPayment},Object(c.createElement)("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--checkout"},Object(c.createElement)("div",{className:"wc-block-components-express-payment__title-container"},Object(c.createElement)(m.a,{className:"wc-block-components-express-payment__title",headingLevel:"2"},Object(s.__)("Express checkout","woo-gutenberg-products-block"))),Object(c.createElement)("div",{className:"wc-block-components-express-payment__content"},Object(c.createElement)(u.a,{context:f.EXPRESS_PAYMENTS}),Object(c.createElement)("p",null,Object(s.__)("In a hurry? Use one of our express checkout options:","woo-gutenberg-products-block")),Object(c.createElement)(h.a,null)))),Object(c.createElement)("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--checkout"},Object(s.__)("Or continue below","woo-gutenberg-products-block")))};t.default=e=>{let{className:t}=e;const{cartNeedsPayment:n}=Object(o.a)();return n?Object(c.createElement)("div",{className:t},Object(c.createElement)(g,null)):null}}}]); \ No newline at end of file diff --git a/build/checkout-blocks/fields-frontend.js b/build/checkout-blocks/fields-frontend.js new file mode 100644 index 00000000000..2d9010f0330 --- /dev/null +++ b/build/checkout-blocks/fields-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[33],{371:function(c,e,t){"use strict";var n=t(0),o=t(5),a=t(4),s=t.n(a);const r=Object(o.forwardRef)((c,e)=>{let{children:t,className:o=""}=c;return Object(n.createElement)("div",{ref:e,className:s()("wc-block-components-main",o)},t)});e.a=r},384:function(c,e){},420:function(c,e,t){"use strict";t.r(e);var n=t(0),o=t(4),a=t.n(o),s=t(371);t(384),e.default=c=>{let{children:e,className:t}=c;return Object(n.createElement)(s.a,{className:a()("wc-block-checkout__main",t)},Object(n.createElement)("form",{className:"wc-block-components-form wc-block-checkout__form"},e))}}}]); \ No newline at end of file diff --git a/build/checkout-blocks/order-note-frontend.js b/build/checkout-blocks/order-note-frontend.js new file mode 100644 index 00000000000..cb43c5bad98 --- /dev/null +++ b/build/checkout-blocks/order-note-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[34],{268:function(e,t,c){"use strict";var n=c(12),o=c.n(n),a=c(0),s=c(4),l=c.n(s);c(269),t.a=e=>{let{children:t,className:c,headingLevel:n,...s}=e;const r=l()("wc-block-components-title",c),d="h"+n;return Object(a.createElement)(d,o()({className:r},s),t)}},269:function(e,t){},276:function(e,t){},298:function(e,t,c){"use strict";var n=c(0),o=c(4),a=c.n(o),s=c(268);c(276);const l=e=>{let{title:t,stepHeadingContent:c}=e;return Object(n.createElement)("div",{className:"wc-block-components-checkout-step__heading"},Object(n.createElement)(s.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!c&&Object(n.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},c))};t.a=e=>{let{id:t,className:c,title:o,legend:s,description:r,children:d,disabled:b=!1,showStepNumber:i=!0,stepHeadingContent:u=(()=>{})}=e;const p=s||o?"fieldset":"div";return Object(n.createElement)(p,{className:a()(c,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":i,"wc-block-components-checkout-step--disabled":b}),id:t,disabled:b},!(!s&&!o)&&Object(n.createElement)("legend",{className:"screen-reader-text"},s||o),!!o&&Object(n.createElement)(l,{title:o,stepHeadingContent:u()}),Object(n.createElement)("div",{className:"wc-block-components-checkout-step__container"},!!r&&Object(n.createElement)("p",{className:"wc-block-components-checkout-step__description"},r),Object(n.createElement)("div",{className:"wc-block-components-checkout-step__content"},d)))}},388:function(e,t){},389:function(e,t){},444:function(e,t,c){"use strict";c.r(t);var n=c(0),o=c(4),a=c.n(o),s=c(1),l=c(298),r=c(36),d=c(66),b=c(10);c(389);const i=e=>{let{className:t="",disabled:c=!1,onTextChange:o,placeholder:s,value:l=""}=e;return Object(n.createElement)("textarea",{className:a()("wc-block-components-textarea",t),disabled:c,onChange:e=>{o(e.target.value)},placeholder:s,rows:2,value:l})};c(388);var u=e=>{let{disabled:t,onChange:c,placeholder:o,value:a}=e;const[l,r]=Object(n.useState)(!1),[d,u]=Object(n.useState)("");return Object(n.createElement)("div",{className:"wc-block-checkout__add-note"},Object(n.createElement)(b.CheckboxControl,{disabled:t,label:Object(s.__)("Add a note to your order","woo-gutenberg-products-block"),checked:l,onChange:e=>{r(e),e?a!==d&&c(d):(c(""),u(a))}}),l&&Object(n.createElement)(i,{disabled:t,onTextChange:c,placeholder:o,value:a}))};t.default=e=>{let{className:t}=e;const{needsShipping:c}=Object(d.a)(),{isProcessing:o,orderNotes:b,dispatchActions:i}=Object(r.b)(),{setOrderNotes:p}=i;return Object(n.createElement)(l.a,{id:"order-notes",showStepNumber:!1,className:a()("wc-block-checkout__order-notes",t),disabled:o},Object(n.createElement)(u,{disabled:o,onChange:p,placeholder:c?Object(s.__)("Notes about your order, e.g. special notes for delivery.","woo-gutenberg-products-block"):Object(s.__)("Notes about your order.","woo-gutenberg-products-block"),value:b}))}}}]); \ No newline at end of file diff --git a/build/checkout-blocks/order-summary-cart-items-frontend.js b/build/checkout-blocks/order-summary-cart-items-frontend.js new file mode 100644 index 00000000000..82bcc3dc365 --- /dev/null +++ b/build/checkout-blocks/order-summary-cart-items-frontend.js @@ -0,0 +1,9 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[36],{102:function(e,t,c){"use strict";var r=c(12),a=c.n(r),n=c(0),l=c(137),s=c(4),o=c.n(s);c(197);const i=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:c,currency:r,onValueChange:s,displayType:m="text",...u}=e;const p="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(p))return null;const b=p/10**r.minorUnit;if(!Number.isFinite(b))return null;const d=o()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),O={...u,...i(r),value:void 0,currency:void 0,onValueChange:void 0},j=s?e=>{const t=+e.value*10**r.minorUnit;s(t)}:()=>{};return Object(n.createElement)(l.a,a()({className:d,displayType:m},O,{value:b,onValueChange:j}))}},197:function(e,t){},22:function(e,t,c){"use strict";var r=c(0),a=c(4),n=c.n(a);t.a=e=>{let t,{label:c,screenReaderLabel:a,wrapperElement:l,wrapperProps:s={}}=e;const o=null!=c,i=null!=a;return!o&&i?(t=l||"span",s={...s,className:n()(s.className,"screen-reader-text")},Object(r.createElement)(t,s,a)):(t=l||r.Fragment,o&&i&&c!==a?Object(r.createElement)(t,s,Object(r.createElement)("span",{"aria-hidden":"true"},c),Object(r.createElement)("span",{className:"screen-reader-text"},a)):Object(r.createElement)(t,s,c))}},284:function(e,t,c){"use strict";var r=c(0),a=c(4),n=c.n(a);c(310),t.a=e=>{let{children:t,className:c}=e;return Object(r.createElement)("div",{className:n()("wc-block-components-product-badge",c)},t)}},286:function(e,t,c){"use strict";var r=c(0),a=c(1),n=c(102),l=c(4),s=c.n(l),o=c(41);c(287);const i=e=>{let{currency:t,maxPrice:c,minPrice:l,priceClassName:i,priceStyle:m={}}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(a.sprintf)( +/* translators: %1$s min price, %2$s max price */ +Object(a.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(o.formatPrice)(l),Object(o.formatPrice)(c))),Object(r.createElement)("span",{"aria-hidden":!0},Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",i),currency:t,value:l,style:m})," — ",Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",i),currency:t,value:c,style:m})))},m=e=>{let{currency:t,regularPriceClassName:c,regularPriceStyle:l,regularPrice:o,priceClassName:i,priceStyle:m,price:u}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:","woo-gutenberg-products-block")),Object(r.createElement)(n.a,{currency:t,renderText:e=>Object(r.createElement)("del",{className:s()("wc-block-components-product-price__regular",c),style:l},e),value:o}),Object(r.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:","woo-gutenberg-products-block")),Object(r.createElement)(n.a,{currency:t,renderText:e=>Object(r.createElement)("ins",{className:s()("wc-block-components-product-price__value","is-discounted",i),style:m},e),value:u}))};t.a=e=>{let{align:t,className:c,currency:a,format:l="",maxPrice:o,minPrice:u,price:p,priceClassName:b,priceStyle:d,regularPrice:O,regularPriceClassName:j,regularPriceStyle:g}=e;const _=s()(c,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+t]:t});l.includes("")||(l="",console.error("Price formats need to include the `` tag."));const y=O&&p!==O;let f=Object(r.createElement)("span",{className:s()("wc-block-components-product-price__value",b)});return y?f=Object(r.createElement)(m,{currency:a,price:p,priceClassName:b,priceStyle:d,regularPrice:O,regularPriceClassName:j,regularPriceStyle:g}):void 0!==u&&void 0!==o?f=Object(r.createElement)(i,{currency:a,maxPrice:o,minPrice:u,priceClassName:b,priceStyle:d}):p&&(f=Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",b),currency:a,value:p,style:d})),Object(r.createElement)("span",{className:_},Object(r.createInterpolateElement)(l,{price:f}))}},287:function(e,t){},288:function(e,t,c){"use strict";var r=c(12),a=c.n(r),n=c(0),l=c(17),s=c(4),o=c.n(s);c(289),t.a=e=>{let{className:t="",disabled:c=!1,name:r,permalink:s="",target:i,rel:m,style:u,onClick:p,...b}=e;const d=o()("wc-block-components-product-name",t);if(c){const e=b;return Object(n.createElement)("span",a()({className:d},e,{dangerouslySetInnerHTML:{__html:Object(l.decodeEntities)(r)}}))}return Object(n.createElement)("a",a()({className:d,href:s,target:i},b,{dangerouslySetInnerHTML:{__html:Object(l.decodeEntities)(r)},style:u}))}},289:function(e,t){},295:function(e,t,c){"use strict";var r=c(0),a=c(115),n=c(116);const l=e=>{const t=e.indexOf("

");return-1===t?e:e.substr(0,t+4)},s=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),o=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,i=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…";const r=s(e),a=r.split(" ").splice(0,t).join(" ");return Object(n.autop)(o(a,c))},m=function(e,t){let c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…";const a=s(e),l=a.slice(0,t);if(c)return Object(n.autop)(o(l,r));const i=l.match(/([\s]+)/g),m=i?i.length:0,u=a.slice(0,t+m);return Object(n.autop)(o(u,r))};t.a=e=>{let{source:t,maxLength:c=15,countType:s="words",className:o="",style:u={}}=e;const p=Object(r.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const r=Object(n.autop)(e),s=Object(a.count)(r,c);if(s<=t)return r;const o=l(r),u=Object(a.count)(o,c);return u<=t?o:"words"===c?i(o,t):m(o,t,"characters_including_spaces"===c)}(t,c,s),[t,c,s]);return Object(r.createElement)(r.RawHTML,{style:u,className:o},p)}},309:function(e,t){},310:function(e,t){},311:function(e,t){},312:function(e,t){},334:function(e,t,c){"use strict";var r=c(12),a=c.n(r),n=c(0),l=c(17),s=c(2);c(309),t.a=e=>{let{image:t={},fallbackAlt:c=""}=e;const r=t.thumbnail?{src:t.thumbnail,alt:Object(l.decodeEntities)(t.alt)||c||"Product Image"}:{src:s.PLACEHOLDER_IMG_SRC,alt:""};return Object(n.createElement)("img",a()({className:"wc-block-components-product-image"},r,{alt:r.alt}))}},335:function(e,t,c){"use strict";var r=c(0),a=c(1),n=c(284);t.a=()=>Object(r.createElement)(n.a,{className:"wc-block-components-product-backorder-badge"},Object(a.__)("Available on backorder","woo-gutenberg-products-block"))},336:function(e,t,c){"use strict";var r=c(0),a=c(1),n=c(284);t.a=e=>{let{lowStockRemaining:t}=e;return t?Object(r.createElement)(n.a,{className:"wc-block-components-product-low-stock-badge"},Object(a.sprintf)( +/* translators: %d stock amount (number of items in stock for product) */ +Object(a.__)("%d left in stock","woo-gutenberg-products-block"),t)):null}},346:function(e,t,c){"use strict";var r=c(0),a=c(3),n=c(17);c(312);var l=e=>{let{details:t=[]}=e;return Array.isArray(t)?(t=t.filter(e=>!e.hidden),0===t.length?null:Object(r.createElement)("ul",{className:"wc-block-components-product-details"},t.map(e=>{const t=(null==e?void 0:e.key)||e.name||"",c=t?"wc-block-components-product-details__"+Object(a.kebabCase)(t):"";return Object(r.createElement)("li",{key:t+(e.display||e.value),className:c},t&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"wc-block-components-product-details__name"},Object(n.decodeEntities)(t),":")," "),Object(r.createElement)("span",{className:"wc-block-components-product-details__value"},Object(n.decodeEntities)(e.display||e.value)))}))):null},s=c(295),o=c(48),i=e=>{let{className:t,shortDescription:c="",fullDescription:a=""}=e;const n=c||a;return n?Object(r.createElement)(s.a,{className:t,source:n,maxLength:15,countType:o.n.wordCountType||"words"}):null};c(311),t.a=e=>{let{shortDescription:t="",fullDescription:c="",itemData:a=[],variation:n=[]}=e;return Object(r.createElement)("div",{className:"wc-block-components-product-metadata"},Object(r.createElement)(i,{className:"wc-block-components-product-metadata__description",shortDescription:t,fullDescription:c}),Object(r.createElement)(l,{details:a}),Object(r.createElement)(l,{details:n.map(e=>{let{attribute:t="",value:c}=e;return{key:t,value:c}})}))}},395:function(e,t){},436:function(e,t,c){"use strict";c.r(t);var r=c(0),a=c(1),n=c(250),l=c(10),s=c(4),o=c.n(s),i=c(22),m=c(286),u=c(288),p=c(41),b=c(333),d=c(2),O=c(32),j=c(45),g=c(335),_=c(334),y=c(336),f=c(346);const E=e=>Object(l.mustContain)(e,"");var k=e=>{let{cartItem:t}=e;const{images:c,low_stock_remaining:n,show_backorder_badge:s,name:k,permalink:w,prices:v,quantity:N,short_description:h,description:P,item_data:x,variation:C,totals:S,extensions:I}=t,{receiveCart:T,...A}=Object(O.a)(),D=Object(r.useMemo)(()=>({context:"summary",cartItem:t,cart:A}),[t,A]),F=Object(p.getCurrencyFromPriceResponse)(v),L=Object(l.__experimentalApplyCheckoutFilter)({filterName:"itemName",defaultValue:k,extensions:I,arg:D}),R=Object(b.a)({amount:parseInt(v.raw_prices.regular_price,10),precision:Object(j.a)(v.raw_prices.precision)?parseInt(v.raw_prices.precision,10):v.raw_prices.precision}).convertPrecision(F.minorUnit).getAmount(),$=Object(b.a)({amount:parseInt(v.raw_prices.price,10),precision:Object(j.a)(v.raw_prices.precision)?parseInt(v.raw_prices.precision,10):v.raw_prices.precision}).convertPrecision(F.minorUnit).getAmount(),V=Object(p.getCurrencyFromPriceResponse)(S);let M=parseInt(S.line_subtotal,10);Object(d.getSetting)("displayCartPricesIncludingTax",!1)&&(M+=parseInt(S.line_subtotal_tax,10));const U=Object(b.a)({amount:M,precision:V.minorUnit}).getAmount(),H=Object(l.__experimentalApplyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"",extensions:I,arg:D,validation:E}),W=Object(l.__experimentalApplyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"",extensions:I,arg:D,validation:E}),B=Object(l.__experimentalApplyCheckoutFilter)({filterName:"cartItemClass",defaultValue:"",extensions:I,arg:D});return Object(r.createElement)("div",{className:o()("wc-block-components-order-summary-item",B)},Object(r.createElement)("div",{className:"wc-block-components-order-summary-item__image"},Object(r.createElement)("div",{className:"wc-block-components-order-summary-item__quantity"},Object(r.createElement)(i.a,{label:N.toString(),screenReaderLabel:Object(a.sprintf)( +/* translators: %d number of products of the same type in the cart */ +Object(a._n)("%d item","%d items",N,"woo-gutenberg-products-block"),N)})),Object(r.createElement)(_.a,{image:c.length?c[0]:{},fallbackAlt:L})),Object(r.createElement)("div",{className:"wc-block-components-order-summary-item__description"},Object(r.createElement)(u.a,{disabled:!0,name:L,permalink:w}),Object(r.createElement)(m.a,{currency:F,price:$,regularPrice:R,className:"wc-block-components-order-summary-item__individual-prices",priceClassName:"wc-block-components-order-summary-item__individual-price",regularPriceClassName:"wc-block-components-order-summary-item__regular-individual-price",format:H}),s?Object(r.createElement)(g.a,null):!!n&&Object(r.createElement)(y.a,{lowStockRemaining:n}),Object(r.createElement)(f.a,{shortDescription:h,fullDescription:P,itemData:x,variation:C})),Object(r.createElement)("span",{className:"screen-reader-text"},Object(a.sprintf)( +/* translators: %1$d is the number of items, %2$s is the item name and %3$s is the total price including the currency symbol. */ +Object(a._n)("Total price for %1$d %2$s item: %3$s","Total price for %1$d %2$s items: %3$s",N,"woo-gutenberg-products-block"),N,L,Object(p.formatPrice)(U,V))),Object(r.createElement)("div",{className:"wc-block-components-order-summary-item__total-price","aria-hidden":"true"},Object(r.createElement)(m.a,{currency:V,format:W,price:U})))};c(395);var w=e=>{let{cartItems:t=[]}=e;const{isLarge:c,hasContainerWidth:s}=Object(n.b)();return s?Object(r.createElement)(l.Panel,{className:"wc-block-components-order-summary",initialOpen:c,hasBorder:!1,title:Object(r.createElement)("span",{className:"wc-block-components-order-summary__button-text"},Object(a.__)("Order summary","woo-gutenberg-products-block")),titleTag:"h2"},Object(r.createElement)("div",{className:"wc-block-components-order-summary__content"},t.map(e=>Object(r.createElement)(k,{key:e.key,cartItem:e})))):null};t.default=e=>{let{className:t}=e;const{cartItems:c}=Object(O.a)();return Object(r.createElement)(l.TotalsWrapper,{className:t},Object(r.createElement)(w,{cartItems:c}))}}}]); \ No newline at end of file diff --git a/build/checkout-blocks/order-summary-coupon-form-frontend.js b/build/checkout-blocks/order-summary-coupon-form-frontend.js new file mode 100644 index 00000000000..97d5fe67dbe --- /dev/null +++ b/build/checkout-blocks/order-summary-coupon-form-frontend.js @@ -0,0 +1,5 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[37],{135:function(e,t,n){"use strict";var o=n(0);n(196),t.a=()=>Object(o.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},136:function(e,t,n){"use strict";var o=n(0),c=n(1),a=n(4),r=n.n(a),s=(n(198),n(135));t.a=e=>{let{children:t,className:n,screenReaderLabel:a,showSpinner:l=!1,isLoading:i=!0}=e;return Object(o.createElement)("div",{className:r()(n,{"wc-block-components-loading-mask":i})},i&&l&&Object(o.createElement)(s.a,null),Object(o.createElement)("div",{className:r()({"wc-block-components-loading-mask__children":i}),"aria-hidden":i},t),i&&Object(o.createElement)("span",{className:"screen-reader-text"},a||Object(c.__)("Loading…","woo-gutenberg-products-block")))}},196:function(e,t){},198:function(e,t){},22:function(e,t,n){"use strict";var o=n(0),c=n(4),a=n.n(c);t.a=e=>{let t,{label:n,screenReaderLabel:c,wrapperElement:r,wrapperProps:s={}}=e;const l=null!=n,i=null!=c;return!l&&i?(t=r||"span",s={...s,className:a()(s.className,"screen-reader-text")},Object(o.createElement)(t,s,c)):(t=r||o.Fragment,l&&i&&n!==c?Object(o.createElement)(t,s,Object(o.createElement)("span",{"aria-hidden":"true"},n),Object(o.createElement)("span",{className:"screen-reader-text"},c)):Object(o.createElement)(t,s,n))}},264:function(e,t){},265:function(e,t){},266:function(e,t,n){"use strict";var o=n(12),c=n.n(o),a=n(0),r=n(42),s=n(4),l=n.n(s),i=n(135);n(267),t.a=e=>{let{className:t,showSpinner:n=!1,children:o,variant:s="contained",...u}=e;const p=l()("wc-block-components-button",t,s,{"wc-block-components-button--loading":n});return Object(a.createElement)(r.a,c()({className:p},u),n&&Object(a.createElement)(i.a,null),Object(a.createElement)("span",{className:"wc-block-components-button__text"},o))}},267:function(e,t){},274:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(1),c=n(7),a=n(6),r=n(17),s=n(32),l=n(199);const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{cartCoupons:t,cartIsLoading:n}=Object(s.a)(),{createErrorNotice:i}=Object(c.useDispatch)("core/notices"),{createNotice:u}=Object(c.useDispatch)("core/notices"),{setValidationErrors:p}=Object(l.b)(),{applyCoupon:b,removeCoupon:d,isApplyingCoupon:m,isRemovingCoupon:g}=Object(c.useSelect)((e,t)=>{let{dispatch:n}=t;const o=e(a.CART_STORE_KEY),c=n(a.CART_STORE_KEY);return{applyCoupon:c.applyCoupon,removeCoupon:c.removeCoupon,isApplyingCoupon:o.isApplyingCoupon(),isRemovingCoupon:o.isRemovingCoupon(),receiveApplyingCoupon:c.receiveApplyingCoupon}},[i,u]),O=t=>{b(t).then(n=>{!0===n&&u("info",Object(o.sprintf)( +/* translators: %s coupon code. */ +Object(o.__)('Coupon code "%s" has been applied to your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(e=>{p({coupon:{message:Object(r.decodeEntities)(e.message),hidden:!1}}),receiveApplyingCoupon("")})},j=t=>{d(t).then(n=>{!0===n&&u("info",Object(o.sprintf)( +/* translators: %s coupon code. */ +Object(o.__)('Coupon code "%s" has been removed from your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(t=>{i(t.message,{id:"coupon-form",context:e}),receiveApplyingCoupon("")})};return{appliedCoupons:t,isLoading:n,applyCoupon:O,removeCoupon:j,isApplyingCoupon:m,isRemovingCoupon:g}}},277:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n(0),c=n(199);n(264);const a=e=>{let{errorMessage:t="",propertyName:n="",elementId:a=""}=e;const{getValidationError:r,getValidationErrorId:s}=Object(c.b)();if(!t||"string"!=typeof t){const e=r(n)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(o.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(o.createElement)("p",{id:s(a)},t))}},302:function(e,t,n){"use strict";var o=n(12),c=n.n(o),a=n(0),r=n(1),s=n(5),l=n(4),i=n.n(l),u=n(199),p=n(277),b=n(9),d=n(45),m=n(22);n(265);var g=Object(s.forwardRef)((e,t)=>{let{className:n,id:o,type:r="text",ariaLabel:s,ariaDescribedBy:l,label:u,screenReaderLabel:p,disabled:b,help:d,autoCapitalize:g="off",autoComplete:O="off",value:j="",onChange:f,required:E=!1,onBlur:v=(()=>{}),feedback:h,...w}=e;const[_,C]=Object(a.useState)(!1);return Object(a.createElement)("div",{className:i()("wc-block-components-text-input",n,{"is-active":_||j})},Object(a.createElement)("input",c()({type:r,id:o,value:j,ref:t,autoCapitalize:g,autoComplete:O,onChange:e=>{f(e.target.value)},onFocus:()=>C(!0),onBlur:e=>{v(e.target.value),C(!1)},"aria-label":s||u,disabled:b,"aria-describedby":d&&!l?o+"__help":l,required:E},w)),Object(a.createElement)(m.a,{label:u,screenReaderLabel:p||u,wrapperElement:"label",wrapperProps:{htmlFor:o},htmlFor:o}),!!d&&Object(a.createElement)("p",{id:o+"__help",className:"wc-block-components-text-input__help"},d),h)});t.a=Object(b.withInstanceId)(e=>{let{className:t,instanceId:n,id:o,ariaDescribedBy:l,errorId:b,focusOnMount:m=!1,onChange:O,showError:j=!0,errorMessage:f="",value:E="",...v}=e;const[h,w]=Object(s.useState)(!0),_=Object(s.useRef)(null),{getValidationError:C,hideValidationError:k,setValidationErrors:y,clearValidationError:N,getValidationErrorId:R}=Object(u.b)(),I=void 0!==o?o:"textinput-"+n,A=void 0!==b?b:I,L=Object(s.useCallback)((function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=_.current||null;if(!t)return;t.value=t.value.trim();const n=t.checkValidity();n?N(A):y({[A]:{message:t.validationMessage||Object(r.__)("Invalid value.","woo-gutenberg-products-block"),hidden:e}})}),[N,A,y]);Object(s.useEffect)(()=>{var e;h&&m&&(null===(e=_.current)||void 0===e||e.focus()),w(!1)},[m,h,w]),Object(s.useEffect)(()=>{var e,t;(null===(e=_.current)||void 0===e||null===(t=e.ownerDocument)||void 0===t?void 0:t.activeElement)!==_.current&&L(!0)},[E,L]),Object(s.useEffect)(()=>()=>{N(A)},[N,A]);const S=C(A)||{};Object(d.a)(f)&&""!==f&&(S.message=f);const x=S.message&&!S.hidden,V=j&&x&&R(A)?R(A):l;return Object(a.createElement)(g,c()({className:i()(t,{"has-error":x}),"aria-invalid":!0===x,id:I,onBlur:()=>{L(!1)},feedback:j&&Object(a.createElement)(p.a,{errorMessage:f,propertyName:A}),ref:_,onChange:e=>{k(A),O(e)},ariaDescribedBy:V,value:E},v))})},317:function(e,t){},381:function(e,t,n){"use strict";var o=n(0),c=n(1),a=n(266),r=n(302),s=n(22),l=n(136),i=n(9),u=n(199),p=n(277),b=n(10);n(317),t.a=Object(i.withInstanceId)(e=>{let{instanceId:t,isLoading:n=!1,initialOpen:i=!1,onSubmit:d=(()=>{})}=e;const[m,g]=Object(o.useState)(""),O=Object(o.useRef)(!1),{getValidationError:j,getValidationErrorId:f}=Object(u.b)(),E=j("coupon");Object(o.useEffect)(()=>{O.current!==n&&(n||!m||E||g(""),O.current=n)},[n,m,E]);const v="wc-block-components-totals-coupon__input-"+t;return Object(o.createElement)(b.Panel,{className:"wc-block-components-totals-coupon",hasBorder:!1,initialOpen:i,title:Object(o.createElement)(s.a,{label:Object(c.__)("Coupon code","woo-gutenberg-products-block"),screenReaderLabel:Object(c.__)("Apply a coupon code","woo-gutenberg-products-block"),htmlFor:v})},Object(o.createElement)(l.a,{screenReaderLabel:Object(c.__)("Applying coupon…","woo-gutenberg-products-block"),isLoading:n,showSpinner:!1},Object(o.createElement)("div",{className:"wc-block-components-totals-coupon__content"},Object(o.createElement)("form",{className:"wc-block-components-totals-coupon__form"},Object(o.createElement)(r.a,{id:v,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:Object(c.__)("Enter code","woo-gutenberg-products-block"),value:m,ariaDescribedBy:f(v),onChange:e=>{g(e)},focusOnMount:!0,showError:!1}),Object(o.createElement)(a.a,{className:"wc-block-components-totals-coupon__button",disabled:n||!m,showSpinner:n,onClick:e=>{e.preventDefault(),d(m)},type:"submit"},Object(c.__)("Apply","woo-gutenberg-products-block"))),Object(o.createElement)(p.a,{propertyName:"coupon",elementId:v}))))})},463:function(e,t,n){"use strict";n.r(t);var o=n(0),c=n(381),a=n(274),r=n(2),s=n(10);t.default=e=>{let{className:t=""}=e;const n=Object(r.getSetting)("couponsEnabled",!0),{applyCoupon:l,isApplyingCoupon:i}=Object(a.a)("wc/checkout");return n?Object(o.createElement)(s.TotalsWrapper,{className:t},Object(o.createElement)(c.a,{onSubmit:l,isLoading:i})):null}}}]); \ No newline at end of file diff --git a/build/checkout-blocks/order-summary-discount-frontend.js b/build/checkout-blocks/order-summary-discount-frontend.js new file mode 100644 index 00000000000..957fd3d19a2 --- /dev/null +++ b/build/checkout-blocks/order-summary-discount-frontend.js @@ -0,0 +1,13 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[38],{135:function(e,t,o){"use strict";var c=o(0);o(196),t.a=()=>Object(c.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},136:function(e,t,o){"use strict";var c=o(0),n=o(1),a=o(4),s=o.n(a),r=(o(198),o(135));t.a=e=>{let{children:t,className:o,screenReaderLabel:a,showSpinner:l=!1,isLoading:i=!0}=e;return Object(c.createElement)("div",{className:s()(o,{"wc-block-components-loading-mask":i})},i&&l&&Object(c.createElement)(r.a,null),Object(c.createElement)("div",{className:s()({"wc-block-components-loading-mask__children":i}),"aria-hidden":i},t),i&&Object(c.createElement)("span",{className:"screen-reader-text"},a||Object(n.__)("Loading…","woo-gutenberg-products-block")))}},196:function(e,t){},198:function(e,t){},201:function(e,t){},256:function(e,t,o){"use strict";var c=o(12),n=o.n(c),a=o(0),s=o(4),r=o.n(s),l=o(1),i=o(117),p=o(13),u=Object(a.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(p.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));o(201);var b=e=>{let{text:t,screenReaderText:o="",element:c="li",className:s="",radius:l="small",children:i=null,...p}=e;const u=c,b=r()(s,"wc-block-components-chip","wc-block-components-chip--radius-"+l),m=Boolean(o&&o!==t);return Object(a.createElement)(u,n()({className:b},p),Object(a.createElement)("span",{"aria-hidden":m,className:"wc-block-components-chip__text"},t),m&&Object(a.createElement)("span",{className:"screen-reader-text"},o),i)};t.a=e=>{let{ariaLabel:t="",className:o="",disabled:c=!1,onRemove:s=(()=>{}),removeOnAnyClick:p=!1,text:m,screenReaderText:d="",...g}=e;const O=p?"span":"button";if(!t){const e=d&&"string"==typeof d?d:m;t="string"!=typeof e? +/* translators: Remove chip. */ +Object(l.__)("Remove","woo-gutenberg-products-block"):Object(l.sprintf)( +/* translators: %s text of the chip to remove. */ +Object(l.__)('Remove "%s"',"woo-gutenberg-products-block"),e)}const j={"aria-label":t,disabled:c,onClick:s,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||s()}},v=p?j:{},C=p?{"aria-hidden":!0}:j;return Object(a.createElement)(b,n()({},g,v,{className:r()(o,"is-removable"),element:p?"button":g.element,screenReaderText:d,text:m}),Object(a.createElement)(O,n()({className:"wc-block-components-chip__remove"},C),Object(a.createElement)(i.a,{className:"wc-block-components-chip__remove-icon",icon:u,size:16})))}},274:function(e,t,o){"use strict";o.d(t,"a",(function(){return i}));var c=o(1),n=o(7),a=o(6),s=o(17),r=o(32),l=o(199);const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{cartCoupons:t,cartIsLoading:o}=Object(r.a)(),{createErrorNotice:i}=Object(n.useDispatch)("core/notices"),{createNotice:p}=Object(n.useDispatch)("core/notices"),{setValidationErrors:u}=Object(l.b)(),{applyCoupon:b,removeCoupon:m,isApplyingCoupon:d,isRemovingCoupon:g}=Object(n.useSelect)((e,t)=>{let{dispatch:o}=t;const c=e(a.CART_STORE_KEY),n=o(a.CART_STORE_KEY);return{applyCoupon:n.applyCoupon,removeCoupon:n.removeCoupon,isApplyingCoupon:c.isApplyingCoupon(),isRemovingCoupon:c.isRemovingCoupon(),receiveApplyingCoupon:n.receiveApplyingCoupon}},[i,p]),O=t=>{b(t).then(o=>{!0===o&&p("info",Object(c.sprintf)( +/* translators: %s coupon code. */ +Object(c.__)('Coupon code "%s" has been applied to your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(e=>{u({coupon:{message:Object(s.decodeEntities)(e.message),hidden:!1}}),receiveApplyingCoupon("")})},j=t=>{m(t).then(o=>{!0===o&&p("info",Object(c.sprintf)( +/* translators: %s coupon code. */ +Object(c.__)('Coupon code "%s" has been removed from your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(t=>{i(t.message,{id:"coupon-form",context:e}),receiveApplyingCoupon("")})};return{appliedCoupons:t,isLoading:o,applyCoupon:O,removeCoupon:j,isApplyingCoupon:d,isRemovingCoupon:g}}},316:function(e,t){},380:function(e,t,o){"use strict";var c=o(0),n=o(1),a=o(136),s=o(256),r=o(10),l=o(2);o(316);const i={context:"summary"};t.a=e=>{let{cartCoupons:t=[],currency:o,isRemovingCoupon:p,removeCoupon:u,values:b}=e;const{total_discount:m,total_discount_tax:d}=b,g=parseInt(m,10);if(!g&&0===t.length)return null;const O=parseInt(d,10),j=Object(l.getSetting)("displayCartPricesIncludingTax",!1)?g+O:g,v=Object(r.__experimentalApplyCheckoutFilter)({arg:i,filterName:"coupons",defaultValue:t});return Object(c.createElement)(r.TotalsItem,{className:"wc-block-components-totals-discount",currency:o,description:0!==v.length&&Object(c.createElement)(a.a,{screenReaderLabel:Object(n.__)("Removing coupon…","woo-gutenberg-products-block"),isLoading:p,showSpinner:!1},Object(c.createElement)("ul",{className:"wc-block-components-totals-discount__coupon-list"},v.map(e=>Object(c.createElement)(s.a,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:Object(n.sprintf)( +/* translators: %s Coupon code. */ +Object(n.__)("Coupon: %s","woo-gutenberg-products-block"),e.label),disabled:p,onRemove:()=>{u(e.code)},radius:"large",ariaLabel:Object(n.sprintf)( +/* translators: %s is a coupon code. */ +Object(n.__)('Remove coupon "%s"',"woo-gutenberg-products-block"),e.label)})))),label:j?Object(n.__)("Discount","woo-gutenberg-products-block"):Object(n.__)("Coupons","woo-gutenberg-products-block"),value:j?-1*j:"-"})}},462:function(e,t,o){"use strict";o.r(t);var c=o(0),n=o(380),a=o(41),s=o(32),r=o(274),l=o(10);const i=()=>{const{extensions:e,receiveCart:t,...o}=Object(s.a)(),n={extensions:e,cart:o,context:"woocommerce/checkout"};return Object(c.createElement)(l.ExperimentalDiscountsMeta.Slot,n)};t.default=e=>{let{className:t=""}=e;const{cartTotals:o,cartCoupons:p}=Object(s.a)(),{removeCoupon:u,isRemovingCoupon:b}=Object(r.a)("wc/checkout"),m=Object(a.getCurrencyFromPriceResponse)(o);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(l.TotalsWrapper,{className:t},Object(c.createElement)(n.a,{cartCoupons:p,currency:m,isRemovingCoupon:b,removeCoupon:u,values:o})),Object(c.createElement)(i,null))}}}]); \ No newline at end of file diff --git a/build/checkout-blocks/order-summary-fee-frontend.js b/build/checkout-blocks/order-summary-fee-frontend.js new file mode 100644 index 00000000000..5163afb2b56 --- /dev/null +++ b/build/checkout-blocks/order-summary-fee-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[39],{461:function(e,c,t){"use strict";t.r(c);var s=t(0),a=t(10),r=t(41),n=t(32);c.default=e=>{let{className:c=""}=e;const{cartFees:t,cartTotals:o}=Object(n.a)(),l=Object(r.getCurrencyFromPriceResponse)(o);return Object(s.createElement)(a.TotalsWrapper,{className:c},Object(s.createElement)(a.TotalsFees,{currency:l,cartFees:t}))}}}]); \ No newline at end of file diff --git a/build/checkout-blocks/order-summary-frontend.js b/build/checkout-blocks/order-summary-frontend.js new file mode 100644 index 00000000000..7ebfe33aa79 --- /dev/null +++ b/build/checkout-blocks/order-summary-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[35],{102:function(e,t,c){"use strict";var a=c(12),n=c.n(a),o=c(0),r=c(137),l=c(4),s=c.n(l);c(197);const i=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:c,currency:a,onValueChange:l,displayType:u="text",...m}=e;const p="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(p))return null;const b=p/10**a.minorUnit;if(!Number.isFinite(b))return null;const d=s()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),f={...m,...i(a),value:void 0,currency:void 0,onValueChange:void 0},x=l?e=>{const t=+e.value*10**a.minorUnit;l(t)}:()=>{};return Object(o.createElement)(r.a,n()({className:d,displayType:u},f,{value:b,onValueChange:x}))}},197:function(e,t){},315:function(e,t){},379:function(e,t,c){"use strict";var a=c(0),n=c(1),o=c(4),r=c.n(o),l=c(102),s=c(10),i=c(32),u=c(2);c(315),t.a=e=>{let{currency:t,values:c,className:o}=e;const m=Object(u.getSetting)("taxesEnabled",!0)&&Object(u.getSetting)("displayCartPricesIncludingTax",!1),{total_price:p,total_tax:b}=c,{receiveCart:d,...f}=Object(i.a)(),x=Object(s.__experimentalApplyCheckoutFilter)({filterName:"totalLabel",defaultValue:Object(n.__)("Total","woo-gutenberg-products-block"),extensions:f.extensions,arg:{cart:f}}),O=parseInt(b,10);return Object(a.createElement)(s.TotalsItem,{className:r()("wc-block-components-totals-footer-item",o),currency:t,label:x,value:parseInt(p,10),description:m&&0!==O&&Object(a.createElement)("p",{className:"wc-block-components-totals-footer-item-tax"},Object(a.createInterpolateElement)(Object(n.__)("Including in taxes","woo-gutenberg-products-block"),{TaxAmount:Object(a.createElement)(l.a,{className:"wc-block-components-totals-footer-item-tax-value",currency:t,value:O})}))})}},459:function(e,t,c){"use strict";c.r(t);var a=c(0),n=c(379),o=c(41),r=c(32),l=c(10);const s=()=>{const{extensions:e,receiveCart:t,...c}=Object(r.a)(),n={extensions:e,cart:c,context:"woocommerce/checkout"};return Object(a.createElement)(l.ExperimentalOrderMeta.Slot,n)};t.default=e=>{let{children:t,className:c=""}=e;const{cartTotals:l}=Object(r.a)(),i=Object(o.getCurrencyFromPriceResponse)(l);return Object(a.createElement)("div",{className:c},t,Object(a.createElement)("div",{className:"wc-block-components-totals-wrapper"},Object(a.createElement)(n.a,{currency:i,values:l})),Object(a.createElement)(s,null))}}}]); \ No newline at end of file diff --git a/build/checkout-blocks/order-summary-shipping-frontend.js b/build/checkout-blocks/order-summary-shipping-frontend.js new file mode 100644 index 00000000000..98f0f148bf5 --- /dev/null +++ b/build/checkout-blocks/order-summary-shipping-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[40],{135:function(e,c,t){"use strict";var a=t(0);t(196),c.a=()=>Object(a.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},136:function(e,c,t){"use strict";var a=t(0),n=t(1),s=t(4),r=t.n(s),o=(t(198),t(135));c.a=e=>{let{children:c,className:t,screenReaderLabel:s,showSpinner:l=!1,isLoading:i=!0}=e;return Object(a.createElement)("div",{className:r()(t,{"wc-block-components-loading-mask":i})},i&&l&&Object(a.createElement)(o.a,null),Object(a.createElement)("div",{className:r()({"wc-block-components-loading-mask__children":i}),"aria-hidden":i},c),i&&Object(a.createElement)("span",{className:"screen-reader-text"},s||Object(n.__)("Loading…","woo-gutenberg-products-block")))}},196:function(e,c){},198:function(e,c){},464:function(e,c,t){"use strict";t.r(c);var a=t(0),n=t(432),s=t(41),r=t(32),o=t(10);c.default=e=>{let{className:c=""}=e;const{cartTotals:t,cartNeedsShipping:l}=Object(r.a)();if(!l)return null;const i=Object(s.getCurrencyFromPriceResponse)(t);return Object(a.createElement)(o.TotalsWrapper,{className:c},Object(a.createElement)(n.a,{showCalculator:!1,showRateSelector:!1,values:t,currency:i}))}}}]); \ No newline at end of file diff --git a/build/checkout-blocks/order-summary-subtotal-frontend.js b/build/checkout-blocks/order-summary-subtotal-frontend.js new file mode 100644 index 00000000000..1d70d9fadef --- /dev/null +++ b/build/checkout-blocks/order-summary-subtotal-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[41],{460:function(e,c,t){"use strict";t.r(c);var a=t(0),s=t(10),r=t(41),n=t(32);c.default=e=>{let{className:c=""}=e;const{cartTotals:t}=Object(n.a)(),o=Object(r.getCurrencyFromPriceResponse)(t);return Object(a.createElement)(s.TotalsWrapper,{className:c},Object(a.createElement)(s.Subtotal,{currency:o,values:t}))}}}]); \ No newline at end of file diff --git a/build/checkout-blocks/order-summary-taxes-frontend.js b/build/checkout-blocks/order-summary-taxes-frontend.js new file mode 100644 index 00000000000..6cd15cab727 --- /dev/null +++ b/build/checkout-blocks/order-summary-taxes-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[42],{445:function(e,t,a){"use strict";a.r(t);var c=a(119),r=a(0),s=a(10),l=a(41),n=a(32),o=a(2),i={showRateAfterTaxName:{type:"boolean",default:Object(o.getSetting)("displayCartPricesIncludingTax",!1)},lock:{type:"object",default:{remove:!0,move:!1}}};t.default=Object(c.withFilteredAttributes)(i)(e=>{let{className:t,showRateAfterTaxName:a}=e;const{cartTotals:c}=Object(n.a)();if(Object(o.getSetting)("displayCartPricesIncludingTax",!1)||parseInt(c.total_tax,10)<=0)return null;const i=Object(l.getCurrencyFromPriceResponse)(c);return Object(r.createElement)(s.TotalsWrapper,{className:t},Object(r.createElement)(s.TotalsTaxes,{showRateAfterTaxName:a,currency:i,values:c}))})}}]); \ No newline at end of file diff --git a/build/checkout-blocks/payment-frontend.js b/build/checkout-blocks/payment-frontend.js new file mode 100644 index 00000000000..59f2771b86c --- /dev/null +++ b/build/checkout-blocks/payment-frontend.js @@ -0,0 +1,11 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[43],{135:function(e,t,n){"use strict";var c=n(0);n(196),t.a=()=>Object(c.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},136:function(e,t,n){"use strict";var c=n(0),o=n(1),a=n(4),s=n.n(a),r=(n(198),n(135));t.a=e=>{let{children:t,className:n,screenReaderLabel:a,showSpinner:l=!1,isLoading:i=!0}=e;return Object(c.createElement)("div",{className:s()(n,{"wc-block-components-loading-mask":i})},i&&l&&Object(c.createElement)(r.a,null),Object(c.createElement)("div",{className:s()({"wc-block-components-loading-mask__children":i}),"aria-hidden":i},t),i&&Object(c.createElement)("span",{className:"screen-reader-text"},a||Object(o.__)("Loading…","woo-gutenberg-products-block")))}},196:function(e,t){},198:function(e,t){},22:function(e,t,n){"use strict";var c=n(0),o=n(4),a=n.n(o);t.a=e=>{let t,{label:n,screenReaderLabel:o,wrapperElement:s,wrapperProps:r={}}=e;const l=null!=n,i=null!=o;return!l&&i?(t=s||"span",r={...r,className:a()(r.className,"screen-reader-text")},Object(c.createElement)(t,r,o)):(t=s||c.Fragment,l&&i&&n!==o?Object(c.createElement)(t,r,Object(c.createElement)("span",{"aria-hidden":"true"},n),Object(c.createElement)("span",{className:"screen-reader-text"},o)):Object(c.createElement)(t,r,n))}},264:function(e,t){},268:function(e,t,n){"use strict";var c=n(12),o=n.n(c),a=n(0),s=n(4),r=n.n(s);n(269),t.a=e=>{let{children:t,className:n,headingLevel:c,...s}=e;const l=r()("wc-block-components-title",n),i="h"+c;return Object(a.createElement)(i,o()({className:l},s),t)}},269:function(e,t){},270:function(e,t,n){"use strict";var c=n(0),o=n(4),a=n.n(o),s=n(271);t.a=e=>{let{checked:t,name:n,onChange:o,option:r}=e;const{value:l,label:i,description:p,secondaryLabel:d,secondaryDescription:m}=r;return Object(c.createElement)("label",{className:a()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":t}),htmlFor:`${n}-${l}`},Object(c.createElement)("input",{id:`${n}-${l}`,className:"wc-block-components-radio-control__input",type:"radio",name:n,value:l,onChange:e=>o(e.target.value),checked:t,"aria-describedby":a()({[`${n}-${l}__label`]:i,[`${n}-${l}__secondary-label`]:d,[`${n}-${l}__description`]:p,[`${n}-${l}__secondary-description`]:m})}),Object(c.createElement)(s.a,{id:`${n}-${l}`,label:i,secondaryLabel:d,description:p,secondaryDescription:m}))}},271:function(e,t,n){"use strict";var c=n(0);t.a=e=>{let{label:t,secondaryLabel:n,description:o,secondaryDescription:a,id:s}=e;return Object(c.createElement)("div",{className:"wc-block-components-radio-control__option-layout"},Object(c.createElement)("div",{className:"wc-block-components-radio-control__label-group"},t&&Object(c.createElement)("span",{id:s&&s+"__label",className:"wc-block-components-radio-control__label"},t),n&&Object(c.createElement)("span",{id:s&&s+"__secondary-label",className:"wc-block-components-radio-control__secondary-label"},n)),Object(c.createElement)("div",{className:"wc-block-components-radio-control__description-group"},o&&Object(c.createElement)("span",{id:s&&s+"__description",className:"wc-block-components-radio-control__description"},o),a&&Object(c.createElement)("span",{id:s&&s+"__secondary-description",className:"wc-block-components-radio-control__secondary-description"},a)))}},274:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var c=n(1),o=n(7),a=n(6),s=n(17),r=n(32),l=n(199);const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{cartCoupons:t,cartIsLoading:n}=Object(r.a)(),{createErrorNotice:i}=Object(o.useDispatch)("core/notices"),{createNotice:p}=Object(o.useDispatch)("core/notices"),{setValidationErrors:d}=Object(l.b)(),{applyCoupon:m,removeCoupon:b,isApplyingCoupon:u,isRemovingCoupon:h}=Object(o.useSelect)((e,t)=>{let{dispatch:n}=t;const c=e(a.CART_STORE_KEY),o=n(a.CART_STORE_KEY);return{applyCoupon:o.applyCoupon,removeCoupon:o.removeCoupon,isApplyingCoupon:c.isApplyingCoupon(),isRemovingCoupon:c.isRemovingCoupon(),receiveApplyingCoupon:o.receiveApplyingCoupon}},[i,p]),g=t=>{m(t).then(n=>{!0===n&&p("info",Object(c.sprintf)( +/* translators: %s coupon code. */ +Object(c.__)('Coupon code "%s" has been applied to your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(e=>{d({coupon:{message:Object(s.decodeEntities)(e.message),hidden:!1}}),receiveApplyingCoupon("")})},v=t=>{b(t).then(n=>{!0===n&&p("info",Object(c.sprintf)( +/* translators: %s coupon code. */ +Object(c.__)('Coupon code "%s" has been removed from your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(t=>{i(t.message,{id:"coupon-form",context:e}),receiveApplyingCoupon("")})};return{appliedCoupons:t,isLoading:n,applyCoupon:g,removeCoupon:v,isApplyingCoupon:u,isRemovingCoupon:h}}},275:function(e,t){},276:function(e,t){},277:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var c=n(0),o=n(199);n(264);const a=e=>{let{errorMessage:t="",propertyName:n="",elementId:a=""}=e;const{getValidationError:s,getValidationErrorId:r}=Object(o.b)();if(!t||"string"!=typeof t){const e=s(n)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(c.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(c.createElement)("p",{id:r(a)},t))}},278:function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return r}));var c=n(31),o=n(207);const a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{paymentMethods:t,expressPaymentMethods:n,paymentMethodsInitialized:a,expressPaymentMethodsInitialized:s}=Object(o.b)(),r=Object(c.a)(t),l=Object(c.a)(n);return{paymentMethods:e?l:r,isInitialized:e?s:a}},s=()=>a(!1),r=()=>a(!0)},279:function(e,t,n){"use strict";var c=n(1);t.a=e=>{let{defaultTitle:t=Object(c.__)("Step","woo-gutenberg-products-block"),defaultDescription:n=Object(c.__)("Step description text.","woo-gutenberg-products-block"),defaultShowStepNumber:o=!0}=e;return{title:{type:"string",default:t},description:{type:"string",default:n},showStepNumber:{type:"boolean",default:o}}}},280:function(e,t,n){"use strict";var c=n(12),o=n.n(c),a=n(0),s=n(4),r=n.n(s);const l=e=>"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--"+e;var i=e=>{let{id:t,src:n=null,alt:c=""}=e;return n?Object(a.createElement)("img",{className:l(t),src:n,alt:c}):null},p=n(48);const d=[{id:"alipay",alt:"Alipay",src:p.l+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:p.l+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:p.l+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:p.l+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:p.l+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:p.l+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:p.l+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:p.l+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:p.l+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:p.l+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:p.l+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:p.l+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:p.l+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:p.l+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:p.l+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:p.l+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:p.l+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:p.l+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:p.l+"payment-methods/wechat.svg"}];var m=n(45);n(275),t.a=e=>{let{icons:t=[],align:n="center",className:c}=e;const s=(e=>{const t={};return e.forEach(e=>{let n={};"string"==typeof e&&(n={id:e,alt:e,src:null}),"object"==typeof e&&(n={id:e.id||"",alt:e.alt||"",src:e.src||null}),n.id&&Object(m.a)(n.id)&&!t[n.id]&&(t[n.id]=n)}),Object.values(t)})(t);if(0===s.length)return null;const l=r()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===n,"wc-block-components-payment-method-icons--align-right":"right"===n},c);return Object(a.createElement)("div",{className:l},s.map(e=>{const t={...e,...(n=e.id,d.find(e=>e.id===n)||{})};var n;return Object(a.createElement)(i,o()({key:"payment-method-icon-"+e.id},t))}))}},290:function(e,t){},291:function(e,t,n){"use strict";var c=n(19),o=n.n(c),a=n(0),s=n(1),r=n(5),l=n(2),i=n(123),p=n(30);class d extends r.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return{errorMessage:e.message,hasError:!0}}render(){const{hasError:e,errorMessage:t}=this.state,{isEditor:n}=this.props;if(e){let e=Object(s.__)("This site is experiencing difficulties with this payment method. Please contact the owner of the site for assistance.","woo-gutenberg-products-block");(n||l.CURRENT_USER_IS_ADMIN)&&(e=t||Object(s.__)("There was an error with this payment method. Please verify it's configured correctly.","woo-gutenberg-products-block"));const c=[{id:"0",content:e,isDismissible:!1,status:"error"}];return Object(a.createElement)(i.a,{additionalNotices:c,context:p.c.PAYMENTS})}return this.props.children}}d.defaultProps={isEditor:!1},t.a=d},292:function(e,t,n){"use strict";var c=n(0),o=n(4),a=n.n(o),s=n(9),r=n(270);n(293);const l=e=>{let{className:t="",id:n,selected:o,onChange:i,options:p=[]}=e;const d=Object(s.useInstanceId)(l),m=n||d;return p.length?Object(c.createElement)("div",{className:a()("wc-block-components-radio-control",t)},p.map(e=>Object(c.createElement)(r.a,{key:`${m}-${e.value}`,name:"radio-control-"+m,checked:e.value===o,option:e,onChange:t=>{i(t),"function"==typeof e.onChange&&e.onChange(t)}}))):null};t.a=l},293:function(e,t){},298:function(e,t,n){"use strict";var c=n(0),o=n(4),a=n.n(o),s=n(268);n(276);const r=e=>{let{title:t,stepHeadingContent:n}=e;return Object(c.createElement)("div",{className:"wc-block-components-checkout-step__heading"},Object(c.createElement)(s.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!n&&Object(c.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},n))};t.a=e=>{let{id:t,className:n,title:o,legend:s,description:l,children:i,disabled:p=!1,showStepNumber:d=!0,stepHeadingContent:m=(()=>{})}=e;const b=s||o?"fieldset":"div";return Object(c.createElement)(b,{className:a()(n,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":d,"wc-block-components-checkout-step--disabled":p}),id:t,disabled:p},!(!s&&!o)&&Object(c.createElement)("legend",{className:"screen-reader-text"},s||o),!!o&&Object(c.createElement)(r,{title:o,stepHeadingContent:m()}),Object(c.createElement)("div",{className:"wc-block-components-checkout-step__container"},!!l&&Object(c.createElement)("p",{className:"wc-block-components-checkout-step__description"},l),Object(c.createElement)("div",{className:"wc-block-components-checkout-step__content"},i)))}},332:function(e,t,n){"use strict";var c=n(8),o=n(0),a=n(4),s=n.n(a),r=n(9),l=n(38);t.a=function({icon:e,children:t,label:n,instructions:a,className:i,notices:p,preview:d,isColumnLayout:m,...b}){const[u,{width:h}]=Object(r.useResizeObserver)();let g;"number"==typeof h&&(g={"is-large":h>=480,"is-medium":h>=160&&h<480,"is-small":h<160});const v=s()("components-placeholder",i,g),O=s()("components-placeholder__fieldset",{"is-column-layout":m});return Object(o.createElement)("div",Object(c.a)({},b,{className:v}),u,p,d&&Object(o.createElement)("div",{className:"components-placeholder__preview"},d),Object(o.createElement)("div",{className:"components-placeholder__label"},Object(o.createElement)(l.a,{icon:e}),n),!!a&&Object(o.createElement)("div",{className:"components-placeholder__instructions"},a),Object(o.createElement)("div",{className:O},t))}},337:function(e,t,n){"use strict";var c=n(0),o=n(13);const a=Object(c.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(o.Path,{fillRule:"evenodd",d:"M5.5 9.5v-2h13v2h-13zm0 3v4h13v-4h-13zM4 7a1 1 0 011-1h14a1 1 0 011 1v10a1 1 0 01-1 1H5a1 1 0 01-1-1V7z",clipRule:"evenodd"}));t.a=a},342:function(e,t,n){"use strict";n.d(t,"a",(function(){return T}));var c=n(1),o=n(41),a=n(0),s=n(4),r=n.n(s),l=n(13),i=Object(a.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(a.createElement)("path",{d:"M0 0h24v24H0z"}),Object(a.createElement)("path",{fill:"#000",fillRule:"nonzero",d:"M17.3 8v1c1 .2 1.4.9 1.4 1.7h-1c0-.6-.3-1-1-1-.8 0-1.3.4-1.3.9 0 .4.3.6 1.4 1 1 .2 2 .6 2 1.9 0 .9-.6 1.4-1.5 1.5v1H16v-1c-.9-.1-1.6-.7-1.7-1.7h1c0 .6.4 1 1.3 1 1 0 1.2-.5 1.2-.8 0-.4-.2-.8-1.3-1.1-1.3-.3-2.1-.8-2.1-1.8 0-.9.7-1.5 1.6-1.6V8h1.3zM12 10v1H6v-1h6zm2-2v1H6V8h8zM2 4v16h20V4H2zm2 14V6h16v12H4z"}),Object(a.createElement)("path",{stroke:"#000",strokeLinecap:"round",d:"M6 16c2.6 0 3.9-3 1.7-3-2 0-1 3 1.5 3 1 0 1-.8 2.8-.8"}))),p=Object(a.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(l.Path,{fillRule:"evenodd",d:"M18.646 9H20V8l-1-.5L12 4 5 7.5 4 8v1h14.646zm-3-1.5L12 5.677 8.354 7.5h7.292zm-7.897 9.44v-6.5h-1.5v6.5h1.5zm5-6.5v6.5h-1.5v-6.5h1.5zm5 0v6.5h-1.5v-6.5h1.5zm2.252 8.81c0 .414-.334.75-.748.75H4.752a.75.75 0 010-1.5h14.5a.75.75 0 01.749.75z",clipRule:"evenodd"})),d=Object(a.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(l.Path,{d:"M3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zm-1.338 4.877c-.314.22-.412.452-.412.623 0 .171.098.403.412.623.312.218.783.377 1.338.377.825 0 1.605.233 2.198.648.59.414 1.052 1.057 1.052 1.852 0 .795-.461 1.438-1.052 1.852-.41.286-.907.486-1.448.582v.316a.75.75 0 01-1.5 0v-.316a3.64 3.64 0 01-1.448-.582c-.59-.414-1.052-1.057-1.052-1.852a.75.75 0 011.5 0c0 .171.098.403.412.623.312.218.783.377 1.338.377s1.026-.159 1.338-.377c.314-.22.412-.452.412-.623 0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377-.825 0-1.605-.233-2.198-.648-.59-.414-1.052-1.057-1.052-1.852 0-.795.461-1.438 1.052-1.852a3.64 3.64 0 011.448-.582V7.5a.75.75 0 011.5 0v.316c.54.096 1.039.296 1.448.582.59.414 1.052 1.057 1.052 1.852a.75.75 0 01-1.5 0c0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377s-1.026.159-1.338.377z"})),m=n(337),b=n(117),u=n(45),h=n(18);n(290);const g={bank:p,bill:d,card:m.a,checkPayment:i};var v=e=>{let{icon:t="",text:n=""}=e;const c=!!t,o=Object(a.useCallback)(e=>c&&Object(u.a)(e)&&Object(h.b)(g,e),[c]),s=r()("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":c});return Object(a.createElement)("span",{className:s},o(t)?Object(a.createElement)(b.a,{icon:g[t]}):t,n)},O=n(280),j=n(2),y=n(25),k=n.n(y),_=n(136),w=n(277),E=n(32),f=n(274),S=n(30),C=n(36),N=n(207),P=n(68),M=n(50);const x=(e,t)=>{const n=[],o=(t,n)=>{const c=n+"_tax",o=Object(h.b)(e,n)&&Object(u.a)(e[n])?parseInt(e[n],10):0;return{key:n,label:t,value:o,valueWithTax:o+(Object(h.b)(e,c)&&Object(u.a)(e[c])?parseInt(e[c],10):0)}};return n.push(o(Object(c.__)("Subtotal:","woo-gutenberg-products-block"),"total_items")),n.push(o(Object(c.__)("Fees:","woo-gutenberg-products-block"),"total_fees")),n.push(o(Object(c.__)("Discount:","woo-gutenberg-products-block"),"total_discount")),n.push({key:"total_tax",label:Object(c.__)("Taxes:","woo-gutenberg-products-block"),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&n.push(o(Object(c.__)("Shipping:","woo-gutenberg-products-block"),"total_shipping")),n};var R=n(66);const T=()=>{const{isCalculating:e,isComplete:t,isIdle:n,isProcessing:s,onCheckoutBeforeProcessing:r,onCheckoutValidationBeforeProcessing:l,onCheckoutAfterProcessingWithSuccess:i,onCheckoutAfterProcessingWithError:p,onSubmit:d,customerId:m}=Object(C.b)(),{currentStatus:b,activePaymentMethod:u,onPaymentProcessing:h,setExpressPaymentError:g,shouldSavePayment:y}=Object(N.b)(),{shippingErrorStatus:T,shippingErrorTypes:A,onShippingRateSuccess:I,onShippingRateFail:z,onShippingRateSelectSuccess:L,onShippingRateSelectFail:$}=Object(P.b)(),{shippingRates:D,isLoadingRates:V,selectedRates:F,isSelectingRate:B,selectShippingRate:H,needsShipping:W}=Object(R.a)(),{billingAddress:Y,shippingAddress:G,setShippingAddress:U}=Object(M.b)(),{cartItems:J,cartFees:K,cartTotals:q,extensions:Q}=Object(E.a)(),{appliedCoupons:X}=Object(f.a)(),{noticeContexts:Z,responseTypes:ee}=Object(S.d)(),te=Object(a.useRef)(x(q,W)),ne=Object(a.useRef)({label:Object(c.__)("Total","woo-gutenberg-products-block"),value:parseInt(q.total_price,10)});Object(a.useEffect)(()=>{te.current=x(q,W),ne.current={label:Object(c.__)("Total","woo-gutenberg-products-block"),value:parseInt(q.total_price,10)}},[q,W]);const ce=Object(a.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";k()("setExpressPaymentError should only be used by Express Payment Methods (using the provided onError handler).",{alternative:"",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),g(e)}),[g]);return{activePaymentMethod:u,billing:{appliedCoupons:X,billingAddress:Y,billingData:Y,cartTotal:ne.current,cartTotalItems:te.current,currency:Object(o.getCurrencyFromPriceResponse)(q),customerId:m,displayPricesIncludingTax:Object(j.getSetting)("displayCartPricesIncludingTax",!1)},cartData:{cartItems:J,cartFees:K,extensions:Q},checkoutStatus:{isCalculating:e,isComplete:t,isIdle:n,isProcessing:s},components:{LoadingMask:_.a,PaymentMethodIcons:O.a,PaymentMethodLabel:v,ValidationInputError:w.a},emitResponse:{noticeContexts:Z,responseTypes:ee},eventRegistration:{onCheckoutAfterProcessingWithError:p,onCheckoutAfterProcessingWithSuccess:i,onCheckoutBeforeProcessing:r,onCheckoutValidationBeforeProcessing:l,onPaymentProcessing:h,onShippingRateFail:z,onShippingRateSelectFail:$,onShippingRateSelectSuccess:L,onShippingRateSuccess:I},onSubmit:d,paymentStatus:b,setExpressPaymentError:ce,shippingData:{isSelectingRate:B,needsShipping:W,selectedRates:F,setSelectedRates:H,setShippingAddress:U,shippingAddress:G,shippingRates:D,shippingRatesLoading:V},shippingStatus:{shippingErrorStatus:T,shippingErrorTypes:A},shouldSavePayment:y}}},387:function(e,t){},431:function(e,t,n){"use strict";n.r(t);var c=n(0),o=n(4),a=n.n(o),s=n(32),r=n(30),l=n(119),i=n(298),p=n(36),d=n(278),m=n(1),b=n(22),u=n(207),h=n(332),g=n(42),v=n(76),O=n(117),j=n(337),y=n(2),k=n(29);n(387);const _=()=>Object(c.createElement)(h.a,{icon:Object(c.createElement)(O.a,{icon:j.a}),label:Object(m.__)("Payment methods","woo-gutenberg-products-block"),className:"wc-block-checkout__no-payment-methods-placeholder"},Object(c.createElement)("span",{className:"wc-block-checkout__no-payment-methods-placeholder-description"},Object(m.__)("Your store does not have any payment methods configured that support the checkout block. Once you have configured a compatible payment method it will be shown here.","woo-gutenberg-products-block")),Object(c.createElement)(g.a,{isSecondary:!0,href:y.ADMIN_URL+"admin.php?page=wc-settings&tab=checkout",target:"_blank",rel:"noopener noreferrer"},Object(m.__)("Configure Payment Methods","woo-gutenberg-products-block"))),w=()=>Object(c.createElement)(v.a,{isDismissible:!1,className:a()("wc-block-checkout__no-payment-methods-notice","woocommerce-message","woocommerce-error")},Object(m.__)("There are no payment methods available. This may be an error on our side. Please contact us if you need any help placing your order.","woo-gutenberg-products-block"));var E=()=>{const{isEditor:e}=Object(k.a)();return e?Object(c.createElement)(_,null):Object(c.createElement)(w,null)},f=n(342),S=n(59),C=n(9),N=n(270),P=Object(C.withInstanceId)(e=>{let{className:t,instanceId:n,id:o,selected:s,onChange:r,options:l=[]}=e;const i=o||n;return l.length&&Object(c.createElement)("div",{className:a()("wc-block-components-radio-control",t)},l.map(e=>{const t="object"==typeof e&&"content"in e,n=e.value===s;return Object(c.createElement)("div",{className:"wc-block-components-radio-control-accordion-option",key:e.value},Object(c.createElement)(N.a,{name:"radio-control-"+i,checked:n,option:e,onChange:t=>{r(t),"function"==typeof e.onChange&&e.onChange(t)}}),t&&n&&Object(c.createElement)("div",{className:a()("wc-block-components-radio-control-accordion-content",{"wc-block-components-radio-control-accordion-content-hide":!n})},e.content))}))}),M=n(7),x=n(10),R=n(291),T=e=>{let{children:t,showSaveOption:n}=e;const{isEditor:o}=Object(k.a)(),{shouldSavePayment:a,setShouldSavePayment:s}=Object(u.b)(),{customerId:r}=Object(p.b)();return Object(c.createElement)(R.a,{isEditor:o},t,r>0&&n&&Object(c.createElement)(x.CheckboxControl,{className:"wc-block-components-payment-methods__save-card-info",label:Object(m.__)("Save payment information to my account for future purchases.","woo-gutenberg-products-block"),checked:a,onChange:()=>s(!a)}))},A=()=>{const{setActivePaymentMethod:e,activeSavedToken:t,isExpressPaymentMethodActive:n,customerPaymentMethods:o}=Object(u.b)(),{paymentMethods:s}=Object(d.b)(),{activePaymentMethod:l,...i}=Object(f.a)(),{noticeContexts:p}=Object(r.d)(),{removeNotice:m}=Object(M.useDispatch)("core/notices"),{dispatchCheckoutEvent:b}=Object(S.a)(),{isEditor:h}=Object(k.a)(),g=Object.keys(s).map(e=>{const{edit:t,content:n,label:o,supports:a}=s[e],r=h?t:n;return{value:e,label:"string"==typeof o?o:Object(c.cloneElement)(o,{components:i.components}),name:"wc-saved-payment-method-token-"+e,content:Object(c.createElement)(T,{showSaveOption:a.showSaveOption},Object(c.cloneElement)(r,{activePaymentMethod:l,...i}))}}),v=Object(c.useCallback)(t=>{e(t),m("wc-payment-error",p.PAYMENTS),b("set-active-payment-method",{value:t})},[b,p.PAYMENTS,m,e]),O=0===Object.keys(o).length&&1===Object.keys(s).length,j=a()({"disable-radio-control":O});return n?null:Object(c.createElement)(P,{id:"wc-payment-method-options",className:j,selected:t?null:l,onChange:v,options:g})},I=n(292);const z=e=>{let{method:t,expires:n}=e;return Object(m.sprintf)( +/* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card, %3$s is referring to the expiry date. */ +Object(m.__)("%1$s ending in %2$s (expires %3$s)","woo-gutenberg-products-block"),t.brand,t.last4,n)},L=e=>{let{method:t}=e;return t.brand&&t.last4?Object(m.sprintf)( +/* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card. */ +Object(m.__)("%1$s ending in %2$s","woo-gutenberg-products-block"),t.brand,t.last4):Object(m.sprintf)( +/* translators: %s is the name of the payment method gateway. */ +Object(m.__)("Saved token for %s","woo-gutenberg-products-block"),t.gateway)};var $=()=>{var e,t;const{customerPaymentMethods:n,activePaymentMethod:o,setActivePaymentMethod:a,activeSavedToken:s}=Object(u.b)(),{paymentMethods:l}=Object(d.b)(),i=Object(f.a)(),{noticeContexts:p}=Object(r.d)(),{removeNotice:m}=Object(M.useDispatch)("core/notices"),{dispatchCheckoutEvent:b}=Object(S.a)(),h=Object(c.useMemo)(()=>Object.keys(n).flatMap(e=>n[e].map(t=>{const n="cc"===e||"echeck"===e,c=t.method.gateway;return{name:"wc-saved-payment-method-token-"+c,label:n?z(t):L(t),value:t.tokenId.toString(),onChange:e=>{a(c,{token:e,payment_method:c,[`wc-${c}-payment-token`]:e.toString(),isSavedToken:!0}),m("wc-payment-error",p.PAYMENTS),b("set-active-payment-method",{paymentMethodSlug:c})}}})).filter(Boolean),[n,a,m,p.PAYMENTS,b]),g=s&&l[o]&&null!==(e=l[o])&&void 0!==e&&e.savedTokenComponent?Object(c.cloneElement)(null===(t=l[o])||void 0===t?void 0:t.savedTokenComponent,{token:s,...i}):null;return h.length>0?Object(c.createElement)(c.Fragment,null,Object(c.createElement)(I.a,{id:"wc-payment-method-saved-tokens",selected:s,options:h,onChange:()=>{}}),g):null},D=()=>{const{isInitialized:e,paymentMethods:t}=Object(d.b)(),{customerPaymentMethods:n}=Object(u.b)();return e&&0===Object.keys(t).length?Object(c.createElement)(E,null):Object(c.createElement)(c.Fragment,null,Object(c.createElement)($,null),Object.keys(n).length>0&&Object(c.createElement)(b.a,{label:Object(m.__)("Use another payment method.","woo-gutenberg-products-block"),screenReaderLabel:Object(m.__)("Other available payment methods","woo-gutenberg-products-block"),wrapperElement:"p",wrapperProps:{className:["wc-block-components-checkout-step__description wc-block-components-checkout-step__description-payments-aligned"]}}),Object(c.createElement)(A,null))},V=()=>Object(c.createElement)(D,null),F=n(279),B={...Object(F.a)({defaultTitle:Object(m.__)("Payment options","woo-gutenberg-products-block"),defaultDescription:""}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}},H=n(123);t.default=Object(l.withFilteredAttributes)(B)(e=>{let{title:t,description:n,showStepNumber:o,children:l,className:d}=e;const{isProcessing:m}=Object(p.b)(),{cartNeedsPayment:b}=Object(s.a)(),{noticeContexts:u}=Object(r.d)();return b?Object(c.createElement)(i.a,{id:"payment-method",disabled:m,className:a()("wc-block-checkout__payment-method",d),title:t,description:n,showStepNumber:o},Object(c.createElement)(H.a,{context:u.PAYMENTS}),Object(c.createElement)(V,null),l):null})}}]); \ No newline at end of file diff --git a/build/checkout-blocks/shipping-address-frontend.js b/build/checkout-blocks/shipping-address-frontend.js new file mode 100644 index 00000000000..1b3b61e795e --- /dev/null +++ b/build/checkout-blocks/shipping-address-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[44],{442:function(e,t,i){"use strict";i.r(t);var s=i(0),n=i(4),o=i.n(n),l=i(119),c=i(298),d=i(36),r=i(339),a=i(1),p=i(396),h=i(59),b=i(29),u=i(10),g=i(340),m=i(341),w=e=>{let{showCompanyField:t=!1,showApartmentField:i=!1,showPhoneField:n=!1,requireCompanyField:o=!1,requirePhoneField:l=!1}=e;const{defaultAddressFields:c,setShippingAddress:d,setBillingAddress:w,shippingAddress:j,setShippingPhone:O,useShippingAsBilling:F,setUseShippingAsBilling:f}=Object(r.a)(),{dispatchCheckoutEvent:k}=Object(h.a)(),{isEditor:y}=Object(b.a)(),[C,E]=Object(s.useState)(!1);Object(s.useEffect)(()=>{n||O("")},[n,O]),Object(s.useEffect)(()=>{C||(F&&w(j),E(!0))},[w,j,F]);const _=Object(s.useMemo)(()=>({company:{hidden:!t,required:o},address_2:{hidden:!i}}),[t,o,i]),A=y?g.a:s.Fragment;return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(A,null,Object(s.createElement)(p.a,{id:"shipping",type:"shipping",onChange:e=>{d(e),F&&w(e),k("set-shipping-address")},values:j,fields:Object.keys(c),fieldConfig:_}),n&&Object(s.createElement)(m.a,{id:"shipping-phone",isRequired:l,value:j.phone,onChange:e=>{O(e),k("set-phone-number",{step:"shipping"})}})),Object(s.createElement)(u.CheckboxControl,{className:"wc-block-checkout__use-address-for-billing",label:Object(a.__)("Use same address for billing","woo-gutenberg-products-block"),checked:F,onChange:e=>{f(e),e&&w(j)}}))},j=i(279),O={...Object(j.a)({defaultTitle:Object(a.__)("Shipping address","woo-gutenberg-products-block"),defaultDescription:Object(a.__)("Enter the address where you want your order delivered.","woo-gutenberg-products-block")}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}},F=i(139);t.default=Object(l.withFilteredAttributes)(O)(e=>{let{title:t,description:i,showStepNumber:n,children:l,className:a}=e;const{isProcessing:p}=Object(d.b)(),{showShippingFields:h}=Object(r.a)(),{requireCompanyField:b,requirePhoneField:u,showApartmentField:g,showCompanyField:m,showPhoneField:j}=Object(F.b)();return h?Object(s.createElement)(c.a,{id:"shipping-fields",disabled:p,className:o()("wc-block-checkout__shipping-fields",a),title:t,description:i,showStepNumber:n},Object(s.createElement)(w,{requireCompanyField:b,requirePhoneField:u,showApartmentField:g,showCompanyField:m,showPhoneField:j}),l):null})}}]); \ No newline at end of file diff --git a/build/checkout-blocks/shipping-methods-frontend.js b/build/checkout-blocks/shipping-methods-frontend.js new file mode 100644 index 00000000000..48377761a33 --- /dev/null +++ b/build/checkout-blocks/shipping-methods-frontend.js @@ -0,0 +1,9 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[45],{102:function(e,t,n){"use strict";var c=n(12),a=n.n(c),s=n(0),o=n(137),i=n(4),r=n.n(i);n(197);const l=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:n,currency:c,onValueChange:i,displayType:p="text",...d}=e;const b="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(b))return null;const u=b/10**c.minorUnit;if(!Number.isFinite(u))return null;const m=r()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),g={...d,...l(c),value:void 0,currency:void 0,onValueChange:void 0},h=i?e=>{const t=+e.value*10**c.minorUnit;i(t)}:()=>{};return Object(s.createElement)(o.a,a()({className:m,displayType:p},g,{value:u,onValueChange:h}))}},135:function(e,t,n){"use strict";var c=n(0);n(196),t.a=()=>Object(c.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},136:function(e,t,n){"use strict";var c=n(0),a=n(1),s=n(4),o=n.n(s),i=(n(198),n(135));t.a=e=>{let{children:t,className:n,screenReaderLabel:s,showSpinner:r=!1,isLoading:l=!0}=e;return Object(c.createElement)("div",{className:o()(n,{"wc-block-components-loading-mask":l})},l&&r&&Object(c.createElement)(i.a,null),Object(c.createElement)("div",{className:o()({"wc-block-components-loading-mask__children":l}),"aria-hidden":l},t),l&&Object(c.createElement)("span",{className:"screen-reader-text"},s||Object(a.__)("Loading…","woo-gutenberg-products-block")))}},196:function(e,t){},197:function(e,t){},198:function(e,t){},22:function(e,t,n){"use strict";var c=n(0),a=n(4),s=n.n(a);t.a=e=>{let t,{label:n,screenReaderLabel:a,wrapperElement:o,wrapperProps:i={}}=e;const r=null!=n,l=null!=a;return!r&&l?(t=o||"span",i={...i,className:s()(i.className,"screen-reader-text")},Object(c.createElement)(t,i,a)):(t=o||c.Fragment,r&&l&&n!==a?Object(c.createElement)(t,i,Object(c.createElement)("span",{"aria-hidden":"true"},n),Object(c.createElement)("span",{className:"screen-reader-text"},a)):Object(c.createElement)(t,i,n))}},268:function(e,t,n){"use strict";var c=n(12),a=n.n(c),s=n(0),o=n(4),i=n.n(o);n(269),t.a=e=>{let{children:t,className:n,headingLevel:c,...o}=e;const r=i()("wc-block-components-title",n),l="h"+c;return Object(s.createElement)(l,a()({className:r},o),t)}},269:function(e,t){},270:function(e,t,n){"use strict";var c=n(0),a=n(4),s=n.n(a),o=n(271);t.a=e=>{let{checked:t,name:n,onChange:a,option:i}=e;const{value:r,label:l,description:p,secondaryLabel:d,secondaryDescription:b}=i;return Object(c.createElement)("label",{className:s()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":t}),htmlFor:`${n}-${r}`},Object(c.createElement)("input",{id:`${n}-${r}`,className:"wc-block-components-radio-control__input",type:"radio",name:n,value:r,onChange:e=>a(e.target.value),checked:t,"aria-describedby":s()({[`${n}-${r}__label`]:l,[`${n}-${r}__secondary-label`]:d,[`${n}-${r}__description`]:p,[`${n}-${r}__secondary-description`]:b})}),Object(c.createElement)(o.a,{id:`${n}-${r}`,label:l,secondaryLabel:d,description:p,secondaryDescription:b}))}},271:function(e,t,n){"use strict";var c=n(0);t.a=e=>{let{label:t,secondaryLabel:n,description:a,secondaryDescription:s,id:o}=e;return Object(c.createElement)("div",{className:"wc-block-components-radio-control__option-layout"},Object(c.createElement)("div",{className:"wc-block-components-radio-control__label-group"},t&&Object(c.createElement)("span",{id:o&&o+"__label",className:"wc-block-components-radio-control__label"},t),n&&Object(c.createElement)("span",{id:o&&o+"__secondary-label",className:"wc-block-components-radio-control__secondary-label"},n)),Object(c.createElement)("div",{className:"wc-block-components-radio-control__description-group"},a&&Object(c.createElement)("span",{id:o&&o+"__description",className:"wc-block-components-radio-control__description"},a),s&&Object(c.createElement)("span",{id:o&&o+"__secondary-description",className:"wc-block-components-radio-control__secondary-description"},s)))}},276:function(e,t){},279:function(e,t,n){"use strict";var c=n(1);t.a=e=>{let{defaultTitle:t=Object(c.__)("Step","woo-gutenberg-products-block"),defaultDescription:n=Object(c.__)("Step description text.","woo-gutenberg-products-block"),defaultShowStepNumber:a=!0}=e;return{title:{type:"string",default:t},description:{type:"string",default:n},showStepNumber:{type:"boolean",default:a}}}},292:function(e,t,n){"use strict";var c=n(0),a=n(4),s=n.n(a),o=n(9),i=n(270);n(293);const r=e=>{let{className:t="",id:n,selected:a,onChange:l,options:p=[]}=e;const d=Object(o.useInstanceId)(r),b=n||d;return p.length?Object(c.createElement)("div",{className:s()("wc-block-components-radio-control",t)},p.map(e=>Object(c.createElement)(i.a,{key:`${b}-${e.value}`,name:"radio-control-"+b,checked:e.value===a,option:e,onChange:t=>{l(t),"function"==typeof e.onChange&&e.onChange(t)}}))):null};t.a=r},293:function(e,t){},298:function(e,t,n){"use strict";var c=n(0),a=n(4),s=n.n(a),o=n(268);n(276);const i=e=>{let{title:t,stepHeadingContent:n}=e;return Object(c.createElement)("div",{className:"wc-block-components-checkout-step__heading"},Object(c.createElement)(o.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!n&&Object(c.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},n))};t.a=e=>{let{id:t,className:n,title:a,legend:o,description:r,children:l,disabled:p=!1,showStepNumber:d=!0,stepHeadingContent:b=(()=>{})}=e;const u=o||a?"fieldset":"div";return Object(c.createElement)(u,{className:s()(n,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":d,"wc-block-components-checkout-step--disabled":p}),id:t,disabled:p},!(!o&&!a)&&Object(c.createElement)("legend",{className:"screen-reader-text"},o||a),!!a&&Object(c.createElement)(i,{title:a,stepHeadingContent:b()}),Object(c.createElement)("div",{className:"wc-block-components-checkout-step__container"},!!r&&Object(c.createElement)("p",{className:"wc-block-components-checkout-step__description"},r),Object(c.createElement)("div",{className:"wc-block-components-checkout-step__content"},l)))}},321:function(e,t){},332:function(e,t,n){"use strict";var c=n(8),a=n(0),s=n(4),o=n.n(s),i=n(9),r=n(38);t.a=function({icon:e,children:t,label:n,instructions:s,className:l,notices:p,preview:d,isColumnLayout:b,...u}){const[m,{width:g}]=Object(i.useResizeObserver)();let h;"number"==typeof g&&(h={"is-large":g>=480,"is-medium":g>=160&&g<480,"is-small":g<160});const O=o()("components-placeholder",l,h),j=o()("components-placeholder__fieldset",{"is-column-layout":b});return Object(a.createElement)("div",Object(c.a)({},u,{className:O}),m,p,d&&Object(a.createElement)("div",{className:"components-placeholder__preview"},d),Object(a.createElement)("div",{className:"components-placeholder__label"},Object(a.createElement)(r.a,{icon:e}),n),!!s&&Object(a.createElement)("div",{className:"components-placeholder__instructions"},s),Object(a.createElement)("div",{className:j},t))}},339:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var c=n(2),a=n(0),s=n(36),o=n(67),i=n(66);const r=()=>{const{needsShipping:e}=Object(i.a)(),{useShippingAsBilling:t,setUseShippingAsBilling:n}=Object(s.b)(),{billingAddress:r,setBillingAddress:l,shippingAddress:p,setShippingAddress:d}=Object(o.a)(),b=Object(a.useCallback)(e=>{l({email:e})},[l]),u=Object(a.useCallback)(e=>{l({phone:e})},[l]),m=Object(a.useCallback)(e=>{d({phone:e})},[d]);return{shippingAddress:p,billingAddress:r,setShippingAddress:d,setBillingAddress:l,setEmail:b,setBillingPhone:u,setShippingPhone:m,defaultAddressFields:c.defaultAddressFields,useShippingAsBilling:t,setUseShippingAsBilling:n,showShippingFields:e,showBillingFields:!e||!t}}},345:function(e,t,n){"use strict";var c=n(0),a=n(1),s=n(23),o=n(136),i=n(10),r=n(383),l=n(32),p=n(29),d=n(4),b=n.n(d),u=n(17),m=n(22),g=n(69),h=n(292),O=n(271),j=n(41),_=n(102),k=n(2);const w=e=>{const t=Object(k.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(u.decodeEntities)(e.name),value:e.rate_id,description:Object(c.createElement)(c.Fragment,null,Number.isFinite(t)&&Object(c.createElement)(_.a,{currency:Object(j.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,Object(u.decodeEntities)(e.delivery_time))}};var E=e=>{let{className:t="",noResultsMessage:n,onSelectRate:a,rates:s,renderOption:o=w,selectedRate:i}=e;const r=(null==i?void 0:i.rate_id)||"",[l,p]=Object(c.useState)(r);if(Object(c.useEffect)(()=>{r&&p(r)},[r]),0===s.length)return n;if(s.length>1)return Object(c.createElement)(h.a,{className:t,onChange:e=>{p(e),a(e)},selected:l,options:s.map(o)});const{label:d,secondaryLabel:b,description:u,secondaryDescription:m}=o(s[0]);return Object(c.createElement)(O.a,{label:d,secondaryLabel:b,description:u,secondaryDescription:m})};n(321);var f=e=>{let{packageId:t,className:n="",noResultsMessage:s,renderOption:o,packageData:r,collapsible:l=!1,collapse:p=!1,showItems:d=!1}=e;const{selectShippingRate:h}=Object(g.a)(),O=Object(c.createElement)(c.Fragment,null,(d||l)&&Object(c.createElement)("div",{className:"wc-block-components-shipping-rates-control__package-title"},r.name),d&&Object(c.createElement)("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(r.items).map(e=>{const t=Object(u.decodeEntities)(e.name),n=e.quantity;return Object(c.createElement)("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},Object(c.createElement)(m.a,{label:n>1?`${t} × ${n}`:""+t,screenReaderLabel:Object(a.sprintf)( +/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */ +Object(a._n)("%1$s (%2$d unit)","%1$s (%2$d units)",n,"woo-gutenberg-products-block"),t,n)}))}))),j=Object(c.createElement)(E,{className:n,noResultsMessage:s,rates:r.shipping_rates,onSelectRate:e=>h(e,t),selectedRate:r.shipping_rates.find(e=>e.selected),renderOption:o});return l?Object(c.createElement)(i.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!p,title:O},j):Object(c.createElement)("div",{className:b()("wc-block-components-shipping-rates-control__package",n)},O,j)};const v=e=>{let{packages:t,collapse:n,showItems:a,collapsible:s,noResultsMessage:o,renderOption:i}=e;return t.length?Object(c.createElement)(c.Fragment,null,t.map(e=>{let{package_id:r,...l}=e;return Object(c.createElement)(f,{key:r,packageId:r,packageData:l,collapsible:!!s,collapse:!!n,showItems:a||t.length>1,noResultsMessage:o,renderOption:i})})):null};t.a=e=>{let{shippingRates:t,isLoadingRates:n,className:d,collapsible:b=!1,noResultsMessage:u,renderOption:m,context:g}=e;Object(c.useEffect)(()=>{if(n)return;const e=Object(r.a)(t),c=Object(r.b)(t);1===e?Object(s.speak)(Object(a.sprintf)( +/* translators: %d number of shipping options found. */ +Object(a._n)("%d shipping option was found.","%d shipping options were found.",c,"woo-gutenberg-products-block"),c)):Object(s.speak)(Object(a.sprintf)( +/* translators: %d number of shipping packages packages. */ +Object(a._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",e,"woo-gutenberg-products-block"),e)+" "+Object(a.sprintf)( +/* translators: %d number of shipping options available. */ +Object(a._n)("%d shipping option was found","%d shipping options were found",c,"woo-gutenberg-products-block"),c))},[n,t]);const{extensions:h,receiveCart:O,...j}=Object(l.a)(),_={className:d,collapsible:b,noResultsMessage:u,renderOption:m,extensions:h,cart:j,components:{ShippingRatesControlPackage:f},context:g,shippingRates:t},{isEditor:k}=Object(p.a)();return Object(c.createElement)(o.a,{isLoading:n,screenReaderLabel:Object(a.__)("Loading shipping rates…","woo-gutenberg-products-block"),showSpinner:!0},k?Object(c.createElement)(v,{packages:t,noResultsMessage:u,renderOption:m}):Object(c.createElement)(c.Fragment,null,Object(c.createElement)(i.ExperimentalOrderShippingPackages.Slot,_),Object(c.createElement)(i.ExperimentalOrderShippingPackages,null,Object(c.createElement)(v,{showItems:t.length>1,packages:t,noResultsMessage:u,renderOption:m}))))}},383:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return a}));const c=e=>e.length,a=e=>e.reduce((function(e,t){return e+t.shipping_rates.length}),0)},385:function(e,t){},386:function(e,t){},434:function(e,t,n){"use strict";n.r(t);var c=n(0),a=n(4),s=n.n(a),o=n(119),i=n(298),r=n(36),l=n(339),p=n(1),d=n(66),b=n(345),u=n(383),m=n(41),g=n(102),h=n(29),O=n(17),j=n(76),_=n(2),k=n(332),w=n(42),E=n(117),f=n(13),v=Object(c.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(f.Path,{d:"M3 6.75C3 5.784 3.784 5 4.75 5H15V7.313l.05.027 5.056 2.73.394.212v3.468a1.75 1.75 0 01-1.75 1.75h-.012a2.5 2.5 0 11-4.975 0H9.737a2.5 2.5 0 11-4.975 0H3V6.75zM13.5 14V6.5H4.75a.25.25 0 00-.25.25V14h.965a2.493 2.493 0 011.785-.75c.7 0 1.332.287 1.785.75H13.5zm4.535 0h.715a.25.25 0 00.25-.25v-2.573l-4-2.16v4.568a2.487 2.487 0 011.25-.335c.7 0 1.332.287 1.785.75zM6.282 15.5a1.002 1.002 0 00.968 1.25 1 1 0 10-.968-1.25zm9 0a1 1 0 101.937.498 1 1 0 00-1.938-.498z"}));n(386);var N=()=>Object(c.createElement)(k.a,{icon:Object(c.createElement)(E.a,{icon:v}),label:Object(p.__)("Shipping options","woo-gutenberg-products-block"),className:"wc-block-checkout__no-shipping-placeholder"},Object(c.createElement)("span",{className:"wc-block-checkout__no-shipping-placeholder-description"},Object(p.__)("Your store does not have any Shipping Options configured. Once you have added your Shipping Options they will appear here.","woo-gutenberg-products-block")),Object(c.createElement)(w.a,{isSecondary:!0,href:_.ADMIN_URL+"admin.php?page=wc-settings&tab=shipping",target:"_blank",rel:"noopener noreferrer"},Object(p.__)("Configure Shipping Options","woo-gutenberg-products-block")));n(385);const y=e=>{const t=Object(_.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(O.decodeEntities)(e.name),value:e.rate_id,description:Object(O.decodeEntities)(e.description),secondaryLabel:Object(c.createElement)(g.a,{currency:Object(m.getCurrencyFromPriceResponse)(e),value:t}),secondaryDescription:Object(O.decodeEntities)(e.delivery_time)}};var S=()=>{const{isEditor:e}=Object(h.a)(),{shippingRates:t,needsShipping:n,isLoadingRates:a,hasCalculatedShipping:o}=Object(d.a)();if(!n)return null;const i=Object(u.a)(t);return e||o||i?Object(c.createElement)(c.Fragment,null,e&&!i?Object(c.createElement)(N,null):Object(c.createElement)(b.a,{noResultsMessage:Object(c.createElement)(j.a,{isDismissible:!1,className:s()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(p.__)("There are no shipping options available. Please check your shipping address.","woo-gutenberg-products-block")),renderOption:y,shippingRates:t,isLoadingRates:a,context:"woocommerce/checkout"})):Object(c.createElement)("p",null,Object(p.__)("Shipping options will be displayed here after entering your full shipping address.","woo-gutenberg-products-block"))},R=n(279),C={...Object(R.a)({defaultTitle:Object(p.__)("Shipping options","woo-gutenberg-products-block"),defaultDescription:""}),allowCreateAccount:{type:"boolean",default:!1},className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}};t.default=Object(o.withFilteredAttributes)(C)(e=>{let{title:t,description:n,showStepNumber:a,children:o,className:p}=e;const{isProcessing:d}=Object(r.b)(),{showShippingFields:b}=Object(l.a)();return b?Object(c.createElement)(i.a,{id:"shipping-option",disabled:d,className:s()("wc-block-checkout__shipping-option",p),title:t,description:n,showStepNumber:a},Object(c.createElement)(S,null),o):null})}}]); \ No newline at end of file diff --git a/build/checkout-blocks/terms-frontend.js b/build/checkout-blocks/terms-frontend.js new file mode 100644 index 00000000000..ac9830ef538 --- /dev/null +++ b/build/checkout-blocks/terms-frontend.js @@ -0,0 +1,5 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[46],{278:function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return a}));var o=n(31),c=n(207);const r=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{paymentMethods:t,expressPaymentMethods:n,paymentMethodsInitialized:r,expressPaymentMethodsInitialized:s}=Object(c.b)(),a=Object(o.a)(t),i=Object(o.a)(n);return{paymentMethods:e?i:a,isInitialized:e?s:r}},s=()=>r(!1),a=()=>r(!0)},390:function(e,t){},391:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n(1),c=n(36),r=n(207),s=n(278);const a=()=>{const{onSubmit:e,isCalculating:t,isBeforeProcessing:n,isProcessing:a,isAfterProcessing:i,isComplete:d,hasError:u}=Object(c.b)(),{paymentMethods:b={}}=Object(s.b)(),{activePaymentMethod:l,currentStatus:g}=Object(r.b)(),m=b[l]||{},p=a||i||n,h=d&&!u;return{submitButtonText:(null==m?void 0:m.placeOrderButtonLabel)||Object(o.__)("Place Order","woo-gutenberg-products-block"),onSubmit:e,isCalculating:t,isDisabled:a||g.isDoingExpressPayment,waitingForProcessing:p,waitingForRedirect:h}}},458:function(e,t,n){"use strict";n.r(t);var o=n(0),c=n(1),r=n(4),s=n.n(r),a=n(10),i=n(391),d=n(9),u=n(48);const b=u.j?`${Object(c.__)("Terms and Conditions","woo-gutenberg-products-block")}`:Object(c.__)("Terms and Conditions","woo-gutenberg-products-block"),l=u.f?`${Object(c.__)("Privacy Policy","woo-gutenberg-products-block")}`:Object(c.__)("Privacy Policy","woo-gutenberg-products-block"),g=Object(c.sprintf)( +/* translators: %1$s terms page link, %2$s privacy page link. */ +Object(c.__)("By proceeding with your purchase you agree to our %1$s and %2$s","woo-gutenberg-products-block"),b,l),m=Object(c.sprintf)( +/* translators: %1$s terms page link, %2$s privacy page link. */ +Object(c.__)("You must accept our %1$s and %2$s to continue with your purchase.","woo-gutenberg-products-block"),b,l);n(390),t.default=Object(d.withInstanceId)(e=>{let{text:t,checkbox:n,instanceId:r,validation:d,className:u}=e;const[b,l]=Object(o.useState)(!1),{isDisabled:p}=Object(i.a)(),h="terms-and-conditions-"+r,{getValidationError:j,setValidationErrors:O,clearValidationError:_}=d,k=j(h)||{},w=k.message&&!k.hidden;return Object(o.useEffect)(()=>{if(n)return b?_(h):O({[h]:{message:Object(c.__)("Please read and accept the terms and conditions.","woo-gutenberg-products-block"),hidden:!0}}),()=>{_(h)}},[n,b,h,_,O]),Object(o.createElement)("div",{className:s()("wc-block-checkout__terms",{"wc-block-checkout__terms--disabled":p},u)},n?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.CheckboxControl,{id:"terms-and-conditions",checked:b,onChange:()=>l(e=>!e),hasError:w,disabled:p},Object(o.createElement)("span",{dangerouslySetInnerHTML:{__html:t||m}}))):Object(o.createElement)("span",{dangerouslySetInnerHTML:{__html:t||g}}))})}}]); \ No newline at end of file diff --git a/build/checkout-blocks/totals-frontend.js b/build/checkout-blocks/totals-frontend.js new file mode 100644 index 00000000000..f3d3d86a011 --- /dev/null +++ b/build/checkout-blocks/totals-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[47],{374:function(e,c,t){"use strict";var n=t(0),s=t(5),a=t(4),r=t.n(a);const o=Object(s.forwardRef)((e,c)=>{let{children:t,className:s=""}=e;return Object(n.createElement)("div",{ref:c,className:r()("wc-block-components-sidebar",s)},t)});c.a=o},394:function(e,c){},421:function(e,c,t){"use strict";t.r(c);var n=t(0),s=t(4),a=t.n(s),r=t(374);t(394),c.default=e=>{let{children:c,className:t}=e;return Object(n.createElement)(r.a,{className:a()("wc-block-checkout__sidebar",t)},c)}}}]); \ No newline at end of file diff --git a/build/checkout-contact-information-block/block.json b/build/checkout-contact-information-block/block.json new file mode 100644 index 00000000000..b8a4e6a8b96 --- /dev/null +++ b/build/checkout-contact-information-block/block.json @@ -0,0 +1,28 @@ +{ + "name": "woocommerce/checkout-contact-information-block", + "version": "1.0.0", + "title": "Contact Information", + "description": "Collect your customer's contact information.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/checkout-fields-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-express-payment-block/block.json b/build/checkout-express-payment-block/block.json new file mode 100644 index 00000000000..6c14d00aefe --- /dev/null +++ b/build/checkout-express-payment-block/block.json @@ -0,0 +1,32 @@ +{ + "name": "woocommerce/checkout-express-payment-block", + "version": "1.0.0", + "title": "Express Checkout", + "description": "Provide an express payment option for your customers.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/checkout-fields-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-fields-block/block.json b/build/checkout-fields-block/block.json new file mode 100644 index 00000000000..0f737f001a4 --- /dev/null +++ b/build/checkout-fields-block/block.json @@ -0,0 +1,32 @@ +{ + "name": "woocommerce/checkout-fields-block", + "version": "1.0.0", + "title": "Checkout Fields", + "description": "Column containing checkout address fields.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/checkout" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-frontend.asset.php b/build/checkout-frontend.asset.php new file mode 100644 index 00000000000..d9a29df7858 --- /dev/null +++ b/build/checkout-frontend.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'cbbf026d4326ee8375298e159026b02b'); \ No newline at end of file diff --git a/build/checkout-frontend.js b/build/checkout-frontend.js new file mode 100644 index 00000000000..450691b3885 --- /dev/null +++ b/build/checkout-frontend.js @@ -0,0 +1,6 @@ +!function(e){function t(t){for(var r,o,s=t[0],c=t[1],a=0,l=[];a{let{imageUrl:t=i.l+"/block-error.svg",header:r=Object(a.__)("Oops!","woo-gutenberg-products-block"),text:n=Object(a.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:c=Object(a.__)("Error:","woo-gutenberg-products-block"),button:l,showErrorBlock:u=!0}=e;return u?Object(s.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(s.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(s.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(s.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),n&&Object(s.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},n),o&&Object(s.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},c?c+" ":"",o),l&&Object(s.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};r(35);class u extends c.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(s.createElement)(s.Fragment,null,Object(s.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:n=!0,text:o,errorMessagePrefix:c,renderError:a,button:i}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof a?a({errorMessage:u}):Object(s.createElement)(l,{showErrorBlock:n,errorMessage:r?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:c,button:i}):this.props.children}}t.a=u},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){e.exports=window.wp.htmlEntities},function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return o}));const n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return n(e)&&t in e}},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},,,,function(e,t){e.exports=window.wp.a11y},function(e,t,r){"use strict";(function(e){var n=r(0);r(37);const o=Object(n.createContext)({slots:{},fills:{},registerSlot:()=>{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,r(55))},function(e,t){e.exports=window.wp.deprecated},,function(e,t){e.exports=window.wp.apiFetch},,function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(0);r(7);const o=Object(n.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),s=()=>Object(n.useContext)(o)},function(e,t,r){"use strict";r.d(t,"c",(function(){return s})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return l})),r.d(t,"d",(function(){return d}));var n=r(18);let o,s;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(o||(o={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(s||(s={}));const c=(e,t)=>Object(n.a)(e)&&"type"in e&&e.type===t,a=e=>c(e,o.SUCCESS),i=e=>c(e,o.ERROR),l=e=>c(e,o.FAIL),u=e=>!Object(n.a)(e)||void 0===e.retry||!0===e.retry,d=()=>({responseTypes:o,noticeContexts:s,shouldRetry:u,isSuccessResponse:a,isErrorResponse:i,isFailResponse:l})},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=r(11),s=r.n(o);function c(e){const t=Object(n.useRef)(e);return s()(e,t.current)||(t.current=e),t.current}},function(e,t,r){"use strict";r.d(t,"a",(function(){return E}));var n=r(3),o=r(0),s=r(6),c=r(7),a=r(17),i=r(118),l=r(29),u=r(70);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(c.dispatch)(s.CART_STORE_KEY).invalidateResolutionForStore()},p=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},m=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.b)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.b)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),p),[])},f={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},h={...f,email:""},b={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:s.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},g=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,r]=e;return[t,Object(a.decodeEntities)(r)]})),y={cartCoupons:s.EMPTY_CART_COUPONS,cartItems:s.EMPTY_CART_ITEMS,cartFees:s.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:b,cartIsLoading:!0,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:f,shippingRates:s.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:s.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:s.EMPTY_EXTENSIONS},E=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:r}=Object(l.a)(),a=null==r?void 0:r.previewCart,{shouldSelect:u}=e,d=Object(o.useRef)();m();const p=Object(c.useSelect)((e,r)=>{let{dispatch:n}=r;if(!u)return y;if(t)return{cartCoupons:a.coupons,cartItems:a.items,cartFees:a.fees,cartItemsCount:a.items_count,cartItemsWeight:a.items_weight,cartNeedsPayment:a.needs_payment,cartNeedsShipping:a.needs_shipping,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:a.totals,cartIsLoading:!1,cartErrors:s.EMPTY_CART_ERRORS,billingData:h,billingAddress:h,shippingAddress:f,extensions:s.EMPTY_EXTENSIONS,shippingRates:a.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:a.has_calculated_shipping,paymentRequirements:a.paymentRequirements,receiveCart:"function"==typeof(null==a?void 0:a.receiveCart)?a.receiveCart:()=>{}};const o=e(s.CART_STORE_KEY),c=o.getCartData(),l=o.getCartErrors(),d=o.getCartTotals(),p=!o.hasFinishedResolution("getCartData"),m=o.isCustomerDataUpdating(),{receiveCart:b}=n(s.CART_STORE_KEY),E=g(c.billingAddress),_=c.needsShipping?g(c.shippingAddress):E,O=c.fees.length>0?c.fees.map(e=>g(e)):s.EMPTY_CART_FEES;return{cartCoupons:c.coupons.length>0?c.coupons.map(e=>({...e,label:e.code})):s.EMPTY_CART_COUPONS,cartItems:c.items,cartFees:O,cartItemsCount:c.itemsCount,cartItemsWeight:c.itemsWeight,cartNeedsPayment:c.needsPayment,cartNeedsShipping:c.needsShipping,cartItemErrors:c.errors,cartTotals:d,cartIsLoading:p,cartErrors:l,billingData:Object(i.a)(E),billingAddress:Object(i.a)(E),shippingAddress:Object(i.a)(_),extensions:c.extensions,shippingRates:c.shippingRates,isLoadingRates:m,cartHasCalculatedShipping:c.hasCalculatedShipping,paymentRequirements:c.paymentRequirements,receiveCart:b}},[u]);return d.current&&Object(n.isEqual)(d.current,p)||(d.current=p),d.current}},,function(e,t,r){"use strict";var n=r(4),o=r.n(n),s=r(0);t.a=Object(s.forwardRef)((function({as:e="div",className:t,...r},n){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(s.createElement)(e,t)}({as:e,className:o()("components-visually-hidden",t),...r,ref:n})}))},function(e,t){},function(e,t,r){"use strict";r.d(t,"b",(function(){return A})),r.d(t,"a",(function(){return P}));var n=r(0),o=r(1),s=r(61),c=r(25),a=r.n(c),i=r(45),l=r(18),u=r(7);let d;!function(e){e.SET_IDLE="set_idle",e.SET_PRISTINE="set_pristine",e.SET_REDIRECT_URL="set_redirect_url",e.SET_COMPLETE="set_checkout_complete",e.SET_BEFORE_PROCESSING="set_before_processing",e.SET_AFTER_PROCESSING="set_after_processing",e.SET_PROCESSING_RESPONSE="set_processing_response",e.SET_PROCESSING="set_checkout_is_processing",e.SET_HAS_ERROR="set_checkout_has_error",e.SET_NO_ERROR="set_checkout_no_error",e.SET_CUSTOMER_ID="set_checkout_customer_id",e.SET_ORDER_ID="set_checkout_order_id",e.SET_ORDER_NOTES="set_checkout_order_notes",e.INCREMENT_CALCULATING="increment_calculating",e.DECREMENT_CALCULATING="decrement_calculating",e.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS="set_shipping_address_as_billing_address",e.SET_SHOULD_CREATE_ACCOUNT="set_should_create_account",e.SET_EXTENSION_DATA="set_extension_data"}(d||(d={}));const p=()=>({type:d.SET_IDLE}),m=e=>({type:d.SET_REDIRECT_URL,redirectUrl:e}),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:d.SET_COMPLETE,data:e}},h=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:e?d.SET_HAS_ERROR:d.SET_NO_ERROR}};var b=r(2),g=r(118);let y;!function(e){e.PRISTINE="pristine",e.IDLE="idle",e.PROCESSING="processing",e.COMPLETE="complete",e.BEFORE_PROCESSING="before_processing",e.AFTER_PROCESSING="after_processing"}(y||(y={}));const E={order_id:0,customer_id:0,billing_address:{},shipping_address:{},...Object(b.getSetting)("checkoutData",{})||{}},_={redirectUrl:"",status:y.PRISTINE,hasError:!1,calculatingCount:0,orderId:E.order_id,orderNotes:"",customerId:E.customer_id,useShippingAsBilling:Object(g.b)(E.billing_address,E.shipping_address),shouldCreateAccount:!1,processingResponse:null,extensionData:{}},O=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_,{redirectUrl:t,type:r,customerId:n,orderId:o,orderNotes:s,extensionData:c,useShippingAsBilling:a,shouldCreateAccount:i,data:l}=arguments.length>1?arguments[1]:void 0,u=e;switch(r){case d.SET_PRISTINE:u=_;break;case d.SET_IDLE:u=e.status!==y.IDLE?{...e,status:y.IDLE}:e;break;case d.SET_REDIRECT_URL:u=void 0!==t&&t!==e.redirectUrl?{...e,redirectUrl:t}:e;break;case d.SET_PROCESSING_RESPONSE:u={...e,processingResponse:l};break;case d.SET_COMPLETE:u=e.status!==y.COMPLETE?{...e,status:y.COMPLETE,redirectUrl:"string"==typeof(null==l?void 0:l.redirectUrl)?l.redirectUrl:e.redirectUrl}:e;break;case d.SET_PROCESSING:u=e.status!==y.PROCESSING?{...e,status:y.PROCESSING,hasError:!1}:e,u=!1===u.hasError?u:{...u,hasError:!1};break;case d.SET_BEFORE_PROCESSING:u=e.status!==y.BEFORE_PROCESSING?{...e,status:y.BEFORE_PROCESSING,hasError:!1}:e;break;case d.SET_AFTER_PROCESSING:u=e.status!==y.AFTER_PROCESSING?{...e,status:y.AFTER_PROCESSING}:e;break;case d.SET_HAS_ERROR:u=e.hasError?e:{...e,hasError:!0},u=e.status===y.PROCESSING||e.status===y.BEFORE_PROCESSING?{...u,status:y.IDLE}:u;break;case d.SET_NO_ERROR:u=e.hasError?{...e,hasError:!1}:e;break;case d.INCREMENT_CALCULATING:u={...e,calculatingCount:e.calculatingCount+1};break;case d.DECREMENT_CALCULATING:u={...e,calculatingCount:Math.max(0,e.calculatingCount-1)};break;case d.SET_CUSTOMER_ID:u=void 0!==n?{...e,customerId:n}:e;break;case d.SET_ORDER_ID:u=void 0!==o?{...e,orderId:o}:e;break;case d.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS:void 0!==a&&a!==e.useShippingAsBilling&&(u={...e,useShippingAsBilling:a});break;case d.SET_SHOULD_CREATE_ACCOUNT:void 0!==i&&i!==e.shouldCreateAccount&&(u={...e,shouldCreateAccount:i});break;case d.SET_ORDER_NOTES:void 0!==s&&e.orderNotes!==s&&(u={...e,orderNotes:s});break;case d.SET_EXTENSION_DATA:void 0!==c&&e.extensionData!==c&&(u={...e,extensionData:c})}return u!==e&&r!==d.SET_PRISTINE&&u.status===y.PRISTINE&&(u.status=y.IDLE),u};var v=r(17),k=r(94),S=r(204);var w=r(206),j=r(199),C=r(59),R=r(30),T=r(80);const x=Object(n.createContext)({dispatchActions:{resetCheckout:()=>{},setRedirectUrl:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},incrementCalculating:()=>{},decrementCalculating:()=>{},setCustomerId:e=>{},setOrderId:e=>{},setOrderNotes:e=>{},setExtensionData:e=>{}},onSubmit:()=>{},isComplete:!1,isIdle:!1,isCalculating:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,redirectUrl:"",orderId:0,orderNotes:"",customerId:0,onCheckoutAfterProcessingWithSuccess:()=>()=>{},onCheckoutAfterProcessingWithError:()=>()=>{},onCheckoutBeforeProcessing:()=>()=>{},onCheckoutValidationBeforeProcessing:()=>()=>{},hasOrder:!1,isCart:!1,useShippingAsBilling:!1,setUseShippingAsBilling:e=>{},shouldCreateAccount:!1,setShouldCreateAccount:e=>{},extensionData:{}}),A=()=>Object(n.useContext)(x),P=e=>{let{children:t,redirectUrl:r,isCart:c=!1}=e;_.redirectUrl=r;const[b,g]=Object(n.useReducer)(O,_),{setValidationErrors:E}=Object(j.b)(),{createErrorNotice:A}=Object(u.useDispatch)("core/notices"),{dispatchCheckoutEvent:P}=Object(C.a)(),M=b.calculatingCount>0,{isSuccessResponse:N,isErrorResponse:I,isFailResponse:D,shouldRetry:L}=Object(R.d)(),{checkoutNotices:F,paymentNotices:U,expressPaymentNotices:V}=(()=>{const{noticeContexts:e}=Object(R.d)();return{checkoutNotices:Object(u.useSelect)(e=>e("core/notices").getNotices("wc/checkout"),[]),expressPaymentNotices:Object(u.useSelect)(t=>t("core/notices").getNotices(e.EXPRESS_PAYMENTS),[e.EXPRESS_PAYMENTS]),paymentNotices:Object(u.useSelect)(t=>t("core/notices").getNotices(e.PAYMENTS),[e.PAYMENTS])}})(),[B,H]=Object(n.useReducer)(k.b,{}),z=Object(n.useRef)(B),{onCheckoutAfterProcessingWithSuccess:G,onCheckoutAfterProcessingWithError:q,onCheckoutValidationBeforeProcessing:Y}=(e=>Object(n.useMemo)(()=>({onCheckoutAfterProcessingWithSuccess:Object(S.a)("checkout_after_processing_with_success",e),onCheckoutAfterProcessingWithError:Object(S.a)("checkout_after_processing_with_error",e),onCheckoutValidationBeforeProcessing:Object(S.a)("checkout_validation_before_processing",e)}),[e]))(H);Object(n.useEffect)(()=>{z.current=B},[B]);const $=Object(n.useMemo)(()=>function(){return a()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidationBeforeProcessing",plugin:"WooCommerce Blocks"}),Y(...arguments)},[Y]),W=Object(n.useMemo)(()=>({resetCheckout:()=>{g({type:d.SET_PRISTINE})},setRedirectUrl:e=>{g(m(e))},setHasError:e=>{g(h(e))},incrementCalculating:()=>{g({type:d.INCREMENT_CALCULATING})},decrementCalculating:()=>{g({type:d.DECREMENT_CALCULATING})},setCustomerId:e=>{var t;g((t=e,{type:d.SET_CUSTOMER_ID,customerId:t}))},setOrderId:e=>{g((e=>({type:d.SET_ORDER_ID,orderId:e}))(e))},setOrderNotes:e=>{g((e=>({type:d.SET_ORDER_NOTES,orderNotes:e}))(e))},setExtensionData:e=>{g((e=>({type:d.SET_EXTENSION_DATA,extensionData:e}))(e))},setAfterProcessing:e=>{const t=(e=>{const t={message:"",paymentStatus:"",redirectUrl:"",paymentDetails:{}};return"payment_result"in e&&(t.paymentStatus=e.payment_result.payment_status,t.redirectUrl=e.payment_result.redirect_url,e.payment_result.hasOwnProperty("payment_details")&&Array.isArray(e.payment_result.payment_details)&&e.payment_result.payment_details.forEach(e=>{let{key:r,value:n}=e;t.paymentDetails[r]=Object(v.decodeEntities)(n)})),"message"in e&&(t.message=Object(v.decodeEntities)(e.message)),!t.message&&"data"in e&&"status"in e.data&&e.data.status>299&&(t.message=Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")),t})(e);var r;g(m((null==t?void 0:t.redirectUrl)||"")),g((r=t,{type:d.SET_PROCESSING_RESPONSE,data:r})),g({type:d.SET_AFTER_PROCESSING})}}),[]);Object(n.useEffect)(()=>{b.status===y.BEFORE_PROCESSING&&(Object(T.b)("error"),Object(w.a)(z.current,"checkout_validation_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:r}=e;A(t,{context:"wc/checkout"}),E(r)}),g(p()),g(h())):g({type:d.SET_PROCESSING})}))},[b.status,E,A,g]);const K=Object(s.a)(b.status),X=Object(s.a)(b.hasError);Object(n.useEffect)(()=>{if((b.status!==K||b.hasError!==X)&&b.status===y.AFTER_PROCESSING){const e={redirectUrl:b.redirectUrl,orderId:b.orderId,customerId:b.customerId,orderNotes:b.orderNotes,processingResponse:b.processingResponse};b.hasError?Object(w.b)(z.current,"checkout_after_processing_with_error",e).then(t=>{const r=(e=>{let t=null;return e.forEach(e=>{if((I(e)||D(e))&&e.message&&Object(i.a)(e.message)){const r=e.messageContext&&Object(i.a)(e.messageContent)?{context:e.messageContext}:void 0;t=e,A(e.message,r)}}),t})(t);if(null!==r)L(r)?g(p()):g(f(r));else{if(!(F.some(e=>"error"===e.status)||V.some(e=>"error"===e.status)||U.some(e=>"error"===e.status))){var n;const t=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");A(t,{id:"checkout",context:"wc/checkout"})}g(p())}}):Object(w.b)(z.current,"checkout_after_processing_with_success",e).then(e=>{let t=null,r=null;if(e.forEach(e=>{N(e)&&(t=e),(I(e)||D(e))&&(r=e)}),t&&!r)g(f(t));else if(Object(l.a)(r)){if(r.message&&Object(i.a)(r.message)){const e=r.messageContext&&Object(i.a)(r.messageContext)?{context:r.messageContext}:void 0;A(r.message,e)}L(r)?g(h(!0)):g(f(r))}else g(f())})}},[b.status,b.hasError,b.redirectUrl,b.orderId,b.customerId,b.orderNotes,b.processingResponse,K,X,W,A,I,D,N,L,F,V,U]);const J={onSubmit:Object(n.useCallback)(()=>{P("submit"),g({type:d.SET_BEFORE_PROCESSING})},[P]),isComplete:b.status===y.COMPLETE,isIdle:b.status===y.IDLE,isCalculating:M,isProcessing:b.status===y.PROCESSING,isBeforeProcessing:b.status===y.BEFORE_PROCESSING,isAfterProcessing:b.status===y.AFTER_PROCESSING,hasError:b.hasError,redirectUrl:b.redirectUrl,onCheckoutBeforeProcessing:$,onCheckoutValidationBeforeProcessing:Y,onCheckoutAfterProcessingWithSuccess:G,onCheckoutAfterProcessingWithError:q,dispatchActions:W,isCart:c,orderId:b.orderId,hasOrder:!!b.orderId,customerId:b.customerId,orderNotes:b.orderNotes,useShippingAsBilling:b.useShippingAsBilling,setUseShippingAsBilling:e=>{return g((t=e,{type:d.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS,useShippingAsBilling:t}));var t},shouldCreateAccount:b.shouldCreateAccount,setShouldCreateAccount:e=>{return g((t=e,{type:d.SET_SHOULD_CREATE_ACCOUNT,shouldCreateAccount:t}));var t},extensionData:b.extensionData};return Object(n.createElement)(x.Provider,{value:J},t)}},function(e,t){e.exports=window.wp.warning},function(e,t,r){"use strict";var n=r(8),o=r(0),s=r(13),c=function({icon:e,className:t,...r}){const s=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(o.createElement)("span",Object(n.a)({className:s},r))};t.a=function({icon:e=null,size:t=24,...r}){if("string"==typeof e)return Object(o.createElement)(c,Object(n.a)({icon:e},r));if(Object(o.isValidElement)(e)&&c===e.type)return Object(o.cloneElement)(e,{...r});if("function"==typeof e)return e.prototype instanceof o.Component?Object(o.createElement)(e,{size:t,...r}):e({size:t,...r});if(e&&("svg"===e.type||e.type===s.SVG)){const n={width:t,height:t,...e.props,...r};return Object(o.createElement)(s.SVG,n)}return Object(o.isValidElement)(e)?Object(o.cloneElement)(e,{size:t,...r}):e}},,,function(e,t){e.exports=window.wc.priceFormat},function(e,t,r){"use strict";var n=r(8),o=r(0),s=r(4),c=r.n(s),a=r(3),i=r(25),l=r.n(i),u=r(9),d=r(44),p=r(71),m=r(1);function f(e,t,r){const{defaultView:n}=t,{frameElement:o}=n;if(!o||t===r.ownerDocument)return e;const s=o.getBoundingClientRect();return new n.DOMRect(e.left+s.left,e.top+s.top,e.width,e.height)}let h=0;function b(e){const t=document.scrollingElement||document.body;e&&(h=t.scrollTop);const r=e?"add":"remove";t.classList[r]("lockscroll"),document.documentElement.classList[r]("lockscroll"),e||(t.scrollTop=h)}let g=0;function y(){return Object(o.useEffect)(()=>(0===g&&b(!0),++g,()=>{1===g&&b(!1),--g}),[]),null}var E=r(24);function _(e){const t=Object(o.useContext)(E.a),r=t.slots[e]||{},n=t.fills[e],s=Object(o.useMemo)(()=>n||[],[n]);return{...r,updateSlot:Object(o.useCallback)(r=>{t.updateSlot(e,r)},[e,t.updateSlot]),unregisterSlot:Object(o.useCallback)(r=>{t.unregisterSlot(e,r)},[e,t.unregisterSlot]),fills:s,registerFill:Object(o.useCallback)(r=>{t.registerFill(e,r)},[e,t.registerFill]),unregisterFill:Object(o.useCallback)(r=>{t.unregisterFill(e,r)},[e,t.unregisterFill])}}var O=Object(o.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function v({name:e,children:t,registerFill:r,unregisterFill:n}){const s=(e=>{const{getSlot:t,subscribe:r}=Object(o.useContext)(O),[n,s]=Object(o.useState)(t(e));return Object(o.useEffect)(()=>(s(t(e)),r(()=>{s(t(e))})),[e]),n})(e),c=Object(o.useRef)({name:e,children:t});return Object(o.useLayoutEffect)(()=>(r(e,c.current),()=>n(e,c.current)),[]),Object(o.useLayoutEffect)(()=>{c.current.children=t,s&&s.forceUpdate()},[t]),Object(o.useLayoutEffect)(()=>{e!==c.current.name&&(n(c.current.name,c.current),c.current.name=e,r(e,c.current))},[e]),s&&s.node?(Object(a.isFunction)(t)&&(t=t(s.props.fillProps)),Object(o.createPortal)(t,s.node)):null}var k=e=>Object(o.createElement)(O.Consumer,null,({registerFill:t,unregisterFill:r})=>Object(o.createElement)(v,Object(n.a)({},e,{registerFill:t,unregisterFill:r})));class S extends o.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:r,registerSlot:n}=this.props;e.name!==t&&(r(e.name),n(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:r={},getFills:n}=this.props,s=Object(a.map)(n(t,this),e=>{const t=Object(a.isFunction)(e.children)?e.children(r):e.children;return o.Children.map(t,(e,t)=>{if(!e||Object(a.isString)(e))return e;const r=e.key||t;return Object(o.cloneElement)(e,{key:r})})}).filter(Object(a.negate)(o.isEmptyElement));return Object(o.createElement)(o.Fragment,null,Object(a.isFunction)(e)?e(s):s)}}var w=e=>Object(o.createElement)(O.Consumer,null,({registerSlot:t,unregisterSlot:r,getFills:s})=>Object(o.createElement)(S,Object(n.a)({},e,{registerSlot:t,unregisterSlot:r,getFills:s})));function j(){const[,e]=Object(o.useState)({}),t=Object(o.useRef)(!0);return Object(o.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function C({name:e,children:t}){const r=_(e),n=Object(o.useRef)({rerender:j()});return Object(o.useEffect)(()=>(r.registerFill(n),()=>{r.unregisterFill(n)}),[r.registerFill,r.unregisterFill]),r.ref&&r.ref.current?("function"==typeof t&&(t=t(r.fillProps)),Object(o.createPortal)(t,r.ref.current)):null}var R=Object(o.forwardRef)((function({name:e,fillProps:t={},as:r="div",...s},c){const a=Object(o.useContext)(E.a),i=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(a.registerSlot(e,i,t),()=>{a.unregisterSlot(e,i)}),[a.registerSlot,a.unregisterSlot,e]),Object(o.useLayoutEffect)(()=>{a.updateSlot(e,t)}),Object(o.createElement)(r,Object(n.a)({ref:Object(u.useMergeRefs)([c,i])},s))}));function T(e){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(k,e),Object(o.createElement)(C,e))}r(11),o.Component;const x=Object(o.forwardRef)(({bubblesVirtually:e,...t},r)=>e?Object(o.createElement)(R,Object(n.a)({},t,{ref:r})):Object(o.createElement)(w,t));function A(e){return"appear"===e?"top":"left"}function P(e,t){const{paddingTop:r,paddingBottom:n,paddingLeft:o,paddingRight:s}=(c=t).ownerDocument.defaultView.getComputedStyle(c);var c;const a=r?parseInt(r,10):0,i=n?parseInt(n,10):0,l=o?parseInt(o,10):0,u=s?parseInt(s,10):0;return{x:e.left+l,y:e.top+a,width:e.width-l-u,height:e.height-a-i,left:e.left+l,right:e.right-u,top:e.top+a,bottom:e.bottom-i}}function M(e,t,r){r?e.getAttribute(t)!==r&&e.setAttribute(t,r):e.hasAttribute(t)&&e.removeAttribute(t)}function N(e,t,r=""){e.style[t]!==r&&(e.style[t]=r)}function I(e,t,r){r?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const D=Object(o.forwardRef)(({headerTitle:e,onClose:t,children:r,className:s,noArrow:a=!0,isAlternate:i,position:h="bottom right",range:b,focusOnMount:g="firstElement",anchorRef:E,shouldAnchorIncludePadding:O,anchorRect:v,getAnchorRect:k,expandOnMobile:S,animate:w=!0,onClickOutside:j,onFocusOutside:C,__unstableStickyBoundaryElement:R,__unstableSlotName:x="Popover",__unstableObserveElement:D,__unstableBoundaryParent:L,__unstableForcePosition:F,__unstableForceXAlignment:U,...V},B)=>{const H=Object(o.useRef)(null),z=Object(o.useRef)(null),G=Object(o.useRef)(),q=Object(u.useViewportMatch)("medium","<"),[Y,W]=Object(o.useState)(),K=_(x),X=S&&q,[J,Q]=Object(u.useResizeObserver)();a=X||a,Object(o.useLayoutEffect)(()=>{if(X)return I(G.current,"is-without-arrow",a),I(G.current,"is-alternate",i),M(G.current,"data-x-axis"),M(G.current,"data-y-axis"),N(G.current,"top"),N(G.current,"left"),N(z.current,"maxHeight"),void N(z.current,"maxWidth");const e=()=>{if(!G.current||!z.current)return;let e=function(e,t,r,n=!1,o,s){if(t)return t;if(r){if(!e.current)return;const t=r(e.current);return f(t,t.ownerDocument||e.current.ownerDocument,s)}if(!1!==n){if(!(n&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==n?void 0:n.cloneRange))return f(Object(d.getRectangleFromRange)(n),n.endContainer.ownerDocument,s);if("function"==typeof(null==n?void 0:n.getBoundingClientRect)){const e=f(n.getBoundingClientRect(),n.ownerDocument,s);return o?e:P(e,n)}const{top:e,bottom:t}=n,r=e.getBoundingClientRect(),c=t.getBoundingClientRect(),a=f(new window.DOMRect(r.left,r.top,r.width,c.bottom-r.top),e.ownerDocument,s);return o?a:P(a,n)}if(!e.current)return;const{parentNode:c}=e.current,a=c.getBoundingClientRect();return o?a:P(a,c)}(H,v,k,E,O,G.current);if(!e)return;const{offsetParent:t,ownerDocument:r}=G.current;let n,o=0;if(t&&t!==r.body){const r=t.getBoundingClientRect();o=r.top,e=new window.DOMRect(e.left-r.left,e.top-r.top,e.width,e.height)}var s;L&&(n=null===(s=G.current.closest(".popover-slot"))||void 0===s?void 0:s.parentNode);const c=Q.height?Q:z.current.getBoundingClientRect(),{popoverTop:l,popoverLeft:u,xAxis:p,yAxis:b,contentHeight:g,contentWidth:y}=function(e,t,r="top",n,o,s,c,a,i){const[l,u="center",d]=r.split(" "),p=function(e,t,r,n,o,s,c,a){const{height:i}=t;if(o){const t=o.getBoundingClientRect().top+i-c;if(e.top<=t)return{yAxis:r,popoverTop:Math.min(e.bottom,t)}}let l=e.top+e.height/2;"bottom"===n?l=e.bottom:"top"===n&&(l=e.top);const u={popoverTop:l,contentHeight:(l-i/2>0?i/2:l)+(l+i/2>window.innerHeight?window.innerHeight-l:i/2)},d={popoverTop:e.top,contentHeight:e.top-10-i>0?i:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+i>window.innerHeight?window.innerHeight-10-e.bottom:i};let m,f=r,h=null;if(!o&&!a)if("middle"===r&&u.contentHeight===i)f="middle";else if("top"===r&&d.contentHeight===i)f="top";else if("bottom"===r&&p.contentHeight===i)f="bottom";else{f=d.contentHeight>p.contentHeight?"top":"bottom";const e="top"===f?d.contentHeight:p.contentHeight;h=e!==i?e:null}return m="middle"===f?u.popoverTop:"top"===f?d.popoverTop:p.popoverTop,{yAxis:f,popoverTop:m,contentHeight:h}}(e,t,l,d,n,0,s,a);return{...function(e,t,r,n,o,s,c,a,i){const{width:l}=t;"left"===r&&Object(m.isRTL)()?r="right":"right"===r&&Object(m.isRTL)()&&(r="left"),"left"===n&&Object(m.isRTL)()?n="right":"right"===n&&Object(m.isRTL)()&&(n="left");const u=Math.round(e.left+e.width/2),d={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)};let p=e.left;"right"===n?p=e.right:"middle"===s||i||(p=u);let f=e.right;"left"===n?f=e.left:"middle"===s||i||(f=u);const h={popoverLeft:p,contentWidth:p-l>0?l:p},b={popoverLeft:f,contentWidth:f+l>window.innerWidth?window.innerWidth-f:l};let g,y=r,E=null;if(!o&&!a)if("center"===r&&d.contentWidth===l)y="center";else if("left"===r&&h.contentWidth===l)y="left";else if("right"===r&&b.contentWidth===l)y="right";else{y=h.contentWidth>b.contentWidth?"left":"right";const e="left"===y?h.contentWidth:b.contentWidth;l>window.innerWidth&&(E=window.innerWidth),e!==l&&(y="center",d.popoverLeft=window.innerWidth/2)}if(g="center"===y?d.popoverLeft:"left"===y?h.popoverLeft:b.popoverLeft,c){const e=c.getBoundingClientRect();g=Math.min(g,e.right-l),Object(m.isRTL)()||(g=Math.max(g,0))}return{xAxis:y,popoverLeft:g,contentWidth:E}}(e,t,u,d,n,p.yAxis,c,a,i),...p}}(e,c,h,R,G.current,o,n,F,U);"number"==typeof l&&"number"==typeof u&&(N(G.current,"top",l+"px"),N(G.current,"left",u+"px")),I(G.current,"is-without-arrow",a||"center"===p&&"middle"===b),I(G.current,"is-alternate",i),M(G.current,"data-x-axis",p),M(G.current,"data-y-axis",b),N(z.current,"maxHeight","number"==typeof g?g+"px":""),N(z.current,"maxWidth","number"==typeof y?y+"px":""),W(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))};e();const{ownerDocument:t}=G.current,{defaultView:r}=t,n=r.setInterval(e,500);let o;const s=()=>{r.cancelAnimationFrame(o),o=r.requestAnimationFrame(e)};r.addEventListener("click",s),r.addEventListener("resize",e),r.addEventListener("scroll",e,!0);const c=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(E);let l;return c&&c!==t&&(c.defaultView.addEventListener("resize",e),c.defaultView.addEventListener("scroll",e,!0)),D&&(l=new r.MutationObserver(e),l.observe(D,{attributes:!0})),()=>{r.clearInterval(n),r.removeEventListener("resize",e),r.removeEventListener("scroll",e,!0),r.removeEventListener("click",s),r.cancelAnimationFrame(o),c&&c!==t&&(c.defaultView.removeEventListener("resize",e),c.defaultView.removeEventListener("scroll",e,!0)),l&&l.disconnect()}},[X,v,k,E,O,h,Q,R,D,L]);const Z=(e,r)=>{if("focus-outside"===e&&C)C(r);else if("focus-outside"===e&&j){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>r.relatedTarget}),l()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),j(e)}else t&&t()},[ee,te]=Object(u.__experimentalUseDialog)({focusOnMount:g,__unstableOnClose:Z,onClose:Z}),re=Object(u.useMergeRefs)([G,ee,B]),ne=Boolean(w&&Y)&&function(e){if("loading"===e.type)return c()("components-animate__loading");const{type:t,origin:r=A(t)}=e;if("appear"===t){const[e,t="center"]=r.split(" ");return c()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?c()("components-animate__slide-in","is-from-"+r):void 0}({type:"appear",origin:Y});let oe=Object(o.createElement)("div",Object(n.a)({className:c()("components-popover",s,ne,{"is-expanded":X,"is-without-arrow":a,"is-alternate":i})},V,{ref:re},te,{tabIndex:"-1"}),X&&Object(o.createElement)(y,null),X&&Object(o.createElement)("div",{className:"components-popover__header"},Object(o.createElement)("span",{className:"components-popover__header-title"},e),Object(o.createElement)($,{className:"components-popover__close",icon:p.a,onClick:t})),Object(o.createElement)("div",{ref:z,className:"components-popover__content"},Object(o.createElement)("div",{style:{position:"relative"}},J,r)));return K.ref&&(oe=Object(o.createElement)(T,{name:x},oe)),E||v?oe:Object(o.createElement)("span",{ref:H},oe)});D.Slot=Object(o.forwardRef)((function({name:e="Popover"},t){return Object(o.createElement)(x,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var L=D,F=function({shortcut:e,className:t}){if(!e)return null;let r,n;return Object(a.isString)(e)&&(r=e),Object(a.isObject)(e)&&(r=e.display,n=e.ariaLabel),Object(o.createElement)("span",{className:t,"aria-label":n},r)};const U=Object(o.createElement)("div",{className:"event-catcher"}),V=({eventHandlers:e,child:t,childrenWithPopover:r})=>Object(o.cloneElement)(Object(o.createElement)("span",{className:"disabled-element-wrapper"},Object(o.cloneElement)(U,e),Object(o.cloneElement)(t,{children:r}),","),e),B=({child:e,eventHandlers:t,childrenWithPopover:r})=>Object(o.cloneElement)(e,{...t,children:r}),H=(e,t,r)=>{if(1!==o.Children.count(e))return;const n=o.Children.only(e);"function"==typeof n.props[t]&&n.props[t](r)};var z=function({children:e,position:t,text:r,shortcut:n}){const[s,c]=Object(o.useState)(!1),[i,l]=Object(o.useState)(!1),d=Object(u.useDebounce)(l,700),p=t=>{H(e,"onMouseDown",t),document.addEventListener("mouseup",h),c(!0)},m=t=>{H(e,"onMouseUp",t),document.removeEventListener("mouseup",h),c(!1)},f=e=>"mouseUp"===e?m:"mouseDown"===e?p:void 0,h=f("mouseUp"),b=(t,r)=>n=>{if(H(e,t,n),n.currentTarget.disabled)return;if("focus"===n.type&&s)return;d.cancel();const o=Object(a.includes)(["focus","mouseenter"],n.type);o!==i&&(r?d(o):l(o))},g=()=>{d.cancel(),document.removeEventListener("mouseup",h)};if(Object(o.useEffect)(()=>g,[]),1!==o.Children.count(e))return e;const y={onMouseEnter:b("onMouseEnter",!0),onMouseLeave:b("onMouseLeave"),onClick:b("onClick"),onFocus:b("onFocus"),onBlur:b("onBlur"),onMouseDown:f("mouseDown")},E=o.Children.only(e),{children:_,disabled:O}=E.props;return(O?V:B)({child:E,eventHandlers:y,childrenWithPopover:(({grandchildren:e,isOver:t,position:r,text:n,shortcut:s})=>Object(o.concatChildren)(e,t&&Object(o.createElement)(L,{focusOnMount:!1,position:r,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},n,Object(o.createElement)(F,{className:"components-tooltip__shortcut",shortcut:s}))))({grandchildren:_,isOver:i,position:t,text:r,shortcut:n})})},G=r(38),q=r(34);const Y=["onMouseDown","onClick"];var $=t.a=Object(o.forwardRef)((function(e,t){const{href:r,target:s,isSmall:i,isPressed:u,isBusy:d,isDestructive:p,className:m,disabled:f,icon:h,iconPosition:b="left",iconSize:g,showTooltip:y,tooltipPosition:E,shortcut:_,label:O,children:v,text:k,variant:S,__experimentalIsFocusable:w,describedBy:j,...C}=function({isDefault:e,isPrimary:t,isSecondary:r,isTertiary:n,isLink:o,variant:s,...c}){let a=s;var i,u,d,p,m;return t&&(null!==(i=a)&&void 0!==i||(a="primary")),n&&(null!==(u=a)&&void 0!==u||(a="tertiary")),r&&(null!==(d=a)&&void 0!==d||(a="secondary")),e&&(l()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(p=a)&&void 0!==p||(a="secondary")),o&&(null!==(m=a)&&void 0!==m||(a="link")),{...c,variant:a}}(e),R=c()("components-button",m,{"is-secondary":"secondary"===S,"is-primary":"primary"===S,"is-small":i,"is-tertiary":"tertiary"===S,"is-pressed":u,"is-busy":d,"is-link":"link"===S,"is-destructive":p,"has-text":!!h&&!!v,"has-icon":!!h}),T=f&&!w,x=void 0===r||T?"button":"a",A="a"===x?{href:r,target:s}:{type:"button",disabled:T,"aria-pressed":u};if(f&&w){A["aria-disabled"]=!0;for(const e of Y)C[e]=e=>{e.stopPropagation(),e.preventDefault()}}const P=!T&&(y&&O||_||!!O&&(!v||Object(a.isArray)(v)&&!v.length)&&!1!==y),M=j?Object(a.uniqueId)():null,N=C["aria-describedby"]||M,I=Object(o.createElement)(x,Object(n.a)({},A,C,{className:R,"aria-label":C["aria-label"]||O,"aria-describedby":N,ref:t}),h&&"left"===b&&Object(o.createElement)(G.a,{icon:h,size:g}),k&&Object(o.createElement)(o.Fragment,null,k),h&&"right"===b&&Object(o.createElement)(G.a,{icon:h,size:g}),v);return P?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(z,{text:j||O,shortcut:_,position:E},I),j&&Object(o.createElement)(q.a,null,Object(o.createElement)("span",{id:M},j))):Object(o.createElement)(o.Fragment,null,I,j&&Object(o.createElement)(q.a,null,Object(o.createElement)("span",{id:M},j)))}))},function(e,t){e.exports=window.wp.hooks},function(e,t){e.exports=window.wp.dom},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"string"==typeof e},,,function(e,t,r){"use strict";r.d(t,"n",(function(){return s})),r.d(t,"l",(function(){return c})),r.d(t,"k",(function(){return a})),r.d(t,"m",(function(){return i})),r.d(t,"i",(function(){return l})),r.d(t,"d",(function(){return u})),r.d(t,"f",(function(){return d})),r.d(t,"j",(function(){return p})),r.d(t,"c",(function(){return m})),r.d(t,"e",(function(){return f})),r.d(t,"g",(function(){return h})),r.d(t,"a",(function(){return b})),r.d(t,"h",(function(){return g})),r.d(t,"b",(function(){return y}));var n,o=r(2);const s=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),c=s.pluginUrl+"images/",a=s.pluginUrl+"build/",i=s.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),m=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),f=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),h=Object(o.getSetting)("shippingCountries",{}),b=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),y=Object(o.getSetting)("allowedStates",{})},function(e,t,r){"use strict";var n=r(2),o=r(1),s=r(72),c=r(45);const a=Object(n.getSetting)("countryLocale",{}),i=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(o.sprintf)( +/* translators: %s Field label. */ +Object(o.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(s.a)(e.priority)&&(t.index=e.priority),Object(c.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},l=Object.entries(a).map(e=>{let[t,r]=e;return[t,Object.entries(r).map(e=>{let[t,r]=e;return[t,i(r)]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{})]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{});t.a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=r&&void 0!==l[r]?l[r]:{};return e.map(e=>({key:e,...n.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return a}));var n=r(0),o=r(67);const s=Object(n.createContext)({isInitialized:!1,billingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},setBillingAddress:()=>{},setShippingAddress:()=>{}}),c=()=>Object(n.useContext)(s),a=e=>{let{children:t}=e;const r=Object(o.a)();return Object(n.createElement)(s.Provider,{value:r},t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(5);function o(e,t,r){var o=this,s=Object(n.useRef)(null),c=Object(n.useRef)(0),a=Object(n.useRef)(null),i=Object(n.useRef)([]),l=Object(n.useRef)(),u=Object(n.useRef)(),d=Object(n.useRef)(e),p=Object(n.useRef)(!0);d.current=e;var m=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var f=!!(r=r||{}).leading,h=!("trailing"in r)||!!r.trailing,b="maxWait"in r,g=b?Math.max(+r.maxWait||0,t):null;return Object(n.useEffect)((function(){return p.current=!0,function(){p.current=!1}}),[]),Object(n.useMemo)((function(){var e=function(e){var t=i.current,r=l.current;return i.current=l.current=null,c.current=e,u.current=d.current.apply(r,t)},r=function(e,t){m&&cancelAnimationFrame(a.current),a.current=m?requestAnimationFrame(e):setTimeout(e,t)},n=function(e){if(!p.current)return!1;var r=e-s.current,n=e-c.current;return!s.current||r>=t||r<0||b&&n>=g},y=function(t){return a.current=null,h&&i.current?e(t):(i.current=l.current=null,u.current)},E=function(){var e=Date.now();if(n(e))return y(e);if(p.current){var o=e-s.current,a=e-c.current,i=t-o,l=b?Math.min(i,g-a):i;r(E,l)}},_=function(){for(var d=[],m=0;m{let{Block:t,containers:r,getProps:n=(()=>({})),getErrorBoundaryProps:a=(()=>({}))}=e;0!==r.length&&Array.prototype.forEach.call(r,(e,r)=>{const i=n(e,r),l=a(e,r),u={...e.dataset,...i.attributes||{}};(e=>{let{Block:t,container:r,attributes:n={},props:a={},errorBoundaryProps:i={}}=e;Object(s.render)(Object(s.createElement)(c.a,i,Object(s.createElement)(s.Suspense,{fallback:Object(s.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(s.createElement)(t,o()({},a,{attributes:n})))),r,()=>{r.classList&&r.classList.remove("is-loading")})})({Block:t,container:e,props:i,attributes:u,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(a.join(",")),{Block:r,getProps:n,getErrorBoundaryProps:o,selector:s}=e;(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrappers:s}=e;const c=document.body.querySelectorAll(o);s&&s.length>0&&Array.prototype.filter.call(c,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,s)),i({Block:t,containers:c,getProps:r,getErrorBoundaryProps:n})})({Block:r,getProps:n,getErrorBoundaryProps:o,selector:s,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrapper:s}=e;const c=s.querySelectorAll(o);i({Block:t,containers:c,getProps:r,getErrorBoundaryProps:n})})({...e,wrapper:t})})})}},function(e,t){e.exports=window.wp.keycodes},,function(e,t){var r,n,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(e){r=s}try{n="function"==typeof clearTimeout?clearTimeout:c}catch(e){n=c}}();var i,l=[],u=!1,d=-1;function p(){u&&i&&(u=!1,i.length?l=i.concat(l):d=-1,l.length&&m())}function m(){if(!u){var e=a(p);u=!0;for(var t=l.length;t;){for(i=l,l=[];++d1)for(var r=1;r=16;e.exports={PRESERVE_CUSTOM_ATTRIBUTES:c,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var r,n,o="function"==typeof t,s={},c={};for(r in e)n=e[r],o&&(s=t(r,n))&&2===s.length?c[s[0]]=s[1]:"string"==typeof n&&(c[n]=r);return c},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){null!=e&&(t.style=o(e,s))}}},function(e,t,r){for(var n,o=r(93).CASE_SENSITIVE_TAG_NAMES,s={},c=0,a=o.length;c{const e=Object(s.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...r,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return c}));var n=r(0);const o=Object(n.createContext)({setIsSuppressed:e=>{},isSuppressed:!1}),s=()=>Object(n.useContext)(o),c=e=>{let{children:t}=e;const[r,s]=Object(n.useState)(!1),c={setIsSuppressed:s,isSuppressed:r};return Object(n.createElement)(o.Provider,{value:c},t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(5);function o(e,t){const r=Object(n.useRef)();return Object(n.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},function(e,t,r){var n=r(82),o=r(56),s=r(91),c={decodeEntities:!0,lowerCaseAttributeNames:!1};function a(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return""===e?[]:n(s(e,(t=t||{}).htmlparser2||c),t)}a.domToReact=n,a.htmlToDOM=s,a.attributesToProps=o,e.exports=a,e.exports.default=a},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return b}));var n=r(6),o=r(7),s=r(0),c=r(11),a=r.n(c),i=r(18),l=r(1),u=r(48),d=r(2);const p=[{destination:{address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},package_id:0,name:Object(l.__)("Shipping","woo-gutenberg-products-block"),items:[{key:"33e75ff09dd601bbe69f351039152189",name:Object(l._x)("Beanie with Logo","example product in Cart Block","woo-gutenberg-products-block"),quantity:2},{key:"6512bd43d9caa6e02c990b0a82652dca",name:Object(l._x)("Beanie","example product in Cart Block","woo-gutenberg-products-block"),quantity:1}],shipping_rates:[{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(l.__)("Free shipping","woo-gutenberg-products-block"),description:"",delivery_time:"",price:"000",taxes:"0",rate_id:"free_shipping:1",instance_id:0,meta_data:[],method_id:"flat_rate",selected:!0},{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(l.__)("Local pickup","woo-gutenberg-products-block"),description:"",delivery_time:"",price:"200",taxes:"0",rate_id:"local_pickup:1",instance_id:1,meta_data:[],method_id:"local_pickup",selected:!1}]}],m=Object(d.getSetting)("displayCartPricesIncludingTax",!1),f={coupons:[],shipping_rates:Object(d.getSetting)("shippingMethodsExist",!1)?p:[],items:[{key:"1",id:1,quantity:2,name:Object(l.__)("Beanie","woo-gutenberg-products-block"),short_description:Object(l.__)("Warm hat for winter","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-beanie",permalink:"https://example.org",low_stock_remaining:2,backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:10,src:u.l+"previews/beanie.jpg",thumbnail:u.l+"previews/beanie.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(l.__)("Color","woo-gutenberg-products-block"),value:Object(l.__)("Yellow","woo-gutenberg-products-block")},{attribute:Object(l.__)("Size","woo-gutenberg-products-block"),value:Object(l.__)("Small","woo-gutenberg-products-block")}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:m?"12000":"10000",regular_price:m?"12000":"10000",sale_price:m?"12000":"10000",raw_prices:{precision:6,price:m?"12000000":"10000000",regular_price:m?"12000000":"10000000",sale_price:m?"12000000":"10000000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:"2000",line_subtotal_tax:"400",line_total:"2000",line_total_tax:"400"},extensions:{}},{key:"2",id:2,quantity:1,name:Object(l.__)("Cap","woo-gutenberg-products-block"),short_description:Object(l.__)("Lightweight baseball cap","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-cap",permalink:"https://example.org",backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:11,src:u.l+"previews/cap.jpg",thumbnail:u.l+"previews/cap.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(l.__)("Color","woo-gutenberg-products-block"),value:Object(l.__)("Orange","woo-gutenberg-products-block")}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:m?"2400":"2000",regular_price:m?"2400":"2000",sale_price:m?"2400":"2000",raw_prices:{precision:6,price:m?"24000000":"20000000",regular_price:m?"24000000":"20000000",sale_price:m?"24000000":"20000000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:"2000",line_subtotal_tax:"400",line_total:"2000",line_total_tax:"400"},extensions:{}}],fees:[{id:"fee",name:Object(l.__)("Fee","woo-gutenberg-products-block"),totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total:"100",total_tax:"20",tax_lines:[{name:Object(l.__)("Sales tax","woo-gutenberg-products-block"),rate:"20%",price:"20"}]}}],items_count:3,items_weight:0,needs_payment:!0,needs_shipping:Object(d.getSetting)("shippingEnabled",!0),has_calculated_shipping:!0,shipping_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},billing_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total_items:"4000",total_items_tax:"800",total_fees:"100",total_fees_tax:"20",total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_tax:"820",total_price:"4920",tax_lines:[{name:Object(l.__)("Sales tax","woo-gutenberg-products-block"),rate:"20%",price:"820"}]},errors:[],payment_requirements:["products"],extensions:{}};var h=r(69);const b=()=>{const{shippingRates:e,needsShipping:t,hasCalculatedShipping:r,isLoadingRates:c}=Object(o.useSelect)(e=>{const t=!!e("core/editor"),r=e(n.CART_STORE_KEY);return{shippingRates:t?f.shipping_rates:r.getShippingRates(),needsShipping:t?f.needs_shipping:r.getNeedsShipping(),hasCalculatedShipping:t?f.has_calculated_shipping:r.getHasCalculatedShipping(),isLoadingRates:!t&&r.isCustomerDataUpdating()}}),{isSelectingRate:l,selectShippingRate:u}=Object(h.a)(),d=Object(s.useRef)({});return Object(s.useEffect)(()=>{const t=(e=>Object.fromEntries(e.map(e=>{var t;let{package_id:r,shipping_rates:n}=e;return[r,null===(t=n.find(e=>e.selected))||void 0===t?void 0:t.rate_id]})))(e);Object(i.a)(t)&&!a()(d.current,t)&&(d.current=t)},[e]),{isSelectingRate:l,selectedRates:d.current,selectShippingRate:u,shippingRates:e,needsShipping:t,hasCalculatedShipping:r,isLoadingRates:c}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(7),o=r(6);const s=()=>{const{customerData:e,isInitialized:t}=Object(n.useSelect)(e=>{const t=e(o.CART_STORE_KEY);return{customerData:t.getCustomerData(),isInitialized:t.hasFinishedResolution("getCartData")}}),{setShippingAddress:r,setBillingAddress:s}=Object(n.useDispatch)(o.CART_STORE_KEY);return{isInitialized:t,billingAddress:e.billingAddress,shippingAddress:e.shippingAddress,setBillingAddress:s,setShippingAddress:r}}},function(e,t,r){"use strict";r.d(t,"b",(function(){return _})),r.d(t,"a",(function(){return O}));var n=r(0);const o={NONE:"none",INVALID_ADDRESS:"invalid_address",UNKNOWN:"unknown_error"},s={INVALID_COUNTRY:"woocommerce_rest_cart_shipping_rates_invalid_country",MISSING_COUNTRY:"woocommerce_rest_cart_shipping_rates_missing_country",INVALID_STATE:"woocommerce_rest_cart_shipping_rates_invalid_state"},c={shippingErrorStatus:{isPristine:!0,isValid:!1,hasInvalidAddress:!1,hasError:!1},dispatchErrorStatus:()=>null,shippingErrorTypes:o,shippingRates:[],isLoadingRates:!1,selectedRates:[],setSelectedRates:()=>null,shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},setShippingAddress:()=>null,onShippingRateSuccess:()=>null,onShippingRateFail:()=>null,onShippingRateSelectSuccess:()=>null,onShippingRateSelectFail:()=>null,needsShipping:!1},a=(e,t)=>{let{type:r}=t;return Object.values(o).includes(r)?r:e};var i=r(94),l=r(204);const u=e=>({onSuccess:Object(l.a)("shipping_rates_success",e),onFail:Object(l.a)("shipping_rates_fail",e),onSelectSuccess:Object(l.a)("shipping_rate_select_success",e),onSelectFail:Object(l.a)("shipping_rate_select_fail",e)});var d=r(206),p=r(36),m=r(32),f=r(69),h=r(66);const{NONE:b,INVALID_ADDRESS:g,UNKNOWN:y}=o,E=Object(n.createContext)(c),_=()=>Object(n.useContext)(E),O=e=>{let{children:t}=e;const{dispatchActions:r}=Object(p.b)(),{shippingRates:c,isLoadingRates:l,cartErrors:_}=Object(m.a)(),{isSelectingRate:O}=Object(f.a)(),{selectedRates:v}=Object(h.a)(),[k,S]=Object(n.useReducer)(a,b),[w,j]=Object(n.useReducer)(i.b,{}),C=Object(n.useRef)(w),R=Object(n.useMemo)(()=>({onShippingRateSuccess:u(j).onSuccess,onShippingRateFail:u(j).onFail,onShippingRateSelectSuccess:u(j).onSelectSuccess,onShippingRateSelectFail:u(j).onSelectFail}),[j]);Object(n.useEffect)(()=>{C.current=w},[w]),Object(n.useEffect)(()=>{l?r.incrementCalculating():r.decrementCalculating()},[l,r]),Object(n.useEffect)(()=>{O?r.incrementCalculating():r.decrementCalculating()},[O,r]),Object(n.useEffect)(()=>{_.length>0&&_.some(e=>!(!e.code||!Object.values(s).includes(e.code)))?S({type:g}):S({type:b})},[_]);const T=Object(n.useMemo)(()=>({isPristine:k===b,isValid:k===b,hasInvalidAddress:k===g,hasError:k===y||k===g}),[k]);Object(n.useEffect)(()=>{l||0!==c.length&&!T.hasError||Object(d.a)(C.current,"shipping_rates_fail",{hasInvalidAddress:T.hasInvalidAddress,hasError:T.hasError})},[c,l,T.hasError,T.hasInvalidAddress]),Object(n.useEffect)(()=>{!l&&c.length>0&&!T.hasError&&Object(d.a)(C.current,"shipping_rates_success",c)},[c,l,T.hasError]),Object(n.useEffect)(()=>{O||(T.hasError?Object(d.a)(C.current,"shipping_rate_select_fail",{hasError:T.hasError,hasInvalidAddress:T.hasInvalidAddress}):Object(d.a)(C.current,"shipping_rate_select_success",v.current))},[v,O,T.hasError,T.hasInvalidAddress]);const x={shippingErrorStatus:T,dispatchErrorStatus:S,shippingErrorTypes:o,...R};return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(E.Provider,{value:x},t))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(7),o=r(0),s=r(6),c=r(73),a=r(59);const i=()=>{const e=Object(c.a)(),{dispatchCheckoutEvent:t}=Object(a.a)(),{selectShippingRate:r}=Object(n.useDispatch)(s.CART_STORE_KEY);return{selectShippingRate:Object(o.useCallback)((n,o)=>{r(n,o).then(()=>{t("set-selected-shipping-rate",{shippingRateId:n})}).catch(t=>{e(t)})},[r,t,e]),isSelectingRate:Object(n.useSelect)(e=>e(s.CART_STORE_KEY).isShippingRateBeingSelected(),[])}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"d",(function(){return c})),r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return i}));const n=window.CustomEvent||null,o=(e,t)=>{let{bubbles:r=!1,cancelable:o=!1,element:s,detail:c={}}=t;if(!n)return;s||(s=document.body);const a=new n(e,{bubbles:r,cancelable:o,detail:c});s.dispatchEvent(a)};let s;const c=()=>{s&&clearTimeout(s),s=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},a=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},i=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const s=()=>{o(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,s),()=>jQuery(document).off(e,s)}},function(e,t,r){"use strict";var n=r(0),o=r(13);const s=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=s},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"number"==typeof e},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const o=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},function(e,t,r){"use strict";var n=r(12),o=r.n(n),s=r(0);r(106);const c=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};t.a=e=>t=>{const r=Object(s.useRef)(null);return Object(s.createElement)(s.Fragment,null,Object(s.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:r,"aria-hidden":!0}),Object(s.createElement)(e,o()({},t,{scrollToTop:e=>{null!==r.current&&((e,t)=>{const{focusableSelector:r}=t||{};window&&Number.isFinite(window.innerHeight)&&(r?((e,t)=>{var r;const n=(null===(r=e.parentElement)||void 0===r?void 0:r.querySelectorAll(t))||[];if(n.length){const e=n[0];c(e),null==e||e.focus()}else c(e)})(e,r):c(e))})(r.current,e)}})))}},,function(e,t,r){"use strict";var n=r(0),o=r(3),s=r(4),c=r.n(s),a=r(1),i=r(23),l=r(71),u=r(42);function d(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}t.a=function({className:e,status:t="info",children:r,spokenMessage:s=r,onRemove:p=o.noop,isDismissible:m=!0,actions:f=[],politeness:h=d(t),__unstableHTML:b,onDismiss:g=o.noop}){!function(e,t){const r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)(()=>{r&&Object(i.speak)(r,t)},[r,t])}(s,h);const y=c()(e,"components-notice","is-"+t,{"is-dismissible":m});return b&&(r=Object(n.createElement)(n.RawHTML,null,r)),Object(n.createElement)("div",{className:y},Object(n.createElement)("div",{className:"components-notice__content"},r,Object(n.createElement)("div",{className:"components-notice__actions"},f.map(({className:e,label:t,isPrimary:r,variant:o,noDefaultClasses:s=!1,onClick:a,url:i},l)=>{let d=o;return"primary"===o||s||(d=i?"link":"secondary"),void 0===d&&r&&(d="primary"),Object(n.createElement)(u.a,{key:l,href:i,variant:d,onClick:i?void 0:a,className:c()("components-notice__action",e)},t)}))),m&&Object(n.createElement)(u.a,{className:"components-notice__dismiss",icon:l.a,label:Object(a.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),g(),p()},showTooltip:!1}))}},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return s}));var n=r(7);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;const r=Object(n.select)("core/notices").getNotices(e);return r.some(e=>e.type===t)},s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=Object(n.select)("core/notices").getNotices(),{removeNotice:o}=Object(n.dispatch)("core/notices"),s=r.filter(t=>t.status===e);s.forEach(e=>o(e.id,t))}},function(e,t){},function(e,t,r){var n=r(5),o=r(56),s=r(57),c=s.setStyleProp;function a(e){return s.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&s.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,r){for(var s,i,l,u,d=(r=r||{}).library||n,p=d.cloneElement,m=d.createElement,f=d.isValidElement,h=[],b="function"==typeof r.replace,g=r.trim,y=0,E=t.length;y1&&(i=p(i,{key:i.key||y})),h.push(i);else if("text"!==s.type){switch(l=s.attribs,a(s)?c(l.style,l):l&&(l=o(l)),u=null,s.type){case"script":case"style":s.children[0]&&(l.dangerouslySetInnerHTML={__html:s.children[0].data});break;case"tag":"textarea"===s.name&&s.children[0]?l.defaultValue=s.children[0].data:s.children&&s.children.length&&(u=e(s.children,r));break;default:continue}E>1&&(l.key=y),h.push(m(s.name,l,u))}else g?s.data.trim()&&h.push(s.data):h.push(s.data);return 1===h.length?h[0]:h}},function(e,t,r){var n=r(84),o=r(85),s=r(86),c=s.MUST_USE_PROPERTY,a=s.HAS_BOOLEAN_VALUE,i=s.HAS_NUMERIC_VALUE,l=s.HAS_POSITIVE_NUMERIC_VALUE,u=s.HAS_OVERLOADED_BOOLEAN_VALUE;function d(e,t){return(e&t)===t}function p(e,t,r){var n,o,s,p=e.Properties,m=e.DOMAttributeNames;for(o in p)n=m[o]||(r?o:o.toLowerCase()),s=p[o],t[n]={attributeName:n,propertyName:o,mustUseProperty:d(s,c),hasBooleanValue:d(s,a),hasNumericValue:d(s,i),hasPositiveNumericValue:d(s,l),hasOverloadedBooleanValue:d(s,u)}}var m={};p(n,m);var f={};p(o,f,!0);var h={};p(n,h),p(o,h,!0),e.exports={html:m,svg:f,properties:h,isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"))}},function(e,t){e.exports={Properties:{autoFocus:4,accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:4,allowTransparency:0,alt:0,as:0,async:4,autoComplete:0,autoPlay:4,capture:4,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:5,cite:0,classID:0,className:0,cols:24,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:4,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:4,defer:4,dir:0,disabled:4,download:32,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:4,formTarget:0,frameBorder:0,headers:0,height:0,hidden:4,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:4,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:5,muted:5,name:0,nonce:0,noValidate:4,open:4,optimum:0,pattern:0,placeholder:0,playsInline:4,poster:0,preload:0,profile:0,radioGroup:0,readOnly:4,referrerPolicy:0,rel:0,required:4,reversed:4,role:0,rows:24,rowSpan:8,sandbox:0,scope:0,scoped:4,scrolling:0,seamless:4,selected:5,shape:0,size:24,sizes:0,span:24,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:8,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:4,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"}}},function(e,t){e.exports={Properties:{accentHeight:0,accumulate:0,additive:0,alignmentBaseline:0,allowReorder:0,alphabetic:0,amplitude:0,arabicForm:0,ascent:0,attributeName:0,attributeType:0,autoReverse:0,azimuth:0,baseFrequency:0,baseProfile:0,baselineShift:0,bbox:0,begin:0,bias:0,by:0,calcMode:0,capHeight:0,clip:0,clipPath:0,clipRule:0,clipPathUnits:0,colorInterpolation:0,colorInterpolationFilters:0,colorProfile:0,colorRendering:0,contentScriptType:0,contentStyleType:0,cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:0,direction:0,display:0,divisor:0,dominantBaseline:0,dur:0,dx:0,dy:0,edgeMode:0,elevation:0,enableBackground:0,end:0,exponent:0,externalResourcesRequired:0,fill:0,fillOpacity:0,fillRule:0,filter:0,filterRes:0,filterUnits:0,floodColor:0,floodOpacity:0,focusable:0,fontFamily:0,fontSize:0,fontSizeAdjust:0,fontStretch:0,fontStyle:0,fontVariant:0,fontWeight:0,format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:0,glyphOrientationHorizontal:0,glyphOrientationVertical:0,glyphRef:0,gradientTransform:0,gradientUnits:0,hanging:0,horizAdvX:0,horizOriginX:0,ideographic:0,imageRendering:0,in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:0,kernelUnitLength:0,kerning:0,keyPoints:0,keySplines:0,keyTimes:0,lengthAdjust:0,letterSpacing:0,lightingColor:0,limitingConeAngle:0,local:0,markerEnd:0,markerMid:0,markerStart:0,markerHeight:0,markerUnits:0,markerWidth:0,mask:0,maskContentUnits:0,maskUnits:0,mathematical:0,mode:0,numOctaves:0,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:0,overlineThickness:0,paintOrder:0,panose1:0,pathLength:0,patternContentUnits:0,patternTransform:0,patternUnits:0,pointerEvents:0,points:0,pointsAtX:0,pointsAtY:0,pointsAtZ:0,preserveAlpha:0,preserveAspectRatio:0,primitiveUnits:0,r:0,radius:0,refX:0,refY:0,renderingIntent:0,repeatCount:0,repeatDur:0,requiredExtensions:0,requiredFeatures:0,restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:0,slope:0,spacing:0,specularConstant:0,specularExponent:0,speed:0,spreadMethod:0,startOffset:0,stdDeviation:0,stemh:0,stemv:0,stitchTiles:0,stopColor:0,stopOpacity:0,strikethroughPosition:0,strikethroughThickness:0,string:0,stroke:0,strokeDasharray:0,strokeDashoffset:0,strokeLinecap:0,strokeLinejoin:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0,surfaceScale:0,systemLanguage:0,tableValues:0,targetX:0,targetY:0,textAnchor:0,textDecoration:0,textRendering:0,textLength:0,to:0,transform:0,u1:0,u2:0,underlinePosition:0,underlineThickness:0,unicode:0,unicodeBidi:0,unicodeRange:0,unitsPerEm:0,vAlphabetic:0,vHanging:0,vIdeographic:0,vMathematical:0,values:0,vectorEffect:0,version:0,vertAdvY:0,vertOriginX:0,vertOriginY:0,viewBox:0,viewTarget:0,visibility:0,widths:0,wordSpacing:0,writingMode:0,x:0,xHeight:0,x1:0,x2:0,xChannelSelector:0,xlinkActuate:0,xlinkArcrole:0,xlinkHref:0,xlinkRole:0,xlinkShow:0,xlinkTitle:0,xlinkType:0,xmlBase:0,xmlns:0,xmlnsXlink:0,xmlLang:0,xmlSpace:0,y:0,y1:0,y2:0,yChannelSelector:0,z:0,zoomAndPan:0},DOMAttributeNames:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space"}}},function(e,t){e.exports={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=n(r(88)),s=r(90);t.default=function(e,t){var r={};return e&&"string"==typeof e?(o.default(e,(function(e,n){e&&n&&(r[s.camelCase(e,t)]=n)})),r):r}},function(e,t,r){var n=r(89);e.exports=function(e,t){var r,o=null;if(!e||"string"!=typeof e)return o;for(var s,c,a=n(e),i="function"==typeof t,l=0,u=a.length;l/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t,r=e.match(a);return r&&r[1]&&(t=r[1],c&&(e=e.replace(r[0],""))),s(n(e),null,t)}},function(e,t,r){var n=r(58),o=/<([a-zA-Z]+[0-9]?)/,s=//i,c=//i,a=/<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\/?>/gi,i=n.isIE(9),l=i||n.isIE(),u=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},d=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")};if("function"==typeof window.DOMParser){var p=new window.DOMParser,m=i?"text/xml":"text/html";u=d=function(e,t){return t&&(e="<"+t+">"+e+""),i&&(e=e.replace(a,"<$1$2$3/>")),p.parseFromString(e,m)}}if(document.implementation){var f=document.implementation.createHTMLDocument(l?"html-dom-parser":void 0);u=function(e,t){if(t)return f.documentElement.getElementsByTagName(t)[0].innerHTML=e,f;try{return f.documentElement.innerHTML=e,f}catch(t){if(d)return d(e)}}}var h,b=document.createElement("template");b.content&&(h=function(e){return b.innerHTML=e,b.content.childNodes}),e.exports=function(e){var t,r,n,a,i=e.match(o);switch(i&&i[1]&&(t=i[1].toLowerCase()),t){case"html":return r=d(e),s.test(e)||(n=r.getElementsByTagName("head")[0])&&n.parentNode.removeChild(n),c.test(e)||(n=r.getElementsByTagName("body")[0])&&n.parentNode.removeChild(n),r.getElementsByTagName("html");case"head":case"body":return a=u(e).getElementsByTagName(t),c.test(e)&&s.test(e)?a[0].parentNode.childNodes:a;default:return h?h(e):u(e,"body").getElementsByTagName("body")[0].childNodes}}},function(e,t){e.exports={CASE_SENSITIVE_TAG_NAMES:["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return a}));var n=r(3);let o;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(o||(o={}));const s={addEventCallback:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(n.uniqueId)(),type:o.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:(e,t)=>({id:t,type:o.REMOVE_EVENT_CALLBACK,eventType:e})},c={},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,{type:t,eventType:r,id:n,callback:s,priority:a}=arguments.length>1?arguments[1]:void 0;const i=e.hasOwnProperty(r)?new Map(e[r]):new Map;switch(t){case o.ADD_EVENT_CALLBACK:return i.set(n,{priority:a,callback:s}),{...e,[r]:i};case o.REMOVE_EVENT_CALLBACK:return i.delete(n),{...e,[r]:i}}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return c}));var n=r(1),o=r(17);const s=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},c=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(o.decodeEntities)(e.message):Object(n.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(12)),s=n(r(128)),c=r(5),a=n(c),i=n(r(129)),l=n(r(131)),u={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!=typeof t)return!1;if(u.str(e)||u.num(e))return e===t;if(u.obj(e)&&u.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var r;for(r in e)if(!(r in t))return!1;for(r in t)if(e[r]!==t[r])return!1;return!u.und(r)||e===t}};function d(){var e=c.useState(!1)[1];return c.useCallback((function(){return e((function(e){return!e}))}),[])}function p(e,t){return u.und(e)||u.nul(e)?t:e}function m(e){return u.und(e)?[]:u.arr(e)?e:[e]}function f(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n=r.length)break;s=r[o++]}else{if((o=r.next()).done)break;s=o.value}for(var c=s,a=!1,i=0;i=m.startTime+l.duration;else if(l.decay)b=f+E/(1-.998)*(1-Math.exp(-(1-.998)*(t-m.startTime))),(u=Math.abs(m.lastPosition-b)<.1)&&(h=b);else{d=void 0!==m.lastTime?m.lastTime:t,E=void 0!==m.lastVelocity?m.lastVelocity:l.initialVelocity,t>d+64&&(d=t);for(var _=Math.floor(t-d),O=0;O<_;++O)b+=1*(E+=(-l.tension*(b-h)+-l.friction*E)/l.mass*1/1e3)/1e3;var v=!(!l.clamp||0===l.tension)&&(fh:b=e);++r);return r-1}(e,s);return function(e,t,r,n,o,s,c,a,i){var l=i?i(e):e;if(lr){if("identity"===a)return l;"clamp"===a&&(l=r)}return n===o?n:t===r?e<=t?n:o:(t===-1/0?l=-l:r===1/0?l-=t:l=(l-t)/(r-t),l=s(l),n===-1/0?l=-l:o===1/0?l+=n:l=l*(o-n)+n,l)}(e,s[t],s[t+1],o[t],o[t+1],i,c,a,n.map)}}var V=function(e){function t(r,n,o,s){var c;return(c=e.call(this)||this).calc=void 0,c.payload=r instanceof E&&!(r instanceof t)?r.getPayload():Array.isArray(r)?r:[r],c.calc=U(n,o,s),c}i(t,e);var r=t.prototype;return r.getValue=function(){return this.calc.apply(this,this.payload.map((function(e){return e.getValue()})))},r.updateConfig=function(e,t,r){this.calc=U(e,t,r)},r.interpolate=function(e,r,n){return new t(this,e,r,n)},t}(E),B=function(e){function t(t){var r;return(r=e.call(this)||this).animatedStyles=new Set,r.value=void 0,r.startPosition=void 0,r.lastPosition=void 0,r.lastVelocity=void 0,r.startTime=void 0,r.lastTime=void 0,r.done=!1,r.setValue=function(e,t){void 0===t&&(t=!0),r.value=e,t&&r.flush()},r.value=t,r.startPosition=t,r.lastPosition=t,r}i(t,e);var r=t.prototype;return r.flush=function(){0===this.animatedStyles.size&&function e(t,r){"update"in t?r.add(t):t.getChildren().forEach((function(t){return e(t,r)}))}(this,this.animatedStyles),this.animatedStyles.forEach((function(e){return e.update()}))},r.clearStyles=function(){this.animatedStyles.clear()},r.getValue=function(){return this.value},r.interpolate=function(e,t,r){return new V(this,e,t,r)},t}(y),H=function(e){function t(t){var r;return(r=e.call(this)||this).payload=t.map((function(e){return new B(e)})),r}i(t,e);var r=t.prototype;return r.setValue=function(e,t){var r=this;void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((function(e,n){return r.payload[n].setValue(e,t)})):this.payload.forEach((function(r){return r.setValue(e,t)}))},r.getValue=function(){return this.payload.map((function(e){return e.getValue()}))},r.interpolate=function(e,t){return new V(this,e,t)},t}(E),z=0,G=function(){function e(){var e=this;this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=function(){return e.interpolations},this.id=z++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=h(e),r=t.delay,n=void 0===r?0:r,c=t.to,a=s(t,["delay","to"]);if(u.arr(c)||u.fun(c))this.queue.push(o({},a,{delay:n,to:c}));else if(c){var i={};Object.entries(c).forEach((function(e){var t,r=e[0],s=e[1],c=o({to:(t={},t[r]=s,t),delay:f(n,r)},a),l=i[c.delay]&&i[c.delay].to;i[c.delay]=o({},i[c.delay],c,{to:o({},l,c.to)})})),this.queue=Object.values(i)}return this.queue=this.queue.sort((function(e,t){return e.delay-t.delay})),this.diff(a),this},t.start=function(e){var t=this;if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((function(e){var r=e.from,n=void 0===r?{}:r,s=e.to,c=void 0===s?{}:s;u.obj(n)&&(t.merged=o({},n,t.merged)),u.obj(c)&&(t.merged=o({},t.merged,c))}));var r=this.local=++this.guid,n=this.localQueue=this.queue;this.queue=[],n.forEach((function(o,c){var a=o.delay,i=s(o,["delay"]),l=function(o){c===n.length-1&&r===t.guid&&o&&(t.idle=!0,t.props.onRest&&t.props.onRest(t.merged)),e&&e()},d=u.arr(i.to)||u.fun(i.to);a?setTimeout((function(){r===t.guid&&(d?t.runAsync(i,l):t.diff(i).start(l))}),a):d?t.runAsync(i,l):t.diff(i).start(l)}))}else u.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),this,L.has(this)||L.add(this),D||(D=!0,S(A||F));return this},t.stop=function(e){return this.listeners.forEach((function(t){return t(e)})),this.listeners=[],this},t.pause=function(e){return this.stop(!0),e&&(this,L.has(this)&&L.delete(this)),this},t.runAsync=function(e,t){var r=this,n=(e.delay,s(e,["delay"])),c=this.local,a=Promise.resolve(void 0);if(u.arr(n.to))for(var i=function(e){var t=e,s=o({},n,h(n.to[t]));u.arr(s.config)&&(s.config=s.config[t]),a=a.then((function(){if(c===r.guid)return new Promise((function(e){return r.diff(s).start(e)}))}))},l=0;l=n.length)return"break";c=n[s++]}else{if((s=n.next()).done)return"break";c=s.value}var r=c.key,a=function(e){return e.key!==r};(u.und(t)||t===r)&&(e.current.instances.delete(r),e.current.transitions=e.current.transitions.filter(a),e.current.deleted=e.current.deleted.filter(a))},n=e.current.deleted,o=Array.isArray(n),s=0;for(n=o?n:n[Symbol.iterator]();;){var c;if("break"===r())break}e.current.forceUpdate()}var X=function(e){function t(t){var r;return void 0===t&&(t={}),r=e.call(this)||this,!t.transform||t.transform instanceof y||(t=b.transform(t)),r.payload=t,r}return i(t,e),t}(_),J={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Q="[-+]?\\d*\\.?\\d+";function Z(){for(var e=arguments.length,t=new Array(e),r=0;r1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function le(e,t,r){var n=r<.5?r*(1+t):r+t-r*t,o=2*r-n,s=ie(o,n,e+1/3),c=ie(o,n,e),a=ie(o,n,e-1/3);return Math.round(255*s)<<24|Math.round(255*c)<<16|Math.round(255*a)<<8}function ue(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function de(e){return(parseFloat(e)%360+360)%360/360}function pe(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function me(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function fe(e){var t,r,n="number"==typeof(t=e)?t>>>0===t&&t>=0&&t<=4294967295?t:null:(r=ce.exec(t))?parseInt(r[1]+"ff",16)>>>0:J.hasOwnProperty(t)?J[t]:(r=ee.exec(t))?(ue(r[1])<<24|ue(r[2])<<16|ue(r[3])<<8|255)>>>0:(r=te.exec(t))?(ue(r[1])<<24|ue(r[2])<<16|ue(r[3])<<8|pe(r[4]))>>>0:(r=oe.exec(t))?parseInt(r[1]+r[1]+r[2]+r[2]+r[3]+r[3]+"ff",16)>>>0:(r=ae.exec(t))?parseInt(r[1],16)>>>0:(r=se.exec(t))?parseInt(r[1]+r[1]+r[2]+r[2]+r[3]+r[3]+r[4]+r[4],16)>>>0:(r=re.exec(t))?(255|le(de(r[1]),me(r[2]),me(r[3])))>>>0:(r=ne.exec(t))?(le(de(r[1]),me(r[2]),me(r[3]))|pe(r[4]))>>>0:null;return null===n?e:"rgba("+((4278190080&(n=n||0))>>>24)+", "+((16711680&n)>>>16)+", "+((65280&n)>>>8)+", "+(255&n)/255+")"}var he=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,be=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ge=new RegExp("("+Object.keys(J).join("|")+")","g"),ye={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ee=["Webkit","Ms","Moz","O"];function _e(e,t,r){return null==t||"boolean"==typeof t||""===t?"":r||"number"!=typeof t||0===t||ye.hasOwnProperty(e)&&ye[e]?(""+t).trim():t+"px"}ye=Object.keys(ye).reduce((function(e,t){return Ee.forEach((function(r){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(r,t)]=e[t]})),e}),ye);var Oe={};M((function(e){return new X(e)})),T("div"),j((function(e){var t=e.output.map((function(e){return e.replace(be,fe)})).map((function(e){return e.replace(ge,fe)})),r=t[0].match(he).map((function(){return[]}));t.forEach((function(e){e.match(he).forEach((function(e,t){return r[t].push(+e)}))}));var n=t[0].match(he).map((function(t,n){return U(o({},e,{output:r[n]}))}));return function(e){var r=0;return t[0].replace(he,(function(){return n[r++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,r,n,o){return"rgba("+Math.round(t)+", "+Math.round(r)+", "+Math.round(n)+", "+o+")"}))}})),v(J),O((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var r=t.style,n=t.children,o=t.scrollTop,c=t.scrollLeft,a=s(t,["style","children","scrollTop","scrollLeft"]),i="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var l in void 0!==o&&(e.scrollTop=o),void 0!==c&&(e.scrollLeft=c),void 0!==n&&(e.textContent=n),r)if(r.hasOwnProperty(l)){var u=0===l.indexOf("--"),d=_e(l,r[l],u);"float"===l&&(l="cssFloat"),u?e.style.setProperty(l,d):e.style[l]=d}for(var p in a){var m=i?p:Oe[p]||(Oe[p]=p.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));void 0!==e.getAttribute(m)&&e.setAttribute(m,a[p])}}),(function(e){return e}));var ve,ke,Se=(ve=function(e){return c.forwardRef((function(t,r){var n=d(),i=c.useRef(!0),l=c.useRef(null),p=c.useRef(null),m=c.useCallback((function(e){var t=l.current;l.current=new I(e,(function(){var e=!1;p.current&&(e=b.fn(p.current,l.current.getAnimatedValue())),p.current&&!1!==e||n()})),t&&t.detach()}),[]);c.useEffect((function(){return function(){i.current=!1,l.current&&l.current.detach()}}),[]),c.useImperativeHandle(r,(function(){return P(p,i,n)})),m(t);var f,h=l.current.getValue(),g=(h.scrollTop,h.scrollLeft,s(h,["scrollTop","scrollLeft"])),y=(f=e,!u.fun(f)||f.prototype instanceof a.Component?function(e){return p.current=function(e,t){return t&&(u.fun(t)?t(e):u.obj(t)&&(t.current=e)),e}(e,r)}:void 0);return a.createElement(e,o({},g,{ref:y}))}))},void 0===(ke=!1)&&(ke=!0),function(e){return(u.arr(e)?e:Object.keys(e)).reduce((function(e,t){var r=ke?t[0].toLowerCase()+t.substring(1):t;return e[r]=ve(r),e}),ve)}),we=Se(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);t.apply=Se,t.config={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},t.update=F,t.animated=we,t.a=we,t.interpolate=function(e,t,r){return e&&new V(e,t,r)},t.Globals=N,t.useSpring=function(e){var t=u.fun(e),r=q(1,t?e:[e]),n=r[0],o=r[1],s=r[2];return t?[n[0],o,s]:n},t.useTrail=function(e,t){var r=c.useRef(!1),n=u.fun(t),s=f(t),a=c.useRef(),i=q(e,(function(e,t){return 0===e&&(a.current=[]),a.current.push(t),o({},s,{config:f(s.config,e),attach:e>0&&function(){return a.current[e-1]}})})),l=i[0],d=i[1],p=i[2],m=c.useMemo((function(){return function(e){return d((function(t,r){e.reverse;var n=e.reverse?t+1:t-1,c=a.current[n];return o({},e,{config:f(e.config||s.config,t),attach:c&&function(){return c}})}))}}),[e,s.reverse]);return c.useEffect((function(){r.current&&!n&&m(t)})),c.useEffect((function(){r.current=!0}),[]),n?[l,m,p]:l},t.useTransition=function(e,t,r){var n=o({items:e,keys:t||function(e){return e}},r),a=W(n),i=a.lazy,l=void 0!==i&&i,u=(a.unique,a.reset),p=void 0!==u&&u,m=(a.enter,a.leave,a.update,a.onDestroyed),h=(a.keys,a.items,a.onFrame),b=a.onRest,g=a.onStart,y=a.ref,E=s(a,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),_=d(),O=c.useRef(!1),v=c.useRef({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!n.ref,instances:!O.current&&new Map,forceUpdate:_});return c.useImperativeHandle(n.ref,(function(){return{start:function(){return Promise.all(Array.from(v.current.instances).map((function(e){var t=e[1];return new Promise((function(e){return t.start(e)}))})))},stop:function(e){return Array.from(v.current.instances).forEach((function(t){return t[1].stop(e)}))},get controllers(){return Array.from(v.current.instances).map((function(e){return e[1]}))}}})),v.current=function(e,t){for(var r=e.first,n=e.prevProps,c=s(e,["first","prevProps"]),a=W(t),i=a.items,l=a.keys,u=a.initial,d=a.from,p=a.enter,m=a.leave,h=a.update,b=a.trail,g=void 0===b?0:b,y=a.unique,E=a.config,_=a.order,O=void 0===_?["enter","leave","update"]:_,v=W(n),k=v.keys,S=v.items,w=o({},c.current),j=[].concat(c.deleted),C=Object.keys(w),R=new Set(C),T=new Set(l),x=l.filter((function(e){return!R.has(e)})),A=c.transitions.filter((function(e){return!e.destroyed&&!T.has(e.originalKey)})).map((function(e){return e.originalKey})),P=l.filter((function(e){return R.has(e)})),M=-g;O.length;)switch(O.shift()){case"enter":x.forEach((function(e,t){y&&j.find((function(t){return t.originalKey===e}))&&(j=j.filter((function(t){return t.originalKey!==e})));var n=l.indexOf(e),o=i[n],s=r&&void 0!==u?"initial":"enter";w[e]={slot:s,originalKey:e,key:y?String(e):Y++,item:o,trail:M+=g,config:f(E,o,s),from:f(r&&void 0!==u?u||{}:d,o),to:f(p,o)}}));break;case"leave":A.forEach((function(e){var t=k.indexOf(e),r=S[t];j.unshift(o({},w[e],{slot:"leave",destroyed:!0,left:k[Math.max(0,t-1)],right:k[Math.min(k.length,t+1)],trail:M+=g,config:f(E,r,"leave"),to:f(m,r)})),delete w[e]}));break;case"update":P.forEach((function(e){var t=l.indexOf(e),r=i[t];w[e]=o({},w[e],{item:r,slot:"update",trail:M+=g,config:f(E,r,"update"),to:f(h,r)})}))}var N=l.map((function(e){return w[e]}));return j.forEach((function(e){var t,r=e.left,n=(e.right,s(e,["left","right"]));-1!==(t=N.findIndex((function(e){return e.originalKey===r})))&&(t+=1),t=Math.max(0,t),N=[].concat(N.slice(0,t),[n],N.slice(t))})),o({},c,{changed:x.length||A.length||P.length,first:r&&0===x.length,transitions:N,current:w,deleted:j,prevProps:t})}(v.current,n),v.current.changed&&v.current.transitions.forEach((function(e){var t=e.slot,r=e.from,n=e.to,s=e.config,c=e.trail,a=e.key,i=e.item;v.current.instances.has(a)||v.current.instances.set(a,new G);var u=v.current.instances.get(a),d=o({},E,{to:n,from:r,config:s,ref:y,onRest:function(r){v.current.mounted&&(e.destroyed&&(y||l||K(v,a),m&&m(i)),!Array.from(v.current.instances).some((function(e){return!e[1].idle}))&&(y||l)&&v.current.deleted.length>0&&K(v),b&&b(i,t,r))},onStart:g&&function(){return g(i,t)},onFrame:h&&function(e){return h(i,t,e)},delay:c,reset:p&&"enter"===t});u.update(d),v.current.paused||u.start()})),c.useEffect((function(){return v.current.mounted=O.current=!0,function(){v.current.mounted=O.current=!1,Array.from(v.current.instances).map((function(e){return e[1].destroy()})),v.current.instances.clear()}}),[]),v.current.transitions.map((function(e){var t=e.item,r=e.slot,n=e.key;return{item:t,key:n,state:r,props:v.current.instances.get(n).getValues()}}))},t.useChain=function(e,t,r){void 0===r&&(r=1e3);var n=c.useRef();c.useEffect((function(){u.equ(e,n.current)?e.forEach((function(e){var t=e.current;return t&&t.start()})):t?e.forEach((function(e,n){var s=e.current;if(s){var c=s.controllers;if(c.length){var a=r*t[n];c.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+a})})),e.start()}))}}})):e.reduce((function(e,t,r){var n=t.current;return e.then((function(){return n.start()}))}),Promise.resolve()),n.current=e}))},t.useSprings=q},,,,,,,,,,function(e,t){},,,,,function(e,t,r){"use strict";(function(e){var n=r(0),o=r(3),s=r(4),c=r.n(s),a=r(23),i=r(1),l=(r(37),r(42));t.a=Object(n.forwardRef)((function({className:t,children:r,spokenMessage:s=r,politeness:u="polite",actions:d=[],onRemove:p=o.noop,icon:m=null,explicitDismiss:f=!1,onDismiss:h=o.noop},b){function g(e){e&&e.preventDefault&&e.preventDefault(),h(),p()}h=h||o.noop,function(e,t){const r="string"==typeof e?e:Object(n.renderToString)(e);Object(n.useEffect)(()=>{r&&Object(a.speak)(r,t)},[r,t])}(s,u),Object(n.useEffect)(()=>{const e=setTimeout(()=>{f||(h(),p())},1e4);return()=>clearTimeout(e)},[h,p]);const y=c()(t,"components-snackbar",{"components-snackbar-explicit-dismiss":!!f});d&&d.length>1&&(void 0!==e&&e.env,d=[d[0]]);const E=c()("components-snackbar__content",{"components-snackbar__content-with-icon":!!m});return Object(n.createElement)("div",{ref:b,className:y,onClick:f?o.noop:g,tabIndex:"0",role:f?"":"button",onKeyPress:f?o.noop:g,"aria-label":f?"":Object(i.__)("Dismiss this notice")},Object(n.createElement)("div",{className:E},m&&Object(n.createElement)("div",{className:"components-snackbar__icon"},m),r,d.map(({label:e,onClick:t,url:r},o)=>Object(n.createElement)(l.a,{key:o,href:r,variant:"tertiary",onClick:e=>function(e,t){e.stopPropagation(),p(),t&&t(e)}(e,t),className:"components-snackbar__action"},e)),f&&Object(n.createElement)("span",{role:"button","aria-label":"Dismiss this notice",tabIndex:"0",className:"components-snackbar__dismiss-button",onClick:g,onKeyPress:g},"✕")))}))}).call(this,r(55))},function(e,t){e.exports=window.wp.plugins},,,function(e,t){e.exports=window.wp.wordcount},function(e,t){e.exports=window.wp.autop},function(e,t,r){"use strict";var n=r(0);t.a=function(e){let{icon:t,size:r=24,...o}=e;return Object(n.cloneElement)(t,{width:r,height:r,...o})}},function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return c}));var n=r(49),o=(r(14),r(2));const s=(e,t)=>Object.keys(o.defaultAddressFields).every(r=>e[r]===t[r]),c=e=>{const t=Object.keys(o.defaultAddressFields),r=Object(n.a)(t,{},e.country),s=Object.assign({},e);return r.forEach(t=>{let{key:r="",hidden:n=!1}=t;n&&((e,t)=>e in t)(r,e)&&(s[r]="")}),s}},function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(12),o=r.n(n),s=r(0),c=r(4),a=r.n(c),i=r(76),l=r(7),u=(r(81),r(60));const d=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""},p=e=>{let{className:t,context:r="default",additionalNotices:n=[]}=e;const{isSuppressed:c}=Object(u.b)(),{notices:p}=Object(l.useSelect)(e=>({notices:e("core/notices").getNotices(r)})),{removeNotice:m}=Object(l.useDispatch)("core/notices"),f=p.filter(e=>"snackbar"!==e.type).concat(n);if(!f.length)return null;const h=a()(t,"wc-block-components-notices");return c?null:Object(s.createElement)("div",{className:h},f.map(e=>Object(s.createElement)(i.a,o()({key:"store-notice-"+e.id},e,{className:a()("wc-block-components-notices__notice",d(e)),onRemove:()=>{e.isDismissible&&m(e.id,r)}}),e.content)))}},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(0),o=r(52),s=r(2),c=r(62),a=r.n(c),i=r(10),l=r(15);const u=(e,t)=>e&&t[e]?t[e]:null,d=e=>{let{block:t,blockMap:r,blockWrapper:o,children:c,depth:p=1}=e;return c&&0!==c.length?Array.from(c).map((e,c)=>{const{blockName:m="",...f}={key:`${t}_${p}_${c}`,...e instanceof HTMLElement?e.dataset:{},className:e instanceof Element?null==e?void 0:e.className:""},h=u(m,r);if(!h){const s=a()(e instanceof Element&&(null==e?void 0:e.outerHTML)||(null==e?void 0:e.textContent)||"");if("string"==typeof s&&s)return s;if(!Object(n.isValidElement)(s))return null;const c=e.childNodes.length?d({block:t,blockMap:r,children:e.childNodes,depth:p+1,blockWrapper:o}):void 0;return c?Object(n.cloneElement)(s,f,c):Object(n.cloneElement)(s,f)}const b=o||n.Fragment;return Object(n.createElement)(n.Suspense,{key:`${t}_${p}_${c}_suspense`,fallback:Object(n.createElement)("div",{className:"wc-block-placeholder"})},Object(n.createElement)(l.a,{text:"Unexpected error in: "+m,showErrorBlock:s.CURRENT_USER_IS_ADMIN},Object(n.createElement)(b,null,Object(n.createElement)(h,f,d({block:t,blockMap:r,children:e.childNodes,depth:p+1,blockWrapper:o}),((e,t,r,o)=>{if(!Object(i.hasInnerBlocks)(e))return null;const c=r?Array.from(r).map(e=>e instanceof HTMLElement&&(null==e?void 0:e.dataset.blockName)||null).filter(Boolean):[],a=Object(i.getRegisteredBlocks)(e).filter(e=>{let{blockName:t,force:r}=e;return!0===r&&!c.includes(t)}),d=o||n.Fragment;return Object(n.createElement)(n.Fragment,null,a.map((e,r)=>{let{blockName:o,component:c}=e;const a=c||u(o,t);return a?Object(n.createElement)(l.a,{key:o+"_blockerror",text:"Unexpected error in: "+o,showErrorBlock:s.CURRENT_USER_IS_ADMIN},Object(n.createElement)(d,null,Object(n.createElement)(a,{key:`${o}_forced_${r}`}))):null}))})(m,r,e.childNodes,o)))))}):null},p=e=>{let{Block:t,selector:r,blockName:n,getProps:s=(()=>({})),blockMap:c,blockWrapper:a}=e;Object(o.a)({Block:t,selector:r,getProps:(e,t)=>{const r=d({block:n,blockMap:c,children:e.children||[],blockWrapper:a});return{...s(e,t),children:r}}})}},function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},s=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(130);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t,n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";r.d(t,"a",(function(){return k}));var n=r(0),o=r(112),s=r(2),c=r(15),a=r(207),i=r(68),l=r(50),u=r(36),d=r(1),p=r(27),m=r.n(p),f=r(118),h=r(95),b=r(7);const g=(e,t,r)=>{const n=Object.keys(e).map(t=>({key:t,value:e[t]}),[]),o=`wc-${r}-new-payment-method`;return n.push({key:o,value:t}),n},y=(e,t)=>{m.a.setNonce&&"function"==typeof m.a.setNonce&&m.a.setNonce(e),null!=e&&e.get("User-ID")&&t.setCustomerId(parseInt(e.get("User-ID")||"0",10))};var E=r(199),_=r(32),O=r(60),v=()=>{const{hasError:e,onCheckoutValidationBeforeProcessing:t,dispatchActions:r,redirectUrl:o,isProcessing:s,isBeforeProcessing:c,isComplete:p,orderNotes:v,shouldCreateAccount:k,extensionData:S}=Object(u.b)(),{hasValidationErrors:w}=Object(E.b)(),{shippingErrorStatus:j}=Object(i.b)(),{billingAddress:C,shippingAddress:R}=Object(l.b)(),{cartNeedsPayment:T,cartNeedsShipping:x,receiveCart:A}=Object(_.a)(),{activePaymentMethod:P,isExpressPaymentMethodActive:M,currentStatus:N,paymentMethodData:I,expressPaymentMethods:D,paymentMethods:L,shouldSavePayment:F}=Object(a.b)(),{setIsSuppressed:U}=Object(O.b)(),{createErrorNotice:V,removeNotice:B}=Object(b.useDispatch)("core/notices"),H=Object(n.useRef)(C),z=Object(n.useRef)(R),G=Object(n.useRef)(o),[q,Y]=Object(n.useState)(!1),$=Object(n.useMemo)(()=>{var e;const t={...D,...L};return null==t||null===(e=t[P])||void 0===e?void 0:e.paymentMethodId},[P,D,L]),W=w&&!M||N.hasError||j.hasError,K=!e&&!W&&(N.isSuccessful||!T)&&s;Object(n.useEffect)(()=>{U(M)},[M,U]),Object(n.useEffect)(()=>{W===e||!s&&!c||M||r.setHasError(W)},[W,e,s,c,M,r]),Object(n.useEffect)(()=>{H.current=C,z.current=R,G.current=o},[C,R,o]);const X=Object(n.useCallback)(()=>!w&&(N.hasError?{errorMessage:Object(d.__)("There was a problem with your payment option.","woo-gutenberg-products-block")}:!j.hasError||{errorMessage:Object(d.__)("There was a problem with your shipping option.","woo-gutenberg-products-block")}),[w,N.hasError,j.hasError]);Object(n.useEffect)(()=>{let e;return M||(e=t(X,0)),()=>{M||e()}},[t,X,M]),Object(n.useEffect)(()=>{G.current&&(window.location.href=G.current)},[p]);const J=Object(n.useCallback)(async()=>{if(q)return;Y(!0),B("checkout");const e=T?{payment_method:$,payment_data:g(I,F,P)}:{},t={billing_address:Object(f.a)(H.current),customer_note:v,create_account:k,...e,extensions:{...S}};x&&(t.shipping_address=Object(f.a)(z.current)),m()({path:"/wc/store/v1/checkout",method:"POST",data:t,cache:"no-store",parse:!1}).then(e=>{if(y(e.headers,r),!e.ok)throw new Error(e);return e.json()}).then(e=>{r.setAfterProcessing(e),Y(!1)}).catch(e=>{try{null!=e&&e.headers&&y(e.headers,r),e.json().then(e=>{var t,n,o;null!==(t=e.data)&&void 0!==t&&t.cart&&A(e.data.cart),V(Object(h.b)(e),{id:"checkout",context:"wc/checkout"}),null==e||null===(n=e.additional_errors)||void 0===n||null===(o=n.forEach)||void 0===o||o.call(n,e=>{V(e.message,{id:e.error_code,context:"wc/checkout"})}),r.setAfterProcessing(e)})}catch{var t;V(Object(d.sprintf)(// Translators: %s Error text. +Object(d.__)("%s Please try placing your order again.","woo-gutenberg-products-block"),null!==(t=null==e?void 0:e.message)&&void 0!==t?t:Object(d.__)("Something went wrong.","woo-gutenberg-products-block")),{id:"checkout",context:"wc/checkout"})}r.setHasError(!0),Y(!1)})},[q,B,T,$,I,F,P,v,k,S,x,r,V,A]);return Object(n.useEffect)(()=>{K&&!q&&J()},[J,K,q]),null};const k=e=>{let{children:t,isCart:r=!1,redirectUrl:d}=e;return Object(n.createElement)(u.a,{redirectUrl:d,isCart:r},Object(n.createElement)(l.a,null,Object(n.createElement)(i.a,null,Object(n.createElement)(a.a,null,t,Object(n.createElement)(c.a,{renderError:s.CURRENT_USER_IS_ADMIN?null:()=>null},Object(n.createElement)(o.PluginArea,{scope:"woocommerce-checkout"})),Object(n.createElement)(v,null)))))}},,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return s}));var n=r(0);const o=Object(n.createContext)({allowCreateAccount:!1,showCompanyField:!1,showApartmentField:!1,showPhoneField:!1,requireCompanyField:!1,requirePhoneField:!1,showOrderNotes:!0,showPolicyLinks:!0,showReturnToCart:!0,cartPageId:0,showRateAfterTaxName:!1}),s=(Object(n.createContext)({addressFieldControls:()=>null,accountControls:()=>null}),()=>Object(n.useContext)(o))},,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=(e,t)=>{const r=[];return Object.keys(e).forEach(n=>{if(void 0!==t[n])switch(e[n].type){case"boolean":r[n]="false"!==t[n]&&!1!==t[n];break;case"number":r[n]=parseInt(t[n],10);break;case"array":case"object":r[n]=JSON.parse(t[n]);break;default:r[n]=t[n]}else r[n]=e[n].default}),r}},,,,,,,,,,,,,,,,,,,,,,function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-actions-block","version":"1.0.0","title":"Actions","description":"Allow customers to place their order.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-billing-address-block","version":"1.0.0","title":"Billing Address","description":"Collect your customer\'s billing address.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-contact-information-block","version":"1.0.0","title":"Contact Information","description":"Collect your customer\'s contact information.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-express-payment-block","version":"1.0.0","title":"Express Checkout","description":"Provide an express payment option for your customers.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-fields-block","version":"1.0.0","title":"Checkout Fields","description":"Column containing checkout address fields.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-order-note-block","version":"1.0.0","title":"Order Note","description":"Allow customers to add a note to their order.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":false,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-payment-block","version":"1.0.0","title":"Payment Options","description":"Payment options for your store.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-shipping-address-block","version":"1.0.0","title":"Shipping Address","description":"Collect your customer\'s shipping address.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-shipping-methods-block","version":"1.0.0","title":"Shipping Options","description":"Shipping options for your store.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-terms-block","version":"1.0.0","title":"Terms and Conditions","description":"Ensure customers agree to your terms and conditions and privacy policy.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"className":{"type":"string","default":""},"checkbox":{"type":"boolean","default":false},"text":{"type":"string","required":false}},"parent":["woocommerce/checkout-fields-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-totals-block","version":"1.0.0","title":"Checkout Totals","description":"Column containing the checkout totals.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"className":{"type":"string","default":""},"checkbox":{"type":"boolean","default":false},"text":{"type":"string","required":false}},"parent":["woocommerce/checkout"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-order-summary-block","version":"1.0.0","title":"Order Summary","description":"Show customers a summary of their order.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true}}},"parent":["woocommerce/checkout-totals-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-order-summary-subtotal-block","version":"1.0.0","title":"Subtotal","description":"Shows the cart subtotal row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"lock":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/checkout-order-summary-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-order-summary-fee-block","version":"1.0.0","title":"Fees","description":"Shows the cart fee row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"lock":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/checkout-order-summary-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-order-summary-discount-block","version":"1.0.0","title":"Discount","description":"Shows the cart discount row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"lock":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/checkout-order-summary-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-order-summary-shipping-block","version":"1.0.0","title":"Shipping","description":"Shows the cart shipping row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/checkout-order-summary-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-order-summary-coupon-form-block","version":"1.0.0","title":"Coupon Form","description":"Shows the apply coupon form.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":false,"move":false}}},"parent":["woocommerce/checkout-order-summary-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-order-summary-taxes-block","version":"1.0.0","title":"Taxes","description":"Shows the cart taxes row.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"lock":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/checkout-order-summary-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-order-summary-cart-items-block","version":"1.0.0","title":"Cart Items","description":"Shows cart items.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"lock":false},"attributes":{"className":{"type":"string","default":""},"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/checkout-order-summary-block"],"textdomain":"woo-gutenberg-products-block","$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout","version":"1.0.0","title":"Checkout","description":"Display a checkout form so your customers can submit orders.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"align":["wide"],"html":false,"multiple":false},"attributes":{"isPreview":{"type":"boolean","default":false,"save":false},"showCompanyField":{"type":"boolean","default":false},"requireCompanyField":{"type":"boolean","default":false},"allowCreateAccount":{"type":"boolean","default":false},"showApartmentField":{"type":"boolean","default":true},"showPhoneField":{"type":"boolean","default":true},"requirePhoneField":{"type":"boolean","default":false}},"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},,,,,,,,,,,,function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return l}));var n=r(0),o=r(3),s=r(11),c=r.n(s);const a=Object(n.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),i=()=>Object(n.useContext)(a),l=e=>{let{children:t}=e;const[r,s]=Object(n.useState)({}),i=Object(n.useCallback)(e=>r[e],[r]),l=Object(n.useCallback)(e=>{const t=r[e];return!t||t.hidden?"":"validate-error-"+e},[r]),u=Object(n.useCallback)(e=>{s(t=>{if(!t[e])return t;const{[e]:r,...n}=t;return n})},[]),d=Object(n.useCallback)(()=>{s({})},[]),p=Object(n.useCallback)(e=>{e&&s(t=>(e=Object(o.pickBy)(e,(e,r)=>!("string"!=typeof e.message||t.hasOwnProperty(r)&&c()(t[r],e))),0===Object.values(e).length?t:{...t,...e}))},[]),m=Object(n.useCallback)((e,t)=>{s(r=>{if(!r.hasOwnProperty(e))return r;const n={...r[e],...t};return c()(r[e],n)?r:{...r,[e]:n}})},[]),f={getValidationError:i,setValidationErrors:p,clearValidationError:u,clearAllValidationErrors:d,hideValidationError:Object(n.useCallback)(e=>{m(e,{hidden:!0})},[m]),showValidationError:Object(n.useCallback)(e=>{m(e,{hidden:!1})},[m]),showAllValidationErrors:Object(n.useCallback)(()=>{s(e=>{const t={};return Object.keys(e).forEach(r=>{e[r].hidden&&(t[r]={...e[r],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(r).length>0,getValidationErrorId:l};return Object(n.createElement)(a.Provider,{value:f},t)}},,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(94);const o=(e,t)=>function(r){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const s=n.a.addEventCallback(e,r,o);return t(s),()=>{t(n.a.removeEventCallback(e,s.id))}}},function(e,t){},function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return c}));const n=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var o=r(30);const s=async(e,t,r)=>{const o=n(e,t),s=[];for(const e of o)try{const t=await Promise.resolve(e.callback(r));"object"==typeof t&&s.push(t)}catch(e){console.error(e)}return!s.length||s},c=async(e,t,r)=>{const s=[],c=n(e,t);for(const e of c)try{const t=await Promise.resolve(e.callback(r));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(o.a)(t)||Object(o.b)(t))return s.push(t),s;s.push(t)}catch(e){return console.error(e),s.push({type:"error"}),s}return s}},function(e,t,r){"use strict";r.d(t,"b",(function(){return U})),r.d(t,"a",(function(){return V}));var n=r(0),o=r(18),s=r(7);let c,a;!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(c||(c={})),function(e){e.SET_REGISTERED_PAYMENT_METHODS="set_registered_payment_methods",e.SET_REGISTERED_EXPRESS_PAYMENT_METHODS="set_registered_express_payment_methods",e.SET_SHOULD_SAVE_PAYMENT_METHOD="set_should_save_payment_method",e.SET_ACTIVE_PAYMENT_METHOD="set_active_payment_method"}(a||(a={}));const i={currentStatus:c.PRISTINE,shouldSavePaymentMethod:!1,activePaymentMethod:"",paymentMethodData:{payment_method:""},errorMessage:"",paymentMethods:{},expressPaymentMethods:{}},l={setPaymentStatus:()=>({pristine:()=>{},started:()=>{},processing:()=>{},completed:()=>{},error:e=>{},failed:(e,t)=>{},success:(e,t)=>{}}),currentStatus:{isPristine:!0,isStarted:!1,isProcessing:!1,isFinished:!1,hasError:!1,hasFailed:!1,isSuccessful:!1,isDoingExpressPayment:!1},paymentStatuses:c,paymentMethodData:{},errorMessage:"",activePaymentMethod:"",activeSavedToken:"",setActivePaymentMethod:()=>{},customerPaymentMethods:{},paymentMethods:{},expressPaymentMethods:{},paymentMethodsInitialized:!1,expressPaymentMethodsInitialized:!1,onPaymentProcessing:()=>()=>()=>{},setExpressPaymentError:()=>{},isExpressPaymentMethodActive:!1,setShouldSavePayment:()=>{},shouldSavePayment:!1};var u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,{type:t,paymentMethodData:r,shouldSavePaymentMethod:n=!1,errorMessage:o="",paymentMethods:s={},paymentMethod:l=""}=arguments.length>1?arguments[1]:void 0;switch(t){case c.PRISTINE:return{...i,...e,errorMessage:"",currentStatus:c.PRISTINE};case c.STARTED:return{...e,currentStatus:c.STARTED};case c.ERROR:return e.currentStatus!==c.ERROR?{...e,currentStatus:c.ERROR,errorMessage:o||e.errorMessage}:e;case c.FAILED:return e.currentStatus!==c.FAILED?{...e,currentStatus:c.FAILED,paymentMethodData:r||e.paymentMethodData,errorMessage:o||e.errorMessage}:e;case c.SUCCESS:return e.currentStatus!==c.SUCCESS?{...e,currentStatus:c.SUCCESS,paymentMethodData:r||e.paymentMethodData}:e;case c.PROCESSING:return e.currentStatus!==c.PROCESSING?{...e,currentStatus:c.PROCESSING,errorMessage:""}:e;case c.COMPLETE:return e.currentStatus!==c.COMPLETE?{...e,currentStatus:c.COMPLETE}:e;case a.SET_REGISTERED_PAYMENT_METHODS:return{...e,paymentMethods:s};case a.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:return{...e,expressPaymentMethods:s};case a.SET_SHOULD_SAVE_PAYMENT_METHOD:return{...e,shouldSavePaymentMethod:n};case a.SET_ACTIVE_PAYMENT_METHOD:return{...e,activePaymentMethod:l,paymentMethodData:r||e.paymentMethodData}}},d=r(1),p=r(16),m=r(31),f=r(2),h=r(51),b=r(25),g=r.n(b),y=r(29),E=r(50),_=r(32),O=r(30),v=r(66);const k=(e,t,r,o)=>{const[c,a]=Object(n.useState)(!1),{isEditor:i}=Object(y.a)(),{selectedRates:l}=Object(v.a)(),{billingAddress:u,shippingAddress:p}=Object(E.b)(),b=Object(m.a)(l),O=Object(m.a)(r),k=Object(_.a)(),{cartTotals:S,cartIsLoading:w,cartNeedsShipping:j,paymentRequirements:C}=k,R=Object(n.useRef)({cart:k,cartTotals:S,cartNeedsShipping:j,billingData:u,billingAddress:u,shippingAddress:p,selectedShippingMethods:b,paymentRequirements:C}),{createErrorNotice:T}=Object(s.useDispatch)("core/notices");Object(n.useEffect)(()=>{R.current={cart:k,cartTotals:S,cartNeedsShipping:j,get billingData(){return g()("billingData",{alternative:"billingAddress",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-blocks/pull/6369"}),this.billingAddress},billingAddress:u,shippingAddress:p,selectedShippingMethods:b,paymentRequirements:C}},[k,S,j,u,p,b,C]);const x=Object(n.useCallback)(async()=>{let r={};const n=e=>{r={...r,[e.name]:e}};for(let e=0;e{w||A()},[A,k,b,u,w]),c},S=e=>({type:e}),w=e=>({type:c.ERROR,errorMessage:e}),j=e=>{let{errorMessage:t,paymentMethodData:r}=e;return{type:c.FAILED,errorMessage:t,paymentMethodData:r}},C=e=>{let{paymentMethodData:t}=e;return{type:c.SUCCESS,paymentMethodData:t}},R=e=>({type:a.SET_REGISTERED_PAYMENT_METHODS,paymentMethods:e}),T=e=>({type:a.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,paymentMethods:e}),x=e=>({type:a.SET_SHOULD_SAVE_PAYMENT_METHOD,shouldSavePaymentMethod:e}),A=(e,t)=>({type:a.SET_ACTIVE_PAYMENT_METHOD,paymentMethod:e,paymentMethodData:t});var P=r(67),M=r(36),N=r(94),I=r(204);var D=r(206),L=r(199);const F=Object(n.createContext)(l),U=()=>Object(n.useContext)(F),V=e=>{let{children:t}=e;const{isProcessing:r,isIdle:a,isCalculating:l,hasError:d}=Object(M.b)(),{isEditor:m,getPreviewData:h}=Object(y.a)(),{setValidationErrors:b}=Object(L.b)(),{createErrorNotice:g,removeNotice:E}=Object(s.useDispatch)("core/notices"),{isSuccessResponse:_,isErrorResponse:v,isFailResponse:U,noticeContexts:V}=Object(O.d)(),[B,H]=Object(n.useReducer)(N.b,{}),{onPaymentProcessing:z}=(e=>Object(n.useMemo)(()=>({onPaymentProcessing:Object(I.a)("payment_processing",e)}),[e]))(H),G=Object(n.useRef)(B);Object(n.useEffect)(()=>{G.current=B},[B]);const[q,Y]=Object(n.useReducer)(u,i),{dispatchActions:$,setPaymentStatus:W}=(e=>{const{setBillingAddress:t,setShippingAddress:r}=Object(P.a)();return{dispatchActions:Object(n.useMemo)(()=>({setRegisteredPaymentMethods:t=>{e(R(t))},setRegisteredExpressPaymentMethods:t=>{e(T(t))},setShouldSavePayment:t=>{e(x(t))},setActivePaymentMethod:function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e(A(t,r))}}),[e]),setPaymentStatus:Object(n.useCallback)(()=>({pristine:()=>e(S(c.PRISTINE)),started:()=>e(S(c.STARTED)),processing:()=>e(S(c.PROCESSING)),completed:()=>e(S(c.COMPLETE)),error:t=>e(w(t)),failed:function(r,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;o&&t(o),e(j({errorMessage:r||"",paymentMethodData:n||{}}))},success:function(n){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;o&&t(o),void 0!==typeof s&&null!=s&&s.address&&r(s.address),e(C({paymentMethodData:n}))}}),[e,t,r])}})(Y),K=(e=>{const t=Object(p.getPaymentMethods)(),{noticeContexts:r}=Object(O.d)(),n=new Set([...Object(f.getSetting)("paymentGatewaySortOrder",[]),...Object.keys(t)]);return k(e,t,Array.from(n),r.PAYMENTS)})($.setRegisteredPaymentMethods),X=(e=>{const t=Object(p.getExpressPaymentMethods)(),{noticeContexts:r}=Object(O.d)();return k(e,t,Object.keys(t),r.EXPRESS_PAYMENTS)})($.setRegisteredExpressPaymentMethods),J=Object(n.useMemo)(()=>m?h("previewSavedPaymentMethods"):K?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===Object.keys(e).length)return{};const t=Object(f.getSetting)("customerPaymentMethods",{}),r=Object.keys(t),n={};return r.forEach(r=>{const o=t[r].filter(t=>{var r;let{method:{gateway:n}}=t;return n in e&&(null===(r=e[n].supports)||void 0===r?void 0:r.showSavedCards)});o.length&&(n[r]=o)}),n}(q.paymentMethods):{},[m,h,K,q.paymentMethods]),Q=Object(n.useCallback)(e=>{e?g(e,{id:"wc-express-payment-error",context:V.EXPRESS_PAYMENTS}):E("wc-express-payment-error",V.EXPRESS_PAYMENTS)},[g,V.EXPRESS_PAYMENTS,E]),Z=Object.keys(q.expressPaymentMethods).includes(q.activePaymentMethod),ee=Object(n.useMemo)(()=>({isPristine:q.currentStatus===c.PRISTINE,isStarted:q.currentStatus===c.STARTED,isProcessing:q.currentStatus===c.PROCESSING,isFinished:[c.ERROR,c.FAILED,c.SUCCESS].includes(q.currentStatus),hasError:q.currentStatus===c.ERROR,hasFailed:q.currentStatus===c.FAILED,isSuccessful:q.currentStatus===c.SUCCESS,isDoingExpressPayment:q.currentStatus!==c.PRISTINE&&Z}),[q.currentStatus,Z]);Object(n.useEffect)(()=>{const e=Object.keys(q.paymentMethods);if(!K||!e.length)return;const t=[...e,...Object.keys(q.expressPaymentMethods)];if(q.activePaymentMethod&&t.includes(q.activePaymentMethod))return;W().pristine();const r=Object.keys(J).flatMap(e=>J[e])[0]||void 0;if(r){const e=r.tokenId.toString(),t=r.method.gateway,n=`wc-${t}-payment-token`;$.setActivePaymentMethod(t,{token:e,payment_method:t,[n]:e,isSavedToken:!0})}else $.setActivePaymentMethod(Object.keys(q.paymentMethods)[0])},[K,q.paymentMethods,q.expressPaymentMethods,$,W,q.activePaymentMethod,J]),Object(n.useEffect)(()=>{!r||d||l||ee.isFinished||W().processing()},[r,d,l,ee.isFinished,W]),Object(n.useEffect)(()=>{a&&!ee.isSuccessful&&W().pristine()},[a,ee.isSuccessful,W]),Object(n.useEffect)(()=>{d&&ee.isSuccessful&&W().pristine()},[d,ee.isSuccessful,W]),Object(n.useEffect)(()=>{ee.isProcessing&&(E("wc-payment-error",V.PAYMENTS),Object(D.b)(G.current,"payment_processing",{}).then(e=>{let t,r;var n,o,s,c,a,i;if(e.forEach(e=>{_(e)&&(t=e),(v(e)||U(e))&&(r=e)}),t&&!r)W().success(null===(n=t)||void 0===n||null===(o=n.meta)||void 0===o?void 0:o.paymentMethodData,null===(s=t)||void 0===s||null===(c=s.meta)||void 0===c?void 0:c.billingAddress,null===(a=t)||void 0===a||null===(i=a.meta)||void 0===i?void 0:i.shippingData);else if(r&&U(r)){var l,u,d,p,m,f;r.message&&r.message.length&&g(r.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(f=r)||void 0===f?void 0:f.messageContext)||V.PAYMENTS}),W().failed(null===(l=r)||void 0===l?void 0:l.message,null===(u=r)||void 0===u||null===(d=u.meta)||void 0===d?void 0:d.paymentMethodData,null===(p=r)||void 0===p||null===(m=p.meta)||void 0===m?void 0:m.billingAddress)}else if(r){var h,y;r.message&&r.message.length&&g(r.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(y=r)||void 0===y?void 0:y.messageContext)||V.PAYMENTS}),W().error(r.message),b(null===(h=r)||void 0===h?void 0:h.validationErrors)}else W().success()}))},[ee.isProcessing,b,W,E,V.PAYMENTS,_,U,v,g]);const te="object"==typeof q.paymentMethodData&&Object(o.b)(q.paymentMethodData,"token")?q.paymentMethodData.token+"":"",re={setPaymentStatus:W,currentStatus:ee,paymentStatuses:c,paymentMethodData:q.paymentMethodData,errorMessage:q.errorMessage,activePaymentMethod:q.activePaymentMethod,activeSavedToken:te,setActivePaymentMethod:$.setActivePaymentMethod,onPaymentProcessing:z,customerPaymentMethods:J,paymentMethods:q.paymentMethods,expressPaymentMethods:q.expressPaymentMethods,paymentMethodsInitialized:K,expressPaymentMethodsInitialized:X,setExpressPaymentError:Q,isExpressPaymentMethodActive:Z,shouldSavePayment:q.shouldSavePaymentMethod,setShouldSavePayment:$.setShouldSavePayment};return Object(n.createElement)(F.Provider,{value:re},t)}},,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){e.exports=r(240)},function(e,t){},function(e,t){},function(e,t){},,,,,,function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(146),s=r(32),c=r(11),a=r.n(c),i=r(36),l=r(199),u=r(16),d=r(127),p=r(48),m=r(10),f={CHECKOUT_ACTIONS:r(168),CHECKOUT_BILLING_ADDRESS:r(169),CHECKOUT_CONTACT_INFORMATION:r(170),CHECKOUT_EXPRESS_PAYMENT:r(171),CHECKOUT_FIELDS:r(172),CHECKOUT_ORDER_NOTE:r(173),CHECKOUT_PAYMENT:r(174),CHECKOUT_SHIPPING_ADDRESS:r(175),CHECKOUT_SHIPPING_METHODS:r(176),CHECKOUT_TERMS:r(177),CHECKOUT_TOTALS:r(178),CHECKOUT_ORDER_SUMMARY:r(179),CHECKOUT_ORDER_SUMMARY_SUBTOTAL:r(180),CHECKOUT_ORDER_SUMMARY_FEE:r(181),CHECKOUT_ORDER_SUMMARY_DISCOUNT:r(182),CHECKOUT_ORDER_SUMMARY_SHIPPING:r(183),CHECKOUT_ORDER_SUMMARY_COUPON_FORM:r(184),CHECKOUT_ORDER_SUMMARY_TAXES:r(185),CHECKOUT_ORDER_SUMMARY_CART_ITEMS:r(186)};r.p=p.k,Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_FIELDS,component:Object(n.lazy)(()=>r.e(33).then(r.bind(null,420)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_EXPRESS_PAYMENT,component:Object(n.lazy)(()=>r.e(32).then(r.bind(null,457)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_CONTACT_INFORMATION,component:Object(n.lazy)(()=>r.e(31).then(r.bind(null,435)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_SHIPPING_ADDRESS,component:Object(n.lazy)(()=>Promise.all([r.e(1),r.e(2),r.e(6),r.e(44)]).then(r.bind(null,442)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_BILLING_ADDRESS,component:Object(n.lazy)(()=>Promise.all([r.e(1),r.e(2),r.e(6),r.e(30)]).then(r.bind(null,443)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_SHIPPING_METHODS,component:Object(n.lazy)(()=>Promise.all([r.e(0),r.e(45)]).then(r.bind(null,434)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_PAYMENT,component:Object(n.lazy)(()=>r.e(43).then(r.bind(null,431)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_ORDER_NOTE,component:Object(n.lazy)(()=>r.e(34).then(r.bind(null,444)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_TERMS,component:Object(n.lazy)(()=>r.e(46).then(r.bind(null,458)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_ACTIONS,component:Object(n.lazy)(()=>r.e(29).then(r.bind(null,433)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_TOTALS,component:Object(n.lazy)(()=>r.e(47).then(r.bind(null,421)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_ORDER_SUMMARY,component:Object(n.lazy)(()=>Promise.all([r.e(0),r.e(35)]).then(r.bind(null,459)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_ORDER_SUMMARY_CART_ITEMS,component:Object(n.lazy)(()=>Promise.all([r.e(0),r.e(3),r.e(36)]).then(r.bind(null,436)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_ORDER_SUMMARY_SUBTOTAL,component:Object(n.lazy)(()=>r.e(41).then(r.bind(null,460)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_ORDER_SUMMARY_FEE,component:Object(n.lazy)(()=>r.e(39).then(r.bind(null,461)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_ORDER_SUMMARY_DISCOUNT,component:Object(n.lazy)(()=>r.e(38).then(r.bind(null,462)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_ORDER_SUMMARY_COUPON_FORM,component:Object(n.lazy)(()=>r.e(37).then(r.bind(null,463)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_ORDER_SUMMARY_SHIPPING,component:Object(n.lazy)(()=>Promise.all([r.e(0),r.e(1),r.e(2),r.e(5),r.e(40)]).then(r.bind(null,464)))}),Object(m.registerCheckoutBlock)({metadata:f.CHECKOUT_ORDER_SUMMARY_TAXES,component:Object(n.lazy)(()=>r.e(42).then(r.bind(null,445)))});var h=r(1),b=r(4),g=r.n(b),y=r(251),E=r(132),_=r(123),O=r(15),v=r(258),k=r(2),S=r(74),w=(r(232),r(13)),j=Object(n.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"})),C=r(117);r(233);var R=()=>Object(n.createElement)("div",{className:"wc-block-checkout-empty"},Object(n.createElement)(C.a,{className:"wc-block-checkout-empty__image",icon:j,size:100}),Object(n.createElement)("strong",{className:"wc-block-checkout-empty__title"},Object(h.__)("Your cart is empty!","woo-gutenberg-products-block")),Object(n.createElement)("p",{className:"wc-block-checkout-empty__description"},Object(h.__)("Checkout is not available whilst your cart is empty—please take a look through our store and come back when you're ready to place an order.","woo-gutenberg-products-block")),p.i&&Object(n.createElement)("span",{className:"wp-block-button"},Object(n.createElement)("a",{href:p.i,className:"wp-block-button__link"},Object(h.__)("Browse store","woo-gutenberg-products-block")))),T=Object(n.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M22.7 22.7l-20-20L2 2l-.7-.7L0 2.5 4.4 7l2.2 4.7L5.2 14A2 2 0 007 17h7.5l1.3 1.4a2 2 0 102.8 2.8l2.9 2.8 1.2-1.3zM7.4 15a.2.2 0 01-.2-.3l.9-1.7h2.4l2 2h-5zm8.2-2a2 2 0 001.7-1l3.6-6.5.1-.5c0-.6-.4-1-1-1H6.5l9 9zM7 18a2 2 0 100 4 2 2 0 000-4z"}),Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"})),x=r(17);r(234);const A=["woocommerce_rest_product_out_of_stock","woocommerce_rest_product_not_purchasable","woocommerce_rest_product_partially_out_of_stock","woocommerce_rest_product_too_many_in_cart","woocommerce_rest_cart_item_error"],P=Object(k.getSetting)("checkoutData",{}),M=e=>{let{errorData:t}=e,r=Object(h.__)("Checkout error","woo-gutenberg-products-block");return A.includes(t.code)&&(r=Object(h.__)("There is a problem with your cart","woo-gutenberg-products-block")),Object(n.createElement)("strong",{className:"wc-block-checkout-error_title"},r)},N=e=>{let{errorData:t}=e,r=t.message;return A.includes(t.code)&&(r=r+" "+Object(h.__)("Please edit your cart and try again.","woo-gutenberg-products-block")),Object(n.createElement)("p",{className:"wc-block-checkout-error__description"},r)},I=e=>{let{errorData:t}=e,r=Object(h.__)("Retry","woo-gutenberg-products-block"),o="javascript:window.location.reload(true)";return A.includes(t.code)&&(r=Object(h.__)("Edit your cart","woo-gutenberg-products-block"),o=p.c),Object(n.createElement)("span",{className:"wp-block-button"},Object(n.createElement)("a",{href:o,className:"wp-block-button__link"},r))};var D=()=>{const e={code:"",message:"",...P||{}},t={code:e.code||"unknown",message:Object(x.decodeEntities)(e.message)||Object(h.__)("There was a problem checking out. Please try again. If the problem persists, please get in touch with us so we can assist.","woo-gutenberg-products-block")};return Object(n.createElement)("div",{className:"wc-block-checkout-error"},Object(n.createElement)(C.a,{className:"wc-block-checkout-error__image",icon:T,size:100}),Object(n.createElement)(M,{errorData:t}),Object(n.createElement)(N,{errorData:t}),Object(n.createElement)(I,{errorData:t}))};const L=`${p.e}?redirect_to=${encodeURIComponent(window.location.href)}`,F=()=>{window.location.reload(!0)};var U=r(139),V=r(80),B=r(60);const H=()=>Object(n.createElement)(n.Fragment,null,Object(h.__)("You must be logged in to checkout. ","woo-gutenberg-products-block"),Object(n.createElement)("a",{href:L},Object(h.__)("Click here to log in.","woo-gutenberg-products-block"))),z=e=>{let{attributes:t,children:r}=e;const{hasOrder:o,customerId:c}=Object(i.b)(),{cartItems:a,cartIsLoading:l}=Object(s.a)(),{allowCreateAccount:u,showCompanyField:d,requireCompanyField:p,showApartmentField:m,showPhoneField:f,requirePhoneField:h}=t;return l||0!==a.length?o?((e=>!e&&!Object(k.getSetting)("checkoutAllowsGuest",!1))(c)&&u&&Object(k.getSetting)("checkoutAllowsSignup",!1)&&Object(n.createElement)(H,null),Object(n.createElement)(U.a.Provider,{value:{allowCreateAccount:u,showCompanyField:d,requireCompanyField:p,showApartmentField:m,showPhoneField:f,requirePhoneField:h}},r)):Object(n.createElement)(D,null):Object(n.createElement)(R,null)},G=e=>{let{scrollToTop:t}=e;const{hasError:r,isIdle:o}=Object(i.b)(),{hasValidationErrors:s,showAllValidationErrors:c}=Object(l.b)(),a=o&&r&&(s||Object(V.a)("wc/checkout","default"));return Object(n.useEffect)(()=>{let e;return a&&(c(),e=window.setTimeout(()=>{t({focusableSelector:"input:invalid, .has-error input"})},50)),()=>{clearTimeout(e)}},[a,t,c]),null};var q=Object(S.a)(e=>{let{attributes:t,children:r,scrollToTop:o}=e;return Object(n.createElement)(O.a,{header:Object(h.__)("Something went wrong…","woo-gutenberg-products-block"),text:Object(n.createInterpolateElement)(Object(h.__)("The checkout has encountered an unexpected error. . If the error persists, please get in touch with us so we can assist.","woo-gutenberg-products-block"),{button:Object(n.createElement)("button",{className:"wc-block-link-button",onClick:F})}),showErrorMessage:k.CURRENT_USER_IS_ADMIN},Object(n.createElement)(y.a,{context:"wc/checkout"}),Object(n.createElement)(B.a,null,Object(n.createElement)(_.a,{context:"wc/checkout"}),Object(n.createElement)(l.a,null,Object(n.createElement)(m.SlotFillProvider,null,Object(n.createElement)(E.a,null,Object(n.createElement)(v.a,{className:g()("wc-block-checkout",{"has-dark-controls":t.hasDarkControls})},Object(n.createElement)(z,{attributes:t},r),Object(n.createElement)(G,{scrollToTop:o})))))))});const Y={hasDarkControls:{type:"boolean",default:Object(k.getSetting)("hasDarkEditorStyleSupport",!1)},showRateAfterTaxName:{type:"boolean",default:Object(k.getSetting)("displayCartPricesIncludingTax",!1)}};var $=r(187);Object(d.a)({Block:q,blockName:"woocommerce/checkout",selector:".wp-block-woocommerce-checkout",getProps:e=>({attributes:Object(o.a)({...$.attributes,...Y},e instanceof HTMLElement?e.dataset:{})}),blockMap:Object(u.getRegisteredBlockComponents)("woocommerce/checkout"),blockWrapper:e=>{let{children:t}=e;const{extensions:r,receiveCart:o,...c}=Object(s.a)(),u=(()=>{const{dispatchActions:e,extensionData:t}=Object(i.b)(),r=Object(n.useRef)(t);Object(n.useEffect)(()=>{a()(t,r.current)||(r.current=t)},[t]);const o=Object(n.useCallback)((t,n,o)=>{const s=r.current[t]||{};e.setExtensionData({...r.current,[t]:{...s,[n]:o}})},[e]);return{extensionData:r.current,setExtensionData:o}})(),d=(()=>{const{hasValidationErrors:e,getValidationError:t,clearValidationError:r,hideValidationError:o,setValidationErrors:s}=Object(l.b)(),c="extensions-errors";return{hasValidationErrors:e,getValidationError:Object(n.useCallback)(e=>t(`${c}-${e}`),[t]),clearValidationError:Object(n.useCallback)(e=>r(`${c}-${e}`),[r]),hideValidationError:Object(n.useCallback)(e=>o(`${c}-${e}`),[o]),setValidationErrors:Object(n.useCallback)(e=>s(Object.fromEntries(Object.entries(e).map(e=>{let[t,r]=e;return[`${c}-${t}`,r]}))),[s])}})();return n.Children.map(t,e=>{if(Object(n.isValidElement)(e)){const t={extensions:r,cart:c,checkoutExtensionData:u,validation:d};return Object(n.cloneElement)(e,t)}return e})}})},,,,,,,,,,function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return l}));var n=r(0),o=r(9),s=r(4),c=r.n(s);const a=Object(n.createContext)({hasContainerWidth:!1,containerClassName:"",isMobile:!1,isSmall:!1,isMedium:!1,isLarge:!1}),i=()=>Object(n.useContext)(a),l=e=>{let{children:t,className:r=""}=e;const[s,i]=(()=>{const[e,{width:t}]=Object(o.useResizeObserver)();let r="";return t>700?r="is-large":t>520?r="is-medium":t>400?r="is-small":t&&(r="is-mobile"),[e,r]})(),l={hasContainerWidth:""!==i,containerClassName:i,isMobile:"is-mobile"===i,isSmall:"is-small"===i,isMedium:"is-medium"===i,isLarge:"is-large"===i};return Object(n.createElement)(a.Provider,{value:l},Object(n.createElement)("div",{className:c()(r,i)},s,t))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return b}));var n=r(0),o=r(8),s=r(4),c=r.n(s),a=r(3),i=r(96),l=r(9),u=r(111),d=function({notices:e,className:t,children:r,onRemove:s=a.noop}){const d=Object(l.useReducedMotion)(),[p]=Object(n.useState)(()=>new WeakMap),m=Object(i.useTransition)(e,e=>e.id,{from:{opacity:0,height:0},enter:e=>async t=>await t({opacity:1,height:p.get(e).offsetHeight}),leave:()=>async e=>{await e({opacity:0}),await e({height:0})},immediate:d});t=c()("components-snackbar-list",t);const f=e=>()=>s(e.id);return Object(n.createElement)("div",{className:t},r,m.map(({item:e,key:t,props:r})=>Object(n.createElement)(i.animated.div,{key:t,style:r},Object(n.createElement)("div",{className:"components-snackbar-list__notice-container",ref:t=>t&&p.set(e,t)},Object(n.createElement)(u.a,Object(o.a)({},Object(a.omit)(e,["content"]),{onRemove:f(e)}),e.content)))))},p=r(10),m=r(7),f=r(29);const h={},b=e=>{let{className:t,context:r="default"}=e;const{isEditor:o}=Object(f.a)(),{notices:s}=Object(m.useSelect)(e=>({notices:e("core/notices").getNotices(r)})),{removeNotice:a}=Object(m.useDispatch)("core/notices");if(o)return null;const i=s.filter(e=>"snackbar"===e.type),l=i.length>0?i.reduce((e,t)=>{let{content:r}=t;return e[r]=!0,e},{}):h,u=Object(p.__experimentalApplyCheckoutFilter)({filterName:"snackbarNoticeVisibility",defaultValue:l}),b=i.filter(e=>!0===u[e.content]),g=c()(t,"wc-block-components-notices__snackbar");return Object(n.createElement)(d,{notices:b,className:g,onRemove:()=>{b.forEach(e=>a(e.id,r))}})}},,,,,,,function(e,t,r){"use strict";var n=r(0),o=r(4),s=r.n(o),c=r(250);r(205),t.a=e=>{let{children:t,className:r}=e;return Object(n.createElement)(c.a,{className:s()("wc-block-components-sidebar-layout",r)},t)}}]); \ No newline at end of file diff --git a/build/checkout-order-note-block/block.json b/build/checkout-order-note-block/block.json new file mode 100644 index 00000000000..c4c358412e1 --- /dev/null +++ b/build/checkout-order-note-block/block.json @@ -0,0 +1,30 @@ +{ + "name": "woocommerce/checkout-order-note-block", + "version": "1.0.0", + "title": "Order Note", + "description": "Allow customers to add a note to their order.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "lock": { + "type": "object", + "default": { + "remove": false, + "move": true + } + } + }, + "parent": [ "woocommerce/checkout-fields-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-order-summary-block/block.json b/build/checkout-order-summary-block/block.json new file mode 100644 index 00000000000..7bc0a7a04e7 --- /dev/null +++ b/build/checkout-order-summary-block/block.json @@ -0,0 +1,26 @@ +{ + "name": "woocommerce/checkout-order-summary-block", + "version": "1.0.0", + "title": "Order Summary", + "description": "Show customers a summary of their order.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true + } + } + }, + "parent": [ "woocommerce/checkout-totals-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-order-summary-cart-items-block/block.json b/build/checkout-order-summary-cart-items-block/block.json new file mode 100644 index 00000000000..6063abf365a --- /dev/null +++ b/build/checkout-order-summary-cart-items-block/block.json @@ -0,0 +1,31 @@ +{ + "name": "woocommerce/checkout-order-summary-cart-items-block", + "version": "1.0.0", + "title": "Cart Items", + "description": "Shows cart items.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "lock": false + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "lock": { + "type": "object", + "default": { + "remove": true, + "move": false + } + } + }, + "parent": [ "woocommerce/checkout-order-summary-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-order-summary-coupon-form-block/block.json b/build/checkout-order-summary-coupon-form-block/block.json new file mode 100644 index 00000000000..0aac398caf1 --- /dev/null +++ b/build/checkout-order-summary-coupon-form-block/block.json @@ -0,0 +1,30 @@ +{ + "name": "woocommerce/checkout-order-summary-coupon-form-block", + "version": "1.0.0", + "title": "Coupon Form", + "description": "Shows the apply coupon form.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "lock": { + "type": "object", + "default": { + "remove": false, + "move": false + } + } + }, + "parent": [ "woocommerce/checkout-order-summary-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-order-summary-discount-block/block.json b/build/checkout-order-summary-discount-block/block.json new file mode 100644 index 00000000000..25a304e8e04 --- /dev/null +++ b/build/checkout-order-summary-discount-block/block.json @@ -0,0 +1,31 @@ +{ + "name": "woocommerce/checkout-order-summary-discount-block", + "version": "1.0.0", + "title": "Discount", + "description": "Shows the cart discount row.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "lock": false + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "lock": { + "type": "object", + "default": { + "remove": true, + "move": false + } + } + }, + "parent": [ "woocommerce/checkout-order-summary-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-order-summary-fee-block/block.json b/build/checkout-order-summary-fee-block/block.json new file mode 100644 index 00000000000..9201ac68b5c --- /dev/null +++ b/build/checkout-order-summary-fee-block/block.json @@ -0,0 +1,31 @@ +{ + "name": "woocommerce/checkout-order-summary-fee-block", + "version": "1.0.0", + "title": "Fees", + "description": "Shows the cart fee row.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "lock": false + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "lock": { + "type": "object", + "default": { + "remove": true, + "move": false + } + } + }, + "parent": [ "woocommerce/checkout-order-summary-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-order-summary-shipping-block/block.json b/build/checkout-order-summary-shipping-block/block.json new file mode 100644 index 00000000000..b9350d81b50 --- /dev/null +++ b/build/checkout-order-summary-shipping-block/block.json @@ -0,0 +1,27 @@ +{ + "name": "woocommerce/checkout-order-summary-shipping-block", + "version": "1.0.0", + "title": "Shipping", + "description": "Shows the cart shipping row.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": false + } + } + }, + "parent": [ "woocommerce/checkout-order-summary-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-order-summary-subtotal-block/block.json b/build/checkout-order-summary-subtotal-block/block.json new file mode 100644 index 00000000000..cc0eaab1ae8 --- /dev/null +++ b/build/checkout-order-summary-subtotal-block/block.json @@ -0,0 +1,31 @@ +{ + "name": "woocommerce/checkout-order-summary-subtotal-block", + "version": "1.0.0", + "title": "Subtotal", + "description": "Shows the cart subtotal row.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "lock": false + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "lock": { + "type": "object", + "default": { + "remove": true, + "move": false + } + } + }, + "parent": [ "woocommerce/checkout-order-summary-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-order-summary-taxes-block/block.json b/build/checkout-order-summary-taxes-block/block.json new file mode 100644 index 00000000000..24658d4ba11 --- /dev/null +++ b/build/checkout-order-summary-taxes-block/block.json @@ -0,0 +1,31 @@ +{ + "name": "woocommerce/checkout-order-summary-taxes-block", + "version": "1.0.0", + "title": "Taxes", + "description": "Shows the cart taxes row.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "lock": false + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "lock": { + "type": "object", + "default": { + "remove": true, + "move": false + } + } + }, + "parent": [ "woocommerce/checkout-order-summary-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-payment-block/block.json b/build/checkout-payment-block/block.json new file mode 100644 index 00000000000..94169b163c8 --- /dev/null +++ b/build/checkout-payment-block/block.json @@ -0,0 +1,28 @@ +{ + "name": "woocommerce/checkout-payment-block", + "version": "1.0.0", + "title": "Payment Options", + "description": "Payment options for your store.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/checkout-fields-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-shipping-address-block/block.json b/build/checkout-shipping-address-block/block.json new file mode 100644 index 00000000000..dbffd5e0507 --- /dev/null +++ b/build/checkout-shipping-address-block/block.json @@ -0,0 +1,28 @@ +{ + "name": "woocommerce/checkout-shipping-address-block", + "version": "1.0.0", + "title": "Shipping Address", + "description": "Collect your customer's shipping address.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/checkout-fields-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-shipping-methods-block/block.json b/build/checkout-shipping-methods-block/block.json new file mode 100644 index 00000000000..861a9299560 --- /dev/null +++ b/build/checkout-shipping-methods-block/block.json @@ -0,0 +1,28 @@ +{ + "name": "woocommerce/checkout-shipping-methods-block", + "version": "1.0.0", + "title": "Shipping Options", + "description": "Shipping options for your store.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/checkout-fields-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-terms-block/block.json b/build/checkout-terms-block/block.json new file mode 100644 index 00000000000..a189a8ebfd9 --- /dev/null +++ b/build/checkout-terms-block/block.json @@ -0,0 +1,31 @@ +{ + "name": "woocommerce/checkout-terms-block", + "version": "1.0.0", + "title": "Terms and Conditions", + "description": "Ensure customers agree to your terms and conditions and privacy policy.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "checkbox": { + "type": "boolean", + "default": false + }, + "text": { + "type": "string", + "required": false + } + }, + "parent": [ "woocommerce/checkout-fields-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout-totals-block/block.json b/build/checkout-totals-block/block.json new file mode 100644 index 00000000000..61eaeef919f --- /dev/null +++ b/build/checkout-totals-block/block.json @@ -0,0 +1,32 @@ +{ + "name": "woocommerce/checkout-totals-block", + "version": "1.0.0", + "title": "Checkout Totals", + "description": "Column containing the checkout totals.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "checkbox": { + "type": "boolean", + "default": false + }, + "text": { + "type": "string", + "required": false + } + }, + "parent": [ "woocommerce/checkout" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/checkout.asset.php b/build/checkout.asset.php new file mode 100644 index 00000000000..62d56df410f --- /dev/null +++ b/build/checkout.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'f974961e2b540ede04fb4d75c3332191'); \ No newline at end of file diff --git a/build/checkout.js b/build/checkout.js new file mode 100644 index 00000000000..0ccf449383b --- /dev/null +++ b/build/checkout.js @@ -0,0 +1,50 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks.checkout=function(e){function t(t){for(var o,s,a=t[0],l=t[1],i=t[2],d=0,p=[];d{let{selected:t=[],search:c="",queryArgs:r={}}=e;const a=(e=>{let{selected:t=[],search:c="",queryArgs:r={}}=e;const n=l.o.productCount>100,s={per_page:n?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},a=[Object(o.addQueryArgs)("/wc/store/v1/products",{...s,...r})];return n&&t.length&&a.push(Object(o.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),a})({selected:t,search:c,queryArgs:r});return Promise.all(a.map(e=>n()({path:e}))).then(e=>Object(s.uniqBy)(Object(s.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>n()({path:"/wc/store/v1/products/"+e}),d=()=>n()({path:"wc/store/v1/products/attributes"}),p=e=>n()({path:`wc/store/v1/products/attributes/${e}/terms`}),b=e=>{let{selected:t=[],search:c}=e;const r=(e=>{let{selected:t=[],search:c}=e;const r=Object(a.getSetting)("limitTags",!1),n=[Object(o.addQueryArgs)("wc/store/v1/products/tags",{per_page:r?100:0,orderby:r?"count":"name",order:r?"desc":"asc",search:c})];return r&&t.length&&n.push(Object(o.addQueryArgs)("wc/store/v1/products/tags",{include:t})),n})({selected:t,search:c});return Promise.all(r.map(e=>n()({path:e}))).then(e=>Object(s.uniqBy)(Object(s.flatten)(e),"id"))},m=e=>n()({path:Object(o.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),g=e=>n()({path:"wc/store/v1/products/categories/"+e}),h=e=>n()({path:Object(o.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),O=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},function(e,t){e.exports=window.wc.priceFormat},function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return s}));var o=c(1),r=c(13);const n=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},s=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(r.decodeEntities)(e.message):Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},function(e,t,c){"use strict";var o=c(0),r=c(4),n=c.n(r);t.a=e=>{let t,{label:c,screenReaderLabel:r,wrapperElement:s,wrapperProps:a={}}=e;const l=null!=c,i=null!=r;return!l&&i?(t=s||"span",a={...a,className:n()(a.className,"screen-reader-text")},Object(o.createElement)(t,a,r)):(t=s||o.Fragment,l&&i&&c!==r?Object(o.createElement)(t,a,Object(o.createElement)("span",{"aria-hidden":"true"},c),Object(o.createElement)("span",{className:"screen-reader-text"},r)):Object(o.createElement)(t,a,c))}},,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return r}));const o=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function r(e,t){return o(e)&&t in e}},,function(e,t,c){"use strict";c.d(t,"c",(function(){return n})),c.d(t,"a",(function(){return l})),c.d(t,"b",(function(){return i})),c.d(t,"d",(function(){return d}));var o=c(35);let r,n;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(r||(r={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(n||(n={}));const s=(e,t)=>Object(o.a)(e)&&"type"in e&&e.type===t,a=e=>s(e,r.SUCCESS),l=e=>s(e,r.ERROR),i=e=>s(e,r.FAIL),u=e=>!Object(o.a)(e)||void 0===e.retry||!0===e.retry,d=()=>({responseTypes:r,noticeContexts:n,shouldRetry:u,isSuccessResponse:a,isErrorResponse:l,isFailResponse:i})},function(e,t,c){"use strict";var o=c(6),r=c.n(o),n=c(0),s=c(126),a=c(4),l=c.n(a);c(131);const i=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:c,currency:o,onValueChange:a,displayType:u="text",...d}=e;const p="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(p))return null;const b=p/10**o.minorUnit;if(!Number.isFinite(b))return null;const m=l()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),g={...d,...i(o),value:void 0,currency:void 0,onValueChange:void 0},h=a?e=>{const t=+e.value*10**o.minorUnit;a(t)}:()=>{};return Object(n.createElement)(s.a,r()({className:m,displayType:u},g,{value:b,onValueChange:h}))}},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return j}));var o=c(7),r=c(0),n=c(17),s=c(9),a=c(13),l=c(237),i=c(59),u=c(236);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(s.dispatch)(n.CART_STORE_KEY).invalidateResolutionForStore()},p=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},b=()=>{Object(r.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.a)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.a)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),p),[])},m={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},g={...m,email:""},h={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:n.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},O=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,c]=e;return[t,Object(a.decodeEntities)(c)]})),_={cartCoupons:n.EMPTY_CART_COUPONS,cartItems:n.EMPTY_CART_ITEMS,cartFees:n.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:n.EMPTY_CART_ITEM_ERRORS,cartTotals:h,cartIsLoading:!0,cartErrors:n.EMPTY_CART_ERRORS,billingAddress:g,shippingAddress:m,shippingRates:n.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:n.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:n.EMPTY_EXTENSIONS},j=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:c}=Object(i.b)(),a=null==c?void 0:c.previewCart,{shouldSelect:u}=e,d=Object(r.useRef)();b();const p=Object(s.useSelect)((e,c)=>{let{dispatch:o}=c;if(!u)return _;if(t)return{cartCoupons:a.coupons,cartItems:a.items,cartFees:a.fees,cartItemsCount:a.items_count,cartItemsWeight:a.items_weight,cartNeedsPayment:a.needs_payment,cartNeedsShipping:a.needs_shipping,cartItemErrors:n.EMPTY_CART_ITEM_ERRORS,cartTotals:a.totals,cartIsLoading:!1,cartErrors:n.EMPTY_CART_ERRORS,billingData:g,billingAddress:g,shippingAddress:m,extensions:n.EMPTY_EXTENSIONS,shippingRates:a.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:a.has_calculated_shipping,paymentRequirements:a.paymentRequirements,receiveCart:"function"==typeof(null==a?void 0:a.receiveCart)?a.receiveCart:()=>{}};const r=e(n.CART_STORE_KEY),s=r.getCartData(),i=r.getCartErrors(),d=r.getCartTotals(),p=!r.hasFinishedResolution("getCartData"),b=r.isCustomerDataUpdating(),{receiveCart:h}=o(n.CART_STORE_KEY),j=O(s.billingAddress),E=s.needsShipping?O(s.shippingAddress):j,k=s.fees.length>0?s.fees.map(e=>O(e)):n.EMPTY_CART_FEES;return{cartCoupons:s.coupons.length>0?s.coupons.map(e=>({...e,label:e.code})):n.EMPTY_CART_COUPONS,cartItems:s.items,cartFees:k,cartItemsCount:s.itemsCount,cartItemsWeight:s.itemsWeight,cartNeedsPayment:s.needsPayment,cartNeedsShipping:s.needsShipping,cartItemErrors:s.errors,cartTotals:d,cartIsLoading:p,cartErrors:i,billingData:Object(l.a)(j),billingAddress:Object(l.a)(j),shippingAddress:Object(l.a)(E),extensions:s.extensions,shippingRates:s.shippingRates,isLoadingRates:b,cartHasCalculatedShipping:s.hasCalculatedShipping,paymentRequirements:s.paymentRequirements,receiveCart:h}},[u]);return d.current&&Object(o.isEqual)(d.current,p)||(d.current=p),d.current}},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t,c){"use strict";var o=c(6),r=c.n(o),n=c(0),s=c(71),a=c(112);const l=["BUTTON","FIELDSET","INPUT","OPTGROUP","OPTION","SELECT","TEXTAREA","A"];t.a=e=>{let{children:t,style:c={},...o}=e;const i=Object(n.useRef)(null),u=()=>{i.current&&s.focus.focusable.find(i.current).forEach(e=>{l.includes(e.nodeName)&&e.setAttribute("tabindex","-1"),e.hasAttribute("contenteditable")&&e.setAttribute("contenteditable","false")})},d=Object(a.a)(u,0,{leading:!0});return Object(n.useLayoutEffect)(()=>{let e;return u(),i.current&&(e=new window.MutationObserver(d),e.observe(i.current,{childList:!0,attributes:!0,subtree:!0})),()=>{e&&e.disconnect(),d.cancel()}},[d]),Object(n.createElement)("div",r()({ref:i,"aria-disabled":"true",style:{userSelect:"none",pointerEvents:"none",cursor:"normal",...c}},o),t)}},,function(e,t){e.exports=window.wp.a11y},,,function(e,t){e.exports=window.wp.hooks},function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var o=c(0),r=c(22),n=c.n(r);function s(e){const t=Object(o.useRef)(e);return n()(e,t.current)||(t.current=e),t.current}},,function(e,t){e.exports=window.wp.deprecated},,function(e,t){e.exports=window.wp.keycodes},function(e,t,c){"use strict";c.d(t,"b",(function(){return T})),c.d(t,"a",(function(){return A}));var o=c(0),r=c(1),n=c(109),s=c(51),a=c.n(s),l=c(100),i=c(35),u=c(9);let d;!function(e){e.SET_IDLE="set_idle",e.SET_PRISTINE="set_pristine",e.SET_REDIRECT_URL="set_redirect_url",e.SET_COMPLETE="set_checkout_complete",e.SET_BEFORE_PROCESSING="set_before_processing",e.SET_AFTER_PROCESSING="set_after_processing",e.SET_PROCESSING_RESPONSE="set_processing_response",e.SET_PROCESSING="set_checkout_is_processing",e.SET_HAS_ERROR="set_checkout_has_error",e.SET_NO_ERROR="set_checkout_no_error",e.SET_CUSTOMER_ID="set_checkout_customer_id",e.SET_ORDER_ID="set_checkout_order_id",e.SET_ORDER_NOTES="set_checkout_order_notes",e.INCREMENT_CALCULATING="increment_calculating",e.DECREMENT_CALCULATING="decrement_calculating",e.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS="set_shipping_address_as_billing_address",e.SET_SHOULD_CREATE_ACCOUNT="set_should_create_account",e.SET_EXTENSION_DATA="set_extension_data"}(d||(d={}));const p=()=>({type:d.SET_IDLE}),b=e=>({type:d.SET_REDIRECT_URL,redirectUrl:e}),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:d.SET_COMPLETE,data:e}},g=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:e?d.SET_HAS_ERROR:d.SET_NO_ERROR}};var h=c(2),O=c(237);let _;!function(e){e.PRISTINE="pristine",e.IDLE="idle",e.PROCESSING="processing",e.COMPLETE="complete",e.BEFORE_PROCESSING="before_processing",e.AFTER_PROCESSING="after_processing"}(_||(_={}));const j={order_id:0,customer_id:0,billing_address:{},shipping_address:{},...Object(h.getSetting)("checkoutData",{})||{}},E={redirectUrl:"",status:_.PRISTINE,hasError:!1,calculatingCount:0,orderId:j.order_id,orderNotes:"",customerId:j.customer_id,useShippingAsBilling:Object(O.b)(j.billing_address,j.shipping_address),shouldCreateAccount:!1,processingResponse:null,extensionData:{}},k=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:E,{redirectUrl:t,type:c,customerId:o,orderId:r,orderNotes:n,extensionData:s,useShippingAsBilling:a,shouldCreateAccount:l,data:i}=arguments.length>1?arguments[1]:void 0,u=e;switch(c){case d.SET_PRISTINE:u=E;break;case d.SET_IDLE:u=e.status!==_.IDLE?{...e,status:_.IDLE}:e;break;case d.SET_REDIRECT_URL:u=void 0!==t&&t!==e.redirectUrl?{...e,redirectUrl:t}:e;break;case d.SET_PROCESSING_RESPONSE:u={...e,processingResponse:i};break;case d.SET_COMPLETE:u=e.status!==_.COMPLETE?{...e,status:_.COMPLETE,redirectUrl:"string"==typeof(null==i?void 0:i.redirectUrl)?i.redirectUrl:e.redirectUrl}:e;break;case d.SET_PROCESSING:u=e.status!==_.PROCESSING?{...e,status:_.PROCESSING,hasError:!1}:e,u=!1===u.hasError?u:{...u,hasError:!1};break;case d.SET_BEFORE_PROCESSING:u=e.status!==_.BEFORE_PROCESSING?{...e,status:_.BEFORE_PROCESSING,hasError:!1}:e;break;case d.SET_AFTER_PROCESSING:u=e.status!==_.AFTER_PROCESSING?{...e,status:_.AFTER_PROCESSING}:e;break;case d.SET_HAS_ERROR:u=e.hasError?e:{...e,hasError:!0},u=e.status===_.PROCESSING||e.status===_.BEFORE_PROCESSING?{...u,status:_.IDLE}:u;break;case d.SET_NO_ERROR:u=e.hasError?{...e,hasError:!1}:e;break;case d.INCREMENT_CALCULATING:u={...e,calculatingCount:e.calculatingCount+1};break;case d.DECREMENT_CALCULATING:u={...e,calculatingCount:Math.max(0,e.calculatingCount-1)};break;case d.SET_CUSTOMER_ID:u=void 0!==o?{...e,customerId:o}:e;break;case d.SET_ORDER_ID:u=void 0!==r?{...e,orderId:r}:e;break;case d.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS:void 0!==a&&a!==e.useShippingAsBilling&&(u={...e,useShippingAsBilling:a});break;case d.SET_SHOULD_CREATE_ACCOUNT:void 0!==l&&l!==e.shouldCreateAccount&&(u={...e,shouldCreateAccount:l});break;case d.SET_ORDER_NOTES:void 0!==n&&e.orderNotes!==n&&(u={...e,orderNotes:n});break;case d.SET_EXTENSION_DATA:void 0!==s&&e.extensionData!==s&&(u={...e,extensionData:s})}return u!==e&&c!==d.SET_PRISTINE&&u.status===_.PRISTINE&&(u.status=_.IDLE),u};var y=c(13),f=c(94),w=c(238);var v=c(239),S=c(102),C=c(78),N=c(37),P=c(116);const R=Object(o.createContext)({dispatchActions:{resetCheckout:()=>{},setRedirectUrl:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},incrementCalculating:()=>{},decrementCalculating:()=>{},setCustomerId:e=>{},setOrderId:e=>{},setOrderNotes:e=>{},setExtensionData:e=>{}},onSubmit:()=>{},isComplete:!1,isIdle:!1,isCalculating:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,redirectUrl:"",orderId:0,orderNotes:"",customerId:0,onCheckoutAfterProcessingWithSuccess:()=>()=>{},onCheckoutAfterProcessingWithError:()=>()=>{},onCheckoutBeforeProcessing:()=>()=>{},onCheckoutValidationBeforeProcessing:()=>()=>{},hasOrder:!1,isCart:!1,useShippingAsBilling:!1,setUseShippingAsBilling:e=>{},shouldCreateAccount:!1,setShouldCreateAccount:e=>{},extensionData:{}}),T=()=>Object(o.useContext)(R),A=e=>{let{children:t,redirectUrl:c,isCart:s=!1}=e;E.redirectUrl=c;const[h,O]=Object(o.useReducer)(k,E),{setValidationErrors:j}=Object(S.b)(),{createErrorNotice:T}=Object(u.useDispatch)("core/notices"),{dispatchCheckoutEvent:A}=Object(C.a)(),I=h.calculatingCount>0,{isSuccessResponse:x,isErrorResponse:M,isFailResponse:D,shouldRetry:B}=Object(N.d)(),{checkoutNotices:L,paymentNotices:F,expressPaymentNotices:U}=(()=>{const{noticeContexts:e}=Object(N.d)();return{checkoutNotices:Object(u.useSelect)(e=>e("core/notices").getNotices("wc/checkout"),[]),expressPaymentNotices:Object(u.useSelect)(t=>t("core/notices").getNotices(e.EXPRESS_PAYMENTS),[e.EXPRESS_PAYMENTS]),paymentNotices:Object(u.useSelect)(t=>t("core/notices").getNotices(e.PAYMENTS),[e.PAYMENTS])}})(),[V,q]=Object(o.useReducer)(f.b,{}),$=Object(o.useRef)(V),{onCheckoutAfterProcessingWithSuccess:G,onCheckoutAfterProcessingWithError:H,onCheckoutValidationBeforeProcessing:Y}=(e=>Object(o.useMemo)(()=>({onCheckoutAfterProcessingWithSuccess:Object(w.a)("checkout_after_processing_with_success",e),onCheckoutAfterProcessingWithError:Object(w.a)("checkout_after_processing_with_error",e),onCheckoutValidationBeforeProcessing:Object(w.a)("checkout_validation_before_processing",e)}),[e]))(q);Object(o.useEffect)(()=>{$.current=V},[V]);const z=Object(o.useMemo)(()=>function(){return a()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidationBeforeProcessing",plugin:"WooCommerce Blocks"}),Y(...arguments)},[Y]),W=Object(o.useMemo)(()=>({resetCheckout:()=>{O({type:d.SET_PRISTINE})},setRedirectUrl:e=>{O(b(e))},setHasError:e=>{O(g(e))},incrementCalculating:()=>{O({type:d.INCREMENT_CALCULATING})},decrementCalculating:()=>{O({type:d.DECREMENT_CALCULATING})},setCustomerId:e=>{var t;O((t=e,{type:d.SET_CUSTOMER_ID,customerId:t}))},setOrderId:e=>{O((e=>({type:d.SET_ORDER_ID,orderId:e}))(e))},setOrderNotes:e=>{O((e=>({type:d.SET_ORDER_NOTES,orderNotes:e}))(e))},setExtensionData:e=>{O((e=>({type:d.SET_EXTENSION_DATA,extensionData:e}))(e))},setAfterProcessing:e=>{const t=(e=>{const t={message:"",paymentStatus:"",redirectUrl:"",paymentDetails:{}};return"payment_result"in e&&(t.paymentStatus=e.payment_result.payment_status,t.redirectUrl=e.payment_result.redirect_url,e.payment_result.hasOwnProperty("payment_details")&&Array.isArray(e.payment_result.payment_details)&&e.payment_result.payment_details.forEach(e=>{let{key:c,value:o}=e;t.paymentDetails[c]=Object(y.decodeEntities)(o)})),"message"in e&&(t.message=Object(y.decodeEntities)(e.message)),!t.message&&"data"in e&&"status"in e.data&&e.data.status>299&&(t.message=Object(r.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")),t})(e);var c;O(b((null==t?void 0:t.redirectUrl)||"")),O((c=t,{type:d.SET_PROCESSING_RESPONSE,data:c})),O({type:d.SET_AFTER_PROCESSING})}}),[]);Object(o.useEffect)(()=>{h.status===_.BEFORE_PROCESSING&&(Object(P.a)("error"),Object(v.a)($.current,"checkout_validation_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:c}=e;T(t,{context:"wc/checkout"}),j(c)}),O(p()),O(g())):O({type:d.SET_PROCESSING})}))},[h.status,j,T,O]);const K=Object(n.a)(h.status),X=Object(n.a)(h.hasError);Object(o.useEffect)(()=>{if((h.status!==K||h.hasError!==X)&&h.status===_.AFTER_PROCESSING){const e={redirectUrl:h.redirectUrl,orderId:h.orderId,customerId:h.customerId,orderNotes:h.orderNotes,processingResponse:h.processingResponse};h.hasError?Object(v.b)($.current,"checkout_after_processing_with_error",e).then(t=>{const c=(e=>{let t=null;return e.forEach(e=>{if((M(e)||D(e))&&e.message&&Object(l.a)(e.message)){const c=e.messageContext&&Object(l.a)(e.messageContent)?{context:e.messageContext}:void 0;t=e,T(e.message,c)}}),t})(t);if(null!==c)B(c)?O(p()):O(m(c));else{if(!(L.some(e=>"error"===e.status)||U.some(e=>"error"===e.status)||F.some(e=>"error"===e.status))){var o;const t=(null===(o=e.processingResponse)||void 0===o?void 0:o.message)||Object(r.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");T(t,{id:"checkout",context:"wc/checkout"})}O(p())}}):Object(v.b)($.current,"checkout_after_processing_with_success",e).then(e=>{let t=null,c=null;if(e.forEach(e=>{x(e)&&(t=e),(M(e)||D(e))&&(c=e)}),t&&!c)O(m(t));else if(Object(i.a)(c)){if(c.message&&Object(l.a)(c.message)){const e=c.messageContext&&Object(l.a)(c.messageContext)?{context:c.messageContext}:void 0;T(c.message,e)}B(c)?O(g(!0)):O(m(c))}else O(m())})}},[h.status,h.hasError,h.redirectUrl,h.orderId,h.customerId,h.orderNotes,h.processingResponse,K,X,W,T,M,D,x,B,L,U,F]);const Q={onSubmit:Object(o.useCallback)(()=>{A("submit"),O({type:d.SET_BEFORE_PROCESSING})},[A]),isComplete:h.status===_.COMPLETE,isIdle:h.status===_.IDLE,isCalculating:I,isProcessing:h.status===_.PROCESSING,isBeforeProcessing:h.status===_.BEFORE_PROCESSING,isAfterProcessing:h.status===_.AFTER_PROCESSING,hasError:h.hasError,redirectUrl:h.redirectUrl,onCheckoutBeforeProcessing:z,onCheckoutValidationBeforeProcessing:Y,onCheckoutAfterProcessingWithSuccess:G,onCheckoutAfterProcessingWithError:H,dispatchActions:W,isCart:s,orderId:h.orderId,hasOrder:!!h.orderId,customerId:h.customerId,orderNotes:h.orderNotes,useShippingAsBilling:h.useShippingAsBilling,setUseShippingAsBilling:e=>{return O((t=e,{type:d.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS,useShippingAsBilling:t}));var t},shouldCreateAccount:h.shouldCreateAccount,setShouldCreateAccount:e=>{return O((t=e,{type:d.SET_SHOULD_CREATE_ACCOUNT,shouldCreateAccount:t}));var t},extensionData:h.extensionData};return Object(o.createElement)(R.Provider,{value:Q},t)}},,,,,function(e,t,c){"use strict";c.d(t,"b",(function(){return s})),c.d(t,"a",(function(){return a}));var o=c(0),r=c(9);const n=Object(o.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),s=()=>Object(o.useContext)(n),a=e=>{let{children:t,currentPostId:c=0,currentView:s="",previewData:a={}}=e;const l=Object(r.useSelect)(e=>c||e("core/editor").getCurrentPostId(),[c]),i=Object(o.useCallback)(e=>e in a?a[e]:{},[a]),u={isEditor:!0,currentPostId:l,currentView:s,previewData:a,getPreviewData:i};return Object(o.createElement)(n.Provider,{value:u},t)}},function(e,t){e.exports=window.wp.autop},,,,,,,,function(e,t,c){"use strict";var o=c(6),r=c.n(o),n=c(0),s=c(130),a=c(4),l=c.n(a),i=c(91);c(153),t.a=e=>{let{className:t,showSpinner:c=!1,children:o,variant:a="contained",...u}=e;const d=l()("wc-block-components-button",t,a,{"wc-block-components-button--loading":c});return Object(n.createElement)(s.a,r()({className:d},u),c&&Object(n.createElement)(i.a,null),Object(n.createElement)("span",{className:"wc-block-components-button__text"},o))}},function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(4),s=c.n(n),a=(c(251),c(91));t.a=e=>{let{children:t,className:c,screenReaderLabel:n,showSpinner:l=!1,isLoading:i=!0}=e;return Object(o.createElement)("div",{className:s()(c,{"wc-block-components-loading-mask":i})},i&&l&&Object(o.createElement)(a.a,null),Object(o.createElement)("div",{className:s()({"wc-block-components-loading-mask__children":i}),"aria-hidden":i},t),i&&Object(o.createElement)("span",{className:"screen-reader-text"},n||Object(r.__)("Loading…","woo-gutenberg-products-block")))}},,function(e,t){e.exports=window.wp.dom},function(e,t,c){"use strict";c.d(t,"b",(function(){return s})),c.d(t,"a",(function(){return a}));var o=c(0),r=c(88);const n=Object(o.createContext)({isInitialized:!1,billingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},setBillingAddress:()=>{},setShippingAddress:()=>{}}),s=()=>Object(o.useContext)(n),a=e=>{let{children:t}=e;const c=Object(r.a)();return Object(o.createElement)(n.Provider,{value:c},t)}},,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var o=c(48),r=c(0),n=c(41);const s=()=>{const e=Object(n.a)(),t=Object(r.useRef)(e);return Object(r.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(r.useCallback)((function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...c,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},function(e,t,c){"use strict";var o=c(0),r=c(4),n=c.n(r);c(186),t.a=e=>{let{children:t,className:c}=e;return Object(o.createElement)("div",{className:n()("wc-block-components-product-badge",c)},t)}},function(e,t,c){"use strict";c.d(t,"a",(function(){return d}));var o=c(17),r=c(9),n=c(0),s=c(22),a=c.n(s),l=c(35),i=c(312),u=c(110);const d=()=>{const{shippingRates:e,needsShipping:t,hasCalculatedShipping:c,isLoadingRates:s}=Object(r.useSelect)(e=>{const t=!!e("core/editor"),c=e(o.CART_STORE_KEY);return{shippingRates:t?i.a.shipping_rates:c.getShippingRates(),needsShipping:t?i.a.needs_shipping:c.getNeedsShipping(),hasCalculatedShipping:t?i.a.has_calculated_shipping:c.getHasCalculatedShipping(),isLoadingRates:!t&&c.isCustomerDataUpdating()}}),{isSelectingRate:d,selectShippingRate:p}=Object(u.a)(),b=Object(n.useRef)({});return Object(n.useEffect)(()=>{const t=(e=>Object.fromEntries(e.map(e=>{var t;let{package_id:c,shipping_rates:o}=e;return[c,null===(t=o.find(e=>e.selected))||void 0===t?void 0:t.rate_id]})))(e);Object(l.a)(t)&&!a()(b.current,t)&&(b.current=t)},[e]),{isSelectingRate:d,selectedRates:b.current,selectShippingRate:p,shippingRates:e,needsShipping:t,hasCalculatedShipping:c,isLoadingRates:s}}},,,,,,,function(e,t){e.exports=window.wp.wordcount},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var o=c(9),r=c(17);const n=()=>{const{customerData:e,isInitialized:t}=Object(o.useSelect)(e=>{const t=e(r.CART_STORE_KEY);return{customerData:t.getCustomerData(),isInitialized:t.hasFinishedResolution("getCartData")}}),{setShippingAddress:c,setBillingAddress:n}=Object(o.useDispatch)(r.CART_STORE_KEY);return{isInitialized:t,billingAddress:e.billingAddress,shippingAddress:e.shippingAddress,setBillingAddress:n,setShippingAddress:c}}},,function(e,t,c){"use strict";var o=c(2),r=c(1),n=c(159),s=c(100);const a=Object(o.getSetting)("countryLocale",{}),l=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(r.sprintf)( +/* translators: %s Field label. */ +Object(r.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(n.a)(e.priority)&&(t.index=e.priority),Object(s.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},i=Object.entries(a).map(e=>{let[t,c]=e;return[t,Object.entries(c).map(e=>{let[t,c]=e;return[t,l(c)]}).reduce((e,t)=>{let[c,o]=t;return e[c]=o,e},{})]}).reduce((e,t)=>{let[c,o]=t;return e[c]=o,e},{});t.a=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const r=c&&void 0!==i[c]?i[c]:{};return e.map(e=>({key:e,...o.defaultAddressFields[e]||{},...r[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},function(e,t,c){"use strict";var o=c(0);c(154),t.a=()=>Object(o.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(38),s=c(4),a=c.n(s),l=c(26);c(152);const i=e=>{let{currency:t,maxPrice:c,minPrice:s,priceClassName:i,priceStyle:u={}}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(r.sprintf)( +/* translators: %1$s min price, %2$s max price */ +Object(r.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(l.formatPrice)(s),Object(l.formatPrice)(c))),Object(o.createElement)("span",{"aria-hidden":!0},Object(o.createElement)(n.a,{className:a()("wc-block-components-product-price__value",i),currency:t,value:s,style:u})," — ",Object(o.createElement)(n.a,{className:a()("wc-block-components-product-price__value",i),currency:t,value:c,style:u})))},u=e=>{let{currency:t,regularPriceClassName:c,regularPriceStyle:s,regularPrice:l,priceClassName:i,priceStyle:u,price:d}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(r.__)("Previous price:","woo-gutenberg-products-block")),Object(o.createElement)(n.a,{currency:t,renderText:e=>Object(o.createElement)("del",{className:a()("wc-block-components-product-price__regular",c),style:s},e),value:l}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(r.__)("Discounted price:","woo-gutenberg-products-block")),Object(o.createElement)(n.a,{currency:t,renderText:e=>Object(o.createElement)("ins",{className:a()("wc-block-components-product-price__value","is-discounted",i),style:u},e),value:d}))};t.a=e=>{let{align:t,className:c,currency:r,format:s="",maxPrice:l,minPrice:d,price:p,priceClassName:b,priceStyle:m,regularPrice:g,regularPriceClassName:h,regularPriceStyle:O}=e;const _=a()(c,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+t]:t});s.includes("")||(s="",console.error("Price formats need to include the `` tag."));const j=g&&p!==g;let E=Object(o.createElement)("span",{className:a()("wc-block-components-product-price__value",b)});return j?E=Object(o.createElement)(u,{currency:r,price:p,priceClassName:b,priceStyle:m,regularPrice:g,regularPriceClassName:h,regularPriceStyle:O}):void 0!==d&&void 0!==l?E=Object(o.createElement)(i,{currency:r,maxPrice:l,minPrice:d,priceClassName:b,priceStyle:m}):p&&(E=Object(o.createElement)(n.a,{className:a()("wc-block-components-product-price__value",b),currency:r,value:p,style:m})),Object(o.createElement)("span",{className:_},Object(o.createInterpolateElement)(s,{price:E}))}},,function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return a}));var o=c(7);let r;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(r||(r={}));const n={addEventCallback:function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(o.uniqueId)(),type:r.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:c}},removeEventCallback:(e,t)=>({id:t,type:r.REMOVE_EVENT_CALLBACK,eventType:e})},s={},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,{type:t,eventType:c,id:o,callback:n,priority:a}=arguments.length>1?arguments[1]:void 0;const l=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(t){case r.ADD_EVENT_CALLBACK:return l.set(o,{priority:a,callback:n}),{...e,[c]:l};case r.REMOVE_EVENT_CALLBACK:return l.delete(o),{...e,[c]:l}}}},,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));const o=e=>"string"==typeof e},function(e,t){e.exports=window.wp.warning},function(e,t,c){"use strict";c.d(t,"b",(function(){return l})),c.d(t,"a",(function(){return i}));var o=c(0),r=c(7),n=c(22),s=c.n(n);const a=Object(o.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),l=()=>Object(o.useContext)(a),i=e=>{let{children:t}=e;const[c,n]=Object(o.useState)({}),l=Object(o.useCallback)(e=>c[e],[c]),i=Object(o.useCallback)(e=>{const t=c[e];return!t||t.hidden?"":"validate-error-"+e},[c]),u=Object(o.useCallback)(e=>{n(t=>{if(!t[e])return t;const{[e]:c,...o}=t;return o})},[]),d=Object(o.useCallback)(()=>{n({})},[]),p=Object(o.useCallback)(e=>{e&&n(t=>(e=Object(r.pickBy)(e,(e,c)=>!("string"!=typeof e.message||t.hasOwnProperty(c)&&s()(t[c],e))),0===Object.values(e).length?t:{...t,...e}))},[]),b=Object(o.useCallback)((e,t)=>{n(c=>{if(!c.hasOwnProperty(e))return c;const o={...c[e],...t};return s()(c[e],o)?c:{...c,[e]:o}})},[]),m={getValidationError:l,setValidationErrors:p,clearValidationError:u,clearAllValidationErrors:d,hideValidationError:Object(o.useCallback)(e=>{b(e,{hidden:!0})},[b]),showValidationError:Object(o.useCallback)(e=>{b(e,{hidden:!1})},[b]),showAllValidationErrors:Object(o.useCallback)(()=>{n(e=>{const t={};return Object.keys(e).forEach(c=>{e[c].hidden&&(t[c]={...e[c],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:i};return Object(o.createElement)(a.Provider,{value:m},t)}},,function(e,t,c){"use strict";c.d(t,"b",(function(){return E})),c.d(t,"a",(function(){return k}));var o=c(0);const r={NONE:"none",INVALID_ADDRESS:"invalid_address",UNKNOWN:"unknown_error"},n={INVALID_COUNTRY:"woocommerce_rest_cart_shipping_rates_invalid_country",MISSING_COUNTRY:"woocommerce_rest_cart_shipping_rates_missing_country",INVALID_STATE:"woocommerce_rest_cart_shipping_rates_invalid_state"},s={shippingErrorStatus:{isPristine:!0,isValid:!1,hasInvalidAddress:!1,hasError:!1},dispatchErrorStatus:()=>null,shippingErrorTypes:r,shippingRates:[],isLoadingRates:!1,selectedRates:[],setSelectedRates:()=>null,shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},setShippingAddress:()=>null,onShippingRateSuccess:()=>null,onShippingRateFail:()=>null,onShippingRateSelectSuccess:()=>null,onShippingRateSelectFail:()=>null,needsShipping:!1},a=(e,t)=>{let{type:c}=t;return Object.values(r).includes(c)?c:e};var l=c(94),i=c(238);const u=e=>({onSuccess:Object(i.a)("shipping_rates_success",e),onFail:Object(i.a)("shipping_rates_fail",e),onSelectSuccess:Object(i.a)("shipping_rate_select_success",e),onSelectFail:Object(i.a)("shipping_rate_select_fail",e)});var d=c(239),p=c(54),b=c(41),m=c(110),g=c(80);const{NONE:h,INVALID_ADDRESS:O,UNKNOWN:_}=r,j=Object(o.createContext)(s),E=()=>Object(o.useContext)(j),k=e=>{let{children:t}=e;const{dispatchActions:c}=Object(p.b)(),{shippingRates:s,isLoadingRates:i,cartErrors:E}=Object(b.a)(),{isSelectingRate:k}=Object(m.a)(),{selectedRates:y}=Object(g.a)(),[f,w]=Object(o.useReducer)(a,h),[v,S]=Object(o.useReducer)(l.b,{}),C=Object(o.useRef)(v),N=Object(o.useMemo)(()=>({onShippingRateSuccess:u(S).onSuccess,onShippingRateFail:u(S).onFail,onShippingRateSelectSuccess:u(S).onSelectSuccess,onShippingRateSelectFail:u(S).onSelectFail}),[S]);Object(o.useEffect)(()=>{C.current=v},[v]),Object(o.useEffect)(()=>{i?c.incrementCalculating():c.decrementCalculating()},[i,c]),Object(o.useEffect)(()=>{k?c.incrementCalculating():c.decrementCalculating()},[k,c]),Object(o.useEffect)(()=>{E.length>0&&E.some(e=>!(!e.code||!Object.values(n).includes(e.code)))?w({type:O}):w({type:h})},[E]);const P=Object(o.useMemo)(()=>({isPristine:f===h,isValid:f===h,hasInvalidAddress:f===O,hasError:f===_||f===O}),[f]);Object(o.useEffect)(()=>{i||0!==s.length&&!P.hasError||Object(d.a)(C.current,"shipping_rates_fail",{hasInvalidAddress:P.hasInvalidAddress,hasError:P.hasError})},[s,i,P.hasError,P.hasInvalidAddress]),Object(o.useEffect)(()=>{!i&&s.length>0&&!P.hasError&&Object(d.a)(C.current,"shipping_rates_success",s)},[s,i,P.hasError]),Object(o.useEffect)(()=>{k||(P.hasError?Object(d.a)(C.current,"shipping_rate_select_fail",{hasError:P.hasError,hasInvalidAddress:P.hasInvalidAddress}):Object(d.a)(C.current,"shipping_rate_select_success",y.current))},[y,k,P.hasError,P.hasInvalidAddress]);const R={shippingErrorStatus:P,dispatchErrorStatus:w,shippingErrorTypes:r,...N};return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(j.Provider,{value:R},t))}},,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var o=c(12);function r(e,t){const c=Object(o.useRef)();return Object(o.useEffect)(()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)},[e,t]),c.current}},function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var o=c(9),r=c(0),n=c(17),s=c(124),a=c(78);const l=()=>{const e=Object(s.a)(),{dispatchCheckoutEvent:t}=Object(a.a)(),{selectShippingRate:c}=Object(o.useDispatch)(n.CART_STORE_KEY);return{selectShippingRate:Object(r.useCallback)((o,r)=>{c(o,r).then(()=>{t("set-selected-shipping-rate",{shippingRateId:o})}).catch(t=>{e(t)})},[c,t,e]),isSelectingRate:Object(o.useSelect)(e=>e(n.CART_STORE_KEY).isShippingRateBeingSelected(),[])}}},,,,,function(e,t,c){"use strict";var o=c(6),r=c.n(o),n=c(0),s=c(13),a=c(4),l=c.n(a);c(151),t.a=e=>{let{className:t="",disabled:c=!1,name:o,permalink:a="",target:i,rel:u,style:d,onClick:p,...b}=e;const m=l()("wc-block-components-product-name",t);if(c){const e=b;return Object(n.createElement)("span",r()({className:m},e,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(o)}}))}return Object(n.createElement)("a",r()({className:m,href:a,target:i},b,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(o)},style:d}))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var o=c(9);const r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const c=Object(o.select)("core/notices").getNotices(),{removeNotice:r}=Object(o.dispatch)("core/notices"),n=c.filter(t=>t.status===e);n.forEach(e=>r(e.id,t))}},function(e,t,c){"use strict";var o=c(0),r=c(87),n=c(60);const s=e=>{const t=e.indexOf("

");return-1===t?e:e.substr(0,t+4)},a=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),l=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,i=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…";const o=a(e),r=o.split(" ").splice(0,t).join(" ");return Object(n.autop)(l(r,c))},u=function(e,t){let c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…";const r=a(e),s=r.slice(0,t);if(c)return Object(n.autop)(l(s,o));const i=s.match(/([\s]+)/g),u=i?i.length:0,d=r.slice(0,t+u);return Object(n.autop)(l(d,o))};t.a=e=>{let{source:t,maxLength:c=15,countType:a="words",className:l="",style:d={}}=e;const p=Object(o.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const o=Object(n.autop)(e),a=Object(r.count)(o,c);if(a<=t)return o;const l=s(o),d=Object(r.count)(l,c);return d<=t?l:"words"===c?i(l,t):u(l,t,"characters_including_spaces"===c)}(t,c,a),[t,c,a]);return Object(o.createElement)(o.RawHTML,{style:d,className:l},p)}},function(e,t,c){"use strict";var o=c(0),r=c(4),n=c.n(r),s=c(135);t.a=e=>{let{checked:t,name:c,onChange:r,option:a}=e;const{value:l,label:i,description:u,secondaryLabel:d,secondaryDescription:p}=a;return Object(o.createElement)("label",{className:n()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":t}),htmlFor:`${c}-${l}`},Object(o.createElement)("input",{id:`${c}-${l}`,className:"wc-block-components-radio-control__input",type:"radio",name:c,value:l,onChange:e=>r(e.target.value),checked:t,"aria-describedby":n()({[`${c}-${l}__label`]:i,[`${c}-${l}__secondary-label`]:d,[`${c}-${l}__description`]:u,[`${c}-${l}__secondary-description`]:p})}),Object(o.createElement)(s.a,{id:`${c}-${l}`,label:i,secondaryLabel:d,description:u,secondaryDescription:p}))}},,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var o=c(0);const r=()=>{const[,e]=Object(o.useState)();return Object(o.useCallback)(t=>{e(()=>{throw t})},[])}},,,function(e,t,c){"use strict";var o=c(24),r=c.n(o),n=c(0),s=c(12),a=c(1),l=c(23),i=e=>{let{imageUrl:t=l.m+"/block-error.svg",header:c=Object(a.__)("Oops!","woo-gutenberg-products-block"),text:o=Object(a.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:r,errorMessagePrefix:s=Object(a.__)("Error:","woo-gutenberg-products-block"),button:i,showErrorBlock:u=!0}=e;return u?Object(n.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(n.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(n.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},c&&Object(n.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},c),o&&Object(n.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},o),r&&Object(n.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",r),i&&Object(n.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},i))):null};c(192);class u extends s.Component{constructor(){super(...arguments),r()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(n.createElement)(n.Fragment,null,Object(n.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:c=!0,showErrorBlock:o=!0,text:r,errorMessagePrefix:s,renderError:a,button:l}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof a?a({errorMessage:u}):Object(n.createElement)(i,{showErrorBlock:o,errorMessage:c?u:null,header:e,imageUrl:t,text:r,errorMessagePrefix:s,button:l}):this.props.children}}t.a=u},,,,function(e,t){},,,,function(e,t,c){"use strict";var o=c(0);t.a=e=>{let{label:t,secondaryLabel:c,description:r,secondaryDescription:n,id:s}=e;return Object(o.createElement)("div",{className:"wc-block-components-radio-control__option-layout"},Object(o.createElement)("div",{className:"wc-block-components-radio-control__label-group"},t&&Object(o.createElement)("span",{id:s&&s+"__label",className:"wc-block-components-radio-control__label"},t),c&&Object(o.createElement)("span",{id:s&&s+"__secondary-label",className:"wc-block-components-radio-control__secondary-label"},c)),Object(o.createElement)("div",{className:"wc-block-components-radio-control__description-group"},r&&Object(o.createElement)("span",{id:s&&s+"__description",className:"wc-block-components-radio-control__description"},r),n&&Object(o.createElement)("span",{id:s&&s+"__secondary-description",className:"wc-block-components-radio-control__secondary-description"},n)))}},function(e,t,c){"use strict";var o=c(6),r=c.n(o),n=c(0),s=c(4),a=c.n(s);c(262),t.a=e=>{let{children:t,className:c,headingLevel:o,...s}=e;const l=a()("wc-block-components-title",c),i="h"+o;return Object(n.createElement)(i,r()({className:l},s),t)}},,,,,,,,,function(e,t,c){"use strict";c.d(t,"b",(function(){return n})),c.d(t,"a",(function(){return s}));var o=c(0);const r=Object(o.createContext)({setIsSuppressed:e=>{},isSuppressed:!1}),n=()=>Object(o.useContext)(r),s=e=>{let{children:t}=e;const[c,n]=Object(o.useState)(!1),s={setIsSuppressed:n,isSuppressed:c};return Object(o.createElement)(r.Provider,{value:s},t)}},,,function(e,t,c){"use strict";var o=c(6),r=c.n(o),n=c(0),s=c(4),a=c.n(s);const l=e=>"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--"+e;var i=e=>{let{id:t,src:c=null,alt:o=""}=e;return c?Object(n.createElement)("img",{className:l(t),src:c,alt:o}):null},u=c(23);const d=[{id:"alipay",alt:"Alipay",src:u.m+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:u.m+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:u.m+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:u.m+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:u.m+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:u.m+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:u.m+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:u.m+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:u.m+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:u.m+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:u.m+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:u.m+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:u.m+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:u.m+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:u.m+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:u.m+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:u.m+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:u.m+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:u.m+"payment-methods/wechat.svg"}];var p=c(100);c(189),t.a=e=>{let{icons:t=[],align:c="center",className:o}=e;const s=(e=>{const t={};return e.forEach(e=>{let c={};"string"==typeof e&&(c={id:e,alt:e,src:null}),"object"==typeof e&&(c={id:e.id||"",alt:e.alt||"",src:e.src||null}),c.id&&Object(p.a)(c.id)&&!t[c.id]&&(t[c.id]=c)}),Object.values(t)})(t);if(0===s.length)return null;const l=a()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===c,"wc-block-components-payment-method-icons--align-right":"right"===c},o);return Object(n.createElement)("div",{className:l},s.map(e=>{const t={...e,...(c=e.id,d.find(e=>e.id===c)||{})};var c;return Object(n.createElement)(i,r()({key:"payment-method-icon-"+e.id},t))}))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var o=c(0),r=c(1),n=c(113),s=c(329),a=c(235);c(266);const l=e=>{let{text:t,url:c="https://ideas.woocommerce.com/forums/133476-woocommerce?category_id=384565"}=e;const[l,i]=Object(o.useState)(!1);return Object(o.useEffect)(()=>{i(!0)},[]),l&&Object(o.createElement)("div",{className:"wc-block-feedback-prompt"},Object(o.createElement)(n.a,{icon:s.a}),Object(o.createElement)("h2",{className:"wc-block-feedback-prompt__title"},Object(r.__)("Feedback?","woo-gutenberg-products-block")),Object(o.createElement)("p",{className:"wc-block-feedback-prompt__text"},t),Object(o.createElement)("a",{href:c,className:"wc-block-feedback-prompt__link",rel:"noreferrer noopener",target:"_blank"},Object(r.__)("Give us your feedback.","woo-gutenberg-products-block"),Object(o.createElement)(n.a,{icon:a.a,size:16})))},i=()=>Object(o.createElement)(l,{text:Object(r.__)("We are currently working on improving our cart and checkout blocks to provide merchants with the tools and customization options they need.","woo-gutenberg-products-block"),url:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/new?template=--cart-checkout-feedback.md"})},,function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));const o=e=>"number"==typeof e},function(e,t,c){"use strict";var o=c(24),r=c.n(o),n=c(0),s=c(1),a=c(12),l=c(2),i=c(228),u=c(37);class d extends a.Component{constructor(){super(...arguments),r()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return{errorMessage:e.message,hasError:!0}}render(){const{hasError:e,errorMessage:t}=this.state,{isEditor:c}=this.props;if(e){let e=Object(s.__)("This site is experiencing difficulties with this payment method. Please contact the owner of the site for assistance.","woo-gutenberg-products-block");(c||l.CURRENT_USER_IS_ADMIN)&&(e=t||Object(s.__)("There was an error with this payment method. Please verify it's configured correctly.","woo-gutenberg-products-block"));const o=[{id:"0",content:e,isDismissible:!1,status:"error"}];return Object(n.createElement)(i.a,{additionalNotices:o,context:u.c.PAYMENTS})}return this.props.children}}d.defaultProps={isEditor:!1},t.a=d},function(e,t,c){"use strict";var o=c(0),r=c(4),n=c.n(r),s=c(10),a=c(118);c(260);const l=e=>{let{className:t="",id:c,selected:r,onChange:i,options:u=[]}=e;const d=Object(s.useInstanceId)(l),p=c||d;return u.length?Object(o.createElement)("div",{className:n()("wc-block-components-radio-control",t)},u.map(e=>Object(o.createElement)(a.a,{key:`${p}-${e.value}`,name:"radio-control-"+p,checked:e.value===r,option:e,onChange:t=>{i(t),"function"==typeof e.onChange&&e.onChange(t)}}))):null};t.a=l},,,function(e,t,c){"use strict";c.d(t,"b",(function(){return F})),c.d(t,"a",(function(){return U}));var o=c(0),r=c(35),n=c(9);let s,a;!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(s||(s={})),function(e){e.SET_REGISTERED_PAYMENT_METHODS="set_registered_payment_methods",e.SET_REGISTERED_EXPRESS_PAYMENT_METHODS="set_registered_express_payment_methods",e.SET_SHOULD_SAVE_PAYMENT_METHOD="set_should_save_payment_method",e.SET_ACTIVE_PAYMENT_METHOD="set_active_payment_method"}(a||(a={}));const l={currentStatus:s.PRISTINE,shouldSavePaymentMethod:!1,activePaymentMethod:"",paymentMethodData:{payment_method:""},errorMessage:"",paymentMethods:{},expressPaymentMethods:{}},i={setPaymentStatus:()=>({pristine:()=>{},started:()=>{},processing:()=>{},completed:()=>{},error:e=>{},failed:(e,t)=>{},success:(e,t)=>{}}),currentStatus:{isPristine:!0,isStarted:!1,isProcessing:!1,isFinished:!1,hasError:!1,hasFailed:!1,isSuccessful:!1,isDoingExpressPayment:!1},paymentStatuses:s,paymentMethodData:{},errorMessage:"",activePaymentMethod:"",activeSavedToken:"",setActivePaymentMethod:()=>{},customerPaymentMethods:{},paymentMethods:{},expressPaymentMethods:{},paymentMethodsInitialized:!1,expressPaymentMethodsInitialized:!1,onPaymentProcessing:()=>()=>()=>{},setExpressPaymentError:()=>{},isExpressPaymentMethodActive:!1,setShouldSavePayment:()=>{},shouldSavePayment:!1};var u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,{type:t,paymentMethodData:c,shouldSavePaymentMethod:o=!1,errorMessage:r="",paymentMethods:n={},paymentMethod:i=""}=arguments.length>1?arguments[1]:void 0;switch(t){case s.PRISTINE:return{...l,...e,errorMessage:"",currentStatus:s.PRISTINE};case s.STARTED:return{...e,currentStatus:s.STARTED};case s.ERROR:return e.currentStatus!==s.ERROR?{...e,currentStatus:s.ERROR,errorMessage:r||e.errorMessage}:e;case s.FAILED:return e.currentStatus!==s.FAILED?{...e,currentStatus:s.FAILED,paymentMethodData:c||e.paymentMethodData,errorMessage:r||e.errorMessage}:e;case s.SUCCESS:return e.currentStatus!==s.SUCCESS?{...e,currentStatus:s.SUCCESS,paymentMethodData:c||e.paymentMethodData}:e;case s.PROCESSING:return e.currentStatus!==s.PROCESSING?{...e,currentStatus:s.PROCESSING,errorMessage:""}:e;case s.COMPLETE:return e.currentStatus!==s.COMPLETE?{...e,currentStatus:s.COMPLETE}:e;case a.SET_REGISTERED_PAYMENT_METHODS:return{...e,paymentMethods:n};case a.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:return{...e,expressPaymentMethods:n};case a.SET_SHOULD_SAVE_PAYMENT_METHOD:return{...e,shouldSavePaymentMethod:o};case a.SET_ACTIVE_PAYMENT_METHOD:return{...e,activePaymentMethod:i,paymentMethodData:c||e.paymentMethodData}}},d=c(1),p=c(42),b=c(49),m=c(2),g=c(112),h=c(51),O=c.n(h),_=c(59),j=c(72),E=c(41),k=c(37),y=c(80);const f=(e,t,c,r)=>{const[s,a]=Object(o.useState)(!1),{isEditor:l}=Object(_.b)(),{selectedRates:i}=Object(y.a)(),{billingAddress:u,shippingAddress:p}=Object(j.b)(),h=Object(b.a)(i),k=Object(b.a)(c),f=Object(E.a)(),{cartTotals:w,cartIsLoading:v,cartNeedsShipping:S,paymentRequirements:C}=f,N=Object(o.useRef)({cart:f,cartTotals:w,cartNeedsShipping:S,billingData:u,billingAddress:u,shippingAddress:p,selectedShippingMethods:h,paymentRequirements:C}),{createErrorNotice:P}=Object(n.useDispatch)("core/notices");Object(o.useEffect)(()=>{N.current={cart:f,cartTotals:w,cartNeedsShipping:S,get billingData(){return O()("billingData",{alternative:"billingAddress",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-blocks/pull/6369"}),this.billingAddress},billingAddress:u,shippingAddress:p,selectedShippingMethods:h,paymentRequirements:C}},[f,w,S,u,p,h,C]);const R=Object(o.useCallback)(async()=>{let c={};const o=e=>{c={...c,[e.name]:e}};for(let e=0;e{v||T()},[T,f,h,u,v]),s},w=e=>({type:e}),v=e=>({type:s.ERROR,errorMessage:e}),S=e=>{let{errorMessage:t,paymentMethodData:c}=e;return{type:s.FAILED,errorMessage:t,paymentMethodData:c}},C=e=>{let{paymentMethodData:t}=e;return{type:s.SUCCESS,paymentMethodData:t}},N=e=>({type:a.SET_REGISTERED_PAYMENT_METHODS,paymentMethods:e}),P=e=>({type:a.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,paymentMethods:e}),R=e=>({type:a.SET_SHOULD_SAVE_PAYMENT_METHOD,shouldSavePaymentMethod:e}),T=(e,t)=>({type:a.SET_ACTIVE_PAYMENT_METHOD,paymentMethod:e,paymentMethodData:t});var A=c(88),I=c(54),x=c(94),M=c(238);var D=c(239),B=c(102);const L=Object(o.createContext)(i),F=()=>Object(o.useContext)(L),U=e=>{let{children:t}=e;const{isProcessing:c,isIdle:a,isCalculating:i,hasError:d}=Object(I.b)(),{isEditor:b,getPreviewData:g}=Object(_.b)(),{setValidationErrors:h}=Object(B.b)(),{createErrorNotice:O,removeNotice:j}=Object(n.useDispatch)("core/notices"),{isSuccessResponse:E,isErrorResponse:y,isFailResponse:F,noticeContexts:U}=Object(k.d)(),[V,q]=Object(o.useReducer)(x.b,{}),{onPaymentProcessing:$}=(e=>Object(o.useMemo)(()=>({onPaymentProcessing:Object(M.a)("payment_processing",e)}),[e]))(q),G=Object(o.useRef)(V);Object(o.useEffect)(()=>{G.current=V},[V]);const[H,Y]=Object(o.useReducer)(u,l),{dispatchActions:z,setPaymentStatus:W}=(e=>{const{setBillingAddress:t,setShippingAddress:c}=Object(A.a)();return{dispatchActions:Object(o.useMemo)(()=>({setRegisteredPaymentMethods:t=>{e(N(t))},setRegisteredExpressPaymentMethods:t=>{e(P(t))},setShouldSavePayment:t=>{e(R(t))},setActivePaymentMethod:function(t){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e(T(t,c))}}),[e]),setPaymentStatus:Object(o.useCallback)(()=>({pristine:()=>e(w(s.PRISTINE)),started:()=>e(w(s.STARTED)),processing:()=>e(w(s.PROCESSING)),completed:()=>e(w(s.COMPLETE)),error:t=>e(v(t)),failed:function(c,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;r&&t(r),e(S({errorMessage:c||"",paymentMethodData:o||{}}))},success:function(o){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;r&&t(r),void 0!==typeof n&&null!=n&&n.address&&c(n.address),e(C({paymentMethodData:o}))}}),[e,t,c])}})(Y),K=(e=>{const t=Object(p.getPaymentMethods)(),{noticeContexts:c}=Object(k.d)(),o=new Set([...Object(m.getSetting)("paymentGatewaySortOrder",[]),...Object.keys(t)]);return f(e,t,Array.from(o),c.PAYMENTS)})(z.setRegisteredPaymentMethods),X=(e=>{const t=Object(p.getExpressPaymentMethods)(),{noticeContexts:c}=Object(k.d)();return f(e,t,Object.keys(t),c.EXPRESS_PAYMENTS)})(z.setRegisteredExpressPaymentMethods),Q=Object(o.useMemo)(()=>b?g("previewSavedPaymentMethods"):K?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===Object.keys(e).length)return{};const t=Object(m.getSetting)("customerPaymentMethods",{}),c=Object.keys(t),o={};return c.forEach(c=>{const r=t[c].filter(t=>{var c;let{method:{gateway:o}}=t;return o in e&&(null===(c=e[o].supports)||void 0===c?void 0:c.showSavedCards)});r.length&&(o[c]=r)}),o}(H.paymentMethods):{},[b,g,K,H.paymentMethods]),J=Object(o.useCallback)(e=>{e?O(e,{id:"wc-express-payment-error",context:U.EXPRESS_PAYMENTS}):j("wc-express-payment-error",U.EXPRESS_PAYMENTS)},[O,U.EXPRESS_PAYMENTS,j]),Z=Object.keys(H.expressPaymentMethods).includes(H.activePaymentMethod),ee=Object(o.useMemo)(()=>({isPristine:H.currentStatus===s.PRISTINE,isStarted:H.currentStatus===s.STARTED,isProcessing:H.currentStatus===s.PROCESSING,isFinished:[s.ERROR,s.FAILED,s.SUCCESS].includes(H.currentStatus),hasError:H.currentStatus===s.ERROR,hasFailed:H.currentStatus===s.FAILED,isSuccessful:H.currentStatus===s.SUCCESS,isDoingExpressPayment:H.currentStatus!==s.PRISTINE&&Z}),[H.currentStatus,Z]);Object(o.useEffect)(()=>{const e=Object.keys(H.paymentMethods);if(!K||!e.length)return;const t=[...e,...Object.keys(H.expressPaymentMethods)];if(H.activePaymentMethod&&t.includes(H.activePaymentMethod))return;W().pristine();const c=Object.keys(Q).flatMap(e=>Q[e])[0]||void 0;if(c){const e=c.tokenId.toString(),t=c.method.gateway,o=`wc-${t}-payment-token`;z.setActivePaymentMethod(t,{token:e,payment_method:t,[o]:e,isSavedToken:!0})}else z.setActivePaymentMethod(Object.keys(H.paymentMethods)[0])},[K,H.paymentMethods,H.expressPaymentMethods,z,W,H.activePaymentMethod,Q]),Object(o.useEffect)(()=>{!c||d||i||ee.isFinished||W().processing()},[c,d,i,ee.isFinished,W]),Object(o.useEffect)(()=>{a&&!ee.isSuccessful&&W().pristine()},[a,ee.isSuccessful,W]),Object(o.useEffect)(()=>{d&&ee.isSuccessful&&W().pristine()},[d,ee.isSuccessful,W]),Object(o.useEffect)(()=>{ee.isProcessing&&(j("wc-payment-error",U.PAYMENTS),Object(D.b)(G.current,"payment_processing",{}).then(e=>{let t,c;var o,r,n,s,a,l;if(e.forEach(e=>{E(e)&&(t=e),(y(e)||F(e))&&(c=e)}),t&&!c)W().success(null===(o=t)||void 0===o||null===(r=o.meta)||void 0===r?void 0:r.paymentMethodData,null===(n=t)||void 0===n||null===(s=n.meta)||void 0===s?void 0:s.billingAddress,null===(a=t)||void 0===a||null===(l=a.meta)||void 0===l?void 0:l.shippingData);else if(c&&F(c)){var i,u,d,p,b,m;c.message&&c.message.length&&O(c.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(m=c)||void 0===m?void 0:m.messageContext)||U.PAYMENTS}),W().failed(null===(i=c)||void 0===i?void 0:i.message,null===(u=c)||void 0===u||null===(d=u.meta)||void 0===d?void 0:d.paymentMethodData,null===(p=c)||void 0===p||null===(b=p.meta)||void 0===b?void 0:b.billingAddress)}else if(c){var g,_;c.message&&c.message.length&&O(c.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(_=c)||void 0===_?void 0:_.messageContext)||U.PAYMENTS}),W().error(c.message),h(null===(g=c)||void 0===g?void 0:g.validationErrors)}else W().success()}))},[ee.isProcessing,h,W,j,U.PAYMENTS,E,F,y,O]);const te="object"==typeof H.paymentMethodData&&Object(r.b)(H.paymentMethodData,"token")?H.paymentMethodData.token+"":"",ce={setPaymentStatus:W,currentStatus:ee,paymentStatuses:s,paymentMethodData:H.paymentMethodData,errorMessage:H.errorMessage,activePaymentMethod:H.activePaymentMethod,activeSavedToken:te,setActivePaymentMethod:z.setActivePaymentMethod,onPaymentProcessing:$,customerPaymentMethods:Q,paymentMethods:H.paymentMethods,expressPaymentMethods:H.expressPaymentMethods,paymentMethodsInitialized:K,expressPaymentMethodsInitialized:X,setExpressPaymentError:J,isExpressPaymentMethodActive:Z,shouldSavePayment:H.shouldSavePaymentMethod,setShouldSavePayment:z.setShouldSavePayment};return Object(o.createElement)(L.Provider,{value:ce},t)}},,,,,,,function(e,t,c){"use strict";c.d(t,"b",(function(){return s})),c.d(t,"a",(function(){return a}));var o=c(49),r=c(164);const n=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{paymentMethods:t,expressPaymentMethods:c,paymentMethodsInitialized:n,expressPaymentMethodsInitialized:s}=Object(r.b)(),a=Object(o.a)(t),l=Object(o.a)(c);return{paymentMethods:e?l:a,isInitialized:e?s:n}},s=()=>n(!1),a=()=>n(!0)},,function(e,t){},,,,,,,,,function(e,t){},,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(280),s=c(171),a=c(59),l=c(164),i=c(51),u=c.n(i),d=c(160);t.a=()=>{const{isEditor:e}=Object(a.b)(),{setActivePaymentMethod:t,setExpressPaymentError:c,activePaymentMethod:i,paymentMethodData:p,setPaymentStatus:b}=Object(l.b)(),m=Object(n.a)(),{paymentMethods:g}=Object(s.a)(),h=Object(o.useRef)(i),O=Object(o.useRef)(p),_=Object(o.useCallback)(e=>()=>{h.current=i,O.current=p,b().started(),t(e)},[i,p,t,b]),j=Object(o.useCallback)(()=>{b().pristine(),t(h.current,O.current)},[t,b]),E=Object(o.useCallback)(e=>{b().error(e),c(e),t(h.current,O.current)},[t,b,c]),k=Object(o.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";u()("Express Payment Methods should use the provided onError handler instead.",{alternative:"onError",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),e?E(e):c("")}),[c,E]),y=Object.entries(g),f=y.length>0?y.map(t=>{let[c,r]=t;const n=e?r.edit:r.content;return Object(o.isValidElement)(n)?Object(o.createElement)("li",{key:c,id:"express-payment-method-"+c},Object(o.cloneElement)(n,{...m,onClick:_(c),onClose:j,onError:E,setExpressPaymentError:k})):null}):Object(o.createElement)("li",{key:"noneRegistered"},Object(r.__)("No registered Payment Methods","woo-gutenberg-products-block"));return Object(o.createElement)(d.a,{isEditor:e},Object(o.createElement)("ul",{className:"wc-block-components-express-payment__event-buttons"},f))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var o=c(1),r=c(9),n=c(17),s=c(13),a=c(41),l=c(102);const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{cartCoupons:t,cartIsLoading:c}=Object(a.a)(),{createErrorNotice:i}=Object(r.useDispatch)("core/notices"),{createNotice:u}=Object(r.useDispatch)("core/notices"),{setValidationErrors:d}=Object(l.b)(),{applyCoupon:p,removeCoupon:b,isApplyingCoupon:m,isRemovingCoupon:g}=Object(r.useSelect)((e,t)=>{let{dispatch:c}=t;const o=e(n.CART_STORE_KEY),r=c(n.CART_STORE_KEY);return{applyCoupon:r.applyCoupon,removeCoupon:r.removeCoupon,isApplyingCoupon:o.isApplyingCoupon(),isRemovingCoupon:o.isRemovingCoupon(),receiveApplyingCoupon:r.receiveApplyingCoupon}},[i,u]),h=t=>{p(t).then(c=>{!0===c&&u("info",Object(o.sprintf)( +/* translators: %s coupon code. */ +Object(o.__)('Coupon code "%s" has been applied to your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(e=>{d({coupon:{message:Object(s.decodeEntities)(e.message),hidden:!1}}),receiveApplyingCoupon("")})},O=t=>{b(t).then(c=>{!0===c&&u("info",Object(o.sprintf)( +/* translators: %s coupon code. */ +Object(o.__)('Coupon code "%s" has been removed from your cart.',"woo-gutenberg-products-block"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(t=>{i(t.message,{id:"coupon-form",context:e}),receiveApplyingCoupon("")})};return{appliedCoupons:t,isLoading:c,applyCoupon:h,removeCoupon:O,isApplyingCoupon:m,isRemovingCoupon:g}}},function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(3),s=c(9),a=c(25);t.a=e=>{let{setPageId:t,pageId:c,labels:l}=e;const i=Object(s.useSelect)(e=>e("core").getEntityRecords("postType","page",{status:"publish",orderby:"title",order:"asc",per_page:100}),[])||null;return i?Object(o.createElement)(n.PanelBody,{title:l.title},Object(o.createElement)(n.SelectControl,{label:Object(r.__)("Link to","woo-gutenberg-products-block"),value:c,options:[{label:l.default,value:0},...i.map(e=>({label:Object(a.a)(e,i),value:parseInt(e.id,10)}))],onChange:e=>t(parseInt(e,10))})):null}},function(e,t){e.exports=window.wp.plugins},,,function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(45),s=c(69),a=c(18),l=c(420),i=c(41),u=c(59),d=c(4),p=c.n(d),b=c(13),m=c(28),g=c(110),h=c(161),O=c(135),_=c(26),j=c(38),E=c(2);const k=e=>{const t=Object(E.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(b.decodeEntities)(e.name),value:e.rate_id,description:Object(o.createElement)(o.Fragment,null,Number.isFinite(t)&&Object(o.createElement)(j.a,{currency:Object(_.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,Object(b.decodeEntities)(e.delivery_time))}};var y=e=>{let{className:t="",noResultsMessage:c,onSelectRate:r,rates:n,renderOption:s=k,selectedRate:a}=e;const l=(null==a?void 0:a.rate_id)||"",[i,u]=Object(o.useState)(l);if(Object(o.useEffect)(()=>{l&&u(l)},[l]),0===n.length)return c;if(n.length>1)return Object(o.createElement)(h.a,{className:t,onChange:e=>{u(e),r(e)},selected:i,options:n.map(s)});const{label:d,secondaryLabel:p,description:b,secondaryDescription:m}=s(n[0]);return Object(o.createElement)(O.a,{label:d,secondaryLabel:p,description:b,secondaryDescription:m})};c(259);var f=e=>{let{packageId:t,className:c="",noResultsMessage:n,renderOption:s,packageData:l,collapsible:i=!1,collapse:u=!1,showItems:d=!1}=e;const{selectShippingRate:h}=Object(g.a)(),O=Object(o.createElement)(o.Fragment,null,(d||i)&&Object(o.createElement)("div",{className:"wc-block-components-shipping-rates-control__package-title"},l.name),d&&Object(o.createElement)("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(l.items).map(e=>{const t=Object(b.decodeEntities)(e.name),c=e.quantity;return Object(o.createElement)("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},Object(o.createElement)(m.a,{label:c>1?`${t} × ${c}`:""+t,screenReaderLabel:Object(r.sprintf)( +/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */ +Object(r._n)("%1$s (%2$d unit)","%1$s (%2$d units)",c,"woo-gutenberg-products-block"),t,c)}))}))),_=Object(o.createElement)(y,{className:c,noResultsMessage:n,rates:l.shipping_rates,onSelectRate:e=>h(e,t),selectedRate:l.shipping_rates.find(e=>e.selected),renderOption:s});return i?Object(o.createElement)(a.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!u,title:O},_):Object(o.createElement)("div",{className:p()("wc-block-components-shipping-rates-control__package",c)},O,_)};const w=e=>{let{packages:t,collapse:c,showItems:r,collapsible:n,noResultsMessage:s,renderOption:a}=e;return t.length?Object(o.createElement)(o.Fragment,null,t.map(e=>{let{package_id:l,...i}=e;return Object(o.createElement)(f,{key:l,packageId:l,packageData:i,collapsible:!!n,collapse:!!c,showItems:r||t.length>1,noResultsMessage:s,renderOption:a})})):null};t.a=e=>{let{shippingRates:t,isLoadingRates:c,className:d,collapsible:p=!1,noResultsMessage:b,renderOption:m,context:g}=e;Object(o.useEffect)(()=>{if(c)return;const e=Object(l.a)(t),o=Object(l.b)(t);1===e?Object(n.speak)(Object(r.sprintf)( +/* translators: %d number of shipping options found. */ +Object(r._n)("%d shipping option was found.","%d shipping options were found.",o,"woo-gutenberg-products-block"),o)):Object(n.speak)(Object(r.sprintf)( +/* translators: %d number of shipping packages packages. */ +Object(r._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",e,"woo-gutenberg-products-block"),e)+" "+Object(r.sprintf)( +/* translators: %d number of shipping options available. */ +Object(r._n)("%d shipping option was found","%d shipping options were found",o,"woo-gutenberg-products-block"),o))},[c,t]);const{extensions:h,receiveCart:O,..._}=Object(i.a)(),j={className:d,collapsible:p,noResultsMessage:b,renderOption:m,extensions:h,cart:_,components:{ShippingRatesControlPackage:f},context:g,shippingRates:t},{isEditor:E}=Object(u.b)();return Object(o.createElement)(s.a,{isLoading:c,screenReaderLabel:Object(r.__)("Loading shipping rates…","woo-gutenberg-products-block"),showSpinner:!0},E?Object(o.createElement)(w,{packages:t,noResultsMessage:b,renderOption:m}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.ExperimentalOrderShippingPackages.Slot,j),Object(o.createElement)(a.ExperimentalOrderShippingPackages,null,Object(o.createElement)(w,{showItems:t.length>1,packages:t,noResultsMessage:b,renderOption:m}))))}},,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var o=c(0),r=c(102);c(173);const n=e=>{let{errorMessage:t="",propertyName:c="",elementId:n=""}=e;const{getValidationError:s,getValidationErrorId:a}=Object(r.b)();if(!t||"string"!=typeof t){const e=s(c)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(o.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(o.createElement)("p",{id:a(n)},t))}},function(e,t,c){"use strict";var o=c(6),r=c.n(o),n=c(0),s=c(13),a=c(2);c(185),t.a=e=>{let{image:t={},fallbackAlt:c=""}=e;const o=t.thumbnail?{src:t.thumbnail,alt:Object(s.decodeEntities)(t.alt)||c||"Product Image"}:{src:a.PLACEHOLDER_IMG_SRC,alt:""};return Object(n.createElement)("img",r()({className:"wc-block-components-product-image"},o,{alt:o.alt}))}},function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(79);t.a=()=>Object(o.createElement)(n.a,{className:"wc-block-components-product-backorder-badge"},Object(r.__)("Available on backorder","woo-gutenberg-products-block"))},function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(79);t.a=e=>{let{lowStockRemaining:t}=e;return t?Object(o.createElement)(n.a,{className:"wc-block-components-product-low-stock-badge"},Object(r.sprintf)( +/* translators: %d stock amount (number of items in stock for product) */ +Object(r.__)("%d left in stock","woo-gutenberg-products-block"),t)):null}},function(e,t,c){"use strict";var o=c(0),r=c(7),n=c(13);c(188);var s=e=>{let{details:t=[]}=e;return Array.isArray(t)?(t=t.filter(e=>!e.hidden),0===t.length?null:Object(o.createElement)("ul",{className:"wc-block-components-product-details"},t.map(e=>{const t=(null==e?void 0:e.key)||e.name||"",c=t?"wc-block-components-product-details__"+Object(r.kebabCase)(t):"";return Object(o.createElement)("li",{key:t+(e.display||e.value),className:c},t&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"wc-block-components-product-details__name"},Object(n.decodeEntities)(t),":")," "),Object(o.createElement)("span",{className:"wc-block-components-product-details__value"},Object(n.decodeEntities)(e.display||e.value)))}))):null},a=c(117),l=c(23),i=e=>{let{className:t,shortDescription:c="",fullDescription:r=""}=e;const n=c||r;return n?Object(o.createElement)(a.a,{className:t,source:n,maxLength:15,countType:l.o.wordCountType||"words"}):null};c(187),t.a=e=>{let{shortDescription:t="",fullDescription:c="",itemData:r=[],variation:n=[]}=e;return Object(o.createElement)("div",{className:"wc-block-components-product-metadata"},Object(o.createElement)(i,{className:"wc-block-components-product-metadata__description",shortDescription:t,fullDescription:c}),Object(o.createElement)(s,{details:r}),Object(o.createElement)(s,{details:n.map(e=>{let{attribute:t="",value:c}=e;return{key:t,value:c}})}))}},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return p}));var o=c(6),r=c.n(o),n=c(0),s=c(4),a=c.n(s),l=c(283),i=c(9),u=(c(182),c(145));const d=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""},p=e=>{let{className:t,context:c="default",additionalNotices:o=[]}=e;const{isSuppressed:s}=Object(u.b)(),{notices:p}=Object(i.useSelect)(e=>({notices:e("core/notices").getNotices(c)})),{removeNotice:b}=Object(i.useDispatch)("core/notices"),m=p.filter(e=>"snackbar"!==e.type).concat(o);if(!m.length)return null;const g=a()(t,"wc-block-components-notices");return s?null:Object(n.createElement)("div",{className:g},m.map(e=>Object(n.createElement)(l.a,r()({key:"store-notice-"+e.id},e,{className:a()("wc-block-components-notices__notice",d(e)),onRemove:()=>{e.isDismissible&&b(e.id,c)}}),e.content)))}},,,,function(e,t,c){"use strict";var o=c(6),r=c.n(o),n=c(0),s=c(4),a=c.n(s),l=c(1),i=c(113),u=c(521);c(184);var d=e=>{let{text:t,screenReaderText:c="",element:o="li",className:s="",radius:l="small",children:i=null,...u}=e;const d=o,p=a()(s,"wc-block-components-chip","wc-block-components-chip--radius-"+l),b=Boolean(c&&c!==t);return Object(n.createElement)(d,r()({className:p},u),Object(n.createElement)("span",{"aria-hidden":b,className:"wc-block-components-chip__text"},t),b&&Object(n.createElement)("span",{className:"screen-reader-text"},c),i)};t.a=e=>{let{ariaLabel:t="",className:c="",disabled:o=!1,onRemove:s=(()=>{}),removeOnAnyClick:p=!1,text:b,screenReaderText:m="",...g}=e;const h=p?"span":"button";if(!t){const e=m&&"string"==typeof m?m:b;t="string"!=typeof e? +/* translators: Remove chip. */ +Object(l.__)("Remove","woo-gutenberg-products-block"):Object(l.sprintf)( +/* translators: %s text of the chip to remove. */ +Object(l.__)('Remove "%s"',"woo-gutenberg-products-block"),e)}const O={"aria-label":t,disabled:o,onClick:s,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||s()}},_=p?O:{},j=p?{"aria-hidden":!0}:O;return Object(n.createElement)(d,r()({},g,_,{className:a()(c,"is-removable"),element:p?"button":g.element,screenReaderText:m,text:b}),Object(n.createElement)(h,r()({className:"wc-block-components-chip__remove"},j),Object(n.createElement)(i.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},,function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout","version":"1.0.0","title":"Checkout","description":"Display a checkout form so your customers can submit orders.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"align":["wide"],"html":false,"multiple":false},"attributes":{"isPreview":{"type":"boolean","default":false,"save":false},"showCompanyField":{"type":"boolean","default":false},"requireCompanyField":{"type":"boolean","default":false},"allowCreateAccount":{"type":"boolean","default":false},"showApartmentField":{"type":"boolean","default":true},"showPhoneField":{"type":"boolean","default":true},"requirePhoneField":{"type":"boolean","default":false}},"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},,function(e,t,c){"use strict";c.d(t,"c",(function(){return s})),c.d(t,"b",(function(){return a})),c.d(t,"a",(function(){return l}));const o=window.CustomEvent||null,r=(e,t)=>{let{bubbles:c=!1,cancelable:r=!1,element:n,detail:s={}}=t;if(!o)return;n||(n=document.body);const a=new o(e,{bubbles:c,cancelable:r,detail:s});n.dispatchEvent(a)};let n;const s=()=>{n&&clearTimeout(n),n=setTimeout(()=>{r("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},a=e=>{let{preserveCartData:t=!1}=e;r("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},l=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const n=()=>{r(t,{bubbles:c,cancelable:o})};return jQuery(document).on(e,n),()=>jQuery(document).off(e,n)}},function(e,t,c){"use strict";c.d(t,"b",(function(){return n})),c.d(t,"a",(function(){return s}));var o=c(90),r=(c(15),c(2));const n=(e,t)=>Object.keys(r.defaultAddressFields).every(c=>e[c]===t[c]),s=e=>{const t=Object.keys(r.defaultAddressFields),c=Object(o.a)(t,{},e.country),n=Object.assign({},e);return c.forEach(t=>{let{key:c="",hidden:o=!1}=t;o&&((e,t)=>e in t)(c,e)&&(n[c]="")}),n}},function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var o=c(94);const r=(e,t)=>function(c){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const n=o.a.addEventCallback(e,c,r);return t(n),()=>{t(o.a.removeEventCallback(e,n.id))}}},function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return s}));const o=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var r=c(37);const n=async(e,t,c)=>{const r=o(e,t),n=[];for(const e of r)try{const t=await Promise.resolve(e.callback(c));"object"==typeof t&&n.push(t)}catch(e){console.error(e)}return!n.length||n},s=async(e,t,c)=>{const n=[],s=o(e,t);for(const e of s)try{const t=await Promise.resolve(e.callback(c));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(r.a)(t)||Object(r.b)(t))return n.push(t),n;n.push(t)}catch(e){return console.error(e),n.push({type:"error"}),n}return n}},,,,,function(e,t,c){"use strict";var o=c(0),r=c(11);const n=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(o.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));t.a=n},,,,function(e,t){},,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,c){"use strict";var o=c(0),r=c(10),n=c(5),s=c(48),a=c(3),l=c(1);c(264);const i=[],u=e=>{let{block:t}=e;const[c,r]=(e=>{const[t,c]=((e,t)=>{const[c,r]=Object(o.useState)(()=>{const c=window.localStorage.getItem(e);if(c)try{return JSON.parse(c)}catch{console.error(`Value for key '${e}' could not be retrieved from localStorage because it can't be parsed.`)}return t});return Object(o.useEffect)(()=>{try{window.localStorage.setItem(e,JSON.stringify(c))}catch{console.error(`Value for key '${e}' could not be saved in localStorage because it can't be converted into a string.`)}},[e,c]),[c,r]})("wc-blocks_dismissed_sidebar_compatibility_notices",i),[r,n]=Object(o.useState)(!1),s=t.includes(e);return Object(o.useEffect)(()=>{n(!s)},[s]),[r,()=>{const o=new Set(t);o.add(e),c([...o])}]})(t),n=Object(o.createInterpolateElement)(Object(l.__)("The Cart & Checkout Blocks are a beta feature to optimize for faster checkout. To make sure this feature is right for your store, review the list of compatible extensions.","woo-gutenberg-products-block"),{a:Object(o.createElement)(a.ExternalLink,{href:"https://woocommerce.com/document/cart-checkout-blocks-support-status/#section-3"})});return Object(o.createElement)("div",{className:"wc-blocks-sidebar-compatibility-notice",style:{display:c?"block":"none"}},Object(o.createElement)(a.Notice,{onRemove:r,className:"wc-blocks-sidebar-compatibility-notice__notice"},n))};var d=c(9),p=c(149),b=(c(263),c(2)),m=c(23);function g(e){const t="cart"===e.block?m.c:m.e;return Object(d.useSelect)(e=>e("core/editor").getCurrentPostId())!==t?Object(o.createElement)(a.Notice,{className:"wc-block-cart__page-notice",isDismissible:!1,status:"warning"},Object(o.createInterpolateElement)(Object(l.sprintf)( +/* translators: %s is the block name. It will be cart or checkout. */ +Object(l.__)("If you would like to use this block as your default %s you must update your page settings in WooCommerce.","woo-gutenberg-products-block"),e.block),{a:Object(o.createElement)("a",{href:Object(b.getAdminLink)("admin.php?page=wc-settings&tab=advanced"),target:"_blank",rel:"noopener noreferrer"})})):null}c(265);const h=Object(r.createHigherOrderComponent)(e=>t=>{const c=["woocommerce/checkout-shipping-address-block","woocommerce/checkout-billing-address-block","woocommerce/checkout-contact-information-block","woocommerce/checkout-fields-block"],{clientId:r}=t,{isCart:s,isCheckout:a,isAddressFieldBlock:l}=Object(d.useSelect)(e=>{const{getBlockParentsByBlockName:t,getBlockName:o}=e(n.store),s=t(r,["woocommerce/cart","woocommerce/checkout"]).map(o),a=o(r);return{isCart:s.includes("woocommerce/cart")||"woocommerce/cart"===a,isCheckout:s.includes("woocommerce/checkout")||"woocommerce/checkout"===a,isAddressFieldBlock:c.includes(a)}});return Object(o.createElement)(o.Fragment,null,(s||a)&&Object(o.createElement)(n.InspectorControls,null,Object(o.createElement)(u,{block:a?"checkout":"cart"}),Object(o.createElement)(g,{block:a?"checkout":"cart"}),l?null:Object(o.createElement)(p.a,null)),Object(o.createElement)(e,t))},"withSidebarNotices");Object(s.hasFilter)("editor.BlockEdit","woocommerce/add/sidebar-compatibility-notice")||Object(s.addFilter)("editor.BlockEdit","woocommerce/add/sidebar-compatibility-notice",h,11)},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return f}));var o=c(0),r=c(208),n=c(2),s=c(127),a=c(164),l=c(104),i=c(72),u=c(54),d=c(1),p=c(14),b=c.n(p),m=c(237),g=c(27),h=c(9);const O=(e,t,c)=>{const o=Object.keys(e).map(t=>({key:t,value:e[t]}),[]),r=`wc-${c}-new-payment-method`;return o.push({key:r,value:t}),o},_=(e,t)=>{b.a.setNonce&&"function"==typeof b.a.setNonce&&b.a.setNonce(e),null!=e&&e.get("User-ID")&&t.setCustomerId(parseInt(e.get("User-ID")||"0",10))};var j=c(102),E=c(41),k=c(145),y=()=>{const{hasError:e,onCheckoutValidationBeforeProcessing:t,dispatchActions:c,redirectUrl:r,isProcessing:n,isBeforeProcessing:s,isComplete:p,orderNotes:y,shouldCreateAccount:f,extensionData:w}=Object(u.b)(),{hasValidationErrors:v}=Object(j.b)(),{shippingErrorStatus:S}=Object(l.b)(),{billingAddress:C,shippingAddress:N}=Object(i.b)(),{cartNeedsPayment:P,cartNeedsShipping:R,receiveCart:T}=Object(E.a)(),{activePaymentMethod:A,isExpressPaymentMethodActive:I,currentStatus:x,paymentMethodData:M,expressPaymentMethods:D,paymentMethods:B,shouldSavePayment:L}=Object(a.b)(),{setIsSuppressed:F}=Object(k.b)(),{createErrorNotice:U,removeNotice:V}=Object(h.useDispatch)("core/notices"),q=Object(o.useRef)(C),$=Object(o.useRef)(N),G=Object(o.useRef)(r),[H,Y]=Object(o.useState)(!1),z=Object(o.useMemo)(()=>{var e;const t={...D,...B};return null==t||null===(e=t[A])||void 0===e?void 0:e.paymentMethodId},[A,D,B]),W=v&&!I||x.hasError||S.hasError,K=!e&&!W&&(x.isSuccessful||!P)&&n;Object(o.useEffect)(()=>{F(I)},[I,F]),Object(o.useEffect)(()=>{W===e||!n&&!s||I||c.setHasError(W)},[W,e,n,s,I,c]),Object(o.useEffect)(()=>{q.current=C,$.current=N,G.current=r},[C,N,r]);const X=Object(o.useCallback)(()=>!v&&(x.hasError?{errorMessage:Object(d.__)("There was a problem with your payment option.","woo-gutenberg-products-block")}:!S.hasError||{errorMessage:Object(d.__)("There was a problem with your shipping option.","woo-gutenberg-products-block")}),[v,x.hasError,S.hasError]);Object(o.useEffect)(()=>{let e;return I||(e=t(X,0)),()=>{I||e()}},[t,X,I]),Object(o.useEffect)(()=>{G.current&&(window.location.href=G.current)},[p]);const Q=Object(o.useCallback)(async()=>{if(H)return;Y(!0),V("checkout");const e=P?{payment_method:z,payment_data:O(M,L,A)}:{},t={billing_address:Object(m.a)(q.current),customer_note:y,create_account:f,...e,extensions:{...w}};R&&(t.shipping_address=Object(m.a)($.current)),b()({path:"/wc/store/v1/checkout",method:"POST",data:t,cache:"no-store",parse:!1}).then(e=>{if(_(e.headers,c),!e.ok)throw new Error(e);return e.json()}).then(e=>{c.setAfterProcessing(e),Y(!1)}).catch(e=>{try{null!=e&&e.headers&&_(e.headers,c),e.json().then(e=>{var t,o,r;null!==(t=e.data)&&void 0!==t&&t.cart&&T(e.data.cart),U(Object(g.b)(e),{id:"checkout",context:"wc/checkout"}),null==e||null===(o=e.additional_errors)||void 0===o||null===(r=o.forEach)||void 0===r||r.call(o,e=>{U(e.message,{id:e.error_code,context:"wc/checkout"})}),c.setAfterProcessing(e)})}catch{var t;U(Object(d.sprintf)(// Translators: %s Error text. +Object(d.__)("%s Please try placing your order again.","woo-gutenberg-products-block"),null!==(t=null==e?void 0:e.message)&&void 0!==t?t:Object(d.__)("Something went wrong.","woo-gutenberg-products-block")),{id:"checkout",context:"wc/checkout"})}c.setHasError(!0),Y(!1)})},[H,V,P,z,M,L,A,y,f,w,R,c,U,T]);return Object(o.useEffect)(()=>{K&&!H&&Q()},[Q,K,H]),null};const f=e=>{let{children:t,isCart:c=!1,redirectUrl:d}=e;return Object(o.createElement)(u.a,{redirectUrl:d,isCart:c},Object(o.createElement)(i.a,null,Object(o.createElement)(l.a,null,Object(o.createElement)(a.a,null,t,Object(o.createElement)(s.a,{renderError:n.CURRENT_USER_IS_ADMIN?null:()=>null},Object(o.createElement)(r.PluginArea,{scope:"woocommerce-checkout"})),Object(o.createElement)(y,null)))))}},,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return I}));var o=c(1),r=c(26),n=c(0),s=c(4),a=c.n(s),l=c(11),i=Object(n.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(n.createElement)("path",{d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{fill:"#000",fillRule:"nonzero",d:"M17.3 8v1c1 .2 1.4.9 1.4 1.7h-1c0-.6-.3-1-1-1-.8 0-1.3.4-1.3.9 0 .4.3.6 1.4 1 1 .2 2 .6 2 1.9 0 .9-.6 1.4-1.5 1.5v1H16v-1c-.9-.1-1.6-.7-1.7-1.7h1c0 .6.4 1 1.3 1 1 0 1.2-.5 1.2-.8 0-.4-.2-.8-1.3-1.1-1.3-.3-2.1-.8-2.1-1.8 0-.9.7-1.5 1.6-1.6V8h1.3zM12 10v1H6v-1h6zm2-2v1H6V8h8zM2 4v16h20V4H2zm2 14V6h16v12H4z"}),Object(n.createElement)("path",{stroke:"#000",strokeLinecap:"round",d:"M6 16c2.6 0 3.9-3 1.7-3-2 0-1 3 1.5 3 1 0 1-.8 2.8-.8"}))),u=c(524),d=c(511),p=c(523),b=c(113),m=c(100),g=c(35);c(252);const h={bank:u.a,bill:d.a,card:p.a,checkPayment:i};var O=e=>{let{icon:t="",text:c=""}=e;const o=!!t,r=Object(n.useCallback)(e=>o&&Object(m.a)(e)&&Object(g.b)(h,e),[o]),s=a()("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":o});return Object(n.createElement)("span",{className:s},r(t)?Object(n.createElement)(b.a,{icon:h[t]}):t,c)},_=c(148),j=c(2),E=c(51),k=c.n(E),y=c(69),f=c(221),w=c(41),v=c(206),S=c(37),C=c(54),N=c(164),P=c(104),R=c(72);const T=(e,t)=>{const c=[],r=(t,c)=>{const o=c+"_tax",r=Object(g.b)(e,c)&&Object(m.a)(e[c])?parseInt(e[c],10):0;return{key:c,label:t,value:r,valueWithTax:r+(Object(g.b)(e,o)&&Object(m.a)(e[o])?parseInt(e[o],10):0)}};return c.push(r(Object(o.__)("Subtotal:","woo-gutenberg-products-block"),"total_items")),c.push(r(Object(o.__)("Fees:","woo-gutenberg-products-block"),"total_fees")),c.push(r(Object(o.__)("Discount:","woo-gutenberg-products-block"),"total_discount")),c.push({key:"total_tax",label:Object(o.__)("Taxes:","woo-gutenberg-products-block"),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&c.push(r(Object(o.__)("Shipping:","woo-gutenberg-products-block"),"total_shipping")),c};var A=c(80);const I=()=>{const{isCalculating:e,isComplete:t,isIdle:c,isProcessing:s,onCheckoutBeforeProcessing:a,onCheckoutValidationBeforeProcessing:l,onCheckoutAfterProcessingWithSuccess:i,onCheckoutAfterProcessingWithError:u,onSubmit:d,customerId:p}=Object(C.b)(),{currentStatus:b,activePaymentMethod:m,onPaymentProcessing:g,setExpressPaymentError:h,shouldSavePayment:E}=Object(N.b)(),{shippingErrorStatus:I,shippingErrorTypes:x,onShippingRateSuccess:M,onShippingRateFail:D,onShippingRateSelectSuccess:B,onShippingRateSelectFail:L}=Object(P.b)(),{shippingRates:F,isLoadingRates:U,selectedRates:V,isSelectingRate:q,selectShippingRate:$,needsShipping:G}=Object(A.a)(),{billingAddress:H,shippingAddress:Y,setShippingAddress:z}=Object(R.b)(),{cartItems:W,cartFees:K,cartTotals:X,extensions:Q}=Object(w.a)(),{appliedCoupons:J}=Object(v.a)(),{noticeContexts:Z,responseTypes:ee}=Object(S.d)(),te=Object(n.useRef)(T(X,G)),ce=Object(n.useRef)({label:Object(o.__)("Total","woo-gutenberg-products-block"),value:parseInt(X.total_price,10)});Object(n.useEffect)(()=>{te.current=T(X,G),ce.current={label:Object(o.__)("Total","woo-gutenberg-products-block"),value:parseInt(X.total_price,10)}},[X,G]);const oe=Object(n.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";k()("setExpressPaymentError should only be used by Express Payment Methods (using the provided onError handler).",{alternative:"",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),h(e)}),[h]);return{activePaymentMethod:m,billing:{appliedCoupons:J,billingAddress:H,billingData:H,cartTotal:ce.current,cartTotalItems:te.current,currency:Object(r.getCurrencyFromPriceResponse)(X),customerId:p,displayPricesIncludingTax:Object(j.getSetting)("displayCartPricesIncludingTax",!1)},cartData:{cartItems:W,cartFees:K,extensions:Q},checkoutStatus:{isCalculating:e,isComplete:t,isIdle:c,isProcessing:s},components:{LoadingMask:y.a,PaymentMethodIcons:_.a,PaymentMethodLabel:O,ValidationInputError:f.a},emitResponse:{noticeContexts:Z,responseTypes:ee},eventRegistration:{onCheckoutAfterProcessingWithError:u,onCheckoutAfterProcessingWithSuccess:i,onCheckoutBeforeProcessing:a,onCheckoutValidationBeforeProcessing:l,onPaymentProcessing:g,onShippingRateFail:D,onShippingRateSelectFail:L,onShippingRateSelectSuccess:B,onShippingRateSuccess:M},onSubmit:d,paymentStatus:b,setExpressPaymentError:oe,shippingData:{isSelectingRate:q,needsShipping:G,selectedRates:V,setSelectedRates:$,setShippingAddress:z,shippingAddress:Y,shippingRates:F,shippingRatesLoading:U},shippingStatus:{shippingErrorStatus:I,shippingErrorTypes:x},shouldSavePayment:E}}},function(e,t,c){"use strict";c.d(t,"b",(function(){return l})),c.d(t,"a",(function(){return i}));var o=c(0),r=c(10),n=c(4),s=c.n(n);const a=Object(o.createContext)({hasContainerWidth:!1,containerClassName:"",isMobile:!1,isSmall:!1,isMedium:!1,isLarge:!1}),l=()=>Object(o.useContext)(a),i=e=>{let{children:t,className:c=""}=e;const[n,l]=(()=>{const[e,{width:t}]=Object(r.useResizeObserver)();let c="";return t>700?c="is-large":t>520?c="is-medium":t>400?c="is-small":t&&(c="is-mobile"),[e,c]})(),i={hasContainerWidth:""!==l,containerClassName:l,isMobile:"is-mobile"===l,isSmall:"is-small"===l,isMedium:"is-medium"===l,isLarge:"is-large"===l};return Object(o.createElement)(a.Provider,{value:i},Object(o.createElement)("div",{className:s()(c,l)},n,t))}},function(e,t,c){"use strict";var o=c(6),r=c.n(o),n=c(0),s=c(1),a=c(12),l=c(4),i=c.n(l),u=c(102),d=c(221),p=c(10),b=c(100),m=c(28);c(191);var g=Object(a.forwardRef)((e,t)=>{let{className:c,id:o,type:s="text",ariaLabel:a,ariaDescribedBy:l,label:u,screenReaderLabel:d,disabled:p,help:b,autoCapitalize:g="off",autoComplete:h="off",value:O="",onChange:_,required:j=!1,onBlur:E=(()=>{}),feedback:k,...y}=e;const[f,w]=Object(n.useState)(!1);return Object(n.createElement)("div",{className:i()("wc-block-components-text-input",c,{"is-active":f||O})},Object(n.createElement)("input",r()({type:s,id:o,value:O,ref:t,autoCapitalize:g,autoComplete:h,onChange:e=>{_(e.target.value)},onFocus:()=>w(!0),onBlur:e=>{E(e.target.value),w(!1)},"aria-label":a||u,disabled:p,"aria-describedby":b&&!l?o+"__help":l,required:j},y)),Object(n.createElement)(m.a,{label:u,screenReaderLabel:d||u,wrapperElement:"label",wrapperProps:{htmlFor:o},htmlFor:o}),!!b&&Object(n.createElement)("p",{id:o+"__help",className:"wc-block-components-text-input__help"},b),k)});t.a=Object(p.withInstanceId)(e=>{let{className:t,instanceId:c,id:o,ariaDescribedBy:l,errorId:p,focusOnMount:m=!1,onChange:h,showError:O=!0,errorMessage:_="",value:j="",...E}=e;const[k,y]=Object(a.useState)(!0),f=Object(a.useRef)(null),{getValidationError:w,hideValidationError:v,setValidationErrors:S,clearValidationError:C,getValidationErrorId:N}=Object(u.b)(),P=void 0!==o?o:"textinput-"+c,R=void 0!==p?p:P,T=Object(a.useCallback)((function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=f.current||null;if(!t)return;t.value=t.value.trim();const c=t.checkValidity();c?C(R):S({[R]:{message:t.validationMessage||Object(s.__)("Invalid value.","woo-gutenberg-products-block"),hidden:e}})}),[C,R,S]);Object(a.useEffect)(()=>{var e;k&&m&&(null===(e=f.current)||void 0===e||e.focus()),y(!1)},[m,k,y]),Object(a.useEffect)(()=>{var e,t;(null===(e=f.current)||void 0===e||null===(t=e.ownerDocument)||void 0===t?void 0:t.activeElement)!==f.current&&T(!0)},[j,T]),Object(a.useEffect)(()=>()=>{C(R)},[C,R]);const A=w(R)||{};Object(b.a)(_)&&""!==_&&(A.message=_);const I=A.message&&!A.hidden,x=O&&I&&N(R)?N(R):l;return Object(n.createElement)(g,r()({className:i()(t,{"has-error":I}),"aria-invalid":!0===I,id:P,onBlur:()=>{T(!1)},feedback:O&&Object(n.createElement)(d.a,{errorMessage:_,propertyName:R}),ref:f,onChange:e=>{v(R),h(e)},ariaDescribedBy:x,value:j},E))})},,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var o=c(8);const r=["core/paragraph","core/image","core/separator"],n=e=>[...Object(o.getBlockTypes)().filter(t=>((null==t?void 0:t.parent)||[]).includes(e)).map(e=>{let{name:t}=e;return t}),...r]},function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var o=c(0),r=c(9),n=c(8),s=c(7);const a=e=>{let{clientId:t,registeredBlocks:c,defaultTemplate:a=[]}=e;const l=Object(o.useRef)(c),i=Object(o.useRef)(a),{insertBlock:u,replaceInnerBlocks:d}=Object(r.useDispatch)("core/block-editor"),{innerBlocks:p,registeredBlockTypes:b}=Object(r.useSelect)(e=>({innerBlocks:e("core/block-editor").getBlocks(t),registeredBlockTypes:l.current.map(e=>Object(n.getBlockType)(e))}),[t,l.current]),m=Object(o.useCallback)((e,c)=>{const o=Object(n.createBlock)(e.name);u(o,c,t,!1)},[t,u]),g=Object(o.useMemo)(()=>b.filter(e=>e&&(e=>{var t,c,o;let{attributes:r}=e;return Boolean((null===(t=r.lock)||void 0===t?void 0:t.remove)||(null===(c=r.lock)||void 0===c||null===(o=c.default)||void 0===o?void 0:o.remove))})(e)),[b]);Object(o.useLayoutEffect)(()=>{if(t){if(0===p.length&&i.current.length>0){const e=Object(n.createBlocksFromInnerBlocksTemplate)(i.current);if(!Object(s.isEqual)(e,p))return void d(t,e)}g.forEach(e=>{if(p.find(t=>{let{name:c}=t;return c===e.name}))return;const t=i.current.findIndex(t=>{let[c]=t;return c===e.name});switch(t){case-1:m(e,p.length);break;case 0:m(e,0);break;default:const c=i.current[t-1],o=p.findIndex(e=>{let{name:t}=e;return t===c[0]});m(e,-1===o?t:o+1)}})}},[t,p,g,d,m])}},function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var o=c(1),r=c(23),n=c(2);const s=[{destination:{address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},package_id:0,name:Object(o.__)("Shipping","woo-gutenberg-products-block"),items:[{key:"33e75ff09dd601bbe69f351039152189",name:Object(o._x)("Beanie with Logo","example product in Cart Block","woo-gutenberg-products-block"),quantity:2},{key:"6512bd43d9caa6e02c990b0a82652dca",name:Object(o._x)("Beanie","example product in Cart Block","woo-gutenberg-products-block"),quantity:1}],shipping_rates:[{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(o.__)("Free shipping","woo-gutenberg-products-block"),description:"",delivery_time:"",price:"000",taxes:"0",rate_id:"free_shipping:1",instance_id:0,meta_data:[],method_id:"flat_rate",selected:!0},{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(o.__)("Local pickup","woo-gutenberg-products-block"),description:"",delivery_time:"",price:"200",taxes:"0",rate_id:"local_pickup:1",instance_id:1,meta_data:[],method_id:"local_pickup",selected:!1}]}],a=Object(n.getSetting)("displayCartPricesIncludingTax",!1),l={coupons:[],shipping_rates:Object(n.getSetting)("shippingMethodsExist",!1)?s:[],items:[{key:"1",id:1,quantity:2,name:Object(o.__)("Beanie","woo-gutenberg-products-block"),short_description:Object(o.__)("Warm hat for winter","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-beanie",permalink:"https://example.org",low_stock_remaining:2,backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:10,src:r.m+"previews/beanie.jpg",thumbnail:r.m+"previews/beanie.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(o.__)("Color","woo-gutenberg-products-block"),value:Object(o.__)("Yellow","woo-gutenberg-products-block")},{attribute:Object(o.__)("Size","woo-gutenberg-products-block"),value:Object(o.__)("Small","woo-gutenberg-products-block")}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:a?"12000":"10000",regular_price:a?"12000":"10000",sale_price:a?"12000":"10000",raw_prices:{precision:6,price:a?"12000000":"10000000",regular_price:a?"12000000":"10000000",sale_price:a?"12000000":"10000000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:"2000",line_subtotal_tax:"400",line_total:"2000",line_total_tax:"400"},extensions:{}},{key:"2",id:2,quantity:1,name:Object(o.__)("Cap","woo-gutenberg-products-block"),short_description:Object(o.__)("Lightweight baseball cap","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-cap",permalink:"https://example.org",backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:11,src:r.m+"previews/cap.jpg",thumbnail:r.m+"previews/cap.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(o.__)("Color","woo-gutenberg-products-block"),value:Object(o.__)("Orange","woo-gutenberg-products-block")}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:a?"2400":"2000",regular_price:a?"2400":"2000",sale_price:a?"2400":"2000",raw_prices:{precision:6,price:a?"24000000":"20000000",regular_price:a?"24000000":"20000000",sale_price:a?"24000000":"20000000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:"2000",line_subtotal_tax:"400",line_total:"2000",line_total_tax:"400"},extensions:{}}],fees:[{id:"fee",name:Object(o.__)("Fee","woo-gutenberg-products-block"),totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total:"100",total_tax:"20",tax_lines:[{name:Object(o.__)("Sales tax","woo-gutenberg-products-block"),rate:"20%",price:"20"}]}}],items_count:3,items_weight:0,needs_payment:!0,needs_shipping:Object(n.getSetting)("shippingEnabled",!0),has_calculated_shipping:!0,shipping_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},billing_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total_items:"4000",total_items_tax:"800",total_fees:"100",total_fees_tax:"20",total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_tax:"820",total_price:"4920",tax_lines:[{name:Object(o.__)("Sales tax","woo-gutenberg-products-block"),rate:"20%",price:"820"}]},errors:[],payment_requirements:["products"],extensions:{}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";var o=c(0),r=c(4),n=c.n(r),s=c(281);c(248),t.a=e=>{let{children:t,className:c}=e;return Object(o.createElement)(s.a,{className:n()("wc-block-components-sidebar-layout",c)},t)}},function(e,t,c){"use strict";var o=c(0),r=c(12),n=c(4),s=c.n(n);const a=Object(r.forwardRef)((e,t)=>{let{children:c,className:r=""}=e;return Object(o.createElement)("div",{ref:t,className:s()("wc-block-components-main",r)},c)});t.a=a},,function(e,t,c){"use strict";var o=c(0),r=c(12),n=c(4),s=c.n(n);const a=Object(r.forwardRef)((e,t)=>{let{children:c,className:r=""}=e;return Object(o.createElement)("div",{ref:t,className:s()("wc-block-components-sidebar",r)},c)});t.a=a},,,,,,,function(e,t,c){"use strict";var o=c(0),r=c(11);const n=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24",fill:"none"},Object(o.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",d:"M6 3.75h12c.69 0 1.25.56 1.25 1.25v14c0 .69-.56 1.25-1.25 1.25H6c-.69 0-1.25-.56-1.25-1.25V5c0-.69.56-1.25 1.25-1.25z"}),Object(o.createElement)("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.9 7.5A1.1 1.1 0 018 6.4h8a1.1 1.1 0 011.1 1.1v2a1.1 1.1 0 01-1.1 1.1H8a1.1 1.1 0 01-1.1-1.1v-2zm1.2.1v1.8h7.8V7.6H8.1z",clipRule:"evenodd"}),Object(o.createElement)("path",{fill:"currentColor",d:"M8.5 12h1v1h-1v-1zM8.5 14h1v1h-1v-1zM8.5 16h1v1h-1v-1zM11.5 12h1v1h-1v-1zM11.5 14h1v1h-1v-1zM11.5 16h1v1h-1v-1zM14.5 12h1v1h-1v-1zM14.5 14h1v1h-1v-1zM14.5 16h1v1h-1v-1z"}));t.a=n},function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(4),s=c.n(n),a=c(38),l=c(18),i=c(41),u=c(2);c(253),t.a=e=>{let{currency:t,values:c,className:n}=e;const d=Object(u.getSetting)("taxesEnabled",!0)&&Object(u.getSetting)("displayCartPricesIncludingTax",!1),{total_price:p,total_tax:b}=c,{receiveCart:m,...g}=Object(i.a)(),h=Object(l.__experimentalApplyCheckoutFilter)({filterName:"totalLabel",defaultValue:Object(r.__)("Total","woo-gutenberg-products-block"),extensions:g.extensions,arg:{cart:g}}),O=parseInt(b,10);return Object(o.createElement)(l.TotalsItem,{className:s()("wc-block-components-totals-footer-item",n),currency:t,label:h,value:parseInt(p,10),description:d&&0!==O&&Object(o.createElement)("p",{className:"wc-block-components-totals-footer-item-tax"},Object(o.createInterpolateElement)(Object(r.__)("Including in taxes","woo-gutenberg-products-block"),{TaxAmount:Object(o.createElement)(a.a,{className:"wc-block-components-totals-footer-item-tax-value",currency:t,value:O})}))})}},function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(69),s=c(232),a=c(18),l=c(2);c(254);const i={context:"summary"};t.a=e=>{let{cartCoupons:t=[],currency:c,isRemovingCoupon:u,removeCoupon:d,values:p}=e;const{total_discount:b,total_discount_tax:m}=p,g=parseInt(b,10);if(!g&&0===t.length)return null;const h=parseInt(m,10),O=Object(l.getSetting)("displayCartPricesIncludingTax",!1)?g+h:g,_=Object(a.__experimentalApplyCheckoutFilter)({arg:i,filterName:"coupons",defaultValue:t});return Object(o.createElement)(a.TotalsItem,{className:"wc-block-components-totals-discount",currency:c,description:0!==_.length&&Object(o.createElement)(n.a,{screenReaderLabel:Object(r.__)("Removing coupon…","woo-gutenberg-products-block"),isLoading:u,showSpinner:!1},Object(o.createElement)("ul",{className:"wc-block-components-totals-discount__coupon-list"},_.map(e=>Object(o.createElement)(s.a,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:Object(r.sprintf)( +/* translators: %s Coupon code. */ +Object(r.__)("Coupon: %s","woo-gutenberg-products-block"),e.label),disabled:u,onRemove:()=>{d(e.code)},radius:"large",ariaLabel:Object(r.sprintf)( +/* translators: %s is a coupon code. */ +Object(r.__)('Remove coupon "%s"',"woo-gutenberg-products-block"),e.label)})))),label:O?Object(r.__)("Discount","woo-gutenberg-products-block"):Object(r.__)("Coupons","woo-gutenberg-products-block"),value:O?-1*O:"-"})}},function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return r}));const o=e=>e.length,r=e=>e.reduce((function(e,t){return e+t.shipping_rates.length}),0)},function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(68),s=c(282),a=c(28),l=c(69),i=c(10),u=c(102),d=c(221),p=c(18);c(261),t.a=Object(i.withInstanceId)(e=>{let{instanceId:t,isLoading:c=!1,initialOpen:i=!1,onSubmit:b=(()=>{})}=e;const[m,g]=Object(o.useState)(""),h=Object(o.useRef)(!1),{getValidationError:O,getValidationErrorId:_}=Object(u.b)(),j=O("coupon");Object(o.useEffect)(()=>{h.current!==c&&(c||!m||j||g(""),h.current=c)},[c,m,j]);const E="wc-block-components-totals-coupon__input-"+t;return Object(o.createElement)(p.Panel,{className:"wc-block-components-totals-coupon",hasBorder:!1,initialOpen:i,title:Object(o.createElement)(a.a,{label:Object(r.__)("Coupon code","woo-gutenberg-products-block"),screenReaderLabel:Object(r.__)("Apply a coupon code","woo-gutenberg-products-block"),htmlFor:E})},Object(o.createElement)(l.a,{screenReaderLabel:Object(r.__)("Applying coupon…","woo-gutenberg-products-block"),isLoading:c,showSpinner:!1},Object(o.createElement)("div",{className:"wc-block-components-totals-coupon__content"},Object(o.createElement)("form",{className:"wc-block-components-totals-coupon__form"},Object(o.createElement)(s.a,{id:E,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:Object(r.__)("Enter code","woo-gutenberg-products-block"),value:m,ariaDescribedBy:_(E),onChange:e=>{g(e)},focusOnMount:!0,showError:!1}),Object(o.createElement)(n.a,{className:"wc-block-components-totals-coupon__button",disabled:c||!m,showSpinner:c,onClick:e=>{e.preventDefault(),b(m)},type:"submit"},Object(r.__)("Apply","woo-gutenberg-products-block"))),Object(o.createElement)(d.a,{propertyName:"coupon",elementId:E}))))})},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return d})),c.d(t,"b",(function(){return b}));var o=c(5),r=c(71),n=c(9),s=c(0),a=c(53),l=c(48),i=c(8);const u=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t?window.document.body.classList.add(e):window.document.body.classList.remove(e)},d=()=>{Object(l.hasFilter)("blocks.registerBlockType","core/lock/addAttribute")||Object(n.subscribe)(()=>{var e,t,c,r;const s=Object(n.select)(o.store);if(!s)return;const a=s.getSelectedBlock();a&&(u("wc-lock-selected-block--remove",!(null==a||null===(e=a.attributes)||void 0===e||null===(t=e.lock)||void 0===t||!t.remove)),u("wc-lock-selected-block--move",!(null==a||null===(c=a.attributes)||void 0===c||null===(r=c.lock)||void 0===r||!r.move)))})},p=e=>{let{ref:t}=e;const c=Object(l.hasFilter)("blocks.registerBlockType","core/lock/addAttribute"),u=t.current;return Object(s.useEffect)(()=>{if(u&&!c)return u.addEventListener("keydown",e,{capture:!0,passive:!1}),()=>{u.removeEventListener("keydown",e,{capture:!0})};function e(e){const{keyCode:t,target:c}=e;if(!(c instanceof HTMLElement))return;if(t!==a.BACKSPACE&&t!==a.DELETE)return;if(Object(r.isTextField)(c))return;const s=c;void 0!==s.dataset.block&&(e=>{var t,c,r,s,a;if(!e)return!1;const{getBlock:l}=Object(n.select)(o.store),u=l(e);if("boolean"==typeof(null==u||null===(t=u.attributes)||void 0===t||null===(c=t.lock)||void 0===c?void 0:c.remove))return u.attributes.lock.remove;const d=Object(i.getBlockType)(u.name);var p,b,m;return"boolean"==typeof(null==d||null===(r=d.attributes)||void 0===r||null===(s=r.lock)||void 0===s||null===(a=s.default)||void 0===a?void 0:a.remove)&&(null==d||null===(p=d.attributes)||void 0===p||null===(b=p.lock)||void 0===b||null===(m=b.default)||void 0===m?void 0:m.remove)})(s.dataset.block)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())}},[u,c])},b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object(s.useRef)(),c=Object(o.useBlockProps)({ref:t,...e});return p({ref:t}),c}},function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var o=c(0),r=c(5),n=c(3),s=c(1);const a=e=>{let{attributes:t,setAttributes:c}=e;const{hasDarkControls:a}=t;return Object(o.createElement)(r.InspectorControls,null,Object(o.createElement)(n.PanelBody,{title:Object(s.__)("Style","woo-gutenberg-products-block")},Object(o.createElement)(n.ToggleControl,{label:Object(s.__)("Dark mode inputs","woo-gutenberg-products-block"),help:Object(s.__)("Inputs styled specifically for use on dark background colors.","woo-gutenberg-products-block"),checked:a,onChange:()=>c({hasDarkControls:!a})})))}},function(e,t,c){e.exports=c(453)},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,function(e,t,c){"use strict";c.r(t);var o=c(0),r=c(4),n=c.n(r),s=c(11),a=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24",fill:"none"},Object(o.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",d:"M5 3.75h14c.69 0 1.25.56 1.25 1.25v14c0 .69-.56 1.25-1.25 1.25H5c-.69 0-1.25-.56-1.25-1.25V5c0-.69.56-1.25 1.25-1.25z"}),Object(o.createElement)("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.4 10.75c0-.47.38-.85.85-.85h9.5c.47 0 .85.38.85.85v1.5c0 .47-.38.85-.85.85h-9.5a.85.85 0 01-.85-.85v-1.5zm1.2.35v.8h8.8v-.8H7.6zM12.4 15.25c0-.47.38-.85.85-.85h3.5c.47 0 .85.38.85.85v1.5c0 .47-.38.85-.85.85h-3.5a.85.85 0 01-.85-.85v-1.5zm1.2.35v.8h2.8v-.8h-2.8zM6.5 15.9a.6.6 0 01.6-.6h2.8a.6.6 0 010 1.2H7.1a.6.6 0 01-.6-.6zM6.5 7.9a.6.6 0 01.6-.6h9.8a.6.6 0 110 1.2H7.1a.6.6 0 01-.6-.6z",clipRule:"evenodd"})),l=c(113),i=c(8),u=c(1),d=c(5),p=c(407),b=c(59),m=c(270),g=c(312);const h={cc:[{method:{gateway:"credit-card",last4:"5678",brand:"Visa"},expires:"12/20",is_default:!1,tokenId:"1"}]};var O=c(3),_=c(149),j=c(522),E=c(408),k=c(18);const y=Object(o.createContext)({allowCreateAccount:!1,showCompanyField:!1,showApartmentField:!1,showPhoneField:!1,requireCompanyField:!1,requirePhoneField:!1,showOrderNotes:!0,showPolicyLinks:!0,showReturnToCart:!0,cartPageId:0,showRateAfterTaxName:!1}),f=Object(o.createContext)({addressFieldControls:()=>null,accountControls:()=>null}),w=()=>Object(o.useContext)(y),v=()=>Object(o.useContext)(f);var S=c(310),C=c(311);c(427),Object(i.registerBlockType)("woocommerce/checkout-fields-block",{icon:{src:Object(o.createElement)(l.a,{icon:j.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{clientId:t,attributes:c}=e;const r=Object(d.useBlockProps)({className:n()("wc-block-checkout__main",null==c?void 0:c.className)}),s=Object(S.a)(k.innerBlockAreas.CHECKOUT_FIELDS),{addressFieldControls:a}=v(),l=[["woocommerce/checkout-express-payment-block",{},[]],["woocommerce/checkout-contact-information-block",{},[]],["woocommerce/checkout-shipping-address-block",{},[]],["woocommerce/checkout-billing-address-block",{},[]],["woocommerce/checkout-shipping-methods-block",{},[]],["woocommerce/checkout-payment-block",{},[]],["woocommerce/checkout-order-note-block",{},[]],["woocommerce/checkout-terms-block",{},[]],["woocommerce/checkout-actions-block",{},[]]].filter(Boolean);return Object(C.a)({clientId:t,registeredBlocks:s,defaultTemplate:l}),Object(o.createElement)(E.a,r,Object(o.createElement)(a,null),Object(o.createElement)("form",{className:"wc-block-components-form wc-block-checkout__form"},Object(o.createElement)(d.InnerBlocks,{allowedBlocks:s,templateLock:!1,template:l,renderAppender:d.InnerBlocks.ButtonBlockAppender})))},save:()=>Object(o.createElement)("div",d.useBlockProps.save(),Object(o.createElement)(d.InnerBlocks.Content,null))});var N=c(410);c(428),Object(i.registerBlockType)("woocommerce/checkout-totals-block",{icon:{src:Object(o.createElement)(l.a,{icon:j.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{clientId:t,attributes:c}=e;const r=Object(d.useBlockProps)({className:n()("wc-block-checkout__sidebar",null==c?void 0:c.className)}),s=Object(S.a)(k.innerBlockAreas.CHECKOUT_TOTALS),a=[["woocommerce/checkout-order-summary-block",{},[]]];return Object(C.a)({clientId:t,registeredBlocks:s,defaultTemplate:a}),Object(o.createElement)(N.a,r,Object(o.createElement)(d.InnerBlocks,{allowedBlocks:s,templateLock:!1,template:a,renderAppender:d.InnerBlocks.ButtonBlockAppender}))},save:()=>Object(o.createElement)("div",d.useBlockProps.save(),Object(o.createElement)(d.InnerBlocks.Content,null))});var P=c(525),R=c(136),T=e=>{let{children:t,stepHeadingContent:c}=e;return Object(o.createElement)("div",{className:"wc-block-components-checkout-step__heading"},Object(o.createElement)(R.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!c&&Object(o.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},c))};const A=e=>{let{attributes:t,setAttributes:c,className:r="",children:s}=e;const{title:a="",description:l="",showStepNumber:i=!0}=t,p=Object(d.useBlockProps)({className:n()("wc-block-components-checkout-step",r,{"wc-block-components-checkout-step--with-step-number":i})});return Object(o.createElement)("div",p,Object(o.createElement)(d.InspectorControls,null,Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Form Step Options","woo-gutenberg-products-block")},Object(o.createElement)(O.ToggleControl,{label:Object(u.__)("Show step number","woo-gutenberg-products-block"),checked:i,onChange:()=>c({showStepNumber:!i})}))),Object(o.createElement)(T,null,Object(o.createElement)(d.PlainText,{className:"",value:a,onChange:e=>c({title:e})})),Object(o.createElement)("div",{className:"wc-block-components-checkout-step__container"},Object(o.createElement)("p",{className:"wc-block-components-checkout-step__description"},Object(o.createElement)(d.PlainText,{className:l?"":"wc-block-components-checkout-step__description-placeholder",value:l,placeholder:Object(u.__)("Optional text for this form step.","woo-gutenberg-products-block"),onChange:e=>c({description:e})})),Object(o.createElement)("div",{className:"wc-block-components-checkout-step__content"},s)))};c(429);const I=e=>{let{block:t}=e;const{"data-block":c}=Object(d.useBlockProps)(),r=Object(S.a)(t);return Object(C.a)({clientId:c,registeredBlocks:r}),Object(o.createElement)("div",{className:"wc-block-checkout__additional_fields"},Object(o.createElement)(d.InnerBlocks,{allowedBlocks:r}))},x=()=>Object(o.createElement)(d.InnerBlocks.Content,null);var M=c(460),D=c(2),B=c(54),L=c(88),F=c(80);const U=()=>{const{needsShipping:e}=Object(F.a)(),{useShippingAsBilling:t,setUseShippingAsBilling:c}=Object(B.b)(),{billingAddress:r,setBillingAddress:n,shippingAddress:s,setShippingAddress:a}=Object(L.a)(),l=Object(o.useCallback)(e=>{n({email:e})},[n]),i=Object(o.useCallback)(e=>{n({phone:e})},[n]),u=Object(o.useCallback)(e=>{a({phone:e})},[a]);return{shippingAddress:s,billingAddress:r,setShippingAddress:a,setBillingAddress:n,setEmail:l,setBillingPhone:i,setShippingPhone:u,defaultAddressFields:D.defaultAddressFields,useShippingAsBilling:t,setUseShippingAsBilling:c,showShippingFields:e,showBillingFields:!e||!t}};var V=c(78),q=c(43),$=c(282),G=e=>{let{id:t="phone",isRequired:c=!1,value:r="",onChange:n}=e;return Object(o.createElement)($.a,{id:t,type:"tel",autoComplete:"tel",required:c,label:c?Object(u.__)("Phone","woo-gutenberg-products-block"):Object(u.__)("Phone (optional)","woo-gutenberg-products-block"),value:r,onChange:n})},H=e=>{let{showCompanyField:t=!1,showApartmentField:c=!1,showPhoneField:r=!1,requireCompanyField:n=!1,requirePhoneField:s=!1}=e;const{defaultAddressFields:a,setShippingAddress:l,setBillingAddress:i,shippingAddress:d,setShippingPhone:p,useShippingAsBilling:m,setUseShippingAsBilling:g}=U(),{dispatchCheckoutEvent:h}=Object(V.a)(),{isEditor:O}=Object(b.b)(),[_,j]=Object(o.useState)(!1);Object(o.useEffect)(()=>{r||p("")},[r,p]),Object(o.useEffect)(()=>{_||(m&&i(d),j(!0))},[i,d,m]);const E=Object(o.useMemo)(()=>({company:{hidden:!t,required:n},address_2:{hidden:!c}}),[t,n,c]),y=O?q.a:o.Fragment;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(y,null,Object(o.createElement)(M.a,{id:"shipping",type:"shipping",onChange:e=>{l(e),m&&i(e),h("set-shipping-address")},values:d,fields:Object.keys(a),fieldConfig:E}),r&&Object(o.createElement)(G,{id:"shipping-phone",isRequired:s,value:d.phone,onChange:e=>{p(e),h("set-phone-number",{step:"shipping"})}})),Object(o.createElement)(k.CheckboxControl,{className:"wc-block-checkout__use-address-for-billing",label:Object(u.__)("Use same address for billing","woo-gutenberg-products-block"),checked:m,onChange:e=>{g(e),e&&i(d)}}))},Y=e=>{let{defaultTitle:t=Object(u.__)("Step","woo-gutenberg-products-block"),defaultDescription:c=Object(u.__)("Step description text.","woo-gutenberg-products-block"),defaultShowStepNumber:o=!0}=e;return{title:{type:"string",default:t},description:{type:"string",default:c},showStepNumber:{type:"boolean",default:o}}},z={...Y({defaultTitle:Object(u.__)("Shipping address","woo-gutenberg-products-block"),defaultDescription:Object(u.__)("Enter the address where you want your order delivered.","woo-gutenberg-products-block")}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}};Object(i.registerBlockType)("woocommerce/checkout-shipping-address-block",{icon:{src:Object(o.createElement)(l.a,{icon:P.a,className:"wc-block-editor-components-block-icon"})},attributes:z,edit:e=>{let{attributes:t,setAttributes:c}=e;const{showCompanyField:r,showApartmentField:s,requireCompanyField:a,showPhoneField:l,requirePhoneField:i}=w(),{addressFieldControls:u}=v();return Object(o.createElement)(A,{setAttributes:c,attributes:t,className:n()("wc-block-checkout__shipping-fields",null==t?void 0:t.className)},Object(o.createElement)(u,null),Object(o.createElement)(H,{showCompanyField:r,showApartmentField:s,requireCompanyField:a,showPhoneField:l,requirePhoneField:i}),Object(o.createElement)(I,{block:k.innerBlockAreas.SHIPPING_ADDRESS}))},save:()=>Object(o.createElement)("div",d.useBlockProps.save(),Object(o.createElement)(x,null))});var W=c(526),K=c(23),X=c(235);c(430);const Q=K.k?`${Object(u.__)("Terms and Conditions","woo-gutenberg-products-block")}`:Object(u.__)("Terms and Conditions","woo-gutenberg-products-block"),J=K.g?`${Object(u.__)("Privacy Policy","woo-gutenberg-products-block")}`:Object(u.__)("Privacy Policy","woo-gutenberg-products-block"),Z=Object(u.sprintf)( +/* translators: %1$s terms page link, %2$s privacy page link. */ +Object(u.__)("By proceeding with your purchase you agree to our %1$s and %2$s","woo-gutenberg-products-block"),Q,J),ee=Object(u.sprintf)( +/* translators: %1$s terms page link, %2$s privacy page link. */ +Object(u.__)("You must accept our %1$s and %2$s to continue with your purchase.","woo-gutenberg-products-block"),Q,J);Object(i.registerBlockType)("woocommerce/checkout-terms-block",{icon:{src:Object(o.createElement)(l.a,{icon:W.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:{checkbox:t,text:c},setAttributes:r}=e;const n=Object(d.useBlockProps)(),s=c||(t?ee:Z);return Object(o.createElement)("div",n,Object(o.createElement)(d.InspectorControls,null,Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Display options","woo-gutenberg-products-block")},Object(o.createElement)(O.ToggleControl,{label:Object(u.__)("Require checkbox","woo-gutenberg-products-block"),checked:t,onChange:()=>r({checkbox:!t})}))),Object(o.createElement)("div",{className:"wc-block-checkout__terms"},t?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(k.CheckboxControl,{id:"terms-condition",checked:!1}),Object(o.createElement)(d.RichText,{value:s,onChange:e=>r({text:e})})):Object(o.createElement)(d.RichText,{tagName:"span",value:s,onChange:e=>r({text:e})})),(!K.k||!K.g)&&Object(o.createElement)(O.Notice,{className:"wc-block-checkout__terms_notice",status:"warning",isDismissible:!1,actions:[!K.k&&{className:"wc-block-checkout__terms_notice-button",label:Object(o.createElement)(o.Fragment,null,Object(u.__)("Setup a Terms and Conditions page","woo-gutenberg-products-block"),Object(o.createElement)(l.a,{icon:X.a,size:16,className:"wc-block-checkout__terms_notice-button__icon"})),onClick:()=>window.open(D.ADMIN_URL+"admin.php?page=wc-settings&tab=advanced","_blank")},!K.g&&{className:"wc-block-checkout__terms_notice-button",label:Object(o.createElement)(o.Fragment,null,Object(u.__)("Setup a Privacy Policy page","woo-gutenberg-products-block"),Object(o.createElement)(l.a,{size:16,icon:X.a,className:"wc-block-checkout__terms_notice-button__icon"})),onClick:()=>window.open(D.ADMIN_URL+"options-privacy.php","_blank")}].filter(Boolean)},Object(o.createElement)("p",null,Object(u.__)("You don't seem to have a Terms and Conditions and/or a Privacy Policy pages setup.","woo-gutenberg-products-block"))),K.k&&K.g&&!(s.includes(K.k)&&s.includes(K.g))&&Object(o.createElement)(O.Notice,{className:"wc-block-checkout__terms_notice",status:"warning",isDismissible:!1,actions:Z!==c?[{label:Object(u.__)("Restore default text","woo-gutenberg-products-block"),onClick:()=>r({text:""})}]:[]},Object(o.createElement)("p",null,Object(u.__)("Ensure you add links to your policy pages in this section.","woo-gutenberg-products-block"))))},save:()=>Object(o.createElement)("div",d.useBlockProps.save())});var te=c(527),ce=e=>{let{allowCreateAccount:t}=e;const{customerId:c,shouldCreateAccount:r,setShouldCreateAccount:n}=Object(B.b)(),{billingAddress:s,setEmail:a}=U(),{dispatchCheckoutEvent:l}=Object(V.a)(),i=!c&&t&&Object(D.getSetting)("checkoutAllowsGuest",!1)&&Object(D.getSetting)("checkoutAllowsSignup",!1)&&Object(o.createElement)(k.CheckboxControl,{className:"wc-block-checkout__create-account",label:Object(u.__)("Create an account?","woo-gutenberg-products-block"),checked:r,onChange:e=>n(e)});return Object(o.createElement)(o.Fragment,null,Object(o.createElement)($.a,{id:"email",type:"email",label:Object(u.__)("Email address","woo-gutenberg-products-block"),value:s.email,autoComplete:"email",onChange:e=>{a(e),l("set-email-address")},required:!0}),i)},oe={...Y({defaultTitle:Object(u.__)("Contact information","woo-gutenberg-products-block"),defaultDescription:Object(u.__)("We'll use this email to send you details and updates about your order.","woo-gutenberg-products-block")}),className:{type:"string",default:""},lock:{type:"object",default:{remove:!0,move:!0}}};Object(i.registerBlockType)("woocommerce/checkout-contact-information-block",{icon:{src:Object(o.createElement)(l.a,{icon:te.a,className:"wc-block-editor-components-block-icon"})},attributes:oe,edit:e=>{let{attributes:t,setAttributes:c}=e;const{allowCreateAccount:r}=w(),{accountControls:s}=v();return Object(o.createElement)(A,{attributes:t,setAttributes:c,className:n()("wc-block-checkout__contact-fields",null==t?void 0:t.className)},Object(o.createElement)(s,null),Object(o.createElement)(q.a,null,Object(o.createElement)(ce,{allowCreateAccount:r})),Object(o.createElement)(I,{block:k.innerBlockAreas.CONTACT_INFORMATION}))},save:()=>Object(o.createElement)("div",d.useBlockProps.save(),Object(o.createElement)(x,null))});var re=e=>{let{showCompanyField:t=!1,showApartmentField:c=!1,showPhoneField:r=!1,requireCompanyField:n=!1,requirePhoneField:s=!1}=e;const{defaultAddressFields:a,billingAddress:l,setBillingAddress:i,setBillingPhone:u}=U(),{dispatchCheckoutEvent:d}=Object(V.a)(),{isEditor:p}=Object(b.b)();Object(o.useEffect)(()=>{r||u("")},[r,u]);const m=Object(o.useMemo)(()=>({company:{hidden:!t,required:n},address_2:{hidden:!c}}),[t,n,c]),g=p?q.a:o.Fragment;return Object(o.createElement)(g,null,Object(o.createElement)(M.a,{id:"billing",type:"billing",onChange:e=>{i(e),d("set-billing-address")},values:l,fields:Object.keys(a),fieldConfig:m}),r&&Object(o.createElement)(G,{isRequired:s,value:l.phone,onChange:e=>{u(e),d("set-phone-number",{step:"billing"})}}))},ne={...Y({defaultTitle:Object(u.__)("Billing address","woo-gutenberg-products-block"),defaultDescription:Object(u.__)("Enter the address that matches your card or payment method.","woo-gutenberg-products-block")}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}};Object(i.registerBlockType)("woocommerce/checkout-billing-address-block",{icon:{src:Object(o.createElement)(l.a,{icon:P.a,className:"wc-block-editor-components-block-icon"})},attributes:ne,edit:e=>{let{attributes:t,setAttributes:c}=e;const{showCompanyField:r,showApartmentField:s,requireCompanyField:a,showPhoneField:l,requirePhoneField:i}=w(),{addressFieldControls:u}=v(),{showBillingFields:d}=U();return d?Object(o.createElement)(A,{setAttributes:c,attributes:t,className:n()("wc-block-checkout__billing-fields",null==t?void 0:t.className)},Object(o.createElement)(u,null),Object(o.createElement)(re,{showCompanyField:r,showApartmentField:s,requireCompanyField:a,showPhoneField:l,requirePhoneField:i}),Object(o.createElement)(I,{block:k.innerBlockAreas.BILLING_ADDRESS})):null},save:()=>Object(o.createElement)("div",d.useBlockProps.save(),Object(o.createElement)(x,null))});var se=c(513),ae=c(9),le=c(207),ie=c(528);c(432);var ue=e=>{let{link:t}=e;const c=t||K.d;return c?Object(o.createElement)("a",{href:c,className:"wc-block-components-checkout-return-to-cart-button"},Object(o.createElement)(l.a,{icon:ie.a}),Object(u.__)("Return to Cart","woo-gutenberg-products-block")):null},de=c(164),pe=c(171),be=c(517),me=c(68),ge=()=>{const{submitButtonText:e,onSubmit:t,isCalculating:c,isDisabled:r,waitingForProcessing:n,waitingForRedirect:s}=(()=>{const{onSubmit:e,isCalculating:t,isBeforeProcessing:c,isProcessing:o,isAfterProcessing:r,isComplete:n,hasError:s}=Object(B.b)(),{paymentMethods:a={}}=Object(pe.b)(),{activePaymentMethod:l,currentStatus:i}=Object(de.b)(),d=a[l]||{},p=o||r||c,b=n&&!s;return{submitButtonText:(null==d?void 0:d.placeOrderButtonLabel)||Object(u.__)("Place Order","woo-gutenberg-products-block"),onSubmit:e,isCalculating:t,isDisabled:o||i.isDoingExpressPayment,waitingForProcessing:p,waitingForRedirect:b}})();return Object(o.createElement)(me.a,{className:"wc-block-components-checkout-place-order-button",onClick:t,disabled:c||r||n||s,showSpinner:n},s?Object(o.createElement)(l.a,{icon:be.a}):e)};c(431);var he=e=>{let{cartPageId:t,showReturnToCart:c,className:r}=e;return Object(o.createElement)("div",{className:n()("wc-block-checkout__actions",r)},c&&Object(o.createElement)(ue,{link:Object(D.getSetting)("page-"+t,!1)}),Object(o.createElement)(ge,null))};Object(i.registerBlockType)("woocommerce/checkout-actions-block",{icon:{src:Object(o.createElement)(l.a,{icon:se.a,className:"wc-block-editor-components-block-icon"})},attributes:{cartPageId:{type:"number",default:0},showReturnToCart:{type:"boolean",default:!0},className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}},edit:e=>{let{attributes:t,setAttributes:c}=e;const r=Object(d.useBlockProps)(),{cartPageId:n=0,showReturnToCart:s=!0}=t,{current:a}=Object(o.useRef)(n),l=Object(ae.useSelect)(e=>a||e("core/editor").getCurrentPostId(),[a]);return Object(o.createElement)("div",r,Object(o.createElement)(d.InspectorControls,null,Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Account options","woo-gutenberg-products-block")},Object(o.createElement)(O.ToggleControl,{label:Object(u.__)('Show a "Return to Cart" link',"woo-gutenberg-products-block"),checked:s,onChange:()=>c({showReturnToCart:!s})})),s&&!(l===K.e&&0===a)&&Object(o.createElement)(le.a,{pageId:n,setPageId:e=>c({cartPageId:e}),labels:{title:Object(u.__)("Return to Cart button","woo-gutenberg-products-block"),default:Object(u.__)("WooCommerce Cart Page","woo-gutenberg-products-block")}})),Object(o.createElement)(q.a,null,Object(o.createElement)(he,{showReturnToCart:s,cartPageId:n})))},save:()=>Object(o.createElement)("div",d.useBlockProps.save())});var Oe=c(514);c(434);const _e=e=>{let{title:t,stepHeadingContent:c}=e;return Object(o.createElement)("div",{className:"wc-block-components-checkout-step__heading"},Object(o.createElement)(R.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!c&&Object(o.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},c))};var je=e=>{let{id:t,className:c,title:r,legend:s,description:a,children:l,disabled:i=!1,showStepNumber:u=!0,stepHeadingContent:d=(()=>{})}=e;const p=s||r?"fieldset":"div";return Object(o.createElement)(p,{className:n()(c,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":u,"wc-block-components-checkout-step--disabled":i}),id:t,disabled:i},!(!s&&!r)&&Object(o.createElement)("legend",{className:"screen-reader-text"},s||r),!!r&&Object(o.createElement)(_e,{title:r,stepHeadingContent:d()}),Object(o.createElement)("div",{className:"wc-block-components-checkout-step__container"},!!a&&Object(o.createElement)("p",{className:"wc-block-components-checkout-step__description"},a),Object(o.createElement)("div",{className:"wc-block-components-checkout-step__content"},l)))};c(436);const Ee=e=>{let{className:t="",disabled:c=!1,onTextChange:r,placeholder:s,value:a=""}=e;return Object(o.createElement)("textarea",{className:n()("wc-block-components-textarea",t),disabled:c,onChange:e=>{r(e.target.value)},placeholder:s,rows:2,value:a})};c(435);var ke=e=>{let{disabled:t,onChange:c,placeholder:r,value:n}=e;const[s,a]=Object(o.useState)(!1),[l,i]=Object(o.useState)("");return Object(o.createElement)("div",{className:"wc-block-checkout__add-note"},Object(o.createElement)(k.CheckboxControl,{disabled:t,label:Object(u.__)("Add a note to your order","woo-gutenberg-products-block"),checked:s,onChange:e=>{a(e),e?n!==l&&c(l):(c(""),i(n))}}),s&&Object(o.createElement)(Ee,{disabled:t,onTextChange:c,placeholder:r,value:n}))},ye=e=>{let{className:t}=e;const{needsShipping:c}=Object(F.a)(),{isProcessing:r,orderNotes:s,dispatchActions:a}=Object(B.b)(),{setOrderNotes:l}=a;return Object(o.createElement)(je,{id:"order-notes",showStepNumber:!1,className:n()("wc-block-checkout__order-notes",t),disabled:r},Object(o.createElement)(ke,{disabled:r,onChange:l,placeholder:c?Object(u.__)("Notes about your order, e.g. special notes for delivery.","woo-gutenberg-products-block"):Object(u.__)("Notes about your order.","woo-gutenberg-products-block"),value:s}))};c(433),Object(i.registerBlockType)("woocommerce/checkout-order-note-block",{icon:{src:Object(o.createElement)(l.a,{icon:Oe.a,className:"wc-block-editor-components-block-icon"})},edit:()=>{const e=Object(d.useBlockProps)();return Object(o.createElement)("div",e,Object(o.createElement)(q.a,null,Object(o.createElement)(ye,null)))},save:()=>Object(o.createElement)("div",d.useBlockProps.save())});var fe=c(417),we=c(418),ve=c(26),Se=c(41);const Ce=()=>{const{extensions:e,receiveCart:t,...c}=Object(Se.a)(),r={extensions:e,cart:c,context:"woocommerce/checkout"};return Object(o.createElement)(k.ExperimentalOrderMeta.Slot,r)};Object(i.registerBlockType)("woocommerce/checkout-order-summary-block",{icon:{src:Object(o.createElement)(l.a,{icon:fe.a,className:"wc-block-editor-components-block-icon"})},attributes:{className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}},edit:e=>{let{clientId:t}=e;const c=Object(d.useBlockProps)(),{cartTotals:r}=Object(Se.a)(),n=Object(ve.getCurrencyFromPriceResponse)(r),s=Object(S.a)(k.innerBlockAreas.CHECKOUT_ORDER_SUMMARY),a=[["woocommerce/checkout-order-summary-cart-items-block",{},[]],["woocommerce/checkout-order-summary-subtotal-block",{},[]],["woocommerce/checkout-order-summary-fee-block",{},[]],["woocommerce/checkout-order-summary-discount-block",{},[]],["woocommerce/checkout-order-summary-coupon-form-block",{},[]],["woocommerce/checkout-order-summary-shipping-block",{},[]],["woocommerce/checkout-order-summary-taxes-block",{},[]]];return Object(C.a)({clientId:t,registeredBlocks:s,defaultTemplate:a}),Object(o.createElement)("div",c,Object(o.createElement)(d.InnerBlocks,{allowedBlocks:s,template:a}),Object(o.createElement)("div",{className:"wc-block-components-totals-wrapper"},Object(o.createElement)(we.a,{currency:n,values:r})),Object(o.createElement)(Ce,null))},save:()=>Object(o.createElement)("div",d.useBlockProps.save(),Object(o.createElement)(d.InnerBlocks.Content,null))});var Ne=c(523);c(437);var Pe=e=>{let{href:t,title:c,description:r}=e;return Object(o.createElement)("a",{href:t,className:"wc-block-editor-components-external-link-card",target:"_blank",rel:"noreferrer"},Object(o.createElement)("span",{className:"wc-block-editor-components-external-link-card__content"},Object(o.createElement)("strong",{className:"wc-block-editor-components-external-link-card__title"},c),r&&Object(o.createElement)("span",{className:"wc-block-editor-components-external-link-card__description"},r)),Object(o.createElement)(O.VisuallyHidden,{as:"span"}, +/* translators: accessibility text */ +Object(u.__)("(opens in a new tab)","woo-gutenberg-products-block")),Object(o.createElement)(l.a,{icon:X.a,className:"wc-block-editor-components-external-link-card__icon"}))},Re=c(28),Te=c(519),Ae=c(130),Ie=c(283);c(438);const xe=()=>Object(o.createElement)(Te.a,{icon:Object(o.createElement)(l.a,{icon:Ne.a}),label:Object(u.__)("Payment methods","woo-gutenberg-products-block"),className:"wc-block-checkout__no-payment-methods-placeholder"},Object(o.createElement)("span",{className:"wc-block-checkout__no-payment-methods-placeholder-description"},Object(u.__)("Your store does not have any payment methods configured that support the checkout block. Once you have configured a compatible payment method it will be shown here.","woo-gutenberg-products-block")),Object(o.createElement)(Ae.a,{isSecondary:!0,href:D.ADMIN_URL+"admin.php?page=wc-settings&tab=checkout",target:"_blank",rel:"noopener noreferrer"},Object(u.__)("Configure Payment Methods","woo-gutenberg-products-block"))),Me=()=>Object(o.createElement)(Ie.a,{isDismissible:!1,className:n()("wc-block-checkout__no-payment-methods-notice","woocommerce-message","woocommerce-error")},Object(u.__)("There are no payment methods available. This may be an error on our side. Please contact us if you need any help placing your order.","woo-gutenberg-products-block"));var De=()=>{const{isEditor:e}=Object(b.b)();return e?Object(o.createElement)(xe,null):Object(o.createElement)(Me,null)},Be=c(280),Le=c(37),Fe=c(10),Ue=c(118),Ve=Object(Fe.withInstanceId)(e=>{let{className:t,instanceId:c,id:r,selected:s,onChange:a,options:l=[]}=e;const i=r||c;return l.length&&Object(o.createElement)("div",{className:n()("wc-block-components-radio-control",t)},l.map(e=>{const t="object"==typeof e&&"content"in e,c=e.value===s;return Object(o.createElement)("div",{className:"wc-block-components-radio-control-accordion-option",key:e.value},Object(o.createElement)(Ue.a,{name:"radio-control-"+i,checked:c,option:e,onChange:t=>{a(t),"function"==typeof e.onChange&&e.onChange(t)}}),t&&c&&Object(o.createElement)("div",{className:n()("wc-block-components-radio-control-accordion-content",{"wc-block-components-radio-control-accordion-content-hide":!c})},e.content))}))}),qe=c(160),$e=e=>{let{children:t,showSaveOption:c}=e;const{isEditor:r}=Object(b.b)(),{shouldSavePayment:n,setShouldSavePayment:s}=Object(de.b)(),{customerId:a}=Object(B.b)();return Object(o.createElement)(qe.a,{isEditor:r},t,a>0&&c&&Object(o.createElement)(k.CheckboxControl,{className:"wc-block-components-payment-methods__save-card-info",label:Object(u.__)("Save payment information to my account for future purchases.","woo-gutenberg-products-block"),checked:n,onChange:()=>s(!n)}))},Ge=()=>{const{setActivePaymentMethod:e,activeSavedToken:t,isExpressPaymentMethodActive:c,customerPaymentMethods:r}=Object(de.b)(),{paymentMethods:s}=Object(pe.b)(),{activePaymentMethod:a,...l}=Object(Be.a)(),{noticeContexts:i}=Object(Le.d)(),{removeNotice:u}=Object(ae.useDispatch)("core/notices"),{dispatchCheckoutEvent:d}=Object(V.a)(),{isEditor:p}=Object(b.b)(),m=Object.keys(s).map(e=>{const{edit:t,content:c,label:r,supports:n}=s[e],i=p?t:c;return{value:e,label:"string"==typeof r?r:Object(o.cloneElement)(r,{components:l.components}),name:"wc-saved-payment-method-token-"+e,content:Object(o.createElement)($e,{showSaveOption:n.showSaveOption},Object(o.cloneElement)(i,{activePaymentMethod:a,...l}))}}),g=Object(o.useCallback)(t=>{e(t),u("wc-payment-error",i.PAYMENTS),d("set-active-payment-method",{value:t})},[d,i.PAYMENTS,u,e]),h=0===Object.keys(r).length&&1===Object.keys(s).length,O=n()({"disable-radio-control":h});return c?null:Object(o.createElement)(Ve,{id:"wc-payment-method-options",className:O,selected:t?null:a,onChange:g,options:m})},He=c(161);const Ye=e=>{let{method:t,expires:c}=e;return Object(u.sprintf)( +/* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card, %3$s is referring to the expiry date. */ +Object(u.__)("%1$s ending in %2$s (expires %3$s)","woo-gutenberg-products-block"),t.brand,t.last4,c)},ze=e=>{let{method:t}=e;return t.brand&&t.last4?Object(u.sprintf)( +/* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card. */ +Object(u.__)("%1$s ending in %2$s","woo-gutenberg-products-block"),t.brand,t.last4):Object(u.sprintf)( +/* translators: %s is the name of the payment method gateway. */ +Object(u.__)("Saved token for %s","woo-gutenberg-products-block"),t.gateway)};var We=()=>{var e,t;const{customerPaymentMethods:c,activePaymentMethod:r,setActivePaymentMethod:n,activeSavedToken:s}=Object(de.b)(),{paymentMethods:a}=Object(pe.b)(),l=Object(Be.a)(),{noticeContexts:i}=Object(Le.d)(),{removeNotice:u}=Object(ae.useDispatch)("core/notices"),{dispatchCheckoutEvent:d}=Object(V.a)(),p=Object(o.useMemo)(()=>Object.keys(c).flatMap(e=>c[e].map(t=>{const c="cc"===e||"echeck"===e,o=t.method.gateway;return{name:"wc-saved-payment-method-token-"+o,label:c?Ye(t):ze(t),value:t.tokenId.toString(),onChange:e=>{n(o,{token:e,payment_method:o,[`wc-${o}-payment-token`]:e.toString(),isSavedToken:!0}),u("wc-payment-error",i.PAYMENTS),d("set-active-payment-method",{paymentMethodSlug:o})}}})).filter(Boolean),[c,n,u,i.PAYMENTS,d]),b=s&&a[r]&&null!==(e=a[r])&&void 0!==e&&e.savedTokenComponent?Object(o.cloneElement)(null===(t=a[r])||void 0===t?void 0:t.savedTokenComponent,{token:s,...l}):null;return p.length>0?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(He.a,{id:"wc-payment-method-saved-tokens",selected:s,options:p,onChange:()=>{}}),b):null},Ke=()=>{const{isInitialized:e,paymentMethods:t}=Object(pe.b)(),{customerPaymentMethods:c}=Object(de.b)();return e&&0===Object.keys(t).length?Object(o.createElement)(De,null):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(We,null),Object.keys(c).length>0&&Object(o.createElement)(Re.a,{label:Object(u.__)("Use another payment method.","woo-gutenberg-products-block"),screenReaderLabel:Object(u.__)("Other available payment methods","woo-gutenberg-products-block"),wrapperElement:"p",wrapperProps:{className:["wc-block-components-checkout-step__description wc-block-components-checkout-step__description-payments-aligned"]}}),Object(o.createElement)(Ge,null))},Xe=()=>Object(o.createElement)(Ke,null),Qe={...Y({defaultTitle:Object(u.__)("Payment options","woo-gutenberg-products-block"),defaultDescription:""}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}};Object(i.registerBlockType)("woocommerce/checkout-payment-block",{icon:{src:Object(o.createElement)(l.a,{icon:Ne.a,className:"wc-block-editor-components-block-icon"})},attributes:Qe,edit:e=>{let{attributes:t,setAttributes:c}=e;const r=Object(D.getSetting)("globalPaymentMethods");return Object(o.createElement)(A,{attributes:t,setAttributes:c,className:n()("wc-block-checkout__payment-method",null==t?void 0:t.className)},Object(o.createElement)(d.InspectorControls,null,r.length>0&&Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Methods","woo-gutenberg-products-block")},Object(o.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(u.__)("You currently have the following payment integrations active.","woo-gutenberg-products-block")),r.map(e=>Object(o.createElement)(Pe,{key:e.id,href:`${D.ADMIN_URL}admin.php?page=wc-settings&tab=checkout§ion=${e.id}`,title:e.title,description:e.description})),Object(o.createElement)(O.ExternalLink,{href:D.ADMIN_URL+"admin.php?page=wc-settings&tab=checkout"},Object(u.__)("Manage payment methods","woo-gutenberg-products-block")))),Object(o.createElement)(q.a,null,Object(o.createElement)(Xe,null)),Object(o.createElement)(I,{block:k.innerBlockAreas.PAYMENT_METHODS}))},save:()=>Object(o.createElement)("div",d.useBlockProps.save(),Object(o.createElement)(x,null))});var Je=c(228),Ze=c(69),et=c(205);c(250);var tt=()=>{const{isCalculating:e,isProcessing:t,isAfterProcessing:c,isBeforeProcessing:r,isComplete:n,hasError:s}=Object(B.b)(),{currentStatus:a}=Object(de.b)(),{paymentMethods:l,isInitialized:i}=Object(pe.a)(),{isEditor:d}=Object(b.b)(),{noticeContexts:p}=Object(Le.d)();if(!i||i&&0===Object.keys(l).length)return d||D.CURRENT_USER_IS_ADMIN?Object(o.createElement)(Je.a,{context:p.EXPRESS_PAYMENTS}):null;const m=t||c||r||n&&!s;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(Ze.a,{isLoading:e||m||a.isDoingExpressPayment},Object(o.createElement)("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--checkout"},Object(o.createElement)("div",{className:"wc-block-components-express-payment__title-container"},Object(o.createElement)(R.a,{className:"wc-block-components-express-payment__title",headingLevel:"2"},Object(u.__)("Express checkout","woo-gutenberg-products-block"))),Object(o.createElement)("div",{className:"wc-block-components-express-payment__content"},Object(o.createElement)(Je.a,{context:p.EXPRESS_PAYMENTS}),Object(o.createElement)("p",null,Object(u.__)("In a hurry? Use one of our express checkout options:","woo-gutenberg-products-block")),Object(o.createElement)(et.a,null)))),Object(o.createElement)("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--checkout"},Object(u.__)("Or continue below","woo-gutenberg-products-block")))},ct=e=>{let{className:t}=e;const{cartNeedsPayment:c}=Object(Se.a)();return c?Object(o.createElement)("div",{className:t},Object(o.createElement)(tt,null)):null};c(439);const ot=()=>Object(o.createElement)(Te.a,{icon:Object(o.createElement)(l.a,{icon:Ne.a}),label:Object(u.__)("Express Checkout","woo-gutenberg-products-block"),className:"wp-block-woocommerce-checkout-express-payment-block-placeholder"},Object(o.createElement)("span",{className:"wp-block-woocommerce-checkout-express-payment-block-placeholder__description"},Object(u.__)("Your store doesn't have any Payment Methods that support the Express Checkout Block. If they are added, they will be shown here.","woo-gutenberg-products-block")),Object(o.createElement)(Ae.a,{isPrimary:!0,href:D.ADMIN_URL+"admin.php?page=wc-settings&tab=checkout",target:"_blank",rel:"noopener noreferrer",className:"wp-block-woocommerce-checkout-express-payment-block-placeholder__button"},Object(u.__)("Configure Payment Methods","woo-gutenberg-products-block")));Object(i.registerBlockType)("woocommerce/checkout-express-payment-block",{icon:{src:Object(o.createElement)(l.a,{icon:Ne.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{paymentMethods:c,isInitialized:r}=Object(pe.a)(),s=Object.keys(c).length>0,a=Object(d.useBlockProps)({className:n()({"wp-block-woocommerce-checkout-express-payment-block--has-express-payment-methods":s},null==t?void 0:t.className),attributes:t});return r?Object(o.createElement)("div",a,s?Object(o.createElement)(ct,null):Object(o.createElement)(ot,null)):null},save:()=>Object(o.createElement)("div",d.useBlockProps.save())});var rt=c(529),nt=c(211),st=c(420),at=c(38),lt=c(13);c(441);var it=()=>Object(o.createElement)(Te.a,{icon:Object(o.createElement)(l.a,{icon:rt.a}),label:Object(u.__)("Shipping options","woo-gutenberg-products-block"),className:"wc-block-checkout__no-shipping-placeholder"},Object(o.createElement)("span",{className:"wc-block-checkout__no-shipping-placeholder-description"},Object(u.__)("Your store does not have any Shipping Options configured. Once you have added your Shipping Options they will appear here.","woo-gutenberg-products-block")),Object(o.createElement)(Ae.a,{isSecondary:!0,href:D.ADMIN_URL+"admin.php?page=wc-settings&tab=shipping",target:"_blank",rel:"noopener noreferrer"},Object(u.__)("Configure Shipping Options","woo-gutenberg-products-block")));c(440);const ut=e=>{const t=Object(D.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(lt.decodeEntities)(e.name),value:e.rate_id,description:Object(lt.decodeEntities)(e.description),secondaryLabel:Object(o.createElement)(at.a,{currency:Object(ve.getCurrencyFromPriceResponse)(e),value:t}),secondaryDescription:Object(lt.decodeEntities)(e.delivery_time)}};var dt=()=>{const{isEditor:e}=Object(b.b)(),{shippingRates:t,needsShipping:c,isLoadingRates:r,hasCalculatedShipping:s}=Object(F.a)();if(!c)return null;const a=Object(st.a)(t);return e||s||a?Object(o.createElement)(o.Fragment,null,e&&!a?Object(o.createElement)(it,null):Object(o.createElement)(nt.a,{noResultsMessage:Object(o.createElement)(Ie.a,{isDismissible:!1,className:n()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(u.__)("There are no shipping options available. Please check your shipping address.","woo-gutenberg-products-block")),renderOption:ut,shippingRates:t,isLoadingRates:r,context:"woocommerce/checkout"})):Object(o.createElement)("p",null,Object(u.__)("Shipping options will be displayed here after entering your full shipping address.","woo-gutenberg-products-block"))},pt={...Y({defaultTitle:Object(u.__)("Shipping options","woo-gutenberg-products-block"),defaultDescription:""}),allowCreateAccount:{type:"boolean",default:!1},className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}};Object(i.registerBlockType)("woocommerce/checkout-shipping-methods-block",{icon:{src:Object(o.createElement)(l.a,{icon:rt.a,className:"wc-block-editor-components-block-icon"})},attributes:pt,edit:e=>{let{attributes:t,setAttributes:c}=e;const r=Object(D.getSetting)("globalShippingMethods"),s=Object(D.getSetting)("activeShippingZones");return Object(o.createElement)(A,{attributes:t,setAttributes:c,className:n()("wc-block-checkout__shipping-option",null==t?void 0:t.className)},Object(o.createElement)(d.InspectorControls,null,r.length>0&&Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Methods","woo-gutenberg-products-block")},Object(o.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(u.__)("You currently have the following shipping integrations active.","woo-gutenberg-products-block")),r.map(e=>Object(o.createElement)(Pe,{key:e.id,href:`${D.ADMIN_URL}admin.php?page=wc-settings&tab=shipping§ion=${e.id}`,title:e.title,description:e.description})),Object(o.createElement)(O.ExternalLink,{href:D.ADMIN_URL+"admin.php?page=wc-settings&tab=shipping"},Object(u.__)("Manage shipping methods","woo-gutenberg-products-block"))),s.length&&Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Zones","woo-gutenberg-products-block")},Object(o.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(u.__)("You currently have the following shipping zones active.","woo-gutenberg-products-block")),s.map(e=>Object(o.createElement)(Pe,{key:e.id,href:`${D.ADMIN_URL}admin.php?page=wc-settings&tab=shipping&zone_id=${e.id}`,title:e.title,description:e.description})),Object(o.createElement)(O.ExternalLink,{href:D.ADMIN_URL+"admin.php?page=wc-settings&tab=shipping"},Object(u.__)("Manage shipping zones","woo-gutenberg-products-block")))),Object(o.createElement)(q.a,null,Object(o.createElement)(dt,null)),Object(o.createElement)(I,{block:k.innerBlockAreas.SHIPPING_METHODS}))},save:()=>Object(o.createElement)("div",d.useBlockProps.save(),Object(o.createElement)(x,null))});var bt=e=>{let{className:t=""}=e;const{cartTotals:c}=Object(Se.a)(),r=Object(ve.getCurrencyFromPriceResponse)(c);return Object(o.createElement)(k.TotalsWrapper,{className:t},Object(o.createElement)(k.Subtotal,{currency:r,values:c}))};Object(i.registerBlockType)("woocommerce/checkout-order-summary-subtotal-block",{icon:{src:Object(o.createElement)(l.a,{icon:fe.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,r=Object(d.useBlockProps)();return Object(o.createElement)("div",r,Object(o.createElement)(bt,{className:c}))},save:()=>Object(o.createElement)("div",d.useBlockProps.save())});var mt=e=>{let{className:t=""}=e;const{cartFees:c,cartTotals:r}=Object(Se.a)(),n=Object(ve.getCurrencyFromPriceResponse)(r);return Object(o.createElement)(k.TotalsWrapper,{className:t},Object(o.createElement)(k.TotalsFees,{currency:n,cartFees:c}))};Object(i.registerBlockType)("woocommerce/checkout-order-summary-fee-block",{icon:{src:Object(o.createElement)(l.a,{icon:fe.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,r=Object(d.useBlockProps)();return Object(o.createElement)("div",r,Object(o.createElement)(mt,{className:c}))},save:()=>Object(o.createElement)("div",d.useBlockProps.save())});var gt=c(419),ht=c(206);const Ot=()=>{const{extensions:e,receiveCart:t,...c}=Object(Se.a)(),r={extensions:e,cart:c,context:"woocommerce/checkout"};return Object(o.createElement)(k.ExperimentalDiscountsMeta.Slot,r)};var _t=e=>{let{className:t=""}=e;const{cartTotals:c,cartCoupons:r}=Object(Se.a)(),{removeCoupon:n,isRemovingCoupon:s}=Object(ht.a)("wc/checkout"),a=Object(ve.getCurrencyFromPriceResponse)(c);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(k.TotalsWrapper,{className:t},Object(o.createElement)(gt.a,{cartCoupons:r,currency:a,isRemovingCoupon:s,removeCoupon:n,values:c})),Object(o.createElement)(Ot,null))};Object(i.registerBlockType)("woocommerce/checkout-order-summary-discount-block",{icon:{src:Object(o.createElement)(l.a,{icon:fe.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,r=Object(d.useBlockProps)();return Object(o.createElement)("div",r,Object(o.createElement)(_t,{className:c}))},save:()=>Object(o.createElement)("div",d.useBlockProps.save())});var jt=c(463),Et=e=>{let{className:t=""}=e;const{cartTotals:c,cartNeedsShipping:r}=Object(Se.a)();if(!r)return null;const n=Object(ve.getCurrencyFromPriceResponse)(c);return Object(o.createElement)(k.TotalsWrapper,{className:t},Object(o.createElement)(jt.a,{showCalculator:!1,showRateSelector:!1,values:c,currency:n}))};Object(i.registerBlockType)("woocommerce/checkout-order-summary-shipping-block",{icon:{src:Object(o.createElement)(l.a,{icon:fe.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,r=Object(d.useBlockProps)();return Object(o.createElement)("div",r,Object(o.createElement)(q.a,null,Object(o.createElement)(Et,{className:c})))},save:()=>Object(o.createElement)("div",d.useBlockProps.save())});var kt=c(508),yt=c(421),ft=e=>{let{className:t=""}=e;const c=Object(D.getSetting)("couponsEnabled",!0),{applyCoupon:r,isApplyingCoupon:n}=Object(ht.a)("wc/checkout");return c?Object(o.createElement)(k.TotalsWrapper,{className:t},Object(o.createElement)(yt.a,{onSubmit:r,isLoading:n})):null};Object(i.registerBlockType)("woocommerce/checkout-order-summary-coupon-form-block",{icon:{src:Object(o.createElement)(l.a,{icon:kt.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,r=Object(d.useBlockProps)();return Object(o.createElement)("div",r,Object(o.createElement)(q.a,null,Object(o.createElement)(ft,{className:c})))},save:()=>Object(o.createElement)("div",d.useBlockProps.save())});var wt=e=>{let{className:t,showRateAfterTaxName:c}=e;const{cartTotals:r}=Object(Se.a)();if(Object(D.getSetting)("displayCartPricesIncludingTax",!1)||parseInt(r.total_tax,10)<=0)return null;const n=Object(ve.getCurrencyFromPriceResponse)(r);return Object(o.createElement)(k.TotalsWrapper,{className:t},Object(o.createElement)(k.TotalsTaxes,{showRateAfterTaxName:c,currency:n,values:r}))},vt={showRateAfterTaxName:{type:"boolean",default:Object(D.getSetting)("displayCartPricesIncludingTax",!1)},lock:{type:"object",default:{remove:!0,move:!1}}};Object(i.registerBlockType)("woocommerce/checkout-order-summary-taxes-block",{icon:{src:Object(o.createElement)(l.a,{icon:fe.a,className:"wc-block-editor-components-block-icon"})},attributes:vt,edit:e=>{let{attributes:t,setAttributes:c}=e;const{className:r,showRateAfterTaxName:n}=t,s=Object(d.useBlockProps)(),a=Object(D.getSetting)("taxesEnabled"),l=Object(D.getSetting)("displayItemizedTaxes",!1),i=Object(D.getSetting)("displayCartPricesIncludingTax",!1);return Object(o.createElement)("div",s,Object(o.createElement)(d.InspectorControls,null,a&&l&&!i&&Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Taxes","woo-gutenberg-products-block")},Object(o.createElement)(O.ToggleControl,{label:Object(u.__)("Show rate after tax name","woo-gutenberg-products-block"),help:Object(u.__)("Show the percentage rate alongside each tax line in the summary.","woo-gutenberg-products-block"),checked:n,onChange:()=>c({showRateAfterTaxName:!n})}))),Object(o.createElement)(wt,{className:r,showRateAfterTaxName:n}))},save:()=>Object(o.createElement)("div",d.useBlockProps.save())});var St=c(244),Ct=c(281),Nt=c(92),Pt=c(115),Rt=c(111),Tt=c(100),At=c(223),It=c(222),xt=c(224),Mt=c(225);const Dt=e=>Object(k.mustContain)(e,"");var Bt=e=>{let{cartItem:t}=e;const{images:c,low_stock_remaining:r,show_backorder_badge:s,name:a,permalink:l,prices:i,quantity:d,short_description:p,description:b,item_data:m,variation:g,totals:h,extensions:O}=t,{receiveCart:_,...j}=Object(Se.a)(),E=Object(o.useMemo)(()=>({context:"summary",cartItem:t,cart:j}),[t,j]),y=Object(ve.getCurrencyFromPriceResponse)(i),f=Object(k.__experimentalApplyCheckoutFilter)({filterName:"itemName",defaultValue:a,extensions:O,arg:E}),w=Object(Rt.a)({amount:parseInt(i.raw_prices.regular_price,10),precision:Object(Tt.a)(i.raw_prices.precision)?parseInt(i.raw_prices.precision,10):i.raw_prices.precision}).convertPrecision(y.minorUnit).getAmount(),v=Object(Rt.a)({amount:parseInt(i.raw_prices.price,10),precision:Object(Tt.a)(i.raw_prices.precision)?parseInt(i.raw_prices.precision,10):i.raw_prices.precision}).convertPrecision(y.minorUnit).getAmount(),S=Object(ve.getCurrencyFromPriceResponse)(h);let C=parseInt(h.line_subtotal,10);Object(D.getSetting)("displayCartPricesIncludingTax",!1)&&(C+=parseInt(h.line_subtotal_tax,10));const N=Object(Rt.a)({amount:C,precision:S.minorUnit}).getAmount(),P=Object(k.__experimentalApplyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"",extensions:O,arg:E,validation:Dt}),R=Object(k.__experimentalApplyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"",extensions:O,arg:E,validation:Dt}),T=Object(k.__experimentalApplyCheckoutFilter)({filterName:"cartItemClass",defaultValue:"",extensions:O,arg:E});return Object(o.createElement)("div",{className:n()("wc-block-components-order-summary-item",T)},Object(o.createElement)("div",{className:"wc-block-components-order-summary-item__image"},Object(o.createElement)("div",{className:"wc-block-components-order-summary-item__quantity"},Object(o.createElement)(Re.a,{label:d.toString(),screenReaderLabel:Object(u.sprintf)( +/* translators: %d number of products of the same type in the cart */ +Object(u._n)("%d item","%d items",d,"woo-gutenberg-products-block"),d)})),Object(o.createElement)(It.a,{image:c.length?c[0]:{},fallbackAlt:f})),Object(o.createElement)("div",{className:"wc-block-components-order-summary-item__description"},Object(o.createElement)(Pt.a,{disabled:!0,name:f,permalink:l}),Object(o.createElement)(Nt.a,{currency:y,price:v,regularPrice:w,className:"wc-block-components-order-summary-item__individual-prices",priceClassName:"wc-block-components-order-summary-item__individual-price",regularPriceClassName:"wc-block-components-order-summary-item__regular-individual-price",format:P}),s?Object(o.createElement)(At.a,null):!!r&&Object(o.createElement)(xt.a,{lowStockRemaining:r}),Object(o.createElement)(Mt.a,{shortDescription:p,fullDescription:b,itemData:m,variation:g})),Object(o.createElement)("span",{className:"screen-reader-text"},Object(u.sprintf)( +/* translators: %1$d is the number of items, %2$s is the item name and %3$s is the total price including the currency symbol. */ +Object(u._n)("Total price for %1$d %2$s item: %3$s","Total price for %1$d %2$s items: %3$s",d,"woo-gutenberg-products-block"),d,f,Object(ve.formatPrice)(N,S))),Object(o.createElement)("div",{className:"wc-block-components-order-summary-item__total-price","aria-hidden":"true"},Object(o.createElement)(Nt.a,{currency:S,format:R,price:N})))};c(442);var Lt=e=>{let{cartItems:t=[]}=e;const{isLarge:c,hasContainerWidth:r}=Object(Ct.b)();return r?Object(o.createElement)(k.Panel,{className:"wc-block-components-order-summary",initialOpen:c,hasBorder:!1,title:Object(o.createElement)("span",{className:"wc-block-components-order-summary__button-text"},Object(u.__)("Order summary","woo-gutenberg-products-block")),titleTag:"h2"},Object(o.createElement)("div",{className:"wc-block-components-order-summary__content"},t.map(e=>Object(o.createElement)(Bt,{key:e.key,cartItem:e})))):null},Ft=e=>{let{className:t}=e;const{cartItems:c}=Object(Se.a)();return Object(o.createElement)(k.TotalsWrapper,{className:t},Object(o.createElement)(Lt,{cartItems:c}))};Object(i.registerBlockType)("woocommerce/checkout-order-summary-cart-items-block",{icon:{src:Object(o.createElement)(l.a,{icon:St.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,r=Object(d.useBlockProps)();return Object(o.createElement)("div",r,Object(o.createElement)(Ft,{className:c}))},save:()=>Object(o.createElement)("div",d.useBlockProps.save())}),c(443);var Ut=c(424),Vt=c(425);c(267),Object(Ut.a)();const qt=["woocommerce/checkout-fields-block","woocommerce/checkout-totals-block"],$t={hasDarkControls:{type:"boolean",default:Object(D.getSetting)("hasDarkEditorStyleSupport",!1)},showRateAfterTaxName:{type:"boolean",default:Object(D.getSetting)("displayCartPricesIncludingTax",!1)}},Gt={showOrderNotes:{type:"boolean",default:!0},showPolicyLinks:{type:"boolean",default:!0},showReturnToCart:{type:"boolean",default:!0},cartPageId:{type:"number",default:0}};var Ht=c(234);const Yt={icon:{src:Object(o.createElement)(l.a,{icon:a,className:"wc-block-editor-components-block-icon"})},attributes:{...Ht.attributes,...$t,...Gt},edit:e=>{let{attributes:t,setAttributes:c}=e;const{allowCreateAccount:r,showCompanyField:s,requireCompanyField:a,showApartmentField:l,showPhoneField:i,requirePhoneField:j,showOrderNotes:E,showPolicyLinks:k,showReturnToCart:w,showRateAfterTaxName:v,cartPageId:S}=t,C=e=>{const o={};o[e]=!t[e],c(o)},N=Object(Ut.b)();return Object(o.createElement)("div",N,Object(o.createElement)(d.InspectorControls,null,Object(o.createElement)(Vt.a,{attributes:t,setAttributes:c})),Object(o.createElement)(b.a,{previewData:{previewCart:g.a,previewSavedPaymentMethods:h}},Object(o.createElement)(m.a,null,Object(o.createElement)(p.a,{className:n()("wc-block-checkout",{"has-dark-controls":t.hasDarkControls})},Object(o.createElement)(f.Provider,{value:{addressFieldControls:()=>Object(o.createElement)(d.InspectorControls,null,Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Address Fields","woo-gutenberg-products-block")},Object(o.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(u.__)("Show or hide fields in the checkout address forms.","woo-gutenberg-products-block")),Object(o.createElement)(O.ToggleControl,{label:Object(u.__)("Company","woo-gutenberg-products-block"),checked:s,onChange:()=>C("showCompanyField")}),s&&Object(o.createElement)(O.CheckboxControl,{label:Object(u.__)("Require company name?","woo-gutenberg-products-block"),checked:a,onChange:()=>C("requireCompanyField"),className:"components-base-control--nested"}),Object(o.createElement)(O.ToggleControl,{label:Object(u.__)("Apartment, suite, etc.","woo-gutenberg-products-block"),checked:l,onChange:()=>C("showApartmentField")}),Object(o.createElement)(O.ToggleControl,{label:Object(u.__)("Phone","woo-gutenberg-products-block"),checked:i,onChange:()=>C("showPhoneField")}),i&&Object(o.createElement)(O.CheckboxControl,{label:Object(u.__)("Require phone number?","woo-gutenberg-products-block"),checked:j,onChange:()=>C("requirePhoneField"),className:"components-base-control--nested"})),Object(o.createElement)(_.a,null)),accountControls:()=>Object(o.createElement)(d.InspectorControls,null,Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Account options","woo-gutenberg-products-block")},Object(o.createElement)(O.ToggleControl,{label:Object(u.__)("Allow shoppers to sign up for a user account during checkout","woo-gutenberg-products-block"),checked:r,onChange:()=>c({allowCreateAccount:!r})})),Object(o.createElement)(_.a,null))}},Object(o.createElement)(y.Provider,{value:{allowCreateAccount:r,showCompanyField:s,requireCompanyField:a,showApartmentField:l,showPhoneField:i,requirePhoneField:j,showOrderNotes:E,showPolicyLinks:k,showReturnToCart:w,cartPageId:S,showRateAfterTaxName:v}},Object(o.createElement)(d.InnerBlocks,{allowedBlocks:qt,template:[["woocommerce/checkout-fields-block",{},[]],["woocommerce/checkout-totals-block",{},[]]],templateLock:"insert"})))))))},save:()=>Object(o.createElement)("div",d.useBlockProps.save({className:"wc-block-checkout is-loading"}),Object(o.createElement)(d.InnerBlocks.Content,null)),deprecated:[{attributes:{...Ht.attributes,...$t,...Gt},save(e){let{attributes:t}=e;return Object(o.createElement)("div",{className:n()("is-loading",t.className)})},migrate:e=>{const{showOrderNotes:t,showPolicyLinks:c,showReturnToCart:o,cartPageId:r}=e;return[e,[Object(i.createBlock)("woocommerce/checkout-fields-block",{},[Object(i.createBlock)("woocommerce/checkout-express-payment-block",{},[]),Object(i.createBlock)("woocommerce/checkout-contact-information-block",{},[]),Object(i.createBlock)("woocommerce/checkout-shipping-address-block",{},[]),Object(i.createBlock)("woocommerce/checkout-billing-address-block",{},[]),Object(i.createBlock)("woocommerce/checkout-shipping-methods-block",{},[]),Object(i.createBlock)("woocommerce/checkout-payment-block",{},[]),!!t&&Object(i.createBlock)("woocommerce/checkout-order-note-block",{},[]),!!c&&Object(i.createBlock)("woocommerce/checkout-terms-block",{},[]),Object(i.createBlock)("woocommerce/checkout-actions-block",{showReturnToCart:o,cartPageId:r},[])].filter(Boolean)),Object(i.createBlock)("woocommerce/checkout-totals-block",{})]]},isEligible:(e,t)=>!t.some(e=>"woocommerce/checkout-fields-block"===e.name)}]};Object(i.registerBlockType)(Ht,Yt)},,,,,,,function(e,t,c){"use strict";var o=c(0),r=c(282),n=c(6),s=c.n(n),a=c(23),l=c(1),i=c(13),u=c(4),d=c.n(u),p=c(10),b=c(534),m=c(102),g=c(221),h=c(35);c(257);var O=Object(p.withInstanceId)(e=>{let{id:t,className:c,label:r,onChange:n,options:s,value:a,required:i=!1,errorMessage:u=Object(l.__)("Please select a value.","woo-gutenberg-products-block"),errorId:p,instanceId:O="0",autoComplete:_="off"}=e;const{getValidationError:j,setValidationErrors:E,clearValidationError:k}=Object(m.b)(),y=Object(o.useRef)(null),f=t||"control-"+O,w=p||f,v=j(w)||{message:"",hidden:!1};return Object(o.useEffect)(()=>(!i||a?k(w):E({[w]:{message:u,hidden:!0}}),()=>{k(w)}),[k,a,w,u,i,E]),Object(o.createElement)("div",{id:f,className:d()("wc-block-components-combobox",c,{"is-active":a,"has-error":v.message&&!v.hidden}),ref:y},Object(o.createElement)(b.a,{className:"wc-block-components-combobox-control",label:r,onChange:n,onFilterValueChange:e=>{if(e.length){const t=Object(h.a)(y.current)?y.current.ownerDocument.activeElement:void 0;if(t&&Object(h.a)(y.current)&&y.current.contains(t))return;const c=e.toLocaleUpperCase(),o=s.find(e=>e.label.toLocaleUpperCase().startsWith(c)||e.value.toLocaleUpperCase()===c);o&&n(o.value)}},options:s,value:a||"",allowReset:!1,autoComplete:_,"aria-invalid":v.message&&!v.hidden}),Object(o.createElement)(g.a,{propertyName:w}))});c(256);var _=e=>{let{className:t,countries:c,id:r,label:n,onChange:s,value:a="",autoComplete:u="off",required:p=!1,errorId:b,errorMessage:m=Object(l.__)("Please select a country.","woo-gutenberg-products-block")}=e;const g=Object(o.useMemo)(()=>Object.entries(c).map(e=>{let[t,c]=e;return{value:t,label:Object(i.decodeEntities)(c)}}),[c]);return Object(o.createElement)("div",{className:d()(t,"wc-block-components-country-input")},Object(o.createElement)(O,{id:r,label:n,onChange:s,options:g,value:a,errorId:b,errorMessage:m,required:p,autoComplete:u}),"off"!==u&&Object(o.createElement)("input",{type:"text","aria-hidden":!0,autoComplete:u,value:a,onChange:e=>{const t=e.target.value.toLocaleUpperCase(),c=g.find(e=>2!==t.length&&e.label.toLocaleUpperCase()===t||2===t.length&&e.value.toLocaleUpperCase()===t);s(c?c.value:"")},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1}))},j=e=>Object(o.createElement)(_,s()({countries:a.h},e)),E=e=>Object(o.createElement)(_,s()({countries:a.a},e));c(258);const k=(e,t)=>{const c=t.find(t=>t.label.toLocaleUpperCase()===e.toLocaleUpperCase()||t.value.toLocaleUpperCase()===e.toLocaleUpperCase());return c?c.value:""};var y=e=>{let{className:t,id:c,states:n,country:s,label:a,onChange:u,autoComplete:p="off",value:b="",required:m=!1}=e;const g=n[s],h=Object(o.useMemo)(()=>g?Object.keys(g).map(e=>({value:e,label:Object(i.decodeEntities)(g[e])})):[],[g]),_=Object(o.useCallback)(e=>{u(h.length>0?k(e,h):e)},[u,h]),j=Object(o.useRef)(b);return Object(o.useEffect)(()=>{j.current!==b&&(j.current=b)},[b]),Object(o.useEffect)(()=>{if(h.length>0&&j.current){const e=k(j.current,h);e!==j.current&&_(e)}},[h,_]),h.length>0?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(O,{className:d()(t,"wc-block-components-state-input"),id:c,label:a,onChange:_,options:h,value:b,errorMessage:Object(l.__)("Please select a state.","woo-gutenberg-products-block"),required:m,autoComplete:p}),"off"!==p&&Object(o.createElement)("input",{type:"text","aria-hidden":!0,autoComplete:p,value:b,onChange:e=>_(e.target.value),style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1})):Object(o.createElement)(r.a,{className:t,id:c,label:a,onChange:_,autoComplete:p,value:b,required:m})},f=e=>Object(o.createElement)(y,s()({states:a.i},e)),w=e=>Object(o.createElement)(y,s()({states:a.b},e)),v=c(49),S=c(2),C=c(90);t.a=Object(p.withInstanceId)(e=>{let{id:t="",fields:c=Object.keys(S.defaultAddressFields),fieldConfig:n={},instanceId:s,onChange:a,type:i="shipping",values:u}=e;const{getValidationError:d,setValidationErrors:p,clearValidationError:b}=Object(m.b)(),g=Object(v.a)(c),h=d("shipping-missing-country")||{},O=Object(o.useMemo)(()=>Object(C.a)(g,n,u.country),[g,n,u.country]);return Object(o.useEffect)(()=>{O.forEach(e=>{e.hidden&&u[e.key]&&a({...u,[e.key]:""})})},[O,a,u]),Object(o.useEffect)(()=>{"shipping"===i&&((e,t,c,o)=>{o||e.country||!(e.city||e.state||e.postcode)||t({"shipping-missing-country":{message:Object(l.__)("Please select a country to calculate rates.","woo-gutenberg-products-block"),hidden:!1}}),o&&e.country&&c("shipping-missing-country")})(u,p,b,!!h.message&&!h.hidden)},[u,h.message,h.hidden,p,b,i]),t=t||s,Object(o.createElement)("div",{id:t,className:"wc-block-components-address-form"},O.map(e=>{if(e.hidden)return null;if("country"===e.key){const c="shipping"===i?j:E;return Object(o.createElement)(c,{key:e.key,id:`${t}-${e.key}`,label:e.required?e.label:e.optionalLabel,value:u.country,autoComplete:e.autocomplete,onChange:e=>a({...u,country:e,state:""}),errorId:"shipping"===i?"shipping-missing-country":null,errorMessage:e.errorMessage,required:e.required})}if("state"===e.key){const c="shipping"===i?f:w;return Object(o.createElement)(c,{key:e.key,id:`${t}-${e.key}`,country:u.country,label:e.required?e.label:e.optionalLabel,value:u.state,autoComplete:e.autocomplete,onChange:e=>a({...u,state:e}),errorMessage:e.errorMessage,required:e.required})}return Object(o.createElement)(r.a,{key:e.key,id:`${t}-${e.key}`,className:"wc-block-components-address-form__"+e.key,label:e.required?e.label:e.optionalLabel,value:u[e.key],autoCapitalize:e.autocapitalize,autoComplete:e.autocomplete,onChange:t=>a({...u,[e.key]:t}),errorMessage:e.errorMessage,required:e.required})}))})},,,function(e,t,c){"use strict";var o=c(6),r=c.n(o),n=c(0),s=c(4),a=c.n(s),l=c(1),i=c(41),u=c(18),d=c(2),p=c(13);const b=e=>{let{selectedShippingRates:t}=e;return Object(n.createElement)("div",{className:"wc-block-components-totals-item__description wc-block-components-totals-shipping__via"},Object(l.__)("via","woo-gutenberg-products-block")," ",Object(p.decodeEntities)(t.join(", ")))};var m=c(283),g=c(211),h=e=>{let{hasRates:t,shippingRates:c,isLoadingRates:o}=e;const r=t?Object(l.__)("Shipping options","woo-gutenberg-products-block"):Object(l.__)("Choose a shipping option","woo-gutenberg-products-block");return Object(n.createElement)("fieldset",{className:"wc-block-components-totals-shipping__fieldset"},Object(n.createElement)("legend",{className:"screen-reader-text"},r),Object(n.createElement)(g.a,{className:"wc-block-components-totals-shipping__options",collapsible:!0,noResultsMessage:Object(n.createElement)(m.a,{isDismissible:!1,className:a()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(l.__)("No shipping options were found.","woo-gutenberg-products-block")),shippingRates:c,isLoadingRates:o,context:"woocommerce/cart"}))},O=c(88),_=c(68),j=c(22),E=c.n(j),k=c(102),y=(c(190),c(460)),f=e=>{let{address:t,onUpdate:c,addressFields:o}=e;const[r,s]=Object(n.useState)(t),{hasValidationErrors:a,showAllValidationErrors:i}=Object(k.b)();return Object(n.createElement)("form",{className:"wc-block-components-shipping-calculator-address"},Object(n.createElement)(y.a,{fields:o,onChange:s,values:r}),Object(n.createElement)(_.a,{className:"wc-block-components-shipping-calculator-address__button",disabled:E()(r,t),onClick:e=>{if(e.preventDefault(),i(),!a)return c(r)},type:"submit"},Object(l.__)("Update","woo-gutenberg-products-block")))},w=e=>{let{onUpdate:t=(()=>{}),addressFields:c=["country","state","city","postcode"]}=e;const{shippingAddress:o,setShippingAddress:r,setBillingAddress:s}=Object(O.a)();return Object(n.createElement)("div",{className:"wc-block-components-shipping-calculator"},Object(n.createElement)(f,{address:o,addressFields:c,onUpdate:e=>{r(e),s(e),t(e)}}))},v=e=>{let{address:t}=e;if(0===Object.values(t).length)return null;const c=Object(d.getSetting)("shippingCountries",{}),o=Object(d.getSetting)("shippingStates",{}),r="string"==typeof c[t.country]?Object(p.decodeEntities)(c[t.country]):"",s="object"==typeof o[t.country]&&"string"==typeof o[t.country][t.state]?Object(p.decodeEntities)(o[t.country][t.state]):t.state,a=[];a.push(t.postcode.toUpperCase()),a.push(t.city),a.push(s),a.push(r);const i=a.filter(Boolean).join(", ");return i?Object(n.createElement)("span",{className:"wc-block-components-shipping-address"},Object(l.sprintf)( +/* translators: %s location. */ +Object(l.__)("Shipping to %s","woo-gutenberg-products-block"),i)+" "):null};c(255);const S=e=>{let{label:t=Object(l.__)("Calculate","woo-gutenberg-products-block"),isShippingCalculatorOpen:c,setIsShippingCalculatorOpen:o}=e;return Object(n.createElement)("button",{className:"wc-block-components-totals-shipping__change-address-button",onClick:()=>{o(!c)},"aria-expanded":c},t)},C=e=>{let{showCalculator:t,isShippingCalculatorOpen:c,setIsShippingCalculatorOpen:o,shippingAddress:r}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(v,{address:r}),t&&Object(n.createElement)(S,{label:Object(l.__)("(change address)","woo-gutenberg-products-block"),isShippingCalculatorOpen:c,setIsShippingCalculatorOpen:o}))},N=e=>{let{showCalculator:t,isShippingCalculatorOpen:c,setIsShippingCalculatorOpen:o,isCheckout:r=!1}=e;return t?Object(n.createElement)(S,{isShippingCalculatorOpen:c,setIsShippingCalculatorOpen:o}):Object(n.createElement)("em",null,r?Object(l.__)("No shipping options available","woo-gutenberg-products-block"):Object(l.__)("Calculated during checkout","woo-gutenberg-products-block"))};t.a=e=>{let{currency:t,values:c,showCalculator:o=!0,showRateSelector:s=!0,isCheckout:p=!1,className:m}=e;const[g,O]=Object(n.useState)(!1),{shippingAddress:_,cartHasCalculatedShipping:j,shippingRates:E,isLoadingRates:k}=Object(i.a)(),y=Object(d.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(c.total_shipping,10)+parseInt(c.total_shipping_tax,10):parseInt(c.total_shipping,10),f=E.some(e=>e.shipping_rates.length)||y,v={isShippingCalculatorOpen:g,setIsShippingCalculatorOpen:O},S=E.flatMap(e=>e.shipping_rates.filter(e=>e.selected).flatMap(e=>e.name));return Object(n.createElement)("div",{className:a()("wc-block-components-totals-shipping",m)},Object(n.createElement)(u.TotalsItem,{label:Object(l.__)("Shipping","woo-gutenberg-products-block"),value:f&&j?y:Object(n.createElement)(N,r()({showCalculator:o,isCheckout:p},v)),description:f&&j?Object(n.createElement)(n.Fragment,null,Object(n.createElement)(b,{selectedShippingRates:S}),Object(n.createElement)(C,r()({shippingAddress:_,showCalculator:o},v))):null,currency:t}),o&&g&&Object(n.createElement)(w,{onUpdate:()=>{O(!1)}}),s&&j&&Object(n.createElement)(h,{hasRates:f,shippingRates:E,isLoadingRates:k}))}}]); \ No newline at end of file diff --git a/build/checkout/block.json b/build/checkout/block.json new file mode 100644 index 00000000000..437677063f5 --- /dev/null +++ b/build/checkout/block.json @@ -0,0 +1,46 @@ +{ + "name": "woocommerce/checkout", + "version": "1.0.0", + "title": "Checkout", + "description": "Display a checkout form so your customers can submit orders.", + "category": "woocommerce", + "keywords": [ "WooCommerce" ], + "supports": { + "align": [ "wide" ], + "html": false, + "multiple": false + }, + "attributes": { + "isPreview": { + "type": "boolean", + "default": false, + "save": false + }, + "showCompanyField": { + "type": "boolean", + "default": false + }, + "requireCompanyField": { + "type": "boolean", + "default": false + }, + "allowCreateAccount": { + "type": "boolean", + "default": false + }, + "showApartmentField": { + "type": "boolean", + "default": true + }, + "showPhoneField": { + "type": "boolean", + "default": true + }, + "requirePhoneField": { + "type": "boolean", + "default": false + } + }, + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2 +} diff --git a/build/empty-cart-block/block.json b/build/empty-cart-block/block.json new file mode 100644 index 00000000000..04f089e1ab5 --- /dev/null +++ b/build/empty-cart-block/block.json @@ -0,0 +1,28 @@ +{ + "name": "woocommerce/empty-cart-block", + "version": "1.0.0", + "title": "Empty Cart", + "description": "Contains blocks that are displayed when the cart is empty.", + "category": "woocommerce", + "supports": { + "align": [ "wide" ], + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/cart" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/empty-mini-cart-contents-block/block.json b/build/empty-mini-cart-contents-block/block.json new file mode 100644 index 00000000000..b8017ef7c29 --- /dev/null +++ b/build/empty-mini-cart-contents-block/block.json @@ -0,0 +1,27 @@ +{ + "name": "woocommerce/empty-mini-cart-contents-block", + "version": "1.0.0", + "title": "Empty Mini Cart Contents", + "description": "Contains blocks that are displayed when the mini cart is empty.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/mini-cart-contents" ], + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2 +} diff --git a/build/featured-category.asset.php b/build/featured-category.asset.php new file mode 100644 index 00000000000..ad603d2d3c5 --- /dev/null +++ b/build/featured-category.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-escape-html', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'e2d2d35875d3d9db824442b0800a9be8'); \ No newline at end of file diff --git a/build/featured-category.js b/build/featured-category.js new file mode 100644 index 00000000000..06ede1e3e90 --- /dev/null +++ b/build/featured-category.js @@ -0,0 +1,21 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["featured-category"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],l=t[2],d=0,b=[];dt=>{let{selected:r,...n}=t;const[u,d]=Object(c.useState)(!0),[b,m]=Object(c.useState)(null),[g,p]=Object(c.useState)([]),h=a.o.productCount>100,O=async e=>{const t=await Object(l.a)(e);m(t),d(!1)},j=Object(c.useRef)(r);Object(c.useEffect)(()=>{Object(i.h)({selected:j.current}).then(e=>{p(e),d(!1)}).catch(O)},[j]);const f=Object(s.a)(e=>{Object(i.h)({selected:r,search:e}).then(e=>{p(e),d(!1)}).catch(O)},400),_=Object(c.useCallback)(e=>{d(!0),f(e)},[d,f]);return Object(c.createElement)(e,o()({},n,{selected:r,error:b,products:g,isLoading:u,onSearch:h?_:null}))}},177:function(e,t){},19:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"c",(function(){return s})),r.d(t,"d",(function(){return l})),r.d(t,"b",(function(){return u}));var n=r(0),o=r(7),c=r(1);const a={clear:Object(c.__)("Clear all selected items","woo-gutenberg-products-block"),noItems:Object(c.__)("No items found.","woo-gutenberg-products-block"), +/* Translators: %s search term */ +noResults:Object(c.__)("No results for %s","woo-gutenberg-products-block"),search:Object(c.__)("Search for items","woo-gutenberg-products-block"),selected:e=>Object(c.sprintf)( +/* translators: Number of items selected from list. */ +Object(c._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(c.__)("Search results updated.","woo-gutenberg-products-block")},i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const r=Object(o.groupBy)(e,"parent"),n=Object(o.keyBy)(t,"id"),c=["0"],a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=a(n[e.parent]);return[...t,e.name]},i=e=>e.map(e=>{const t=r[e.id];return c.push(""+e.id),{...e,breadcrumbs:a(n[e.parent]),children:t&&t.length?i(t):[]}}),s=i(r[0]||[]);return Object.entries(r).forEach(e=>{let[t,r]=e;c.includes(t)||s.push(...i(r||[]))}),s},s=(e,t,r)=>{if(!t)return r?i(e):e;const n=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),o=e.map(e=>!!n.test(e.name)&&e).filter(Boolean);return r?i(o,e):o},l=(e,t)=>{if(!t)return e;const r=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(r).map((e,t)=>r.test(e)?Object(n.createElement)("strong",{key:t},e):Object(n.createElement)(n.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},193:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(6),o=r.n(n),c=r(0),a=r(12),i=r(9);const s=e=>t=>{var r;const[n,s]=Object(a.useState)(!1),{attributes:l,category:u,clientId:d,product:b}=t,m=u||b,{editMode:g}=l,p=(null==m?void 0:m.link)||(null==m?void 0:m.permalink),h=Object(i.useSelect)(e=>e("core/block-editor").getBlock(d)),O=null==h||null===(r=h.innerBlocks[0])||void 0===r?void 0:r.innerBlocks[0],j=(null==O?void 0:O.clientId)||"",f=Object(a.useMemo)(()=>(null==O?void 0:O.attributes)||{},[O]),{url:_}=f,{updateBlockAttributes:w}=Object(i.useDispatch)("core/block-editor");return Object(a.useEffect)(()=>{n&&j&&!g&&p&&_&&p!==_&&(w(j,{url:p}),s(!1))},[j,n,g,p,w,_]),Object(c.createElement)(e,o()({},t,{triggerUrlUpdate:()=>s(!0)}))}},194:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(6),o=r.n(n),c=r(0),a=r(12);const i=e=>t=>{const[r,n]=Object(a.useState)(!1),{isSelected:i}=t;return Object(a.useEffect)(()=>{n(!1)},[i]),Object(c.createElement)(e,o()({},t,{useEditingImage:[r,n]}))}},195:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(0),o=r(3),c=r(1),a=r(56),i=r(93),s=r(46),l=r(85);const u=e=>{let{description:t,editLabel:r,icon:u,label:d}=e;return e=>b=>{const{attributes:m,debouncedSpeak:g,name:p,setAttributes:h,triggerUrlUpdate:O=(()=>{})}=b,j=Object(l.c)(p);return m.editMode?Object(n.createElement)(o.Placeholder,{icon:Object(n.createElement)(o.Icon,{icon:u}),label:d,className:j},t,Object(n.createElement)("div",{className:j+"__selection"},p===s.a.featuredCategory&&Object(n.createElement)(a.a,{selected:[m.categoryId],onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e[0]?e[0].id:0;h({categoryId:t,mediaId:0,mediaSrc:""}),O()},isSingle:!0}),p===s.a.featuredProduct&&Object(n.createElement)(i.a,{selected:m.productId?[m.productId]:[],showVariations:!0,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e[0]?e[0].id:0;h({productId:t,mediaId:0,mediaSrc:""}),O()}}),Object(n.createElement)(o.Button,{isPrimary:!0,onClick:()=>{h({editMode:!1}),g(r)}},Object(c.__)("Done","woo-gutenberg-products-block")))):Object(n.createElement)(e,b)}}},196:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=r(73),c=r(46),a=r(85);const i=e=>t=>{const{error:r,isLoading:i,name:s}=t,l=Object(a.c)(s),u=s===c.a.featuredCategory?t.getCategory:t.getProduct;return r?Object(n.createElement)(o.a,{className:l+"-error",error:r,isLoading:i,onRetry:u}):Object(n.createElement)(e,t)}},197:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(0),o=r(5),c=r(46),a=r(84);const i=e=>{let{backgroundImageId:t,backgroundImageSize:r,backgroundImageSrc:a,isEditingImage:i,setAttributes:s,setIsEditingImage:l}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(o.__experimentalImageEditingProvider,{id:t,url:a,naturalHeight:r.height||c.b.height,naturalWidth:r.width||c.b.width,onSaveImage:e=>{let{id:t,url:r}=e;s({mediaId:t,mediaSrc:r})},isEditing:i,onFinishEditing:()=>l(!1)},Object(n.createElement)(o.__experimentalImageEditor,{url:a,height:r.height||c.b.height,width:r.width||c.b.width})))},s=e=>t=>{const[r,o]=t.useEditingImage,{attributes:s,backgroundImageSize:l,name:u,setAttributes:d}=t,{mediaId:b,mediaSrc:m}=s,g=u===c.a.featuredProduct?t.product:t.category,{backgroundImageId:p,backgroundImageSrc:h}=Object(a.a)({item:g,mediaId:b,mediaSrc:m,blockName:u});return r?Object(n.createElement)(i,{backgroundImageId:p,backgroundImageSize:l,backgroundImageSrc:h,isEditingImage:r,setAttributes:d,setIsEditingImage:o}):Object(n.createElement)(e,t)}},198:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(0),o=r(1),c=r(5),a=r(3),i=r(84),s=r(46);const l=e=>{let{alt:t,backgroundImageSrc:r,contentPanel:i,dimRatio:s,focalPoint:l,hasParallax:u,imageFit:d,isRepeated:b,overlayColor:m,overlayGradient:g,setAttributes:p,setGradient:h,showDesc:O}=e;const j="function"==typeof a.FocalPointPicker,f=!b&&!u;return Object(n.createElement)(c.InspectorControls,{key:"inspector"},Object(n.createElement)(a.PanelBody,{title:Object(o.__)("Content","woo-gutenberg-products-block")},Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Show description","woo-gutenberg-products-block"),checked:O,onChange:()=>p({showDesc:!O})}),i),!!r&&Object(n.createElement)(n.Fragment,null,j&&Object(n.createElement)(a.PanelBody,{title:Object(o.__)("Media settings","woo-gutenberg-products-block")},Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Fixed background","woo-gutenberg-products-block"),checked:u,onChange:()=>{p({hasParallax:!u})}}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Repeated background","woo-gutenberg-products-block"),checked:b,onChange:()=>{p({isRepeated:!b})}}),!b&&Object(n.createElement)(a.__experimentalToggleGroupControl,{help:Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{style:{display:"block",marginBottom:"1em"}},Object(o.__)("Choose “Cover” if you want the image to scale automatically to always fit its container.","woo-gutenberg-products-block")),Object(n.createElement)("span",null,Object(o.__)("Note: by choosing “Cover” you will lose the ability to freely move the focal point precisely.","woo-gutenberg-products-block"))),label:Object(o.__)("Image fit","woo-gutenberg-products-block"),value:d,onChange:e=>p({imageFit:e})},Object(n.createElement)(a.__experimentalToggleGroupControlOption,{label:Object(o.__)("None","woo-gutenberg-products-block"),value:"none"}),Object(n.createElement)(a.__experimentalToggleGroupControlOption +/* translators: "Cover" is a verb that indicates an image covering the entire container. */,{label:Object(o.__)("Cover","woo-gutenberg-products-block"),value:"cover"})),Object(n.createElement)(a.FocalPointPicker,{label:Object(o.__)("Focal Point Picker","woo-gutenberg-products-block"),url:r,value:l,onChange:e=>p({focalPoint:e})}),f&&Object(n.createElement)(a.TextareaControl,{label:Object(o.__)("Alt text (alternative text)","woo-gutenberg-products-block"),value:t,onChange:e=>{p({alt:e})},help:Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.ExternalLink,{href:"https://www.w3.org/WAI/tutorials/images/decision-tree"},Object(o.__)("Describe the purpose of the image","woo-gutenberg-products-block")))})),Object(n.createElement)(c.__experimentalPanelColorGradientSettings,{__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,title:Object(o.__)("Overlay","woo-gutenberg-products-block"),initialOpen:!0,settings:[{colorValue:m,gradientValue:g,onColorChange:e=>p({overlayColor:e}),onGradientChange:e=>{h(e),p({overlayGradient:e})},label:Object(o.__)("Color","woo-gutenberg-products-block")}]},Object(n.createElement)(a.RangeControl,{label:Object(o.__)("Opacity","woo-gutenberg-products-block"),value:s,onChange:e=>p({dimRatio:e}),min:0,max:100,step:10,required:!0}))))},u=e=>t=>{const{attributes:r,name:u,setAttributes:d}=t,{alt:b,dimRatio:m,focalPoint:g,hasParallax:p,isRepeated:h,imageFit:O,mediaId:j,mediaSrc:f,overlayColor:_,overlayGradient:w,showDesc:v,showPrice:y}=r,E=u===s.a.featuredProduct?t.product:t.category,{setGradient:k}=Object(c.__experimentalUseGradient)({gradientAttribute:"overlayGradient",customGradientAttribute:"overlayGradient"}),{backgroundImageSrc:S}=Object(i.a)({item:E,mediaId:j,mediaSrc:f,blockName:u}),I=u===s.a.featuredProduct?Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Show price","woo-gutenberg-products-block"),checked:y,onChange:()=>d({showPrice:!y})}):void 0;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(l,{alt:b,backgroundImageSrc:S,contentPanel:I,dimRatio:m,focalPoint:g,hasParallax:p,isRepeated:h,imageFit:O,overlayColor:_,overlayGradient:w,setAttributes:d,setGradient:k,showDesc:v}),Object(n.createElement)(e,t))}},199:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(0),o=r(1),c=r(5),a=r(3),i=r(328),s=r(142),l=r(84);const u=e=>{let{backgroundImageId:t,backgroundImageSrc:r,contentAlign:l,cropLabel:u,editLabel:d,editMode:b,isEditingImage:m,mediaSrc:g,setAttributes:p,setIsEditingImage:h}=e;return Object(n.createElement)(c.BlockControls,null,Object(n.createElement)(c.AlignmentToolbar,{value:l,onChange:e=>{p({contentAlign:e})}}),Object(n.createElement)(a.ToolbarGroup,null,r&&!m&&Object(n.createElement)(a.ToolbarButton,{onClick:()=>h(!0),icon:i.a,label:u}),Object(n.createElement)(c.MediaReplaceFlow,{mediaId:t,mediaURL:g,accept:"image/*",onSelect:e=>{p({mediaId:e.id,mediaSrc:e.url})},allowedTypes:["image"]}),t&&g?Object(n.createElement)(s.a,{onClick:()=>p({mediaId:0,mediaSrc:""})},Object(o.__)("Reset","woo-gutenberg-products-block")):null),Object(n.createElement)(a.ToolbarGroup,{controls:[{icon:"edit",title:d,onClick:()=>p({editMode:!b}),isActive:b}]}))},d=e=>{let{cropLabel:t,editLabel:r}=e;return e=>o=>{const[c,a]=o.useEditingImage,{attributes:i,category:s,name:d,product:b,setAttributes:m}=o,{contentAlign:g,editMode:p,mediaId:h,mediaSrc:O}=i,j=s||b,{backgroundImageId:f,backgroundImageSrc:_}=Object(l.a)({item:j,mediaId:h,mediaSrc:O,blockName:d});return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(u,{backgroundImageId:f,backgroundImageSrc:_,contentAlign:g,cropLabel:t,editLabel:r,editMode:p,isEditingImage:c,mediaSrc:O,setAttributes:m,setIsEditingImage:a}),Object(n.createElement)(e,o))}}},2:function(e,t){e.exports=window.wc.wcSettings},210:function(e,t,r){"use strict";r.d(t,"a",(function(){return O}));var n=r(6),o=r.n(n),c=r(0),a=r(5),i=r(3),s=r(4),l=r.n(s),u=r(7),d=r(12),b=r(1);const m=e=>{let{itemId:t,linkText:r,permalink:n}=e;const o=l()("wp-block-button__link","is-style-fill");return"preview"===t?Object(c.createElement)("div",{className:"wp-block-button aligncenter",style:{width:"100%"}},Object(c.createElement)(a.RichText.Content,{tagName:"a",className:o,href:n,title:r,style:{backgroundColor:"vivid-green-cyan",borderRadius:"5px"},value:r,target:n})):Object(c.createElement)(a.InnerBlocks,{template:[["core/buttons",{layout:{type:"flex",justifyContent:"center"}},[["core/button",{text:Object(b.__)("Shop now","woo-gutenberg-products-block"),url:n}]]]],templateLock:"all"})},g=e=>{let{className:t="",onResize:r,...n}=e;const[a,s]=Object(d.useState)(!1),b=l()(t,{"is-resizing":a}),m=function(e,t,r){const n=Object(d.useRef)(e);return Object(d.useEffect)(()=>{n.current=e}),Object(d.useCallback)(Object(u.throttle)((function(){return n.current(...arguments)}),50,{leading:!0}),[50])}((e,t,n,o)=>{a||s(!0),null==r||r(e,t,n,o)});return Object(c.createElement)(i.ResizableBox,o()({className:b,enable:{bottom:!0},onResize:m,onResizeStop:function(){for(var e=arguments.length,t=new Array(e),n=0;n{let{emptyMessage:t,icon:r,label:n}=e;return e=>s=>{const[b]=s.useEditingImage,{attributes:O,category:j,isLoading:f,isSelected:_,name:w,product:v,setAttributes:y}=s,{mediaId:E,mediaSrc:k}=O,S=j||v,[I,C]=Object(d.useState)({}),{backgroundImageSrc:x}=Object(p.a)({item:S,mediaId:E,mediaSrc:k,blockName:w}),P=Object(h.c)(w),N=Object(d.useCallback)((e,t,r)=>{y({minHeight:parseInt(r.style.height,10)})},[y]);return b?Object(c.createElement)(e,o()({},s,{backgroundImageSize:I})):Object(c.createElement)(c.Fragment,null,Object(c.createElement)(e,o()({},s,{backgroundImageSize:I})),S?(()=>{var e,t;const{contentAlign:r,dimRatio:n,focalPoint:o,hasParallax:i,isRepeated:s,imageFit:d,minHeight:b,overlayColor:p,overlayGradient:w,showDesc:y,showPrice:E,style:k,textColor:I}=O,R=l()(P,{"is-selected":_&&"preview"!==O.categoryId&&"preview"!==O.productId,"is-loading":!S&&f,"is-not-found":!S&&!f,"has-background-dim":0!==n,"is-repeated":s},Object(h.a)(n),"center"!==r&&`has-${r}-content`),A={borderRadius:null==k||null===(e=k.border)||void 0===e?void 0:e.radius,color:I?`var(--wp--preset--color--${I})`:null==k||null===(t=k.color)||void 0===t?void 0:t.text},L={...Object(a.__experimentalGetSpacingClassesAndStyles)(O).style,minHeight:b},T=!s&&!i,M=Object(h.b)({focalPoint:o,imageFit:d,isImgElement:T,isRepeated:s,url:x}),F={background:w,backgroundColor:p};return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(g,{enable:{bottom:!0},onResize:N,showHandle:_,style:{minHeight:b}}),Object(c.createElement)("div",{className:R,style:A},Object(c.createElement)("div",{className:P+"__wrapper",style:L},Object(c.createElement)("div",{className:"background-dim__overlay",style:F}),x&&(T?Object(c.createElement)("img",{alt:S.name,className:P+"__background-image",src:x,style:M,onLoad:e=>{var t,r;C({height:null===(t=e.currentTarget)||void 0===t?void 0:t.naturalHeight,width:null===(r=e.currentTarget)||void 0===r?void 0:r.naturalWidth})}}):Object(c.createElement)("div",{className:l()(P+"__background-image",{"has-parallax":i}),style:M})),Object(c.createElement)("h2",{className:P+"__title",dangerouslySetInnerHTML:{__html:S.name}}),!Object(u.isEmpty)(null==v?void 0:v.variation)&&Object(c.createElement)("h3",{className:P+"__variation",dangerouslySetInnerHTML:{__html:v.variation}}),y&&Object(c.createElement)("div",{className:P+"__description",dangerouslySetInnerHTML:{__html:(null==j?void 0:j.description)||(null==v?void 0:v.short_description)}}),E&&Object(c.createElement)("div",{className:P+"__price",dangerouslySetInnerHTML:{__html:v.price_html}}),Object(c.createElement)("div",{className:P+"__link"},(()=>{const{categoryId:e,linkText:t,productId:r}=O;return Object(c.createElement)(m,{itemId:e||r,linkText:t,permalink:(j||v).permalink})})()))))})():Object(c.createElement)(i.Placeholder,{className:P,icon:Object(c.createElement)(i.Icon,{icon:r}),label:n},f?Object(c.createElement)(i.Spinner,null):t))}}},212:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(0),o=r(5),c=r(8),a=r(2),i=r(95),s=r(6),l=r.n(s);function u(e){return function(t){const r=Object(o.useBlockProps)(),{color:c,...a}=r.style;return Object(n.createElement)("div",l()({},r,{style:a}),Object(n.createElement)(e,t))}}function d(e,t,r,s){var l,d,b,m,g,p,h,O,j,f,_,w,v;const y={attributes:{...r.attributes,minHeight:{type:"number",default:Object(a.getSetting)("default_height",500)}},supports:{...r.supports,color:{background:null===(l=r.supports)||void 0===l||null===(d=l.color)||void 0===d?void 0:d.background,text:null===(b=r.supports)||void 0===b||null===(m=b.color)||void 0===m?void 0:m.text,...Object(i.b)()&&{__experimentalDuotone:null===(g=r.supports)||void 0===g||null===(p=g.color)||void 0===p?void 0:p.__experimentalDuotone}},spacing:{padding:null===(h=r.supports)||void 0===h||null===(O=h.spacing)||void 0===O?void 0:O.padding,...Object(i.b)()&&{__experimentalDefaultControls:{padding:null===(j=r.supports)||void 0===j||null===(f=j.spacing)||void 0===f?void 0:f.__experimentalDefaultControls},__experimentalSkipSerialization:null===(_=r.supports)||void 0===_||null===(w=_.spacing)||void 0===w?void 0:w.__experimentalSkipSerialization}},...Object(i.b)()&&{__experimentalBorder:null==r||null===(v=r.supports)||void 0===v?void 0:v.__experimentalBorder}}},E={attributes:{alt:"",contentAlign:"center",dimRatio:50,editMode:!1,hasParallax:!1,isRepeated:!1,height:Object(a.getSetting)("default_height",500),mediaSrc:"",overlayColor:"#000000",showDesc:!0}};Object(c.registerBlockType)(r,{...y,example:{...E,example:t},edit:u(e),save:()=>Object(n.createElement)(o.InnerBlocks.Content,null),...s})}},22:function(e,t){e.exports=window.wp.isShallowEqual},23:function(e,t,r){"use strict";r.d(t,"o",(function(){return c})),r.d(t,"m",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"n",(function(){return s})),r.d(t,"j",(function(){return l})),r.d(t,"e",(function(){return u})),r.d(t,"f",(function(){return d})),r.d(t,"g",(function(){return b})),r.d(t,"k",(function(){return m})),r.d(t,"c",(function(){return g})),r.d(t,"d",(function(){return p})),r.d(t,"h",(function(){return h})),r.d(t,"a",(function(){return O})),r.d(t,"i",(function(){return j})),r.d(t,"b",(function(){return f}));var n,o=r(2);const c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",i=c.pluginUrl+"build/",s=c.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=o.STORE_PAGES.checkout.id,d=o.STORE_PAGES.checkout.permalink,b=o.STORE_PAGES.privacy.permalink,m=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),g=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),p=o.STORE_PAGES.cart.permalink,h=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),O=Object(o.getSetting)("allowedCountries",{}),j=Object(o.getSetting)("shippingStates",{}),f=Object(o.getSetting)("allowedStates",{})},25:function(e,t,r){"use strict";r.d(t,"h",(function(){return l})),r.d(t,"e",(function(){return u})),r.d(t,"b",(function(){return d})),r.d(t,"i",(function(){return b})),r.d(t,"f",(function(){return m})),r.d(t,"c",(function(){return g})),r.d(t,"d",(function(){return p})),r.d(t,"g",(function(){return h})),r.d(t,"a",(function(){return O}));var n=r(15),o=r(14),c=r.n(o),a=r(7),i=r(2),s=r(23);const l=e=>{let{selected:t=[],search:r="",queryArgs:o={}}=e;const i=(e=>{let{selected:t=[],search:r="",queryArgs:o={}}=e;const c=s.o.productCount>100,a={per_page:c?100:0,catalog_visibility:"any",search:r,orderby:"title",order:"asc"},i=[Object(n.addQueryArgs)("/wc/store/v1/products",{...a,...o})];return c&&t.length&&i.push(Object(n.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),i})({selected:t,search:r,queryArgs:o});return Promise.all(i.map(e=>c()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>c()({path:"/wc/store/v1/products/"+e}),d=()=>c()({path:"wc/store/v1/products/attributes"}),b=e=>c()({path:`wc/store/v1/products/attributes/${e}/terms`}),m=e=>{let{selected:t=[],search:r}=e;const o=(e=>{let{selected:t=[],search:r}=e;const o=Object(i.getSetting)("limitTags",!1),c=[Object(n.addQueryArgs)("wc/store/v1/products/tags",{per_page:o?100:0,orderby:o?"count":"name",order:o?"desc":"asc",search:r})];return o&&t.length&&c.push(Object(n.addQueryArgs)("wc/store/v1/products/tags",{include:t})),c})({selected:t,search:r});return Promise.all(o.map(e=>c()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id"))},g=e=>c()({path:Object(n.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),p=e=>c()({path:"wc/store/v1/products/categories/"+e}),h=e=>c()({path:Object(n.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),O=(e,t)=>{if(!e.title.raw)return e.slug;const r=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(r?"":" - "+e.slug)}},27:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return a}));var n=r(1),o=r(13);const c=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},a=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(o.decodeEntities)(e.message):Object(n.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},3:function(e,t){e.exports=window.wp.components},315:function(e){e.exports=JSON.parse('{"name":"woocommerce/featured-category","version":"1.0.0","title":"Featured Category","category":"woocommerce","keywords":["WooCommerce"],"description":"Visually highlight a product category and encourage prompt action.","supports":{"align":["wide","full"],"html":false,"color":{"background":true,"text":true,"__experimentalDuotone":".wc-block-featured-category__background-image"},"spacing":{"padding":true,"__experimentalDefaultControls":{"padding":true},"__experimentalSkipSerialization":true},"__experimentalBorder":{"color":true,"radius":true,"width":true,"__experimentalSkipSerialization":true}},"attributes":{"alt":{"type":"string","default":""},"contentAlign":{"type":"string","default":"center"},"dimRatio":{"type":"number","default":50},"editMode":{"type":"boolean","default":true},"focalPoint":{"type":"object","default":{"x":0.5,"y":0.5}},"imageFit":{"type":"string","default":"none"},"hasParallax":{"type":"boolean","default":false},"isRepeated":{"type":"boolean","default":false},"mediaId":{"type":"number","default":0},"mediaSrc":{"type":"string","default":""},"minHeight":{"type":"number","default":500},"linkText":{"type":"string"},"categoryId":{"type":"number"},"overlayColor":{"type":"string","default":"#000000"},"overlayGradient":{"type":"string"},"previewCategory":{"type":"object","default":null},"showDesc":{"type":"boolean","default":true},"style":{"type":"object","default":{"color":{"text":"#ffffff"}}}},"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},32:function(e,t,r){"use strict";var n=r(0),o=r(1),c=r(33);t.a=e=>{let{error:t}=e;return Object(n.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:r}=e;return t?"general"===r?Object(n.createElement)("span",null,Object(o.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(t))):"api"===r?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(t))):t:Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},33:function(e,t){e.exports=window.wp.escapeHtml},36:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(6),o=r.n(n),c=r(0),a=r(19);const i=e=>{let{countLabel:t,className:r,depth:n=0,controlId:i="",item:s,isSelected:l,isSingle:u,onSelect:d,search:b="",...m}=e;const g=null!=t&&void 0!==s.count&&null!==s.count,p=[r,"woocommerce-search-list__item"];p.push("depth-"+n),u&&p.push("is-radio-button"),g&&p.push("has-count");const h=s.breadcrumbs&&s.breadcrumbs.length,O=m.name||"search-list-item-"+i,j=`${O}-${s.id}`;return Object(c.createElement)("label",{htmlFor:j,className:p.join(" ")},u?Object(c.createElement)("input",o()({type:"radio",id:j,name:O,value:s.value,onChange:d(s),checked:l,className:"woocommerce-search-list__item-input"},m)):Object(c.createElement)("input",o()({type:"checkbox",id:j,name:O,value:s.value,onChange:d(s),checked:l,className:"woocommerce-search-list__item-input"},m)),Object(c.createElement)("span",{className:"woocommerce-search-list__item-label"},h?Object(c.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(a.b)(s.breadcrumbs)):null,Object(c.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(a.d)(s.name,b))),!!g&&Object(c.createElement)("span",{className:"woocommerce-search-list__item-count"},t||s.count))};t.b=i},372:function(e,t,r){e.exports=r(465)},373:function(e,t){},374:function(e,t){},46:function(e,t,r){"use strict";r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return o}));const n={height:500,width:500},o={featuredCategory:"woocommerce/featured-category",featuredProduct:"woocommerce/featured-product"}},465:function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(11),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l2 2H20v10zm-6.92-3.96L12.39 17 15 15.47 17.61 17l-.69-2.96 2.3-1.99-3.03-.26L15 9l-1.19 2.79-3.03.26z"})),a=r(113),i=(r(373),r(374),r(6)),s=r.n(i),l=r(10),u=r(25),d=r(27),b=Object(l.createHigherOrderComponent)(e=>class extends n.Component{constructor(){super(...arguments),this.state={error:null,loading:!1,category:"preview"===this.props.attributes.categoryId?this.props.attributes.previewCategory:null},this.loadCategory=this.loadCategory.bind(this)}componentDidMount(){this.loadCategory()}componentDidUpdate(e){e.attributes.categoryId!==this.props.attributes.categoryId&&this.loadCategory()}loadCategory(){const{categoryId:e}=this.props.attributes;"preview"!==e&&(e?(this.setState({loading:!0}),Object(u.d)(e).then(e=>{this.setState({category:e,loading:!1,error:null})}).catch(async e=>{const t=await Object(d.a)(e);this.setState({category:null,loading:!1,error:t})})):this.setState({category:null,loading:!1,error:null}))}render(){const{error:t,loading:r,category:o}=this.state;return Object(n.createElement)(e,s()({},this.props,{error:t,getCategory:this.loadCategory,isLoading:r,category:o}))}},"withCategory"),m=r(3),g=r(1),p=r(199),h=r(197),O=r(198),j=r(196),f=r(195),_=r(194),w=r(210),v=r(193);const y={icon:c,label:Object(g.__)("Featured Category","woo-gutenberg-products-block")},E={...y,cropLabel:Object(g.__)("Edit category image","woo-gutenberg-products-block"),editLabel:Object(g.__)("Edit selected category","woo-gutenberg-products-block")},k={...y,emptyMessage:Object(g.__)("No product category is selected.","woo-gutenberg-products-block")},S={...y,description:Object(g.__)("Visually highlight a product category and encourage prompt action.","woo-gutenberg-products-block"),editLabel:Object(g.__)("Showing Featured Product block preview.","woo-gutenberg-products-block")};var I=Object(l.compose)([b,m.withSpokenMessages,v.a,_.a,Object(f.a)(S),Object(w.a)(k),j.a,h.a,O.a,Object(p.a)(E)])(()=>Object(n.createElement)(n.Fragment,null)),C=r(315),x=r(212),P=r(23);const N={attributes:{categoryId:"preview",previewCategory:{id:1,name:Object(g.__)("Clothing","woo-gutenberg-products-block"),slug:"clothing",parent:0,count:10,description:`

${Object(g.__)("Branded t-shirts, jumpers, pants and more!","woo-gutenberg-products-block")}

\n`,image:{id:1,date_created:"2019-07-15T17:05:04",date_created_gmt:"2019-07-15T17:05:04",date_modified:"2019-07-15T17:05:04",date_modified_gmt:"2019-07-15T17:05:04",src:P.m+"previews/collection.jpg",name:"",alt:""},permalink:"#"}}};Object(x.a)(I,N,C,{icon:{src:Object(n.createElement)(a.a,{icon:c,className:"wc-block-editor-components-block-icon"})}})},5:function(e,t){e.exports=window.wp.blockEditor},56:function(e,t,r){"use strict";var n=r(6),o=r.n(n),c=r(0),a=r(1),i=r(36),s=r(97),l=r(3),u=r(10),d=r(25),b=r(27),m=Object(u.createHigherOrderComponent)(e=>class extends c.Component{constructor(){super(...arguments),this.state={error:null,loading:!1,categories:[]},this.loadCategories=this.loadCategories.bind(this)}componentDidMount(){this.loadCategories()}loadCategories(){this.setState({loading:!0}),Object(d.c)().then(e=>{this.setState({categories:e,loading:!1,error:null})}).catch(async e=>{const t=await Object(b.a)(e);this.setState({categories:[],loading:!1,error:t})})}render(){const{error:t,loading:r,categories:n}=this.state;return Object(c.createElement)(e,o()({},this.props,{error:t,isLoading:r,categories:n}))}},"withCategories"),g=r(32),p=r(4),h=r.n(p);r(89);const O=e=>{let{categories:t,error:r,isLoading:n,onChange:u,onOperatorChange:d,operator:b,selected:m,isCompact:p,isSingle:O,showReviewCount:j}=e;const f={clear:Object(a.__)("Clear all product categories","woo-gutenberg-products-block"),list:Object(a.__)("Product Categories","woo-gutenberg-products-block"),noItems:Object(a.__)("Your store doesn't have any product categories.","woo-gutenberg-products-block"),search:Object(a.__)("Search for product categories","woo-gutenberg-products-block"),selected:e=>Object(a.sprintf)( +/* translators: %d is the count of selected categories. */ +Object(a._n)("%d category selected","%d categories selected",e,"woo-gutenberg-products-block"),e),updated:Object(a.__)("Category search results updated.","woo-gutenberg-products-block")};return r?Object(c.createElement)(g.a,{error:r}):Object(c.createElement)(c.Fragment,null,Object(c.createElement)(s.a,{className:"woocommerce-product-categories",list:t,isLoading:n,selected:m.map(e=>t.find(t=>t.id===e)).filter(Boolean),onChange:u,renderItem:e=>{const{item:t,search:r,depth:n=0}=e,s=t.breadcrumbs.length?`${t.breadcrumbs.join(", ")}, ${t.name}`:t.name,l=j?Object(a.sprintf)( +/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */ +Object(a._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,"woo-gutenberg-products-block"),s,t.review_count):Object(a.sprintf)( +/* translators: %1$s is the item name, %2$d is the count of products for the item. */ +Object(a._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,"woo-gutenberg-products-block"),s,t.count),u=j?Object(a.sprintf)( +/* translators: %d is the count of reviews. */ +Object(a._n)("%d review","%d reviews",t.review_count,"woo-gutenberg-products-block"),t.review_count):Object(a.sprintf)( +/* translators: %d is the count of products. */ +Object(a._n)("%d product","%d products",t.count,"woo-gutenberg-products-block"),t.count);return Object(c.createElement)(i.a,o()({className:h()("woocommerce-product-categories__item","has-count",{"is-searching":r.length>0,"is-skip-level":0===n&&0!==t.parent})},e,{countLabel:u,"aria-label":l}))},messages:f,isCompact:p,isHierarchical:!0,isSingle:O}),!!d&&Object(c.createElement)("div",{hidden:m.length<2},Object(c.createElement)(l.SelectControl,{className:"woocommerce-product-categories__operator",label:Object(a.__)("Display products matching","woo-gutenberg-products-block"),help:Object(a.__)("Pick at least two categories to use this setting.","woo-gutenberg-products-block"),value:b,onChange:d,options:[{label:Object(a.__)("Any selected categories","woo-gutenberg-products-block"),value:"any"},{label:Object(a.__)("All selected categories","woo-gutenberg-products-block"),value:"all"}]})))};O.defaultProps={operator:"any",isCompact:!1,isSingle:!1},t.a=m(O)},7:function(e,t){e.exports=window.lodash},73:function(e,t,r){"use strict";var n=r(0),o=r(1),c=r(113),a=r(172),i=r(4),s=r.n(i),l=r(3),u=r(32);r(114),t.a=e=>{let{className:t,error:r,isLoading:i=!1,onRetry:d}=e;return Object(n.createElement)(l.Placeholder,{icon:Object(n.createElement)(c.a,{icon:a.a}),label:Object(o.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:s()("wc-block-api-error",t)},Object(n.createElement)(u.a,{error:r}),d&&Object(n.createElement)(n.Fragment,null,i?Object(n.createElement)(l.Spinner,null):Object(n.createElement)(l.Button,{isSecondary:!0,onClick:d},Object(o.__)("Retry","woo-gutenberg-products-block"))))}},8:function(e,t){e.exports=window.wp.blocks},82:function(e,t,r){"use strict";var n=r(6),o=r.n(n),c=r(0),a=r(36),i=r(3),s=r(4),l=r.n(s);t.a=e=>{let{className:t,item:r,isSelected:n,isLoading:s,onSelect:u,disabled:d,...b}=e;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(a.a,o()({},b,{key:r.id,className:t,isSelected:n,item:r,onSelect:u,isSingle:!0,disabled:d})),n&&s&&Object(c.createElement)("div",{key:"loading",className:l()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(c.createElement)(i.Spinner,null)))}},84:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(12),o=r(46),c=r(7);function a(e){return!!e&&Object(c.isNumber)(e.id)&&"string"==typeof e.src}function i(e){let{blockName:t,item:r,mediaId:c,mediaSrc:i}=e;const[s,l]=Object(n.useState)(0),[u,d]=Object(n.useState)("");return Object(n.useEffect)(()=>{var e,n;l(c||(t===o.a.featuredProduct?(n=r)&&n.images&&n.images.length&&n.images[0].id||0:(e=r)&&a(e.image)?e.image.id:0))},[t,r,c]),Object(n.useEffect)(()=>{var e,n;d(i||(t===o.a.featuredProduct?(n=r)&&n.images&&n.images.length&&n.images[0].src||"":(e=r)&&a(e.image)?e.image.src:""))},[t,r,i]),{backgroundImageId:s,backgroundImageSrc:u}}},85:function(e,t,r){"use strict";function n(e){return e?`${Math.round(100*e.x)}% ${Math.round(100*e.y)}%`:""}function o(e){let{focalPoint:t,imageFit:r,isImgElement:o,isRepeated:c,url:a}=e,i={};var s;return i=o?{...i,...(s=t,s?{objectPosition:n(s)}:{}),objectFit:r}:{...i,...a&&{backgroundImage:`url(${a})`},backgroundPosition:n(t),...!c&&{backgroundRepeat:"no-repeat",backgroundSize:"cover"===r?r:"auto"}},i}function c(e){return"wc-block-"+e.split("/")[1]}function a(e){return 0===e||50===e?null:"has-background-dim-"+10*Math.round(e/10)}r.d(t,"b",(function(){return o})),r.d(t,"c",(function(){return c})),r.d(t,"a",(function(){return a}))},89:function(e,t){},9:function(e,t){e.exports=window.wp.data},93:function(e,t,r){"use strict";var n=r(6),o=r.n(n),c=r(0),a=r(1),i=r(7),s=r(36),l=r(97),u=r(10),d=Object(u.createHigherOrderComponent)(e=>{class t extends c.Component{render(){const{selected:t}=this.props,r=null==t;return Array.isArray(t)?Object(c.createElement)(e,this.props):Object(c.createElement)(e,o()({},this.props,{selected:r?[]:[t]}))}}return t.defaultProps={selected:null},t},"withTransformSingleSelectToMultipleSelect"),b=r(176),m=r(24),g=r.n(m),p=r(22),h=r.n(p),O=r(25),j=r(27),f=Object(u.createHigherOrderComponent)(e=>{class t extends c.Component{constructor(){super(...arguments),g()(this,"state",{error:null,loading:!1,variations:{}}),g()(this,"loadVariations",()=>{const{products:e}=this.props,{loading:t,variations:r}=this.state;if(t)return;const n=this.getExpandedProduct();if(!n||r[n])return;const o=e.find(e=>e.id===n);o.variations&&0!==o.variations.length?(this.setState({loading:!0}),Object(O.g)(n).then(e=>{const t=e.map(e=>({...e,parent:n}));this.setState({variations:{...this.state.variations,[n]:t},loading:!1,error:null})}).catch(async e=>{const t=await Object(j.a)(e);this.setState({variations:{...this.state.variations,[n]:null},loading:!1,error:t})})):this.setState({variations:{...this.state.variations,[n]:null},loading:!1,error:null})})}componentDidMount(){const{selected:e,showVariations:t}=this.props;e&&t&&this.loadVariations()}componentDidUpdate(e){const{isLoading:t,selected:r,showVariations:n}=this.props;n&&(!h()(e.selected,r)||e.isLoading&&!t)&&this.loadVariations()}isProductId(e){const{products:t}=this.props;return t.some(t=>t.id===e)}findParentProduct(e){var t;const{products:r}=this.props;return null===(t=r.filter(t=>t.variations&&t.variations.find(t=>{let{id:r}=t;return r===e}))[0])||void 0===t?void 0:t.id}getExpandedProduct(){const{isLoading:e,selected:t,showVariations:r}=this.props;if(!r)return null;let n=t&&t.length?t[0]:null;return n?this.prevSelectedItem=n:this.prevSelectedItem&&(e||this.isProductId(this.prevSelectedItem)||(n=this.prevSelectedItem)),!e&&n?this.isProductId(n)?n:this.findParentProduct(n):null}render(){const{error:t,isLoading:r}=this.props,{error:n,loading:a,variations:i}=this.state;return Object(c.createElement)(e,o()({},this.props,{error:n||t,expandedProduct:this.getExpandedProduct(),isLoading:r,variations:i,variationsLoading:a}))}}return g()(t,"defaultProps",{selected:[],showVariations:!1}),t},"withProductVariations"),_=r(32),w=r(4),v=r.n(w),y=r(82);r(134);const E={list:Object(a.__)("Products","woo-gutenberg-products-block"),noItems:Object(a.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(a.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(a.__)("Product search results updated.","woo-gutenberg-products-block")},k=e=>{let{expandedProduct:t,error:r,instanceId:n,isCompact:u,isLoading:d,onChange:b,onSearch:m,products:g,renderItem:p,selected:h,showVariations:O,variations:j,variationsLoading:f}=e;if(r)return Object(c.createElement)(_.a,{error:r});const w=[...g,...j&&j[t]?j[t]:[]];return Object(c.createElement)(l.a,{className:"woocommerce-products",list:w,isCompact:u,isLoading:d,isSingle:!0,selected:w.filter(e=>{let{id:t}=e;return h.includes(t)}),onChange:b,renderItem:p||(O?e=>{const{item:t,search:r,depth:l=0,isSelected:u,onSelect:b}=e,m=t.variations&&Array.isArray(t.variations)?t.variations.length:0,g=v()("woocommerce-search-product__item","woocommerce-search-list__item","depth-"+l,"has-count",{"is-searching":r.length>0,"is-skip-level":0===l&&0!==t.parent,"is-variable":m>0});if(!t.breadcrumbs.length)return Object(c.createElement)(y.a,o()({},e,{className:v()(g,{"is-selected":u}),isSelected:u,item:t,onSelect:()=>()=>{b(t)()},isLoading:d||f,countLabel:t.variations.length>0?Object(a.sprintf)( +/* translators: %1$d is the number of variations of a product product. */ +Object(a.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-"+n,"aria-label":Object(a.sprintf)( +/* translators: %1$s is the product name, %2$d is the number of variations of that product. */ +Object(a._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,"woo-gutenberg-products-block"),t.name,t.variations.length)}));const p=Object(i.isEmpty)(t.variation)?e:{...e,item:{...e.item,name:t.variation},"aria-label":`${t.breadcrumbs[0]}: ${t.variation}`};return Object(c.createElement)(s.a,o()({},p,{className:g,name:"variations-"+n}))}:null),onSearch:m,messages:E,isHierarchical:!0})};k.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=d(Object(b.a)(f(Object(u.withInstanceId)(k))))},95:function(e,t,r){"use strict";r.d(t,"c",(function(){return c})),r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return i}));var n=r(8),o=r(23);const c=(e,t)=>{if(o.n>2)return Object(n.registerBlockType)(e,t)},a=()=>o.n>2,i=()=>o.n>1},97:function(e,t,r){"use strict";r.d(t,"a",(function(){return y}));var n=r(6),o=r.n(n),c=r(0),a=r(1),i=r(3),s=r(113),l=r(498),u=r(4),d=r.n(u),b=r(10),m=r(19),g=r(36),p=r(497),h=r(13);const O=e=>{let{id:t,label:r,popoverContents:n,remove:o,screenReaderLabel:l,className:u=""}=e;const[m,g]=Object(c.useState)(!1),j=Object(b.useInstanceId)(O);if(l=l||r,!r)return null;r=Object(h.decodeEntities)(r);const f=d()("woocommerce-tag",u,{"has-remove":!!o}),_="woocommerce-tag__label-"+j,w=Object(c.createElement)(c.Fragment,null,Object(c.createElement)("span",{className:"screen-reader-text"},l),Object(c.createElement)("span",{"aria-hidden":"true"},r));return Object(c.createElement)("span",{className:f},n?Object(c.createElement)(i.Button,{className:"woocommerce-tag__text",id:_,onClick:()=>g(!0)},w):Object(c.createElement)("span",{className:"woocommerce-tag__text",id:_},w),n&&m&&Object(c.createElement)(i.Popover,{onClose:()=>g(!1)},n),o&&Object(c.createElement)(i.Button,{className:"woocommerce-tag__remove",onClick:o(t),label:Object(a.sprintf)(// Translators: %s label. +Object(a.__)("Remove %s","woo-gutenberg-products-block"),r),"aria-describedby":_},Object(c.createElement)(s.a,{icon:p.a,size:20,className:"clear-icon"})))};var j=O;const f=e=>Object(c.createElement)(g.b,e),_=e=>{const{list:t,selected:r,renderItem:n,depth:a=0,onSelect:i,instanceId:s,isSingle:l,search:u}=e;return t?Object(c.createElement)(c.Fragment,null,t.map(t=>{const d=-1!==r.findIndex(e=>{let{id:r}=e;return r===t.id});return Object(c.createElement)(c.Fragment,{key:t.id},Object(c.createElement)("li",null,n({item:t,isSelected:d,onSelect:i,isSingle:l,search:u,depth:a,controlId:s})),Object(c.createElement)(_,o()({},e,{list:t.children,depth:a+1})))})):null},w=e=>{let{isLoading:t,isSingle:r,selected:n,messages:o,onChange:s,onRemove:l}=e;if(t||r||!n)return null;const u=n.length;return Object(c.createElement)("div",{className:"woocommerce-search-list__selected"},Object(c.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(c.createElement)("strong",null,o.selected(u)),u>0?Object(c.createElement)(i.Button,{isLink:!0,isDestructive:!0,onClick:()=>s([]),"aria-label":o.clear},Object(a.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(c.createElement)("ul",null,n.map((e,t)=>Object(c.createElement)("li",{key:t},Object(c.createElement)(j,{label:e.name,id:e.id,remove:l})))):null)},v=e=>{let{filteredList:t,search:r,onSelect:n,instanceId:o,...i}=e;const{messages:u,renderItem:d,selected:b,isSingle:m}=i,g=d||f;return 0===t.length?Object(c.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(c.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(c.createElement)(s.a,{icon:l.a})),Object(c.createElement)("span",{className:"woocommerce-search-list__not-found-text"},r?Object(a.sprintf)(u.noResults,r):u.noItems)):Object(c.createElement)("ul",{className:"woocommerce-search-list__list"},Object(c.createElement)(_,{list:t,selected:b,renderItem:g,onSelect:n,instanceId:o,isSingle:m,search:r}))},y=e=>{const{className:t="",isCompact:r,isHierarchical:n,isLoading:a,isSingle:s,list:l,messages:u=m.a,onChange:g,onSearch:p,selected:h,debouncedSpeak:O}=e,[j,f]=Object(c.useState)(""),_=Object(b.useInstanceId)(y),E=Object(c.useMemo)(()=>({...m.a,...u}),[u]),k=Object(c.useMemo)(()=>Object(m.c)(l,j,n),[l,j,n]);Object(c.useEffect)(()=>{O&&O(E.updated)},[O,E]),Object(c.useEffect)(()=>{"function"==typeof p&&p(j)},[j,p]);const S=Object(c.useCallback)(e=>()=>{s&&g([]);const t=h.findIndex(t=>{let{id:r}=t;return r===e});g([...h.slice(0,t),...h.slice(t+1)])},[s,h,g]),I=Object(c.useCallback)(e=>()=>{-1===h.findIndex(t=>{let{id:r}=t;return r===e.id})?g(s?[e]:[...h,e]):S(e.id)()},[s,S,g,h]);return Object(c.createElement)("div",{className:d()("woocommerce-search-list",t,{"is-compact":r})},Object(c.createElement)(w,o()({},e,{onRemove:S,messages:E})),Object(c.createElement)("div",{className:"woocommerce-search-list__search"},Object(c.createElement)(i.TextControl,{label:E.search,type:"search",value:j,onChange:e=>f(e)})),a?Object(c.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(c.createElement)(i.Spinner,null)):Object(c.createElement)(v,o()({},e,{search:j,filteredList:k,messages:E,onSelect:I,instanceId:_})))};Object(i.withSpokenMessages)(y)}}); \ No newline at end of file diff --git a/build/featured-category/block.json b/build/featured-category/block.json new file mode 100644 index 00000000000..00e75c84329 --- /dev/null +++ b/build/featured-category/block.json @@ -0,0 +1,110 @@ +{ + "name": "woocommerce/featured-category", + "version": "1.0.0", + "title": "Featured Category", + "category": "woocommerce", + "keywords": [ "WooCommerce" ], + "description": "Visually highlight a product category and encourage prompt action.", + "supports": { + "align": [ "wide", "full" ], + "html": false, + "color": { + "background": true, + "text": true, + "__experimentalDuotone": ".wc-block-featured-category__background-image" + }, + "spacing": { + "padding": true, + "__experimentalDefaultControls": { + "padding": true + }, + "__experimentalSkipSerialization": true + }, + "__experimentalBorder": { + "color": true, + "radius": true, + "width": true, + "__experimentalSkipSerialization": true + } + }, + "attributes": { + "alt": { + "type": "string", + "default": "" + }, + "contentAlign": { + "type": "string", + "default": "center" + }, + "dimRatio": { + "type": "number", + "default": 50 + }, + "editMode": { + "type": "boolean", + "default": true + }, + "focalPoint": { + "type": "object", + "default": { + "x": 0.5, + "y": 0.5 + } + }, + "imageFit": { + "type": "string", + "default": "none" + }, + "hasParallax": { + "type": "boolean", + "default": false + }, + "isRepeated": { + "type": "boolean", + "default": false + }, + "mediaId": { + "type": "number", + "default": 0 + }, + "mediaSrc": { + "type": "string", + "default": "" + }, + "minHeight": { + "type": "number", + "default": 500 + }, + "linkText": { + "type": "string" + }, + "categoryId": { + "type": "number" + }, + "overlayColor": { + "type": "string", + "default": "#000000" + }, + "overlayGradient": { + "type": "string" + }, + "previewCategory": { + "type": "object", + "default": null + }, + "showDesc": { + "type": "boolean", + "default": true + }, + "style": { + "type": "object", + "default": { + "color": { + "text": "#ffffff" + } + } + } + }, + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2 +} diff --git a/build/featured-product.asset.php b/build/featured-product.asset.php new file mode 100644 index 00000000000..3a23617a837 --- /dev/null +++ b/build/featured-product.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-escape-html', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '89206810153de9a329096a8881908c43'); \ No newline at end of file diff --git a/build/featured-product.js b/build/featured-product.js new file mode 100644 index 00000000000..fd41670576e --- /dev/null +++ b/build/featured-product.js @@ -0,0 +1,21 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["featured-product"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],l=t[2],d=0,b=[];dt=>{let{selected:r,...n}=t;const[u,d]=Object(o.useState)(!0),[b,m]=Object(o.useState)(null),[p,g]=Object(o.useState)([]),h=a.o.productCount>100,O=async e=>{const t=await Object(l.a)(e);m(t),d(!1)},j=Object(o.useRef)(r);Object(o.useEffect)(()=>{Object(i.h)({selected:j.current}).then(e=>{g(e),d(!1)}).catch(O)},[j]);const f=Object(s.a)(e=>{Object(i.h)({selected:r,search:e}).then(e=>{g(e),d(!1)}).catch(O)},400),_=Object(o.useCallback)(e=>{d(!0),f(e)},[d,f]);return Object(o.createElement)(e,c()({},n,{selected:r,error:b,products:p,isLoading:u,onSearch:h?_:null}))}},177:function(e,t){},19:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"c",(function(){return s})),r.d(t,"d",(function(){return l})),r.d(t,"b",(function(){return u}));var n=r(0),c=r(7),o=r(1);const a={clear:Object(o.__)("Clear all selected items","woo-gutenberg-products-block"),noItems:Object(o.__)("No items found.","woo-gutenberg-products-block"), +/* Translators: %s search term */ +noResults:Object(o.__)("No results for %s","woo-gutenberg-products-block"),search:Object(o.__)("Search for items","woo-gutenberg-products-block"),selected:e=>Object(o.sprintf)( +/* translators: Number of items selected from list. */ +Object(o._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(o.__)("Search results updated.","woo-gutenberg-products-block")},i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const r=Object(c.groupBy)(e,"parent"),n=Object(c.keyBy)(t,"id"),o=["0"],a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=a(n[e.parent]);return[...t,e.name]},i=e=>e.map(e=>{const t=r[e.id];return o.push(""+e.id),{...e,breadcrumbs:a(n[e.parent]),children:t&&t.length?i(t):[]}}),s=i(r[0]||[]);return Object.entries(r).forEach(e=>{let[t,r]=e;o.includes(t)||s.push(...i(r||[]))}),s},s=(e,t,r)=>{if(!t)return r?i(e):e;const n=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),c=e.map(e=>!!n.test(e.name)&&e).filter(Boolean);return r?i(c,e):c},l=(e,t)=>{if(!t)return e;const r=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(r).map((e,t)=>r.test(e)?Object(n.createElement)("strong",{key:t},e):Object(n.createElement)(n.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},193:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(6),c=r.n(n),o=r(0),a=r(12),i=r(9);const s=e=>t=>{var r;const[n,s]=Object(a.useState)(!1),{attributes:l,category:u,clientId:d,product:b}=t,m=u||b,{editMode:p}=l,g=(null==m?void 0:m.link)||(null==m?void 0:m.permalink),h=Object(i.useSelect)(e=>e("core/block-editor").getBlock(d)),O=null==h||null===(r=h.innerBlocks[0])||void 0===r?void 0:r.innerBlocks[0],j=(null==O?void 0:O.clientId)||"",f=Object(a.useMemo)(()=>(null==O?void 0:O.attributes)||{},[O]),{url:_}=f,{updateBlockAttributes:w}=Object(i.useDispatch)("core/block-editor");return Object(a.useEffect)(()=>{n&&j&&!p&&g&&_&&g!==_&&(w(j,{url:g}),s(!1))},[j,n,p,g,w,_]),Object(o.createElement)(e,c()({},t,{triggerUrlUpdate:()=>s(!0)}))}},194:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(6),c=r.n(n),o=r(0),a=r(12);const i=e=>t=>{const[r,n]=Object(a.useState)(!1),{isSelected:i}=t;return Object(a.useEffect)(()=>{n(!1)},[i]),Object(o.createElement)(e,c()({},t,{useEditingImage:[r,n]}))}},195:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(0),c=r(3),o=r(1),a=r(56),i=r(93),s=r(46),l=r(85);const u=e=>{let{description:t,editLabel:r,icon:u,label:d}=e;return e=>b=>{const{attributes:m,debouncedSpeak:p,name:g,setAttributes:h,triggerUrlUpdate:O=(()=>{})}=b,j=Object(l.c)(g);return m.editMode?Object(n.createElement)(c.Placeholder,{icon:Object(n.createElement)(c.Icon,{icon:u}),label:d,className:j},t,Object(n.createElement)("div",{className:j+"__selection"},g===s.a.featuredCategory&&Object(n.createElement)(a.a,{selected:[m.categoryId],onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e[0]?e[0].id:0;h({categoryId:t,mediaId:0,mediaSrc:""}),O()},isSingle:!0}),g===s.a.featuredProduct&&Object(n.createElement)(i.a,{selected:m.productId?[m.productId]:[],showVariations:!0,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e[0]?e[0].id:0;h({productId:t,mediaId:0,mediaSrc:""}),O()}}),Object(n.createElement)(c.Button,{isPrimary:!0,onClick:()=>{h({editMode:!1}),p(r)}},Object(o.__)("Done","woo-gutenberg-products-block")))):Object(n.createElement)(e,b)}}},196:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),c=r(73),o=r(46),a=r(85);const i=e=>t=>{const{error:r,isLoading:i,name:s}=t,l=Object(a.c)(s),u=s===o.a.featuredCategory?t.getCategory:t.getProduct;return r?Object(n.createElement)(c.a,{className:l+"-error",error:r,isLoading:i,onRetry:u}):Object(n.createElement)(e,t)}},197:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(0),c=r(5),o=r(46),a=r(84);const i=e=>{let{backgroundImageId:t,backgroundImageSize:r,backgroundImageSrc:a,isEditingImage:i,setAttributes:s,setIsEditingImage:l}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(c.__experimentalImageEditingProvider,{id:t,url:a,naturalHeight:r.height||o.b.height,naturalWidth:r.width||o.b.width,onSaveImage:e=>{let{id:t,url:r}=e;s({mediaId:t,mediaSrc:r})},isEditing:i,onFinishEditing:()=>l(!1)},Object(n.createElement)(c.__experimentalImageEditor,{url:a,height:r.height||o.b.height,width:r.width||o.b.width})))},s=e=>t=>{const[r,c]=t.useEditingImage,{attributes:s,backgroundImageSize:l,name:u,setAttributes:d}=t,{mediaId:b,mediaSrc:m}=s,p=u===o.a.featuredProduct?t.product:t.category,{backgroundImageId:g,backgroundImageSrc:h}=Object(a.a)({item:p,mediaId:b,mediaSrc:m,blockName:u});return r?Object(n.createElement)(i,{backgroundImageId:g,backgroundImageSize:l,backgroundImageSrc:h,isEditingImage:r,setAttributes:d,setIsEditingImage:c}):Object(n.createElement)(e,t)}},198:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(0),c=r(1),o=r(5),a=r(3),i=r(84),s=r(46);const l=e=>{let{alt:t,backgroundImageSrc:r,contentPanel:i,dimRatio:s,focalPoint:l,hasParallax:u,imageFit:d,isRepeated:b,overlayColor:m,overlayGradient:p,setAttributes:g,setGradient:h,showDesc:O}=e;const j="function"==typeof a.FocalPointPicker,f=!b&&!u;return Object(n.createElement)(o.InspectorControls,{key:"inspector"},Object(n.createElement)(a.PanelBody,{title:Object(c.__)("Content","woo-gutenberg-products-block")},Object(n.createElement)(a.ToggleControl,{label:Object(c.__)("Show description","woo-gutenberg-products-block"),checked:O,onChange:()=>g({showDesc:!O})}),i),!!r&&Object(n.createElement)(n.Fragment,null,j&&Object(n.createElement)(a.PanelBody,{title:Object(c.__)("Media settings","woo-gutenberg-products-block")},Object(n.createElement)(a.ToggleControl,{label:Object(c.__)("Fixed background","woo-gutenberg-products-block"),checked:u,onChange:()=>{g({hasParallax:!u})}}),Object(n.createElement)(a.ToggleControl,{label:Object(c.__)("Repeated background","woo-gutenberg-products-block"),checked:b,onChange:()=>{g({isRepeated:!b})}}),!b&&Object(n.createElement)(a.__experimentalToggleGroupControl,{help:Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{style:{display:"block",marginBottom:"1em"}},Object(c.__)("Choose “Cover” if you want the image to scale automatically to always fit its container.","woo-gutenberg-products-block")),Object(n.createElement)("span",null,Object(c.__)("Note: by choosing “Cover” you will lose the ability to freely move the focal point precisely.","woo-gutenberg-products-block"))),label:Object(c.__)("Image fit","woo-gutenberg-products-block"),value:d,onChange:e=>g({imageFit:e})},Object(n.createElement)(a.__experimentalToggleGroupControlOption,{label:Object(c.__)("None","woo-gutenberg-products-block"),value:"none"}),Object(n.createElement)(a.__experimentalToggleGroupControlOption +/* translators: "Cover" is a verb that indicates an image covering the entire container. */,{label:Object(c.__)("Cover","woo-gutenberg-products-block"),value:"cover"})),Object(n.createElement)(a.FocalPointPicker,{label:Object(c.__)("Focal Point Picker","woo-gutenberg-products-block"),url:r,value:l,onChange:e=>g({focalPoint:e})}),f&&Object(n.createElement)(a.TextareaControl,{label:Object(c.__)("Alt text (alternative text)","woo-gutenberg-products-block"),value:t,onChange:e=>{g({alt:e})},help:Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.ExternalLink,{href:"https://www.w3.org/WAI/tutorials/images/decision-tree"},Object(c.__)("Describe the purpose of the image","woo-gutenberg-products-block")))})),Object(n.createElement)(o.__experimentalPanelColorGradientSettings,{__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,title:Object(c.__)("Overlay","woo-gutenberg-products-block"),initialOpen:!0,settings:[{colorValue:m,gradientValue:p,onColorChange:e=>g({overlayColor:e}),onGradientChange:e=>{h(e),g({overlayGradient:e})},label:Object(c.__)("Color","woo-gutenberg-products-block")}]},Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Opacity","woo-gutenberg-products-block"),value:s,onChange:e=>g({dimRatio:e}),min:0,max:100,step:10,required:!0}))))},u=e=>t=>{const{attributes:r,name:u,setAttributes:d}=t,{alt:b,dimRatio:m,focalPoint:p,hasParallax:g,isRepeated:h,imageFit:O,mediaId:j,mediaSrc:f,overlayColor:_,overlayGradient:w,showDesc:v,showPrice:k}=r,E=u===s.a.featuredProduct?t.product:t.category,{setGradient:y}=Object(o.__experimentalUseGradient)({gradientAttribute:"overlayGradient",customGradientAttribute:"overlayGradient"}),{backgroundImageSrc:S}=Object(i.a)({item:E,mediaId:j,mediaSrc:f,blockName:u}),I=u===s.a.featuredProduct?Object(n.createElement)(a.ToggleControl,{label:Object(c.__)("Show price","woo-gutenberg-products-block"),checked:k,onChange:()=>d({showPrice:!k})}):void 0;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(l,{alt:b,backgroundImageSrc:S,contentPanel:I,dimRatio:m,focalPoint:p,hasParallax:g,isRepeated:h,imageFit:O,overlayColor:_,overlayGradient:w,setAttributes:d,setGradient:y,showDesc:v}),Object(n.createElement)(e,t))}},199:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(0),c=r(1),o=r(5),a=r(3),i=r(328),s=r(142),l=r(84);const u=e=>{let{backgroundImageId:t,backgroundImageSrc:r,contentAlign:l,cropLabel:u,editLabel:d,editMode:b,isEditingImage:m,mediaSrc:p,setAttributes:g,setIsEditingImage:h}=e;return Object(n.createElement)(o.BlockControls,null,Object(n.createElement)(o.AlignmentToolbar,{value:l,onChange:e=>{g({contentAlign:e})}}),Object(n.createElement)(a.ToolbarGroup,null,r&&!m&&Object(n.createElement)(a.ToolbarButton,{onClick:()=>h(!0),icon:i.a,label:u}),Object(n.createElement)(o.MediaReplaceFlow,{mediaId:t,mediaURL:p,accept:"image/*",onSelect:e=>{g({mediaId:e.id,mediaSrc:e.url})},allowedTypes:["image"]}),t&&p?Object(n.createElement)(s.a,{onClick:()=>g({mediaId:0,mediaSrc:""})},Object(c.__)("Reset","woo-gutenberg-products-block")):null),Object(n.createElement)(a.ToolbarGroup,{controls:[{icon:"edit",title:d,onClick:()=>g({editMode:!b}),isActive:b}]}))},d=e=>{let{cropLabel:t,editLabel:r}=e;return e=>c=>{const[o,a]=c.useEditingImage,{attributes:i,category:s,name:d,product:b,setAttributes:m}=c,{contentAlign:p,editMode:g,mediaId:h,mediaSrc:O}=i,j=s||b,{backgroundImageId:f,backgroundImageSrc:_}=Object(l.a)({item:j,mediaId:h,mediaSrc:O,blockName:d});return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(u,{backgroundImageId:f,backgroundImageSrc:_,contentAlign:p,cropLabel:t,editLabel:r,editMode:g,isEditingImage:o,mediaSrc:O,setAttributes:m,setIsEditingImage:a}),Object(n.createElement)(e,c))}}},2:function(e,t){e.exports=window.wc.wcSettings},210:function(e,t,r){"use strict";r.d(t,"a",(function(){return O}));var n=r(6),c=r.n(n),o=r(0),a=r(5),i=r(3),s=r(4),l=r.n(s),u=r(7),d=r(12),b=r(1);const m=e=>{let{itemId:t,linkText:r,permalink:n}=e;const c=l()("wp-block-button__link","is-style-fill");return"preview"===t?Object(o.createElement)("div",{className:"wp-block-button aligncenter",style:{width:"100%"}},Object(o.createElement)(a.RichText.Content,{tagName:"a",className:c,href:n,title:r,style:{backgroundColor:"vivid-green-cyan",borderRadius:"5px"},value:r,target:n})):Object(o.createElement)(a.InnerBlocks,{template:[["core/buttons",{layout:{type:"flex",justifyContent:"center"}},[["core/button",{text:Object(b.__)("Shop now","woo-gutenberg-products-block"),url:n}]]]],templateLock:"all"})},p=e=>{let{className:t="",onResize:r,...n}=e;const[a,s]=Object(d.useState)(!1),b=l()(t,{"is-resizing":a}),m=function(e,t,r){const n=Object(d.useRef)(e);return Object(d.useEffect)(()=>{n.current=e}),Object(d.useCallback)(Object(u.throttle)((function(){return n.current(...arguments)}),50,{leading:!0}),[50])}((e,t,n,c)=>{a||s(!0),null==r||r(e,t,n,c)});return Object(o.createElement)(i.ResizableBox,c()({className:b,enable:{bottom:!0},onResize:m,onResizeStop:function(){for(var e=arguments.length,t=new Array(e),n=0;n{let{emptyMessage:t,icon:r,label:n}=e;return e=>s=>{const[b]=s.useEditingImage,{attributes:O,category:j,isLoading:f,isSelected:_,name:w,product:v,setAttributes:k}=s,{mediaId:E,mediaSrc:y}=O,S=j||v,[I,C]=Object(d.useState)({}),{backgroundImageSrc:P}=Object(g.a)({item:S,mediaId:E,mediaSrc:y,blockName:w}),x=Object(h.c)(w),N=Object(d.useCallback)((e,t,r)=>{k({minHeight:parseInt(r.style.height,10)})},[k]);return b?Object(o.createElement)(e,c()({},s,{backgroundImageSize:I})):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(e,c()({},s,{backgroundImageSize:I})),S?(()=>{var e,t;const{contentAlign:r,dimRatio:n,focalPoint:c,hasParallax:i,isRepeated:s,imageFit:d,minHeight:b,overlayColor:g,overlayGradient:w,showDesc:k,showPrice:E,style:y,textColor:I}=O,A=l()(x,{"is-selected":_&&"preview"!==O.categoryId&&"preview"!==O.productId,"is-loading":!S&&f,"is-not-found":!S&&!f,"has-background-dim":0!==n,"is-repeated":s},Object(h.a)(n),"center"!==r&&`has-${r}-content`),R={borderRadius:null==y||null===(e=y.border)||void 0===e?void 0:e.radius,color:I?`var(--wp--preset--color--${I})`:null==y||null===(t=y.color)||void 0===t?void 0:t.text},L={...Object(a.__experimentalGetSpacingClassesAndStyles)(O).style,minHeight:b},T=!s&&!i,F=Object(h.b)({focalPoint:c,imageFit:d,isImgElement:T,isRepeated:s,url:P}),M={background:w,backgroundColor:g};return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(p,{enable:{bottom:!0},onResize:N,showHandle:_,style:{minHeight:b}}),Object(o.createElement)("div",{className:A,style:R},Object(o.createElement)("div",{className:x+"__wrapper",style:L},Object(o.createElement)("div",{className:"background-dim__overlay",style:M}),P&&(T?Object(o.createElement)("img",{alt:S.name,className:x+"__background-image",src:P,style:F,onLoad:e=>{var t,r;C({height:null===(t=e.currentTarget)||void 0===t?void 0:t.naturalHeight,width:null===(r=e.currentTarget)||void 0===r?void 0:r.naturalWidth})}}):Object(o.createElement)("div",{className:l()(x+"__background-image",{"has-parallax":i}),style:F})),Object(o.createElement)("h2",{className:x+"__title",dangerouslySetInnerHTML:{__html:S.name}}),!Object(u.isEmpty)(null==v?void 0:v.variation)&&Object(o.createElement)("h3",{className:x+"__variation",dangerouslySetInnerHTML:{__html:v.variation}}),k&&Object(o.createElement)("div",{className:x+"__description",dangerouslySetInnerHTML:{__html:(null==j?void 0:j.description)||(null==v?void 0:v.short_description)}}),E&&Object(o.createElement)("div",{className:x+"__price",dangerouslySetInnerHTML:{__html:v.price_html}}),Object(o.createElement)("div",{className:x+"__link"},(()=>{const{categoryId:e,linkText:t,productId:r}=O;return Object(o.createElement)(m,{itemId:e||r,linkText:t,permalink:(j||v).permalink})})()))))})():Object(o.createElement)(i.Placeholder,{className:x,icon:Object(o.createElement)(i.Icon,{icon:r}),label:n},f?Object(o.createElement)(i.Spinner,null):t))}}},212:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(0),c=r(5),o=r(8),a=r(2),i=r(95),s=r(6),l=r.n(s);function u(e){return function(t){const r=Object(c.useBlockProps)(),{color:o,...a}=r.style;return Object(n.createElement)("div",l()({},r,{style:a}),Object(n.createElement)(e,t))}}function d(e,t,r,s){var l,d,b,m,p,g,h,O,j,f,_,w,v;const k={attributes:{...r.attributes,minHeight:{type:"number",default:Object(a.getSetting)("default_height",500)}},supports:{...r.supports,color:{background:null===(l=r.supports)||void 0===l||null===(d=l.color)||void 0===d?void 0:d.background,text:null===(b=r.supports)||void 0===b||null===(m=b.color)||void 0===m?void 0:m.text,...Object(i.b)()&&{__experimentalDuotone:null===(p=r.supports)||void 0===p||null===(g=p.color)||void 0===g?void 0:g.__experimentalDuotone}},spacing:{padding:null===(h=r.supports)||void 0===h||null===(O=h.spacing)||void 0===O?void 0:O.padding,...Object(i.b)()&&{__experimentalDefaultControls:{padding:null===(j=r.supports)||void 0===j||null===(f=j.spacing)||void 0===f?void 0:f.__experimentalDefaultControls},__experimentalSkipSerialization:null===(_=r.supports)||void 0===_||null===(w=_.spacing)||void 0===w?void 0:w.__experimentalSkipSerialization}},...Object(i.b)()&&{__experimentalBorder:null==r||null===(v=r.supports)||void 0===v?void 0:v.__experimentalBorder}}},E={attributes:{alt:"",contentAlign:"center",dimRatio:50,editMode:!1,hasParallax:!1,isRepeated:!1,height:Object(a.getSetting)("default_height",500),mediaSrc:"",overlayColor:"#000000",showDesc:!0}};Object(o.registerBlockType)(r,{...k,example:{...E,example:t},edit:u(e),save:()=>Object(n.createElement)(c.InnerBlocks.Content,null),...s})}},22:function(e,t){e.exports=window.wp.isShallowEqual},23:function(e,t,r){"use strict";r.d(t,"o",(function(){return o})),r.d(t,"m",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"n",(function(){return s})),r.d(t,"j",(function(){return l})),r.d(t,"e",(function(){return u})),r.d(t,"f",(function(){return d})),r.d(t,"g",(function(){return b})),r.d(t,"k",(function(){return m})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return g})),r.d(t,"h",(function(){return h})),r.d(t,"a",(function(){return O})),r.d(t,"i",(function(){return j})),r.d(t,"b",(function(){return f}));var n,c=r(2);const o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=o.pluginUrl+"images/",i=o.pluginUrl+"build/",s=o.buildPhase,l=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=c.STORE_PAGES.checkout.id,d=c.STORE_PAGES.checkout.permalink,b=c.STORE_PAGES.privacy.permalink,m=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),p=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),g=c.STORE_PAGES.cart.permalink,h=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),O=Object(c.getSetting)("allowedCountries",{}),j=Object(c.getSetting)("shippingStates",{}),f=Object(c.getSetting)("allowedStates",{})},25:function(e,t,r){"use strict";r.d(t,"h",(function(){return l})),r.d(t,"e",(function(){return u})),r.d(t,"b",(function(){return d})),r.d(t,"i",(function(){return b})),r.d(t,"f",(function(){return m})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return g})),r.d(t,"g",(function(){return h})),r.d(t,"a",(function(){return O}));var n=r(15),c=r(14),o=r.n(c),a=r(7),i=r(2),s=r(23);const l=e=>{let{selected:t=[],search:r="",queryArgs:c={}}=e;const i=(e=>{let{selected:t=[],search:r="",queryArgs:c={}}=e;const o=s.o.productCount>100,a={per_page:o?100:0,catalog_visibility:"any",search:r,orderby:"title",order:"asc"},i=[Object(n.addQueryArgs)("/wc/store/v1/products",{...a,...c})];return o&&t.length&&i.push(Object(n.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),i})({selected:t,search:r,queryArgs:c});return Promise.all(i.map(e=>o()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>o()({path:"/wc/store/v1/products/"+e}),d=()=>o()({path:"wc/store/v1/products/attributes"}),b=e=>o()({path:`wc/store/v1/products/attributes/${e}/terms`}),m=e=>{let{selected:t=[],search:r}=e;const c=(e=>{let{selected:t=[],search:r}=e;const c=Object(i.getSetting)("limitTags",!1),o=[Object(n.addQueryArgs)("wc/store/v1/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:r})];return c&&t.length&&o.push(Object(n.addQueryArgs)("wc/store/v1/products/tags",{include:t})),o})({selected:t,search:r});return Promise.all(c.map(e=>o()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id"))},p=e=>o()({path:Object(n.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),g=e=>o()({path:"wc/store/v1/products/categories/"+e}),h=e=>o()({path:Object(n.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),O=(e,t)=>{if(!e.title.raw)return e.slug;const r=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(r?"":" - "+e.slug)}},27:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return a}));var n=r(1),c=r(13);const o=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},a=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(c.decodeEntities)(e.message):Object(n.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},299:function(e,t,r){"use strict";var n=r(6),c=r.n(n),o=r(24),a=r.n(o),i=r(0),s=r(10),l=r(25),u=r(27);const d=Object(s.createHigherOrderComponent)(e=>class extends i.Component{constructor(){super(...arguments),a()(this,"state",{error:null,loading:!1,product:"preview"===this.props.attributes.productId?this.props.attributes.previewProduct:null}),a()(this,"loadProduct",()=>{const{productId:e}=this.props.attributes;"preview"!==e&&(e?(this.setState({loading:!0}),Object(l.e)(e).then(e=>{this.setState({product:e,loading:!1,error:null})}).catch(async e=>{const t=await Object(u.a)(e);this.setState({product:null,loading:!1,error:t})})):this.setState({product:null,loading:!1,error:null}))})}componentDidMount(){this.loadProduct()}componentDidUpdate(e){e.attributes.productId!==this.props.attributes.productId&&this.loadProduct()}render(){const{error:t,loading:r,product:n}=this.state;return Object(i.createElement)(e,c()({},this.props,{error:t,getProduct:this.loadProduct,isLoading:r,product:n}))}},"withProduct");t.a=d},3:function(e,t){e.exports=window.wp.components},314:function(e){e.exports=JSON.parse('{"name":"woocommerce/featured-product","version":"1.0.0","title":"Featured Product","description":"Visually highlight a product or variation and encourage prompt action.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"align":["wide","full"],"html":false,"color":{"background":true,"text":true,"__experimentalDuotone":".wc-block-featured-product__background-image"},"spacing":{"padding":true,"__experimentalDefaultControls":{"padding":true},"__experimentalSkipSerialization":true},"__experimentalBorder":{"color":true,"radius":true,"width":true,"__experimentalSkipSerialization":true},"multiple":true},"attributes":{"alt":{"type":"string","default":""},"contentAlign":{"type":"string","default":"center"},"dimRatio":{"type":"number","default":50},"editMode":{"type":"boolean","default":true},"focalPoint":{"type":"object","default":{"x":0.5,"y":0.5}},"imageFit":{"type":"string","default":"none"},"hasParallax":{"type":"boolean","default":false},"isRepeated":{"type":"boolean","default":false},"mediaId":{"type":"number","default":0},"mediaSrc":{"type":"string","default":""},"minHeight":{"type":"number","default":500},"linkText":{"type":"string","default":"Shop now"},"overlayColor":{"type":"string","default":"#000000"},"overlayGradient":{"type":"string"},"productId":{"type":"number"},"previewProduct":{"type":"object","default":null},"showDesc":{"type":"boolean","default":true},"showPrice":{"type":"boolean","default":true},"style":{"type":"object","default":{"color":{"text":"#ffffff"}}}},"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},32:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(33);t.a=e=>{let{error:t}=e;return Object(n.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:r}=e;return t?"general"===r?Object(n.createElement)("span",null,Object(c.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(t))):"api"===r?Object(n.createElement)("span",null,Object(c.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(t))):t:Object(c.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},33:function(e,t){e.exports=window.wp.escapeHtml},36:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(6),c=r.n(n),o=r(0),a=r(19);const i=e=>{let{countLabel:t,className:r,depth:n=0,controlId:i="",item:s,isSelected:l,isSingle:u,onSelect:d,search:b="",...m}=e;const p=null!=t&&void 0!==s.count&&null!==s.count,g=[r,"woocommerce-search-list__item"];g.push("depth-"+n),u&&g.push("is-radio-button"),p&&g.push("has-count");const h=s.breadcrumbs&&s.breadcrumbs.length,O=m.name||"search-list-item-"+i,j=`${O}-${s.id}`;return Object(o.createElement)("label",{htmlFor:j,className:g.join(" ")},u?Object(o.createElement)("input",c()({type:"radio",id:j,name:O,value:s.value,onChange:d(s),checked:l,className:"woocommerce-search-list__item-input"},m)):Object(o.createElement)("input",c()({type:"checkbox",id:j,name:O,value:s.value,onChange:d(s),checked:l,className:"woocommerce-search-list__item-input"},m)),Object(o.createElement)("span",{className:"woocommerce-search-list__item-label"},h?Object(o.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(a.b)(s.breadcrumbs)):null,Object(o.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(a.d)(s.name,b))),!!p&&Object(o.createElement)("span",{className:"woocommerce-search-list__item-count"},t||s.count))};t.b=i},362:function(e,t,r){e.exports=r(474)},363:function(e,t){},364:function(e,t){},365:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),c=r(23);const o=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(n.__)("Fly your WordPress banner with this beauty! Deck out your office space or add it to your kids walls. This banner will spruce up any space it’s hung!","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",price:"7.99",price_html:'$7.99',images:[{id:1,src:c.m+"previews/pennant.jpg",thumbnail:c.m+"previews/pennant.jpg",name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,categories:[{id:1,name:"Decor",slug:"decor",link:"https://example.org"}],review_count:1,prices:{currency_code:"GBP",decimal_separator:".",thousand_separator:",",decimals:2,price_prefix:"£",price_suffix:"",price:"7.99",regular_price:"9.99",sale_price:"7.99",price_range:null},add_to_cart:{text:Object(n.__)("Add to cart","woo-gutenberg-products-block"),description:Object(n.__)("Add to cart","woo-gutenberg-products-block")},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},46:function(e,t,r){"use strict";r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return c}));const n={height:500,width:500},c={featuredCategory:"woocommerce/featured-category",featuredProduct:"woocommerce/featured-product"}},474:function(e,t,r){"use strict";r.r(t);var n=r(0),c=r(113),o=r(505),a=(r(363),r(364),r(299)),i=r(3),s=r(10),l=r(1),u=r(199),d=r(197),b=r(198),m=r(196),p=r(195),g=r(194),h=r(210),O=r(193);const j={icon:o.a,label:Object(l.__)("Featured Product","woo-gutenberg-products-block")},f={...j,cropLabel:Object(l.__)("Edit product image","woo-gutenberg-products-block"),editLabel:Object(l.__)("Edit selected product","woo-gutenberg-products-block")},_={...j,emptyMessage:Object(l.__)("No product is selected.","woo-gutenberg-products-block")},w={...j,description:Object(l.__)("Visually highlight a product or variation and encourage prompt action","woo-gutenberg-products-block"),editLabel:Object(l.__)("Showing Featured Product block preview.","woo-gutenberg-products-block")};var v=Object(s.compose)([a.a,i.withSpokenMessages,O.a,g.a,Object(p.a)(w),Object(h.a)(_),m.a,d.a,b.a,Object(u.a)(f)])(()=>Object(n.createElement)(n.Fragment,null)),k=r(212);const E={attributes:{productId:"preview",previewProduct:r(365).a[0]}};var y=r(314);Object(k.a)(v,E,y,{icon:{src:Object(n.createElement)(c.a,{icon:o.a,className:"wc-block-editor-components-block-icon"})}})},5:function(e,t){e.exports=window.wp.blockEditor},56:function(e,t,r){"use strict";var n=r(6),c=r.n(n),o=r(0),a=r(1),i=r(36),s=r(97),l=r(3),u=r(10),d=r(25),b=r(27),m=Object(u.createHigherOrderComponent)(e=>class extends o.Component{constructor(){super(...arguments),this.state={error:null,loading:!1,categories:[]},this.loadCategories=this.loadCategories.bind(this)}componentDidMount(){this.loadCategories()}loadCategories(){this.setState({loading:!0}),Object(d.c)().then(e=>{this.setState({categories:e,loading:!1,error:null})}).catch(async e=>{const t=await Object(b.a)(e);this.setState({categories:[],loading:!1,error:t})})}render(){const{error:t,loading:r,categories:n}=this.state;return Object(o.createElement)(e,c()({},this.props,{error:t,isLoading:r,categories:n}))}},"withCategories"),p=r(32),g=r(4),h=r.n(g);r(89);const O=e=>{let{categories:t,error:r,isLoading:n,onChange:u,onOperatorChange:d,operator:b,selected:m,isCompact:g,isSingle:O,showReviewCount:j}=e;const f={clear:Object(a.__)("Clear all product categories","woo-gutenberg-products-block"),list:Object(a.__)("Product Categories","woo-gutenberg-products-block"),noItems:Object(a.__)("Your store doesn't have any product categories.","woo-gutenberg-products-block"),search:Object(a.__)("Search for product categories","woo-gutenberg-products-block"),selected:e=>Object(a.sprintf)( +/* translators: %d is the count of selected categories. */ +Object(a._n)("%d category selected","%d categories selected",e,"woo-gutenberg-products-block"),e),updated:Object(a.__)("Category search results updated.","woo-gutenberg-products-block")};return r?Object(o.createElement)(p.a,{error:r}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(s.a,{className:"woocommerce-product-categories",list:t,isLoading:n,selected:m.map(e=>t.find(t=>t.id===e)).filter(Boolean),onChange:u,renderItem:e=>{const{item:t,search:r,depth:n=0}=e,s=t.breadcrumbs.length?`${t.breadcrumbs.join(", ")}, ${t.name}`:t.name,l=j?Object(a.sprintf)( +/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */ +Object(a._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,"woo-gutenberg-products-block"),s,t.review_count):Object(a.sprintf)( +/* translators: %1$s is the item name, %2$d is the count of products for the item. */ +Object(a._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,"woo-gutenberg-products-block"),s,t.count),u=j?Object(a.sprintf)( +/* translators: %d is the count of reviews. */ +Object(a._n)("%d review","%d reviews",t.review_count,"woo-gutenberg-products-block"),t.review_count):Object(a.sprintf)( +/* translators: %d is the count of products. */ +Object(a._n)("%d product","%d products",t.count,"woo-gutenberg-products-block"),t.count);return Object(o.createElement)(i.a,c()({className:h()("woocommerce-product-categories__item","has-count",{"is-searching":r.length>0,"is-skip-level":0===n&&0!==t.parent})},e,{countLabel:u,"aria-label":l}))},messages:f,isCompact:g,isHierarchical:!0,isSingle:O}),!!d&&Object(o.createElement)("div",{hidden:m.length<2},Object(o.createElement)(l.SelectControl,{className:"woocommerce-product-categories__operator",label:Object(a.__)("Display products matching","woo-gutenberg-products-block"),help:Object(a.__)("Pick at least two categories to use this setting.","woo-gutenberg-products-block"),value:b,onChange:d,options:[{label:Object(a.__)("Any selected categories","woo-gutenberg-products-block"),value:"any"},{label:Object(a.__)("All selected categories","woo-gutenberg-products-block"),value:"all"}]})))};O.defaultProps={operator:"any",isCompact:!1,isSingle:!1},t.a=m(O)},7:function(e,t){e.exports=window.lodash},73:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(113),a=r(172),i=r(4),s=r.n(i),l=r(3),u=r(32);r(114),t.a=e=>{let{className:t,error:r,isLoading:i=!1,onRetry:d}=e;return Object(n.createElement)(l.Placeholder,{icon:Object(n.createElement)(o.a,{icon:a.a}),label:Object(c.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:s()("wc-block-api-error",t)},Object(n.createElement)(u.a,{error:r}),d&&Object(n.createElement)(n.Fragment,null,i?Object(n.createElement)(l.Spinner,null):Object(n.createElement)(l.Button,{isSecondary:!0,onClick:d},Object(c.__)("Retry","woo-gutenberg-products-block"))))}},8:function(e,t){e.exports=window.wp.blocks},82:function(e,t,r){"use strict";var n=r(6),c=r.n(n),o=r(0),a=r(36),i=r(3),s=r(4),l=r.n(s);t.a=e=>{let{className:t,item:r,isSelected:n,isLoading:s,onSelect:u,disabled:d,...b}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.a,c()({},b,{key:r.id,className:t,isSelected:n,item:r,onSelect:u,isSingle:!0,disabled:d})),n&&s&&Object(o.createElement)("div",{key:"loading",className:l()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(o.createElement)(i.Spinner,null)))}},84:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(12),c=r(46),o=r(7);function a(e){return!!e&&Object(o.isNumber)(e.id)&&"string"==typeof e.src}function i(e){let{blockName:t,item:r,mediaId:o,mediaSrc:i}=e;const[s,l]=Object(n.useState)(0),[u,d]=Object(n.useState)("");return Object(n.useEffect)(()=>{var e,n;l(o||(t===c.a.featuredProduct?(n=r)&&n.images&&n.images.length&&n.images[0].id||0:(e=r)&&a(e.image)?e.image.id:0))},[t,r,o]),Object(n.useEffect)(()=>{var e,n;d(i||(t===c.a.featuredProduct?(n=r)&&n.images&&n.images.length&&n.images[0].src||"":(e=r)&&a(e.image)?e.image.src:""))},[t,r,i]),{backgroundImageId:s,backgroundImageSrc:u}}},85:function(e,t,r){"use strict";function n(e){return e?`${Math.round(100*e.x)}% ${Math.round(100*e.y)}%`:""}function c(e){let{focalPoint:t,imageFit:r,isImgElement:c,isRepeated:o,url:a}=e,i={};var s;return i=c?{...i,...(s=t,s?{objectPosition:n(s)}:{}),objectFit:r}:{...i,...a&&{backgroundImage:`url(${a})`},backgroundPosition:n(t),...!o&&{backgroundRepeat:"no-repeat",backgroundSize:"cover"===r?r:"auto"}},i}function o(e){return"wc-block-"+e.split("/")[1]}function a(e){return 0===e||50===e?null:"has-background-dim-"+10*Math.round(e/10)}r.d(t,"b",(function(){return c})),r.d(t,"c",(function(){return o})),r.d(t,"a",(function(){return a}))},89:function(e,t){},9:function(e,t){e.exports=window.wp.data},93:function(e,t,r){"use strict";var n=r(6),c=r.n(n),o=r(0),a=r(1),i=r(7),s=r(36),l=r(97),u=r(10),d=Object(u.createHigherOrderComponent)(e=>{class t extends o.Component{render(){const{selected:t}=this.props,r=null==t;return Array.isArray(t)?Object(o.createElement)(e,this.props):Object(o.createElement)(e,c()({},this.props,{selected:r?[]:[t]}))}}return t.defaultProps={selected:null},t},"withTransformSingleSelectToMultipleSelect"),b=r(176),m=r(24),p=r.n(m),g=r(22),h=r.n(g),O=r(25),j=r(27),f=Object(u.createHigherOrderComponent)(e=>{class t extends o.Component{constructor(){super(...arguments),p()(this,"state",{error:null,loading:!1,variations:{}}),p()(this,"loadVariations",()=>{const{products:e}=this.props,{loading:t,variations:r}=this.state;if(t)return;const n=this.getExpandedProduct();if(!n||r[n])return;const c=e.find(e=>e.id===n);c.variations&&0!==c.variations.length?(this.setState({loading:!0}),Object(O.g)(n).then(e=>{const t=e.map(e=>({...e,parent:n}));this.setState({variations:{...this.state.variations,[n]:t},loading:!1,error:null})}).catch(async e=>{const t=await Object(j.a)(e);this.setState({variations:{...this.state.variations,[n]:null},loading:!1,error:t})})):this.setState({variations:{...this.state.variations,[n]:null},loading:!1,error:null})})}componentDidMount(){const{selected:e,showVariations:t}=this.props;e&&t&&this.loadVariations()}componentDidUpdate(e){const{isLoading:t,selected:r,showVariations:n}=this.props;n&&(!h()(e.selected,r)||e.isLoading&&!t)&&this.loadVariations()}isProductId(e){const{products:t}=this.props;return t.some(t=>t.id===e)}findParentProduct(e){var t;const{products:r}=this.props;return null===(t=r.filter(t=>t.variations&&t.variations.find(t=>{let{id:r}=t;return r===e}))[0])||void 0===t?void 0:t.id}getExpandedProduct(){const{isLoading:e,selected:t,showVariations:r}=this.props;if(!r)return null;let n=t&&t.length?t[0]:null;return n?this.prevSelectedItem=n:this.prevSelectedItem&&(e||this.isProductId(this.prevSelectedItem)||(n=this.prevSelectedItem)),!e&&n?this.isProductId(n)?n:this.findParentProduct(n):null}render(){const{error:t,isLoading:r}=this.props,{error:n,loading:a,variations:i}=this.state;return Object(o.createElement)(e,c()({},this.props,{error:n||t,expandedProduct:this.getExpandedProduct(),isLoading:r,variations:i,variationsLoading:a}))}}return p()(t,"defaultProps",{selected:[],showVariations:!1}),t},"withProductVariations"),_=r(32),w=r(4),v=r.n(w),k=r(82);r(134);const E={list:Object(a.__)("Products","woo-gutenberg-products-block"),noItems:Object(a.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(a.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(a.__)("Product search results updated.","woo-gutenberg-products-block")},y=e=>{let{expandedProduct:t,error:r,instanceId:n,isCompact:u,isLoading:d,onChange:b,onSearch:m,products:p,renderItem:g,selected:h,showVariations:O,variations:j,variationsLoading:f}=e;if(r)return Object(o.createElement)(_.a,{error:r});const w=[...p,...j&&j[t]?j[t]:[]];return Object(o.createElement)(l.a,{className:"woocommerce-products",list:w,isCompact:u,isLoading:d,isSingle:!0,selected:w.filter(e=>{let{id:t}=e;return h.includes(t)}),onChange:b,renderItem:g||(O?e=>{const{item:t,search:r,depth:l=0,isSelected:u,onSelect:b}=e,m=t.variations&&Array.isArray(t.variations)?t.variations.length:0,p=v()("woocommerce-search-product__item","woocommerce-search-list__item","depth-"+l,"has-count",{"is-searching":r.length>0,"is-skip-level":0===l&&0!==t.parent,"is-variable":m>0});if(!t.breadcrumbs.length)return Object(o.createElement)(k.a,c()({},e,{className:v()(p,{"is-selected":u}),isSelected:u,item:t,onSelect:()=>()=>{b(t)()},isLoading:d||f,countLabel:t.variations.length>0?Object(a.sprintf)( +/* translators: %1$d is the number of variations of a product product. */ +Object(a.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-"+n,"aria-label":Object(a.sprintf)( +/* translators: %1$s is the product name, %2$d is the number of variations of that product. */ +Object(a._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,"woo-gutenberg-products-block"),t.name,t.variations.length)}));const g=Object(i.isEmpty)(t.variation)?e:{...e,item:{...e.item,name:t.variation},"aria-label":`${t.breadcrumbs[0]}: ${t.variation}`};return Object(o.createElement)(s.a,c()({},g,{className:p,name:"variations-"+n}))}:null),onSearch:m,messages:E,isHierarchical:!0})};y.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=d(Object(b.a)(f(Object(u.withInstanceId)(y))))},95:function(e,t,r){"use strict";r.d(t,"c",(function(){return o})),r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return i}));var n=r(8),c=r(23);const o=(e,t)=>{if(c.n>2)return Object(n.registerBlockType)(e,t)},a=()=>c.n>2,i=()=>c.n>1},97:function(e,t,r){"use strict";r.d(t,"a",(function(){return k}));var n=r(6),c=r.n(n),o=r(0),a=r(1),i=r(3),s=r(113),l=r(498),u=r(4),d=r.n(u),b=r(10),m=r(19),p=r(36),g=r(497),h=r(13);const O=e=>{let{id:t,label:r,popoverContents:n,remove:c,screenReaderLabel:l,className:u=""}=e;const[m,p]=Object(o.useState)(!1),j=Object(b.useInstanceId)(O);if(l=l||r,!r)return null;r=Object(h.decodeEntities)(r);const f=d()("woocommerce-tag",u,{"has-remove":!!c}),_="woocommerce-tag__label-"+j,w=Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},l),Object(o.createElement)("span",{"aria-hidden":"true"},r));return Object(o.createElement)("span",{className:f},n?Object(o.createElement)(i.Button,{className:"woocommerce-tag__text",id:_,onClick:()=>p(!0)},w):Object(o.createElement)("span",{className:"woocommerce-tag__text",id:_},w),n&&m&&Object(o.createElement)(i.Popover,{onClose:()=>p(!1)},n),c&&Object(o.createElement)(i.Button,{className:"woocommerce-tag__remove",onClick:c(t),label:Object(a.sprintf)(// Translators: %s label. +Object(a.__)("Remove %s","woo-gutenberg-products-block"),r),"aria-describedby":_},Object(o.createElement)(s.a,{icon:g.a,size:20,className:"clear-icon"})))};var j=O;const f=e=>Object(o.createElement)(p.b,e),_=e=>{const{list:t,selected:r,renderItem:n,depth:a=0,onSelect:i,instanceId:s,isSingle:l,search:u}=e;return t?Object(o.createElement)(o.Fragment,null,t.map(t=>{const d=-1!==r.findIndex(e=>{let{id:r}=e;return r===t.id});return Object(o.createElement)(o.Fragment,{key:t.id},Object(o.createElement)("li",null,n({item:t,isSelected:d,onSelect:i,isSingle:l,search:u,depth:a,controlId:s})),Object(o.createElement)(_,c()({},e,{list:t.children,depth:a+1})))})):null},w=e=>{let{isLoading:t,isSingle:r,selected:n,messages:c,onChange:s,onRemove:l}=e;if(t||r||!n)return null;const u=n.length;return Object(o.createElement)("div",{className:"woocommerce-search-list__selected"},Object(o.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(o.createElement)("strong",null,c.selected(u)),u>0?Object(o.createElement)(i.Button,{isLink:!0,isDestructive:!0,onClick:()=>s([]),"aria-label":c.clear},Object(a.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(o.createElement)("ul",null,n.map((e,t)=>Object(o.createElement)("li",{key:t},Object(o.createElement)(j,{label:e.name,id:e.id,remove:l})))):null)},v=e=>{let{filteredList:t,search:r,onSelect:n,instanceId:c,...i}=e;const{messages:u,renderItem:d,selected:b,isSingle:m}=i,p=d||f;return 0===t.length?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(o.createElement)(s.a,{icon:l.a})),Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-text"},r?Object(a.sprintf)(u.noResults,r):u.noItems)):Object(o.createElement)("ul",{className:"woocommerce-search-list__list"},Object(o.createElement)(_,{list:t,selected:b,renderItem:p,onSelect:n,instanceId:c,isSingle:m,search:r}))},k=e=>{const{className:t="",isCompact:r,isHierarchical:n,isLoading:a,isSingle:s,list:l,messages:u=m.a,onChange:p,onSearch:g,selected:h,debouncedSpeak:O}=e,[j,f]=Object(o.useState)(""),_=Object(b.useInstanceId)(k),E=Object(o.useMemo)(()=>({...m.a,...u}),[u]),y=Object(o.useMemo)(()=>Object(m.c)(l,j,n),[l,j,n]);Object(o.useEffect)(()=>{O&&O(E.updated)},[O,E]),Object(o.useEffect)(()=>{"function"==typeof g&&g(j)},[j,g]);const S=Object(o.useCallback)(e=>()=>{s&&p([]);const t=h.findIndex(t=>{let{id:r}=t;return r===e});p([...h.slice(0,t),...h.slice(t+1)])},[s,h,p]),I=Object(o.useCallback)(e=>()=>{-1===h.findIndex(t=>{let{id:r}=t;return r===e.id})?p(s?[e]:[...h,e]):S(e.id)()},[s,S,p,h]);return Object(o.createElement)("div",{className:d()("woocommerce-search-list",t,{"is-compact":r})},Object(o.createElement)(w,c()({},e,{onRemove:S,messages:E})),Object(o.createElement)("div",{className:"woocommerce-search-list__search"},Object(o.createElement)(i.TextControl,{label:E.search,type:"search",value:j,onChange:e=>f(e)})),a?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(o.createElement)(i.Spinner,null)):Object(o.createElement)(v,c()({},e,{search:j,filteredList:y,messages:E,onSelect:I,instanceId:_})))};Object(i.withSpokenMessages)(k)}}); \ No newline at end of file diff --git a/build/featured-product/block.json b/build/featured-product/block.json new file mode 100644 index 00000000000..119ecb2e268 --- /dev/null +++ b/build/featured-product/block.json @@ -0,0 +1,116 @@ +{ + "name": "woocommerce/featured-product", + "version": "1.0.0", + "title": "Featured Product", + "description": "Visually highlight a product or variation and encourage prompt action.", + "category": "woocommerce", + "keywords": [ "WooCommerce" ], + "supports": { + "align": [ "wide", "full" ], + "html": false, + "color": { + "background": true, + "text": true, + "__experimentalDuotone": ".wc-block-featured-product__background-image" + }, + "spacing": { + "padding": true, + "__experimentalDefaultControls": { + "padding": true + }, + "__experimentalSkipSerialization": true + }, + "__experimentalBorder": { + "color": true, + "radius": true, + "width": true, + "__experimentalSkipSerialization": true + }, + "multiple": true + }, + "attributes": { + "alt": { + "type": "string", + "default": "" + }, + "contentAlign": { + "type": "string", + "default": "center" + }, + "dimRatio": { + "type": "number", + "default": 50 + }, + "editMode": { + "type": "boolean", + "default": true + }, + "focalPoint": { + "type": "object", + "default": { + "x": 0.5, + "y": 0.5 + } + }, + "imageFit": { + "type": "string", + "default": "none" + }, + "hasParallax": { + "type": "boolean", + "default": false + }, + "isRepeated": { + "type": "boolean", + "default": false + }, + "mediaId": { + "type": "number", + "default": 0 + }, + "mediaSrc": { + "type": "string", + "default": "" + }, + "minHeight": { + "type": "number", + "default": 500 + }, + "linkText": { + "type": "string", + "default": "Shop now" + }, + "overlayColor": { + "type": "string", + "default": "#000000" + }, + "overlayGradient": { + "type": "string" + }, + "productId": { + "type": "number" + }, + "previewProduct": { + "type": "object", + "default": null + }, + "showDesc": { + "type": "boolean", + "default": true + }, + "showPrice": { + "type": "boolean", + "default": true + }, + "style": { + "type": "object", + "default": { + "color": { + "text": "#ffffff" + } + } + } + }, + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2 +} diff --git a/build/filled-cart-block/block.json b/build/filled-cart-block/block.json new file mode 100644 index 00000000000..2314753ae69 --- /dev/null +++ b/build/filled-cart-block/block.json @@ -0,0 +1,28 @@ +{ + "name": "woocommerce/filled-cart-block", + "version": "1.0.0", + "title": "Filled Cart", + "description": "Contains blocks that are displayed when the cart contains products.", + "category": "woocommerce", + "supports": { + "align": [ "wide" ], + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/cart" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/filled-mini-cart-contents-block/block.json b/build/filled-mini-cart-contents-block/block.json new file mode 100644 index 00000000000..2f529ee2052 --- /dev/null +++ b/build/filled-mini-cart-contents-block/block.json @@ -0,0 +1,27 @@ +{ + "name": "woocommerce/filled-mini-cart-contents-block", + "version": "1.0.0", + "title": "Filled Mini Cart Contents", + "description": "Contains blocks that are displayed when the mini cart has products.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/mini-cart-contents" ], + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2 +} diff --git a/build/general-style-rtl.css b/build/general-style-rtl.css new file mode 100644 index 00000000000..943a09b5f45 --- /dev/null +++ b/build/general-style-rtl.css @@ -0,0 +1 @@ +@-webkit-keyframes spinner__animation{0%{-webkit-animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(-1turn)}}@keyframes spinner__animation{0%{-webkit-animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(-1turn)}}@-webkit-keyframes loading__animation{to{transform:translateX(-100%)}}@keyframes loading__animation{to{transform:translateX(-100%)}}.wc-blocks-components-form-token-field-wrapper{/*!rtl:end:ignore*//*!rtl:begin:ignore*/}.wc-blocks-components-form-token-field-wrapper .components-popover{left:0;opacity:0;position:fixed;top:0;z-index:z-index(".components-popover")}.wc-blocks-components-form-token-field-wrapper .components-popover.is-expanded,.wc-blocks-components-form-token-field-wrapper .components-popover[data-x-axis][data-y-axis]{opacity:1}.wc-blocks-components-form-token-field-wrapper .components-popover.is-expanded{bottom:0;left:0;right:0;top:0;z-index:z-index(".components-popover")!important}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow){margin-left:2px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):before{border:8px solid #ccc}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow).is-alternate:before{border-color:#1e1e1e}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):after{border:8px solid #fff}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):before{content:"";height:0;line-height:0;position:absolute;width:0}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]{margin-top:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{bottom:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:after{bottom:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{border-bottom:none;border-left-color:transparent;border-right-color:transparent;border-top-style:solid;margin-left:-10px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]{margin-top:8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{top:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after{top:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{border-bottom-style:solid;border-left-color:transparent;border-right-color:transparent;border-top:none;margin-left:-10px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]{margin-left:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:before{right:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:after{right:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:before{border-bottom-color:transparent;border-left-style:solid;border-right:none;border-top-color:transparent}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]{margin-left:8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:before{left:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:after{left:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:before{border-bottom-color:transparent;border-left:none;border-right-style:solid;border-top-color:transparent}.wc-blocks-components-form-token-field-wrapper .components-popover[data-y-axis=top]{bottom:100%}.wc-blocks-components-form-token-field-wrapper .components-popover[data-y-axis=bottom]{top:100%}.wc-blocks-components-form-token-field-wrapper .components-popover[data-y-axis=middle]{align-items:center;display:flex}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-top{margin-top:12px}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-bottom{margin-top:-12px}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-left:not(.is-from-top):not(.is-from-bottom){margin-left:12px}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-right:not(.is-from-top):not(.is-from-bottom){margin-right:12px}.wc-blocks-components-form-token-field-wrapper .components-popover__content{background:#fff;border:1px solid #ccc;border-radius:2px;box-shadow:0 2px 6px rgba(0,0,0,.05);height:100%}.is-alternate .wc-blocks-components-form-token-field-wrapper .components-popover__content{border:1px solid #1e1e1e;box-shadow:none}.components-popover .wc-blocks-components-form-token-field-wrapper .components-popover__content{height:auto;overflow-y:auto;position:absolute}.components-popover.is-expanded .wc-blocks-components-form-token-field-wrapper .components-popover__content{border:none;border-top:1px solid #1e1e1e;height:calc(100% - 48px);min-width:auto;overflow-y:visible;position:static}.components-popover[data-y-axis=top] .wc-blocks-components-form-token-field-wrapper .components-popover__content{bottom:100%}.components-popover[data-x-axis=center] .wc-blocks-components-form-token-field-wrapper .components-popover__content{left:50%;transform:translateX(-50%)}.components-popover[data-x-axis=right] .wc-blocks-components-form-token-field-wrapper .components-popover__content{left:100%;position:absolute}.components-popover:not([data-y-axis=middle])[data-x-axis=right] .wc-blocks-components-form-token-field-wrapper .components-popover__content{margin-left:-25px}.components-popover[data-x-axis=left] .wc-blocks-components-form-token-field-wrapper .components-popover__content{position:absolute;right:100%}.components-popover:not([data-y-axis=middle])[data-x-axis=left] .wc-blocks-components-form-token-field-wrapper .components-popover__content{margin-right:-25px}.wc-blocks-components-form-token-field-wrapper .components-popover__header{align-items:center;background:#fff;display:flex;height:48px;justify-content:space-between;padding:0 8px 0 16px}.wc-blocks-components-form-token-field-wrapper .components-popover__header-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.wc-blocks-components-form-token-field-wrapper .components-popover__close.components-button{z-index:z-index(".components-popover__close")}.wc-blocks-components-form-token-field-wrapper .components-tooltip.components-popover{z-index:z-index(".components-tooltip")}.wc-blocks-components-form-token-field-wrapper .components-tooltip.components-popover .components-popover__content{min-width:0}.wc-blocks-components-form-token-field-wrapper .components-tooltip .components-popover__content{background:#1e1e1e;border-radius:2px;border-width:0;box-shadow:none;color:#fff;font-size:12px;line-height:1.4;text-align:center;white-space:nowrap}.wc-blocks-components-form-token-field-wrapper .components-tooltip .components-popover__content>div{padding:4px 8px}.wc-blocks-components-form-token-field-wrapper .components-tooltip__shortcut{display:inline-block;margin-left:8px}.wc-blocks-components-form-token-field-wrapper .disabled-element-wrapper{position:relative}.wc-blocks-components-form-token-field-wrapper .disabled-element-wrapper .event-catcher{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%;z-index:z-index(".components-tooltip .event-catcher")} \ No newline at end of file diff --git a/build/general-style.css b/build/general-style.css new file mode 100644 index 00000000000..10c14909493 --- /dev/null +++ b/build/general-style.css @@ -0,0 +1 @@ +@-webkit-keyframes spinner__animation{0%{-webkit-animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes spinner__animation{0%{-webkit-animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(1turn)}}@-webkit-keyframes loading__animation{to{transform:translateX(100%)}}@keyframes loading__animation{to{transform:translateX(100%)}}.wc-blocks-components-form-token-field-wrapper{/*!rtl:end:ignore*//*!rtl:begin:ignore*/}.wc-blocks-components-form-token-field-wrapper .components-popover{left:0;opacity:0;position:fixed;top:0;z-index:z-index(".components-popover")}.wc-blocks-components-form-token-field-wrapper .components-popover.is-expanded,.wc-blocks-components-form-token-field-wrapper .components-popover[data-x-axis][data-y-axis]{opacity:1}.wc-blocks-components-form-token-field-wrapper .components-popover.is-expanded{bottom:0;left:0;right:0;top:0;z-index:z-index(".components-popover")!important}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow){margin-left:2px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):before{border:8px solid #ccc}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow).is-alternate:before{border-color:#1e1e1e}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):after{border:8px solid #fff}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):before{content:"";height:0;line-height:0;position:absolute;width:0}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]{margin-top:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{bottom:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:after{bottom:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{border-bottom:none;border-left-color:transparent;border-right-color:transparent;border-top-style:solid;margin-left:-10px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]{margin-top:8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{top:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after{top:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{border-bottom-style:solid;border-left-color:transparent;border-right-color:transparent;border-top:none;margin-left:-10px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]{margin-left:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:before{right:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:after{right:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:before{border-bottom-color:transparent;border-left-style:solid;border-right:none;border-top-color:transparent}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]{margin-left:8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:before{left:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:after{left:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:before{border-bottom-color:transparent;border-left:none;border-right-style:solid;border-top-color:transparent}.wc-blocks-components-form-token-field-wrapper .components-popover[data-y-axis=top]{bottom:100%}.wc-blocks-components-form-token-field-wrapper .components-popover[data-y-axis=bottom]{top:100%}.wc-blocks-components-form-token-field-wrapper .components-popover[data-y-axis=middle]{align-items:center;display:flex}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-top{margin-top:12px}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-bottom{margin-top:-12px}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-left:not(.is-from-top):not(.is-from-bottom){margin-left:12px}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-right:not(.is-from-top):not(.is-from-bottom){margin-right:12px}.wc-blocks-components-form-token-field-wrapper .components-popover__content{background:#fff;border:1px solid #ccc;border-radius:2px;box-shadow:0 2px 6px rgba(0,0,0,.05);height:100%}.is-alternate .wc-blocks-components-form-token-field-wrapper .components-popover__content{border:1px solid #1e1e1e;box-shadow:none}.components-popover .wc-blocks-components-form-token-field-wrapper .components-popover__content{height:auto;overflow-y:auto;position:absolute}.components-popover.is-expanded .wc-blocks-components-form-token-field-wrapper .components-popover__content{border:none;border-top:1px solid #1e1e1e;height:calc(100% - 48px);min-width:auto;overflow-y:visible;position:static}.components-popover[data-y-axis=top] .wc-blocks-components-form-token-field-wrapper .components-popover__content{bottom:100%}.components-popover[data-x-axis=center] .wc-blocks-components-form-token-field-wrapper .components-popover__content{left:50%;transform:translateX(-50%)}.components-popover[data-x-axis=right] .wc-blocks-components-form-token-field-wrapper .components-popover__content{left:100%;position:absolute}.components-popover:not([data-y-axis=middle])[data-x-axis=right] .wc-blocks-components-form-token-field-wrapper .components-popover__content{margin-left:-25px}.components-popover[data-x-axis=left] .wc-blocks-components-form-token-field-wrapper .components-popover__content{position:absolute;right:100%}.components-popover:not([data-y-axis=middle])[data-x-axis=left] .wc-blocks-components-form-token-field-wrapper .components-popover__content{margin-right:-25px}.wc-blocks-components-form-token-field-wrapper .components-popover__header{align-items:center;background:#fff;display:flex;height:48px;justify-content:space-between;padding:0 8px 0 16px}.wc-blocks-components-form-token-field-wrapper .components-popover__header-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.wc-blocks-components-form-token-field-wrapper .components-popover__close.components-button{z-index:z-index(".components-popover__close")}.wc-blocks-components-form-token-field-wrapper .components-tooltip.components-popover{z-index:z-index(".components-tooltip")}.wc-blocks-components-form-token-field-wrapper .components-tooltip.components-popover .components-popover__content{min-width:0}.wc-blocks-components-form-token-field-wrapper .components-tooltip .components-popover__content{background:#1e1e1e;border-radius:2px;border-width:0;box-shadow:none;color:#fff;font-size:12px;line-height:1.4;text-align:center;white-space:nowrap}.wc-blocks-components-form-token-field-wrapper .components-tooltip .components-popover__content>div{padding:4px 8px}.wc-blocks-components-form-token-field-wrapper .components-tooltip__shortcut{display:inline-block;margin-left:8px}.wc-blocks-components-form-token-field-wrapper .disabled-element-wrapper{position:relative}.wc-blocks-components-form-token-field-wrapper .disabled-element-wrapper .event-catcher{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%;z-index:z-index(".components-tooltip .event-catcher")} \ No newline at end of file diff --git a/build/handpicked-products.asset.php b/build/handpicked-products.asset.php new file mode 100644 index 00000000000..dcfc0db2160 --- /dev/null +++ b/build/handpicked-products.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render', 'wp-url'), 'version' => 'ac2f186a72216c4b9eb3e329c0edf86c'); \ No newline at end of file diff --git a/build/handpicked-products.js b/build/handpicked-products.js new file mode 100644 index 00000000000..c5d782ba0e3 --- /dev/null +++ b/build/handpicked-products.js @@ -0,0 +1,8 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["handpicked-products"]=function(e){function t(t){for(var r,l,i=t[0],a=t[1],s=t[2],d=0,b=[];dt=>{let{selected:c,...r}=t;const[u,d]=Object(o.useState)(!0),[b,g]=Object(o.useState)(null),[m,p]=Object(o.useState)([]),h=l.o.productCount>100,E=async e=>{const t=await Object(s.a)(e);g(t),d(!1)},O=Object(o.useRef)(c);Object(o.useEffect)(()=>{Object(i.h)({selected:O.current}).then(e=>{p(e),d(!1)}).catch(E)},[O]);const j=Object(a.a)(e=>{Object(i.h)({selected:c,search:e}).then(e=>{p(e),d(!1)}).catch(E)},400),w=Object(o.useCallback)(e=>{d(!0),j(e)},[d,j]);return Object(o.createElement)(e,n()({},r,{selected:c,error:b,products:m,isLoading:u,onSearch:h?w:null}))}},19:function(e,t,c){"use strict";c.d(t,"a",(function(){return l})),c.d(t,"c",(function(){return a})),c.d(t,"d",(function(){return s})),c.d(t,"b",(function(){return u}));var r=c(0),n=c(7),o=c(1);const l={clear:Object(o.__)("Clear all selected items","woo-gutenberg-products-block"),noItems:Object(o.__)("No items found.","woo-gutenberg-products-block"), +/* Translators: %s search term */ +noResults:Object(o.__)("No results for %s","woo-gutenberg-products-block"),search:Object(o.__)("Search for items","woo-gutenberg-products-block"),selected:e=>Object(o.sprintf)( +/* translators: Number of items selected from list. */ +Object(o._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(o.__)("Search results updated.","woo-gutenberg-products-block")},i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(n.groupBy)(e,"parent"),r=Object(n.keyBy)(t,"id"),o=["0"],l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=l(r[e.parent]);return[...t,e.name]},i=e=>e.map(e=>{const t=c[e.id];return o.push(""+e.id),{...e,breadcrumbs:l(r[e.parent]),children:t&&t.length?i(t):[]}}),a=i(c[0]||[]);return Object.entries(c).forEach(e=>{let[t,c]=e;o.includes(t)||a.push(...i(c||[]))}),a},a=(e,t,c)=>{if(!t)return c?i(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),n=e.map(e=>!!r.test(e.name)&&e).filter(Boolean);return c?i(n,e):n},s=(e,t)=>{if(!t)return e;const c=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(c).map((e,t)=>c.test(e)?Object(r.createElement)("strong",{key:t},e):Object(r.createElement)(r.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},2:function(e,t){e.exports=window.wc.wcSettings},23:function(e,t,c){"use strict";c.d(t,"o",(function(){return o})),c.d(t,"m",(function(){return l})),c.d(t,"l",(function(){return i})),c.d(t,"n",(function(){return a})),c.d(t,"j",(function(){return s})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return d})),c.d(t,"g",(function(){return b})),c.d(t,"k",(function(){return g})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return p})),c.d(t,"h",(function(){return h})),c.d(t,"a",(function(){return E})),c.d(t,"i",(function(){return O})),c.d(t,"b",(function(){return j}));var r,n=c(2);const o=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),l=o.pluginUrl+"images/",i=o.pluginUrl+"build/",a=o.buildPhase,s=null===(r=n.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=n.STORE_PAGES.checkout.id,d=n.STORE_PAGES.checkout.permalink,b=n.STORE_PAGES.privacy.permalink,g=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),m=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),p=n.STORE_PAGES.cart.permalink,h=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),E=Object(n.getSetting)("allowedCountries",{}),O=Object(n.getSetting)("shippingStates",{}),j=Object(n.getSetting)("allowedStates",{})},25:function(e,t,c){"use strict";c.d(t,"h",(function(){return s})),c.d(t,"e",(function(){return u})),c.d(t,"b",(function(){return d})),c.d(t,"i",(function(){return b})),c.d(t,"f",(function(){return g})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return p})),c.d(t,"g",(function(){return h})),c.d(t,"a",(function(){return E}));var r=c(15),n=c(14),o=c.n(n),l=c(7),i=c(2),a=c(23);const s=e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const i=(e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const o=a.o.productCount>100,l={per_page:o?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},i=[Object(r.addQueryArgs)("/wc/store/v1/products",{...l,...n})];return o&&t.length&&i.push(Object(r.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),i})({selected:t,search:c,queryArgs:n});return Promise.all(i.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>o()({path:"/wc/store/v1/products/"+e}),d=()=>o()({path:"wc/store/v1/products/attributes"}),b=e=>o()({path:`wc/store/v1/products/attributes/${e}/terms`}),g=e=>{let{selected:t=[],search:c}=e;const n=(e=>{let{selected:t=[],search:c}=e;const n=Object(i.getSetting)("limitTags",!1),o=[Object(r.addQueryArgs)("wc/store/v1/products/tags",{per_page:n?100:0,orderby:n?"count":"name",order:n?"desc":"asc",search:c})];return n&&t.length&&o.push(Object(r.addQueryArgs)("wc/store/v1/products/tags",{include:t})),o})({selected:t,search:c});return Promise.all(n.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id"))},m=e=>o()({path:Object(r.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),p=e=>o()({path:"wc/store/v1/products/categories/"+e}),h=e=>o()({path:Object(r.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),E=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},27:function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return l}));var r=c(1),n=c(13);const o=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},l=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(n.decodeEntities)(e.message):Object(r.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},271:function(e){e.exports=JSON.parse('{"name":"woocommerce/handpicked-products","title":"Hand-picked Products","category":"woocommerce","keywords":["Handpicked Products","WooCommerce"],"description":"Display a selection of hand-picked products in a grid.","supports":{"align":["wide","full"],"html":false},"attributes":{"align":{"type":"string"},"columns":{"type":"number","default":3},"contentVisibility":{"type":"object","default":{"image":true,"title":true,"price":true,"rating":true,"button":true},"properties":{"image":{"type":"boolean","image":true},"title":{"type":"boolean","title":true},"price":{"type":"boolean","price":true},"rating":{"type":"boolean","rating":true},"button":{"type":"boolean","button":true}}},"orderby":{"type":"string","enum":["date","popularity","price_asc","price_desc","rating","title","menu_order"],"default":"date"},"products":{"type":"array","default":[]},"alignButtons":{"type":"boolean","default":false},"isPreview":{"type":"boolean","default":false}},"textdomain":"woo-gutenberg-products-block","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},296:function(e,t){},3:function(e,t){e.exports=window.wp.components},32:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(33);t.a=e=>{let{error:t}=e;return Object(r.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:c}=e;return t?"general"===c?Object(r.createElement)("span",null,Object(n.__)("The following error was returned","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(o.escapeHTML)(t))):"api"===c?Object(r.createElement)("span",null,Object(n.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(o.escapeHTML)(t))):t:Object(n.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},33:function(e,t){e.exports=window.wp.escapeHtml},350:function(e,t,c){e.exports=c(464)},36:function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var r=c(6),n=c.n(r),o=c(0),l=c(19);const i=e=>{let{countLabel:t,className:c,depth:r=0,controlId:i="",item:a,isSelected:s,isSingle:u,onSelect:d,search:b="",...g}=e;const m=null!=t&&void 0!==a.count&&null!==a.count,p=[c,"woocommerce-search-list__item"];p.push("depth-"+r),u&&p.push("is-radio-button"),m&&p.push("has-count");const h=a.breadcrumbs&&a.breadcrumbs.length,E=g.name||"search-list-item-"+i,O=`${E}-${a.id}`;return Object(o.createElement)("label",{htmlFor:O,className:p.join(" ")},u?Object(o.createElement)("input",n()({type:"radio",id:O,name:E,value:a.value,onChange:d(a),checked:s,className:"woocommerce-search-list__item-input"},g)):Object(o.createElement)("input",n()({type:"checkbox",id:O,name:E,value:a.value,onChange:d(a),checked:s,className:"woocommerce-search-list__item-input"},g)),Object(o.createElement)("span",{className:"woocommerce-search-list__item-label"},h?Object(o.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(l.b)(a.breadcrumbs)):null,Object(o.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(l.d)(a.name,b))),!!m&&Object(o.createElement)("span",{className:"woocommerce-search-list__item-count"},t||a.count))};t.b=i},464:function(e,t,c){"use strict";c.r(t);var r=c(0),n=c(8),o=c(2),l=c(113),i=c(496),a=(c(296),c(271)),s=c(6),u=c.n(s),d=c(5),b=c(3),g=c(1),m=c(62),p=c(98),h=c(97),E=c(176),O=c(32);const j=e=>{let{error:t,onChange:c,onSearch:n,selected:o,products:l,isLoading:i,isCompact:a}=e;const s={clear:Object(g.__)("Clear all products","woo-gutenberg-products-block"),list:Object(g.__)("Products","woo-gutenberg-products-block"),noItems:Object(g.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(g.__)("Search for products to display","woo-gutenberg-products-block"),selected:e=>Object(g.sprintf)( +/* translators: %d is the number of selected products. */ +Object(g._n)("%d product selected","%d products selected",e,"woo-gutenberg-products-block"),e),updated:Object(g.__)("Product search results updated.","woo-gutenberg-products-block")};return t?Object(r.createElement)(O.a,{error:t}):Object(r.createElement)(h.a,{className:"woocommerce-products",list:l.map(e=>{const t=e.sku?" ("+e.sku+")":"";return{...e,name:`${e.name}${t}`}}),isCompact:a,isLoading:i,selected:l.filter(e=>{let{id:t}=e;return o.includes(t)}),onSearch:n,onChange:c,messages:s})};j.defaultProps={selected:[],products:[],isCompact:!1,isLoading:!0};var w=Object(E.a)(j);const f=e=>{const{attributes:t,setAttributes:c}=e,{columns:n,contentVisibility:l,orderby:i,alignButtons:a}=t;return Object(r.createElement)(d.InspectorControls,{key:"inspector"},Object(r.createElement)(b.PanelBody,{title:Object(g.__)("Layout","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(b.RangeControl,{label:Object(g.__)("Columns","woo-gutenberg-products-block"),value:n,onChange:e=>c({columns:e}),min:Object(o.getSetting)("min_columns",1),max:Object(o.getSetting)("max_columns",6)}),Object(r.createElement)(b.ToggleControl,{label:Object(g.__)("Align Buttons","woo-gutenberg-products-block"),help:a?Object(g.__)("Buttons are aligned vertically.","woo-gutenberg-products-block"):Object(g.__)("Buttons follow content.","woo-gutenberg-products-block"),checked:a,onChange:()=>c({alignButtons:!a})})),Object(r.createElement)(b.PanelBody,{title:Object(g.__)("Content","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(m.a,{settings:l,onChange:e=>c({contentVisibility:e})})),Object(r.createElement)(b.PanelBody,{title:Object(g.__)("Order By","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(p.a,{setAttributes:c,value:i})),Object(r.createElement)(b.PanelBody,{title:Object(g.__)("Products","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(w,{selected:t.products,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e.map(e=>{let{id:t}=e;return t});c({products:t})},isCompact:!0})))},_=e=>{const{attributes:t,setAttributes:c,debouncedSpeak:n,isEditing:o,setIsEditing:a}=e;return Object(r.createElement)(b.Placeholder,{icon:Object(r.createElement)(l.a,{icon:i.a}),label:Object(g.__)("Hand-picked Products","woo-gutenberg-products-block"),className:"wc-block-products-grid wc-block-handpicked-products"},Object(g.__)("Display a selection of hand-picked products in a grid.","woo-gutenberg-products-block"),Object(r.createElement)("div",{className:"wc-block-handpicked-products__selection"},Object(r.createElement)(w,{selected:t.products,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e.map(e=>{let{id:t}=e;return t});c({products:t})}}),Object(r.createElement)(b.Button,{isPrimary:!0,onClick:()=>{a(!o),n(Object(g.__)("Showing Hand-picked Products block preview.","woo-gutenberg-products-block"))}},Object(g.__)("Done","woo-gutenberg-products-block"))))};var y=c(55),x=c.n(y),k=c(141);const v=e=>{const{attributes:t,name:c}=e;return t.isPreview?k.a:Object(r.createElement)(x.a,{block:c,attributes:t})},S=Object(b.withSpokenMessages)(e=>{const t=Object(d.useBlockProps)(),{attributes:{products:c}}=e,[n,o]=Object(r.useState)(!c.length);return Object(r.createElement)("div",t,Object(r.createElement)(d.BlockControls,null,Object(r.createElement)(b.ToolbarGroup,{controls:[{icon:"edit",title:Object(g.__)("Edit selected products","woo-gutenberg-products-block"),onClick:()=>o(!n),isActive:n}]})),Object(r.createElement)(f,e),n?Object(r.createElement)(_,u()({isEditing:n,setIsEditing:o},e)):Object(r.createElement)(b.Disabled,null,Object(r.createElement)(v,e)))});Object(n.registerBlockType)(a,{icon:{src:Object(r.createElement)(l.a,{icon:i.a,className:"wc-block-editor-components-block-icon"})},attributes:{...a.attributes,columns:{type:"number",default:Object(o.getSetting)("default_columns",3)}},edit:S,save:()=>null})},5:function(e,t){e.exports=window.wp.blockEditor},55:function(e,t){e.exports=window.wp.serverSideRender},62:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(3);t.a=e=>{let{onChange:t,settings:c}=e;const{image:l,button:i,price:a,rating:s,title:u}=c,d=!1!==l;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product image","woo-gutenberg-products-block"),help:d?Object(n.__)("Product image is visible.","woo-gutenberg-products-block"):Object(n.__)("Product image is hidden.","woo-gutenberg-products-block"),checked:d,onChange:()=>t({...c,image:!d})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product title","woo-gutenberg-products-block"),help:u?Object(n.__)("Product title is visible.","woo-gutenberg-products-block"):Object(n.__)("Product title is hidden.","woo-gutenberg-products-block"),checked:u,onChange:()=>t({...c,title:!u})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product price","woo-gutenberg-products-block"),help:a?Object(n.__)("Product price is visible.","woo-gutenberg-products-block"):Object(n.__)("Product price is hidden.","woo-gutenberg-products-block"),checked:a,onChange:()=>t({...c,price:!a})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product rating","woo-gutenberg-products-block"),help:s?Object(n.__)("Product rating is visible.","woo-gutenberg-products-block"):Object(n.__)("Product rating is hidden.","woo-gutenberg-products-block"),checked:s,onChange:()=>t({...c,rating:!s})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Add to Cart button","woo-gutenberg-products-block"),help:i?Object(n.__)("Add to Cart button is visible.","woo-gutenberg-products-block"):Object(n.__)("Add to Cart button is hidden.","woo-gutenberg-products-block"),checked:i,onChange:()=>t({...c,button:!i})}))}},7:function(e,t){e.exports=window.lodash},8:function(e,t){e.exports=window.wp.blocks},97:function(e,t,c){"use strict";c.d(t,"a",(function(){return y}));var r=c(6),n=c.n(r),o=c(0),l=c(1),i=c(3),a=c(113),s=c(498),u=c(4),d=c.n(u),b=c(10),g=c(19),m=c(36),p=c(497),h=c(13);const E=e=>{let{id:t,label:c,popoverContents:r,remove:n,screenReaderLabel:s,className:u=""}=e;const[g,m]=Object(o.useState)(!1),O=Object(b.useInstanceId)(E);if(s=s||c,!c)return null;c=Object(h.decodeEntities)(c);const j=d()("woocommerce-tag",u,{"has-remove":!!n}),w="woocommerce-tag__label-"+O,f=Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},s),Object(o.createElement)("span",{"aria-hidden":"true"},c));return Object(o.createElement)("span",{className:j},r?Object(o.createElement)(i.Button,{className:"woocommerce-tag__text",id:w,onClick:()=>m(!0)},f):Object(o.createElement)("span",{className:"woocommerce-tag__text",id:w},f),r&&g&&Object(o.createElement)(i.Popover,{onClose:()=>m(!1)},r),n&&Object(o.createElement)(i.Button,{className:"woocommerce-tag__remove",onClick:n(t),label:Object(l.sprintf)(// Translators: %s label. +Object(l.__)("Remove %s","woo-gutenberg-products-block"),c),"aria-describedby":w},Object(o.createElement)(a.a,{icon:p.a,size:20,className:"clear-icon"})))};var O=E;const j=e=>Object(o.createElement)(m.b,e),w=e=>{const{list:t,selected:c,renderItem:r,depth:l=0,onSelect:i,instanceId:a,isSingle:s,search:u}=e;return t?Object(o.createElement)(o.Fragment,null,t.map(t=>{const d=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(o.createElement)(o.Fragment,{key:t.id},Object(o.createElement)("li",null,r({item:t,isSelected:d,onSelect:i,isSingle:s,search:u,depth:l,controlId:a})),Object(o.createElement)(w,n()({},e,{list:t.children,depth:l+1})))})):null},f=e=>{let{isLoading:t,isSingle:c,selected:r,messages:n,onChange:a,onRemove:s}=e;if(t||c||!r)return null;const u=r.length;return Object(o.createElement)("div",{className:"woocommerce-search-list__selected"},Object(o.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(o.createElement)("strong",null,n.selected(u)),u>0?Object(o.createElement)(i.Button,{isLink:!0,isDestructive:!0,onClick:()=>a([]),"aria-label":n.clear},Object(l.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(o.createElement)("ul",null,r.map((e,t)=>Object(o.createElement)("li",{key:t},Object(o.createElement)(O,{label:e.name,id:e.id,remove:s})))):null)},_=e=>{let{filteredList:t,search:c,onSelect:r,instanceId:n,...i}=e;const{messages:u,renderItem:d,selected:b,isSingle:g}=i,m=d||j;return 0===t.length?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(o.createElement)(a.a,{icon:s.a})),Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(l.sprintf)(u.noResults,c):u.noItems)):Object(o.createElement)("ul",{className:"woocommerce-search-list__list"},Object(o.createElement)(w,{list:t,selected:b,renderItem:m,onSelect:r,instanceId:n,isSingle:g,search:c}))},y=e=>{const{className:t="",isCompact:c,isHierarchical:r,isLoading:l,isSingle:a,list:s,messages:u=g.a,onChange:m,onSearch:p,selected:h,debouncedSpeak:E}=e,[O,j]=Object(o.useState)(""),w=Object(b.useInstanceId)(y),x=Object(o.useMemo)(()=>({...g.a,...u}),[u]),k=Object(o.useMemo)(()=>Object(g.c)(s,O,r),[s,O,r]);Object(o.useEffect)(()=>{E&&E(x.updated)},[E,x]),Object(o.useEffect)(()=>{"function"==typeof p&&p(O)},[O,p]);const v=Object(o.useCallback)(e=>()=>{a&&m([]);const t=h.findIndex(t=>{let{id:c}=t;return c===e});m([...h.slice(0,t),...h.slice(t+1)])},[a,h,m]),S=Object(o.useCallback)(e=>()=>{-1===h.findIndex(t=>{let{id:c}=t;return c===e.id})?m(a?[e]:[...h,e]):v(e.id)()},[a,v,m,h]);return Object(o.createElement)("div",{className:d()("woocommerce-search-list",t,{"is-compact":c})},Object(o.createElement)(f,n()({},e,{onRemove:v,messages:x})),Object(o.createElement)("div",{className:"woocommerce-search-list__search"},Object(o.createElement)(i.TextControl,{label:x.search,type:"search",value:O,onChange:e=>j(e)})),l?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(o.createElement)(i.Spinner,null)):Object(o.createElement)(_,n()({},e,{search:O,filteredList:k,messages:x,onSelect:S,instanceId:w})))};Object(i.withSpokenMessages)(y)},98:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(3);t.a=e=>{let{value:t,setAttributes:c}=e;return Object(r.createElement)(o.SelectControl,{label:Object(n.__)("Order products by","woo-gutenberg-products-block"),value:t,options:[{label:Object(n.__)("Newness - newest first","woo-gutenberg-products-block"),value:"date"},{label:Object(n.__)("Price - low to high","woo-gutenberg-products-block"),value:"price_asc"},{label:Object(n.__)("Price - high to low","woo-gutenberg-products-block"),value:"price_desc"},{label:Object(n.__)("Rating - highest first","woo-gutenberg-products-block"),value:"rating"},{label:Object(n.__)("Sales - most first","woo-gutenberg-products-block"),value:"popularity"},{label:Object(n.__)("Title - alphabetical","woo-gutenberg-products-block"),value:"title"},{label:Object(n.__)("Menu Order","woo-gutenberg-products-block"),value:"menu_order"}],onChange:e=>c({orderby:e})})}}}); \ No newline at end of file diff --git a/build/handpicked-products/block.json b/build/handpicked-products/block.json new file mode 100644 index 00000000000..b6819377598 --- /dev/null +++ b/build/handpicked-products/block.json @@ -0,0 +1,80 @@ +{ + "name": "woocommerce/handpicked-products", + "title": "Hand-picked Products", + "category": "woocommerce", + "keywords": [ "Handpicked Products", "WooCommerce" ], + "description": "Display a selection of hand-picked products in a grid.", + "supports": { + "align": [ "wide", "full" ], + "html": false + }, + "attributes": { + "align": { + "type": "string" + }, + "columns": { + "type": "number", + "default": 3 + }, + "contentVisibility": { + "type": "object", + "default": { + "image": true, + "title": true, + "price": true, + "rating": true, + "button": true + }, + "properties": { + "image": { + "type": "boolean", + "image": true + }, + "title": { + "type": "boolean", + "title": true + }, + "price": { + "type": "boolean", + "price": true + }, + "rating": { + "type": "boolean", + "rating": true + }, + "button": { + "type": "boolean", + "button": true + } + } + }, + "orderby": { + "type": "string", + "enum": [ + "date", + "popularity", + "price_asc", + "price_desc", + "rating", + "title", + "menu_order" + ], + "default": "date" + }, + "products": { + "type": "array", + "default": [] + }, + "alignButtons": { + "type": "boolean", + "default": false + }, + "isPreview": { + "type": "boolean", + "default": false + } + }, + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2, + "$schema": "https://schemas.wp.org/trunk/block.json" +} diff --git a/build/legacy-template.asset.php b/build/legacy-template.asset.php new file mode 100644 index 00000000000..26b0a3964cd --- /dev/null +++ b/build/legacy-template.asset.php @@ -0,0 +1 @@ + array('wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '27d5ac9de1c02463b4a480f79a8ba412'); \ No newline at end of file diff --git a/build/legacy-template.js b/build/legacy-template.js new file mode 100644 index 00000000000..9f2b5329c94 --- /dev/null +++ b/build/legacy-template.js @@ -0,0 +1,3 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["legacy-template"]=function(e){function t(t){for(var c,l,i=t[0],u=t[1],a=t[2],p=0,d=[];p{var t,o,p,b;let{clientId:f,attributes:g,setAttributes:w}=e;const{replaceBlock:O}=Object(d.useDispatch)("core/block-editor"),h=Object(i.useBlockProps)(),k=null!==(t=null===(o=m[g.template])||void 0===o?void 0:o.title)&&void 0!==t?t:g.template,v=null!==(p=null===(b=m[g.template])||void 0===b?void 0:b.placeholder)&&void 0!==p?p:"fallback";return Object(c.useEffect)(()=>{var e;return w({template:g.template,align:null!==(e=g.align)&&void 0!==e?e:"wide"})},[g.align,g.template,w]),Object(c.createElement)("div",h,Object(c.createElement)(u.Placeholder,{icon:s.a,label:k,className:"wp-block-woocommerce-classic-template__placeholder"},Object(c.createElement)("div",{className:"wp-block-woocommerce-classic-template__placeholder-copy"},Object(c.createElement)("p",{className:"wp-block-woocommerce-classic-template__placeholder-warning"},Object(c.createElement)("strong",null,Object(a.__)("Attention: Do not remove this block!","woo-gutenberg-products-block"))," ",Object(a.__)("Removal will cause unintended effects on your store.","woo-gutenberg-products-block")),Object(c.createElement)("p",null,Object(a.sprintf)( +/* translators: %s is the template title */ +Object(a.__)("This is an editor placeholder for the %s. On your store this will be replaced by the template and display with your product image(s), title, price, etc. You can move this placeholder around and add further blocks around it to extend the template.","woo-gutenberg-products-block"),k))),Object(c.createElement)("div",{className:"wp-block-woocommerce-classic-template__placeholder-wireframe"},Object(n.a)()&&Object(c.createElement)("div",{className:"wp-block-woocommerce-classic-template__placeholder-migration-button-container"},Object(c.createElement)(u.Button,{isPrimary:!0,onClick:()=>{O(f,Object(r.createBlock)("core/paragraph",{content:"Instead of this block, the new Product Grid Block will be rendered"}))},text:Object(a.__)("Use the blockified Product Grid Block","woo-gutenberg-products-block")})),Object(c.createElement)("img",{className:"wp-block-woocommerce-classic-template__placeholder-image",src:`${l.m}template-placeholders/${v}.svg`,alt:k}))))},g=Object.keys(m),w=e=>{let{template:t,inserter:o}=e;Object(r.registerBlockType)(b,{title:t?m[t].title:Object(a.__)("WooCommerce Classic Template","woo-gutenberg-products-block"),icon:Object(c.createElement)(p.a,{icon:s.a,className:"wc-block-editor-components-block-icon"}),category:"woocommerce",apiVersion:2,keywords:[Object(a.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(a.__)("Renders classic WooCommerce PHP templates.","woo-gutenberg-products-block"),supports:{align:["wide","full"],html:!1,multiple:!1,reusable:!1,inserter:o},example:{attributes:{isPreview:!0}},attributes:{template:{type:"string",default:"any"},align:{type:"string",default:"wide"}},edit:e=>{let{attributes:o,clientId:r,setAttributes:n}=e;const l=null!=t?t:o.template;return Object(c.createElement)(f,{attributes:{...o,template:l},setAttributes:n,clientId:r})},save:()=>null})},O=e=>g.includes(e);let h;Object(n.a)()?Object(d.subscribe)(()=>{var e;const t=h,o=Object(d.select)("core/edit-site");if(h=null==o?void 0:o.getEditedPostId(),t===h)return;const c=null===(e=h)||void 0===e?void 0:e.split("//")[1];if(null==c)return;const n=Object(r.getBlockType)(b);if(void 0!==n&&(!O(c)||((e,t)=>(null==e?void 0:e.title)!==m[t].title)(n,c)))return Object(r.unregisterBlockType)(b),void(h=void 0);void 0===n&&O(c)&&w({template:c,inserter:!0})}):w({inserter:!1})},5:function(e,t){e.exports=window.wp.blockEditor},8:function(e,t){e.exports=window.wp.blocks},9:function(e,t){e.exports=window.wp.data},95:function(e,t,o){"use strict";o.d(t,"c",(function(){return n})),o.d(t,"a",(function(){return l})),o.d(t,"b",(function(){return i}));var c=o(8),r=o(23);const n=(e,t)=>{if(r.n>2)return Object(c.registerBlockType)(e,t)},l=()=>r.n>2,i=()=>r.n>1}}); \ No newline at end of file diff --git a/build/mini-cart-component-frontend.asset.php b/build/mini-cart-component-frontend.asset.php new file mode 100644 index 00000000000..71af11ba9cd --- /dev/null +++ b/build/mini-cart-component-frontend.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-autop', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '7d40eb9d493115b9f90efa0a854bb6b2'); \ No newline at end of file diff --git a/build/mini-cart-component-frontend.js b/build/mini-cart-component-frontend.js new file mode 100644 index 00000000000..52a6b1ec591 --- /dev/null +++ b/build/mini-cart-component-frontend.js @@ -0,0 +1,5 @@ +!function(e){function t(t){for(var r,o,c=t[0],a=t[1],i=0,l=[];i{let{imageUrl:t=s.l+"/block-error.svg",header:r=Object(i.__)("Oops!","woo-gutenberg-products-block"),text:n=Object(i.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:a=Object(i.__)("Error:","woo-gutenberg-products-block"),button:l,showErrorBlock:u=!0}=e;return u?Object(c.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(c.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(c.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(c.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),n&&Object(c.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},n),o&&Object(c.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},a?a+" ":"",o),l&&Object(c.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};r(35);class u extends a.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(c.createElement)(c.Fragment,null,Object(c.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:n=!0,text:o,errorMessagePrefix:a,renderError:i,button:s}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof i?i({errorMessage:u}):Object(c.createElement)(l,{showErrorBlock:n,errorMessage:r?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:a,button:s}):this.props.children}}t.a=u},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){e.exports=window.wp.htmlEntities},function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return o}));const n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return n(e)&&t in e}},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},,,,function(e,t){e.exports=window.wp.a11y},,function(e,t){e.exports=window.wp.deprecated},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0);r(7);const o=Object(n.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),c=()=>Object(n.useContext)(o)},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return k}));var n=r(3),o=r(0),c=r(6),a=r(7),i=r(17),s=r(118),l=r(29),u=r(70);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(a.dispatch)(c.CART_STORE_KEY).invalidateResolutionForStore()},p=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},m=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.b)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.b)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),p),[])},f={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},b={...f,email:""},g={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:c.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},h=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,r]=e;return[t,Object(i.decodeEntities)(r)]})),y={cartCoupons:c.EMPTY_CART_COUPONS,cartItems:c.EMPTY_CART_ITEMS,cartFees:c.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:c.EMPTY_CART_ITEM_ERRORS,cartTotals:g,cartIsLoading:!0,cartErrors:c.EMPTY_CART_ERRORS,billingAddress:b,shippingAddress:f,shippingRates:c.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:c.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:c.EMPTY_EXTENSIONS},k=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:r}=Object(l.a)(),i=null==r?void 0:r.previewCart,{shouldSelect:u}=e,d=Object(o.useRef)();m();const p=Object(a.useSelect)((e,r)=>{let{dispatch:n}=r;if(!u)return y;if(t)return{cartCoupons:i.coupons,cartItems:i.items,cartFees:i.fees,cartItemsCount:i.items_count,cartItemsWeight:i.items_weight,cartNeedsPayment:i.needs_payment,cartNeedsShipping:i.needs_shipping,cartItemErrors:c.EMPTY_CART_ITEM_ERRORS,cartTotals:i.totals,cartIsLoading:!1,cartErrors:c.EMPTY_CART_ERRORS,billingData:b,billingAddress:b,shippingAddress:f,extensions:c.EMPTY_EXTENSIONS,shippingRates:i.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:i.has_calculated_shipping,paymentRequirements:i.paymentRequirements,receiveCart:"function"==typeof(null==i?void 0:i.receiveCart)?i.receiveCart:()=>{}};const o=e(c.CART_STORE_KEY),a=o.getCartData(),l=o.getCartErrors(),d=o.getCartTotals(),p=!o.hasFinishedResolution("getCartData"),m=o.isCustomerDataUpdating(),{receiveCart:g}=n(c.CART_STORE_KEY),k=h(a.billingAddress),w=a.needsShipping?h(a.shippingAddress):k,v=a.fees.length>0?a.fees.map(e=>h(e)):c.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map(e=>({...e,label:e.code})):c.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:v,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:d,cartIsLoading:p,cartErrors:l,billingData:Object(s.a)(k),billingAddress:Object(s.a)(k),shippingAddress:Object(s.a)(w),extensions:a.extensions,shippingRates:a.shippingRates,isLoadingRates:m,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:g}},[u]);return d.current&&Object(n.isEqual)(d.current,p)||(d.current=p),d.current}},,,function(e,t){},,function(e,t){e.exports=window.wp.warning},,,,function(e,t){e.exports=window.wc.priceFormat},,function(e,t){e.exports=window.wp.hooks},function(e,t){e.exports=window.wp.dom},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"string"==typeof e},,,function(e,t,r){"use strict";r.d(t,"n",(function(){return c})),r.d(t,"l",(function(){return a})),r.d(t,"k",(function(){return i})),r.d(t,"m",(function(){return s})),r.d(t,"i",(function(){return l})),r.d(t,"d",(function(){return u})),r.d(t,"f",(function(){return d})),r.d(t,"j",(function(){return p})),r.d(t,"c",(function(){return m})),r.d(t,"e",(function(){return f})),r.d(t,"g",(function(){return b})),r.d(t,"a",(function(){return g})),r.d(t,"h",(function(){return h})),r.d(t,"b",(function(){return y}));var n,o=r(2);const c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",i=c.pluginUrl+"build/",s=c.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),m=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),f=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),b=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),y=Object(o.getSetting)("allowedStates",{})},function(e,t,r){"use strict";var n=r(2),o=r(1),c=r(72),a=r(45);const i=Object(n.getSetting)("countryLocale",{}),s=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(o.sprintf)( +/* translators: %s Field label. */ +Object(o.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(c.a)(e.priority)&&(t.index=e.priority),Object(a.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},l=Object.entries(i).map(e=>{let[t,r]=e;return[t,Object.entries(r).map(e=>{let[t,r]=e;return[t,s(r)]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{})]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{});t.a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=r&&void 0!==l[r]?l[r]:{};return e.map(e=>({key:e,...n.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},,function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(5);function o(e,t,r){var o=this,c=Object(n.useRef)(null),a=Object(n.useRef)(0),i=Object(n.useRef)(null),s=Object(n.useRef)([]),l=Object(n.useRef)(),u=Object(n.useRef)(),d=Object(n.useRef)(e),p=Object(n.useRef)(!0);d.current=e;var m=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var f=!!(r=r||{}).leading,b=!("trailing"in r)||!!r.trailing,g="maxWait"in r,h=g?Math.max(+r.maxWait||0,t):null;return Object(n.useEffect)((function(){return p.current=!0,function(){p.current=!1}}),[]),Object(n.useMemo)((function(){var e=function(e){var t=s.current,r=l.current;return s.current=l.current=null,a.current=e,u.current=d.current.apply(r,t)},r=function(e,t){m&&cancelAnimationFrame(i.current),i.current=m?requestAnimationFrame(e):setTimeout(e,t)},n=function(e){if(!p.current)return!1;var r=e-c.current,n=e-a.current;return!c.current||r>=t||r<0||g&&n>=h},y=function(t){return i.current=null,b&&s.current?e(t):(s.current=l.current=null,u.current)},k=function(){var e=Date.now();if(n(e))return y(e);if(p.current){var o=e-c.current,i=e-a.current,s=t-o,l=g?Math.min(s,h-i):s;r(k,l)}},w=function(){for(var d=[],m=0;m{let{Block:t,containers:r,getProps:n=(()=>({})),getErrorBoundaryProps:i=(()=>({}))}=e;0!==r.length&&Array.prototype.forEach.call(r,(e,r)=>{const s=n(e,r),l=i(e,r),u={...e.dataset,...s.attributes||{}};(e=>{let{Block:t,container:r,attributes:n={},props:i={},errorBoundaryProps:s={}}=e;Object(c.render)(Object(c.createElement)(a.a,s,Object(c.createElement)(c.Suspense,{fallback:Object(c.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(c.createElement)(t,o()({},i,{attributes:n})))),r,()=>{r.classList&&r.classList.remove("is-loading")})})({Block:t,container:e,props:s,attributes:u,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(i.join(",")),{Block:r,getProps:n,getErrorBoundaryProps:o,selector:c}=e;(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrappers:c}=e;const a=document.body.querySelectorAll(o);c&&c.length>0&&Array.prototype.filter.call(a,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,c)),s({Block:t,containers:a,getProps:r,getErrorBoundaryProps:n})})({Block:r,getProps:n,getErrorBoundaryProps:o,selector:c,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrapper:c}=e;const a=c.querySelectorAll(o);s({Block:t,containers:a,getProps:r,getErrorBoundaryProps:n})})({...e,wrapper:t})})})}},function(e,t){e.exports=window.wp.keycodes},,,function(e,t,r){var n=r(83),o=r(57),c=o.setStyleProp,a=n.html,i=n.svg,s=n.isCustomAttribute,l=Object.prototype.hasOwnProperty;e.exports=function(e){var t,r,n,u;e=e||{};var d={};for(t in e)n=e[t],s(t)?d[t]=n:(r=t.toLowerCase(),l.call(a,r)?d[(u=a[r]).propertyName]=!!(u.hasBooleanValue||u.hasOverloadedBooleanValue&&!n)||n:l.call(i,t)?d[(u=i[t]).propertyName]=n:o.PRESERVE_CUSTOM_ATTRIBUTES&&(d[t]=n));return c(e.style,d),d}},function(e,t,r){var n=r(5),o=r(87).default,c={reactCompat:!0},a=n.version.split(".")[0]>=16;e.exports={PRESERVE_CUSTOM_ATTRIBUTES:a,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var r,n,o="function"==typeof t,c={},a={};for(r in e)n=e[r],o&&(c=t(r,n))&&2===c.length?a[c[0]]=c[1]:"string"==typeof n&&(a[n]=r);return a},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){null!=e&&(t.style=o(e,c))}}},function(e,t,r){for(var n,o=r(93).CASE_SENSITIVE_TAG_NAMES,c={},a=0,i=o.length;a{let{bubbles:r=!1,cancelable:o=!1,element:c,detail:a={}}=t;if(!n)return;c||(c=document.body);const i=new n(e,{bubbles:r,cancelable:o,detail:a});c.dispatchEvent(i)};let c;const a=()=>{c&&clearTimeout(c),c=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},i=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},s=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const c=()=>{o(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,c),()=>jQuery(document).off(e,c)}},,function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"number"==typeof e},,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"boolean"==typeof e},,,,,function(e,t,r){var n=r(5),o=r(56),c=r(57),a=c.setStyleProp;function i(e){return c.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&c.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,r){for(var c,s,l,u,d=(r=r||{}).library||n,p=d.cloneElement,m=d.createElement,f=d.isValidElement,b=[],g="function"==typeof r.replace,h=r.trim,y=0,k=t.length;y1&&(s=p(s,{key:s.key||y})),b.push(s);else if("text"!==c.type){switch(l=c.attribs,i(c)?a(l.style,l):l&&(l=o(l)),u=null,c.type){case"script":case"style":c.children[0]&&(l.dangerouslySetInnerHTML={__html:c.children[0].data});break;case"tag":"textarea"===c.name&&c.children[0]?l.defaultValue=c.children[0].data:c.children&&c.children.length&&(u=e(c.children,r));break;default:continue}k>1&&(l.key=y),b.push(m(c.name,l,u))}else h?c.data.trim()&&b.push(c.data):b.push(c.data);return 1===b.length?b[0]:b}},function(e,t,r){var n=r(84),o=r(85),c=r(86),a=c.MUST_USE_PROPERTY,i=c.HAS_BOOLEAN_VALUE,s=c.HAS_NUMERIC_VALUE,l=c.HAS_POSITIVE_NUMERIC_VALUE,u=c.HAS_OVERLOADED_BOOLEAN_VALUE;function d(e,t){return(e&t)===t}function p(e,t,r){var n,o,c,p=e.Properties,m=e.DOMAttributeNames;for(o in p)n=m[o]||(r?o:o.toLowerCase()),c=p[o],t[n]={attributeName:n,propertyName:o,mustUseProperty:d(c,a),hasBooleanValue:d(c,i),hasNumericValue:d(c,s),hasPositiveNumericValue:d(c,l),hasOverloadedBooleanValue:d(c,u)}}var m={};p(n,m);var f={};p(o,f,!0);var b={};p(n,b),p(o,b,!0),e.exports={html:m,svg:f,properties:b,isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"))}},function(e,t){e.exports={Properties:{autoFocus:4,accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:4,allowTransparency:0,alt:0,as:0,async:4,autoComplete:0,autoPlay:4,capture:4,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:5,cite:0,classID:0,className:0,cols:24,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:4,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:4,defer:4,dir:0,disabled:4,download:32,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:4,formTarget:0,frameBorder:0,headers:0,height:0,hidden:4,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:4,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:5,muted:5,name:0,nonce:0,noValidate:4,open:4,optimum:0,pattern:0,placeholder:0,playsInline:4,poster:0,preload:0,profile:0,radioGroup:0,readOnly:4,referrerPolicy:0,rel:0,required:4,reversed:4,role:0,rows:24,rowSpan:8,sandbox:0,scope:0,scoped:4,scrolling:0,seamless:4,selected:5,shape:0,size:24,sizes:0,span:24,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:8,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:4,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"}}},function(e,t){e.exports={Properties:{accentHeight:0,accumulate:0,additive:0,alignmentBaseline:0,allowReorder:0,alphabetic:0,amplitude:0,arabicForm:0,ascent:0,attributeName:0,attributeType:0,autoReverse:0,azimuth:0,baseFrequency:0,baseProfile:0,baselineShift:0,bbox:0,begin:0,bias:0,by:0,calcMode:0,capHeight:0,clip:0,clipPath:0,clipRule:0,clipPathUnits:0,colorInterpolation:0,colorInterpolationFilters:0,colorProfile:0,colorRendering:0,contentScriptType:0,contentStyleType:0,cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:0,direction:0,display:0,divisor:0,dominantBaseline:0,dur:0,dx:0,dy:0,edgeMode:0,elevation:0,enableBackground:0,end:0,exponent:0,externalResourcesRequired:0,fill:0,fillOpacity:0,fillRule:0,filter:0,filterRes:0,filterUnits:0,floodColor:0,floodOpacity:0,focusable:0,fontFamily:0,fontSize:0,fontSizeAdjust:0,fontStretch:0,fontStyle:0,fontVariant:0,fontWeight:0,format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:0,glyphOrientationHorizontal:0,glyphOrientationVertical:0,glyphRef:0,gradientTransform:0,gradientUnits:0,hanging:0,horizAdvX:0,horizOriginX:0,ideographic:0,imageRendering:0,in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:0,kernelUnitLength:0,kerning:0,keyPoints:0,keySplines:0,keyTimes:0,lengthAdjust:0,letterSpacing:0,lightingColor:0,limitingConeAngle:0,local:0,markerEnd:0,markerMid:0,markerStart:0,markerHeight:0,markerUnits:0,markerWidth:0,mask:0,maskContentUnits:0,maskUnits:0,mathematical:0,mode:0,numOctaves:0,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:0,overlineThickness:0,paintOrder:0,panose1:0,pathLength:0,patternContentUnits:0,patternTransform:0,patternUnits:0,pointerEvents:0,points:0,pointsAtX:0,pointsAtY:0,pointsAtZ:0,preserveAlpha:0,preserveAspectRatio:0,primitiveUnits:0,r:0,radius:0,refX:0,refY:0,renderingIntent:0,repeatCount:0,repeatDur:0,requiredExtensions:0,requiredFeatures:0,restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:0,slope:0,spacing:0,specularConstant:0,specularExponent:0,speed:0,spreadMethod:0,startOffset:0,stdDeviation:0,stemh:0,stemv:0,stitchTiles:0,stopColor:0,stopOpacity:0,strikethroughPosition:0,strikethroughThickness:0,string:0,stroke:0,strokeDasharray:0,strokeDashoffset:0,strokeLinecap:0,strokeLinejoin:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0,surfaceScale:0,systemLanguage:0,tableValues:0,targetX:0,targetY:0,textAnchor:0,textDecoration:0,textRendering:0,textLength:0,to:0,transform:0,u1:0,u2:0,underlinePosition:0,underlineThickness:0,unicode:0,unicodeBidi:0,unicodeRange:0,unitsPerEm:0,vAlphabetic:0,vHanging:0,vIdeographic:0,vMathematical:0,values:0,vectorEffect:0,version:0,vertAdvY:0,vertOriginX:0,vertOriginY:0,viewBox:0,viewTarget:0,visibility:0,widths:0,wordSpacing:0,writingMode:0,x:0,xHeight:0,x1:0,x2:0,xChannelSelector:0,xlinkActuate:0,xlinkArcrole:0,xlinkHref:0,xlinkRole:0,xlinkShow:0,xlinkTitle:0,xlinkType:0,xmlBase:0,xmlns:0,xmlnsXlink:0,xmlLang:0,xmlSpace:0,y:0,y1:0,y2:0,yChannelSelector:0,z:0,zoomAndPan:0},DOMAttributeNames:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space"}}},function(e,t){e.exports={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=n(r(88)),c=r(90);t.default=function(e,t){var r={};return e&&"string"==typeof e?(o.default(e,(function(e,n){e&&n&&(r[c.camelCase(e,t)]=n)})),r):r}},function(e,t,r){var n=r(89);e.exports=function(e,t){var r,o=null;if(!e||"string"!=typeof e)return o;for(var c,a,i=n(e),s="function"==typeof t,l=0,u=i.length;l/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t,r=e.match(i);return r&&r[1]&&(t=r[1],a&&(e=e.replace(r[0],""))),c(n(e),null,t)}},function(e,t,r){var n=r(58),o=/<([a-zA-Z]+[0-9]?)/,c=//i,a=//i,i=/<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\/?>/gi,s=n.isIE(9),l=s||n.isIE(),u=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},d=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")};if("function"==typeof window.DOMParser){var p=new window.DOMParser,m=s?"text/xml":"text/html";u=d=function(e,t){return t&&(e="<"+t+">"+e+""),s&&(e=e.replace(i,"<$1$2$3/>")),p.parseFromString(e,m)}}if(document.implementation){var f=document.implementation.createHTMLDocument(l?"html-dom-parser":void 0);u=function(e,t){if(t)return f.documentElement.getElementsByTagName(t)[0].innerHTML=e,f;try{return f.documentElement.innerHTML=e,f}catch(t){if(d)return d(e)}}}var b,g=document.createElement("template");g.content&&(b=function(e){return g.innerHTML=e,g.content.childNodes}),e.exports=function(e){var t,r,n,i,s=e.match(o);switch(s&&s[1]&&(t=s[1].toLowerCase()),t){case"html":return r=d(e),c.test(e)||(n=r.getElementsByTagName("head")[0])&&n.parentNode.removeChild(n),a.test(e)||(n=r.getElementsByTagName("body")[0])&&n.parentNode.removeChild(n),r.getElementsByTagName("html");case"head":case"body":return i=u(e).getElementsByTagName(t),a.test(e)&&c.test(e)?i[0].parentNode.childNodes:i;default:return b?b(e):u(e,"body").getElementsByTagName("body")[0].childNodes}}},function(e,t){e.exports={CASE_SENSITIVE_TAG_NAMES:["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]}},,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(5),o=r(51);function c(e,t){return e===t}function a(e){return"function"==typeof e?function(){return e}:e}function i(e,t,r){var i=r&&r.equalityFn||c,s=function(e){var t=Object(n.useState)(a(e)),r=t[0],o=t[1];return[r,Object(n.useCallback)((function(e){return o(a(e))}),[])]}(e),l=s[0],u=s[1],d=Object(o.a)(Object(n.useCallback)((function(e){return u(e)}),[u]),t,r),p=Object(n.useRef)(e);return i(p.current,e)||(d(e),p.current=e),[l,d]}},,,,,,,,,,,,,,,function(e,t){e.exports=window.wp.wordcount},function(e,t){e.exports=window.wp.autop},function(e,t,r){"use strict";var n=r(0);t.a=function(e){let{icon:t,size:r=24,...o}=e;return Object(n.cloneElement)(t,{width:r,height:r,...o})}},function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return a}));var n=r(49),o=(r(14),r(2));const c=(e,t)=>Object.keys(o.defaultAddressFields).every(r=>e[r]===t[r]),a=e=>{const t=Object.keys(o.defaultAddressFields),r=Object(n.a)(t,{},e.country),c=Object.assign({},e);return r.forEach(t=>{let{key:r="",hidden:n=!1}=t;n&&((e,t)=>e in t)(r,e)&&(c[r]="")}),c}},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(45),o=r(18);const c=e=>Object(n.a)(e)?JSON.parse(e)||{}:Object(o.a)(e)?e:{}},,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(0),o=r(52),c=r(2),a=r(62),i=r.n(a),s=r(10),l=r(15);const u=(e,t)=>e&&t[e]?t[e]:null,d=e=>{let{block:t,blockMap:r,blockWrapper:o,children:a,depth:p=1}=e;return a&&0!==a.length?Array.from(a).map((e,a)=>{const{blockName:m="",...f}={key:`${t}_${p}_${a}`,...e instanceof HTMLElement?e.dataset:{},className:e instanceof Element?null==e?void 0:e.className:""},b=u(m,r);if(!b){const c=i()(e instanceof Element&&(null==e?void 0:e.outerHTML)||(null==e?void 0:e.textContent)||"");if("string"==typeof c&&c)return c;if(!Object(n.isValidElement)(c))return null;const a=e.childNodes.length?d({block:t,blockMap:r,children:e.childNodes,depth:p+1,blockWrapper:o}):void 0;return a?Object(n.cloneElement)(c,f,a):Object(n.cloneElement)(c,f)}const g=o||n.Fragment;return Object(n.createElement)(n.Suspense,{key:`${t}_${p}_${a}_suspense`,fallback:Object(n.createElement)("div",{className:"wc-block-placeholder"})},Object(n.createElement)(l.a,{text:"Unexpected error in: "+m,showErrorBlock:c.CURRENT_USER_IS_ADMIN},Object(n.createElement)(g,null,Object(n.createElement)(b,f,d({block:t,blockMap:r,children:e.childNodes,depth:p+1,blockWrapper:o}),((e,t,r,o)=>{if(!Object(s.hasInnerBlocks)(e))return null;const a=r?Array.from(r).map(e=>e instanceof HTMLElement&&(null==e?void 0:e.dataset.blockName)||null).filter(Boolean):[],i=Object(s.getRegisteredBlocks)(e).filter(e=>{let{blockName:t,force:r}=e;return!0===r&&!a.includes(t)}),d=o||n.Fragment;return Object(n.createElement)(n.Fragment,null,i.map((e,r)=>{let{blockName:o,component:a}=e;const i=a||u(o,t);return i?Object(n.createElement)(l.a,{key:o+"_blockerror",text:"Unexpected error in: "+o,showErrorBlock:c.CURRENT_USER_IS_ADMIN},Object(n.createElement)(d,null,Object(n.createElement)(i,{key:`${o}_forced_${r}`}))):null}))})(m,r,e.childNodes,o)))))}):null},p=e=>{let{Block:t,selector:r,blockName:n,getProps:c=(()=>({})),blockMap:a,blockWrapper:i}=e;Object(o.a)({Block:t,selector:r,getProps:(e,t)=>{const r=d({block:n,blockMap:a,children:e.children||[],blockWrapper:i});return{...c(e,t),children:r}}})}},,,,,,,,,,,,,,,,,,,,,function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e){e.exports=JSON.parse('{"name":"woocommerce/filled-mini-cart-contents-block","version":"1.0.0","title":"Filled Mini Cart Contents","description":"Contains blocks that are displayed when the mini cart has products.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/mini-cart-contents"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/empty-mini-cart-contents-block","version":"1.0.0","title":"Empty Mini Cart Contents","description":"Contains blocks that are displayed when the mini cart is empty.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/mini-cart-contents"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/mini-cart-title-block","version":"1.0.0","title":"Mini Cart Title","description":"Block that displays the title of the Mini Cart block.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/filled-mini-cart-contents-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/mini-cart-items-block","version":"1.0.0","title":"Mini Cart Items","description":"Contains the products table and other custom blocks of filled mini cart.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/filled-mini-cart-contents-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/mini-cart-products-table-block","version":"1.0.0","title":"Mini Cart Products Table","description":"Block that displays the products table of the Mini Cart block.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/mini-cart-items-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/mini-cart-footer-block","version":"1.0.0","title":"Mini Cart Footer","description":"Block that displays the footer of the Mini Cart block.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/filled-mini-cart-contents-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e){e.exports=JSON.parse('{"name":"woocommerce/mini-cart-shopping-button-block","version":"1.0.0","title":"Mini Cart Shopping Button","description":"Block that displays the shopping button for the Mini Cart block.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":true},"attributes":{"lock":{"type":"object","default":{"remove":false,"move":false}}},"parent":["woocommerce/empty-mini-cart-contents-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},function(e,t){e.exports=window.wp.components},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t){},,,,function(e,t,r){"use strict";r.r(t);var n=r(52),o=r(0),c=r(127),a=r(1),i=r(195),s=r(100),l=r(4),u=r.n(l);r(238);var d=e=>{let{children:t,className:r,isOpen:n,onClose:c,slideIn:l=!0,slideOut:d=!0,title:p}=e;const[m]=Object(s.a)(n,300);return n||!n&&m?Object(o.createElement)(i.Modal,{title:p,focusOnMount:!0,onRequestClose:c,className:u()(r,"wc-block-components-drawer"),overlayClassName:u()("wc-block-components-drawer__screen-overlay",{"wc-block-components-drawer__screen-overlay--is-hidden":!n,"wc-block-components-drawer__screen-overlay--with-slide-in":l,"wc-block-components-drawer__screen-overlay--with-slide-out":d}),closeButtonLabel:Object(a.__)("Close mini cart","woo-gutenberg-products-block")},t):null},p=r(32),m=r(252),f=r(70),b=r(16),g=r(41),h=r(2),y=r(77),k=r(18);const w=e=>!!Object(k.a)(e)&&Object.keys({total_items:0,total_items_tax:0,total_fees:0,total_fees_tax:0,total_discount:0,total_discount_tax:0,total_shipping:0,total_shipping_tax:0,total_price:0,total_tax:0,tax_lines:0,currency_code:0,currency_symbol:0,currency_minor_unit:0,currency_decimal_separator:0,currency_thousand_separator:0,currency_prefix:0,currency_suffix:0}).every(t=>t in e);var v=r(72),_=r(45),O=r(13),E=Object(o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"none"},Object(o.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.84614 18.2769C7.89712 18.2769 7.93845 18.2356 7.93845 18.1846C7.93845 18.1336 7.89712 18.0923 7.84614 18.0923C7.79516 18.0923 7.75384 18.1336 7.75384 18.1846C7.75384 18.2356 7.79516 18.2769 7.84614 18.2769ZM6.03076 18.1846C6.03076 17.182 6.84353 16.3692 7.84614 16.3692C8.84875 16.3692 9.66152 17.182 9.66152 18.1846C9.66152 19.1872 8.84875 20 7.84614 20C6.84353 20 6.03076 19.1872 6.03076 18.1846Z",fill:"currentColor"}),Object(o.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.3231 18.2769C17.3741 18.2769 17.4154 18.2356 17.4154 18.1846C17.4154 18.1336 17.3741 18.0923 17.3231 18.0923C17.2721 18.0923 17.2308 18.1336 17.2308 18.1846C17.2308 18.2356 17.2721 18.2769 17.3231 18.2769ZM15.5077 18.1846C15.5077 17.182 16.3205 16.3692 17.3231 16.3692C18.3257 16.3692 19.1385 17.182 19.1385 18.1846C19.1385 19.1872 18.3257 20 17.3231 20C16.3205 20 15.5077 19.1872 15.5077 18.1846Z",fill:"currentColor"}),Object(o.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.0631 9.53835L19.4662 12.6685L19.4648 12.6757L19.4648 12.6757C19.3424 13.2919 19.0072 13.8454 18.5178 14.2394C18.031 14.6312 17.4226 14.8404 16.798 14.8308H8.44017C7.81556 14.8404 7.20714 14.6312 6.72038 14.2394C6.2312 13.8456 5.89605 13.2924 5.77352 12.6765L5.77335 12.6757L4.33477 5.48814C4.3286 5.46282 4.32345 5.43711 4.31934 5.41104L3.61815 1.90768H0.953842C0.42705 1.90768 0 1.48063 0 0.953842C0 0.42705 0.42705 0 0.953842 0H4.4C4.85462 0 5.24607 0.320858 5.33529 0.766644L6.04403 4.30769H12.785C13.0114 4.99157 13.3319 5.63258 13.7312 6.21538H6.42585L7.64421 12.3026L7.64449 12.304C7.67966 12.4811 7.77599 12.6402 7.91662 12.7534C8.05725 12.8666 8.23322 12.9267 8.41372 12.9233L8.432 12.9231H16.8062L16.8244 12.9233C17.0049 12.9267 17.1809 12.8666 17.3215 12.7534C17.4614 12.6408 17.5575 12.4828 17.5931 12.3068L17.5937 12.304L18.1649 9.30867C18.762 9.45873 19.387 9.53842 20.0307 9.53842C20.0415 9.53842 20.0523 9.5384 20.0631 9.53835Z",fill:"currentColor"})),x=r(117);r(237);var C=e=>{let{count:t,colorClassNames:r,style:n}=e;return Object(o.createElement)("span",{className:"wc-block-mini-cart__quantity-badge"},Object(o.createElement)(x.a,{className:"wc-block-mini-cart__icon",size:20,icon:E}),Object(o.createElement)("span",{className:"wc-block-mini-cart__badge "+r,style:n},t))},S=r(48),j=r(10),T=r(189),R=r(188),A=r(190),P=r(192),M=r(193),N=r(191),L=r(194);r.p=S.k,Object(j.registerCheckoutBlock)({metadata:R,component:Object(o.lazy)(()=>r.e(51).then(r.bind(null,422)))}),Object(j.registerCheckoutBlock)({metadata:T,component:Object(o.lazy)(()=>r.e(50).then(r.bind(null,423)))}),Object(j.registerCheckoutBlock)({metadata:A,component:Object(o.lazy)(()=>r.e(56).then(r.bind(null,424)))}),Object(j.registerCheckoutBlock)({metadata:N,component:Object(o.lazy)(()=>r.e(53).then(r.bind(null,425)))}),Object(j.registerCheckoutBlock)({metadata:P,component:Object(o.lazy)(()=>Promise.all([r.e(0),r.e(3),r.e(7),r.e(4),r.e(54)]).then(r.bind(null,426)))}),Object(j.registerCheckoutBlock)({metadata:M,component:Object(o.lazy)(()=>Promise.all([r.e(73),r.e(7),r.e(52)]).then(r.bind(null,427)))}),Object(j.registerCheckoutBlock)({metadata:L,component:Object(o.lazy)(()=>r.e(55).then(r.bind(null,428)))});const B=e=>{let{children:t}=e;return Object(o.createElement)(o.Fragment,null,t)};r(148);const I="woocommerce/mini-cart-contents";var F=e=>{var t,r;const{isInitiallyOpen:n=!1,colorClassNames:i,style:s,contents:l="",addToCartBehaviour:k="none",hasHiddenPrice:O=!1}=e,{cartItemsCount:E,cartIsLoading:x,cartTotals:S}=Object(p.a)(),j=Object(o.useRef)(x);Object(o.useEffect)(()=>{j.current&&!x&&(j.current=!1)},[x,j]);const[T,R]=Object(o.useState)(n),[A,P]=Object(o.useState)(n),[M,N]=Object(o.useState)(null),L=Object(o.useCallback)(e=>{N(e)},[]);Object(o.useEffect)(()=>{const e=document.querySelector("body");e&&(T?Object.assign(e.style,{overflow:"hidden"}):Object.assign(e.style,{overflow:""}))},[T]),Object(o.useEffect)(()=>{if(M instanceof Element){if(!M.querySelector(".wp-block-woocommerce-mini-cart-contents"))return;T&&Object(c.a)({Block:B,blockName:I,selector:".wp-block-woocommerce-mini-cart-contents",blockMap:Object(b.getRegisteredBlockComponents)(I)})}return()=>{if(M instanceof Element&&T){const e=M.querySelector(".wp-block-woocommerce-mini-cart-contents");e&&Object(o.unmountComponentAtNode)(e)}}},[T,M]),Object(o.useEffect)(()=>{const e=()=>{"open_drawer"===k&&(P(!1),R(!0))},t=Object(f.b)("added_to_cart","wc-blocks_added_to_cart");return document.body.addEventListener("wc-blocks_added_to_cart",e),()=>{t(),document.body.removeEventListener("wc-blocks_added_to_cart",e)}},[k]);const F=Object(h.getSettingWithCoercion)("displayCartPricesIncludingTax",!1,y.a),D=Object(h.getSettingWithCoercion)("cartTotals",null,w),H=Object(h.getSettingWithCoercion)("cartItemsCount",0,v.a),U=Object(h.getSettingWithCoercion)("taxLabel","",_.a),V=j.current&&null!==D?D:S,z=j.current?H:E,q=F?parseInt(V.total_items,10)+parseInt(V.total_items_tax,10):parseInt(V.total_items,10),Y=Object(a.sprintf)( +/* translators: %1$d is the number of products in the cart. %2$s is the cart total */ +Object(a._n)("%1$d item in cart, total price of %2$s","%1$d items in cart, total price of %2$s",z,"woo-gutenberg-products-block"),z,Object(g.formatPrice)(q,Object(g.getCurrencyFromPriceResponse)(V))),W={backgroundColor:null==s||null===(t=s.color)||void 0===t?void 0:t.background,color:null==s||null===(r=s.color)||void 0===r?void 0:r.text},G=Object(m.a)(e);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("button",{className:"wc-block-mini-cart__button "+i,style:W,onClick:()=>{T||(R(!0),P(!1))},"aria-label":Y},!O&&Object(o.createElement)("span",{className:"wc-block-mini-cart__amount",style:G.style},Object(g.formatPrice)(q,Object(g.getCurrencyFromPriceResponse)(V))),""!==U&&0!==q&&!O&&Object(o.createElement)("small",{className:"wc-block-mini-cart__tax-label"},U),Object(o.createElement)(C,{count:z})),Object(o.createElement)(d,{className:u()("wc-block-mini-cart__drawer","is-mobile",{"is-loading":x}),title:"",isOpen:T,onClose:()=>{R(!1)},slideIn:!A},Object(o.createElement)("div",{className:"wc-block-mini-cart__template-part",ref:L,dangerouslySetInnerHTML:{__html:l}})))};(()=>{let e=null;if(document.activeElement&&document.activeElement.classList.contains("wc-block-mini-cart__button")&&document.activeElement.parentNode instanceof HTMLElement&&(e=document.activeElement.parentNode),Object(n.a)({selector:".wc-block-mini-cart",Block:F,getProps:e=>{var t,r;let n="";const o=e.querySelector(".wc-block-mini-cart__button");return null!==o&&(n=o.classList.toString().replace("wc-block-mini-cart__button","")),{isDataOutdated:e.dataset.isDataOutdated,isInitiallyOpen:"true"===e.dataset.isInitiallyOpen,colorClassNames:n,style:e.dataset.style?JSON.parse(e.dataset.style):{},addToCartBehaviour:e.dataset.addToCartBehaviour||"none",hasHiddenPrice:e.dataset.hasHiddenPrice,contents:null!==(t=null===(r=e.querySelector(".wc-block-mini-cart__template-part"))||void 0===r?void 0:r.innerHTML)&&void 0!==t?t:""}}}),e instanceof HTMLElement&&!e.dataset.isInitiallyOpen){const t=e.querySelector(".wc-block-mini-cart__button");t instanceof HTMLElement&&t.focus()}})()},,,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(18),o=r(121);const c=e=>{const t=Object(n.a)(e)?e:{},r=Object(o.a)(t.style),c=Object(n.a)(r.typography)?r.typography:{};return{style:{fontSize:t.fontSize?`var(--wp--preset--font-size--${t.fontSize})`:c.fontSize,lineHeight:c.lineHeight,fontWeight:c.fontWeight,textTransform:c.textTransform,fontFamily:t.fontFamily}}}}]); \ No newline at end of file diff --git a/build/mini-cart-contents-block/empty-cart-frontend.js b/build/mini-cart-contents-block/empty-cart-frontend.js new file mode 100644 index 00000000000..8ccd73571b0 --- /dev/null +++ b/build/mini-cart-contents-block/empty-cart-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[50],{423:function(e,c,t){"use strict";t.r(c);var a=t(0),n=t(32),l=t(5);c.default=e=>{let{children:c,className:t}=e;const{cartItems:s,cartIsLoading:r}=Object(n.a)(),o=Object(l.useRef)(null);return Object(l.useEffect)(()=>{var e;0!==s.length||r||null===(e=o.current)||void 0===e||e.focus()},[s,r]),r||s.length>0?null:Object(a.createElement)("div",{tabIndex:-1,ref:o,className:t},Object(a.createElement)("div",{className:"wc-block-mini-cart__empty-cart-wrapper"},c))}}}]); \ No newline at end of file diff --git a/build/mini-cart-contents-block/filled-cart-frontend.js b/build/mini-cart-contents-block/filled-cart-frontend.js new file mode 100644 index 00000000000..83b780eaf10 --- /dev/null +++ b/build/mini-cart-contents-block/filled-cart-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[51],{422:function(e,c,t){"use strict";t.r(c);var s=t(0),n=t(32);c.default=e=>{let{children:c,className:t}=e;const{cartItems:a}=Object(n.a)();return 0===a.length?null:Object(s.createElement)("div",{className:t},c)}}}]); \ No newline at end of file diff --git a/build/mini-cart-contents-block/footer--mini-cart-contents-block/products-table-frontend.js b/build/mini-cart-contents-block/footer--mini-cart-contents-block/products-table-frontend.js new file mode 100644 index 00000000000..90c4fecd6f9 --- /dev/null +++ b/build/mini-cart-contents-block/footer--mini-cart-contents-block/products-table-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[7],{199:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return u}));var s=r(0),o=r(3),c=r(11),n=r.n(c);const a=Object(s.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),i=()=>Object(s.useContext)(a),u=e=>{let{children:t}=e;const[r,c]=Object(s.useState)({}),i=Object(s.useCallback)(e=>r[e],[r]),u=Object(s.useCallback)(e=>{const t=r[e];return!t||t.hidden?"":"validate-error-"+e},[r]),E=Object(s.useCallback)(e=>{c(t=>{if(!t[e])return t;const{[e]:r,...s}=t;return s})},[]),l=Object(s.useCallback)(()=>{c({})},[]),d=Object(s.useCallback)(e=>{e&&c(t=>(e=Object(o.pickBy)(e,(e,r)=>!("string"!=typeof e.message||t.hasOwnProperty(r)&&n()(t[r],e))),0===Object.values(e).length?t:{...t,...e}))},[]),_=Object(s.useCallback)((e,t)=>{c(r=>{if(!r.hasOwnProperty(e))return r;const s={...r[e],...t};return n()(r[e],s)?r:{...r,[e]:s}})},[]),S={getValidationError:i,setValidationErrors:d,clearValidationError:E,clearAllValidationErrors:l,hideValidationError:Object(s.useCallback)(e=>{_(e,{hidden:!0})},[_]),showValidationError:Object(s.useCallback)(e=>{_(e,{hidden:!1})},[_]),showAllValidationErrors:Object(s.useCallback)(()=>{c(e=>{const t={};return Object.keys(e).forEach(r=>{e[r].hidden&&(t[r]={...e[r],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(r).length>0,getValidationErrorId:u};return Object(s.createElement)(a.Provider,{value:S},t)}},204:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var s=r(94);const o=(e,t)=>function(r){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const c=s.a.addEventCallback(e,r,o);return t(c),()=>{t(s.a.removeEventCallback(e,c.id))}}},206:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return n}));const s=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var o=r(30);const c=async(e,t,r)=>{const o=s(e,t),c=[];for(const e of o)try{const t=await Promise.resolve(e.callback(r));"object"==typeof t&&c.push(t)}catch(e){console.error(e)}return!c.length||c},n=async(e,t,r)=>{const c=[],n=s(e,t);for(const e of n)try{const t=await Promise.resolve(e.callback(r));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(o.a)(t)||Object(o.b)(t))return c.push(t),c;c.push(t)}catch(e){return console.error(e),c.push({type:"error"}),c}return c}},30:function(e,t,r){"use strict";r.d(t,"c",(function(){return c})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return u})),r.d(t,"d",(function(){return l}));var s=r(18);let o,c;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(o||(o={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));const n=(e,t)=>Object(s.a)(e)&&"type"in e&&e.type===t,a=e=>n(e,o.SUCCESS),i=e=>n(e,o.ERROR),u=e=>n(e,o.FAIL),E=e=>!Object(s.a)(e)||void 0===e.retry||!0===e.retry,l=()=>({responseTypes:o,noticeContexts:c,shouldRetry:E,isSuccessResponse:a,isErrorResponse:i,isFailResponse:u})},36:function(e,t,r){"use strict";r.d(t,"b",(function(){return j})),r.d(t,"a",(function(){return v}));var s=r(0),o=r(1),c=r(61),n=r(25),a=r.n(n),i=r(45),u=r(18),E=r(7);let l;!function(e){e.SET_IDLE="set_idle",e.SET_PRISTINE="set_pristine",e.SET_REDIRECT_URL="set_redirect_url",e.SET_COMPLETE="set_checkout_complete",e.SET_BEFORE_PROCESSING="set_before_processing",e.SET_AFTER_PROCESSING="set_after_processing",e.SET_PROCESSING_RESPONSE="set_processing_response",e.SET_PROCESSING="set_checkout_is_processing",e.SET_HAS_ERROR="set_checkout_has_error",e.SET_NO_ERROR="set_checkout_no_error",e.SET_CUSTOMER_ID="set_checkout_customer_id",e.SET_ORDER_ID="set_checkout_order_id",e.SET_ORDER_NOTES="set_checkout_order_notes",e.INCREMENT_CALCULATING="increment_calculating",e.DECREMENT_CALCULATING="decrement_calculating",e.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS="set_shipping_address_as_billing_address",e.SET_SHOULD_CREATE_ACCOUNT="set_should_create_account",e.SET_EXTENSION_DATA="set_extension_data"}(l||(l={}));const d=()=>({type:l.SET_IDLE}),_=e=>({type:l.SET_REDIRECT_URL,redirectUrl:e}),S=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:l.SET_COMPLETE,data:e}},O=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:e?l.SET_HAS_ERROR:l.SET_NO_ERROR}};var h=r(2),C=r(118);let p;!function(e){e.PRISTINE="pristine",e.IDLE="idle",e.PROCESSING="processing",e.COMPLETE="complete",e.BEFORE_PROCESSING="before_processing",e.AFTER_PROCESSING="after_processing"}(p||(p={}));const b={order_id:0,customer_id:0,billing_address:{},shipping_address:{},...Object(h.getSetting)("checkoutData",{})||{}},R={redirectUrl:"",status:p.PRISTINE,hasError:!1,calculatingCount:0,orderId:b.order_id,orderNotes:"",customerId:b.customer_id,useShippingAsBilling:Object(C.b)(b.billing_address,b.shipping_address),shouldCreateAccount:!1,processingResponse:null,extensionData:{}},g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R,{redirectUrl:t,type:r,customerId:s,orderId:o,orderNotes:c,extensionData:n,useShippingAsBilling:a,shouldCreateAccount:i,data:u}=arguments.length>1?arguments[1]:void 0,E=e;switch(r){case l.SET_PRISTINE:E=R;break;case l.SET_IDLE:E=e.status!==p.IDLE?{...e,status:p.IDLE}:e;break;case l.SET_REDIRECT_URL:E=void 0!==t&&t!==e.redirectUrl?{...e,redirectUrl:t}:e;break;case l.SET_PROCESSING_RESPONSE:E={...e,processingResponse:u};break;case l.SET_COMPLETE:E=e.status!==p.COMPLETE?{...e,status:p.COMPLETE,redirectUrl:"string"==typeof(null==u?void 0:u.redirectUrl)?u.redirectUrl:e.redirectUrl}:e;break;case l.SET_PROCESSING:E=e.status!==p.PROCESSING?{...e,status:p.PROCESSING,hasError:!1}:e,E=!1===E.hasError?E:{...E,hasError:!1};break;case l.SET_BEFORE_PROCESSING:E=e.status!==p.BEFORE_PROCESSING?{...e,status:p.BEFORE_PROCESSING,hasError:!1}:e;break;case l.SET_AFTER_PROCESSING:E=e.status!==p.AFTER_PROCESSING?{...e,status:p.AFTER_PROCESSING}:e;break;case l.SET_HAS_ERROR:E=e.hasError?e:{...e,hasError:!0},E=e.status===p.PROCESSING||e.status===p.BEFORE_PROCESSING?{...E,status:p.IDLE}:E;break;case l.SET_NO_ERROR:E=e.hasError?{...e,hasError:!1}:e;break;case l.INCREMENT_CALCULATING:E={...e,calculatingCount:e.calculatingCount+1};break;case l.DECREMENT_CALCULATING:E={...e,calculatingCount:Math.max(0,e.calculatingCount-1)};break;case l.SET_CUSTOMER_ID:E=void 0!==s?{...e,customerId:s}:e;break;case l.SET_ORDER_ID:E=void 0!==o?{...e,orderId:o}:e;break;case l.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS:void 0!==a&&a!==e.useShippingAsBilling&&(E={...e,useShippingAsBilling:a});break;case l.SET_SHOULD_CREATE_ACCOUNT:void 0!==i&&i!==e.shouldCreateAccount&&(E={...e,shouldCreateAccount:i});break;case l.SET_ORDER_NOTES:void 0!==c&&e.orderNotes!==c&&(E={...e,orderNotes:c});break;case l.SET_EXTENSION_DATA:void 0!==n&&e.extensionData!==n&&(E={...e,extensionData:n})}return E!==e&&r!==l.SET_PRISTINE&&E.status===p.PRISTINE&&(E.status=p.IDLE),E};var T=r(17),f=r(94),I=r(204);var A=r(206),N=r(199),m=r(59),P=r(30),k=r(80);const y=Object(s.createContext)({dispatchActions:{resetCheckout:()=>{},setRedirectUrl:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},incrementCalculating:()=>{},decrementCalculating:()=>{},setCustomerId:e=>{},setOrderId:e=>{},setOrderNotes:e=>{},setExtensionData:e=>{}},onSubmit:()=>{},isComplete:!1,isIdle:!1,isCalculating:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,redirectUrl:"",orderId:0,orderNotes:"",customerId:0,onCheckoutAfterProcessingWithSuccess:()=>()=>{},onCheckoutAfterProcessingWithError:()=>()=>{},onCheckoutBeforeProcessing:()=>()=>{},onCheckoutValidationBeforeProcessing:()=>()=>{},hasOrder:!1,isCart:!1,useShippingAsBilling:!1,setUseShippingAsBilling:e=>{},shouldCreateAccount:!1,setShouldCreateAccount:e=>{},extensionData:{}}),j=()=>Object(s.useContext)(y),v=e=>{let{children:t,redirectUrl:r,isCart:n=!1}=e;R.redirectUrl=r;const[h,C]=Object(s.useReducer)(g,R),{setValidationErrors:b}=Object(N.b)(),{createErrorNotice:j}=Object(E.useDispatch)("core/notices"),{dispatchCheckoutEvent:v}=Object(m.a)(),D=h.calculatingCount>0,{isSuccessResponse:L,isErrorResponse:U,isFailResponse:B,shouldRetry:w}=Object(P.d)(),{checkoutNotices:G,paymentNotices:V,expressPaymentNotices:x}=(()=>{const{noticeContexts:e}=Object(P.d)();return{checkoutNotices:Object(E.useSelect)(e=>e("core/notices").getNotices("wc/checkout"),[]),expressPaymentNotices:Object(E.useSelect)(t=>t("core/notices").getNotices(e.EXPRESS_PAYMENTS),[e.EXPRESS_PAYMENTS]),paymentNotices:Object(E.useSelect)(t=>t("core/notices").getNotices(e.PAYMENTS),[e.PAYMENTS])}})(),[M,F]=Object(s.useReducer)(f.b,{}),H=Object(s.useRef)(M),{onCheckoutAfterProcessingWithSuccess:W,onCheckoutAfterProcessingWithError:K,onCheckoutValidationBeforeProcessing:X}=(e=>Object(s.useMemo)(()=>({onCheckoutAfterProcessingWithSuccess:Object(I.a)("checkout_after_processing_with_success",e),onCheckoutAfterProcessingWithError:Object(I.a)("checkout_after_processing_with_error",e),onCheckoutValidationBeforeProcessing:Object(I.a)("checkout_validation_before_processing",e)}),[e]))(F);Object(s.useEffect)(()=>{H.current=M},[M]);const Y=Object(s.useMemo)(()=>function(){return a()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidationBeforeProcessing",plugin:"WooCommerce Blocks"}),X(...arguments)},[X]),J=Object(s.useMemo)(()=>({resetCheckout:()=>{C({type:l.SET_PRISTINE})},setRedirectUrl:e=>{C(_(e))},setHasError:e=>{C(O(e))},incrementCalculating:()=>{C({type:l.INCREMENT_CALCULATING})},decrementCalculating:()=>{C({type:l.DECREMENT_CALCULATING})},setCustomerId:e=>{var t;C((t=e,{type:l.SET_CUSTOMER_ID,customerId:t}))},setOrderId:e=>{C((e=>({type:l.SET_ORDER_ID,orderId:e}))(e))},setOrderNotes:e=>{C((e=>({type:l.SET_ORDER_NOTES,orderNotes:e}))(e))},setExtensionData:e=>{C((e=>({type:l.SET_EXTENSION_DATA,extensionData:e}))(e))},setAfterProcessing:e=>{const t=(e=>{const t={message:"",paymentStatus:"",redirectUrl:"",paymentDetails:{}};return"payment_result"in e&&(t.paymentStatus=e.payment_result.payment_status,t.redirectUrl=e.payment_result.redirect_url,e.payment_result.hasOwnProperty("payment_details")&&Array.isArray(e.payment_result.payment_details)&&e.payment_result.payment_details.forEach(e=>{let{key:r,value:s}=e;t.paymentDetails[r]=Object(T.decodeEntities)(s)})),"message"in e&&(t.message=Object(T.decodeEntities)(e.message)),!t.message&&"data"in e&&"status"in e.data&&e.data.status>299&&(t.message=Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")),t})(e);var r;C(_((null==t?void 0:t.redirectUrl)||"")),C((r=t,{type:l.SET_PROCESSING_RESPONSE,data:r})),C({type:l.SET_AFTER_PROCESSING})}}),[]);Object(s.useEffect)(()=>{h.status===p.BEFORE_PROCESSING&&(Object(k.b)("error"),Object(A.a)(H.current,"checkout_validation_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:r}=e;j(t,{context:"wc/checkout"}),b(r)}),C(d()),C(O())):C({type:l.SET_PROCESSING})}))},[h.status,b,j,C]);const q=Object(c.a)(h.status),z=Object(c.a)(h.hasError);Object(s.useEffect)(()=>{if((h.status!==q||h.hasError!==z)&&h.status===p.AFTER_PROCESSING){const e={redirectUrl:h.redirectUrl,orderId:h.orderId,customerId:h.customerId,orderNotes:h.orderNotes,processingResponse:h.processingResponse};h.hasError?Object(A.b)(H.current,"checkout_after_processing_with_error",e).then(t=>{const r=(e=>{let t=null;return e.forEach(e=>{if((U(e)||B(e))&&e.message&&Object(i.a)(e.message)){const r=e.messageContext&&Object(i.a)(e.messageContent)?{context:e.messageContext}:void 0;t=e,j(e.message,r)}}),t})(t);if(null!==r)w(r)?C(d()):C(S(r));else{if(!(G.some(e=>"error"===e.status)||x.some(e=>"error"===e.status)||V.some(e=>"error"===e.status))){var s;const t=(null===(s=e.processingResponse)||void 0===s?void 0:s.message)||Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");j(t,{id:"checkout",context:"wc/checkout"})}C(d())}}):Object(A.b)(H.current,"checkout_after_processing_with_success",e).then(e=>{let t=null,r=null;if(e.forEach(e=>{L(e)&&(t=e),(U(e)||B(e))&&(r=e)}),t&&!r)C(S(t));else if(Object(u.a)(r)){if(r.message&&Object(i.a)(r.message)){const e=r.messageContext&&Object(i.a)(r.messageContext)?{context:r.messageContext}:void 0;j(r.message,e)}w(r)?C(O(!0)):C(S(r))}else C(S())})}},[h.status,h.hasError,h.redirectUrl,h.orderId,h.customerId,h.orderNotes,h.processingResponse,q,z,J,j,U,B,L,w,G,x,V]);const Q={onSubmit:Object(s.useCallback)(()=>{v("submit"),C({type:l.SET_BEFORE_PROCESSING})},[v]),isComplete:h.status===p.COMPLETE,isIdle:h.status===p.IDLE,isCalculating:D,isProcessing:h.status===p.PROCESSING,isBeforeProcessing:h.status===p.BEFORE_PROCESSING,isAfterProcessing:h.status===p.AFTER_PROCESSING,hasError:h.hasError,redirectUrl:h.redirectUrl,onCheckoutBeforeProcessing:Y,onCheckoutValidationBeforeProcessing:X,onCheckoutAfterProcessingWithSuccess:W,onCheckoutAfterProcessingWithError:K,dispatchActions:J,isCart:n,orderId:h.orderId,hasOrder:!!h.orderId,customerId:h.customerId,orderNotes:h.orderNotes,useShippingAsBilling:h.useShippingAsBilling,setUseShippingAsBilling:e=>{return C((t=e,{type:l.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS,useShippingAsBilling:t}));var t},shouldCreateAccount:h.shouldCreateAccount,setShouldCreateAccount:e=>{return C((t=e,{type:l.SET_SHOULD_CREATE_ACCOUNT,shouldCreateAccount:t}));var t},extensionData:h.extensionData};return Object(s.createElement)(y.Provider,{value:Q},t)}},59:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var s=r(43),o=r(0),c=r(32);const n=()=>{const e=Object(c.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(s.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(s.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...r,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},61:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var s=r(5);function o(e,t){const r=Object(s.useRef)();return Object(s.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},80:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var s=r(7);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;const r=Object(s.select)("core/notices").getNotices(e);return r.some(e=>e.type===t)},c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=Object(s.select)("core/notices").getNotices(),{removeNotice:o}=Object(s.dispatch)("core/notices"),c=r.filter(t=>t.status===e);c.forEach(e=>o(e.id,t))}},94:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return a}));var s=r(3);let o;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(o||(o={}));const c={addEventCallback:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(s.uniqueId)(),type:o.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:(e,t)=>({id:t,type:o.REMOVE_EVENT_CALLBACK,eventType:e})},n={},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n,{type:t,eventType:r,id:s,callback:c,priority:a}=arguments.length>1?arguments[1]:void 0;const i=e.hasOwnProperty(r)?new Map(e[r]):new Map;switch(t){case o.ADD_EVENT_CALLBACK:return i.set(s,{priority:a,callback:c}),{...e,[r]:i};case o.REMOVE_EVENT_CALLBACK:return i.delete(s),{...e,[r]:i}}}}}]); \ No newline at end of file diff --git a/build/mini-cart-contents-block/footer-frontend.js b/build/mini-cart-contents-block/footer-frontend.js new file mode 100644 index 00000000000..277aa7b0c87 --- /dev/null +++ b/build/mini-cart-contents-block/footer-frontend.js @@ -0,0 +1,3 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[52],{135:function(e,t,s){"use strict";var a=s(0);s(196),t.a=()=>Object(a.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},196:function(e,t){},207:function(e,t,s){"use strict";s.d(t,"b",(function(){return U})),s.d(t,"a",(function(){return $}));var a=s(0),r=s(18),n=s(7);let c,i;!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(c||(c={})),function(e){e.SET_REGISTERED_PAYMENT_METHODS="set_registered_payment_methods",e.SET_REGISTERED_EXPRESS_PAYMENT_METHODS="set_registered_express_payment_methods",e.SET_SHOULD_SAVE_PAYMENT_METHOD="set_should_save_payment_method",e.SET_ACTIVE_PAYMENT_METHOD="set_active_payment_method"}(i||(i={}));const o={currentStatus:c.PRISTINE,shouldSavePaymentMethod:!1,activePaymentMethod:"",paymentMethodData:{payment_method:""},errorMessage:"",paymentMethods:{},expressPaymentMethods:{}},d={setPaymentStatus:()=>({pristine:()=>{},started:()=>{},processing:()=>{},completed:()=>{},error:e=>{},failed:(e,t)=>{},success:(e,t)=>{}}),currentStatus:{isPristine:!0,isStarted:!1,isProcessing:!1,isFinished:!1,hasError:!1,hasFailed:!1,isSuccessful:!1,isDoingExpressPayment:!1},paymentStatuses:c,paymentMethodData:{},errorMessage:"",activePaymentMethod:"",activeSavedToken:"",setActivePaymentMethod:()=>{},customerPaymentMethods:{},paymentMethods:{},expressPaymentMethods:{},paymentMethodsInitialized:!1,expressPaymentMethodsInitialized:!1,onPaymentProcessing:()=>()=>()=>{},setExpressPaymentError:()=>{},isExpressPaymentMethodActive:!1,setShouldSavePayment:()=>{},shouldSavePayment:!1};var l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,{type:t,paymentMethodData:s,shouldSavePaymentMethod:a=!1,errorMessage:r="",paymentMethods:n={},paymentMethod:d=""}=arguments.length>1?arguments[1]:void 0;switch(t){case c.PRISTINE:return{...o,...e,errorMessage:"",currentStatus:c.PRISTINE};case c.STARTED:return{...e,currentStatus:c.STARTED};case c.ERROR:return e.currentStatus!==c.ERROR?{...e,currentStatus:c.ERROR,errorMessage:r||e.errorMessage}:e;case c.FAILED:return e.currentStatus!==c.FAILED?{...e,currentStatus:c.FAILED,paymentMethodData:s||e.paymentMethodData,errorMessage:r||e.errorMessage}:e;case c.SUCCESS:return e.currentStatus!==c.SUCCESS?{...e,currentStatus:c.SUCCESS,paymentMethodData:s||e.paymentMethodData}:e;case c.PROCESSING:return e.currentStatus!==c.PROCESSING?{...e,currentStatus:c.PROCESSING,errorMessage:""}:e;case c.COMPLETE:return e.currentStatus!==c.COMPLETE?{...e,currentStatus:c.COMPLETE}:e;case i.SET_REGISTERED_PAYMENT_METHODS:return{...e,paymentMethods:n};case i.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:return{...e,expressPaymentMethods:n};case i.SET_SHOULD_SAVE_PAYMENT_METHOD:return{...e,shouldSavePaymentMethod:a};case i.SET_ACTIVE_PAYMENT_METHOD:return{...e,activePaymentMethod:d,paymentMethodData:s||e.paymentMethodData}}},u=s(1),p=s(16),m=s(31),_=s(2),h=s(51),y=s(25),b=s.n(y),g=s(29),S=s(50),E=s(32),O=s(30),v=s(66);const M=(e,t,s,r)=>{const[c,i]=Object(a.useState)(!1),{isEditor:o}=Object(g.a)(),{selectedRates:d}=Object(v.a)(),{billingAddress:l,shippingAddress:p}=Object(S.b)(),y=Object(m.a)(d),O=Object(m.a)(s),M=Object(E.a)(),{cartTotals:f,cartIsLoading:j,cartNeedsShipping:P,paymentRequirements:R}=M,T=Object(a.useRef)({cart:M,cartTotals:f,cartNeedsShipping:P,billingData:l,billingAddress:l,shippingAddress:p,selectedShippingMethods:y,paymentRequirements:R}),{createErrorNotice:k}=Object(n.useDispatch)("core/notices");Object(a.useEffect)(()=>{T.current={cart:M,cartTotals:f,cartNeedsShipping:P,get billingData(){return b()("billingData",{alternative:"billingAddress",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-blocks/pull/6369"}),this.billingAddress},billingAddress:l,shippingAddress:p,selectedShippingMethods:y,paymentRequirements:R}},[M,f,P,l,p,y,R]);const w=Object(a.useCallback)(async()=>{let s={};const a=e=>{s={...s,[e.name]:e}};for(let e=0;e{j||D()},[D,M,y,l,j]),c},f=e=>({type:e}),j=e=>({type:c.ERROR,errorMessage:e}),P=e=>{let{errorMessage:t,paymentMethodData:s}=e;return{type:c.FAILED,errorMessage:t,paymentMethodData:s}},R=e=>{let{paymentMethodData:t}=e;return{type:c.SUCCESS,paymentMethodData:t}},T=e=>({type:i.SET_REGISTERED_PAYMENT_METHODS,paymentMethods:e}),k=e=>({type:i.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,paymentMethods:e}),w=e=>({type:i.SET_SHOULD_SAVE_PAYMENT_METHOD,shouldSavePaymentMethod:e}),D=(e,t)=>({type:i.SET_ACTIVE_PAYMENT_METHOD,paymentMethod:e,paymentMethodData:t});var x=s(67),A=s(36),C=s(94),I=s(204);var N=s(206),Y=s(199);const L=Object(a.createContext)(d),U=()=>Object(a.useContext)(L),$=e=>{let{children:t}=e;const{isProcessing:s,isIdle:i,isCalculating:d,hasError:u}=Object(A.b)(),{isEditor:m,getPreviewData:h}=Object(g.a)(),{setValidationErrors:y}=Object(Y.b)(),{createErrorNotice:b,removeNotice:S}=Object(n.useDispatch)("core/notices"),{isSuccessResponse:E,isErrorResponse:v,isFailResponse:U,noticeContexts:$}=Object(O.d)(),[F,q]=Object(a.useReducer)(C.b,{}),{onPaymentProcessing:H}=(e=>Object(a.useMemo)(()=>({onPaymentProcessing:Object(I.a)("payment_processing",e)}),[e]))(q),z=Object(a.useRef)(F);Object(a.useEffect)(()=>{z.current=F},[F]);const[G,B]=Object(a.useReducer)(l,o),{dispatchActions:V,setPaymentStatus:X}=(e=>{const{setBillingAddress:t,setShippingAddress:s}=Object(x.a)();return{dispatchActions:Object(a.useMemo)(()=>({setRegisteredPaymentMethods:t=>{e(T(t))},setRegisteredExpressPaymentMethods:t=>{e(k(t))},setShouldSavePayment:t=>{e(w(t))},setActivePaymentMethod:function(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e(D(t,s))}}),[e]),setPaymentStatus:Object(a.useCallback)(()=>({pristine:()=>e(f(c.PRISTINE)),started:()=>e(f(c.STARTED)),processing:()=>e(f(c.PROCESSING)),completed:()=>e(f(c.COMPLETE)),error:t=>e(j(t)),failed:function(s,a){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;r&&t(r),e(P({errorMessage:s||"",paymentMethodData:a||{}}))},success:function(a){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;r&&t(r),void 0!==typeof n&&null!=n&&n.address&&s(n.address),e(R({paymentMethodData:a}))}}),[e,t,s])}})(B),K=(e=>{const t=Object(p.getPaymentMethods)(),{noticeContexts:s}=Object(O.d)(),a=new Set([...Object(_.getSetting)("paymentGatewaySortOrder",[]),...Object.keys(t)]);return M(e,t,Array.from(a),s.PAYMENTS)})(V.setRegisteredPaymentMethods),W=(e=>{const t=Object(p.getExpressPaymentMethods)(),{noticeContexts:s}=Object(O.d)();return M(e,t,Object.keys(t),s.EXPRESS_PAYMENTS)})(V.setRegisteredExpressPaymentMethods),J=Object(a.useMemo)(()=>m?h("previewSavedPaymentMethods"):K?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===Object.keys(e).length)return{};const t=Object(_.getSetting)("customerPaymentMethods",{}),s=Object.keys(t),a={};return s.forEach(s=>{const r=t[s].filter(t=>{var s;let{method:{gateway:a}}=t;return a in e&&(null===(s=e[a].supports)||void 0===s?void 0:s.showSavedCards)});r.length&&(a[s]=r)}),a}(G.paymentMethods):{},[m,h,K,G.paymentMethods]),Q=Object(a.useCallback)(e=>{e?b(e,{id:"wc-express-payment-error",context:$.EXPRESS_PAYMENTS}):S("wc-express-payment-error",$.EXPRESS_PAYMENTS)},[b,$.EXPRESS_PAYMENTS,S]),Z=Object.keys(G.expressPaymentMethods).includes(G.activePaymentMethod),ee=Object(a.useMemo)(()=>({isPristine:G.currentStatus===c.PRISTINE,isStarted:G.currentStatus===c.STARTED,isProcessing:G.currentStatus===c.PROCESSING,isFinished:[c.ERROR,c.FAILED,c.SUCCESS].includes(G.currentStatus),hasError:G.currentStatus===c.ERROR,hasFailed:G.currentStatus===c.FAILED,isSuccessful:G.currentStatus===c.SUCCESS,isDoingExpressPayment:G.currentStatus!==c.PRISTINE&&Z}),[G.currentStatus,Z]);Object(a.useEffect)(()=>{const e=Object.keys(G.paymentMethods);if(!K||!e.length)return;const t=[...e,...Object.keys(G.expressPaymentMethods)];if(G.activePaymentMethod&&t.includes(G.activePaymentMethod))return;X().pristine();const s=Object.keys(J).flatMap(e=>J[e])[0]||void 0;if(s){const e=s.tokenId.toString(),t=s.method.gateway,a=`wc-${t}-payment-token`;V.setActivePaymentMethod(t,{token:e,payment_method:t,[a]:e,isSavedToken:!0})}else V.setActivePaymentMethod(Object.keys(G.paymentMethods)[0])},[K,G.paymentMethods,G.expressPaymentMethods,V,X,G.activePaymentMethod,J]),Object(a.useEffect)(()=>{!s||u||d||ee.isFinished||X().processing()},[s,u,d,ee.isFinished,X]),Object(a.useEffect)(()=>{i&&!ee.isSuccessful&&X().pristine()},[i,ee.isSuccessful,X]),Object(a.useEffect)(()=>{u&&ee.isSuccessful&&X().pristine()},[u,ee.isSuccessful,X]),Object(a.useEffect)(()=>{ee.isProcessing&&(S("wc-payment-error",$.PAYMENTS),Object(N.b)(z.current,"payment_processing",{}).then(e=>{let t,s;var a,r,n,c,i,o;if(e.forEach(e=>{E(e)&&(t=e),(v(e)||U(e))&&(s=e)}),t&&!s)X().success(null===(a=t)||void 0===a||null===(r=a.meta)||void 0===r?void 0:r.paymentMethodData,null===(n=t)||void 0===n||null===(c=n.meta)||void 0===c?void 0:c.billingAddress,null===(i=t)||void 0===i||null===(o=i.meta)||void 0===o?void 0:o.shippingData);else if(s&&U(s)){var d,l,u,p,m,_;s.message&&s.message.length&&b(s.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(_=s)||void 0===_?void 0:_.messageContext)||$.PAYMENTS}),X().failed(null===(d=s)||void 0===d?void 0:d.message,null===(l=s)||void 0===l||null===(u=l.meta)||void 0===u?void 0:u.paymentMethodData,null===(p=s)||void 0===p||null===(m=p.meta)||void 0===m?void 0:m.billingAddress)}else if(s){var h,g;s.message&&s.message.length&&b(s.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(g=s)||void 0===g?void 0:g.messageContext)||$.PAYMENTS}),X().error(s.message),y(null===(h=s)||void 0===h?void 0:h.validationErrors)}else X().success()}))},[ee.isProcessing,y,X,S,$.PAYMENTS,E,U,v,b]);const te="object"==typeof G.paymentMethodData&&Object(r.b)(G.paymentMethodData,"token")?G.paymentMethodData.token+"":"",se={setPaymentStatus:X,currentStatus:ee,paymentStatuses:c,paymentMethodData:G.paymentMethodData,errorMessage:G.errorMessage,activePaymentMethod:G.activePaymentMethod,activeSavedToken:te,setActivePaymentMethod:V.setActivePaymentMethod,onPaymentProcessing:H,customerPaymentMethods:J,paymentMethods:G.paymentMethods,expressPaymentMethods:G.expressPaymentMethods,paymentMethodsInitialized:K,expressPaymentMethodsInitialized:W,setExpressPaymentError:Q,isExpressPaymentMethodActive:Z,shouldSavePayment:G.shouldSavePaymentMethod,setShouldSavePayment:V.setShouldSavePayment};return Object(a.createElement)(L.Provider,{value:se},t)}},266:function(e,t,s){"use strict";var a=s(12),r=s.n(a),n=s(0),c=s(42),i=s(4),o=s.n(i),d=s(135);s(267),t.a=e=>{let{className:t,showSpinner:s=!1,children:a,variant:i="contained",...l}=e;const u=o()("wc-block-components-button",t,i,{"wc-block-components-button--loading":s});return Object(n.createElement)(c.a,r()({className:u},l),s&&Object(n.createElement)(d.a,null),Object(n.createElement)("span",{className:"wc-block-components-button__text"},a))}},267:function(e,t){},275:function(e,t){},278:function(e,t,s){"use strict";s.d(t,"b",(function(){return c})),s.d(t,"a",(function(){return i}));var a=s(31),r=s(207);const n=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{paymentMethods:t,expressPaymentMethods:s,paymentMethodsInitialized:n,expressPaymentMethodsInitialized:c}=Object(r.b)(),i=Object(a.a)(t),o=Object(a.a)(s);return{paymentMethods:e?o:i,isInitialized:e?c:n}},c=()=>n(!1),i=()=>n(!0)},280:function(e,t,s){"use strict";var a=s(12),r=s.n(a),n=s(0),c=s(4),i=s.n(c);const o=e=>"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--"+e;var d=e=>{let{id:t,src:s=null,alt:a=""}=e;return s?Object(n.createElement)("img",{className:o(t),src:s,alt:a}):null},l=s(48);const u=[{id:"alipay",alt:"Alipay",src:l.l+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:l.l+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:l.l+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:l.l+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:l.l+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:l.l+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:l.l+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:l.l+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:l.l+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:l.l+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:l.l+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:l.l+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:l.l+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:l.l+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:l.l+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:l.l+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:l.l+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:l.l+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:l.l+"payment-methods/wechat.svg"}];var p=s(45);s(275),t.a=e=>{let{icons:t=[],align:s="center",className:a}=e;const c=(e=>{const t={};return e.forEach(e=>{let s={};"string"==typeof e&&(s={id:e,alt:e,src:null}),"object"==typeof e&&(s={id:e.id||"",alt:e.alt||"",src:e.src||null}),s.id&&Object(p.a)(s.id)&&!t[s.id]&&(t[s.id]=s)}),Object.values(t)})(t);if(0===c.length)return null;const o=i()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===s,"wc-block-components-payment-method-icons--align-right":"right"===s},a);return Object(n.createElement)("div",{className:o},c.map(e=>{const t={...e,...(s=e.id,u.find(e=>e.id===s)||{})};var s;return Object(n.createElement)(d,r()({key:"payment-method-icon-"+e.id},t))}))}},31:function(e,t,s){"use strict";s.d(t,"a",(function(){return c}));var a=s(0),r=s(11),n=s.n(r);function c(e){const t=Object(a.useRef)(e);return n()(e,t.current)||(t.current=e),t.current}},378:function(e,t,s){"use strict";s.d(t,"a",(function(){return a}));const a=e=>Object.values(e).reduce((e,t)=>(null!==t.icons&&(e=e.concat(t.icons)),e),[])},427:function(e,t,s){"use strict";s.r(t);var a=s(0),r=s(1),n=s(10),c=s(41),i=s(278),o=s(32),d=s(280),l=s(378),u=s(2),p=s(48),m=s(266),_=s(207),h=s(4),y=s.n(h);const b=()=>{const{paymentMethods:e}=Object(i.b)();return Object(a.createElement)(d.a,{icons:Object(l.a)(e)})};t.default=e=>{let{className:t}=e;const{cartTotals:s}=Object(o.a)(),i=Object(u.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(s.total_items,10)+parseInt(s.total_items_tax,10):parseInt(s.total_items,10);return Object(a.createElement)("div",{className:y()(t,"wc-block-mini-cart__footer")},Object(a.createElement)(n.TotalsItem,{className:"wc-block-mini-cart__footer-subtotal",currency:Object(c.getCurrencyFromPriceResponse)(s),label:Object(r.__)("Subtotal","woo-gutenberg-products-block"),value:i,description:Object(r.__)("Shipping, taxes, and discounts calculated at checkout.","woo-gutenberg-products-block")}),Object(a.createElement)("div",{className:"wc-block-mini-cart__footer-actions"},p.c&&Object(a.createElement)(m.a,{className:"wc-block-mini-cart__footer-cart",href:p.c,variant:"outlined"},Object(r.__)("View my cart","woo-gutenberg-products-block")),p.d&&Object(a.createElement)(m.a,{className:"wc-block-mini-cart__footer-checkout",href:p.d},Object(r.__)("Go to checkout","woo-gutenberg-products-block"))),Object(a.createElement)(_.a,null,Object(a.createElement)(b,null)))}},50:function(e,t,s){"use strict";s.d(t,"b",(function(){return c})),s.d(t,"a",(function(){return i}));var a=s(0),r=s(67);const n=Object(a.createContext)({isInitialized:!1,billingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},setBillingAddress:()=>{},setShippingAddress:()=>{}}),c=()=>Object(a.useContext)(n),i=e=>{let{children:t}=e;const s=Object(r.a)();return Object(a.createElement)(n.Provider,{value:s},t)}},66:function(e,t,s){"use strict";s.d(t,"a",(function(){return y}));var a=s(6),r=s(7),n=s(0),c=s(11),i=s.n(c),o=s(18),d=s(1),l=s(48),u=s(2);const p=[{destination:{address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},package_id:0,name:Object(d.__)("Shipping","woo-gutenberg-products-block"),items:[{key:"33e75ff09dd601bbe69f351039152189",name:Object(d._x)("Beanie with Logo","example product in Cart Block","woo-gutenberg-products-block"),quantity:2},{key:"6512bd43d9caa6e02c990b0a82652dca",name:Object(d._x)("Beanie","example product in Cart Block","woo-gutenberg-products-block"),quantity:1}],shipping_rates:[{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(d.__)("Free shipping","woo-gutenberg-products-block"),description:"",delivery_time:"",price:"000",taxes:"0",rate_id:"free_shipping:1",instance_id:0,meta_data:[],method_id:"flat_rate",selected:!0},{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(d.__)("Local pickup","woo-gutenberg-products-block"),description:"",delivery_time:"",price:"200",taxes:"0",rate_id:"local_pickup:1",instance_id:1,meta_data:[],method_id:"local_pickup",selected:!1}]}],m=Object(u.getSetting)("displayCartPricesIncludingTax",!1),_={coupons:[],shipping_rates:Object(u.getSetting)("shippingMethodsExist",!1)?p:[],items:[{key:"1",id:1,quantity:2,name:Object(d.__)("Beanie","woo-gutenberg-products-block"),short_description:Object(d.__)("Warm hat for winter","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-beanie",permalink:"https://example.org",low_stock_remaining:2,backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:10,src:l.l+"previews/beanie.jpg",thumbnail:l.l+"previews/beanie.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(d.__)("Color","woo-gutenberg-products-block"),value:Object(d.__)("Yellow","woo-gutenberg-products-block")},{attribute:Object(d.__)("Size","woo-gutenberg-products-block"),value:Object(d.__)("Small","woo-gutenberg-products-block")}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:m?"12000":"10000",regular_price:m?"12000":"10000",sale_price:m?"12000":"10000",raw_prices:{precision:6,price:m?"12000000":"10000000",regular_price:m?"12000000":"10000000",sale_price:m?"12000000":"10000000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:"2000",line_subtotal_tax:"400",line_total:"2000",line_total_tax:"400"},extensions:{}},{key:"2",id:2,quantity:1,name:Object(d.__)("Cap","woo-gutenberg-products-block"),short_description:Object(d.__)("Lightweight baseball cap","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-cap",permalink:"https://example.org",backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:11,src:l.l+"previews/cap.jpg",thumbnail:l.l+"previews/cap.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(d.__)("Color","woo-gutenberg-products-block"),value:Object(d.__)("Orange","woo-gutenberg-products-block")}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:m?"2400":"2000",regular_price:m?"2400":"2000",sale_price:m?"2400":"2000",raw_prices:{precision:6,price:m?"24000000":"20000000",regular_price:m?"24000000":"20000000",sale_price:m?"24000000":"20000000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:"2000",line_subtotal_tax:"400",line_total:"2000",line_total_tax:"400"},extensions:{}}],fees:[{id:"fee",name:Object(d.__)("Fee","woo-gutenberg-products-block"),totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total:"100",total_tax:"20",tax_lines:[{name:Object(d.__)("Sales tax","woo-gutenberg-products-block"),rate:"20%",price:"20"}]}}],items_count:3,items_weight:0,needs_payment:!0,needs_shipping:Object(u.getSetting)("shippingEnabled",!0),has_calculated_shipping:!0,shipping_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},billing_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total_items:"4000",total_items_tax:"800",total_fees:"100",total_fees_tax:"20",total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_tax:"820",total_price:"4920",tax_lines:[{name:Object(d.__)("Sales tax","woo-gutenberg-products-block"),rate:"20%",price:"820"}]},errors:[],payment_requirements:["products"],extensions:{}};var h=s(69);const y=()=>{const{shippingRates:e,needsShipping:t,hasCalculatedShipping:s,isLoadingRates:c}=Object(r.useSelect)(e=>{const t=!!e("core/editor"),s=e(a.CART_STORE_KEY);return{shippingRates:t?_.shipping_rates:s.getShippingRates(),needsShipping:t?_.needs_shipping:s.getNeedsShipping(),hasCalculatedShipping:t?_.has_calculated_shipping:s.getHasCalculatedShipping(),isLoadingRates:!t&&s.isCustomerDataUpdating()}}),{isSelectingRate:d,selectShippingRate:l}=Object(h.a)(),u=Object(n.useRef)({});return Object(n.useEffect)(()=>{const t=(e=>Object.fromEntries(e.map(e=>{var t;let{package_id:s,shipping_rates:a}=e;return[s,null===(t=a.find(e=>e.selected))||void 0===t?void 0:t.rate_id]})))(e);Object(o.a)(t)&&!i()(u.current,t)&&(u.current=t)},[e]),{isSelectingRate:d,selectedRates:u.current,selectShippingRate:l,shippingRates:e,needsShipping:t,hasCalculatedShipping:s,isLoadingRates:c}}},67:function(e,t,s){"use strict";s.d(t,"a",(function(){return n}));var a=s(7),r=s(6);const n=()=>{const{customerData:e,isInitialized:t}=Object(a.useSelect)(e=>{const t=e(r.CART_STORE_KEY);return{customerData:t.getCustomerData(),isInitialized:t.hasFinishedResolution("getCartData")}}),{setShippingAddress:s,setBillingAddress:n}=Object(a.useDispatch)(r.CART_STORE_KEY);return{isInitialized:t,billingAddress:e.billingAddress,shippingAddress:e.shippingAddress,setBillingAddress:n,setShippingAddress:s}}},69:function(e,t,s){"use strict";s.d(t,"a",(function(){return o}));var a=s(7),r=s(0),n=s(6),c=s(73),i=s(59);const o=()=>{const e=Object(c.a)(),{dispatchCheckoutEvent:t}=Object(i.a)(),{selectShippingRate:s}=Object(a.useDispatch)(n.CART_STORE_KEY);return{selectShippingRate:Object(r.useCallback)((a,r)=>{s(a,r).then(()=>{t("set-selected-shipping-rate",{shippingRateId:a})}).catch(t=>{e(t)})},[s,t,e]),isSelectingRate:Object(a.useSelect)(e=>e(n.CART_STORE_KEY).isShippingRateBeingSelected(),[])}}},73:function(e,t,s){"use strict";s.d(t,"a",(function(){return r}));var a=s(0);const r=()=>{const[,e]=Object(a.useState)();return Object(a.useCallback)(t=>{e(()=>{throw t})},[])}}}]); \ No newline at end of file diff --git a/build/mini-cart-contents-block/items-frontend.js b/build/mini-cart-contents-block/items-frontend.js new file mode 100644 index 00000000000..9a1b137ae73 --- /dev/null +++ b/build/mini-cart-contents-block/items-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[53],{425:function(c,e,n){"use strict";n.r(e);var s=n(0),t=n(4),a=n.n(t);e.default=c=>{let{children:e,className:n}=c;return Object(s.createElement)("div",{className:a()(n,"wc-block-mini-cart__items"),tabIndex:-1},e)}}}]); \ No newline at end of file diff --git a/build/mini-cart-contents-block/products-table-frontend.js b/build/mini-cart-contents-block/products-table-frontend.js new file mode 100644 index 00000000000..8f8963d9ccb --- /dev/null +++ b/build/mini-cart-contents-block/products-table-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[54],{426:function(c,e,t){"use strict";t.r(e);var a=t(0),s=t(32),n=t(4),i=t.n(n),l=t(343);e.default=c=>{let{className:e}=c;const{cartItems:t,cartIsLoading:n}=Object(s.a)();return Object(a.createElement)("div",{className:i()(e,"wc-block-mini-cart__products-table")},Object(a.createElement)(l.a,{lineItems:t,isLoading:n,className:"wc-block-mini-cart-items"}))}}}]); \ No newline at end of file diff --git a/build/mini-cart-contents-block/shopping-button-frontend.js b/build/mini-cart-contents-block/shopping-button-frontend.js new file mode 100644 index 00000000000..5589cd7ccc2 --- /dev/null +++ b/build/mini-cart-contents-block/shopping-button-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[55],{428:function(e,c,t){"use strict";t.r(c);var n=t(0),o=t(1),s=t(48),a=t(4),l=t.n(a);c.default=e=>{let{className:c}=e;return s.i?Object(n.createElement)("div",{className:l()(c,"wc-block-mini-cart__shopping-button")},Object(n.createElement)("a",{href:s.i},Object(o.__)("Start shopping","woo-gutenberg-products-block"))):null}}}]); \ No newline at end of file diff --git a/build/mini-cart-contents-block/title-frontend.js b/build/mini-cart-contents-block/title-frontend.js new file mode 100644 index 00000000000..55a3c4276e7 --- /dev/null +++ b/build/mini-cart-contents-block/title-frontend.js @@ -0,0 +1,3 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[56],{424:function(t,c,e){"use strict";e.r(c);var o=e(0),r=e(1),s=e(32),a=e(4),n=e.n(a);c.default=t=>{let{className:c}=t;const{cartItemsCount:e,cartIsLoading:a}=Object(s.a)();return Object(o.createElement)("h2",{className:n()(c,"wc-block-mini-cart__title")},a?Object(r.__)("Your cart","woo-gutenberg-products-block"):Object(r.sprintf)( +/* translators: %d is the count of items in the cart. */ +Object(r._n)("Your cart (%d item)","Your cart (%d items)",e,"woo-gutenberg-products-block"),e))}}}]); \ No newline at end of file diff --git a/build/mini-cart-contents.asset.php b/build/mini-cart-contents.asset.php new file mode 100644 index 00000000000..dfb3f294bcf --- /dev/null +++ b/build/mini-cart-contents.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '310ba23255e6993c4b06aabde2652ea4'); \ No newline at end of file diff --git a/build/mini-cart-contents.js b/build/mini-cart-contents.js new file mode 100644 index 00000000000..dc241392d7b --- /dev/null +++ b/build/mini-cart-contents.js @@ -0,0 +1,21 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["mini-cart-contents"]=function(e){function t(t){for(var c,s,a=t[0],i=t[1],l=t[2],d=0,m=[];d"string"==typeof e},101:function(e,t){e.exports=window.wp.warning},102:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return l}));var c=r(0),n=r(7),o=r(22),s=r.n(o);const a=Object(c.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),i=()=>Object(c.useContext)(a),l=e=>{let{children:t}=e;const[r,o]=Object(c.useState)({}),i=Object(c.useCallback)(e=>r[e],[r]),l=Object(c.useCallback)(e=>{const t=r[e];return!t||t.hidden?"":"validate-error-"+e},[r]),u=Object(c.useCallback)(e=>{o(t=>{if(!t[e])return t;const{[e]:r,...c}=t;return c})},[]),d=Object(c.useCallback)(()=>{o({})},[]),m=Object(c.useCallback)(e=>{e&&o(t=>(e=Object(n.pickBy)(e,(e,r)=>!("string"!=typeof e.message||t.hasOwnProperty(r)&&s()(t[r],e))),0===Object.values(e).length?t:{...t,...e}))},[]),p=Object(c.useCallback)((e,t)=>{o(r=>{if(!r.hasOwnProperty(e))return r;const c={...r[e],...t};return s()(r[e],c)?r:{...r,[e]:c}})},[]),b={getValidationError:i,setValidationErrors:m,clearValidationError:u,clearAllValidationErrors:d,hideValidationError:Object(c.useCallback)(e=>{p(e,{hidden:!0})},[p]),showValidationError:Object(c.useCallback)(e=>{p(e,{hidden:!1})},[p]),showAllValidationErrors:Object(c.useCallback)(()=>{o(e=>{const t={};return Object.keys(e).forEach(r=>{e[r].hidden&&(t[r]={...e[r],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(r).length>0,getValidationErrorId:l};return Object(c.createElement)(a.Provider,{value:b},t)}},109:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var c=r(12);function n(e,t){const r=Object(c.useRef)();return Object(c.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},11:function(e,t){e.exports=window.wp.primitives},110:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var c=r(9),n=r(0),o=r(17),s=r(124),a=r(78);const i=()=>{const e=Object(s.a)(),{dispatchCheckoutEvent:t}=Object(a.a)(),{selectShippingRate:r}=Object(c.useDispatch)(o.CART_STORE_KEY);return{selectShippingRate:Object(n.useCallback)((c,n)=>{r(c,n).then(()=>{t("set-selected-shipping-rate",{shippingRateId:c})}).catch(t=>{e(t)})},[r,t,e]),isSelectingRate:Object(c.useSelect)(e=>e(o.CART_STORE_KEY).isShippingRateBeingSelected(),[])}}},115:function(e,t,r){"use strict";var c=r(6),n=r.n(c),o=r(0),s=r(13),a=r(4),i=r.n(a);r(151),t.a=e=>{let{className:t="",disabled:r=!1,name:c,permalink:a="",target:l,rel:u,style:d,onClick:m,...p}=e;const b=i()("wc-block-components-product-name",t);if(r){const e=p;return Object(o.createElement)("span",n()({className:b},e,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(c)}}))}return Object(o.createElement)("a",n()({className:b,href:a,target:l},p,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(c)},style:d}))}},116:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var c=r(9);const n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=Object(c.select)("core/notices").getNotices(),{removeNotice:n}=Object(c.dispatch)("core/notices"),o=r.filter(t=>t.status===e);o.forEach(e=>n(e.id,t))}},117:function(e,t,r){"use strict";var c=r(0),n=r(87),o=r(60);const s=e=>{const t=e.indexOf("

");return-1===t?e:e.substr(0,t+4)},a=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),i=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,l=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…";const c=a(e),n=c.split(" ").splice(0,t).join(" ");return Object(o.autop)(i(n,r))},u=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…";const n=a(e),s=n.slice(0,t);if(r)return Object(o.autop)(i(s,c));const l=s.match(/([\s]+)/g),u=l?l.length:0,d=n.slice(0,t+u);return Object(o.autop)(i(d,c))};t.a=e=>{let{source:t,maxLength:r=15,countType:a="words",className:i="",style:d={}}=e;const m=Object(c.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const c=Object(o.autop)(e),a=Object(n.count)(c,r);if(a<=t)return c;const i=s(c),d=Object(n.count)(i,r);return d<=t?i:"words"===r?l(i,t):u(i,t,"characters_including_spaces"===r)}(t,r,a),[t,r,a]);return Object(c.createElement)(c.RawHTML,{style:d,className:i},m)}},12:function(e,t){e.exports=window.React},124:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var c=r(0);const n=()=>{const[,e]=Object(c.useState)();return Object(c.useCallback)(t=>{e(()=>{throw t})},[])}},13:function(e,t){e.exports=window.wp.htmlEntities},131:function(e,t){},148:function(e,t,r){"use strict";var c=r(6),n=r.n(c),o=r(0),s=r(4),a=r.n(s);const i=e=>"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--"+e;var l=e=>{let{id:t,src:r=null,alt:c=""}=e;return r?Object(o.createElement)("img",{className:i(t),src:r,alt:c}):null},u=r(23);const d=[{id:"alipay",alt:"Alipay",src:u.m+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:u.m+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:u.m+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:u.m+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:u.m+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:u.m+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:u.m+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:u.m+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:u.m+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:u.m+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:u.m+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:u.m+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:u.m+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:u.m+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:u.m+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:u.m+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:u.m+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:u.m+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:u.m+"payment-methods/wechat.svg"}];var m=r(100);r(189),t.a=e=>{let{icons:t=[],align:r="center",className:c}=e;const s=(e=>{const t={};return e.forEach(e=>{let r={};"string"==typeof e&&(r={id:e,alt:e,src:null}),"object"==typeof e&&(r={id:e.id||"",alt:e.alt||"",src:e.src||null}),r.id&&Object(m.a)(r.id)&&!t[r.id]&&(t[r.id]=r)}),Object.values(t)})(t);if(0===s.length)return null;const i=a()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===r,"wc-block-components-payment-method-icons--align-right":"right"===r},c);return Object(o.createElement)("div",{className:i},s.map(e=>{const t={...e,...(r=e.id,d.find(e=>e.id===r)||{})};var r;return Object(o.createElement)(l,n()({key:"payment-method-icon-"+e.id},t))}))}},15:function(e,t){e.exports=window.wp.url},151:function(e,t){},152:function(e,t){},153:function(e,t){},154:function(e,t){},159:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));const c=e=>"number"==typeof e},164:function(e,t,r){"use strict";r.d(t,"b",(function(){return U})),r.d(t,"a",(function(){return V}));var c=r(0),n=r(35),o=r(9);let s,a;!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(s||(s={})),function(e){e.SET_REGISTERED_PAYMENT_METHODS="set_registered_payment_methods",e.SET_REGISTERED_EXPRESS_PAYMENT_METHODS="set_registered_express_payment_methods",e.SET_SHOULD_SAVE_PAYMENT_METHOD="set_should_save_payment_method",e.SET_ACTIVE_PAYMENT_METHOD="set_active_payment_method"}(a||(a={}));const i={currentStatus:s.PRISTINE,shouldSavePaymentMethod:!1,activePaymentMethod:"",paymentMethodData:{payment_method:""},errorMessage:"",paymentMethods:{},expressPaymentMethods:{}},l={setPaymentStatus:()=>({pristine:()=>{},started:()=>{},processing:()=>{},completed:()=>{},error:e=>{},failed:(e,t)=>{},success:(e,t)=>{}}),currentStatus:{isPristine:!0,isStarted:!1,isProcessing:!1,isFinished:!1,hasError:!1,hasFailed:!1,isSuccessful:!1,isDoingExpressPayment:!1},paymentStatuses:s,paymentMethodData:{},errorMessage:"",activePaymentMethod:"",activeSavedToken:"",setActivePaymentMethod:()=>{},customerPaymentMethods:{},paymentMethods:{},expressPaymentMethods:{},paymentMethodsInitialized:!1,expressPaymentMethodsInitialized:!1,onPaymentProcessing:()=>()=>()=>{},setExpressPaymentError:()=>{},isExpressPaymentMethodActive:!1,setShouldSavePayment:()=>{},shouldSavePayment:!1};var u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,{type:t,paymentMethodData:r,shouldSavePaymentMethod:c=!1,errorMessage:n="",paymentMethods:o={},paymentMethod:l=""}=arguments.length>1?arguments[1]:void 0;switch(t){case s.PRISTINE:return{...i,...e,errorMessage:"",currentStatus:s.PRISTINE};case s.STARTED:return{...e,currentStatus:s.STARTED};case s.ERROR:return e.currentStatus!==s.ERROR?{...e,currentStatus:s.ERROR,errorMessage:n||e.errorMessage}:e;case s.FAILED:return e.currentStatus!==s.FAILED?{...e,currentStatus:s.FAILED,paymentMethodData:r||e.paymentMethodData,errorMessage:n||e.errorMessage}:e;case s.SUCCESS:return e.currentStatus!==s.SUCCESS?{...e,currentStatus:s.SUCCESS,paymentMethodData:r||e.paymentMethodData}:e;case s.PROCESSING:return e.currentStatus!==s.PROCESSING?{...e,currentStatus:s.PROCESSING,errorMessage:""}:e;case s.COMPLETE:return e.currentStatus!==s.COMPLETE?{...e,currentStatus:s.COMPLETE}:e;case a.SET_REGISTERED_PAYMENT_METHODS:return{...e,paymentMethods:o};case a.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:return{...e,expressPaymentMethods:o};case a.SET_SHOULD_SAVE_PAYMENT_METHOD:return{...e,shouldSavePaymentMethod:c};case a.SET_ACTIVE_PAYMENT_METHOD:return{...e,activePaymentMethod:l,paymentMethodData:r||e.paymentMethodData}}},d=r(1),m=r(42),p=r(49),b=r(2),_=r(112),E=r(51),g=r.n(E),O=r(59),h=r(72),f=r(41),y=r(37),j=r(80);const S=(e,t,r,n)=>{const[s,a]=Object(c.useState)(!1),{isEditor:i}=Object(O.b)(),{selectedRates:l}=Object(j.a)(),{billingAddress:u,shippingAddress:m}=Object(h.b)(),E=Object(p.a)(l),y=Object(p.a)(r),S=Object(f.a)(),{cartTotals:v,cartIsLoading:k,cartNeedsShipping:w,paymentRequirements:C}=S,P=Object(c.useRef)({cart:S,cartTotals:v,cartNeedsShipping:w,billingData:u,billingAddress:u,shippingAddress:m,selectedShippingMethods:E,paymentRequirements:C}),{createErrorNotice:R}=Object(o.useDispatch)("core/notices");Object(c.useEffect)(()=>{P.current={cart:S,cartTotals:v,cartNeedsShipping:w,get billingData(){return g()("billingData",{alternative:"billingAddress",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-blocks/pull/6369"}),this.billingAddress},billingAddress:u,shippingAddress:m,selectedShippingMethods:E,paymentRequirements:C}},[S,v,w,u,m,E,C]);const T=Object(c.useCallback)(async()=>{let r={};const c=e=>{r={...r,[e.name]:e}};for(let e=0;e{k||N()},[N,S,E,u,k]),s},v=e=>({type:e}),k=e=>({type:s.ERROR,errorMessage:e}),w=e=>{let{errorMessage:t,paymentMethodData:r}=e;return{type:s.FAILED,errorMessage:t,paymentMethodData:r}},C=e=>{let{paymentMethodData:t}=e;return{type:s.SUCCESS,paymentMethodData:t}},P=e=>({type:a.SET_REGISTERED_PAYMENT_METHODS,paymentMethods:e}),R=e=>({type:a.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,paymentMethods:e}),T=e=>({type:a.SET_SHOULD_SAVE_PAYMENT_METHOD,shouldSavePaymentMethod:e}),N=(e,t)=>({type:a.SET_ACTIVE_PAYMENT_METHOD,paymentMethod:e,paymentMethodData:t});var A=r(88),I=r(54),M=r(94),x=r(238);var D=r(239),B=r(102);const L=Object(c.createContext)(l),U=()=>Object(c.useContext)(L),V=e=>{let{children:t}=e;const{isProcessing:r,isIdle:a,isCalculating:l,hasError:d}=Object(I.b)(),{isEditor:p,getPreviewData:_}=Object(O.b)(),{setValidationErrors:E}=Object(B.b)(),{createErrorNotice:g,removeNotice:h}=Object(o.useDispatch)("core/notices"),{isSuccessResponse:f,isErrorResponse:j,isFailResponse:U,noticeContexts:V}=Object(y.d)(),[G,F]=Object(c.useReducer)(M.b,{}),{onPaymentProcessing:q}=(e=>Object(c.useMemo)(()=>({onPaymentProcessing:Object(x.a)("payment_processing",e)}),[e]))(F),Y=Object(c.useRef)(G);Object(c.useEffect)(()=>{Y.current=G},[G]);const[H,z]=Object(c.useReducer)(u,i),{dispatchActions:$,setPaymentStatus:W}=(e=>{const{setBillingAddress:t,setShippingAddress:r}=Object(A.a)();return{dispatchActions:Object(c.useMemo)(()=>({setRegisteredPaymentMethods:t=>{e(P(t))},setRegisteredExpressPaymentMethods:t=>{e(R(t))},setShouldSavePayment:t=>{e(T(t))},setActivePaymentMethod:function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e(N(t,r))}}),[e]),setPaymentStatus:Object(c.useCallback)(()=>({pristine:()=>e(v(s.PRISTINE)),started:()=>e(v(s.STARTED)),processing:()=>e(v(s.PROCESSING)),completed:()=>e(v(s.COMPLETE)),error:t=>e(k(t)),failed:function(r,c){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;n&&t(n),e(w({errorMessage:r||"",paymentMethodData:c||{}}))},success:function(c){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;n&&t(n),void 0!==typeof o&&null!=o&&o.address&&r(o.address),e(C({paymentMethodData:c}))}}),[e,t,r])}})(z),K=(e=>{const t=Object(m.getPaymentMethods)(),{noticeContexts:r}=Object(y.d)(),c=new Set([...Object(b.getSetting)("paymentGatewaySortOrder",[]),...Object.keys(t)]);return S(e,t,Array.from(c),r.PAYMENTS)})($.setRegisteredPaymentMethods),X=(e=>{const t=Object(m.getExpressPaymentMethods)(),{noticeContexts:r}=Object(y.d)();return S(e,t,Object.keys(t),r.EXPRESS_PAYMENTS)})($.setRegisteredExpressPaymentMethods),Q=Object(c.useMemo)(()=>p?_("previewSavedPaymentMethods"):K?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===Object.keys(e).length)return{};const t=Object(b.getSetting)("customerPaymentMethods",{}),r=Object.keys(t),c={};return r.forEach(r=>{const n=t[r].filter(t=>{var r;let{method:{gateway:c}}=t;return c in e&&(null===(r=e[c].supports)||void 0===r?void 0:r.showSavedCards)});n.length&&(c[r]=n)}),c}(H.paymentMethods):{},[p,_,K,H.paymentMethods]),J=Object(c.useCallback)(e=>{e?g(e,{id:"wc-express-payment-error",context:V.EXPRESS_PAYMENTS}):h("wc-express-payment-error",V.EXPRESS_PAYMENTS)},[g,V.EXPRESS_PAYMENTS,h]),Z=Object.keys(H.expressPaymentMethods).includes(H.activePaymentMethod),ee=Object(c.useMemo)(()=>({isPristine:H.currentStatus===s.PRISTINE,isStarted:H.currentStatus===s.STARTED,isProcessing:H.currentStatus===s.PROCESSING,isFinished:[s.ERROR,s.FAILED,s.SUCCESS].includes(H.currentStatus),hasError:H.currentStatus===s.ERROR,hasFailed:H.currentStatus===s.FAILED,isSuccessful:H.currentStatus===s.SUCCESS,isDoingExpressPayment:H.currentStatus!==s.PRISTINE&&Z}),[H.currentStatus,Z]);Object(c.useEffect)(()=>{const e=Object.keys(H.paymentMethods);if(!K||!e.length)return;const t=[...e,...Object.keys(H.expressPaymentMethods)];if(H.activePaymentMethod&&t.includes(H.activePaymentMethod))return;W().pristine();const r=Object.keys(Q).flatMap(e=>Q[e])[0]||void 0;if(r){const e=r.tokenId.toString(),t=r.method.gateway,c=`wc-${t}-payment-token`;$.setActivePaymentMethod(t,{token:e,payment_method:t,[c]:e,isSavedToken:!0})}else $.setActivePaymentMethod(Object.keys(H.paymentMethods)[0])},[K,H.paymentMethods,H.expressPaymentMethods,$,W,H.activePaymentMethod,Q]),Object(c.useEffect)(()=>{!r||d||l||ee.isFinished||W().processing()},[r,d,l,ee.isFinished,W]),Object(c.useEffect)(()=>{a&&!ee.isSuccessful&&W().pristine()},[a,ee.isSuccessful,W]),Object(c.useEffect)(()=>{d&&ee.isSuccessful&&W().pristine()},[d,ee.isSuccessful,W]),Object(c.useEffect)(()=>{ee.isProcessing&&(h("wc-payment-error",V.PAYMENTS),Object(D.b)(Y.current,"payment_processing",{}).then(e=>{let t,r;var c,n,o,s,a,i;if(e.forEach(e=>{f(e)&&(t=e),(j(e)||U(e))&&(r=e)}),t&&!r)W().success(null===(c=t)||void 0===c||null===(n=c.meta)||void 0===n?void 0:n.paymentMethodData,null===(o=t)||void 0===o||null===(s=o.meta)||void 0===s?void 0:s.billingAddress,null===(a=t)||void 0===a||null===(i=a.meta)||void 0===i?void 0:i.shippingData);else if(r&&U(r)){var l,u,d,m,p,b;r.message&&r.message.length&&g(r.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(b=r)||void 0===b?void 0:b.messageContext)||V.PAYMENTS}),W().failed(null===(l=r)||void 0===l?void 0:l.message,null===(u=r)||void 0===u||null===(d=u.meta)||void 0===d?void 0:d.paymentMethodData,null===(m=r)||void 0===m||null===(p=m.meta)||void 0===p?void 0:p.billingAddress)}else if(r){var _,O;r.message&&r.message.length&&g(r.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(O=r)||void 0===O?void 0:O.messageContext)||V.PAYMENTS}),W().error(r.message),E(null===(_=r)||void 0===_?void 0:_.validationErrors)}else W().success()}))},[ee.isProcessing,E,W,h,V.PAYMENTS,f,U,j,g]);const te="object"==typeof H.paymentMethodData&&Object(n.b)(H.paymentMethodData,"token")?H.paymentMethodData.token+"":"",re={setPaymentStatus:W,currentStatus:ee,paymentStatuses:s,paymentMethodData:H.paymentMethodData,errorMessage:H.errorMessage,activePaymentMethod:H.activePaymentMethod,activeSavedToken:te,setActivePaymentMethod:$.setActivePaymentMethod,onPaymentProcessing:q,customerPaymentMethods:Q,paymentMethods:H.paymentMethods,expressPaymentMethods:H.expressPaymentMethods,paymentMethodsInitialized:K,expressPaymentMethodsInitialized:X,setExpressPaymentError:J,isExpressPaymentMethodActive:Z,shouldSavePayment:H.shouldSavePaymentMethod,setShouldSavePayment:$.setShouldSavePayment};return Object(c.createElement)(L.Provider,{value:re},t)}},17:function(e,t){e.exports=window.wc.wcBlocksData},171:function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return a}));var c=r(49),n=r(164);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{paymentMethods:t,expressPaymentMethods:r,paymentMethodsInitialized:o,expressPaymentMethodsInitialized:s}=Object(n.b)(),a=Object(c.a)(t),i=Object(c.a)(r);return{paymentMethods:e?i:a,isInitialized:e?s:o}},s=()=>o(!1),a=()=>o(!0)},18:function(e,t){e.exports=window.wc.blocksCheckout},185:function(e,t){},186:function(e,t){},187:function(e,t){},188:function(e,t){},189:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},209:function(e,t,r){"use strict";var c=r(0),n=r(4),o=r.n(n),s=r(1),a=r(45),i=r(53),l=r(112);r(249);var u=e=>{let{className:t,quantity:r=1,minimum:n=1,maximum:u,onChange:d=(()=>{}),step:m=1,itemName:p="",disabled:b}=e;const _=o()("wc-block-components-quantity-selector",t),E=void 0!==u,g=r-m>=n,O=!E||r+m<=u,h=Object(c.useCallback)(e=>{let t=e;E&&(t=Math.min(t,Math.floor(u/m)*m)),t=Math.max(t,Math.ceil(n/m)*m),t=Math.floor(t/m)*m,t!==e&&d(t)},[E,u,n,d,m]),f=Object(l.a)(h,300);Object(c.useLayoutEffect)(()=>{h(r)},[r,h]);const y=Object(c.useCallback)(e=>{const t=void 0!==typeof e.key?"ArrowDown"===e.key:e.keyCode===i.DOWN,c=void 0!==typeof e.key?"ArrowUp"===e.key:e.keyCode===i.UP;t&&g&&(e.preventDefault(),d(r-m)),c&&O&&(e.preventDefault(),d(r+m))},[r,d,O,g,m]);return Object(c.createElement)("div",{className:_},Object(c.createElement)("input",{className:"wc-block-components-quantity-selector__input",disabled:b,type:"number",step:m,min:n,max:u,value:r,onKeyDown:y,onChange:e=>{let t=parseInt(e.target.value,10);t=isNaN(t)?r:t,t!==r&&(d(t),f(t))},"aria-label":Object(s.sprintf)( +/* translators: %s refers to the item name in the cart. */ +Object(s.__)("Quantity of %s in your cart.","woo-gutenberg-products-block"),p)}),Object(c.createElement)("button",{"aria-label":Object(s.__)("Reduce quantity","woo-gutenberg-products-block"),className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus",disabled:b||!g,onClick:()=>{const e=r-m;d(e),Object(a.speak)(Object(s.sprintf)( +/* translators: %s refers to the item name in the cart. */ +Object(s.__)("Quantity reduced to %s.","woo-gutenberg-products-block"),e)),h(e)}},"-"),Object(c.createElement)("button",{"aria-label":Object(s.__)("Increase quantity","woo-gutenberg-products-block"),disabled:b||!O,className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus",onClick:()=>{const e=r+m;d(e),Object(a.speak)(Object(s.sprintf)( +/* translators: %s refers to the item name in the cart. */ +Object(s.__)("Quantity increased to %s.","woo-gutenberg-products-block"),e)),h(e)}},"+"))},d=r(92),m=r(115),p=r(9),b=r(17),_=r(284),E=r(109),g=r(236),O=r(35),h=r(100),f=r(159),y=r(41),j=r(54);var S=r(78),v=r(222),k=r(223),w=r(224),C=r(38),P=r(79),R=e=>{let{currency:t,saleAmount:r,format:n=""}=e;if(!r||r<=0)return null;n.includes("")||(n="",console.error("Price formats need to include the `` tag."));const o=Object(s.sprintf)( +/* translators: %s will be replaced by the discount amount */ +Object(s.__)("Save %s","woo-gutenberg-products-block"),n);return Object(c.createElement)(P.a,{className:"wc-block-components-sale-badge"},Object(c.createInterpolateElement)(o,{price:Object(c.createElement)(C.a,{currency:t,value:r})}))},T=r(225),N=r(26),A=r(18),I=r(111),M=r(2);const x=(e,t)=>e.convertPrecision(t.minorUnit).getAmount(),D=e=>Object(A.mustContain)(e,"");var B=Object(c.forwardRef)((e,t)=>{let{lineItem:r,onRemove:n=(()=>{}),tabIndex:i=null}=e;const{name:l="",catalog_visibility:C="visible",short_description:P="",description:B="",low_stock_remaining:L=null,show_backorder_badge:U=!1,quantity_limits:V={minimum:1,maximum:99,multiple_of:1,editable:!0},sold_individually:G=!1,permalink:F="",images:q=[],variation:Y=[],item_data:H=[],prices:z={currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",price:"0",regular_price:"0",sale_price:"0",price_range:null,raw_prices:{precision:6,price:"0",regular_price:"0",sale_price:"0"}},totals:$={currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",line_subtotal:"0",line_subtotal_tax:"0"},extensions:W}=r,{quantity:K,setItemQuantity:X,removeItem:Q,isPendingDelete:J}=(e=>{const t={key:"",quantity:1};(e=>Object(O.a)(e)&&Object(O.b)(e,"key")&&Object(O.b)(e,"quantity")&&Object(h.a)(e.key)&&Object(f.a)(e.quantity))(e)&&(t.key=e.key,t.quantity=e.quantity);const{key:r="",quantity:n=1}=t,{cartErrors:o}=Object(y.a)(),{dispatchActions:s}=Object(j.b)(),[a,i]=Object(c.useState)(n),[l]=Object(_.a)(a,400),u=Object(E.a)(l),{removeItemFromCart:d,changeCartItemQuantity:m}=Object(p.useDispatch)(b.CART_STORE_KEY);Object(c.useEffect)(()=>i(n),[n]);const S=Object(p.useSelect)(e=>{if(!r)return{quantity:!1,delete:!1};const t=e(b.CART_STORE_KEY);return{quantity:t.isItemPendingQuantity(r),delete:t.isItemPendingDelete(r)}},[r]),v=Object(c.useCallback)(()=>r?d(r).then(()=>(Object(g.c)(),!0)):Promise.resolve(!1),[r,d]);return Object(c.useEffect)(()=>{r&&Object(f.a)(u)&&Number.isFinite(u)&&u!==l&&m(r,l)},[r,m,l,u]),Object(c.useEffect)(()=>(S.delete?s.incrementCalculating():s.decrementCalculating(),()=>{S.delete&&s.decrementCalculating()}),[s,S.delete]),Object(c.useEffect)(()=>(S.quantity||l!==a?s.incrementCalculating():s.decrementCalculating(),()=>{(S.quantity||l!==a)&&s.decrementCalculating()}),[s,S.quantity,l,a]),{isPendingDelete:S.delete,quantity:a,setItemQuantity:i,removeItem:v,cartItemQuantityErrors:o}})(r),{dispatchStoreEvent:Z}=Object(S.a)(),{receiveCart:ee,...te}=Object(y.a)(),re=Object(c.useMemo)(()=>({context:"cart",cartItem:r,cart:te}),[r,te]),ce=Object(N.getCurrencyFromPriceResponse)(z),ne=Object(A.__experimentalApplyCheckoutFilter)({filterName:"itemName",defaultValue:l,extensions:W,arg:re}),oe=Object(I.a)({amount:parseInt(z.raw_prices.regular_price,10),precision:z.raw_prices.precision}),se=Object(I.a)({amount:parseInt(z.raw_prices.price,10),precision:z.raw_prices.precision}),ae=oe.subtract(se),ie=ae.multiply(K),le=Object(N.getCurrencyFromPriceResponse)($);let ue=parseInt($.line_subtotal,10);Object(M.getSetting)("displayCartPricesIncludingTax",!1)&&(ue+=parseInt($.line_subtotal_tax,10));const de=Object(I.a)({amount:ue,precision:le.minorUnit}),me=q.length?q[0]:{},pe="hidden"===C||"search"===C,be=Object(A.__experimentalApplyCheckoutFilter)({filterName:"cartItemClass",defaultValue:"",extensions:W,arg:re}),_e=Object(A.__experimentalApplyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"",extensions:W,arg:re,validation:D}),Ee=Object(A.__experimentalApplyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"",extensions:W,arg:re,validation:D}),ge=Object(A.__experimentalApplyCheckoutFilter)({filterName:"saleBadgePriceFormat",defaultValue:"",extensions:W,arg:re,validation:D});return Object(c.createElement)("tr",{className:o()("wc-block-cart-items__row",be,{"is-disabled":J}),ref:t,tabIndex:i},Object(c.createElement)("td",{className:"wc-block-cart-item__image","aria-hidden":!Object(O.b)(me,"alt")||!me.alt},pe?Object(c.createElement)(v.a,{image:me,fallbackAlt:ne}):Object(c.createElement)("a",{href:F,tabIndex:-1},Object(c.createElement)(v.a,{image:me,fallbackAlt:ne}))),Object(c.createElement)("td",{className:"wc-block-cart-item__product"},Object(c.createElement)("div",{className:"wc-block-cart-item__wrap"},Object(c.createElement)(m.a,{disabled:J||pe,name:ne,permalink:F}),U?Object(c.createElement)(k.a,null):!!L&&Object(c.createElement)(w.a,{lowStockRemaining:L}),Object(c.createElement)("div",{className:"wc-block-cart-item__prices"},Object(c.createElement)(d.a,{currency:ce,regularPrice:x(oe,ce),price:x(se,ce),format:Ee})),Object(c.createElement)(R,{currency:ce,saleAmount:x(ae,ce),format:ge}),Object(c.createElement)(T.a,{shortDescription:P,fullDescription:B,itemData:H,variation:Y}),Object(c.createElement)("div",{className:"wc-block-cart-item__quantity"},!G&&!!V.editable&&Object(c.createElement)(u,{disabled:J,quantity:K,minimum:V.minimum,maximum:V.maximum,step:V.multiple_of,onChange:e=>{X(e),Z("cart-set-item-quantity",{product:r,quantity:e})},itemName:ne}),Object(c.createElement)("button",{className:"wc-block-cart-item__remove-link",onClick:()=>{n(),Q(),Z("cart-remove-item",{product:r,quantity:K}),Object(a.speak)(Object(s.sprintf)( +/* translators: %s refers to the item name in the cart. */ +Object(s.__)("%s has been removed from your cart.","woo-gutenberg-products-block"),ne))},disabled:J},Object(s.__)("Remove item","woo-gutenberg-products-block"))))),Object(c.createElement)("td",{className:"wc-block-cart-item__total"},Object(c.createElement)("div",{className:"wc-block-cart-item__total-price-and-sale-badge-wrapper"},Object(c.createElement)(d.a,{currency:le,format:_e,price:de.getAmount()}),K>1&&Object(c.createElement)(R,{currency:ce,saleAmount:x(ie,ce),format:ge}))))});const L=[...Array(3)].map((_x,e)=>Object(c.createElement)(B,{lineItem:{},key:e})),U=e=>{const t={};return e.forEach(e=>{let{key:r}=e;t[r]=Object(c.createRef)()}),t};t.a=e=>{let{lineItems:t=[],isLoading:r=!1,className:n}=e;const a=Object(c.useRef)(null),i=Object(c.useRef)(U(t));Object(c.useEffect)(()=>{i.current=U(t)},[t]);const l=e=>()=>{null!=i&&i.current&&e&&i.current[e].current instanceof HTMLElement?i.current[e].current.focus():a.current instanceof HTMLElement&&a.current.focus()},u=r?L:t.map((e,r)=>{const n=t.length>r+1?t[r+1].key:null;return Object(c.createElement)(B,{key:e.key,lineItem:e,onRemove:l(n),ref:i.current[e.key],tabIndex:-1})});return Object(c.createElement)("table",{className:o()("wc-block-cart-items",n),ref:a,tabIndex:-1},Object(c.createElement)("thead",null,Object(c.createElement)("tr",{className:"wc-block-cart-items__header"},Object(c.createElement)("th",{className:"wc-block-cart-items__header-image"},Object(c.createElement)("span",null,Object(s.__)("Product","woo-gutenberg-products-block"))),Object(c.createElement)("th",{className:"wc-block-cart-items__header-product"},Object(c.createElement)("span",null,Object(s.__)("Details","woo-gutenberg-products-block"))),Object(c.createElement)("th",{className:"wc-block-cart-items__header-total"},Object(c.createElement)("span",null,Object(s.__)("Total","woo-gutenberg-products-block"))))),Object(c.createElement)("tbody",null,u))}},22:function(e,t){e.exports=window.wp.isShallowEqual},222:function(e,t,r){"use strict";var c=r(6),n=r.n(c),o=r(0),s=r(13),a=r(2);r(185),t.a=e=>{let{image:t={},fallbackAlt:r=""}=e;const c=t.thumbnail?{src:t.thumbnail,alt:Object(s.decodeEntities)(t.alt)||r||"Product Image"}:{src:a.PLACEHOLDER_IMG_SRC,alt:""};return Object(o.createElement)("img",n()({className:"wc-block-components-product-image"},c,{alt:c.alt}))}},223:function(e,t,r){"use strict";var c=r(0),n=r(1),o=r(79);t.a=()=>Object(c.createElement)(o.a,{className:"wc-block-components-product-backorder-badge"},Object(n.__)("Available on backorder","woo-gutenberg-products-block"))},224:function(e,t,r){"use strict";var c=r(0),n=r(1),o=r(79);t.a=e=>{let{lowStockRemaining:t}=e;return t?Object(c.createElement)(o.a,{className:"wc-block-components-product-low-stock-badge"},Object(n.sprintf)( +/* translators: %d stock amount (number of items in stock for product) */ +Object(n.__)("%d left in stock","woo-gutenberg-products-block"),t)):null}},225:function(e,t,r){"use strict";var c=r(0),n=r(7),o=r(13);r(188);var s=e=>{let{details:t=[]}=e;return Array.isArray(t)?(t=t.filter(e=>!e.hidden),0===t.length?null:Object(c.createElement)("ul",{className:"wc-block-components-product-details"},t.map(e=>{const t=(null==e?void 0:e.key)||e.name||"",r=t?"wc-block-components-product-details__"+Object(n.kebabCase)(t):"";return Object(c.createElement)("li",{key:t+(e.display||e.value),className:r},t&&Object(c.createElement)(c.Fragment,null,Object(c.createElement)("span",{className:"wc-block-components-product-details__name"},Object(o.decodeEntities)(t),":")," "),Object(c.createElement)("span",{className:"wc-block-components-product-details__value"},Object(o.decodeEntities)(e.display||e.value)))}))):null},a=r(117),i=r(23),l=e=>{let{className:t,shortDescription:r="",fullDescription:n=""}=e;const o=r||n;return o?Object(c.createElement)(a.a,{className:t,source:o,maxLength:15,countType:i.o.wordCountType||"words"}):null};r(187),t.a=e=>{let{shortDescription:t="",fullDescription:r="",itemData:n=[],variation:o=[]}=e;return Object(c.createElement)("div",{className:"wc-block-components-product-metadata"},Object(c.createElement)(l,{className:"wc-block-components-product-metadata__description",shortDescription:t,fullDescription:r}),Object(c.createElement)(s,{details:n}),Object(c.createElement)(s,{details:o.map(e=>{let{attribute:t="",value:r}=e;return{key:t,value:r}})}))}},23:function(e,t,r){"use strict";r.d(t,"o",(function(){return o})),r.d(t,"m",(function(){return s})),r.d(t,"l",(function(){return a})),r.d(t,"n",(function(){return i})),r.d(t,"j",(function(){return l})),r.d(t,"e",(function(){return u})),r.d(t,"f",(function(){return d})),r.d(t,"g",(function(){return m})),r.d(t,"k",(function(){return p})),r.d(t,"c",(function(){return b})),r.d(t,"d",(function(){return _})),r.d(t,"h",(function(){return E})),r.d(t,"a",(function(){return g})),r.d(t,"i",(function(){return O})),r.d(t,"b",(function(){return h}));var c,n=r(2);const o=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),s=o.pluginUrl+"images/",a=o.pluginUrl+"build/",i=o.buildPhase,l=null===(c=n.STORE_PAGES.shop)||void 0===c?void 0:c.permalink,u=n.STORE_PAGES.checkout.id,d=n.STORE_PAGES.checkout.permalink,m=n.STORE_PAGES.privacy.permalink,p=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),b=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),_=n.STORE_PAGES.cart.permalink,E=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),g=Object(n.getSetting)("allowedCountries",{}),O=Object(n.getSetting)("shippingStates",{}),h=Object(n.getSetting)("allowedStates",{})},236:function(e,t,r){"use strict";r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));const c=window.CustomEvent||null,n=(e,t)=>{let{bubbles:r=!1,cancelable:n=!1,element:o,detail:s={}}=t;if(!c)return;o||(o=document.body);const a=new c(e,{bubbles:r,cancelable:n,detail:s});o.dispatchEvent(a)};let o;const s=()=>{o&&clearTimeout(o),o=setTimeout(()=>{n("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},a=e=>{let{preserveCartData:t=!1}=e;n("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},i=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const o=()=>{n(t,{bubbles:r,cancelable:c})};return jQuery(document).on(e,o),()=>jQuery(document).off(e,o)}},237:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return s}));var c=r(90),n=(r(15),r(2));const o=(e,t)=>Object.keys(n.defaultAddressFields).every(r=>e[r]===t[r]),s=e=>{const t=Object.keys(n.defaultAddressFields),r=Object(c.a)(t,{},e.country),o=Object.assign({},e);return r.forEach(t=>{let{key:r="",hidden:c=!1}=t;c&&((e,t)=>e in t)(r,e)&&(o[r]="")}),o}},238:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var c=r(94);const n=(e,t)=>function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const o=c.a.addEventCallback(e,r,n);return t(o),()=>{t(c.a.removeEventCallback(e,o.id))}}},239:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return s}));const c=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var n=r(37);const o=async(e,t,r)=>{const n=c(e,t),o=[];for(const e of n)try{const t=await Promise.resolve(e.callback(r));"object"==typeof t&&o.push(t)}catch(e){console.error(e)}return!o.length||o},s=async(e,t,r)=>{const o=[],s=c(e,t);for(const e of s)try{const t=await Promise.resolve(e.callback(r));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(n.a)(t)||Object(n.b)(t))return o.push(t),o;o.push(t)}catch(e){return console.error(e),o.push({type:"error"}),o}return o}},244:function(e,t,r){"use strict";var c=r(0),n=r(11);const o=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));t.a=o},249:function(e,t){},26:function(e,t){e.exports=window.wc.priceFormat},3:function(e,t){e.exports=window.wp.components},310:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var c=r(8);const n=["core/paragraph","core/image","core/separator"],o=e=>[...Object(c.getBlockTypes)().filter(t=>((null==t?void 0:t.parent)||[]).includes(e)).map(e=>{let{name:t}=e;return t}),...n]},311:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var c=r(0),n=r(9),o=r(8),s=r(7);const a=e=>{let{clientId:t,registeredBlocks:r,defaultTemplate:a=[]}=e;const i=Object(c.useRef)(r),l=Object(c.useRef)(a),{insertBlock:u,replaceInnerBlocks:d}=Object(n.useDispatch)("core/block-editor"),{innerBlocks:m,registeredBlockTypes:p}=Object(n.useSelect)(e=>({innerBlocks:e("core/block-editor").getBlocks(t),registeredBlockTypes:i.current.map(e=>Object(o.getBlockType)(e))}),[t,i.current]),b=Object(c.useCallback)((e,r)=>{const c=Object(o.createBlock)(e.name);u(c,r,t,!1)},[t,u]),_=Object(c.useMemo)(()=>p.filter(e=>e&&(e=>{var t,r,c;let{attributes:n}=e;return Boolean((null===(t=n.lock)||void 0===t?void 0:t.remove)||(null===(r=n.lock)||void 0===r||null===(c=r.default)||void 0===c?void 0:c.remove))})(e)),[p]);Object(c.useLayoutEffect)(()=>{if(t){if(0===m.length&&l.current.length>0){const e=Object(o.createBlocksFromInnerBlocksTemplate)(l.current);if(!Object(s.isEqual)(e,m))return void d(t,e)}_.forEach(e=>{if(m.find(t=>{let{name:r}=t;return r===e.name}))return;const t=l.current.findIndex(t=>{let[r]=t;return r===e.name});switch(t){case-1:b(e,m.length);break;case 0:b(e,0);break;default:const r=l.current[t-1],c=m.findIndex(e=>{let{name:t}=e;return t===r[0]});b(e,-1===c?t:c+1)}})}},[t,m,_,d,b])}},312:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var c=r(1),n=r(23),o=r(2);const s=[{destination:{address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},package_id:0,name:Object(c.__)("Shipping","woo-gutenberg-products-block"),items:[{key:"33e75ff09dd601bbe69f351039152189",name:Object(c._x)("Beanie with Logo","example product in Cart Block","woo-gutenberg-products-block"),quantity:2},{key:"6512bd43d9caa6e02c990b0a82652dca",name:Object(c._x)("Beanie","example product in Cart Block","woo-gutenberg-products-block"),quantity:1}],shipping_rates:[{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(c.__)("Free shipping","woo-gutenberg-products-block"),description:"",delivery_time:"",price:"000",taxes:"0",rate_id:"free_shipping:1",instance_id:0,meta_data:[],method_id:"flat_rate",selected:!0},{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(c.__)("Local pickup","woo-gutenberg-products-block"),description:"",delivery_time:"",price:"200",taxes:"0",rate_id:"local_pickup:1",instance_id:1,meta_data:[],method_id:"local_pickup",selected:!1}]}],a=Object(o.getSetting)("displayCartPricesIncludingTax",!1),i={coupons:[],shipping_rates:Object(o.getSetting)("shippingMethodsExist",!1)?s:[],items:[{key:"1",id:1,quantity:2,name:Object(c.__)("Beanie","woo-gutenberg-products-block"),short_description:Object(c.__)("Warm hat for winter","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-beanie",permalink:"https://example.org",low_stock_remaining:2,backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:10,src:n.m+"previews/beanie.jpg",thumbnail:n.m+"previews/beanie.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(c.__)("Color","woo-gutenberg-products-block"),value:Object(c.__)("Yellow","woo-gutenberg-products-block")},{attribute:Object(c.__)("Size","woo-gutenberg-products-block"),value:Object(c.__)("Small","woo-gutenberg-products-block")}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:a?"12000":"10000",regular_price:a?"12000":"10000",sale_price:a?"12000":"10000",raw_prices:{precision:6,price:a?"12000000":"10000000",regular_price:a?"12000000":"10000000",sale_price:a?"12000000":"10000000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:"2000",line_subtotal_tax:"400",line_total:"2000",line_total_tax:"400"},extensions:{}},{key:"2",id:2,quantity:1,name:Object(c.__)("Cap","woo-gutenberg-products-block"),short_description:Object(c.__)("Lightweight baseball cap","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-cap",permalink:"https://example.org",backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:11,src:n.m+"previews/cap.jpg",thumbnail:n.m+"previews/cap.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(c.__)("Color","woo-gutenberg-products-block"),value:Object(c.__)("Orange","woo-gutenberg-products-block")}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:a?"2400":"2000",regular_price:a?"2400":"2000",sale_price:a?"2400":"2000",raw_prices:{precision:6,price:a?"24000000":"20000000",regular_price:a?"24000000":"20000000",sale_price:a?"24000000":"20000000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:"2000",line_subtotal_tax:"400",line_total:"2000",line_total_tax:"400"},extensions:{}}],fees:[{id:"fee",name:Object(c.__)("Fee","woo-gutenberg-products-block"),totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total:"100",total_tax:"20",tax_lines:[{name:Object(c.__)("Sales tax","woo-gutenberg-products-block"),rate:"20%",price:"20"}]}}],items_count:3,items_weight:0,needs_payment:!0,needs_shipping:Object(o.getSetting)("shippingEnabled",!0),has_calculated_shipping:!0,shipping_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},billing_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total_items:"4000",total_items_tax:"800",total_fees:"100",total_fees_tax:"20",total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_tax:"820",total_price:"4920",tax_lines:[{name:Object(c.__)("Sales tax","woo-gutenberg-products-block"),rate:"20%",price:"820"}]},errors:[],payment_requirements:["products"],extensions:{}}},321:function(e){e.exports=JSON.parse('{"name":"woocommerce/empty-mini-cart-contents-block","version":"1.0.0","title":"Empty Mini Cart Contents","description":"Contains blocks that are displayed when the mini cart is empty.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/mini-cart-contents"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},322:function(e){e.exports=JSON.parse('{"name":"woocommerce/filled-mini-cart-contents-block","version":"1.0.0","title":"Filled Mini Cart Contents","description":"Contains blocks that are displayed when the mini cart has products.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/mini-cart-contents"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},323:function(e){e.exports=JSON.parse('{"name":"woocommerce/mini-cart-title-block","version":"1.0.0","title":"Mini Cart Title","description":"Block that displays the title of the Mini Cart block.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/filled-mini-cart-contents-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},324:function(e){e.exports=JSON.parse('{"name":"woocommerce/mini-cart-items-block","version":"1.0.0","title":"Mini Cart Items","description":"Contains the products table and other custom blocks of filled mini cart.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/filled-mini-cart-contents-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},325:function(e){e.exports=JSON.parse('{"name":"woocommerce/mini-cart-products-table-block","version":"1.0.0","title":"Mini Cart Products Table","description":"Block that displays the products table of the Mini Cart block.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/mini-cart-items-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},326:function(e){e.exports=JSON.parse('{"name":"woocommerce/mini-cart-footer-block","version":"1.0.0","title":"Mini Cart Footer","description":"Block that displays the footer of the Mini Cart block.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false,"lock":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/filled-mini-cart-contents-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},327:function(e){e.exports=JSON.parse('{"name":"woocommerce/mini-cart-shopping-button-block","version":"1.0.0","title":"Mini Cart Shopping Button","description":"Block that displays the shopping button for the Mini Cart block.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":true},"attributes":{"lock":{"type":"object","default":{"remove":false,"move":false}}},"parent":["woocommerce/empty-mini-cart-contents-block"],"textdomain":"woo-gutenberg-products-block","apiVersion":2}')},35:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return n}));const c=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function n(e,t){return c(e)&&t in e}},37:function(e,t,r){"use strict";r.d(t,"c",(function(){return o})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return l})),r.d(t,"d",(function(){return d}));var c=r(35);let n,o;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(o||(o={}));const s=(e,t)=>Object(c.a)(e)&&"type"in e&&e.type===t,a=e=>s(e,n.SUCCESS),i=e=>s(e,n.ERROR),l=e=>s(e,n.FAIL),u=e=>!Object(c.a)(e)||void 0===e.retry||!0===e.retry,d=()=>({responseTypes:n,noticeContexts:o,shouldRetry:u,isSuccessResponse:a,isErrorResponse:i,isFailResponse:l})},38:function(e,t,r){"use strict";var c=r(6),n=r.n(c),o=r(0),s=r(126),a=r(4),i=r.n(a);r(131);const l=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:r,currency:c,onValueChange:a,displayType:u="text",...d}=e;const m="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(m))return null;const p=m/10**c.minorUnit;if(!Number.isFinite(p))return null;const b=i()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),_={...d,...l(c),value:void 0,currency:void 0,onValueChange:void 0},E=a?e=>{const t=+e.value*10**c.minorUnit;a(t)}:()=>{};return Object(o.createElement)(s.a,n()({className:b,displayType:u},_,{value:p,onValueChange:E}))}},405:function(e,t,r){"use strict";var c=r(0),n=r(11);const o=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(c.createElement)("path",{d:"M0 0h24v24H0z"}),Object(c.createElement)("path",{fill:"currentColor",fillRule:"nonzero",d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49A.996.996 0 0 0 20.01 4H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45ZM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2Zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2Z"}))," ");t.a=o},41:function(e,t,r){"use strict";r.d(t,"a",(function(){return h}));var c=r(7),n=r(0),o=r(17),s=r(9),a=r(13),i=r(237),l=r(59),u=r(236);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(s.dispatch)(o.CART_STORE_KEY).invalidateResolutionForStore()},m=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},p=()=>{Object(n.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.a)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.a)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),m),[])},b={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},_={...b,email:""},E={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:o.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},g=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,r]=e;return[t,Object(a.decodeEntities)(r)]})),O={cartCoupons:o.EMPTY_CART_COUPONS,cartItems:o.EMPTY_CART_ITEMS,cartFees:o.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:o.EMPTY_CART_ITEM_ERRORS,cartTotals:E,cartIsLoading:!0,cartErrors:o.EMPTY_CART_ERRORS,billingAddress:_,shippingAddress:b,shippingRates:o.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:o.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:o.EMPTY_EXTENSIONS},h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:r}=Object(l.b)(),a=null==r?void 0:r.previewCart,{shouldSelect:u}=e,d=Object(n.useRef)();p();const m=Object(s.useSelect)((e,r)=>{let{dispatch:c}=r;if(!u)return O;if(t)return{cartCoupons:a.coupons,cartItems:a.items,cartFees:a.fees,cartItemsCount:a.items_count,cartItemsWeight:a.items_weight,cartNeedsPayment:a.needs_payment,cartNeedsShipping:a.needs_shipping,cartItemErrors:o.EMPTY_CART_ITEM_ERRORS,cartTotals:a.totals,cartIsLoading:!1,cartErrors:o.EMPTY_CART_ERRORS,billingData:_,billingAddress:_,shippingAddress:b,extensions:o.EMPTY_EXTENSIONS,shippingRates:a.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:a.has_calculated_shipping,paymentRequirements:a.paymentRequirements,receiveCart:"function"==typeof(null==a?void 0:a.receiveCart)?a.receiveCart:()=>{}};const n=e(o.CART_STORE_KEY),s=n.getCartData(),l=n.getCartErrors(),d=n.getCartTotals(),m=!n.hasFinishedResolution("getCartData"),p=n.isCustomerDataUpdating(),{receiveCart:E}=c(o.CART_STORE_KEY),h=g(s.billingAddress),f=s.needsShipping?g(s.shippingAddress):h,y=s.fees.length>0?s.fees.map(e=>g(e)):o.EMPTY_CART_FEES;return{cartCoupons:s.coupons.length>0?s.coupons.map(e=>({...e,label:e.code})):o.EMPTY_CART_COUPONS,cartItems:s.items,cartFees:y,cartItemsCount:s.itemsCount,cartItemsWeight:s.itemsWeight,cartNeedsPayment:s.needsPayment,cartNeedsShipping:s.needsShipping,cartItemErrors:s.errors,cartTotals:d,cartIsLoading:m,cartErrors:l,billingData:Object(i.a)(h),billingAddress:Object(i.a)(h),shippingAddress:Object(i.a)(f),extensions:s.extensions,shippingRates:s.shippingRates,isLoadingRates:p,cartHasCalculatedShipping:s.hasCalculatedShipping,paymentRequirements:s.paymentRequirements,receiveCart:E}},[u]);return d.current&&Object(c.isEqual)(d.current,m)||(d.current=m),d.current}},414:function(e,t,r){"use strict";var c=r(0),n=r(11);const o=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)("path",{d:"M22.7 22.7l-20-20L2 2l-.7-.7L0 2.5 4.4 7l2.2 4.7L5.2 14A2 2 0 007 17h7.5l1.3 1.4a2 2 0 102.8 2.8l2.9 2.8 1.2-1.3zM7.4 15a.2.2 0 01-.2-.3l.9-1.7h2.4l2 2h-5zm8.2-2a2 2 0 001.7-1l3.6-6.5.1-.5c0-.6-.4-1-1-1H6.5l9 9zM7 18a2 2 0 100 4 2 2 0 000-4z"}),Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}));t.a=o},416:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));const c=e=>Object.values(e).reduce((e,t)=>(null!==t.icons&&(e=e.concat(t.icons)),e),[])},42:function(e,t){e.exports=window.wc.wcBlocksRegistry},43:function(e,t,r){"use strict";var c=r(6),n=r.n(c),o=r(0),s=r(71),a=r(112);const i=["BUTTON","FIELDSET","INPUT","OPTGROUP","OPTION","SELECT","TEXTAREA","A"];t.a=e=>{let{children:t,style:r={},...c}=e;const l=Object(o.useRef)(null),u=()=>{l.current&&s.focus.focusable.find(l.current).forEach(e=>{i.includes(e.nodeName)&&e.setAttribute("tabindex","-1"),e.hasAttribute("contenteditable")&&e.setAttribute("contenteditable","false")})},d=Object(a.a)(u,0,{leading:!0});return Object(o.useLayoutEffect)(()=>{let e;return u(),l.current&&(e=new window.MutationObserver(d),e.observe(l.current,{childList:!0,attributes:!0,subtree:!0})),()=>{e&&e.disconnect(),d.cancel()}},[d]),Object(o.createElement)("div",n()({ref:l,"aria-disabled":"true",style:{userSelect:"none",pointerEvents:"none",cursor:"normal",...r}},c),t)}},446:function(e,t,r){e.exports=r(456)},447:function(e,t){},45:function(e,t){e.exports=window.wp.a11y},456:function(e,t,r){"use strict";r.r(t);var c=r(0),n=r(1),o=r(244),s=r(113),a=r(8),i=r(5),l=r(405),u=r(414),d=r(59),m=r(483),p=r(311);const b=e=>{let{style:t}=e;const r=[{selector:".wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-mini-cart__footer-checkout",properties:[{property:"color",value:t.backgroundColor},{property:"background-color",value:t.color},{property:"border-color",value:t.color}]}].map(e=>{let{selector:t,properties:r}=e;const c=r.filter(e=>{let{value:t}=e;return t}).map(e=>{let{property:t,value:r}=e;return`${t}: ${r};`}).join("");return c?`${t} { ${c} }`:""}).join("").trim();return r?Object(c.createElement)("style",null,r," "):Object(c.createElement)(c.Fragment,null)};r(447);const _=["woocommerce/filled-mini-cart-contents-block","woocommerce/empty-mini-cart-contents-block"],E=[{view:"woocommerce/filled-mini-cart-contents-block",label:Object(n.__)("Filled Mini Cart","woo-gutenberg-products-block"),icon:Object(c.createElement)(s.a,{icon:l.a})},{view:"woocommerce/empty-mini-cart-contents-block",label:Object(n.__)("Empty Mini Cart","woo-gutenberg-products-block"),icon:Object(c.createElement)(s.a,{icon:u.a})}];var g=r(6),O=r.n(g);const h=["woocommerce/mini-cart","woocommerce/checkout","woocommerce/cart","woocommerce/single-product","woocommerce/cart-totals-block","woocommerce/checkout-fields-block","core/post-template","core/comment-template","core/query-pagination","core/comments-query-loop","core/post-comments-form","core/post-comments-link","core/post-comments-count","core/comments-pagination","core/post-navigation-link","core/button"],f=()=>Object(a.getBlockTypes)().filter(e=>!(h.includes(e.name)||e.parent&&e.parent.filter(e=>h.includes(e)).length>0)).map(e=>{let{name:t}=e;return t});var y=r(321);Object(a.registerBlockType)(y,{icon:{src:Object(c.createElement)(s.a,{icon:u.a,className:"wc-block-editor-components-block-icon"})},edit:()=>{const e=Object(i.useBlockProps)(),{currentView:t}=Object(d.b)();return Object(c.createElement)("div",O()({},e,{hidden:"woocommerce/empty-mini-cart-contents-block"!==t}),Object(c.createElement)(i.InnerBlocks,{allowedBlocks:f(),renderAppender:i.InnerBlocks.ButtonBlockAppender}))},save:()=>Object(c.createElement)("div",i.useBlockProps.save(),Object(c.createElement)(i.InnerBlocks.Content,null))});var j=r(18),S=r(312),v=r(310),k=r(322);Object(a.registerBlockType)(k,{icon:{src:Object(c.createElement)(s.a,{icon:l.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{clientId:t}=e;const r=Object(i.useBlockProps)(),n=Object(v.a)(j.innerBlockAreas.FILLED_MINI_CART),{currentView:o}=Object(d.b)(),s=[["woocommerce/mini-cart-title-block",{}],["woocommerce/mini-cart-items-block",{}],["woocommerce/mini-cart-footer-block",{}]].filter(Boolean);return Object(p.a)({clientId:t,registeredBlocks:n,defaultTemplate:s}),Object(c.createElement)("div",O()({},r,{hidden:"woocommerce/filled-mini-cart-contents-block"!==o}),Object(c.createElement)(d.a,{currentView:o,previewData:{previewCart:S.a}},Object(c.createElement)(i.InnerBlocks,{template:s,allowedBlocks:n,templateLock:"insert"})))},save:()=>Object(c.createElement)("div",i.useBlockProps.save(),Object(c.createElement)(i.InnerBlocks.Content,null))});var w=r(510),C=r(41),P=r(4),R=r.n(P),T=e=>{let{className:t}=e;const{cartItemsCount:r,cartIsLoading:o}=Object(C.a)();return Object(c.createElement)("h2",{className:R()(t,"wc-block-mini-cart__title")},o?Object(n.__)("Your cart","woo-gutenberg-products-block"):Object(n.sprintf)( +/* translators: %d is the count of items in the cart. */ +Object(n._n)("Your cart (%d item)","Your cart (%d items)",r,"woo-gutenberg-products-block"),r))},N=r(323);Object(a.registerBlockType)(N,{icon:{src:Object(c.createElement)(s.a,{icon:w.a,className:"wc-block-editor-components-block-icon"})},edit:()=>{const e=Object(i.useBlockProps)();return Object(c.createElement)("div",e,Object(c.createElement)(T,null))},save:()=>Object(c.createElement)("div",i.useBlockProps.save())});var A=r(509),I=r(324);Object(a.registerBlockType)(I,{icon:{src:Object(c.createElement)(s.a,{icon:A.a,className:"wc-block-editor-components-block-icon"})},edit:()=>{const e=Object(i.useBlockProps)({className:"wc-block-mini-cart__items"}),t=[["woocommerce/mini-cart-products-table-block",{}]].filter(Boolean);return Object(c.createElement)("div",e,Object(c.createElement)(i.InnerBlocks,{template:t,renderAppender:i.InnerBlocks.ButtonBlockAppender,templateLock:!1,allowedBlocks:f()}))},save:()=>Object(c.createElement)("div",i.useBlockProps.save(),Object(c.createElement)(i.InnerBlocks.Content,null))});var M=r(530),x=r(43),D=r(209),B=e=>{let{className:t}=e;const{cartItems:r,cartIsLoading:n}=Object(C.a)();return Object(c.createElement)("div",{className:R()(t,"wc-block-mini-cart__products-table")},Object(c.createElement)(D.a,{lineItems:r,isLoading:n,className:"wc-block-mini-cart-items"}))},L=r(325);Object(a.registerBlockType)(L,{icon:Object(c.createElement)(s.a,{icon:M.a,className:"wc-block-editor-components-block-icon"}),edit:()=>{const e=Object(i.useBlockProps)();return Object(c.createElement)("div",e,Object(c.createElement)(x.a,null,Object(c.createElement)(B,null)))},save:()=>Object(c.createElement)("div",i.useBlockProps.save())});var U=r(523),V=r(26),G=r(171),F=r(148),q=r(416),Y=r(2),H=r(23),z=r(68),$=r(164);const W=()=>{const{paymentMethods:e}=Object(G.b)();return Object(c.createElement)(F.a,{icons:Object(q.a)(e)})};var K=e=>{let{className:t}=e;const{cartTotals:r}=Object(C.a)(),o=Object(Y.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(r.total_items,10)+parseInt(r.total_items_tax,10):parseInt(r.total_items,10);return Object(c.createElement)("div",{className:R()(t,"wc-block-mini-cart__footer")},Object(c.createElement)(j.TotalsItem,{className:"wc-block-mini-cart__footer-subtotal",currency:Object(V.getCurrencyFromPriceResponse)(r),label:Object(n.__)("Subtotal","woo-gutenberg-products-block"),value:o,description:Object(n.__)("Shipping, taxes, and discounts calculated at checkout.","woo-gutenberg-products-block")}),Object(c.createElement)("div",{className:"wc-block-mini-cart__footer-actions"},H.d&&Object(c.createElement)(z.a,{className:"wc-block-mini-cart__footer-cart",href:H.d,variant:"outlined"},Object(n.__)("View my cart","woo-gutenberg-products-block")),H.f&&Object(c.createElement)(z.a,{className:"wc-block-mini-cart__footer-checkout",href:H.f},Object(n.__)("Go to checkout","woo-gutenberg-products-block"))),Object(c.createElement)($.a,null,Object(c.createElement)(W,null)))},X=r(326);Object(a.registerBlockType)(X,{icon:{src:Object(c.createElement)(s.a,{icon:U.a,className:"wc-block-editor-components-block-icon"})},edit:()=>{const e=Object(i.useBlockProps)();return Object(c.createElement)("div",e,Object(c.createElement)(x.a,null,Object(c.createElement)(K,null)))},save:()=>Object(c.createElement)("div",i.useBlockProps.save())});var Q=r(513),J=e=>{let{className:t}=e;return H.j?Object(c.createElement)("div",{className:R()(t,"wc-block-mini-cart__shopping-button")},Object(c.createElement)("a",{href:H.j},Object(n.__)("Start shopping","woo-gutenberg-products-block"))):null},Z=r(327);Object(a.registerBlockType)(Z,{icon:{src:Object(c.createElement)(s.a,{icon:Q.a,className:"wc-block-editor-components-block-icon"})},edit:()=>{const e=Object(i.useBlockProps)();return Object(c.createElement)("div",e,Object(c.createElement)(x.a,null,Object(c.createElement)(J,null)))},save:()=>Object(c.createElement)("div",i.useBlockProps.save())});const ee={apiVersion:2,title:Object(n.__)("Mini Cart Contents","woo-gutenberg-products-block"),icon:{src:Object(c.createElement)(s.a,{icon:o.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(n.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(n.__)("Display a mini cart widget.","woo-gutenberg-products-block"),supports:{align:!1,html:!1,multiple:!1,reusable:!1,inserter:!1,color:{link:!0},lock:!1},attributes:{isPreview:{type:"boolean",default:!1,save:!1},lock:{type:"object",default:{remove:!0,move:!0}}},example:{attributes:{isPreview:!0}},edit:e=>{let{clientId:t}=e;const r=Object(i.useBlockProps)({style:{minHeight:"100vh"}}),n=[["woocommerce/filled-mini-cart-contents-block",{},[]],["woocommerce/empty-mini-cart-contents-block",{},[]]],{currentView:o,component:s}=Object(m.a)(t,E);return Object(p.a)({clientId:t,registeredBlocks:_,defaultTemplate:n}),Object(c.createElement)("div",r,Object(c.createElement)(d.a,{currentView:o},Object(c.createElement)(i.BlockControls,null,s),Object(c.createElement)(i.InnerBlocks,{allowedBlocks:_,template:n,templateLock:!1})),Object(c.createElement)(b,{style:r.style}))},save:()=>Object(c.createElement)("div",i.useBlockProps.save(),Object(c.createElement)(i.InnerBlocks.Content,null))};Object(a.registerBlockType)("woocommerce/mini-cart-contents",ee)},48:function(e,t){e.exports=window.wp.hooks},483:function(e,t,r){"use strict";r.d(t,"a",(function(){return m}));var c=r(0),n=r(1),o=r(9),s=r(3),a=r(11),i=Object(c.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.createElement)("path",{d:"M12 6a9.77 9.77 0 0 1 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0 1 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"})),l=r(113),u=r(5);function d(e,t){return t.find(t=>t.view===e)}const m=(e,t)=>{const r=t[0],[a,m]=Object(c.useState)(r),{selectBlock:p}=Object(o.useDispatch)("core/block-editor"),{getBlock:b,getSelectedBlockClientId:_,getBlockParentsByBlockName:E}=Object(o.select)(u.store),g=_();Object(c.useEffect)(()=>{const e=b(g);if(!e)return;if(a.view===e.name)return;const r=t.map(e=>{let{view:t}=e;return t});if(r.includes(e.name)){const r=d(e.name,t);if(r)return m(r)}const c=E(g,r);if(1!==c.length)return;const n=b(c[0]);if(a.view===n.name)return;const o=d(n.name,t);o&&m(o)},[E,g,b,a.view,t]);const O=Object(c.createElement)(s.ToolbarGroup,null,Object(c.createElement)(s.ToolbarDropdownMenu,{label:Object(n.__)("Switch view","woo-gutenberg-products-block"),text:a.label,icon:Object(c.createElement)(l.a,{icon:i,style:{marginRight:"8px"}}),controls:t.map(t=>({...t,title:Object(c.createElement)("span",null,t.label),isActive:t.view===a.view,onClick:()=>{var r;m(t),p((null===(r=b(e).innerBlocks.find(e=>e.name===t.view))||void 0===r?void 0:r.clientId)||e)}}))}));return{currentView:a.view,component:O}}},49:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var c=r(0),n=r(22),o=r.n(n);function s(e){const t=Object(c.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},5:function(e,t){e.exports=window.wp.blockEditor},51:function(e,t){e.exports=window.wp.deprecated},53:function(e,t){e.exports=window.wp.keycodes},54:function(e,t,r){"use strict";r.d(t,"b",(function(){return N})),r.d(t,"a",(function(){return A}));var c=r(0),n=r(1),o=r(109),s=r(51),a=r.n(s),i=r(100),l=r(35),u=r(9);let d;!function(e){e.SET_IDLE="set_idle",e.SET_PRISTINE="set_pristine",e.SET_REDIRECT_URL="set_redirect_url",e.SET_COMPLETE="set_checkout_complete",e.SET_BEFORE_PROCESSING="set_before_processing",e.SET_AFTER_PROCESSING="set_after_processing",e.SET_PROCESSING_RESPONSE="set_processing_response",e.SET_PROCESSING="set_checkout_is_processing",e.SET_HAS_ERROR="set_checkout_has_error",e.SET_NO_ERROR="set_checkout_no_error",e.SET_CUSTOMER_ID="set_checkout_customer_id",e.SET_ORDER_ID="set_checkout_order_id",e.SET_ORDER_NOTES="set_checkout_order_notes",e.INCREMENT_CALCULATING="increment_calculating",e.DECREMENT_CALCULATING="decrement_calculating",e.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS="set_shipping_address_as_billing_address",e.SET_SHOULD_CREATE_ACCOUNT="set_should_create_account",e.SET_EXTENSION_DATA="set_extension_data"}(d||(d={}));const m=()=>({type:d.SET_IDLE}),p=e=>({type:d.SET_REDIRECT_URL,redirectUrl:e}),b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:d.SET_COMPLETE,data:e}},_=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:e?d.SET_HAS_ERROR:d.SET_NO_ERROR}};var E=r(2),g=r(237);let O;!function(e){e.PRISTINE="pristine",e.IDLE="idle",e.PROCESSING="processing",e.COMPLETE="complete",e.BEFORE_PROCESSING="before_processing",e.AFTER_PROCESSING="after_processing"}(O||(O={}));const h={order_id:0,customer_id:0,billing_address:{},shipping_address:{},...Object(E.getSetting)("checkoutData",{})||{}},f={redirectUrl:"",status:O.PRISTINE,hasError:!1,calculatingCount:0,orderId:h.order_id,orderNotes:"",customerId:h.customer_id,useShippingAsBilling:Object(g.b)(h.billing_address,h.shipping_address),shouldCreateAccount:!1,processingResponse:null,extensionData:{}},y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,{redirectUrl:t,type:r,customerId:c,orderId:n,orderNotes:o,extensionData:s,useShippingAsBilling:a,shouldCreateAccount:i,data:l}=arguments.length>1?arguments[1]:void 0,u=e;switch(r){case d.SET_PRISTINE:u=f;break;case d.SET_IDLE:u=e.status!==O.IDLE?{...e,status:O.IDLE}:e;break;case d.SET_REDIRECT_URL:u=void 0!==t&&t!==e.redirectUrl?{...e,redirectUrl:t}:e;break;case d.SET_PROCESSING_RESPONSE:u={...e,processingResponse:l};break;case d.SET_COMPLETE:u=e.status!==O.COMPLETE?{...e,status:O.COMPLETE,redirectUrl:"string"==typeof(null==l?void 0:l.redirectUrl)?l.redirectUrl:e.redirectUrl}:e;break;case d.SET_PROCESSING:u=e.status!==O.PROCESSING?{...e,status:O.PROCESSING,hasError:!1}:e,u=!1===u.hasError?u:{...u,hasError:!1};break;case d.SET_BEFORE_PROCESSING:u=e.status!==O.BEFORE_PROCESSING?{...e,status:O.BEFORE_PROCESSING,hasError:!1}:e;break;case d.SET_AFTER_PROCESSING:u=e.status!==O.AFTER_PROCESSING?{...e,status:O.AFTER_PROCESSING}:e;break;case d.SET_HAS_ERROR:u=e.hasError?e:{...e,hasError:!0},u=e.status===O.PROCESSING||e.status===O.BEFORE_PROCESSING?{...u,status:O.IDLE}:u;break;case d.SET_NO_ERROR:u=e.hasError?{...e,hasError:!1}:e;break;case d.INCREMENT_CALCULATING:u={...e,calculatingCount:e.calculatingCount+1};break;case d.DECREMENT_CALCULATING:u={...e,calculatingCount:Math.max(0,e.calculatingCount-1)};break;case d.SET_CUSTOMER_ID:u=void 0!==c?{...e,customerId:c}:e;break;case d.SET_ORDER_ID:u=void 0!==n?{...e,orderId:n}:e;break;case d.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS:void 0!==a&&a!==e.useShippingAsBilling&&(u={...e,useShippingAsBilling:a});break;case d.SET_SHOULD_CREATE_ACCOUNT:void 0!==i&&i!==e.shouldCreateAccount&&(u={...e,shouldCreateAccount:i});break;case d.SET_ORDER_NOTES:void 0!==o&&e.orderNotes!==o&&(u={...e,orderNotes:o});break;case d.SET_EXTENSION_DATA:void 0!==s&&e.extensionData!==s&&(u={...e,extensionData:s})}return u!==e&&r!==d.SET_PRISTINE&&u.status===O.PRISTINE&&(u.status=O.IDLE),u};var j=r(13),S=r(94),v=r(238);var k=r(239),w=r(102),C=r(78),P=r(37),R=r(116);const T=Object(c.createContext)({dispatchActions:{resetCheckout:()=>{},setRedirectUrl:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},incrementCalculating:()=>{},decrementCalculating:()=>{},setCustomerId:e=>{},setOrderId:e=>{},setOrderNotes:e=>{},setExtensionData:e=>{}},onSubmit:()=>{},isComplete:!1,isIdle:!1,isCalculating:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,redirectUrl:"",orderId:0,orderNotes:"",customerId:0,onCheckoutAfterProcessingWithSuccess:()=>()=>{},onCheckoutAfterProcessingWithError:()=>()=>{},onCheckoutBeforeProcessing:()=>()=>{},onCheckoutValidationBeforeProcessing:()=>()=>{},hasOrder:!1,isCart:!1,useShippingAsBilling:!1,setUseShippingAsBilling:e=>{},shouldCreateAccount:!1,setShouldCreateAccount:e=>{},extensionData:{}}),N=()=>Object(c.useContext)(T),A=e=>{let{children:t,redirectUrl:r,isCart:s=!1}=e;f.redirectUrl=r;const[E,g]=Object(c.useReducer)(y,f),{setValidationErrors:h}=Object(w.b)(),{createErrorNotice:N}=Object(u.useDispatch)("core/notices"),{dispatchCheckoutEvent:A}=Object(C.a)(),I=E.calculatingCount>0,{isSuccessResponse:M,isErrorResponse:x,isFailResponse:D,shouldRetry:B}=Object(P.d)(),{checkoutNotices:L,paymentNotices:U,expressPaymentNotices:V}=(()=>{const{noticeContexts:e}=Object(P.d)();return{checkoutNotices:Object(u.useSelect)(e=>e("core/notices").getNotices("wc/checkout"),[]),expressPaymentNotices:Object(u.useSelect)(t=>t("core/notices").getNotices(e.EXPRESS_PAYMENTS),[e.EXPRESS_PAYMENTS]),paymentNotices:Object(u.useSelect)(t=>t("core/notices").getNotices(e.PAYMENTS),[e.PAYMENTS])}})(),[G,F]=Object(c.useReducer)(S.b,{}),q=Object(c.useRef)(G),{onCheckoutAfterProcessingWithSuccess:Y,onCheckoutAfterProcessingWithError:H,onCheckoutValidationBeforeProcessing:z}=(e=>Object(c.useMemo)(()=>({onCheckoutAfterProcessingWithSuccess:Object(v.a)("checkout_after_processing_with_success",e),onCheckoutAfterProcessingWithError:Object(v.a)("checkout_after_processing_with_error",e),onCheckoutValidationBeforeProcessing:Object(v.a)("checkout_validation_before_processing",e)}),[e]))(F);Object(c.useEffect)(()=>{q.current=G},[G]);const $=Object(c.useMemo)(()=>function(){return a()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidationBeforeProcessing",plugin:"WooCommerce Blocks"}),z(...arguments)},[z]),W=Object(c.useMemo)(()=>({resetCheckout:()=>{g({type:d.SET_PRISTINE})},setRedirectUrl:e=>{g(p(e))},setHasError:e=>{g(_(e))},incrementCalculating:()=>{g({type:d.INCREMENT_CALCULATING})},decrementCalculating:()=>{g({type:d.DECREMENT_CALCULATING})},setCustomerId:e=>{var t;g((t=e,{type:d.SET_CUSTOMER_ID,customerId:t}))},setOrderId:e=>{g((e=>({type:d.SET_ORDER_ID,orderId:e}))(e))},setOrderNotes:e=>{g((e=>({type:d.SET_ORDER_NOTES,orderNotes:e}))(e))},setExtensionData:e=>{g((e=>({type:d.SET_EXTENSION_DATA,extensionData:e}))(e))},setAfterProcessing:e=>{const t=(e=>{const t={message:"",paymentStatus:"",redirectUrl:"",paymentDetails:{}};return"payment_result"in e&&(t.paymentStatus=e.payment_result.payment_status,t.redirectUrl=e.payment_result.redirect_url,e.payment_result.hasOwnProperty("payment_details")&&Array.isArray(e.payment_result.payment_details)&&e.payment_result.payment_details.forEach(e=>{let{key:r,value:c}=e;t.paymentDetails[r]=Object(j.decodeEntities)(c)})),"message"in e&&(t.message=Object(j.decodeEntities)(e.message)),!t.message&&"data"in e&&"status"in e.data&&e.data.status>299&&(t.message=Object(n.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")),t})(e);var r;g(p((null==t?void 0:t.redirectUrl)||"")),g((r=t,{type:d.SET_PROCESSING_RESPONSE,data:r})),g({type:d.SET_AFTER_PROCESSING})}}),[]);Object(c.useEffect)(()=>{E.status===O.BEFORE_PROCESSING&&(Object(R.a)("error"),Object(k.a)(q.current,"checkout_validation_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:r}=e;N(t,{context:"wc/checkout"}),h(r)}),g(m()),g(_())):g({type:d.SET_PROCESSING})}))},[E.status,h,N,g]);const K=Object(o.a)(E.status),X=Object(o.a)(E.hasError);Object(c.useEffect)(()=>{if((E.status!==K||E.hasError!==X)&&E.status===O.AFTER_PROCESSING){const e={redirectUrl:E.redirectUrl,orderId:E.orderId,customerId:E.customerId,orderNotes:E.orderNotes,processingResponse:E.processingResponse};E.hasError?Object(k.b)(q.current,"checkout_after_processing_with_error",e).then(t=>{const r=(e=>{let t=null;return e.forEach(e=>{if((x(e)||D(e))&&e.message&&Object(i.a)(e.message)){const r=e.messageContext&&Object(i.a)(e.messageContent)?{context:e.messageContext}:void 0;t=e,N(e.message,r)}}),t})(t);if(null!==r)B(r)?g(m()):g(b(r));else{if(!(L.some(e=>"error"===e.status)||V.some(e=>"error"===e.status)||U.some(e=>"error"===e.status))){var c;const t=(null===(c=e.processingResponse)||void 0===c?void 0:c.message)||Object(n.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");N(t,{id:"checkout",context:"wc/checkout"})}g(m())}}):Object(k.b)(q.current,"checkout_after_processing_with_success",e).then(e=>{let t=null,r=null;if(e.forEach(e=>{M(e)&&(t=e),(x(e)||D(e))&&(r=e)}),t&&!r)g(b(t));else if(Object(l.a)(r)){if(r.message&&Object(i.a)(r.message)){const e=r.messageContext&&Object(i.a)(r.messageContext)?{context:r.messageContext}:void 0;N(r.message,e)}B(r)?g(_(!0)):g(b(r))}else g(b())})}},[E.status,E.hasError,E.redirectUrl,E.orderId,E.customerId,E.orderNotes,E.processingResponse,K,X,W,N,x,D,M,B,L,V,U]);const Q={onSubmit:Object(c.useCallback)(()=>{A("submit"),g({type:d.SET_BEFORE_PROCESSING})},[A]),isComplete:E.status===O.COMPLETE,isIdle:E.status===O.IDLE,isCalculating:I,isProcessing:E.status===O.PROCESSING,isBeforeProcessing:E.status===O.BEFORE_PROCESSING,isAfterProcessing:E.status===O.AFTER_PROCESSING,hasError:E.hasError,redirectUrl:E.redirectUrl,onCheckoutBeforeProcessing:$,onCheckoutValidationBeforeProcessing:z,onCheckoutAfterProcessingWithSuccess:Y,onCheckoutAfterProcessingWithError:H,dispatchActions:W,isCart:s,orderId:E.orderId,hasOrder:!!E.orderId,customerId:E.customerId,orderNotes:E.orderNotes,useShippingAsBilling:E.useShippingAsBilling,setUseShippingAsBilling:e=>{return g((t=e,{type:d.SET_SHIPPING_ADDRESS_AS_BILLING_ADDRESS,useShippingAsBilling:t}));var t},shouldCreateAccount:E.shouldCreateAccount,setShouldCreateAccount:e=>{return g((t=e,{type:d.SET_SHOULD_CREATE_ACCOUNT,shouldCreateAccount:t}));var t},extensionData:E.extensionData};return Object(c.createElement)(T.Provider,{value:Q},t)}},59:function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return a}));var c=r(0),n=r(9);const o=Object(c.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),s=()=>Object(c.useContext)(o),a=e=>{let{children:t,currentPostId:r=0,currentView:s="",previewData:a={}}=e;const i=Object(n.useSelect)(e=>r||e("core/editor").getCurrentPostId(),[r]),l=Object(c.useCallback)(e=>e in a?a[e]:{},[a]),u={isEditor:!0,currentPostId:i,currentView:s,previewData:a,getPreviewData:l};return Object(c.createElement)(o.Provider,{value:u},t)}},60:function(e,t){e.exports=window.wp.autop},68:function(e,t,r){"use strict";var c=r(6),n=r.n(c),o=r(0),s=r(130),a=r(4),i=r.n(a),l=r(91);r(153),t.a=e=>{let{className:t,showSpinner:r=!1,children:c,variant:a="contained",...u}=e;const d=i()("wc-block-components-button",t,a,{"wc-block-components-button--loading":r});return Object(o.createElement)(s.a,n()({className:d},u),r&&Object(o.createElement)(l.a,null),Object(o.createElement)("span",{className:"wc-block-components-button__text"},c))}},7:function(e,t){e.exports=window.lodash},71:function(e,t){e.exports=window.wp.dom},72:function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return a}));var c=r(0),n=r(88);const o=Object(c.createContext)({isInitialized:!1,billingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},setBillingAddress:()=>{},setShippingAddress:()=>{}}),s=()=>Object(c.useContext)(o),a=e=>{let{children:t}=e;const r=Object(n.a)();return Object(c.createElement)(o.Provider,{value:r},t)}},78:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var c=r(48),n=r(0),o=r(41);const s=()=>{const e=Object(o.a)(),t=Object(n.useRef)(e);return Object(n.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(n.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(n.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...r,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},79:function(e,t,r){"use strict";var c=r(0),n=r(4),o=r.n(n);r(186),t.a=e=>{let{children:t,className:r}=e;return Object(c.createElement)("div",{className:o()("wc-block-components-product-badge",r)},t)}},8:function(e,t){e.exports=window.wp.blocks},80:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var c=r(17),n=r(9),o=r(0),s=r(22),a=r.n(s),i=r(35),l=r(312),u=r(110);const d=()=>{const{shippingRates:e,needsShipping:t,hasCalculatedShipping:r,isLoadingRates:s}=Object(n.useSelect)(e=>{const t=!!e("core/editor"),r=e(c.CART_STORE_KEY);return{shippingRates:t?l.a.shipping_rates:r.getShippingRates(),needsShipping:t?l.a.needs_shipping:r.getNeedsShipping(),hasCalculatedShipping:t?l.a.has_calculated_shipping:r.getHasCalculatedShipping(),isLoadingRates:!t&&r.isCustomerDataUpdating()}}),{isSelectingRate:d,selectShippingRate:m}=Object(u.a)(),p=Object(o.useRef)({});return Object(o.useEffect)(()=>{const t=(e=>Object.fromEntries(e.map(e=>{var t;let{package_id:r,shipping_rates:c}=e;return[r,null===(t=c.find(e=>e.selected))||void 0===t?void 0:t.rate_id]})))(e);Object(i.a)(t)&&!a()(p.current,t)&&(p.current=t)},[e]),{isSelectingRate:d,selectedRates:p.current,selectShippingRate:m,shippingRates:e,needsShipping:t,hasCalculatedShipping:r,isLoadingRates:s}}},87:function(e,t){e.exports=window.wp.wordcount},88:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var c=r(9),n=r(17);const o=()=>{const{customerData:e,isInitialized:t}=Object(c.useSelect)(e=>{const t=e(n.CART_STORE_KEY);return{customerData:t.getCustomerData(),isInitialized:t.hasFinishedResolution("getCartData")}}),{setShippingAddress:r,setBillingAddress:o}=Object(c.useDispatch)(n.CART_STORE_KEY);return{isInitialized:t,billingAddress:e.billingAddress,shippingAddress:e.shippingAddress,setBillingAddress:o,setShippingAddress:r}}},9:function(e,t){e.exports=window.wp.data},90:function(e,t,r){"use strict";var c=r(2),n=r(1),o=r(159),s=r(100);const a=Object(c.getSetting)("countryLocale",{}),i=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(n.sprintf)( +/* translators: %s Field label. */ +Object(n.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(o.a)(e.priority)&&(t.index=e.priority),Object(s.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},l=Object.entries(a).map(e=>{let[t,r]=e;return[t,Object.entries(r).map(e=>{let[t,r]=e;return[t,i(r)]}).reduce((e,t)=>{let[r,c]=t;return e[r]=c,e},{})]}).reduce((e,t)=>{let[r,c]=t;return e[r]=c,e},{});t.a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=r&&void 0!==l[r]?l[r]:{};return e.map(e=>({key:e,...c.defaultAddressFields[e]||{},...n[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},91:function(e,t,r){"use strict";var c=r(0);r(154),t.a=()=>Object(c.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},92:function(e,t,r){"use strict";var c=r(0),n=r(1),o=r(38),s=r(4),a=r.n(s),i=r(26);r(152);const l=e=>{let{currency:t,maxPrice:r,minPrice:s,priceClassName:l,priceStyle:u={}}=e;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("span",{className:"screen-reader-text"},Object(n.sprintf)( +/* translators: %1$s min price, %2$s max price */ +Object(n.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(i.formatPrice)(s),Object(i.formatPrice)(r))),Object(c.createElement)("span",{"aria-hidden":!0},Object(c.createElement)(o.a,{className:a()("wc-block-components-product-price__value",l),currency:t,value:s,style:u})," — ",Object(c.createElement)(o.a,{className:a()("wc-block-components-product-price__value",l),currency:t,value:r,style:u})))},u=e=>{let{currency:t,regularPriceClassName:r,regularPriceStyle:s,regularPrice:i,priceClassName:l,priceStyle:u,price:d}=e;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("span",{className:"screen-reader-text"},Object(n.__)("Previous price:","woo-gutenberg-products-block")),Object(c.createElement)(o.a,{currency:t,renderText:e=>Object(c.createElement)("del",{className:a()("wc-block-components-product-price__regular",r),style:s},e),value:i}),Object(c.createElement)("span",{className:"screen-reader-text"},Object(n.__)("Discounted price:","woo-gutenberg-products-block")),Object(c.createElement)(o.a,{currency:t,renderText:e=>Object(c.createElement)("ins",{className:a()("wc-block-components-product-price__value","is-discounted",l),style:u},e),value:d}))};t.a=e=>{let{align:t,className:r,currency:n,format:s="",maxPrice:i,minPrice:d,price:m,priceClassName:p,priceStyle:b,regularPrice:_,regularPriceClassName:E,regularPriceStyle:g}=e;const O=a()(r,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+t]:t});s.includes("")||(s="",console.error("Price formats need to include the `` tag."));const h=_&&m!==_;let f=Object(c.createElement)("span",{className:a()("wc-block-components-product-price__value",p)});return h?f=Object(c.createElement)(u,{currency:n,price:m,priceClassName:p,priceStyle:b,regularPrice:_,regularPriceClassName:E,regularPriceStyle:g}):void 0!==d&&void 0!==i?f=Object(c.createElement)(l,{currency:n,maxPrice:i,minPrice:d,priceClassName:p,priceStyle:b}):m&&(f=Object(c.createElement)(o.a,{className:a()("wc-block-components-product-price__value",p),currency:n,value:m,style:b})),Object(c.createElement)("span",{className:O},Object(c.createInterpolateElement)(s,{price:f}))}},94:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return a}));var c=r(7);let n;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));const o={addEventCallback:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(c.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:(e,t)=>({id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e})},s={},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,{type:t,eventType:r,id:c,callback:o,priority:a}=arguments.length>1?arguments[1]:void 0;const i=e.hasOwnProperty(r)?new Map(e[r]):new Map;switch(t){case n.ADD_EVENT_CALLBACK:return i.set(c,{priority:a,callback:o}),{...e,[r]:i};case n.REMOVE_EVENT_CALLBACK:return i.delete(c),{...e,[r]:i}}}}}); \ No newline at end of file diff --git a/build/mini-cart-footer-block/block.json b/build/mini-cart-footer-block/block.json new file mode 100644 index 00000000000..2ef388fd9a4 --- /dev/null +++ b/build/mini-cart-footer-block/block.json @@ -0,0 +1,27 @@ +{ + "name": "woocommerce/mini-cart-footer-block", + "version": "1.0.0", + "title": "Mini Cart Footer", + "description": "Block that displays the footer of the Mini Cart block.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/filled-mini-cart-contents-block" ], + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2 +} diff --git a/build/mini-cart-frontend.asset.php b/build/mini-cart-frontend.asset.php new file mode 100644 index 00000000000..be11fd25bc0 --- /dev/null +++ b/build/mini-cart-frontend.asset.php @@ -0,0 +1 @@ + array('wc-settings', 'wp-polyfill'), 'version' => 'afc6569abb2b00801579341264b24ce9'); \ No newline at end of file diff --git a/build/mini-cart-frontend.js b/build/mini-cart-frontend.js new file mode 100644 index 00000000000..45f99016241 --- /dev/null +++ b/build/mini-cart-frontend.js @@ -0,0 +1 @@ +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=235)}({2:function(e,t){e.exports=window.wc.wcSettings},235:function(e,t,n){e.exports=n(249)},249:function(e,t,n){"use strict";n.r(t);var r=n(2),o=e=>{let{handle:t,src:n,version:r}=e;if(0===document.querySelectorAll(`#${t}-js, #${t}-js-prefetch`).length){const e=document.createElement("link");e.href=r?`${n}?ver=${r}`:n,e.rel="preload",e.as="script",e.id=t+"-js-prefetch",document.head.appendChild(e)}},c=n(45);const d=e=>document.querySelectorAll("script#"+e).length>0,a=e=>{if(!Object(c.a)(e.id)||d(e.id))return;const t=document.createElement("script");for(const n in e){if(!e.hasOwnProperty(n))continue;const r=n;if("onload"===r||"onerror"===r)continue;const o=e[r];Object(c.a)(o)&&(t[r]=o)}"function"==typeof e.onload&&(t.onload=e.onload),"function"==typeof e.onerror&&(t.onerror=e.onerror),document.body.appendChild(t)};var i=e=>{let{handle:t,src:n,version:r,after:o,before:c,translations:i}=e;return new Promise((e,s)=>{d(t+"-js")&&e(),i&&a({id:t+"-js-translations",innerHTML:i}),c&&a({id:t+"-js-before",innerHTML:c}),a({id:t+"-js",onerror:s,onload:()=>{o&&a({id:t+"-js-after",innerHTML:o}),e()},src:r?`${n}?ver=${r}`:n})})},s=n(70);window.addEventListener("load",()=>{const e=document.querySelectorAll(".wc-block-mini-cart");let t=!1;if(0===e.length)return;const n=Object(r.getSetting)("mini_cart_block_frontend_dependencies",{});for(const e in n){const t=n[e];o({handle:e,...t})}const c=Object(s.b)("adding_to_cart","wc-blocks_adding_to_cart"),d=Object(s.b)("added_to_cart","wc-blocks_added_to_cart"),a=Object(s.b)("removed_from_cart","wc-blocks_removed_from_cart"),l=async()=>{if(!t){t=!0,document.body.removeEventListener("wc-blocks_adding_to_cart",l),c();for(const e in n){const t=n[e];await i({handle:e,...t})}}};document.body.addEventListener("wc-blocks_adding_to_cart",l),e.forEach((e,n)=>{if(!(e instanceof HTMLElement))return;const r=e.querySelector(".wc-block-mini-cart__button"),o=e.querySelector(".wc-block-components-drawer__screen-overlay");if(!r||!o)return;const c=()=>{t||l(),document.body.removeEventListener("wc-blocks_added_to_cart",s),document.body.removeEventListener("wc-blocks_removed_from_cart",u),d(),a()},i=()=>{e.dataset.isInitiallyOpen="true",o.classList.add("wc-block-components-drawer__screen-overlay--with-slide-in"),o.classList.remove("wc-block-components-drawer__screen-overlay--is-hidden"),c()},s=()=>{e.dataset.isDataOutdated="true",i()},u=()=>{e.dataset.isDataOutdated="true",e.dataset.isInitiallyOpen="false",c()};r.addEventListener("mouseover",l),r.addEventListener("focus",l),r.addEventListener("click",i),0===n&&(document.body.addEventListener("wc-blocks_added_to_cart",s),document.body.addEventListener("wc-blocks_removed_from_cart",u))})})},45:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"string"==typeof e},70:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"d",(function(){return d})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return i}));const r=window.CustomEvent||null,o=(e,t)=>{let{bubbles:n=!1,cancelable:o=!1,element:c,detail:d={}}=t;if(!r)return;c||(c=document.body);const a=new r(e,{bubbles:n,cancelable:o,detail:d});c.dispatchEvent(a)};let c;const d=()=>{c&&clearTimeout(c),c=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},a=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const c=()=>{o(t,{bubbles:n,cancelable:r})};return jQuery(document).on(e,c),()=>jQuery(document).off(e,c)}}}); \ No newline at end of file diff --git a/build/mini-cart-items-block/block.json b/build/mini-cart-items-block/block.json new file mode 100644 index 00000000000..a4edd87b0f8 --- /dev/null +++ b/build/mini-cart-items-block/block.json @@ -0,0 +1,27 @@ +{ + "name": "woocommerce/mini-cart-items-block", + "version": "1.0.0", + "title": "Mini Cart Items", + "description": "Contains the products table and other custom blocks of filled mini cart.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/filled-mini-cart-contents-block" ], + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2 +} diff --git a/build/mini-cart-products-table-block/block.json b/build/mini-cart-products-table-block/block.json new file mode 100644 index 00000000000..5da3ae07180 --- /dev/null +++ b/build/mini-cart-products-table-block/block.json @@ -0,0 +1,27 @@ +{ + "name": "woocommerce/mini-cart-products-table-block", + "version": "1.0.0", + "title": "Mini Cart Products Table", + "description": "Block that displays the products table of the Mini Cart block.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": false + } + } + }, + "parent": [ "woocommerce/mini-cart-items-block" ], + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2 +} diff --git a/build/mini-cart-shopping-button-block/block.json b/build/mini-cart-shopping-button-block/block.json new file mode 100644 index 00000000000..397a99d9515 --- /dev/null +++ b/build/mini-cart-shopping-button-block/block.json @@ -0,0 +1,26 @@ +{ + "name": "woocommerce/mini-cart-shopping-button-block", + "version": "1.0.0", + "title": "Mini Cart Shopping Button", + "description": "Block that displays the shopping button for the Mini Cart block.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": true + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": false, + "move": false + } + } + }, + "parent": [ "woocommerce/empty-mini-cart-contents-block" ], + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2 +} diff --git a/build/mini-cart-title-block/block.json b/build/mini-cart-title-block/block.json new file mode 100644 index 00000000000..2e44d415a5e --- /dev/null +++ b/build/mini-cart-title-block/block.json @@ -0,0 +1,27 @@ +{ + "name": "woocommerce/mini-cart-title-block", + "version": "1.0.0", + "title": "Mini Cart Title", + "description": "Block that displays the title of the Mini Cart block.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "type": "object", + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/filled-mini-cart-contents-block" ], + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2 +} diff --git a/build/mini-cart.asset.php b/build/mini-cart.asset.php new file mode 100644 index 00000000000..08613d91621 --- /dev/null +++ b/build/mini-cart.asset.php @@ -0,0 +1 @@ + array('react', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'ede5b15df274e73aabcbdb6d5070d711'); \ No newline at end of file diff --git a/build/mini-cart.js b/build/mini-cart.js new file mode 100644 index 00000000000..81f69353957 --- /dev/null +++ b/build/mini-cart.js @@ -0,0 +1 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["mini-cart"]=function(e){function t(t){for(var r,i,l=t[0],a=t[1],u=t[2],d=0,b=[];d"string"==typeof e},11:function(e,t){e.exports=window.wp.primitives},12:function(e,t){e.exports=window.React},123:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(35),o=n(150);const c=e=>{const t=Object(r.a)(e)?e:{},n=Object(o.a)(t.style),c=Object(r.a)(n.typography)?n.typography:{};return{style:{fontSize:t.fontSize?`var(--wp--preset--font-size--${t.fontSize})`:c.fontSize,lineHeight:c.lineHeight,fontWeight:c.fontWeight,textTransform:c.textTransform,fontFamily:t.fontFamily}}}},150:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(100),o=n(35);const c=e=>Object(r.a)(e)?JSON.parse(e)||{}:Object(o.a)(e)?e:{}},2:function(e,t){e.exports=window.wc.wcSettings},23:function(e,t,n){"use strict";n.d(t,"o",(function(){return c})),n.d(t,"m",(function(){return i})),n.d(t,"l",(function(){return l})),n.d(t,"n",(function(){return a})),n.d(t,"j",(function(){return u})),n.d(t,"e",(function(){return s})),n.d(t,"f",(function(){return d})),n.d(t,"g",(function(){return b})),n.d(t,"k",(function(){return p})),n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return m})),n.d(t,"h",(function(){return w})),n.d(t,"a",(function(){return O})),n.d(t,"i",(function(){return g})),n.d(t,"b",(function(){return h}));var r,o=n(2);const c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"images/",l=c.pluginUrl+"build/",a=c.buildPhase,u=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,s=o.STORE_PAGES.checkout.id,d=o.STORE_PAGES.checkout.permalink,b=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),f=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),m=o.STORE_PAGES.cart.permalink,w=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),O=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),h=Object(o.getSetting)("allowedStates",{})},26:function(e,t){e.exports=window.wc.priceFormat},3:function(e,t){e.exports=window.wp.components},35:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return r(e)&&t in e}},43:function(e,t,n){"use strict";var r=n(6),o=n.n(r),c=n(0),i=n(71),l=n(112);const a=["BUTTON","FIELDSET","INPUT","OPTGROUP","OPTION","SELECT","TEXTAREA","A"];t.a=e=>{let{children:t,style:n={},...r}=e;const u=Object(c.useRef)(null),s=()=>{u.current&&i.focus.focusable.find(u.current).forEach(e=>{a.includes(e.nodeName)&&e.setAttribute("tabindex","-1"),e.hasAttribute("contenteditable")&&e.setAttribute("contenteditable","false")})},d=Object(l.a)(s,0,{leading:!0});return Object(c.useLayoutEffect)(()=>{let e;return s(),u.current&&(e=new window.MutationObserver(d),e.observe(u.current,{childList:!0,attributes:!0,subtree:!0})),()=>{e&&e.disconnect(),d.cancel()}},[d]),Object(c.createElement)("div",o()({ref:u,"aria-disabled":"true",style:{userSelect:"none",pointerEvents:"none",cursor:"normal",...n}},r),t)}},444:function(e,t,n){e.exports=n(468)},445:function(e,t){},468:function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(1),c=n(11),i=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},Object(r.createElement)("defs",null,Object(r.createElement)("mask",{id:"mask",x:"0",y:"0",width:"24.01",height:"24",maskUnits:"userSpaceOnUse"},Object(r.createElement)("g",{id:"path-1-inside-1_928_1005","data-name":"path-1-inside-1 928 1005"},Object(r.createElement)("path",{d:"M2,2V4H4l3.6,7.6L6.3,14A2,2,0,0,0,8,17H20V15H8l1.1-2h7.5a1.9,1.9,0,0,0,1.7-1l3.6-6.5A1,1,0,0,0,21,4H6.2L5.3,2ZM8,18a2,2,0,1,0,2,2A2,2,0,0,0,8,18Zm8,2a2,2,0,1,1,2,2A2,2,0,0,1,16,20Z",fill:"#fff",fillRule:"evenodd"})))),Object(r.createElement)("g",{mask:"url(#mask)"},Object(r.createElement)("path",{d:"M2,4H0V6H2ZM2,2V0H0V2ZM4,4l1.8-.9L5.3,2H4Zm3.6,7.6,1.7,1,.5-.9-.4-1ZM6.3,14l-1.8-.9h0ZM20,17v2h2V17Zm0-2h2V13H20ZM8,15,6.2,14,4.6,17H8Zm1.1-2V11H7.9l-.6,1Zm9.2-1-1.8-1h0Zm3.6-6.5-1.8-1h0ZM6.2,4l-1.8.9L4.9,6H6.2ZM5.3,2l1.8-.9L6.5,0H5.3ZM4,4V2H0V4ZM4,2H2V6H4Zm5.4,8.7L5.8,3.1,2.2,4.9l3.6,7.5ZM8,15l1.3-2.4-3.5-2L4.5,13.1Zm0,0H8L4.5,13.1A4,4,0,0,0,8,19Zm12,0H8v4H20Zm-2,0v2h4V15ZM8,17H20V13H8Zm-.7-5L6.2,14l3.6,2,1.1-2Zm9.3-1H9.1v4h7.5Zm-.1,0h.1v4a4,4,0,0,0,3.5-2.1Zm3.6-6.5L16.5,11l3.6,1.9,3.5-6.5ZM21,6a1,1,0,0,1-.9-1.5l3.5,2A3,3,0,0,0,21,2ZM6.2,6H21V2H6.2ZM3.5,2.9l.9,2L8,3.1l-.9-2ZM2,4H5.3V0H2ZM8,20H8V16a4,4,0,0,0-4,4Zm0,0H4a4,4,0,0,0,4,4Zm0,0v4a4,4,0,0,0,4-4Zm0,0h4a4,4,0,0,0-4-4Zm10-4a4,4,0,0,0-4,4h4Zm4,4a4,4,0,0,0-4-4v4Zm-4,4a4,4,0,0,0,4-4H18Zm-4-4a4,4,0,0,0,4,4V20H14Z",fill:"#7f54b3"})),Object(r.createElement)("circle",{cx:"20.2",cy:"4.7",r:"3.8",fill:"#7f54b3"})),l=n(113),a=n(8),u=n(95),s=n(5),d=n(26),b=n(3),p=n(2),f=n(43),m=n(123),w=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"none"},Object(r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.84614 18.2769C7.89712 18.2769 7.93845 18.2356 7.93845 18.1846C7.93845 18.1336 7.89712 18.0923 7.84614 18.0923C7.79516 18.0923 7.75384 18.1336 7.75384 18.1846C7.75384 18.2356 7.79516 18.2769 7.84614 18.2769ZM6.03076 18.1846C6.03076 17.182 6.84353 16.3692 7.84614 16.3692C8.84875 16.3692 9.66152 17.182 9.66152 18.1846C9.66152 19.1872 8.84875 20 7.84614 20C6.84353 20 6.03076 19.1872 6.03076 18.1846Z",fill:"currentColor"}),Object(r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.3231 18.2769C17.3741 18.2769 17.4154 18.2356 17.4154 18.1846C17.4154 18.1336 17.3741 18.0923 17.3231 18.0923C17.2721 18.0923 17.2308 18.1336 17.2308 18.1846C17.2308 18.2356 17.2721 18.2769 17.3231 18.2769ZM15.5077 18.1846C15.5077 17.182 16.3205 16.3692 17.3231 16.3692C18.3257 16.3692 19.1385 17.182 19.1385 18.1846C19.1385 19.1872 18.3257 20 17.3231 20C16.3205 20 15.5077 19.1872 15.5077 18.1846Z",fill:"currentColor"}),Object(r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.0631 9.53835L19.4662 12.6685L19.4648 12.6757L19.4648 12.6757C19.3424 13.2919 19.0072 13.8454 18.5178 14.2394C18.031 14.6312 17.4226 14.8404 16.798 14.8308H8.44017C7.81556 14.8404 7.20714 14.6312 6.72038 14.2394C6.2312 13.8456 5.89605 13.2924 5.77352 12.6765L5.77335 12.6757L4.33477 5.48814C4.3286 5.46282 4.32345 5.43711 4.31934 5.41104L3.61815 1.90768H0.953842C0.42705 1.90768 0 1.48063 0 0.953842C0 0.42705 0.42705 0 0.953842 0H4.4C4.85462 0 5.24607 0.320858 5.33529 0.766644L6.04403 4.30769H12.785C13.0114 4.99157 13.3319 5.63258 13.7312 6.21538H6.42585L7.64421 12.3026L7.64449 12.304C7.67966 12.4811 7.77599 12.6402 7.91662 12.7534C8.05725 12.8666 8.23322 12.9267 8.41372 12.9233L8.432 12.9231H16.8062L16.8244 12.9233C17.0049 12.9267 17.1809 12.8666 17.3215 12.7534C17.4614 12.6408 17.5575 12.4828 17.5931 12.3068L17.5937 12.304L18.1649 9.30867C18.762 9.45873 19.387 9.53842 20.0307 9.53842C20.0415 9.53842 20.0523 9.5384 20.0631 9.53835Z",fill:"currentColor"}));n(445);var O=e=>{let{count:t,colorClassNames:n,style:o}=e;return Object(r.createElement)("span",{className:"wc-block-mini-cart__quantity-badge"},Object(r.createElement)(l.a,{className:"wc-block-mini-cart__icon",size:20,icon:w}),Object(r.createElement)("span",{className:"wc-block-mini-cart__badge "+n,style:o},t))};const g={apiVersion:2,title:Object(o.__)("Mini Cart","woo-gutenberg-products-block"),icon:{src:Object(r.createElement)(l.a,{icon:i,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(o.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(o.__)("Display a mini cart widget.","woo-gutenberg-products-block"),supports:{html:!1,multiple:!1,color:!0,typography:{fontSize:!0,...Object(u.b)()&&{__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalSkipSerialization:!0}}},example:{attributes:{isPreview:!0}},attributes:{isPreview:{type:"boolean",default:!1,save:!1},addToCartBehaviour:{type:"string",default:"none"},hasHiddenPrice:{type:"boolean",default:!1}},edit:e=>{let{attributes:t,setAttributes:n}=e;const{addToCartBehaviour:c,hasHiddenPrice:i}=t,l=Object(s.useBlockProps)({className:"wc-block-mini-cart"}),a=Object(p.getSetting)("templatePartEditUri",""),u=Object(m.a)(t);return Object(r.createElement)("div",l,Object(r.createElement)(s.InspectorControls,null,Object(r.createElement)(b.PanelBody,{title:Object(o.__)("Mini Cart Settings","woo-gutenberg-products-block")},Object(r.createElement)(b.SelectControl,{label:Object(o.__)("Add-to-Cart behaviour","woo-gutenberg-products-block"),value:c,onChange:e=>{n({addToCartBehaviour:e})},help:Object(o.__)("Select what happens when a customer adds a product to the cart.","woo-gutenberg-products-block"),options:[{value:"none",label:Object(o.__)("Do nothing","woo-gutenberg-products-block")},{value:"open_drawer",label:Object(o.__)("Open cart drawer","woo-gutenberg-products-block")}]}),Object(r.createElement)(b.ToggleControl,{label:Object(o.__)("Hide Cart Price","woo-gutenberg-products-block"),help:Object(o.__)("Toggles the visibility of the Mini Cart price.","woo-gutenberg-products-block"),checked:i,onChange:()=>n({hasHiddenPrice:!i})})),a&&Object(r.createElement)(b.PanelBody,{title:Object(o.__)("Template settings","woo-gutenberg-products-block")},Object(r.createElement)("p",null,Object(o.__)("Edit the appearance of your empty and filled mini cart contents.","woo-gutenberg-products-block")),Object(r.createElement)(b.ExternalLink,{href:a},Object(o.__)("Edit Mini Cart template part","woo-gutenberg-products-block")))),Object(r.createElement)(f.a,null,Object(r.createElement)("button",{className:"wc-block-mini-cart__button"},!i&&Object(r.createElement)("span",{className:"wc-block-mini-cart__amount",style:u.style},Object(d.formatPrice)(0)),Object(r.createElement)(O,{count:0}))))},save:()=>null};Object(a.registerBlockType)("woocommerce/mini-cart",g)},5:function(e,t){e.exports=window.wp.blockEditor},71:function(e,t){e.exports=window.wp.dom},8:function(e,t){e.exports=window.wp.blocks},95:function(e,t,n){"use strict";n.d(t,"c",(function(){return c})),n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return l}));var r=n(8),o=n(23);const c=(e,t)=>{if(o.n>2)return Object(r.registerBlockType)(e,t)},i=()=>o.n>2,l=()=>o.n>1}}); \ No newline at end of file diff --git a/build/price-filter-frontend.asset.php b/build/price-filter-frontend.asset.php new file mode 100644 index 00000000000..a87fef2f5ab --- /dev/null +++ b/build/price-filter-frontend.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-data', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => '548dbacd8b0e9cae84dec01f0ba15417'); \ No newline at end of file diff --git a/build/price-filter-frontend.js b/build/price-filter-frontend.js new file mode 100644 index 00000000000..a3a80b1b52f --- /dev/null +++ b/build/price-filter-frontend.js @@ -0,0 +1,5 @@ +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=217)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},100:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(5),o=r(51);function i(e,t){return e===t}function a(e){return"function"==typeof e?function(){return e}:e}function c(e,t,r){var c=r&&r.equalityFn||i,s=function(e){var t=Object(n.useState)(a(e)),r=t[0],o=t[1];return[r,Object(n.useCallback)((function(e){return o(a(e))}),[])]}(e),u=s[0],l=s[1],p=Object(o.a)(Object(n.useCallback)((function(e){return l(e)}),[l]),t,r),f=Object(n.useRef)(e);return c(f.current,e)||(p(e),f.current=e),[u,p]}},102:function(e,t,r){"use strict";var n=r(12),o=r.n(n),i=r(0),a=r(137),c=r(4),s=r.n(c);r(197);const u=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:r,currency:n,onValueChange:c,displayType:l="text",...p}=e;const f="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(f))return null;const m=f/10**n.minorUnit;if(!Number.isFinite(m))return null;const d=s()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),b={...p,...u(n),value:void 0,currency:void 0,onValueChange:void 0},g=c?e=>{const t=+e.value*10**n.minorUnit;c(t)}:()=>{};return Object(i.createElement)(a.a,o()({className:d,displayType:l},b,{value:m,onValueChange:g}))}},107:function(e,t){},11:function(e,t){e.exports=window.wp.isShallowEqual},12:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;tu&&("#"!==c[p]||!a(e[p]));)p-=1;return!a(e[f])||"left"===r&&t!==u||t-p=a?n+=p("0",i-a):n=(n.substring(0,i)||"0")+"."+n.substring(i),t+n}(s),f=!0),"Infinity"===s&&f&&(s=""),f&&!r&&"number"==typeof n&&(s=function(e,t,r){if(-1!==["","-"].indexOf(e))return e;var n=-1!==e.indexOf(".")&&t,o=u(e),i=o.beforeDecimal,a=o.afterDecimal,c=o.hasNagation,s=parseFloat("0."+(a||"0")),p=(a.length<=t?"0."+a:s.toFixed(t)).split(".");return(c?"-":"")+i.split("").reverse().reduce((function(e,t,r){return e.length>r?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e}),p[0])+(n?".":"")+l(p[1]||"",Math.min(t,a.length),r)}(s,n,o)),f?this.formatNumString(s):this.formatInput(s))},t.prototype.formatNegation=function(e){void 0===e&&(e="");var t=this.props.allowNegative,r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),o=r.test(e),i=n.test(e);return e=e.replace(/-/g,""),o&&!i&&t&&(e="-"+e),e},t.prototype.formatInput=function(e){return void 0===e&&(e=""),this.props.format||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)},t.prototype.isCharacterAFormat=function(e,t){var r=this.props,n=r.format,o=r.prefix,i=r.suffix,a=r.decimalScale,c=r.fixedDecimalScale,s=this.getSeparators().decimalSeparator;return"string"==typeof n&&"#"!==n[e]||!(n||!(e=t.length-i.length||a&&c&&t[e]===s))},t.prototype.correctInputValue=function(e,t,r){var n=this,o=this.props,i=o.format,a=o.allowNegative,c=o.prefix,s=o.suffix,l=o.decimalScale,p=this.getSeparators(),f=p.allowedDecimalSeparators,m=p.decimalSeparator,d=this.state.numAsString||"",b=this.selectionBeforeInput,g=b.selectionStart,h=b.selectionEnd,v=function(e,t){for(var r=0,n=0,o=e.length,i=t.length;e[r]===t[r]&&rr&&o-n>r;)n++;return{start:r,end:o-n}}(t,r),O=v.start,w=v.end;if(!i&&O===w&&-1!==f.indexOf(r[g])){var y=0===l?"":m;return r.substr(0,g)+y+r.substr(g+1,r.length)}var j=i?0:c.length,_=t.length-(i?0:s.length);if(r.length>t.length||!r.length||O===w||0===g&&h===t.length||0===O&&w===t.length||g===j&&h===_)return r;var S=t.substr(O,w-O);if([].concat(S).find((function(e,r){return n.isCharacterAFormat(r+O,t)}))){var x=t.substr(O),E={},k=[];[].concat(x).forEach((function(e,r){n.isCharacterAFormat(r+O,t)?E[r]=e:r>S.length-1&&k.push(e)})),Object.keys(E).forEach((function(e){k.length>e?k.splice(e,0,E[e]):k.push(E[e])})),r=t.substr(0,O)+k.join("")}if(!i){var N=this.removeFormatting(r),P=u(N,a),C=P.beforeDecimal,F=P.afterDecimal,R=P.addNegation,A=eO;)v--;v=this.correctCaretPosition(a,v,"left")}}else for(;!b.test(a[v])&&vw)&&(e.preventDefault(),this.setPatchedCaretPosition(r,v,a)),e.isUnitTestRun&&this.setPatchedCaretPosition(r,v,a),m(e)}else m(e)},t.prototype.onMouseUp=function(e){var t=e.target,r=t.selectionStart,n=t.selectionEnd,o=t.value;if(void 0===o&&(o=""),r===n){var i=this.correctCaretPosition(o,r);i!==r&&this.setPatchedCaretPosition(t,i,o)}this.props.onMouseUp(e)},t.prototype.onFocus=function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout((function(){var r=e.target,n=r.selectionStart,o=r.selectionEnd,i=r.value;void 0===i&&(i="");var a=t.correctCaretPosition(i,n);a===n||0===n&&o===i.length||t.setPatchedCaretPosition(r,a,i),t.props.onFocus(e)}),0)},t.prototype.render=function(){var e=this.props,t=e.type,r=e.displayType,n=e.customInput,i=e.renderText,a=e.getInputRef,c=e.format,s=(e.thousandSeparator,e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle,e.decimalScale,e.fixedDecimalScale,e.prefix,e.suffix,e.removeFormatting,e.mask,e.defaultValue,e.isNumericString,e.allowNegative,e.allowEmptyFormatting,e.allowLeadingZeros,e.onValueChange,e.isAllowed,e.customNumerals,e.onChange,e.onKeyDown,e.onMouseUp,e.onFocus,e.onBlur,e.value,function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&(r[n]=e[n]);return r}(e,["type","displayType","customInput","renderText","getInputRef","format","thousandSeparator","decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","decimalScale","fixedDecimalScale","prefix","suffix","removeFormatting","mask","defaultValue","isNumericString","allowNegative","allowEmptyFormatting","allowLeadingZeros","onValueChange","isAllowed","customNumerals","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value"])),u=this.state,l=u.value,p=u.mounted&&function(e){return e||"undefined"!=typeof navigator&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}(c)?"numeric":void 0,f=Object.assign({inputMode:p},s,{type:t,value:l,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===r)return i?i(l,s)||null:o.a.createElement("span",Object.assign({},s,{ref:a}),l);if(n){var m=n;return o.a.createElement(m,Object.assign({},f,{ref:a}))}return o.a.createElement("input",Object.assign({},f,{ref:a}))},t}(o.a.Component);g.defaultProps=b,t.a=g},14:function(e,t){e.exports=window.wp.url},145:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(0),o=r(100),i=r(3),a=r(31),c=r(18),s=r(39),u=r(65),l=r(26);const p=e=>{let{queryAttribute:t,queryPrices:r,queryStock:p,queryState:f}=e,m=Object(l.a)();m+="-collection-data";const[d]=Object(s.a)(m),[b,g]=Object(s.b)("calculate_attribute_counts",[],m),[h,v]=Object(s.b)("calculate_price_range",null,m),[O,w]=Object(s.b)("calculate_stock_status_counts",null,m),y=Object(a.a)(t||{}),j=Object(a.a)(r),_=Object(a.a)(p);Object(n.useEffect)(()=>{"object"==typeof y&&Object.keys(y).length&&(b.find(e=>Object(c.b)(y,"taxonomy")&&e.taxonomy===y.taxonomy)||g([...b,y]))},[y,b,g]),Object(n.useEffect)(()=>{h!==j&&void 0!==j&&v(j)},[j,v,h]),Object(n.useEffect)(()=>{O!==_&&void 0!==_&&w(_)},[_,w,O]);const[S,x]=Object(n.useState)(!1),[E]=Object(o.a)(S,200);S||x(!0);const k=Object(n.useMemo)(()=>(e=>{const t=e;return Array.isArray(e.calculate_attribute_counts)&&(t.calculate_attribute_counts=Object(i.sortBy)(e.calculate_attribute_counts.map(e=>{let{taxonomy:t,queryType:r}=e;return{taxonomy:t,query_type:r}}),["taxonomy","query_type"])),t})(d),[d]);return Object(u.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...f,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...k},shouldSelect:E})}},15:function(e,t,r){"use strict";var n=r(19),o=r.n(n),i=r(0),a=r(5),c=r(1),s=r(48),u=e=>{let{imageUrl:t=s.l+"/block-error.svg",header:r=Object(c.__)("Oops!","woo-gutenberg-products-block"),text:n=Object(c.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:a=Object(c.__)("Error:","woo-gutenberg-products-block"),button:u,showErrorBlock:l=!0}=e;return l?Object(i.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(i.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(i.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(i.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),n&&Object(i.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},n),o&&Object(i.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},a?a+" ":"",o),u&&Object(i.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},u))):null};r(35);class l extends a.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(i.createElement)(i.Fragment,null,Object(i.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:n=!0,text:o,errorMessagePrefix:a,renderError:c,button:s}=this.props,{errorMessage:l,hasError:p}=this.state;return p?"function"==typeof c?c({errorMessage:l}):Object(i.createElement)(u,{showErrorBlock:n,errorMessage:r?l:null,header:e,imageUrl:t,text:o,errorMessagePrefix:a,button:s}):this.props.children}}t.a=l},150:function(e){e.exports=JSON.parse('{"name":"woocommerce/price-filter","version":"1.0.0","title":"Filter by Price","description":"Allow customers to filter products by price range.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"multiple":false,"color":{"text":true,"background":false}},"example":{"attributes":{"isPreview":true}},"attributes":{"className":{"type":"string","default":""},"showInputFields":{"type":"boolean","default":true},"inlineInput":{"type":"boolean","default":true},"showFilterButton":{"type":"boolean","default":false},"headingLevel":{"type":"number","default":3}},"textdomain":"woo-gutenberg-products-block","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},18:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return o}));const n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return n(e)&&t in e}},19:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},197:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},217:function(e,t,r){e.exports=r(243)},218:function(e,t){},219:function(e,t){},22:function(e,t,r){"use strict";var n=r(0),o=r(4),i=r.n(o);t.a=e=>{let t,{label:r,screenReaderLabel:o,wrapperElement:a,wrapperProps:c={}}=e;const s=null!=r,u=null!=o;return!s&&u?(t=a||"span",c={...c,className:i()(c.className,"screen-reader-text")},Object(n.createElement)(t,c,o)):(t=a||n.Fragment,s&&u&&r!==o?Object(n.createElement)(t,c,Object(n.createElement)("span",{"aria-hidden":"true"},r),Object(n.createElement)("span",{className:"screen-reader-text"},o)):Object(n.createElement)(t,c,r))}},220:function(e,t){},243:function(e,t,r){"use strict";r.r(t);var n=r(52),o=r(0),i=r(61),a=r(39),c=r(145),s=r(1),u=r(4),l=r.n(u),p=r(102),f=r(18),m=r(51);r(219);const d=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],[i,a]=e;const c=e=>Number.isFinite(e);return c(i)||(i=t||0),c(a)||(a=r||n),c(t)&&t>i&&(i=t),c(r)&&r<=i&&(i=r-n),c(t)&&t>=a&&(a=t+n),c(r)&&r=a&&(i=a-n),o&&a<=i&&(a=i+n),[i,a]};var b=r(75);const g=e=>{let{maxConstraint:t,minorUnit:r}=e;return e=>{let{floatValue:n}=e;return void 0!==n&&n<=t/10**r&&n>0}},h=e=>{let{minConstraint:t,currentMaxValue:r,minorUnit:n}=e;return e=>{let{floatValue:o}=e;return void 0!==o&&o>=t/10**n&&o{let{className:t,label: +/* translators: Reset button text for filters. */ +r=Object(s.__)("Reset","woo-gutenberg-products-block"),onClick:n,screenReaderLabel:i=Object(s.__)("Reset filter","woo-gutenberg-products-block")}=e;return Object(o.createElement)("button",{className:l()("wc-block-components-filter-reset-button",t),onClick:n},Object(o.createElement)(v.a,{label:r,screenReaderLabel:i}))},w=e=>{let{minPrice:t,maxPrice:r,minConstraint:n,maxConstraint:i,onChange:a,step:c,currency:u,showInputFields:v=!0,showFilterButton:w=!1,inlineInput:y=!0,isLoading:j=!1,onSubmit:_=(()=>{})}=e;const S=Object(o.useRef)(null),x=Object(o.useRef)(null),E=c||10**u.minorUnit,[k,N]=Object(o.useState)(t),[P,C]=Object(o.useState)(r);Object(o.useEffect)(()=>{N(t)},[t]),Object(o.useEffect)(()=>{C(r)},[r]);const F=Object(o.useMemo)(()=>isFinite(n)&&isFinite(i),[n,i]),R=Object(o.useMemo)(()=>isFinite(t)&&isFinite(r)&&F?{"--low":Math.round((t-n)/(i-n)*100)-.5+"%","--high":Math.round((r-n)/(i-n)*100)+.5+"%"}:{"--low":"0%","--high":"100%"},[t,r,n,i,F]),A=Object(o.useCallback)(e=>{if(j||!F||!S.current||!x.current)return;const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=S.current.offsetWidth,o=+S.current.value,a=x.current.offsetWidth,c=+x.current.value,s=n*(o/i),u=a*(c/i);Math.abs(r-s)>Math.abs(r-u)?(S.current.style.zIndex="20",x.current.style.zIndex="21"):(S.current.style.zIndex="21",x.current.style.zIndex="20")},[j,i,F]),T=Object(o.useCallback)(e=>{const o=e.target.classList.contains("wc-block-price-filter__range-input--min"),c=+e.target.value,s=o?[Math.round(c/E)*E,r]:[t,Math.round(c/E)*E],u=d(s,n,i,E,o);a(u)},[a,t,r,n,i,E]),M=Object(o.useCallback)(e=>{if(e.relatedTarget&&e.relatedTarget.classList&&e.relatedTarget.classList.contains("wc-block-price-filter__amount"))return;const t=e.target.classList.contains("wc-block-price-filter__amount--min");if(k>=P){const e=d([0,P],null,null,E,t);return a([parseInt(e[0],10),parseInt(e[1],10)])}const r=d([k,P],null,null,E,t);a(r)},[a,E,k,P]),U=Object(m.a)(_,600),B=l()("wc-block-price-filter","wc-block-components-price-slider",v&&"wc-block-price-filter--has-input-fields",v&&"wc-block-components-price-slider--has-input-fields",w&&"wc-block-price-filter--has-filter-button",w&&"wc-block-components-price-slider--has-filter-button",j&&"is-loading",!F&&"is-disabled"),D=Object(f.a)(S.current)?S.current.ownerDocument.activeElement:void 0,V=D&&D===S.current?E:1,I=D&&D===x.current?E:1,L=String(k/10**u.minorUnit),q=String(P/10**u.minorUnit),G=Object(o.createElement)("div",{className:"wc-block-price-filter__range-input-wrapper wc-block-components-price-slider__range-input-wrapper",onMouseMove:A,onFocus:A},F&&Object(o.createElement)("div",{"aria-hidden":v},Object(o.createElement)("div",{className:"wc-block-price-filter__range-input-progress wc-block-components-price-slider__range-input-progress",style:R}),Object(o.createElement)("input",{type:"range",className:"wc-block-price-filter__range-input wc-block-price-filter__range-input--min wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--min","aria-label":Object(s.__)("Filter products by minimum price","woo-gutenberg-products-block"),"aria-valuetext":L,value:Number.isFinite(t)?t:n,onChange:T,step:V,min:n,max:i,ref:S,disabled:j&&!F,tabIndex:v?-1:0}),Object(o.createElement)("input",{type:"range",className:"wc-block-price-filter__range-input wc-block-price-filter__range-input--max wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--max","aria-label":Object(s.__)("Filter products by maximum price","woo-gutenberg-products-block"),"aria-valuetext":q,value:Number.isFinite(r)?r:i,onChange:T,step:I,min:n,max:i,ref:x,disabled:j,tabIndex:v?-1:0})));return Object(o.createElement)("div",{className:B},(!y||!v)&&G,v&&Object(o.createElement)("div",{className:"wc-block-price-filter__controls wc-block-components-price-slider__controls"},Object(o.createElement)(p.a,{currency:u,displayType:"input",className:"wc-block-price-filter__amount wc-block-price-filter__amount--min wc-block-form-text-input wc-block-components-price-slider__amount wc-block-components-price-slider__amount--min","aria-label":Object(s.__)("Filter products by minimum price","woo-gutenberg-products-block"),allowNegative:!1,isAllowed:h({minConstraint:n,minorUnit:u.minorUnit,currentMaxValue:P}),onValueChange:e=>{e!==k&&N(e)},onBlur:M,disabled:j||!F,value:k}),y&&G,Object(o.createElement)(p.a,{currency:u,displayType:"input",className:"wc-block-price-filter__amount wc-block-price-filter__amount--max wc-block-form-text-input wc-block-components-price-slider__amount wc-block-components-price-slider__amount--max","aria-label":Object(s.__)("Filter products by maximum price","woo-gutenberg-products-block"),isAllowed:g({maxConstraint:i,minorUnit:u.minorUnit}),onValueChange:e=>{e!==P&&C(e)},onBlur:M,disabled:j||!F,value:P})),!v&&!j&&Number.isFinite(t)&&Number.isFinite(r)&&Object(o.createElement)("div",{className:"wc-block-price-filter__range-text wc-block-components-price-slider__range-text"},Object(o.createElement)(p.a,{currency:u,value:t}),Object(o.createElement)(p.a,{currency:u,value:r})),Object(o.createElement)("div",{className:"wc-block-components-price-slider__actions"},(t!==n||r!==i)&&Object(o.createElement)(O,{onClick:()=>{a([n,i]),U()},screenReaderLabel:Object(s.__)("Reset price filter","woo-gutenberg-products-block")}),w&&Object(o.createElement)(b.a,{className:"wc-block-price-filter__button wc-block-components-price-slider__button",disabled:j||!F,onClick:_,screenReaderLabel:Object(s.__)("Apply price filter","woo-gutenberg-products-block")})))},y=r(41),j=r(2),_=r(14),S=r(124),x=r(77),E=r(45);const k=(e,t,r)=>{const n=10*10**t;let o=null;const a=parseFloat(e);isNaN(a)||("ROUND_UP"===r?o=Math.ceil(a/n)*n:"ROUND_DOWN"===r&&(o=Math.floor(a/n)*n));const c=Object(i.a)(o,Number.isFinite);return Number.isFinite(o)?o:c};function N(e,t){return Number(e)*10**t}r(218);var P=r(150);const C={heading:{type:"string",default:Object(s.__)("Filter by price","woo-gutenberg-products-block")}};Object(n.a)({selector:".wp-block-woocommerce-price-filter",Block:e=>{let{attributes:t,isEditor:r=!1}=e;const n=Object(j.getSettingWithCoercion)("has_filterable_products",!1,x.a),s=Object(j.getSettingWithCoercion)("is_rendering_php_template",!1,x.a),[u,l]=Object(o.useState)(!1),p=Object(S.d)("min_price"),d=Object(S.d)("max_price"),[b]=Object(a.a)(),{results:g,isLoading:h}=Object(c.a)({queryPrices:!0,queryState:b}),v=Object(y.getCurrencyFromPriceResponse)(Object(f.b)(g,"price_range")?g.price_range:void 0),[O,P]=Object(a.b)("min_price"),[C,F]=Object(a.b)("max_price"),[R,A]=Object(o.useState)(N(p,v.minorUnit)||null),[T,M]=Object(o.useState)(N(d,v.minorUnit)||null),{minConstraint:U,maxConstraint:B}=(e=>{let{minPrice:t,maxPrice:r,minorUnit:n}=e;return{minConstraint:k(t||"",n,"ROUND_DOWN"),maxConstraint:k(r||"",n,"ROUND_UP")}})({minPrice:Object(f.b)(g,"price_range")&&Object(f.b)(g.price_range,"min_price")&&Object(E.a)(g.price_range.min_price)?g.price_range.min_price:void 0,maxPrice:Object(f.b)(g,"price_range")&&Object(f.b)(g.price_range,"max_price")&&Object(E.a)(g.price_range.max_price)?g.price_range.max_price:void 0,minorUnit:v.minorUnit});Object(o.useEffect)(()=>{u||(P(N(p,v.minorUnit)),F(N(d,v.minorUnit)),l(!0))},[v.minorUnit,u,d,p,F,P]);const D=Object(o.useCallback)((e,t)=>{const r=t>=Number(B)?void 0:t,n=e<=Number(U)?void 0:e;if(window){const e=function(e,t){const r={};for(const[e,n]of Object.entries(t))n?r[e]=n.toString():delete r[e];const n=Object(_.removeQueryArgs)(e,...Object.keys(t));return Object(_.addQueryArgs)(n,r)}(window.location.href,{min_price:n/10**v.minorUnit,max_price:r/10**v.minorUnit});window.location.href!==e&&Object(S.c)(e)}P(n),F(r)},[U,B,P,F,v.minorUnit]),V=Object(m.a)(D,500),I=Object(o.useCallback)(e=>{e[0]!==R&&A(e[0]),e[1]!==T&&M(e[1]),s&&u&&!t.showFilterButton&&V(e[0],e[1])},[R,T,A,M,s,u,V,t.showFilterButton]);Object(o.useEffect)(()=>{t.showFilterButton||s||V(R,T)},[R,T,t.showFilterButton,V,s]);const L=Object(i.a)(O),q=Object(i.a)(C),G=Object(i.a)(U),K=Object(i.a)(B);if(Object(o.useEffect)(()=>{(!Number.isFinite(R)||O!==L&&O!==R||U!==G&&U!==R)&&A(Number.isFinite(O)?O:U),(!Number.isFinite(T)||C!==q&&C!==T||B!==K&&B!==T)&&M(Number.isFinite(C)?C:B)},[R,T,O,C,U,B,G,K,L,q]),!n)return null;if(!h&&(null===U||null===B||U===B))return null;const W="h"+t.headingLevel;return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(W,{className:"wc-block-price-filter__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-price-slider"},Object(o.createElement)(w,{minConstraint:U,maxConstraint:B,minPrice:R,maxPrice:T,currency:v,showInputFields:t.showInputFields,inlineInput:t.inlineInput,showFilterButton:t.showFilterButton,onChange:I,onSubmit:()=>D(R,T),isLoading:h})))},getProps:e=>({attributes:{showInputFields:"true"===e.dataset.showinputfields,inlineInput:"false"!==e.dataset.inlineInput,showFilterButton:"true"===e.dataset.showfilterbutton,heading:e.dataset.heading||C.heading.default,headingLevel:e.dataset.headingLevel?parseInt(e.dataset.headingLevel,10):P.attributes.headingLevel.default},isEditor:!1})})},26:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);const o=Object(n.createContext)("page"),i=()=>Object(n.useContext)(o);o.Provider},3:function(e,t){e.exports=window.lodash},31:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(11),i=r.n(o);function a(e){const t=Object(n.useRef)(e);return i()(e,t.current)||(t.current=e),t.current}},35:function(e,t){},39:function(e,t,r){"use strict";r.d(t,"a",(function(){return p})),r.d(t,"b",(function(){return f})),r.d(t,"c",(function(){return m}));var n=r(6),o=r(7),i=r(0),a=r(11),c=r.n(a),s=r(31),u=r(61),l=r(26);const p=e=>{const t=Object(l.a)();e=e||t;const r=Object(o.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:a}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[r,Object(i.useCallback)(t=>{a(e,t)},[e,a])]},f=(e,t,r)=>{const a=Object(l.a)();r=r||a;const c=Object(o.useSelect)(o=>o(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t),[r,e]),{setQueryValue:s}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[c,Object(i.useCallback)(t=>{s(r,e,t)},[r,e,s])]},m=(e,t)=>{const r=Object(l.a)();t=t||r;const[n,o]=p(t),a=Object(s.a)(n),f=Object(s.a)(e),m=Object(u.a)(f),d=Object(i.useRef)(!1);return Object(i.useEffect)(()=>{c()(m,f)||(o(Object.assign({},a,f)),d.current=!0)},[a,f,m,o]),d.current?[n,o]:[e,o]}},4:function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t"string"==typeof e},48:function(e,t,r){"use strict";r.d(t,"n",(function(){return i})),r.d(t,"l",(function(){return a})),r.d(t,"k",(function(){return c})),r.d(t,"m",(function(){return s})),r.d(t,"i",(function(){return u})),r.d(t,"d",(function(){return l})),r.d(t,"f",(function(){return p})),r.d(t,"j",(function(){return f})),r.d(t,"c",(function(){return m})),r.d(t,"e",(function(){return d})),r.d(t,"g",(function(){return b})),r.d(t,"a",(function(){return g})),r.d(t,"h",(function(){return h})),r.d(t,"b",(function(){return v}));var n,o=r(2);const i=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=i.pluginUrl+"images/",c=i.pluginUrl+"build/",s=i.buildPhase,u=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,f=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),m=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),d=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),b=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),v=Object(o.getSetting)("allowedStates",{})},5:function(e,t){e.exports=window.React},51:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(5);function o(e,t,r){var o=this,i=Object(n.useRef)(null),a=Object(n.useRef)(0),c=Object(n.useRef)(null),s=Object(n.useRef)([]),u=Object(n.useRef)(),l=Object(n.useRef)(),p=Object(n.useRef)(e),f=Object(n.useRef)(!0);p.current=e;var m=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var d=!!(r=r||{}).leading,b=!("trailing"in r)||!!r.trailing,g="maxWait"in r,h=g?Math.max(+r.maxWait||0,t):null;return Object(n.useEffect)((function(){return f.current=!0,function(){f.current=!1}}),[]),Object(n.useMemo)((function(){var e=function(e){var t=s.current,r=u.current;return s.current=u.current=null,a.current=e,l.current=p.current.apply(r,t)},r=function(e,t){m&&cancelAnimationFrame(c.current),c.current=m?requestAnimationFrame(e):setTimeout(e,t)},n=function(e){if(!f.current)return!1;var r=e-i.current,n=e-a.current;return!i.current||r>=t||r<0||g&&n>=h},v=function(t){return c.current=null,b&&s.current?e(t):(s.current=u.current=null,l.current)},O=function(){var e=Date.now();if(n(e))return v(e);if(f.current){var o=e-i.current,c=e-a.current,s=t-o,u=g?Math.min(s,h-c):s;r(O,u)}},w=function(){for(var p=[],m=0;m{let{Block:t,containers:r,getProps:n=(()=>({})),getErrorBoundaryProps:c=(()=>({}))}=e;0!==r.length&&Array.prototype.forEach.call(r,(e,r)=>{const s=n(e,r),u=c(e,r),l={...e.dataset,...s.attributes||{}};(e=>{let{Block:t,container:r,attributes:n={},props:c={},errorBoundaryProps:s={}}=e;Object(i.render)(Object(i.createElement)(a.a,s,Object(i.createElement)(i.Suspense,{fallback:Object(i.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(i.createElement)(t,o()({},c,{attributes:n})))),r,()=>{r.classList&&r.classList.remove("is-loading")})})({Block:t,container:e,props:s,attributes:l,errorBoundaryProps:u})})},u=e=>{const t=document.body.querySelectorAll(c.join(",")),{Block:r,getProps:n,getErrorBoundaryProps:o,selector:i}=e;(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrappers:i}=e;const a=document.body.querySelectorAll(o);i&&i.length>0&&Array.prototype.filter.call(a,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,i)),s({Block:t,containers:a,getProps:r,getErrorBoundaryProps:n})})({Block:r,getProps:n,getErrorBoundaryProps:o,selector:i,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrapper:i}=e;const a=i.querySelectorAll(o);s({Block:t,containers:a,getProps:r,getErrorBoundaryProps:n})})({...e,wrapper:t})})})}},6:function(e,t){e.exports=window.wc.wcBlocksData},61:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(5);function o(e,t){const r=Object(n.useRef)();return Object(n.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},65:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(6),o=r(7),i=r(0),a=r(31),c=r(73);const s=e=>{const{namespace:t,resourceName:r,resourceValues:s=[],query:u={},shouldSelect:l=!0}=e;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");const p=Object(i.useRef)({results:[],isLoading:!0}),f=Object(a.a)(u),m=Object(a.a)(s),d=Object(c.a)(),b=Object(o.useSelect)(e=>{if(!l)return null;const o=e(n.COLLECTIONS_STORE_KEY),i=[t,r,f,m],a=o.getCollectionError(...i);if(a){if(!(a instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");d(a)}return{results:o.getCollection(...i),isLoading:!o.hasFinishedResolution("getCollection",i)}},[t,r,m,f,l]);return null!==b&&(p.current=b),p.current}},7:function(e,t){e.exports=window.wp.data},73:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const o=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},75:function(e,t,r){"use strict";var n=r(0),o=r(1),i=r(4),a=r.n(i),c=r(22);r(107),t.a=e=>{let{className:t,disabled:r,label: +/* translators: Submit button text for filters. */ +i=Object(o.__)("Apply","woo-gutenberg-products-block"),onClick:s,screenReaderLabel:u=Object(o.__)("Apply filter","woo-gutenberg-products-block")}=e;return Object(n.createElement)("button",{type:"submit",className:a()("wp-block-button__link","wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:r,onClick:s},Object(n.createElement)(c.a,{label:i,screenReaderLabel:u}))}},77:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"boolean"==typeof e}}); \ No newline at end of file diff --git a/build/price-filter.asset.php b/build/price-filter.asset.php new file mode 100644 index 00000000000..f3de34eba81 --- /dev/null +++ b/build/price-filter.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'b0027bb997be631a5b11c0915946817a'); \ No newline at end of file diff --git a/build/price-filter.js b/build/price-filter.js new file mode 100644 index 00000000000..692bec44ac0 --- /dev/null +++ b/build/price-filter.js @@ -0,0 +1,7 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["price-filter"]=function(e){function t(t){for(var r,i,l=t[0],a=t[1],s=t[2],b=0,p=[];b"string"==typeof e},109:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(12);function c(e,t){const n=Object(r.useRef)();return Object(r.useEffect)(()=>{n.current===e||t&&!t(e,n.current)||(n.current=e)},[e,t]),n.current}},11:function(e,t){e.exports=window.wp.primitives},12:function(e,t){e.exports=window.React},120:function(e,t,n){"use strict";var r=n(0),c=n(5),o=n(10),i=n(1);n(158),t.a=Object(o.withInstanceId)(e=>{let{className:t,headingLevel:n,onChange:o,heading:l,instanceId:a}=e;const s="h"+n;return Object(r.createElement)(s,{className:t},Object(r.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-"+a},Object(i.__)("Block title","woo-gutenberg-products-block")),Object(r.createElement)(c.PlainText,{id:"block-title-"+a,className:"wc-block-editor-components-title",value:l,onChange:o}))})},124:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0);const c=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},125:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(17),c=n(9),o=n(0),i=n(49),l=n(124);const a=e=>{const{namespace:t,resourceName:n,resourceValues:a=[],query:s={},shouldSelect:u=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(o.useRef)({results:[],isLoading:!0}),p=Object(i.a)(s),d=Object(i.a)(a),m=Object(l.a)(),f=Object(c.useSelect)(e=>{if(!u)return null;const c=e(r.COLLECTIONS_STORE_KEY),o=[t,n,p,d],i=c.getCollectionError(...o);if(i){if(!(i instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(i)}return{results:c.getCollection(...o),isLoading:!c.hasFinishedResolution("getCollection",o)}},[t,n,d,p,u]);return null!==f&&(b.current=f),b.current}},131:function(e,t){},146:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(4),i=n.n(o),l=n(28);n(183),t.a=e=>{let{className:t,disabled:n,label: +/* translators: Submit button text for filters. */ +o=Object(c.__)("Apply","woo-gutenberg-products-block"),onClick:a,screenReaderLabel:s=Object(c.__)("Apply filter","woo-gutenberg-products-block")}=e;return Object(r.createElement)("button",{type:"submit",className:i()("wp-block-button__link","wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:n,onClick:a},Object(r.createElement)(l.a,{label:o,screenReaderLabel:s}))}},15:function(e,t){e.exports=window.wp.url},158:function(e,t){},162:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"boolean"==typeof e},17:function(e,t){e.exports=window.wc.wcBlocksData},183:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},22:function(e,t){e.exports=window.wp.isShallowEqual},23:function(e,t,n){"use strict";n.d(t,"o",(function(){return o})),n.d(t,"m",(function(){return i})),n.d(t,"l",(function(){return l})),n.d(t,"n",(function(){return a})),n.d(t,"j",(function(){return s})),n.d(t,"e",(function(){return u})),n.d(t,"f",(function(){return b})),n.d(t,"g",(function(){return p})),n.d(t,"k",(function(){return d})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return f})),n.d(t,"h",(function(){return g})),n.d(t,"a",(function(){return O})),n.d(t,"i",(function(){return w})),n.d(t,"b",(function(){return _}));var r,c=n(2);const o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=o.pluginUrl+"images/",l=o.pluginUrl+"build/",a=o.buildPhase,s=null===(r=c.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,p=c.STORE_PAGES.privacy.permalink,d=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),m=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),f=c.STORE_PAGES.cart.permalink,g=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),O=Object(c.getSetting)("allowedCountries",{}),w=Object(c.getSetting)("shippingStates",{}),_=Object(c.getSetting)("allowedStates",{})},245:function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"c",(function(){return u}));var r=n(15),c=n(2),o=n(162);const i=Object(c.getSettingWithCoercion)("is_rendering_php_template",!1,o.a),l="query_type_",a="filter_";function s(e){return window?Object(r.getQueryArg)(window.location.href,e):null}function u(e){i?window.location.href=e:window.history.replaceState({},"",e)}},26:function(e,t){e.exports=window.wc.priceFormat},277:function(e){e.exports=JSON.parse('{"name":"woocommerce/price-filter","version":"1.0.0","title":"Filter by Price","description":"Allow customers to filter products by price range.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"multiple":false,"color":{"text":true,"background":false}},"example":{"attributes":{"isPreview":true}},"attributes":{"className":{"type":"string","default":""},"showInputFields":{"type":"boolean","default":true},"inlineInput":{"type":"boolean","default":true},"showFilterButton":{"type":"boolean","default":false},"headingLevel":{"type":"number","default":3}},"textdomain":"woo-gutenberg-products-block","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},28:function(e,t,n){"use strict";var r=n(0),c=n(4),o=n.n(c);t.a=e=>{let t,{label:n,screenReaderLabel:c,wrapperElement:i,wrapperProps:l={}}=e;const a=null!=n,s=null!=c;return!a&&s?(t=i||"span",l={...l,className:o()(l.className,"screen-reader-text")},Object(r.createElement)(t,l,c)):(t=i||r.Fragment,a&&s&&n!==c?Object(r.createElement)(t,l,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},c)):Object(r.createElement)(t,l,n))}},3:function(e,t){e.exports=window.wp.components},309:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(0),c=n(284),o=n(7),i=n(49),l=n(35),a=n(75),s=n(125),u=n(52);const b=e=>{let{queryAttribute:t,queryPrices:n,queryStock:b,queryState:p}=e,d=Object(u.a)();d+="-collection-data";const[m]=Object(a.a)(d),[f,g]=Object(a.b)("calculate_attribute_counts",[],d),[O,w]=Object(a.b)("calculate_price_range",null,d),[_,j]=Object(a.b)("calculate_stock_status_counts",null,d),h=Object(i.a)(t||{}),v=Object(i.a)(n),k=Object(i.a)(b);Object(r.useEffect)(()=>{"object"==typeof h&&Object.keys(h).length&&(f.find(e=>Object(l.b)(h,"taxonomy")&&e.taxonomy===h.taxonomy)||g([...f,h]))},[h,f,g]),Object(r.useEffect)(()=>{O!==v&&void 0!==v&&w(v)},[v,w,O]),Object(r.useEffect)(()=>{_!==k&&void 0!==k&&j(k)},[k,j,_]);const[y,E]=Object(r.useState)(!1),[x]=Object(c.a)(y,200);y||E(!0);const S=Object(r.useMemo)(()=>(e=>{const t=e;return Array.isArray(e.calculate_attribute_counts)&&(t.calculate_attribute_counts=Object(o.sortBy)(e.calculate_attribute_counts.map(e=>{let{taxonomy:t,queryType:n}=e;return{taxonomy:t,query_type:n}}),["taxonomy","query_type"])),t})(m),[m]);return Object(s.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...p,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...S},shouldSelect:x})}},35:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return c}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function c(e,t){return r(e)&&t in e}},38:function(e,t,n){"use strict";var r=n(6),c=n.n(r),o=n(0),i=n(126),l=n(4),a=n.n(l);n(131);const s=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:n,currency:r,onValueChange:l,displayType:u="text",...b}=e;const p="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(p))return null;const d=p/10**r.minorUnit;if(!Number.isFinite(d))return null;const m=a()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),f={...b,...s(r),value:void 0,currency:void 0,onValueChange:void 0},g=l?e=>{const t=+e.value*10**r.minorUnit;l(t)}:()=>{};return Object(o.createElement)(i.a,c()({className:m,displayType:u},f,{value:d,onValueChange:g}))}},386:function(e,t,n){e.exports=n(458)},387:function(e,t){},388:function(e,t){},389:function(e,t){},390:function(e,t){},458:function(e,t,n){"use strict";n.r(t);var r=n(6),c=n.n(r),o=n(0),i=n(1),l=n(8),a=n(4),s=n.n(a),u=n(113),b=n(511),p=n(5),d=n(2),m=n(23),f=n(99),g=n(120),O=n(235),w=n(3),_=n(109),j=n(75),h=n(309),v=n(38),k=n(35),y=n(112);n(389);const E=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,c=arguments.length>4&&void 0!==arguments[4]&&arguments[4],[o,i]=e;const l=e=>Number.isFinite(e);return l(o)||(o=t||0),l(i)||(i=n||r),l(t)&&t>o&&(o=t),l(n)&&n<=o&&(o=n-r),l(t)&&t>=i&&(i=t+r),l(n)&&n=i&&(o=i-r),c&&i<=o&&(i=o+r),[o,i]};var x=n(146);const S=e=>{let{maxConstraint:t,minorUnit:n}=e;return e=>{let{floatValue:r}=e;return void 0!==r&&r<=t/10**n&&r>0}},C=e=>{let{minConstraint:t,currentMaxValue:n,minorUnit:r}=e;return e=>{let{floatValue:c}=e;return void 0!==c&&c>=t/10**r&&c{let{className:t,label: +/* translators: Reset button text for filters. */ +n=Object(i.__)("Reset","woo-gutenberg-products-block"),onClick:r,screenReaderLabel:c=Object(i.__)("Reset filter","woo-gutenberg-products-block")}=e;return Object(o.createElement)("button",{className:s()("wc-block-components-filter-reset-button",t),onClick:r},Object(o.createElement)(N.a,{label:n,screenReaderLabel:c}))},P=e=>{let{minPrice:t,maxPrice:n,minConstraint:r,maxConstraint:c,onChange:l,step:a,currency:u,showInputFields:b=!0,showFilterButton:p=!1,inlineInput:d=!0,isLoading:m=!1,onSubmit:f=(()=>{})}=e;const g=Object(o.useRef)(null),O=Object(o.useRef)(null),w=a||10**u.minorUnit,[_,j]=Object(o.useState)(t),[h,N]=Object(o.useState)(n);Object(o.useEffect)(()=>{j(t)},[t]),Object(o.useEffect)(()=>{N(n)},[n]);const P=Object(o.useMemo)(()=>isFinite(r)&&isFinite(c),[r,c]),T=Object(o.useMemo)(()=>isFinite(t)&&isFinite(n)&&P?{"--low":Math.round((t-r)/(c-r)*100)-.5+"%","--high":Math.round((n-r)/(c-r)*100)+.5+"%"}:{"--low":"0%","--high":"100%"},[t,n,r,c,P]),R=Object(o.useCallback)(e=>{if(m||!P||!g.current||!O.current)return;const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=g.current.offsetWidth,o=+g.current.value,i=O.current.offsetWidth,l=+O.current.value,a=r*(o/c),s=i*(l/c);Math.abs(n-a)>Math.abs(n-s)?(g.current.style.zIndex="20",O.current.style.zIndex="21"):(g.current.style.zIndex="21",O.current.style.zIndex="20")},[m,c,P]),L=Object(o.useCallback)(e=>{const o=e.target.classList.contains("wc-block-price-filter__range-input--min"),i=+e.target.value,a=o?[Math.round(i/w)*w,n]:[t,Math.round(i/w)*w],s=E(a,r,c,w,o);l(s)},[l,t,n,r,c,w]),U=Object(o.useCallback)(e=>{if(e.relatedTarget&&e.relatedTarget.classList&&e.relatedTarget.classList.contains("wc-block-price-filter__amount"))return;const t=e.target.classList.contains("wc-block-price-filter__amount--min");if(_>=h){const e=E([0,h],null,null,w,t);return l([parseInt(e[0],10),parseInt(e[1],10)])}const n=E([_,h],null,null,w,t);l(n)},[l,w,_,h]),A=Object(y.a)(f,600),V=s()("wc-block-price-filter","wc-block-components-price-slider",b&&"wc-block-price-filter--has-input-fields",b&&"wc-block-components-price-slider--has-input-fields",p&&"wc-block-price-filter--has-filter-button",p&&"wc-block-components-price-slider--has-filter-button",m&&"is-loading",!P&&"is-disabled"),B=Object(k.a)(g.current)?g.current.ownerDocument.activeElement:void 0,I=B&&B===g.current?w:1,M=B&&B===O.current?w:1,H=String(_/10**u.minorUnit),z=String(h/10**u.minorUnit),G=Object(o.createElement)("div",{className:"wc-block-price-filter__range-input-wrapper wc-block-components-price-slider__range-input-wrapper",onMouseMove:R,onFocus:R},P&&Object(o.createElement)("div",{"aria-hidden":b},Object(o.createElement)("div",{className:"wc-block-price-filter__range-input-progress wc-block-components-price-slider__range-input-progress",style:T}),Object(o.createElement)("input",{type:"range",className:"wc-block-price-filter__range-input wc-block-price-filter__range-input--min wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--min","aria-label":Object(i.__)("Filter products by minimum price","woo-gutenberg-products-block"),"aria-valuetext":H,value:Number.isFinite(t)?t:r,onChange:L,step:I,min:r,max:c,ref:g,disabled:m&&!P,tabIndex:b?-1:0}),Object(o.createElement)("input",{type:"range",className:"wc-block-price-filter__range-input wc-block-price-filter__range-input--max wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--max","aria-label":Object(i.__)("Filter products by maximum price","woo-gutenberg-products-block"),"aria-valuetext":z,value:Number.isFinite(n)?n:c,onChange:L,step:M,min:r,max:c,ref:O,disabled:m,tabIndex:b?-1:0})));return Object(o.createElement)("div",{className:V},(!d||!b)&&G,b&&Object(o.createElement)("div",{className:"wc-block-price-filter__controls wc-block-components-price-slider__controls"},Object(o.createElement)(v.a,{currency:u,displayType:"input",className:"wc-block-price-filter__amount wc-block-price-filter__amount--min wc-block-form-text-input wc-block-components-price-slider__amount wc-block-components-price-slider__amount--min","aria-label":Object(i.__)("Filter products by minimum price","woo-gutenberg-products-block"),allowNegative:!1,isAllowed:C({minConstraint:r,minorUnit:u.minorUnit,currentMaxValue:h}),onValueChange:e=>{e!==_&&j(e)},onBlur:U,disabled:m||!P,value:_}),d&&G,Object(o.createElement)(v.a,{currency:u,displayType:"input",className:"wc-block-price-filter__amount wc-block-price-filter__amount--max wc-block-form-text-input wc-block-components-price-slider__amount wc-block-components-price-slider__amount--max","aria-label":Object(i.__)("Filter products by maximum price","woo-gutenberg-products-block"),isAllowed:S({maxConstraint:c,minorUnit:u.minorUnit}),onValueChange:e=>{e!==h&&N(e)},onBlur:U,disabled:m||!P,value:h})),!b&&!m&&Number.isFinite(t)&&Number.isFinite(n)&&Object(o.createElement)("div",{className:"wc-block-price-filter__range-text wc-block-components-price-slider__range-text"},Object(o.createElement)(v.a,{currency:u,value:t}),Object(o.createElement)(v.a,{currency:u,value:n})),Object(o.createElement)("div",{className:"wc-block-components-price-slider__actions"},(t!==r||n!==c)&&Object(o.createElement)(F,{onClick:()=>{l([r,c]),A()},screenReaderLabel:Object(i.__)("Reset price filter","woo-gutenberg-products-block")}),p&&Object(o.createElement)(x.a,{className:"wc-block-price-filter__button wc-block-components-price-slider__button",disabled:m||!P,onClick:f,screenReaderLabel:Object(i.__)("Apply price filter","woo-gutenberg-products-block")})))},T=n(26),R=n(15),L=n(245),U=n(162),A=n(100);const V=(e,t,n)=>{const r=10*10**t;let c=null;const o=parseFloat(e);isNaN(o)||("ROUND_UP"===n?c=Math.ceil(o/r)*r:"ROUND_DOWN"===n&&(c=Math.floor(o/r)*r));const i=Object(_.a)(c,Number.isFinite);return Number.isFinite(c)?c:i};function B(e,t){return Number(e)*10**t}n(388);var I=e=>{let{attributes:t,isEditor:n=!1}=e;const r=Object(d.getSettingWithCoercion)("has_filterable_products",!1,U.a),c=Object(d.getSettingWithCoercion)("is_rendering_php_template",!1,U.a),[i,l]=Object(o.useState)(!1),a=Object(L.d)("min_price"),s=Object(L.d)("max_price"),[u]=Object(j.a)(),{results:b,isLoading:p}=Object(h.a)({queryPrices:!0,queryState:u}),m=Object(T.getCurrencyFromPriceResponse)(Object(k.b)(b,"price_range")?b.price_range:void 0),[f,g]=Object(j.b)("min_price"),[O,w]=Object(j.b)("max_price"),[v,E]=Object(o.useState)(B(a,m.minorUnit)||null),[x,S]=Object(o.useState)(B(s,m.minorUnit)||null),{minConstraint:C,maxConstraint:N}=(e=>{let{minPrice:t,maxPrice:n,minorUnit:r}=e;return{minConstraint:V(t||"",r,"ROUND_DOWN"),maxConstraint:V(n||"",r,"ROUND_UP")}})({minPrice:Object(k.b)(b,"price_range")&&Object(k.b)(b.price_range,"min_price")&&Object(A.a)(b.price_range.min_price)?b.price_range.min_price:void 0,maxPrice:Object(k.b)(b,"price_range")&&Object(k.b)(b.price_range,"max_price")&&Object(A.a)(b.price_range.max_price)?b.price_range.max_price:void 0,minorUnit:m.minorUnit});Object(o.useEffect)(()=>{i||(g(B(a,m.minorUnit)),w(B(s,m.minorUnit)),l(!0))},[m.minorUnit,i,s,a,w,g]);const F=Object(o.useCallback)((e,t)=>{const n=t>=Number(N)?void 0:t,r=e<=Number(C)?void 0:e;if(window){const e=function(e,t){const n={};for(const[e,r]of Object.entries(t))r?n[e]=r.toString():delete n[e];const r=Object(R.removeQueryArgs)(e,...Object.keys(t));return Object(R.addQueryArgs)(r,n)}(window.location.href,{min_price:r/10**m.minorUnit,max_price:n/10**m.minorUnit});window.location.href!==e&&Object(L.c)(e)}g(r),w(n)},[C,N,g,w,m.minorUnit]),I=Object(y.a)(F,500),M=Object(o.useCallback)(e=>{e[0]!==v&&E(e[0]),e[1]!==x&&S(e[1]),c&&i&&!t.showFilterButton&&I(e[0],e[1])},[v,x,E,S,c,i,I,t.showFilterButton]);Object(o.useEffect)(()=>{t.showFilterButton||c||I(v,x)},[v,x,t.showFilterButton,I,c]);const H=Object(_.a)(f),z=Object(_.a)(O),G=Object(_.a)(C),q=Object(_.a)(N);if(Object(o.useEffect)(()=>{(!Number.isFinite(v)||f!==H&&f!==v||C!==G&&C!==v)&&E(Number.isFinite(f)?f:C),(!Number.isFinite(x)||O!==z&&O!==x||N!==q&&N!==x)&&S(Number.isFinite(O)?O:N)},[v,x,f,O,C,N,G,q,H,z]),!r)return null;if(!p&&(null===C||null===N||C===N))return null;const D="h"+t.headingLevel;return Object(o.createElement)(o.Fragment,null,!n&&t.heading&&Object(o.createElement)(D,{className:"wc-block-price-filter__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-price-slider"},Object(o.createElement)(P,{minConstraint:C,maxConstraint:N,minPrice:v,maxPrice:x,currency:m,showInputFields:t.showInputFields,inlineInput:t.inlineInput,showFilterButton:t.showFilterButton,onChange:M,onSubmit:()=>F(v,x),isLoading:p})))},M=(n(387),n(277));const H={heading:{type:"string",default:Object(i.__)("Filter by price","woo-gutenberg-products-block")}};Object(l.registerBlockType)(M,{title:Object(i.__)("Filter by Price","woo-gutenberg-products-block"),description:Object(i.__)("Allow customers to filter products by price range.","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(u.a,{icon:b.a,className:"wc-block-editor-components-block-icon"})},attributes:{...M.attributes,...H},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:n}=e;return"woocommerce_price_filter"===t&&!(null==n||!n.raw)},transform:e=>{var t;let{instance:n}=e;return Object(l.createBlock)("woocommerce/price-filter",{showInputFields:!1,showFilterButton:!0,heading:(null==n||null===(t=n.raw)||void 0===t?void 0:t.title)||Object(i.__)("Filter by price","woo-gutenberg-products-block"),headingLevel:3,inlineInput:!0})}}]},edit:function(e){let{attributes:t,setAttributes:n}=e;const{heading:r,headingLevel:c,showInputFields:l,inlineInput:a,showFilterButton:s}=t,_=Object(p.useBlockProps)();return Object(o.createElement)("div",_,0===m.o.productCount?Object(o.createElement)(w.Placeholder,{className:"wc-block-price-slider",icon:Object(o.createElement)(u.a,{icon:b.a}),label:Object(i.__)("Filter by Price","woo-gutenberg-products-block"),instructions:Object(i.__)("Display a slider to filter products in your store by price.","woo-gutenberg-products-block")},Object(o.createElement)("p",null,Object(i.__)("Products with prices are needed for filtering by price. You haven't created any products yet.","woo-gutenberg-products-block")),Object(o.createElement)(w.Button,{className:"wc-block-price-slider__add-product-button",isSecondary:!0,href:Object(d.getAdminLink)("post-new.php?post_type=product")},Object(i.__)("Add new product","woo-gutenberg-products-block")+" ",Object(o.createElement)(u.a,{icon:O.a})),Object(o.createElement)(w.Button,{className:"wc-block-price-slider__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(i.__)("Learn more","woo-gutenberg-products-block"))):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(p.InspectorControls,{key:"inspector"},Object(o.createElement)(w.PanelBody,{title:Object(i.__)("Settings","woo-gutenberg-products-block")},Object(o.createElement)(w.__experimentalToggleGroupControl,{label:Object(i.__)("Price Range Selector","woo-gutenberg-products-block"),value:l?"editable":"text",onChange:e=>n({showInputFields:"editable"===e}),className:"wc-block-price-filter__price-range-toggle"},Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"editable",label:Object(i.__)("Editable","woo-gutenberg-products-block")}),Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"text",label:Object(i.__)("Text","woo-gutenberg-products-block")})),l&&Object(o.createElement)(w.ToggleControl,{label:Object(i.__)("Inline input fields","woo-gutenberg-products-block"),checked:a,onChange:()=>n({inlineInput:!a}),help:Object(i.__)("Show input fields inline with the slider.","woo-gutenberg-products-block")}),Object(o.createElement)(w.ToggleControl,{label:Object(i.__)("Show 'Apply filters' button","woo-gutenberg-products-block"),help:s?Object(i.__)("Products will only update when the button is pressed.","woo-gutenberg-products-block"):Object(i.__)("Products will update when the slider is moved.","woo-gutenberg-products-block"),checked:s,onChange:()=>n({showFilterButton:!s})}),Object(o.createElement)("p",null,Object(i.__)("Heading Level","woo-gutenberg-products-block")),Object(o.createElement)(f.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:c,onChange:e=>n({headingLevel:e})}))),Object(o.createElement)(g.a,{className:"wc-block-price-filter__title",headingLevel:c,heading:r,onChange:e=>n({heading:e})}),Object(o.createElement)(w.Disabled,null,Object(o.createElement)(I,{attributes:t,isEditor:!0}))))},save(e){let{attributes:t}=e;const{className:n,showInputFields:r,showFilterButton:i,heading:l,headingLevel:a}=t,u={"data-showinputfields":r,"data-showfilterbutton":i,"data-heading":l,"data-heading-level":a};return Object(o.createElement)("div",c()({},p.useBlockProps.save({className:s()("is-loading",n)}),u),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-product-categories__placeholder"}))}})},49:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),c=n(22),o=n.n(c);function i(e){const t=Object(r.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},5:function(e,t){e.exports=window.wp.blockEditor},52:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);const c=Object(r.createContext)("page"),o=()=>Object(r.useContext)(c);c.Provider},7:function(e,t){e.exports=window.lodash},75:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return d}));var r=n(17),c=n(9),o=n(0),i=n(22),l=n.n(i),a=n(49),s=n(109),u=n(52);const b=e=>{const t=Object(u.a)();e=e||t;const n=Object(c.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:i}=Object(c.useDispatch)(r.QUERY_STATE_STORE_KEY);return[n,Object(o.useCallback)(t=>{i(e,t)},[e,i])]},p=(e,t,n)=>{const i=Object(u.a)();n=n||i;const l=Object(c.useSelect)(c=>c(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t),[n,e]),{setQueryValue:a}=Object(c.useDispatch)(r.QUERY_STATE_STORE_KEY);return[l,Object(o.useCallback)(t=>{a(n,e,t)},[n,e,a])]},d=(e,t)=>{const n=Object(u.a)();t=t||n;const[r,c]=b(t),i=Object(a.a)(r),p=Object(a.a)(e),d=Object(s.a)(p),m=Object(o.useRef)(!1);return Object(o.useEffect)(()=>{l()(d,p)||(c(Object.assign({},i,p)),m.current=!0)},[i,p,d,c]),m.current?[r,c]:[e,c]}},8:function(e,t){e.exports=window.wp.blocks},9:function(e,t){e.exports=window.wp.data},99:function(e,t,n){"use strict";var r=n(0),c=n(7),o=n(1),i=n(3),l=n(11);function a(e){let{level:t}=e;const n={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return n.hasOwnProperty(t)?Object(r.createElement)(l.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(l.Path,{d:n[t]})):null}class s extends r.Component{createLevelControl(e,t,n){const c=e===t;return{icon:Object(r.createElement)(a,{level:e}),title:Object(o.sprintf)( +/* translators: %s: heading level e.g: "2", "3", "4" */ +Object(o.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:c,onClick:()=>n(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:n,selectedLevel:o,onChange:l}=this.props;return Object(r.createElement)(i.ToolbarGroup,{isCollapsed:e,icon:Object(r.createElement)(a,{level:o}),controls:Object(c.range)(t,n).map(e=>this.createLevelControl(e,o,l))})}}t.a=s}}); \ No newline at end of file diff --git a/build/price-filter/block.json b/build/price-filter/block.json new file mode 100644 index 00000000000..d22b929c524 --- /dev/null +++ b/build/price-filter/block.json @@ -0,0 +1,46 @@ +{ + "name": "woocommerce/price-filter", + "version": "1.0.0", + "title": "Filter by Price", + "description": "Allow customers to filter products by price range.", + "category": "woocommerce", + "keywords": [ "WooCommerce" ], + "supports": { + "html": false, + "multiple": false, + "color": { + "text": true, + "background": false + } + }, + "example": { + "attributes": { + "isPreview": true + } + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "showInputFields": { + "type": "boolean", + "default": true + }, + "inlineInput": { + "type": "boolean", + "default": true + }, + "showFilterButton": { + "type": "boolean", + "default": false + }, + "headingLevel": { + "type": "number", + "default": 3 + } + }, + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2, + "$schema": "https://schemas.wp.org/trunk/block.json" +} diff --git a/build/price-format.asset.php b/build/price-format.asset.php new file mode 100644 index 00000000000..7d8fb7fe643 --- /dev/null +++ b/build/price-format.asset.php @@ -0,0 +1 @@ + array('wc-settings', 'wp-polyfill'), 'version' => '13a0f5eed75229267d2f637c54d08941'); \ No newline at end of file diff --git a/build/price-format.js b/build/price-format.js new file mode 100644 index 00000000000..db582056731 --- /dev/null +++ b/build/price-format.js @@ -0,0 +1 @@ +this.wc=this.wc||{},this.wc.priceFormat=function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=141)}({141:function(e,r,t){"use strict";t.r(r),t.d(r,"getCurrencyFromPriceResponse",(function(){return u})),t.d(r,"getCurrency",(function(){return a})),t.d(r,"formatPrice",(function(){return f}));var n=t(5);const o={code:n.CURRENCY.code,symbol:n.CURRENCY.symbol,thousandSeparator:n.CURRENCY.thousandSeparator,decimalSeparator:n.CURRENCY.decimalSeparator,minorUnit:n.CURRENCY.precision,prefix:(i=n.CURRENCY.symbol,c=n.CURRENCY.symbolPosition,{left:i,left_space:" "+i,right:"",right_space:""}[c]||""),suffix:((e,r)=>({left:"",left_space:"",right:e,right_space:" "+e}[r]||""))(n.CURRENCY.symbol,n.CURRENCY.symbolPosition)};var i,c;const u=e=>{if(null==e||!e.currency_code)return o;const{currency_code:r,currency_symbol:t,currency_thousand_separator:n,currency_decimal_separator:i,currency_minor_unit:c,currency_prefix:u,currency_suffix:a}=e;return{code:r||"USD",symbol:t||"$",thousandSeparator:"string"==typeof n?n:",",decimalSeparator:"string"==typeof i?i:".",minorUnit:Number.isFinite(c)?c:2,prefix:"string"==typeof u?u:"$",suffix:"string"==typeof a?a:""}},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{...o,...e}},f=(e,r)=>{if(""===e||void 0===e)return"";const t="number"==typeof e?e:parseInt(e,10);if(!Number.isFinite(t))return"";const n=a(r),{minorUnit:o,prefix:i,suffix:c,decimalSeparator:u,thousandSeparator:f}=n,s=t/10**o,{beforeDecimal:l,afterDecimal:p}=(e=>{const r=e.split(".");return{beforeDecimal:r[0],afterDecimal:r[1]||""}})(s.toString()),d=`${i}${((e,r)=>e.replace(/\B(?=(\d{3})+(?!\d))/g,r))(l,f)}${((e,r,t)=>e?`${r}${e.padEnd(t,"0")}`:t>0?`${r}${"0".repeat(t)}`:"")(p,u,o)}${c}`,m=document.createElement("textarea");return m.innerHTML=d,m.value}},5:function(e,r){e.exports=window.wc.wcSettings}}); \ No newline at end of file diff --git a/build/proceed-to-checkout-block/block.json b/build/proceed-to-checkout-block/block.json new file mode 100644 index 00000000000..11e5606ecba --- /dev/null +++ b/build/proceed-to-checkout-block/block.json @@ -0,0 +1,27 @@ +{ + "name": "woocommerce/proceed-to-checkout-block", + "version": "1.0.0", + "title": "Proceed to checkout", + "description": "Allow customers proceed to Checkout.", + "category": "woocommerce", + "supports": { + "align": false, + "html": false, + "multiple": false, + "reusable": false, + "inserter": false, + "lock": false + }, + "attributes": { + "lock": { + "default": { + "remove": true, + "move": true + } + } + }, + "parent": [ "woocommerce/cart-totals-block" ], + "textdomain": "woo-gutenberg-products-block", + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2 +} diff --git a/build/product-add-to-cart--product-button--product-category-list--product-image--product-price--product-r--a0326d00.js b/build/product-add-to-cart--product-button--product-category-list--product-image--product-price--product-r--a0326d00.js new file mode 100644 index 00000000000..b93840bf60d --- /dev/null +++ b/build/product-add-to-cart--product-button--product-category-list--product-image--product-price--product-r--a0326d00.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{100:function(n,t,c){"use strict";c.d(t,"a",(function(){return o}));const o=n=>"string"==typeof n},35:function(n,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return u}));const o=n=>!(n=>null===n)(n)&&n instanceof Object&&n.constructor===Object;function u(n,t){return o(n)&&t in n}}}]); \ No newline at end of file diff --git a/build/product-add-to-cart--product-button--product-image--product-title.js b/build/product-add-to-cart--product-button--product-image--product-title.js new file mode 100644 index 00000000000..a713a13894c --- /dev/null +++ b/build/product-add-to-cart--product-button--product-image--product-title.js @@ -0,0 +1,3 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[4],{159:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"number"==typeof e},236:function(e,t,r){"use strict";r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));const n=window.CustomEvent||null,c=(e,t)=>{let{bubbles:r=!1,cancelable:c=!1,element:s,detail:o={}}=t;if(!n)return;s||(s=document.body);const a=new n(e,{bubbles:r,cancelable:c,detail:o});s.dispatchEvent(a)};let s;const o=()=>{s&&clearTimeout(s),s=setTimeout(()=>{c("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},a=e=>{let{preserveCartData:t=!1}=e;c("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},i=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const s=()=>{c(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,s),()=>jQuery(document).off(e,s)}},237:function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return o}));var n=r(90),c=(r(15),r(2));const s=(e,t)=>Object.keys(c.defaultAddressFields).every(r=>e[r]===t[r]),o=e=>{const t=Object.keys(c.defaultAddressFields),r=Object(n.a)(t,{},e.country),s=Object.assign({},e);return r.forEach(t=>{let{key:r="",hidden:n=!1}=t;n&&((e,t)=>e in t)(r,e)&&(s[r]="")}),s}},41:function(e,t,r){"use strict";r.d(t,"a",(function(){return h}));var n=r(7),c=r(0),s=r(17),o=r(9),a=r(13),i=r(237),d=r(59),u=r(236);const l=e=>{const t=e.detail;t&&t.preserveCartData||Object(o.dispatch)(s.CART_STORE_KEY).invalidateResolutionForStore()},_=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},p=()=>{Object(c.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.a)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.a)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",l),document.body.addEventListener("wc-blocks_removed_from_cart",l),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",l),document.body.removeEventListener("wc-blocks_removed_from_cart",l)}}window.wcBlocksStoreCartListeners.count++})(),_),[])},b={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},m={...b,email:""},E={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:s.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},f=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,r]=e;return[t,Object(a.decodeEntities)(r)]})),g={cartCoupons:s.EMPTY_CART_COUPONS,cartItems:s.EMPTY_CART_ITEMS,cartFees:s.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:E,cartIsLoading:!0,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:m,shippingAddress:b,shippingRates:s.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:s.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:s.EMPTY_EXTENSIONS},h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:r}=Object(d.b)(),a=null==r?void 0:r.previewCart,{shouldSelect:u}=e,l=Object(c.useRef)();p();const _=Object(o.useSelect)((e,r)=>{let{dispatch:n}=r;if(!u)return g;if(t)return{cartCoupons:a.coupons,cartItems:a.items,cartFees:a.fees,cartItemsCount:a.items_count,cartItemsWeight:a.items_weight,cartNeedsPayment:a.needs_payment,cartNeedsShipping:a.needs_shipping,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:a.totals,cartIsLoading:!1,cartErrors:s.EMPTY_CART_ERRORS,billingData:m,billingAddress:m,shippingAddress:b,extensions:s.EMPTY_EXTENSIONS,shippingRates:a.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:a.has_calculated_shipping,paymentRequirements:a.paymentRequirements,receiveCart:"function"==typeof(null==a?void 0:a.receiveCart)?a.receiveCart:()=>{}};const c=e(s.CART_STORE_KEY),o=c.getCartData(),d=c.getCartErrors(),l=c.getCartTotals(),_=!c.hasFinishedResolution("getCartData"),p=c.isCustomerDataUpdating(),{receiveCart:E}=n(s.CART_STORE_KEY),h=f(o.billingAddress),w=o.needsShipping?f(o.shippingAddress):h,C=o.fees.length>0?o.fees.map(e=>f(e)):s.EMPTY_CART_FEES;return{cartCoupons:o.coupons.length>0?o.coupons.map(e=>({...e,label:e.code})):s.EMPTY_CART_COUPONS,cartItems:o.items,cartFees:C,cartItemsCount:o.itemsCount,cartItemsWeight:o.itemsWeight,cartNeedsPayment:o.needsPayment,cartNeedsShipping:o.needsShipping,cartItemErrors:o.errors,cartTotals:l,cartIsLoading:_,cartErrors:d,billingData:Object(i.a)(h),billingAddress:Object(i.a)(h),shippingAddress:Object(i.a)(w),extensions:o.extensions,shippingRates:o.shippingRates,isLoadingRates:p,cartHasCalculatedShipping:o.hasCalculatedShipping,paymentRequirements:o.paymentRequirements,receiveCart:E}},[u]);return l.current&&Object(n.isEqual)(l.current,_)||(l.current=_),l.current}},59:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return a}));var n=r(0),c=r(9);const s=Object(n.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),o=()=>Object(n.useContext)(s),a=e=>{let{children:t,currentPostId:r=0,currentView:o="",previewData:a={}}=e;const i=Object(c.useSelect)(e=>r||e("core/editor").getCurrentPostId(),[r]),d=Object(n.useCallback)(e=>e in a?a[e]:{},[a]),u={isEditor:!0,currentPostId:i,currentView:o,previewData:a,getPreviewData:d};return Object(n.createElement)(s.Provider,{value:u},t)}},78:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(48),c=r(0),s=r(41);const o=()=>{const e=Object(s.a)(),t=Object(c.useRef)(e);return Object(c.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(c.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(c.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...r,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},90:function(e,t,r){"use strict";var n=r(2),c=r(1),s=r(159),o=r(100);const a=Object(n.getSetting)("countryLocale",{}),i=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(c.sprintf)( +/* translators: %s Field label. */ +Object(c.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(s.a)(e.priority)&&(t.index=e.priority),Object(o.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},d=Object.entries(a).map(e=>{let[t,r]=e;return[t,Object.entries(r).map(e=>{let[t,r]=e;return[t,i(r)]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{})]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{});t.a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const c=r&&void 0!==d[r]?d[r]:{};return e.map(e=>({key:e,...n.defaultAddressFields[e]||{},...c[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}}}]); \ No newline at end of file diff --git a/build/product-add-to-cart-frontend.js b/build/product-add-to-cart-frontend.js new file mode 100644 index 00000000000..b1dbbe08171 --- /dev/null +++ b/build/product-add-to-cart-frontend.js @@ -0,0 +1,3 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[58],{135:function(e,t,r){"use strict";var s=r(0);r(196),t.a=()=>Object(s.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},18:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return c}));const s=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function c(e,t){return s(e)&&t in e}},196:function(e,t){},199:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return u}));var s=r(0),c=r(3),n=r(11),o=r.n(n);const a=Object(s.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),i=()=>Object(s.useContext)(a),u=e=>{let{children:t}=e;const[r,n]=Object(s.useState)({}),i=Object(s.useCallback)(e=>r[e],[r]),u=Object(s.useCallback)(e=>{const t=r[e];return!t||t.hidden?"":"validate-error-"+e},[r]),l=Object(s.useCallback)(e=>{n(t=>{if(!t[e])return t;const{[e]:r,...s}=t;return s})},[]),d=Object(s.useCallback)(()=>{n({})},[]),b=Object(s.useCallback)(e=>{e&&n(t=>(e=Object(c.pickBy)(e,(e,r)=>!("string"!=typeof e.message||t.hasOwnProperty(r)&&o()(t[r],e))),0===Object.values(e).length?t:{...t,...e}))},[]),E=Object(s.useCallback)((e,t)=>{n(r=>{if(!r.hasOwnProperty(e))return r;const s={...r[e],...t};return o()(r[e],s)?r:{...r,[e]:s}})},[]),p={getValidationError:i,setValidationErrors:b,clearValidationError:l,clearAllValidationErrors:d,hideValidationError:Object(s.useCallback)(e=>{E(e,{hidden:!0})},[E]),showValidationError:Object(s.useCallback)(e=>{E(e,{hidden:!1})},[E]),showAllValidationErrors:Object(s.useCallback)(()=>{n(e=>{const t={};return Object.keys(e).forEach(r=>{e[r].hidden&&(t[r]={...e[r],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(r).length>0,getValidationErrorId:u};return Object(s.createElement)(a.Provider,{value:p},t)}},204:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var s=r(94);const c=(e,t)=>function(r){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const n=s.a.addEventCallback(e,r,c);return t(n),()=>{t(s.a.removeEventCallback(e,n.id))}}},206:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return o}));const s=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var c=r(30);const n=async(e,t,r)=>{const c=s(e,t),n=[];for(const e of c)try{const t=await Promise.resolve(e.callback(r));"object"==typeof t&&n.push(t)}catch(e){console.error(e)}return!n.length||n},o=async(e,t,r)=>{const n=[],o=s(e,t);for(const e of o)try{const t=await Promise.resolve(e.callback(r));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(c.a)(t)||Object(c.b)(t))return n.push(t),n;n.push(t)}catch(e){return console.error(e),n.push({type:"error"}),n}return n}},264:function(e,t){},266:function(e,t,r){"use strict";var s=r(12),c=r.n(s),n=r(0),o=r(42),a=r(4),i=r.n(a),u=r(135);r(267),t.a=e=>{let{className:t,showSpinner:r=!1,children:s,variant:a="contained",...l}=e;const d=i()("wc-block-components-button",t,a,{"wc-block-components-button--loading":r});return Object(n.createElement)(o.a,c()({className:d},l),r&&Object(n.createElement)(u.a,null),Object(n.createElement)("span",{className:"wc-block-components-button__text"},s))}},267:function(e,t){},277:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var s=r(0),c=r(199);r(264);const n=e=>{let{errorMessage:t="",propertyName:r="",elementId:n=""}=e;const{getValidationError:o,getValidationErrorId:a}=Object(c.b)();if(!t||"string"!=typeof t){const e=o(r)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(s.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(s.createElement)("p",{id:a(n)},t))}},30:function(e,t,r){"use strict";r.d(t,"c",(function(){return n})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return u})),r.d(t,"d",(function(){return d}));var s=r(18);let c,n;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(c||(c={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(n||(n={}));const o=(e,t)=>Object(s.a)(e)&&"type"in e&&e.type===t,a=e=>o(e,c.SUCCESS),i=e=>o(e,c.ERROR),u=e=>o(e,c.FAIL),l=e=>!Object(s.a)(e)||void 0===e.retry||!0===e.retry,d=()=>({responseTypes:c,noticeContexts:n,shouldRetry:l,isSuccessResponse:a,isErrorResponse:i,isFailResponse:u})},31:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var s=r(0),c=r(11),n=r.n(c);function o(e){const t=Object(s.useRef)(e);return n()(e,t.current)||(t.current=e),t.current}},355:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var s=r(0),c=r(7),n=r(6),o=r(17),a=r(32);const i=(e,t)=>{const r=e.find(e=>{let{id:r}=e;return r===t});return r?r.quantity:0},u=e=>{const{addItemToCart:t}=Object(c.useDispatch)(n.CART_STORE_KEY),{cartItems:r,cartIsLoading:u}=Object(a.a)(),{createErrorNotice:l,removeNotice:d}=Object(c.useDispatch)("core/notices"),[b,E]=Object(s.useState)(!1),p=Object(s.useRef)(i(r,e));return Object(s.useEffect)(()=>{const t=i(r,e);t!==p.current&&(p.current=t)},[r,e]),{cartQuantity:Number.isFinite(p.current)?p.current:0,addingToCart:b,cartIsLoading:u,addToCart:function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return E(!0),t(e,r).then(()=>{d("add-to-cart")}).catch(e=>{l(Object(o.decodeEntities)(e.message),{id:"add-to-cart",context:"wc/all-products",isDismissible:!0})}).finally(()=>{E(!1)})}}}},361:function(e,t){},363:function(e,t){},429:function(e,t,r){"use strict";r.r(t);var s=r(119),c=r(0),n=r(4),o=r.n(n),a=r(1),i=r(31);const u=e=>e.is_purchasable||!1;var l=r(7);const d={PRISTINE:"pristine",IDLE:"idle",DISABLED:"disabled",PROCESSING:"processing",BEFORE_PROCESSING:"before_processing",AFTER_PROCESSING:"after_processing"},b={status:d.PRISTINE,hasError:!1,quantity:0,processingResponse:null,requestParams:{}},E={SET_PRISTINE:"set_pristine",SET_IDLE:"set_idle",SET_DISABLED:"set_disabled",SET_PROCESSING:"set_processing",SET_BEFORE_PROCESSING:"set_before_processing",SET_AFTER_PROCESSING:"set_after_processing",SET_PROCESSING_RESPONSE:"set_processing_response",SET_HAS_ERROR:"set_has_error",SET_NO_ERROR:"set_no_error",SET_QUANTITY:"set_quantity",SET_REQUEST_PARAMS:"set_request_params"},{SET_PRISTINE:p,SET_IDLE:m,SET_DISABLED:O,SET_PROCESSING:h,SET_BEFORE_PROCESSING:_,SET_AFTER_PROCESSING:f,SET_PROCESSING_RESPONSE:j,SET_HAS_ERROR:g,SET_NO_ERROR:S,SET_QUANTITY:v,SET_REQUEST_PARAMS:y}=E,R=()=>({type:m}),C=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e?g:S;return{type:t}},{SET_PRISTINE:P,SET_IDLE:T,SET_DISABLED:A,SET_PROCESSING:k,SET_BEFORE_PROCESSING:w,SET_AFTER_PROCESSING:N,SET_PROCESSING_RESPONSE:I,SET_HAS_ERROR:D,SET_NO_ERROR:F,SET_QUANTITY:V,SET_REQUEST_PARAMS:B}=E,{PRISTINE:q,IDLE:x,DISABLED:L,PROCESSING:G,BEFORE_PROCESSING:M,AFTER_PROCESSING:Q}=d,W=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,{quantity:r,type:s,data:c}=arguments.length>1?arguments[1]:void 0;switch(s){case P:e=b;break;case T:e=t.status!==x?{...t,status:x}:t;break;case A:e=t.status!==L?{...t,status:L}:t;break;case V:e=r!==t.quantity?{...t,quantity:r}:t;break;case B:e={...t,requestParams:{...t.requestParams,...c}};break;case I:e={...t,processingResponse:c};break;case k:e=t.status!==G?{...t,status:G,hasError:!1}:t,e=!1===e.hasError?e:{...e,hasError:!1};break;case w:e=t.status!==M?{...t,status:M,hasError:!1}:t;break;case N:e=t.status!==Q?{...t,status:Q}:t;break;case D:e=t.hasError?t:{...t,hasError:!0},e=t.status===G||t.status===M?{...e,status:x}:e;break;case F:e=t.hasError?{...t,hasError:!1}:t}return e!==t&&s!==P&&e.status===q&&(e.status=x),e};var H=r(94),U=r(204);const K=e=>({onAddToCartAfterProcessingWithSuccess:Object(U.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(U.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(U.a)("add_to_cart_before_processing",e)});var Y=r(206),J=r(199),X=r(30),z=r(80);const Z=Object(c.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:e=>{},onAddToCartAfterProcessingWithError:e=>{},onAddToCartBeforeProcessing:e=>{}},dispatchActions:{resetForm:()=>{},submitForm:()=>{},setQuantity:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},setRequestParams:e=>{}}}),$=()=>Object(c.useContext)(Z),ee=e=>{var t,r,s,n;let{children:o,product:E,showFormElements:m}=e;const[g,S]=Object(c.useReducer)(W,b),[P,T]=Object(c.useReducer)(H.b,{}),A=Object(i.a)(P),{createErrorNotice:k}=Object(l.useDispatch)("core/notices"),{setValidationErrors:w}=Object(J.b)(),{isSuccessResponse:N,isErrorResponse:I,isFailResponse:D}=Object(X.d)(),F=Object(c.useMemo)(()=>({onAddToCartAfterProcessingWithSuccess:K(T).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:K(T).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:K(T).onAddToCartBeforeProcessing}),[T]),V=Object(c.useMemo)(()=>({resetForm:()=>{S({type:p})},submitForm:()=>{S({type:_})},setQuantity:e=>{S((e=>({type:v,quantity:e}))(e))},setHasError:e=>{S(C(e))},setRequestParams:e=>{S((e=>({type:y,data:e}))(e))},setAfterProcessing:e=>{S({type:j,data:e}),S({type:f})}}),[]);Object(c.useEffect)(()=>{const e=g.status,t=!E.id||!u(E);e!==d.DISABLED||t?e!==d.DISABLED&&t&&S({type:O}):S(R())},[g.status,E,S]),Object(c.useEffect)(()=>{g.status===d.BEFORE_PROCESSING&&(Object(z.b)("error","wc/add-to-cart"),Object(Y.a)(A,"add_to_cart_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:r}=e;t&&k(t,{context:"wc/add-to-cart"}),r&&w(r)}),S(R())):S({type:h})}))},[g.status,w,k,S,A,null==E?void 0:E.id]),Object(c.useEffect)(()=>{if(g.status===d.AFTER_PROCESSING){const e={processingResponse:g.processingResponse},t=e=>{let t=!1;return e.forEach(e=>{const{message:r,messageContext:s}=e;(I(e)||D(e))&&r&&(t=!0,k(r,s?{context:s}:void 0))}),t};if(g.hasError)return void Object(Y.b)(A,"add_to_cart_after_processing_with_error",e).then(r=>{if(!t(r)){var s;const t=(null===(s=e.processingResponse)||void 0===s?void 0:s.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");k(t,{id:"add-to-cart",context:"woocommerce/single-product/"+((null==E?void 0:E.id)||0)})}S(R())});Object(Y.b)(A,"add_to_cart_after_processing_with_success",e).then(e=>{t(e)?S(C(!0)):S(R())})}},[g.status,g.hasError,g.processingResponse,V,k,I,D,N,A,null==E?void 0:E.id]);const B=(e=>["simple","variable"].includes(e.type||"simple"))(E),q={product:E,productType:E.type||"simple",productIsPurchasable:u(E),productHasOptions:E.has_options||!1,supportsFormElements:B,showFormElements:m&&B,quantity:g.quantity||(null==E||null===(t=E.add_to_cart)||void 0===t?void 0:t.minimum)||1,minQuantity:(null==E||null===(r=E.add_to_cart)||void 0===r?void 0:r.minimum)||1,maxQuantity:(null==E||null===(s=E.add_to_cart)||void 0===s?void 0:s.maximum)||99,multipleOf:(null==E||null===(n=E.add_to_cart)||void 0===n?void 0:n.multiple_of)||1,requestParams:g.requestParams,isIdle:g.status===d.IDLE,isDisabled:g.status===d.DISABLED,isProcessing:g.status===d.PROCESSING,isBeforeProcessing:g.status===d.BEFORE_PROCESSING,isAfterProcessing:g.status===d.AFTER_PROCESSING,hasError:g.hasError,eventRegistration:F,dispatchActions:V};return Object(c.createElement)(Z.Provider,{value:q},o)};var te=r(27),re=r.n(te),se=r(17),ce=r(70),ne=r(32),oe=()=>{const{dispatchActions:e,product:t,quantity:r,eventRegistration:s,hasError:n,isProcessing:o,requestParams:i}=$(),{hasValidationErrors:u,showAllValidationErrors:d}=Object(J.b)(),{createErrorNotice:b,removeNotice:E}=Object(l.useDispatch)("core/notices"),{receiveCart:p}=Object(ne.a)(),[m,O]=Object(c.useState)(!1),h=!n&&o,_=Object(c.useCallback)(()=>!u||(d(),{type:"error"}),[u,d]);Object(c.useEffect)(()=>{const e=s.onAddToCartBeforeProcessing(_,0);return()=>{e()}},[s,_]);const f=Object(c.useCallback)(()=>{O(!0),E("add-to-cart","woocommerce/single-product/"+((null==t?void 0:t.id)||0));const s={id:t.id||0,quantity:r,...i};re()({path:"/wc/store/v1/cart/add-item",method:"POST",data:s,cache:"no-store",parse:!1}).then(r=>{re.a.setNonce(r.headers),r.json().then((function(s){r.ok?p(s):(s.body&&s.body.message?b(Object(se.decodeEntities)(s.body.message),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}):b(Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}),e.setHasError()),Object(ce.c)({preserveCartData:!0}),e.setAfterProcessing(s),O(!1)}))}).catch(t=>{t.json().then((function(t){var r;null!==(r=t.data)&&void 0!==r&&r.cart&&p(t.data.cart),e.setHasError(),e.setAfterProcessing(t),O(!1)}))})},[t,b,E,p,e,r,i]);return Object(c.useEffect)(()=>{h&&!m&&f()},[h,f,m]),null};const ae=e=>{let{children:t,product:r,showFormElements:s}=e;return Object(c.createElement)(J.a,null,Object(c.createElement)(ee,{product:r,showFormElements:s},t,Object(c.createElement)(oe,null)))};var ie=r(47),ue=r(3),le=(r(361),r(266)),de=r(117),be=r(362),Ee=r(59),pe=r(355);const me=e=>{let{className:t,href:r,text:s,onClick:n}=e;return Object(c.createElement)(le.a,{className:t,href:r,onClick:n,rel:"nofollow"},s)},Oe=e=>{let{className:t,quantityInCart:r,isProcessing:s,isDisabled:n,isDone:o,onClick:i}=e;return Object(c.createElement)(le.a,{className:t,disabled:n,showSpinner:s,onClick:i},o&&r>0?Object(a.sprintf)( +/* translators: %s number of products in cart. */ +Object(a._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(a.__)("Add to cart","woo-gutenberg-products-block"),!!o&&Object(c.createElement)(de.a,{icon:be.a}))};var he=()=>{const{showFormElements:e,productIsPurchasable:t,productHasOptions:r,product:s,productType:n,isDisabled:o,isProcessing:i,eventRegistration:u,hasError:l,dispatchActions:d}=$(),{parentName:b}=Object(ie.useInnerBlockLayoutContext)(),{dispatchStoreEvent:E}=Object(Ee.a)(),{cartQuantity:p}=Object(pe.a)(s.id||0),[m,O]=Object(c.useState)(!1),h=s.add_to_cart||{url:"",text:""};return Object(c.useEffect)(()=>{const e=u.onAddToCartAfterProcessingWithSuccess(()=>(l||O(!0),!0),0);return()=>{e()}},[u,l]),(e||!r&&"simple"===n)&&t?Object(c.createElement)(Oe,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:p,isDisabled:o,isProcessing:i,isDone:m,onClick:()=>{d.submitForm("woocommerce/single-product/"+((null==s?void 0:s.id)||0)),E("cart-add-item",{product:s,listName:b})}}):Object(c.createElement)(me,{className:"wc-block-components-product-add-to-cart-button",href:h.url,text:h.text||Object(a.__)("View Product","woo-gutenberg-products-block"),onClick:()=>{E("product-view-link",{product:s,listName:b})}})},_e=r(51),fe=e=>{let{disabled:t,min:r,max:s,step:n=1,value:o,onChange:a}=e;const i=void 0!==s,u=Object(_e.a)(e=>{let t=e;i&&(t=Math.min(t,Math.floor(s/n)*n)),t=Math.max(t,Math.ceil(r/n)*n),t=Math.floor(t/n)*n,t!==e&&a(t)},300);return Object(c.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:s,step:n,hidden:1===s,disabled:t,onChange:e=>{a(e.target.value),u(e.target.value)}})},je=e=>{let{reason:t=Object(a.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block")}=e;return Object(c.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},t)},ge=()=>{const{product:e,quantity:t,minQuantity:r,maxQuantity:s,multipleOf:n,dispatchActions:o,isDisabled:i}=$();return e.id&&!e.is_purchasable?Object(c.createElement)(je,null):e.id&&!e.is_in_stock?Object(c.createElement)(je,{reason:Object(a.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(c.createElement)(c.Fragment,null,Object(c.createElement)(fe,{value:t,min:r,max:s,step:n,disabled:i,onChange:o.setQuantity}),Object(c.createElement)(he,null))},Se=(r(363),r(430)),ve=r(5),ye=r(277);const Re={value:"",label:Object(a.__)("Select an option","woo-gutenberg-products-block")};var Ce=e=>{let{attributeName:t,options:r=[],value:s="",onChange:n=(()=>{}),errorMessage:i=Object(a.__)("Please select a value.","woo-gutenberg-products-block")}=e;const{getValidationError:u,setValidationErrors:l,clearValidationError:d}=Object(J.b)(),b=t,E=u(b)||{};return Object(ve.useEffect)(()=>{s?d(b):l({[b]:{message:i,hidden:!0}})},[s,b,i,d,l]),Object(ve.useEffect)(()=>()=>{d(b)},[b,d]),Object(c.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(c.createElement)(Se.a,{label:Object(se.decodeEntities)(t),value:s||"",options:[Re,...r],onChange:n,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":E.message&&!E.hidden})}),Object(c.createElement)(ye.a,{propertyName:b,elementId:b}))},Pe=r(18);const Te=(e,t,r)=>{const s=Object.values(t).map(e=>{let{id:t}=e;return t});if(Object.values(r).every(e=>""===e))return s;const c=Object.keys(e);return s.filter(e=>c.every(s=>{const c=r[s]||"",n=t["id:"+e].attributes[s];return""===c||null===n||n===c}))};var Ae=e=>{let{attributes:t,variationAttributes:r,setRequestParams:s}=e;const n=Object(i.a)(t),o=Object(i.a)(r),[a,u]=Object(c.useState)(0),[l,d]=Object(c.useState)({}),[b,E]=Object(c.useState)(!1),p=Object(c.useMemo)(()=>((e,t,r)=>{const s={},c=Object.keys(e),n=Object.values(r).filter(Boolean).length>0;return c.forEach(c=>{const o=e[c],a={...r,[c]:null},i=n?Te(e,t,a):null,u=null!==i?i.map(e=>t["id:"+e].attributes[c]):null;s[c]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map(e=>{let{name:r,slug:s}=e;return null===t||t.includes(null)||t.includes(s)?{value:s,label:Object(se.decodeEntities)(r)}:null}).filter(Boolean)}(o.terms,u)}),s})(n,o,l),[l,n,o]);return Object(c.useEffect)(()=>{if(!b){const e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(Pe.a)(e))return{};const t=Object.keys(e),r={};return 0===t.length||t.forEach(t=>{const s=e[t],c=s.terms.filter(e=>e.default);var n;c.length>0&&(r[s.name]=null===(n=c[0])||void 0===n?void 0:n.slug)}),r}(t);e&&d({...e}),E(!0)}},[l,t,b]),Object(c.useEffect)(()=>{Object.values(l).filter(e=>""!==e).length===Object.keys(n).length?u(((e,t,r)=>Te(e,t,r)[0]||0)(n,o,l)):a>0&&u(0)},[l,a,n,o]),Object(c.useEffect)(()=>{s({id:a,variation:Object.keys(l).map(e=>({attribute:e,value:l[e]}))})},[s,a,l]),Object(c.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(n).map(e=>Object(c.createElement)(Ce,{key:e,attributeName:e,options:p[e],value:l[e],onChange:t=>{d({...l,[e]:t})}})))},ke=e=>{let{product:t,dispatchers:r}=e;const s=(e=>e?Object(ue.keyBy)(Object.values(e).filter(e=>{let{has_variations:t}=e;return t}),"name"):{})(t.attributes),n=(e=>{if(!e)return{};const t={};return e.forEach(e=>{let{id:r,attributes:s}=e;t["id:"+r]={id:r,attributes:s.reduce((e,t)=>{let{name:r,value:s}=t;return e[r]=s,e},{})}}),t})(t.variations);return 0===Object.keys(s).length||0===n.length?null:Object(c.createElement)(Ae,{attributes:s,variationAttributes:n,setRequestParams:r.setRequestParams})},we=()=>{const{product:e,quantity:t,minQuantity:r,maxQuantity:s,multipleOf:n,dispatchActions:o,isDisabled:i}=$();return e.id&&!e.is_purchasable?Object(c.createElement)(je,null):e.id&&!e.is_in_stock?Object(c.createElement)(je,{reason:Object(a.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(c.createElement)(c.Fragment,null,Object(c.createElement)(ke,{product:e,dispatchers:o}),Object(c.createElement)(fe,{value:t,min:r,max:s,step:n,disabled:i,onChange:o.setQuantity}),Object(c.createElement)(he,null))},Ne=()=>Object(c.createElement)(he,null),Ie=r(332),De=()=>Object(c.createElement)(Ie.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element."),Fe=()=>Object(c.createElement)(De,null);const Ve=()=>{const{showFormElements:e,productType:t}=$();return e?"variable"===t?Object(c.createElement)(we,null):"grouped"===t?Object(c.createElement)(Fe,null):"external"===t?Object(c.createElement)(Ne,null):"simple"===t||"variation"===t?Object(c.createElement)(ge,null):null:Object(c.createElement)(he,null)};var Be=Object(s.withProductDataContext)(e=>{let{className:t,showFormElements:r}=e;const{product:s}=Object(ie.useProductDataContext)(),n=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(ue.isEmpty)(s)});return Object(c.createElement)(ae,{product:s,showFormElements:r},Object(c.createElement)("div",{className:n},Object(c.createElement)(Ve,null)))});t.default=Object(s.withFilteredAttributes)({showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}})(Be)},80:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return n}));var s=r(7);const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;const r=Object(s.select)("core/notices").getNotices(e);return r.some(e=>e.type===t)},n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=Object(s.select)("core/notices").getNotices(),{removeNotice:c}=Object(s.dispatch)("core/notices"),n=r.filter(t=>t.status===e);n.forEach(e=>c(e.id,t))}},94:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return a}));var s=r(3);let c;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(c||(c={}));const n={addEventCallback:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(s.uniqueId)(),type:c.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:(e,t)=>({id:t,type:c.REMOVE_EVENT_CALLBACK,eventType:e})},o={},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,{type:t,eventType:r,id:s,callback:n,priority:a}=arguments.length>1?arguments[1]:void 0;const i=e.hasOwnProperty(r)?new Map(e[r]):new Map;switch(t){case c.ADD_EVENT_CALLBACK:return i.set(s,{priority:a,callback:n}),{...e,[r]:i};case c.REMOVE_EVENT_CALLBACK:return i.delete(s),{...e,[r]:i}}}}}]); \ No newline at end of file diff --git a/build/product-add-to-cart.js b/build/product-add-to-cart.js new file mode 100644 index 00000000000..d1f940fe45f --- /dev/null +++ b/build/product-add-to-cart.js @@ -0,0 +1,3 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[18],{102:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return u}));var s=r(0),c=r(7),n=r(22),o=r.n(n);const a=Object(s.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),i=()=>Object(s.useContext)(a),u=e=>{let{children:t}=e;const[r,n]=Object(s.useState)({}),i=Object(s.useCallback)(e=>r[e],[r]),u=Object(s.useCallback)(e=>{const t=r[e];return!t||t.hidden?"":"validate-error-"+e},[r]),l=Object(s.useCallback)(e=>{n(t=>{if(!t[e])return t;const{[e]:r,...s}=t;return s})},[]),d=Object(s.useCallback)(()=>{n({})},[]),b=Object(s.useCallback)(e=>{e&&n(t=>(e=Object(c.pickBy)(e,(e,r)=>!("string"!=typeof e.message||t.hasOwnProperty(r)&&o()(t[r],e))),0===Object.values(e).length?t:{...t,...e}))},[]),E=Object(s.useCallback)((e,t)=>{n(r=>{if(!r.hasOwnProperty(e))return r;const s={...r[e],...t};return o()(r[e],s)?r:{...r,[e]:s}})},[]),p={getValidationError:i,setValidationErrors:b,clearValidationError:l,clearAllValidationErrors:d,hideValidationError:Object(s.useCallback)(e=>{E(e,{hidden:!0})},[E]),showValidationError:Object(s.useCallback)(e=>{E(e,{hidden:!1})},[E]),showAllValidationErrors:Object(s.useCallback)(()=>{n(e=>{const t={};return Object.keys(e).forEach(r=>{e[r].hidden&&(t[r]={...e[r],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(r).length>0,getValidationErrorId:u};return Object(s.createElement)(a.Provider,{value:p},t)}},116:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var s=r(9);const c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=Object(s.select)("core/notices").getNotices(),{removeNotice:c}=Object(s.dispatch)("core/notices"),n=r.filter(t=>t.status===e);n.forEach(e=>c(e.id,t))}},153:function(e,t){},154:function(e,t){},173:function(e,t){},221:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var s=r(0),c=r(102);r(173);const n=e=>{let{errorMessage:t="",propertyName:r="",elementId:n=""}=e;const{getValidationError:o,getValidationErrorId:a}=Object(c.b)();if(!t||"string"!=typeof t){const e=o(r)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(s.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(s.createElement)("p",{id:a(n)},t))}},238:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var s=r(94);const c=(e,t)=>function(r){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const n=s.a.addEventCallback(e,r,c);return t(n),()=>{t(s.a.removeEventCallback(e,n.id))}}},239:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return o}));const s=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var c=r(37);const n=async(e,t,r)=>{const c=s(e,t),n=[];for(const e of c)try{const t=await Promise.resolve(e.callback(r));"object"==typeof t&&n.push(t)}catch(e){console.error(e)}return!n.length||n},o=async(e,t,r)=>{const n=[],o=s(e,t);for(const e of o)try{const t=await Promise.resolve(e.callback(r));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(c.a)(t)||Object(c.b)(t))return n.push(t),n;n.push(t)}catch(e){return console.error(e),n.push({type:"error"}),n}return n}},285:function(e,t){},290:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},291:function(e,t,r){"use strict";var s=r(0),c=r(4),n=r.n(c),o=r(1),a=r(49),i=r(490),u=r(9);const l={PRISTINE:"pristine",IDLE:"idle",DISABLED:"disabled",PROCESSING:"processing",BEFORE_PROCESSING:"before_processing",AFTER_PROCESSING:"after_processing"},d={status:l.PRISTINE,hasError:!1,quantity:0,processingResponse:null,requestParams:{}},b={SET_PRISTINE:"set_pristine",SET_IDLE:"set_idle",SET_DISABLED:"set_disabled",SET_PROCESSING:"set_processing",SET_BEFORE_PROCESSING:"set_before_processing",SET_AFTER_PROCESSING:"set_after_processing",SET_PROCESSING_RESPONSE:"set_processing_response",SET_HAS_ERROR:"set_has_error",SET_NO_ERROR:"set_no_error",SET_QUANTITY:"set_quantity",SET_REQUEST_PARAMS:"set_request_params"},{SET_PRISTINE:E,SET_IDLE:p,SET_DISABLED:m,SET_PROCESSING:O,SET_BEFORE_PROCESSING:h,SET_AFTER_PROCESSING:_,SET_PROCESSING_RESPONSE:f,SET_HAS_ERROR:j,SET_NO_ERROR:g,SET_QUANTITY:S,SET_REQUEST_PARAMS:v}=b,y=()=>({type:p}),R=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e?j:g;return{type:t}},{SET_PRISTINE:C,SET_IDLE:P,SET_DISABLED:T,SET_PROCESSING:A,SET_BEFORE_PROCESSING:k,SET_AFTER_PROCESSING:w,SET_PROCESSING_RESPONSE:N,SET_HAS_ERROR:I,SET_NO_ERROR:D,SET_QUANTITY:F,SET_REQUEST_PARAMS:V}=b,{PRISTINE:B,IDLE:q,DISABLED:x,PROCESSING:L,BEFORE_PROCESSING:G,AFTER_PROCESSING:M}=l,Q=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,{quantity:r,type:s,data:c}=arguments.length>1?arguments[1]:void 0;switch(s){case C:e=d;break;case P:e=t.status!==q?{...t,status:q}:t;break;case T:e=t.status!==x?{...t,status:x}:t;break;case F:e=r!==t.quantity?{...t,quantity:r}:t;break;case V:e={...t,requestParams:{...t.requestParams,...c}};break;case N:e={...t,processingResponse:c};break;case A:e=t.status!==L?{...t,status:L,hasError:!1}:t,e=!1===e.hasError?e:{...e,hasError:!1};break;case k:e=t.status!==G?{...t,status:G,hasError:!1}:t;break;case w:e=t.status!==M?{...t,status:M}:t;break;case I:e=t.hasError?t:{...t,hasError:!0},e=t.status===L||t.status===G?{...e,status:q}:e;break;case D:e=t.hasError?{...t,hasError:!1}:t}return e!==t&&s!==C&&e.status===B&&(e.status=q),e};var W=r(94),H=r(238);const U=e=>({onAddToCartAfterProcessingWithSuccess:Object(H.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(H.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(H.a)("add_to_cart_before_processing",e)});var K=r(239),Y=r(102),J=r(37),X=r(116);const z=Object(s.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:e=>{},onAddToCartAfterProcessingWithError:e=>{},onAddToCartBeforeProcessing:e=>{}},dispatchActions:{resetForm:()=>{},submitForm:()=>{},setQuantity:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},setRequestParams:e=>{}}}),Z=()=>Object(s.useContext)(z),$=e=>{var t,r,c,n;let{children:b,product:p,showFormElements:j}=e;const[g,C]=Object(s.useReducer)(Q,d),[P,T]=Object(s.useReducer)(W.b,{}),A=Object(a.a)(P),{createErrorNotice:k}=Object(u.useDispatch)("core/notices"),{setValidationErrors:w}=Object(Y.b)(),{isSuccessResponse:N,isErrorResponse:I,isFailResponse:D}=Object(J.d)(),F=Object(s.useMemo)(()=>({onAddToCartAfterProcessingWithSuccess:U(T).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:U(T).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:U(T).onAddToCartBeforeProcessing}),[T]),V=Object(s.useMemo)(()=>({resetForm:()=>{C({type:E})},submitForm:()=>{C({type:h})},setQuantity:e=>{C((e=>({type:S,quantity:e}))(e))},setHasError:e=>{C(R(e))},setRequestParams:e=>{C((e=>({type:v,data:e}))(e))},setAfterProcessing:e=>{C({type:f,data:e}),C({type:_})}}),[]);Object(s.useEffect)(()=>{const e=g.status,t=!p.id||!Object(i.a)(p);e!==l.DISABLED||t?e!==l.DISABLED&&t&&C({type:m}):C(y())},[g.status,p,C]),Object(s.useEffect)(()=>{g.status===l.BEFORE_PROCESSING&&(Object(X.a)("error","wc/add-to-cart"),Object(K.a)(A,"add_to_cart_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:r}=e;t&&k(t,{context:"wc/add-to-cart"}),r&&w(r)}),C(y())):C({type:O})}))},[g.status,w,k,C,A,null==p?void 0:p.id]),Object(s.useEffect)(()=>{if(g.status===l.AFTER_PROCESSING){const e={processingResponse:g.processingResponse},t=e=>{let t=!1;return e.forEach(e=>{const{message:r,messageContext:s}=e;(I(e)||D(e))&&r&&(t=!0,k(r,s?{context:s}:void 0))}),t};if(g.hasError)return void Object(K.b)(A,"add_to_cart_after_processing_with_error",e).then(r=>{if(!t(r)){var s;const t=(null===(s=e.processingResponse)||void 0===s?void 0:s.message)||Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");k(t,{id:"add-to-cart",context:"woocommerce/single-product/"+((null==p?void 0:p.id)||0)})}C(y())});Object(K.b)(A,"add_to_cart_after_processing_with_success",e).then(e=>{t(e)?C(R(!0)):C(y())})}},[g.status,g.hasError,g.processingResponse,V,k,I,D,N,A,null==p?void 0:p.id]);const B=Object(i.b)(p),q={product:p,productType:p.type||"simple",productIsPurchasable:Object(i.a)(p),productHasOptions:p.has_options||!1,supportsFormElements:B,showFormElements:j&&B,quantity:g.quantity||(null==p||null===(t=p.add_to_cart)||void 0===t?void 0:t.minimum)||1,minQuantity:(null==p||null===(r=p.add_to_cart)||void 0===r?void 0:r.minimum)||1,maxQuantity:(null==p||null===(c=p.add_to_cart)||void 0===c?void 0:c.maximum)||99,multipleOf:(null==p||null===(n=p.add_to_cart)||void 0===n?void 0:n.multiple_of)||1,requestParams:g.requestParams,isIdle:g.status===l.IDLE,isDisabled:g.status===l.DISABLED,isProcessing:g.status===l.PROCESSING,isBeforeProcessing:g.status===l.BEFORE_PROCESSING,isAfterProcessing:g.status===l.AFTER_PROCESSING,hasError:g.hasError,eventRegistration:F,dispatchActions:V};return Object(s.createElement)(z.Provider,{value:q},b)};var ee=r(14),te=r.n(ee),re=r(13),se=r(236),ce=r(41),ne=()=>{const{dispatchActions:e,product:t,quantity:r,eventRegistration:c,hasError:n,isProcessing:a,requestParams:i}=Z(),{hasValidationErrors:l,showAllValidationErrors:d}=Object(Y.b)(),{createErrorNotice:b,removeNotice:E}=Object(u.useDispatch)("core/notices"),{receiveCart:p}=Object(ce.a)(),[m,O]=Object(s.useState)(!1),h=!n&&a,_=Object(s.useCallback)(()=>!l||(d(),{type:"error"}),[l,d]);Object(s.useEffect)(()=>{const e=c.onAddToCartBeforeProcessing(_,0);return()=>{e()}},[c,_]);const f=Object(s.useCallback)(()=>{O(!0),E("add-to-cart","woocommerce/single-product/"+((null==t?void 0:t.id)||0));const s={id:t.id||0,quantity:r,...i};te()({path:"/wc/store/v1/cart/add-item",method:"POST",data:s,cache:"no-store",parse:!1}).then(r=>{te.a.setNonce(r.headers),r.json().then((function(s){r.ok?p(s):(s.body&&s.body.message?b(Object(re.decodeEntities)(s.body.message),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}):b(Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}),e.setHasError()),Object(se.b)({preserveCartData:!0}),e.setAfterProcessing(s),O(!1)}))}).catch(t=>{t.json().then((function(t){var r;null!==(r=t.data)&&void 0!==r&&r.cart&&p(t.data.cart),e.setHasError(),e.setAfterProcessing(t),O(!1)}))})},[t,b,E,p,e,r,i]);return Object(s.useEffect)(()=>{h&&!m&&f()},[h,f,m]),null};const oe=e=>{let{children:t,product:r,showFormElements:c}=e;return Object(s.createElement)(Y.a,null,Object(s.createElement)($,{product:r,showFormElements:c},t,Object(s.createElement)(ne,null)))};var ae=r(29),ie=r(7),ue=r(58),le=(r(285),r(68)),de=r(113),be=r(517),Ee=r(78),pe=r(341);const me=e=>{let{className:t,href:r,text:c,onClick:n}=e;return Object(s.createElement)(le.a,{className:t,href:r,onClick:n,rel:"nofollow"},c)},Oe=e=>{let{className:t,quantityInCart:r,isProcessing:c,isDisabled:n,isDone:a,onClick:i}=e;return Object(s.createElement)(le.a,{className:t,disabled:n,showSpinner:c,onClick:i},a&&r>0?Object(o.sprintf)( +/* translators: %s number of products in cart. */ +Object(o._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(o.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(s.createElement)(de.a,{icon:be.a}))};var he=()=>{const{showFormElements:e,productIsPurchasable:t,productHasOptions:r,product:c,productType:n,isDisabled:a,isProcessing:i,eventRegistration:u,hasError:l,dispatchActions:d}=Z(),{parentName:b}=Object(ae.useInnerBlockLayoutContext)(),{dispatchStoreEvent:E}=Object(Ee.a)(),{cartQuantity:p}=Object(pe.a)(c.id||0),[m,O]=Object(s.useState)(!1),h=c.add_to_cart||{url:"",text:""};return Object(s.useEffect)(()=>{const e=u.onAddToCartAfterProcessingWithSuccess(()=>(l||O(!0),!0),0);return()=>{e()}},[u,l]),(e||!r&&"simple"===n)&&t?Object(s.createElement)(Oe,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:p,isDisabled:a,isProcessing:i,isDone:m,onClick:()=>{d.submitForm("woocommerce/single-product/"+((null==c?void 0:c.id)||0)),E("cart-add-item",{product:c,listName:b})}}):Object(s.createElement)(me,{className:"wc-block-components-product-add-to-cart-button",href:h.url,text:h.text||Object(o.__)("View Product","woo-gutenberg-products-block"),onClick:()=>{E("product-view-link",{product:c,listName:b})}})},_e=r(112),fe=e=>{let{disabled:t,min:r,max:c,step:n=1,value:o,onChange:a}=e;const i=void 0!==c,u=Object(_e.a)(e=>{let t=e;i&&(t=Math.min(t,Math.floor(c/n)*n)),t=Math.max(t,Math.ceil(r/n)*n),t=Math.floor(t/n)*n,t!==e&&a(t)},300);return Object(s.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:c,step:n,hidden:1===c,disabled:t,onChange:e=>{a(e.target.value),u(e.target.value)}})},je=e=>{let{reason:t=Object(o.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block")}=e;return Object(s.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},t)},ge=()=>{const{product:e,quantity:t,minQuantity:r,maxQuantity:c,multipleOf:n,dispatchActions:a,isDisabled:i}=Z();return e.id&&!e.is_purchasable?Object(s.createElement)(je,null):e.id&&!e.is_in_stock?Object(s.createElement)(je,{reason:Object(o.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(s.createElement)(s.Fragment,null,Object(s.createElement)(fe,{value:t,min:r,max:c,step:n,disabled:i,onChange:a.setQuantity}),Object(s.createElement)(he,null))},Se=(r(340),r(533)),ve=r(12),ye=r(221);const Re={value:"",label:Object(o.__)("Select an option","woo-gutenberg-products-block")};var Ce=e=>{let{attributeName:t,options:r=[],value:c="",onChange:a=(()=>{}),errorMessage:i=Object(o.__)("Please select a value.","woo-gutenberg-products-block")}=e;const{getValidationError:u,setValidationErrors:l,clearValidationError:d}=Object(Y.b)(),b=t,E=u(b)||{};return Object(ve.useEffect)(()=>{c?d(b):l({[b]:{message:i,hidden:!0}})},[c,b,i,d,l]),Object(ve.useEffect)(()=>()=>{d(b)},[b,d]),Object(s.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(s.createElement)(Se.a,{label:Object(re.decodeEntities)(t),value:c||"",options:[Re,...r],onChange:a,required:!0,className:n()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":E.message&&!E.hidden})}),Object(s.createElement)(ye.a,{propertyName:b,elementId:b}))},Pe=r(35);const Te=(e,t,r)=>{const s=Object.values(t).map(e=>{let{id:t}=e;return t});if(Object.values(r).every(e=>""===e))return s;const c=Object.keys(e);return s.filter(e=>c.every(s=>{const c=r[s]||"",n=t["id:"+e].attributes[s];return""===c||null===n||n===c}))};var Ae=e=>{let{attributes:t,variationAttributes:r,setRequestParams:c}=e;const n=Object(a.a)(t),o=Object(a.a)(r),[i,u]=Object(s.useState)(0),[l,d]=Object(s.useState)({}),[b,E]=Object(s.useState)(!1),p=Object(s.useMemo)(()=>((e,t,r)=>{const s={},c=Object.keys(e),n=Object.values(r).filter(Boolean).length>0;return c.forEach(c=>{const o=e[c],a={...r,[c]:null},i=n?Te(e,t,a):null,u=null!==i?i.map(e=>t["id:"+e].attributes[c]):null;s[c]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map(e=>{let{name:r,slug:s}=e;return null===t||t.includes(null)||t.includes(s)?{value:s,label:Object(re.decodeEntities)(r)}:null}).filter(Boolean)}(o.terms,u)}),s})(n,o,l),[l,n,o]);return Object(s.useEffect)(()=>{if(!b){const e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(Pe.a)(e))return{};const t=Object.keys(e),r={};return 0===t.length||t.forEach(t=>{const s=e[t],c=s.terms.filter(e=>e.default);var n;c.length>0&&(r[s.name]=null===(n=c[0])||void 0===n?void 0:n.slug)}),r}(t);e&&d({...e}),E(!0)}},[l,t,b]),Object(s.useEffect)(()=>{Object.values(l).filter(e=>""!==e).length===Object.keys(n).length?u(((e,t,r)=>Te(e,t,r)[0]||0)(n,o,l)):i>0&&u(0)},[l,i,n,o]),Object(s.useEffect)(()=>{c({id:i,variation:Object.keys(l).map(e=>({attribute:e,value:l[e]}))})},[c,i,l]),Object(s.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(n).map(e=>Object(s.createElement)(Ce,{key:e,attributeName:e,options:p[e],value:l[e],onChange:t=>{d({...l,[e]:t})}})))},ke=e=>{let{product:t,dispatchers:r}=e;const c=(e=>e?Object(ie.keyBy)(Object.values(e).filter(e=>{let{has_variations:t}=e;return t}),"name"):{})(t.attributes),n=(e=>{if(!e)return{};const t={};return e.forEach(e=>{let{id:r,attributes:s}=e;t["id:"+r]={id:r,attributes:s.reduce((e,t)=>{let{name:r,value:s}=t;return e[r]=s,e},{})}}),t})(t.variations);return 0===Object.keys(c).length||0===n.length?null:Object(s.createElement)(Ae,{attributes:c,variationAttributes:n,setRequestParams:r.setRequestParams})},we=()=>{const{product:e,quantity:t,minQuantity:r,maxQuantity:c,multipleOf:n,dispatchActions:a,isDisabled:i}=Z();return e.id&&!e.is_purchasable?Object(s.createElement)(je,null):e.id&&!e.is_in_stock?Object(s.createElement)(je,{reason:Object(o.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(s.createElement)(s.Fragment,null,Object(s.createElement)(ke,{product:e,dispatchers:a}),Object(s.createElement)(fe,{value:t,min:r,max:c,step:n,disabled:i,onChange:a.setQuantity}),Object(s.createElement)(he,null))},Ne=()=>Object(s.createElement)(he,null),Ie=r(519),De=()=>Object(s.createElement)(Ie.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element."),Fe=()=>Object(s.createElement)(De,null);const Ve=()=>{const{showFormElements:e,productType:t}=Z();return e?"variable"===t?Object(s.createElement)(we,null):"grouped"===t?Object(s.createElement)(Fe,null):"external"===t?Object(s.createElement)(Ne,null):"simple"===t||"variation"===t?Object(s.createElement)(ge,null):null:Object(s.createElement)(he,null)};t.a=Object(ue.withProductDataContext)(e=>{let{className:t,showFormElements:r}=e;const{product:c}=Object(ae.useProductDataContext)(),o=n()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(ie.isEmpty)(c)});return Object(s.createElement)(oe,{product:c,showFormElements:r},Object(s.createElement)("div",{className:o},Object(s.createElement)(Ve,null)))})},340:function(e,t){},341:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var s=r(0),c=r(9),n=r(17),o=r(13),a=r(41);const i=(e,t)=>{const r=e.find(e=>{let{id:r}=e;return r===t});return r?r.quantity:0},u=e=>{const{addItemToCart:t}=Object(c.useDispatch)(n.CART_STORE_KEY),{cartItems:r,cartIsLoading:u}=Object(a.a)(),{createErrorNotice:l,removeNotice:d}=Object(c.useDispatch)("core/notices"),[b,E]=Object(s.useState)(!1),p=Object(s.useRef)(i(r,e));return Object(s.useEffect)(()=>{const t=i(r,e);t!==p.current&&(p.current=t)},[r,e]),{cartQuantity:Number.isFinite(p.current)?p.current:0,addingToCart:b,cartIsLoading:u,addToCart:function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return E(!0),t(e,r).then(()=>{d("add-to-cart")}).catch(e=>{l(Object(o.decodeEntities)(e.message),{id:"add-to-cart",context:"wc/all-products",isDismissible:!0})}).finally(()=>{E(!1)})}}}},37:function(e,t,r){"use strict";r.d(t,"c",(function(){return n})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return u})),r.d(t,"d",(function(){return d}));var s=r(35);let c,n;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(c||(c={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(n||(n={}));const o=(e,t)=>Object(s.a)(e)&&"type"in e&&e.type===t,a=e=>o(e,c.SUCCESS),i=e=>o(e,c.ERROR),u=e=>o(e,c.FAIL),l=e=>!Object(s.a)(e)||void 0===e.retry||!0===e.retry,d=()=>({responseTypes:c,noticeContexts:n,shouldRetry:l,isSuccessResponse:a,isErrorResponse:i,isFailResponse:u})},49:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var s=r(0),c=r(22),n=r.n(c);function o(e){const t=Object(s.useRef)(e);return n()(e,t.current)||(t.current=e),t.current}},490:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return c}));const s=e=>e.is_purchasable||!1,c=e=>["simple","variable"].includes(e.type||"simple")},539:function(e,t,r){"use strict";r.r(t);var s=r(58),c=r(291),n=r(290);t.default=Object(s.withFilteredAttributes)(n.a)(c.a)},68:function(e,t,r){"use strict";var s=r(6),c=r.n(s),n=r(0),o=r(130),a=r(4),i=r.n(a),u=r(91);r(153),t.a=e=>{let{className:t,showSpinner:r=!1,children:s,variant:a="contained",...l}=e;const d=i()("wc-block-components-button",t,a,{"wc-block-components-button--loading":r});return Object(n.createElement)(o.a,c()({className:d},l),r&&Object(n.createElement)(u.a,null),Object(n.createElement)("span",{className:"wc-block-components-button__text"},s))}},91:function(e,t,r){"use strict";var s=r(0);r(154),t.a=()=>Object(s.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},94:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return a}));var s=r(7);let c;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(c||(c={}));const n={addEventCallback:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(s.uniqueId)(),type:c.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:(e,t)=>({id:t,type:c.REMOVE_EVENT_CALLBACK,eventType:e})},o={},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,{type:t,eventType:r,id:s,callback:n,priority:a}=arguments.length>1?arguments[1]:void 0;const i=e.hasOwnProperty(r)?new Map(e[r]):new Map;switch(t){case c.ADD_EVENT_CALLBACK:return i.set(s,{priority:a,callback:n}),{...e,[r]:i};case c.REMOVE_EVENT_CALLBACK:return i.delete(s),{...e,[r]:i}}}}}]); \ No newline at end of file diff --git a/build/product-best-sellers.asset.php b/build/product-best-sellers.asset.php new file mode 100644 index 00000000000..ad110e1dd2c --- /dev/null +++ b/build/product-best-sellers.asset.php @@ -0,0 +1 @@ + array('lodash', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render', 'wp-url'), 'version' => '7caea69f0656178652a9fcf8e0edf694'); \ No newline at end of file diff --git a/build/product-best-sellers.js b/build/product-best-sellers.js new file mode 100644 index 00000000000..f5b6cc590c8 --- /dev/null +++ b/build/product-best-sellers.js @@ -0,0 +1,16 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-best-sellers"]=function(e){function t(t){for(var r,l,i=t[0],a=t[1],s=t[2],d=0,b=[];dObject(o.sprintf)( +/* translators: Number of items selected from list. */ +Object(o._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(o.__)("Search results updated.","woo-gutenberg-products-block")},i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(n.groupBy)(e,"parent"),r=Object(n.keyBy)(t,"id"),o=["0"],l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=l(r[e.parent]);return[...t,e.name]},i=e=>e.map(e=>{const t=c[e.id];return o.push(""+e.id),{...e,breadcrumbs:l(r[e.parent]),children:t&&t.length?i(t):[]}}),a=i(c[0]||[]);return Object.entries(c).forEach(e=>{let[t,c]=e;o.includes(t)||a.push(...i(c||[]))}),a},a=(e,t,c)=>{if(!t)return c?i(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),n=e.map(e=>!!r.test(e.name)&&e).filter(Boolean);return c?i(n,e):n},s=(e,t)=>{if(!t)return e;const c=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(c).map((e,t)=>c.test(e)?Object(r.createElement)("strong",{key:t},e):Object(r.createElement)(r.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},2:function(e,t){e.exports=window.wc.wcSettings},23:function(e,t,c){"use strict";c.d(t,"o",(function(){return o})),c.d(t,"m",(function(){return l})),c.d(t,"l",(function(){return i})),c.d(t,"n",(function(){return a})),c.d(t,"j",(function(){return s})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return d})),c.d(t,"g",(function(){return b})),c.d(t,"k",(function(){return m})),c.d(t,"c",(function(){return g})),c.d(t,"d",(function(){return p})),c.d(t,"h",(function(){return h})),c.d(t,"a",(function(){return E})),c.d(t,"i",(function(){return O})),c.d(t,"b",(function(){return w}));var r,n=c(2);const o=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),l=o.pluginUrl+"images/",i=o.pluginUrl+"build/",a=o.buildPhase,s=null===(r=n.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=n.STORE_PAGES.checkout.id,d=n.STORE_PAGES.checkout.permalink,b=n.STORE_PAGES.privacy.permalink,m=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),g=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),p=n.STORE_PAGES.cart.permalink,h=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),E=Object(n.getSetting)("allowedCountries",{}),O=Object(n.getSetting)("shippingStates",{}),w=Object(n.getSetting)("allowedStates",{})},25:function(e,t,c){"use strict";c.d(t,"h",(function(){return s})),c.d(t,"e",(function(){return u})),c.d(t,"b",(function(){return d})),c.d(t,"i",(function(){return b})),c.d(t,"f",(function(){return m})),c.d(t,"c",(function(){return g})),c.d(t,"d",(function(){return p})),c.d(t,"g",(function(){return h})),c.d(t,"a",(function(){return E}));var r=c(15),n=c(14),o=c.n(n),l=c(7),i=c(2),a=c(23);const s=e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const i=(e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const o=a.o.productCount>100,l={per_page:o?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},i=[Object(r.addQueryArgs)("/wc/store/v1/products",{...l,...n})];return o&&t.length&&i.push(Object(r.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),i})({selected:t,search:c,queryArgs:n});return Promise.all(i.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>o()({path:"/wc/store/v1/products/"+e}),d=()=>o()({path:"wc/store/v1/products/attributes"}),b=e=>o()({path:`wc/store/v1/products/attributes/${e}/terms`}),m=e=>{let{selected:t=[],search:c}=e;const n=(e=>{let{selected:t=[],search:c}=e;const n=Object(i.getSetting)("limitTags",!1),o=[Object(r.addQueryArgs)("wc/store/v1/products/tags",{per_page:n?100:0,orderby:n?"count":"name",order:n?"desc":"asc",search:c})];return n&&t.length&&o.push(Object(r.addQueryArgs)("wc/store/v1/products/tags",{include:t})),o})({selected:t,search:c});return Promise.all(n.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id"))},g=e=>o()({path:Object(r.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),p=e=>o()({path:"wc/store/v1/products/categories/"+e}),h=e=>o()({path:Object(r.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),E=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},27:function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return l}));var r=c(1),n=c(13);const o=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},l=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(n.decodeEntities)(e.message):Object(r.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},272:function(e){e.exports=JSON.parse('{"name":"woocommerce/product-best-sellers","title":"Best Selling Products","category":"woocommerce","keywords":["WooCommerce"],"description":"Display a grid of your all-time best selling products.","supports":{"align":["wide","full"],"html":false},"example":{"attributes":{"isPreview":true}},"attributes":{"columns":{"type":"number","default":3},"rows":{"type":"number","default":3},"alignButtons":{"type":"boolean","default":false},"contentVisibility":{"type":"object","default":{"image":true,"title":true,"price":true,"rating":true,"button":true},"properties":{"image":{"type":"boolean","default":true},"title":{"type":"boolean","default":true},"price":{"type":"boolean","default":true},"rating":{"type":"boolean","default":true},"button":{"type":"boolean","default":true}}},"categories":{"type":"array","default":[]},"catOperator":{"type":"string","default":"any"},"isPreview":{"type":"boolean","default":false},"stockStatus":{"type":"array"},"editMode":{"type":"boolean","default":true},"orderby":{"type":"string","enum":["date","popularity","price_asc","price_desc","rating","title","menu_order"],"default":"date"}},"textdomain":"woo-gutenberg-products-block","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},3:function(e,t){e.exports=window.wp.components},32:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(33);t.a=e=>{let{error:t}=e;return Object(r.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:c}=e;return t?"general"===c?Object(r.createElement)("span",null,Object(n.__)("The following error was returned","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(o.escapeHTML)(t))):"api"===c?Object(r.createElement)("span",null,Object(n.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(o.escapeHTML)(t))):t:Object(n.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},33:function(e,t){e.exports=window.wp.escapeHtml},351:function(e,t,c){e.exports=c(470)},36:function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var r=c(6),n=c.n(r),o=c(0),l=c(19);const i=e=>{let{countLabel:t,className:c,depth:r=0,controlId:i="",item:a,isSelected:s,isSingle:u,onSelect:d,search:b="",...m}=e;const g=null!=t&&void 0!==a.count&&null!==a.count,p=[c,"woocommerce-search-list__item"];p.push("depth-"+r),u&&p.push("is-radio-button"),g&&p.push("has-count");const h=a.breadcrumbs&&a.breadcrumbs.length,E=m.name||"search-list-item-"+i,O=`${E}-${a.id}`;return Object(o.createElement)("label",{htmlFor:O,className:p.join(" ")},u?Object(o.createElement)("input",n()({type:"radio",id:O,name:E,value:a.value,onChange:d(a),checked:s,className:"woocommerce-search-list__item-input"},m)):Object(o.createElement)("input",n()({type:"checkbox",id:O,name:E,value:a.value,onChange:d(a),checked:s,className:"woocommerce-search-list__item-input"},m)),Object(o.createElement)("span",{className:"woocommerce-search-list__item-label"},h?Object(o.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(l.b)(a.breadcrumbs)):null,Object(o.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(l.d)(a.name,b))),!!g&&Object(o.createElement)("span",{className:"woocommerce-search-list__item-count"},t||a.count))};t.b=i},470:function(e,t,c){"use strict";c.r(t);var r=c(0),n=c(7),o=c(113),l=c(499),i=c(8),a=c(272),s=c(5),u=c(3),d=c(55),b=c.n(d),m=c(141),g=c(1),p=c(63),h=c(2),E=c(62),O=c(56);const w=e=>{const{attributes:t,setAttributes:c}=e,{categories:n,catOperator:o,columns:l,contentVisibility:i,rows:a,alignButtons:d}=t;return Object(r.createElement)(s.InspectorControls,{key:"inspector"},Object(r.createElement)(u.PanelBody,{title:Object(g.__)("Layout","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(p.a,{columns:l,rows:a,alignButtons:d,setAttributes:c,minColumns:Object(h.getSetting)("min_columns",1),maxColumns:Object(h.getSetting)("max_columns",6),minRows:Object(h.getSetting)("min_rows",1),maxRows:Object(h.getSetting)("max_rows",6)})),Object(r.createElement)(u.PanelBody,{title:Object(g.__)("Content","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(E.a,{settings:i,onChange:e=>c({contentVisibility:e})})),Object(r.createElement)(u.PanelBody,{title:Object(g.__)("Filter by Product Category","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(O.a,{selected:n,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e.map(e=>{let{id:t}=e;return t});c({categories:t})},operator:o,onOperatorChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return c({catOperator:e})}})))},j=e=>{const{attributes:t,name:c}=e;return t.isPreview?m.a:Object(r.createElement)("div",{className:"wc-block-product-best-sellers"},Object(r.createElement)(w,e),Object(r.createElement)(u.Disabled,null,Object(r.createElement)(b.a,{block:c,attributes:t})))};var f=c(74);Object(i.registerBlockType)(a,{icon:{src:Object(r.createElement)(o.a,{icon:l.a,className:"wc-block-editor-components-block-icon"})},attributes:{...f.a,...a.attributes},transforms:{from:[{type:"block",blocks:Object(n.without)(f.b,"woocommerce/product-best-sellers"),transform:e=>Object(i.createBlock)("woocommerce/product-best-sellers",e)}]},edit:e=>{const t=Object(s.useBlockProps)();return Object(r.createElement)("div",t,Object(r.createElement)(j,e))},save:()=>null})},5:function(e,t){e.exports=window.wp.blockEditor},55:function(e,t){e.exports=window.wp.serverSideRender},56:function(e,t,c){"use strict";var r=c(6),n=c.n(r),o=c(0),l=c(1),i=c(36),a=c(97),s=c(3),u=c(10),d=c(25),b=c(27),m=Object(u.createHigherOrderComponent)(e=>class extends o.Component{constructor(){super(...arguments),this.state={error:null,loading:!1,categories:[]},this.loadCategories=this.loadCategories.bind(this)}componentDidMount(){this.loadCategories()}loadCategories(){this.setState({loading:!0}),Object(d.c)().then(e=>{this.setState({categories:e,loading:!1,error:null})}).catch(async e=>{const t=await Object(b.a)(e);this.setState({categories:[],loading:!1,error:t})})}render(){const{error:t,loading:c,categories:r}=this.state;return Object(o.createElement)(e,n()({},this.props,{error:t,isLoading:c,categories:r}))}},"withCategories"),g=c(32),p=c(4),h=c.n(p);c(89);const E=e=>{let{categories:t,error:c,isLoading:r,onChange:u,onOperatorChange:d,operator:b,selected:m,isCompact:p,isSingle:E,showReviewCount:O}=e;const w={clear:Object(l.__)("Clear all product categories","woo-gutenberg-products-block"),list:Object(l.__)("Product Categories","woo-gutenberg-products-block"),noItems:Object(l.__)("Your store doesn't have any product categories.","woo-gutenberg-products-block"),search:Object(l.__)("Search for product categories","woo-gutenberg-products-block"),selected:e=>Object(l.sprintf)( +/* translators: %d is the count of selected categories. */ +Object(l._n)("%d category selected","%d categories selected",e,"woo-gutenberg-products-block"),e),updated:Object(l.__)("Category search results updated.","woo-gutenberg-products-block")};return c?Object(o.createElement)(g.a,{error:c}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.a,{className:"woocommerce-product-categories",list:t,isLoading:r,selected:m.map(e=>t.find(t=>t.id===e)).filter(Boolean),onChange:u,renderItem:e=>{const{item:t,search:c,depth:r=0}=e,a=t.breadcrumbs.length?`${t.breadcrumbs.join(", ")}, ${t.name}`:t.name,s=O?Object(l.sprintf)( +/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */ +Object(l._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,"woo-gutenberg-products-block"),a,t.review_count):Object(l.sprintf)( +/* translators: %1$s is the item name, %2$d is the count of products for the item. */ +Object(l._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,"woo-gutenberg-products-block"),a,t.count),u=O?Object(l.sprintf)( +/* translators: %d is the count of reviews. */ +Object(l._n)("%d review","%d reviews",t.review_count,"woo-gutenberg-products-block"),t.review_count):Object(l.sprintf)( +/* translators: %d is the count of products. */ +Object(l._n)("%d product","%d products",t.count,"woo-gutenberg-products-block"),t.count);return Object(o.createElement)(i.a,n()({className:h()("woocommerce-product-categories__item","has-count",{"is-searching":c.length>0,"is-skip-level":0===r&&0!==t.parent})},e,{countLabel:u,"aria-label":s}))},messages:w,isCompact:p,isHierarchical:!0,isSingle:E}),!!d&&Object(o.createElement)("div",{hidden:m.length<2},Object(o.createElement)(s.SelectControl,{className:"woocommerce-product-categories__operator",label:Object(l.__)("Display products matching","woo-gutenberg-products-block"),help:Object(l.__)("Pick at least two categories to use this setting.","woo-gutenberg-products-block"),value:b,onChange:d,options:[{label:Object(l.__)("Any selected categories","woo-gutenberg-products-block"),value:"any"},{label:Object(l.__)("All selected categories","woo-gutenberg-products-block"),value:"all"}]})))};E.defaultProps={operator:"any",isCompact:!1,isSingle:!1},t.a=m(E)},62:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(3);t.a=e=>{let{onChange:t,settings:c}=e;const{image:l,button:i,price:a,rating:s,title:u}=c,d=!1!==l;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product image","woo-gutenberg-products-block"),help:d?Object(n.__)("Product image is visible.","woo-gutenberg-products-block"):Object(n.__)("Product image is hidden.","woo-gutenberg-products-block"),checked:d,onChange:()=>t({...c,image:!d})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product title","woo-gutenberg-products-block"),help:u?Object(n.__)("Product title is visible.","woo-gutenberg-products-block"):Object(n.__)("Product title is hidden.","woo-gutenberg-products-block"),checked:u,onChange:()=>t({...c,title:!u})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product price","woo-gutenberg-products-block"),help:a?Object(n.__)("Product price is visible.","woo-gutenberg-products-block"):Object(n.__)("Product price is hidden.","woo-gutenberg-products-block"),checked:a,onChange:()=>t({...c,price:!a})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product rating","woo-gutenberg-products-block"),help:s?Object(n.__)("Product rating is visible.","woo-gutenberg-products-block"):Object(n.__)("Product rating is hidden.","woo-gutenberg-products-block"),checked:s,onChange:()=>t({...c,rating:!s})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Add to Cart button","woo-gutenberg-products-block"),help:i?Object(n.__)("Add to Cart button is visible.","woo-gutenberg-products-block"):Object(n.__)("Add to Cart button is hidden.","woo-gutenberg-products-block"),checked:i,onChange:()=>t({...c,button:!i})}))}},63:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(7),l=c(3);t.a=e=>{let{columns:t,rows:c,setAttributes:i,alignButtons:a,minColumns:s=1,maxColumns:u=6,minRows:d=1,maxRows:b=6}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(l.RangeControl,{label:Object(n.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:e=>{const t=Object(o.clamp)(e,s,u);i({columns:Number.isNaN(t)?"":t})},min:s,max:u}),Object(r.createElement)(l.RangeControl,{label:Object(n.__)("Rows","woo-gutenberg-products-block"),value:c,onChange:e=>{const t=Object(o.clamp)(e,d,b);i({rows:Number.isNaN(t)?"":t})},min:d,max:b}),Object(r.createElement)(l.ToggleControl,{label:Object(n.__)("Align Last Block","woo-gutenberg-products-block"),help:a?Object(n.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(n.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:a,onChange:()=>i({alignButtons:!a})}))}},7:function(e,t){e.exports=window.lodash},74:function(e,t,c){"use strict";c.d(t,"b",(function(){return n}));var r=c(2);const n=["woocommerce/product-best-sellers","woocommerce/product-category","woocommerce/product-new","woocommerce/product-on-sale","woocommerce/product-top-rated"];t.a={columns:{type:"number",default:Object(r.getSetting)("default_columns",3)},rows:{type:"number",default:Object(r.getSetting)("default_rows",3)},alignButtons:{type:"boolean",default:!1},categories:{type:"array",default:[]},catOperator:{type:"string",default:"any"},contentVisibility:{type:"object",default:{image:!0,title:!0,price:!0,rating:!0,button:!0}},isPreview:{type:"boolean",default:!1},stockStatus:{type:"array",default:Object.keys(Object(r.getSetting)("stockStatusOptions",[]))}}},8:function(e,t){e.exports=window.wp.blocks},89:function(e,t){},97:function(e,t,c){"use strict";c.d(t,"a",(function(){return y}));var r=c(6),n=c.n(r),o=c(0),l=c(1),i=c(3),a=c(113),s=c(498),u=c(4),d=c.n(u),b=c(10),m=c(19),g=c(36),p=c(497),h=c(13);const E=e=>{let{id:t,label:c,popoverContents:r,remove:n,screenReaderLabel:s,className:u=""}=e;const[m,g]=Object(o.useState)(!1),O=Object(b.useInstanceId)(E);if(s=s||c,!c)return null;c=Object(h.decodeEntities)(c);const w=d()("woocommerce-tag",u,{"has-remove":!!n}),j="woocommerce-tag__label-"+O,f=Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},s),Object(o.createElement)("span",{"aria-hidden":"true"},c));return Object(o.createElement)("span",{className:w},r?Object(o.createElement)(i.Button,{className:"woocommerce-tag__text",id:j,onClick:()=>g(!0)},f):Object(o.createElement)("span",{className:"woocommerce-tag__text",id:j},f),r&&m&&Object(o.createElement)(i.Popover,{onClose:()=>g(!1)},r),n&&Object(o.createElement)(i.Button,{className:"woocommerce-tag__remove",onClick:n(t),label:Object(l.sprintf)(// Translators: %s label. +Object(l.__)("Remove %s","woo-gutenberg-products-block"),c),"aria-describedby":j},Object(o.createElement)(a.a,{icon:p.a,size:20,className:"clear-icon"})))};var O=E;const w=e=>Object(o.createElement)(g.b,e),j=e=>{const{list:t,selected:c,renderItem:r,depth:l=0,onSelect:i,instanceId:a,isSingle:s,search:u}=e;return t?Object(o.createElement)(o.Fragment,null,t.map(t=>{const d=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(o.createElement)(o.Fragment,{key:t.id},Object(o.createElement)("li",null,r({item:t,isSelected:d,onSelect:i,isSingle:s,search:u,depth:l,controlId:a})),Object(o.createElement)(j,n()({},e,{list:t.children,depth:l+1})))})):null},f=e=>{let{isLoading:t,isSingle:c,selected:r,messages:n,onChange:a,onRemove:s}=e;if(t||c||!r)return null;const u=r.length;return Object(o.createElement)("div",{className:"woocommerce-search-list__selected"},Object(o.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(o.createElement)("strong",null,n.selected(u)),u>0?Object(o.createElement)(i.Button,{isLink:!0,isDestructive:!0,onClick:()=>a([]),"aria-label":n.clear},Object(l.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(o.createElement)("ul",null,r.map((e,t)=>Object(o.createElement)("li",{key:t},Object(o.createElement)(O,{label:e.name,id:e.id,remove:s})))):null)},_=e=>{let{filteredList:t,search:c,onSelect:r,instanceId:n,...i}=e;const{messages:u,renderItem:d,selected:b,isSingle:m}=i,g=d||w;return 0===t.length?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(o.createElement)(a.a,{icon:s.a})),Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(l.sprintf)(u.noResults,c):u.noItems)):Object(o.createElement)("ul",{className:"woocommerce-search-list__list"},Object(o.createElement)(j,{list:t,selected:b,renderItem:g,onSelect:r,instanceId:n,isSingle:m,search:c}))},y=e=>{const{className:t="",isCompact:c,isHierarchical:r,isLoading:l,isSingle:a,list:s,messages:u=m.a,onChange:g,onSearch:p,selected:h,debouncedSpeak:E}=e,[O,w]=Object(o.useState)(""),j=Object(b.useInstanceId)(y),x=Object(o.useMemo)(()=>({...m.a,...u}),[u]),k=Object(o.useMemo)(()=>Object(m.c)(s,O,r),[s,O,r]);Object(o.useEffect)(()=>{E&&E(x.updated)},[E,x]),Object(o.useEffect)(()=>{"function"==typeof p&&p(O)},[O,p]);const v=Object(o.useCallback)(e=>()=>{a&&g([]);const t=h.findIndex(t=>{let{id:c}=t;return c===e});g([...h.slice(0,t),...h.slice(t+1)])},[a,h,g]),S=Object(o.useCallback)(e=>()=>{-1===h.findIndex(t=>{let{id:c}=t;return c===e.id})?g(a?[e]:[...h,e]):v(e.id)()},[a,v,g,h]);return Object(o.createElement)("div",{className:d()("woocommerce-search-list",t,{"is-compact":c})},Object(o.createElement)(f,n()({},e,{onRemove:v,messages:x})),Object(o.createElement)("div",{className:"woocommerce-search-list__search"},Object(o.createElement)(i.TextControl,{label:x.search,type:"search",value:O,onChange:e=>w(e)})),l?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(o.createElement)(i.Spinner,null)):Object(o.createElement)(_,n()({},e,{search:O,filteredList:k,messages:x,onSelect:S,instanceId:j})))};Object(i.withSpokenMessages)(y)}}); \ No newline at end of file diff --git a/build/product-best-sellers/block.json b/build/product-best-sellers/block.json new file mode 100644 index 00000000000..5804158f1de --- /dev/null +++ b/build/product-best-sellers/block.json @@ -0,0 +1,97 @@ +{ + "name": "woocommerce/product-best-sellers", + "title": "Best Selling Products", + "category": "woocommerce", + "keywords": [ "WooCommerce" ], + "description": "Display a grid of your all-time best selling products.", + "supports": { + "align": [ "wide", "full" ], + "html": false + }, + "example": { + "attributes": { + "isPreview": true + } + }, + "attributes": { + "columns": { + "type": "number", + "default": 3 + }, + "rows": { + "type": "number", + "default": 3 + }, + "alignButtons": { + "type": "boolean", + "default": false + }, + "contentVisibility": { + "type": "object", + "default": { + "image": true, + "title": true, + "price": true, + "rating": true, + "button": true + }, + "properties": { + "image": { + "type": "boolean", + "default": true + }, + "title": { + "type": "boolean", + "default": true + }, + "price": { + "type": "boolean", + "default": true + }, + "rating": { + "type": "boolean", + "default": true + }, + "button": { + "type": "boolean", + "default": true + } + } + }, + "categories": { + "type": "array", + "default": [] + }, + "catOperator": { + "type": "string", + "default": "any" + }, + "isPreview": { + "type": "boolean", + "default": false + }, + "stockStatus": { + "type": "array" + }, + "editMode": { + "type": "boolean", + "default": true + }, + "orderby": { + "type": "string", + "enum": [ + "date", + "popularity", + "price_asc", + "price_desc", + "rating", + "title", + "menu_order" + ], + "default": "date" + } + }, + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2, + "$schema": "https://schemas.wp.org/trunk/block.json" +} diff --git a/build/product-button--product-category-list--product-image--product-price--product-rating--product-sale-b--e17c7c01.js b/build/product-button--product-category-list--product-image--product-price--product-rating--product-sale-b--e17c7c01.js new file mode 100644 index 00000000000..edc95ffd7a6 --- /dev/null +++ b/build/product-button--product-category-list--product-image--product-price--product-rating--product-sale-b--e17c7c01.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{123:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(35),c=n(150);const r=t=>{const e=Object(o.a)(t)?t:{},n=Object(c.a)(e.style),r=Object(o.a)(n.typography)?n.typography:{};return{style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:r.fontSize,lineHeight:r.lineHeight,fontWeight:r.fontWeight,textTransform:r.textTransform,fontFamily:e.fontFamily}}}},138:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var o=n(5),c=n(95),r=n(35),s=n(150);const a=t=>{if(!Object(c.b)())return{className:"",style:{}};const e=Object(r.a)(t)?t:{},n=Object(s.a)(e.style);return Object(o.__experimentalUseColorProps)({...e,style:n})}},150:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(100),c=n(35);const r=t=>Object(o.a)(t)?JSON.parse(t)||{}:Object(c.a)(t)?t:{}}}]); \ No newline at end of file diff --git a/build/product-button--product-image--product-rating--product-sale-badge--product-title.js b/build/product-button--product-image--product-rating--product-sale-badge--product-title.js new file mode 100644 index 00000000000..05dfe3d80a6 --- /dev/null +++ b/build/product-button--product-image--product-rating--product-sale-badge--product-title.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[3],{121:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var c=n(5);const s=()=>"function"==typeof c.__experimentalGetSpacingClassesAndStyles},215:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var c=n(5),s=n(95),a=n(35),o=n(121),i=n(150);const r=t=>{if(!Object(s.b)()||!Object(o.a)())return{style:{}};const e=Object(a.a)(t)?t:{},n=Object(i.a)(e.style);return Object(c.__experimentalGetSpacingClassesAndStyles)({...e,style:n})}}}]); \ No newline at end of file diff --git a/build/product-button-frontend.js b/build/product-button-frontend.js new file mode 100644 index 00000000000..46f8d4a18f1 --- /dev/null +++ b/build/product-button-frontend.js @@ -0,0 +1,3 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[59],{121:function(t,e,c){"use strict";c.d(e,"a",(function(){return r}));var n=c(45),o=c(18);const r=t=>Object(n.a)(t)?JSON.parse(t)||{}:Object(o.a)(t)?t:{}},18:function(t,e,c){"use strict";c.d(e,"a",(function(){return n})),c.d(e,"b",(function(){return o}));const n=t=>!(t=>null===t)(t)&&t instanceof Object&&t.constructor===Object;function o(t,e){return n(t)&&e in t}},200:function(t,e,c){"use strict";c.d(e,"a",(function(){return o})),c(103);var n=c(48);const o=()=>n.m>1},252:function(t,e,c){"use strict";c.d(e,"a",(function(){return r}));var n=c(18),o=c(121);const r=t=>{const e=Object(n.a)(t)?t:{},c=Object(o.a)(e.style),r=Object(n.a)(c.typography)?c.typography:{};return{style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:r.fontSize,lineHeight:r.lineHeight,fontWeight:r.fontWeight,textTransform:r.textTransform,fontFamily:e.fontFamily}}}},254:function(t,e,c){"use strict";c.d(e,"a",(function(){return a}));var n=c(114),o=c(200),r=c(18),s=c(121);const a=t=>{if(!Object(o.a)())return{className:"",style:{}};const e=Object(r.a)(t)?t:{},c=Object(s.a)(e.style);return Object(n.__experimentalUseBorderProps)({...e,style:c})}},272:function(t,e,c){"use strict";c.d(e,"a",(function(){return a}));var n=c(114),o=c(200),r=c(18),s=c(121);const a=t=>{if(!Object(o.a)())return{className:"",style:{}};const e=Object(r.a)(t)?t:{},c=Object(s.a)(e.style);return Object(n.__experimentalUseColorProps)({...e,style:c})}},301:function(t,e,c){"use strict";c.d(e,"a",(function(){return a}));var n=c(114),o=c(200),r=c(18),s=c(121);const a=t=>{if(!Object(o.a)()||"function"!=typeof n.__experimentalGetSpacingClassesAndStyles)return{style:{}};const e=Object(r.a)(t)?t:{},c=Object(s.a)(e.style);return Object(n.__experimentalGetSpacingClassesAndStyles)({...e,style:c})}},354:function(t,e){},355:function(t,e,c){"use strict";c.d(e,"a",(function(){return l}));var n=c(0),o=c(7),r=c(6),s=c(17),a=c(32);const i=(t,e)=>{const c=t.find(t=>{let{id:c}=t;return c===e});return c?c.quantity:0},l=t=>{const{addItemToCart:e}=Object(o.useDispatch)(r.CART_STORE_KEY),{cartItems:c,cartIsLoading:l}=Object(a.a)(),{createErrorNotice:u,removeNotice:d}=Object(o.useDispatch)("core/notices"),[b,p]=Object(n.useState)(!1),y=Object(n.useRef)(i(c,t));return Object(n.useEffect)(()=>{const e=i(c,t);e!==y.current&&(y.current=e)},[c,t]),{cartQuantity:Number.isFinite(y.current)?y.current:0,addingToCart:b,cartIsLoading:l,addToCart:function(){let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return p(!0),e(t,c).then(()=>{d("add-to-cart")}).catch(t=>{u(Object(s.decodeEntities)(t.message),{id:"add-to-cart",context:"wc/all-products",isDismissible:!0})}).finally(()=>{p(!1)})}}}},404:function(t,e,c){"use strict";c.r(e);var n=c(12),o=c.n(n),r=c(0),s=c(4),a=c.n(s),i=c(1),l=c(59),u=c(355),d=c(272),b=c(254),p=c(252),y=c(301),f=c(17),O=c(48),j=c(2),m=c(47),_=c(119);c(354);const g=t=>{let{product:e,colorStyles:c,borderStyles:n,typographyStyles:s,spacingStyles:d}=t;const{id:b,permalink:p,add_to_cart:y,has_options:m,is_purchasable:_,is_in_stock:g}=e,{dispatchStoreEvent:S}=Object(l.a)(),{cartQuantity:w,addingToCart:h,addToCart:k}=Object(u.a)(b,"woocommerce/single-product/"+(b||0)),v=Number.isFinite(w)&&w>0,N=!m&&_&&g,C=Object(f.decodeEntities)((null==y?void 0:y.description)||""),E=v?Object(i.sprintf)( +/* translators: %s number of products in cart. */ +Object(i._n)("%d in cart","%d in cart",w,"woo-gutenberg-products-block"),w):Object(f.decodeEntities)((null==y?void 0:y.text)||Object(i.__)("Add to cart","woo-gutenberg-products-block")),x=N?"button":"a",T={};return N?T.onClick=async()=>{await k(),S("cart-add-item",{product:e});const{cartRedirectAfterAdd:t}=Object(j.getSetting)("productsSettings");t&&(window.location.href=O.c)}:(T.href=p,T.rel="nofollow",T.onClick=()=>{S("product-view-link",{product:e})}),Object(r.createElement)(x,o()({"aria-label":C,className:a()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",c.className,n.className,{loading:h,added:v}),style:{...c.style,...n.style,...s.style,...d.style},disabled:h},T),E)},S=t=>{let{colorStyles:e,borderStyles:c,typographyStyles:n,spacingStyles:o}=t;return Object(r.createElement)("button",{className:a()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder",e.className,c.className),style:{...e.style,...c.style,...n.style,...o.style},disabled:!0})};e.default=Object(_.withProductDataContext)(t=>{const{className:e}=t,{parentClassName:c}=Object(m.useInnerBlockLayoutContext)(),{product:n}=Object(m.useProductDataContext)(),o=Object(d.a)(t),s=Object(b.a)(t),i=Object(p.a)(t),l=Object(y.a)(t);return Object(r.createElement)("div",{className:a()(e,"wp-block-button","wc-block-components-product-button",{[c+"__product-add-to-cart"]:c})},n.id?Object(r.createElement)(g,{product:n,colorStyles:o,borderStyles:s,typographyStyles:i,spacingStyles:l}):Object(r.createElement)(S,{colorStyles:o,borderStyles:s,typographyStyles:i,spacingStyles:l}))})}}]); \ No newline at end of file diff --git a/build/product-button.js b/build/product-button.js new file mode 100644 index 00000000000..f4853664f39 --- /dev/null +++ b/build/product-button.js @@ -0,0 +1,3 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[20],{219:function(t,e,c){"use strict";c.d(e,"a",(function(){return a}));var o=c(5),n=c(95),r=c(35),s=c(150);const a=t=>{if(!Object(n.b)())return{className:"",style:{}};const e=Object(r.a)(t)?t:{},c=Object(s.a)(e.style);return Object(o.__experimentalUseBorderProps)({...e,style:c})}},303:function(t,e,c){"use strict";c.r(e);var o=c(6),n=c.n(o),r=c(0),s=c(4),a=c.n(s),l=c(1),d=c(78),i=c(341),u=c(138),b=c(219),p=c(123),y=c(215),O=c(13),j=c(23),m=c(2),_=c(29),g=c(58);c(334);const w=t=>{let{product:e,colorStyles:c,borderStyles:o,typographyStyles:s,spacingStyles:u}=t;const{id:b,permalink:p,add_to_cart:y,has_options:_,is_purchasable:g,is_in_stock:w}=e,{dispatchStoreEvent:k}=Object(d.a)(),{cartQuantity:S,addingToCart:f,addToCart:h}=Object(i.a)(b,"woocommerce/single-product/"+(b||0)),N=Number.isFinite(S)&&S>0,E=!_&&g&&w,C=Object(O.decodeEntities)((null==y?void 0:y.description)||""),v=N?Object(l.sprintf)( +/* translators: %s number of products in cart. */ +Object(l._n)("%d in cart","%d in cart",S,"woo-gutenberg-products-block"),S):Object(O.decodeEntities)((null==y?void 0:y.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),T=E?"button":"a",x={};return E?x.onClick=async()=>{await h(),k("cart-add-item",{product:e});const{cartRedirectAfterAdd:t}=Object(m.getSetting)("productsSettings");t&&(window.location.href=j.d)}:(x.href=p,x.rel="nofollow",x.onClick=()=>{k("product-view-link",{product:e})}),Object(r.createElement)(T,n()({"aria-label":C,className:a()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",c.className,o.className,{loading:f,added:N}),style:{...c.style,...o.style,...s.style,...u.style},disabled:f},x),v)},k=t=>{let{colorStyles:e,borderStyles:c,typographyStyles:o,spacingStyles:n}=t;return Object(r.createElement)("button",{className:a()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder",e.className,c.className),style:{...e.style,...c.style,...o.style,...n.style},disabled:!0})};e.default=Object(g.withProductDataContext)(t=>{const{className:e}=t,{parentClassName:c}=Object(_.useInnerBlockLayoutContext)(),{product:o}=Object(_.useProductDataContext)(),n=Object(u.a)(t),s=Object(b.a)(t),l=Object(p.a)(t),d=Object(y.a)(t);return Object(r.createElement)("div",{className:a()(e,"wp-block-button","wc-block-components-product-button",{[c+"__product-add-to-cart"]:c})},o.id?Object(r.createElement)(w,{product:o,colorStyles:n,borderStyles:s,typographyStyles:l,spacingStyles:d}):Object(r.createElement)(k,{colorStyles:n,borderStyles:s,typographyStyles:l,spacingStyles:d}))})},334:function(t,e){},341:function(t,e,c){"use strict";c.d(e,"a",(function(){return d}));var o=c(0),n=c(9),r=c(17),s=c(13),a=c(41);const l=(t,e)=>{const c=t.find(t=>{let{id:c}=t;return c===e});return c?c.quantity:0},d=t=>{const{addItemToCart:e}=Object(n.useDispatch)(r.CART_STORE_KEY),{cartItems:c,cartIsLoading:d}=Object(a.a)(),{createErrorNotice:i,removeNotice:u}=Object(n.useDispatch)("core/notices"),[b,p]=Object(o.useState)(!1),y=Object(o.useRef)(l(c,t));return Object(o.useEffect)(()=>{const e=l(c,t);e!==y.current&&(y.current=e)},[c,t]),{cartQuantity:Number.isFinite(y.current)?y.current:0,addingToCart:b,cartIsLoading:d,addToCart:function(){let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return p(!0),e(t,c).then(()=>{u("add-to-cart")}).catch(t=>{i(Object(s.decodeEntities)(t.message),{id:"add-to-cart",context:"wc/all-products",isDismissible:!0})}).finally(()=>{p(!1)})}}}}}]); \ No newline at end of file diff --git a/build/product-categories.asset.php b/build/product-categories.asset.php new file mode 100644 index 00000000000..a8b8e2d0148 --- /dev/null +++ b/build/product-categories.asset.php @@ -0,0 +1 @@ + array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render'), 'version' => 'ecf63736757fc13d5fd8afcaa87124a8'); \ No newline at end of file diff --git a/build/product-categories.js b/build/product-categories.js new file mode 100644 index 00000000000..0f024554527 --- /dev/null +++ b/build/product-categories.js @@ -0,0 +1 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-categories"]=function(e){function t(t){for(var r,n,l=t[0],s=t[1],i=t[2],p=0,b=[];pObject(a.createElement)(g.Placeholder,{icon:Object(a.createElement)(l.a,{icon:s.a}),label:Object(p.__)("Product Categories List","woo-gutenberg-products-block"),className:"wc-block-product-categories"},Object(p.__)("This block shows product categories for your store. To use it, you'll first need to create a product and assign it to a category.","woo-gutenberg-products-block"));var w=e=>{let{attributes:t,setAttributes:o,name:r}=e;const c=Object(u.useBlockProps)({className:"wc-block-product-categories"});return Object(a.createElement)("div",c,(()=>{const{hasCount:e,hasImage:r,hasEmpty:c,isDropdown:n,isHierarchical:l}=t;return Object(a.createElement)(u.InspectorControls,{key:"inspector"},Object(a.createElement)(g.PanelBody,{title:Object(p.__)("List Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(a.createElement)(g.__experimentalToggleGroupControl,{label:Object(p.__)("Display style","woo-gutenberg-products-block"),value:n?"dropdown":"list",onChange:e=>o({isDropdown:"dropdown"===e})},Object(a.createElement)(g.__experimentalToggleGroupControlOption,{value:"list",label:Object(p.__)("List","woo-gutenberg-products-block")}),Object(a.createElement)(g.__experimentalToggleGroupControlOption,{value:"dropdown",label:Object(p.__)("Dropdown","woo-gutenberg-products-block")}))),Object(a.createElement)(g.PanelBody,{title:Object(p.__)("Content","woo-gutenberg-products-block"),initialOpen:!0},Object(a.createElement)(g.ToggleControl,{label:Object(p.__)("Show product count","woo-gutenberg-products-block"),help:e?Object(p.__)("Product count is visible.","woo-gutenberg-products-block"):Object(p.__)("Product count is hidden.","woo-gutenberg-products-block"),checked:e,onChange:()=>o({hasCount:!e})}),!n&&Object(a.createElement)(g.ToggleControl,{label:Object(p.__)("Show category images","woo-gutenberg-products-block"),help:r?Object(p.__)("Category images are visible.","woo-gutenberg-products-block"):Object(p.__)("Category images are hidden.","woo-gutenberg-products-block"),checked:r,onChange:()=>o({hasImage:!r})}),Object(a.createElement)(g.ToggleControl,{label:Object(p.__)("Show hierarchy","woo-gutenberg-products-block"),help:l?Object(p.__)("Hierarchy is visible.","woo-gutenberg-products-block"):Object(p.__)("Hierarchy is hidden.","woo-gutenberg-products-block"),checked:l,onChange:()=>o({isHierarchical:!l})}),Object(a.createElement)(g.ToggleControl,{label:Object(p.__)("Show empty categories","woo-gutenberg-products-block"),help:c?Object(p.__)("Empty categories are visible.","woo-gutenberg-products-block"):Object(p.__)("Empty categories are hidden.","woo-gutenberg-products-block"),checked:c,onChange:()=>o({hasEmpty:!c})})))})(),Object(a.createElement)(g.Disabled,null,Object(a.createElement)(d.a,{block:r,attributes:t,EmptyResponsePlaceholder:h})))};Object(n.registerBlockType)(i,{icon:{src:Object(a.createElement)(l.a,{icon:s.a,className:"wc-block-editor-components-block-icon"})},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:o}=e;return"woocommerce_product_categories"===t&&!(null==o||!o.raw)},transform:e=>{let{instance:t}=e;return Object(n.createBlock)("woocommerce/product-categories",{hasCount:!!t.raw.count,hasEmpty:!t.raw.hide_empty,isDropdown:!!t.raw.dropdown,isHierarchical:!!t.raw.hierarchical})}}]},deprecated:[{attributes:{hasCount:{type:"boolean",default:!0,source:"attribute",selector:"div",attribute:"data-has-count"},hasEmpty:{type:"boolean",default:!1,source:"attribute",selector:"div",attribute:"data-has-empty"},isDropdown:{type:"boolean",default:!1,source:"attribute",selector:"div",attribute:"data-is-dropdown"},isHierarchical:{type:"boolean",default:!0,source:"attribute",selector:"div",attribute:"data-is-hierarchical"}},migrate:e=>e,save(e){const{hasCount:t,hasEmpty:o,isDropdown:r,isHierarchical:n}=e.attributes,l={};return t&&(l["data-has-count"]=!0),o&&(l["data-has-empty"]=!0),r&&(l["data-is-dropdown"]=!0),n&&(l["data-is-hierarchical"]=!0),Object(a.createElement)("div",c()({className:"is-loading"},l),r?Object(a.createElement)("span",{"aria-hidden":!0,className:"wc-block-product-categories__placeholder"}):Object(a.createElement)("ul",{"aria-hidden":!0},Object(a.createElement)("li",null,Object(a.createElement)("span",{className:"wc-block-product-categories__placeholder"})),Object(a.createElement)("li",null,Object(a.createElement)("span",{className:"wc-block-product-categories__placeholder"})),Object(a.createElement)("li",null,Object(a.createElement)("span",{className:"wc-block-product-categories__placeholder"}))))}}],edit:e=>{const t=Object(u.useBlockProps)();return Object(a.createElement)("div",t,Object(a.createElement)(w,e))},save:()=>null})},5:function(e,t){e.exports=window.wp.blockEditor},55:function(e,t){e.exports=window.wp.serverSideRender},8:function(e,t){e.exports=window.wp.blocks}}); \ No newline at end of file diff --git a/build/product-categories/block.json b/build/product-categories/block.json new file mode 100644 index 00000000000..3842a4ccf2f --- /dev/null +++ b/build/product-categories/block.json @@ -0,0 +1,53 @@ +{ + "name": "woocommerce/product-categories", + "title": "Product Categories List", + "category": "woocommerce", + "description": "Show all product categories as a list or dropdown.", + "keywords": [ "WooCommerce" ], + "supports": { + "align": [ "wide", "full" ], + "html": false, + "color": { + "background": false, + "link": true + }, + "typography": { + "fontSize": true, + "lineHeight": true + } + }, + "attributes": { + "align": { + "type": "string" + }, + "hasCount": { + "type": "boolean", + "default": true + }, + "hasImage": { + "type": "boolean", + "default": false + }, + "hasEmpty": { + "type": "boolean", + "default": false + }, + "isDropdown": { + "type": "boolean", + "default": false + }, + "isHierarchical": { + "type": "boolean", + "default": true + } + }, + "example": { + "attributes": { + "hasCount": true, + "hasImage": false + } + }, + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2, + "$schema": "https://schemas.wp.org/trunk/block.json" +} diff --git a/build/product-category-list-frontend.js b/build/product-category-list-frontend.js new file mode 100644 index 00000000000..d53fc854a1e --- /dev/null +++ b/build/product-category-list-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[60],{121:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var c=n(45),o=n(18);const r=t=>Object(c.a)(t)?JSON.parse(t)||{}:Object(o.a)(t)?t:{}},18:function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return o}));const c=t=>!(t=>null===t)(t)&&t instanceof Object&&t.constructor===Object;function o(t,e){return c(t)&&e in t}},200:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n(103);var c=n(48);const o=()=>c.m>1},252:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var c=n(18),o=n(121);const r=t=>{const e=Object(c.a)(t)?t:{},n=Object(o.a)(e.style),r=Object(c.a)(n.typography)?n.typography:{};return{style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:r.fontSize,lineHeight:r.lineHeight,fontWeight:r.fontWeight,textTransform:r.textTransform,fontFamily:e.fontFamily}}}},272:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var c=n(114),o=n(200),r=n(18),s=n(121);const a=t=>{if(!Object(o.a)())return{className:"",style:{}};const e=Object(r.a)(t)?t:{},n=Object(s.a)(e.style);return Object(c.__experimentalUseColorProps)({...e,style:n})}},358:function(t,e){},407:function(t,e,n){"use strict";n.r(e);var c=n(0),o=n(1),r=n(4),s=n.n(r),a=n(47),i=n(272),u=n(252),l=n(3),b=n(119);n(358),e.default=Object(b.withProductDataContext)(t=>{const{className:e}=t,{parentClassName:n}=Object(a.useInnerBlockLayoutContext)(),{product:r}=Object(a.useProductDataContext)(),b=Object(i.a)(t),f=Object(u.a)(t);return Object(l.isEmpty)(r.categories)?null:Object(c.createElement)("div",{className:s()(e,"wc-block-components-product-category-list",b.className,{[n+"__product-category-list"]:n}),style:{...b.style,...f.style}},Object(o.__)("Categories:","woo-gutenberg-products-block")," ",Object(c.createElement)("ul",null,Object.values(r.categories).map(t=>{let{name:e,link:n,slug:o}=t;return Object(c.createElement)("li",{key:"category-list-item-"+o},Object(c.createElement)("a",{href:n},e))})))})}}]); \ No newline at end of file diff --git a/build/product-category-list.js b/build/product-category-list.js new file mode 100644 index 00000000000..1833680de8d --- /dev/null +++ b/build/product-category-list.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[23],{306:function(e,t,c){"use strict";c.r(t);var a=c(0),o=c(1),s=c(4),l=c.n(s),n=c(29),r=c(138),u=c(123),b=c(7),i=c(58);c(337),t.default=Object(i.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(n.useInnerBlockLayoutContext)(),{product:s}=Object(n.useProductDataContext)(),i=Object(r.a)(e),m=Object(u.a)(e);return Object(b.isEmpty)(s.categories)?null:Object(a.createElement)("div",{className:l()(t,"wc-block-components-product-category-list",i.className,{[c+"__product-category-list"]:c}),style:{...i.style,...m.style}},Object(o.__)("Categories:","woo-gutenberg-products-block")," ",Object(a.createElement)("ul",null,Object.values(s.categories).map(e=>{let{name:t,link:c,slug:o}=e;return Object(a.createElement)("li",{key:"category-list-item-"+o},Object(a.createElement)("a",{href:c},t))})))})},337:function(e,t){}}]); \ No newline at end of file diff --git a/build/product-category.asset.php b/build/product-category.asset.php new file mode 100644 index 00000000000..afa5a980600 --- /dev/null +++ b/build/product-category.asset.php @@ -0,0 +1 @@ + array('lodash', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render', 'wp-url'), 'version' => 'f7f323f0e4afbb0b433807a6a1d6a885'); \ No newline at end of file diff --git a/build/product-category.js b/build/product-category.js new file mode 100644 index 00000000000..7acf98fcc1c --- /dev/null +++ b/build/product-category.js @@ -0,0 +1,20 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-category"]=function(e){function t(t){for(var r,l,a=t[0],s=t[1],i=t[2],b=0,d=[];bObject(n.sprintf)( +/* translators: Number of items selected from list. */ +Object(n._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(n.__)("Search results updated.","woo-gutenberg-products-block")},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(o.groupBy)(e,"parent"),r=Object(o.keyBy)(t,"id"),n=["0"],l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=l(r[e.parent]);return[...t,e.name]},a=e=>e.map(e=>{const t=c[e.id];return n.push(""+e.id),{...e,breadcrumbs:l(r[e.parent]),children:t&&t.length?a(t):[]}}),s=a(c[0]||[]);return Object.entries(c).forEach(e=>{let[t,c]=e;n.includes(t)||s.push(...a(c||[]))}),s},s=(e,t,c)=>{if(!t)return c?a(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),o=e.map(e=>!!r.test(e.name)&&e).filter(Boolean);return c?a(o,e):o},i=(e,t)=>{if(!t)return e;const c=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(c).map((e,t)=>c.test(e)?Object(r.createElement)("strong",{key:t},e):Object(r.createElement)(r.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},2:function(e,t){e.exports=window.wc.wcSettings},23:function(e,t,c){"use strict";c.d(t,"o",(function(){return n})),c.d(t,"m",(function(){return l})),c.d(t,"l",(function(){return a})),c.d(t,"n",(function(){return s})),c.d(t,"j",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return b})),c.d(t,"g",(function(){return d})),c.d(t,"k",(function(){return g})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return p})),c.d(t,"h",(function(){return h})),c.d(t,"a",(function(){return O})),c.d(t,"i",(function(){return E})),c.d(t,"b",(function(){return j}));var r,o=c(2);const n=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),l=n.pluginUrl+"images/",a=n.pluginUrl+"build/",s=n.buildPhase,i=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=o.STORE_PAGES.checkout.id,b=o.STORE_PAGES.checkout.permalink,d=o.STORE_PAGES.privacy.permalink,g=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),m=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),p=o.STORE_PAGES.cart.permalink,h=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),O=Object(o.getSetting)("allowedCountries",{}),E=Object(o.getSetting)("shippingStates",{}),j=Object(o.getSetting)("allowedStates",{})},25:function(e,t,c){"use strict";c.d(t,"h",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"b",(function(){return b})),c.d(t,"i",(function(){return d})),c.d(t,"f",(function(){return g})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return p})),c.d(t,"g",(function(){return h})),c.d(t,"a",(function(){return O}));var r=c(15),o=c(14),n=c.n(o),l=c(7),a=c(2),s=c(23);const i=e=>{let{selected:t=[],search:c="",queryArgs:o={}}=e;const a=(e=>{let{selected:t=[],search:c="",queryArgs:o={}}=e;const n=s.o.productCount>100,l={per_page:n?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},a=[Object(r.addQueryArgs)("/wc/store/v1/products",{...l,...o})];return n&&t.length&&a.push(Object(r.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),a})({selected:t,search:c,queryArgs:o});return Promise.all(a.map(e=>n()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>n()({path:"/wc/store/v1/products/"+e}),b=()=>n()({path:"wc/store/v1/products/attributes"}),d=e=>n()({path:`wc/store/v1/products/attributes/${e}/terms`}),g=e=>{let{selected:t=[],search:c}=e;const o=(e=>{let{selected:t=[],search:c}=e;const o=Object(a.getSetting)("limitTags",!1),n=[Object(r.addQueryArgs)("wc/store/v1/products/tags",{per_page:o?100:0,orderby:o?"count":"name",order:o?"desc":"asc",search:c})];return o&&t.length&&n.push(Object(r.addQueryArgs)("wc/store/v1/products/tags",{include:t})),n})({selected:t,search:c});return Promise.all(o.map(e=>n()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id"))},m=e=>n()({path:Object(r.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),p=e=>n()({path:"wc/store/v1/products/categories/"+e}),h=e=>n()({path:Object(r.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),O=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},27:function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return l}));var r=c(1),o=c(13);const n=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},l=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(o.decodeEntities)(e.message):Object(r.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},273:function(e){e.exports=JSON.parse('{"name":"woocommerce/product-category","title":"Products by Category","category":"woocommerce","keywords":["WooCommerce"],"description":"Display a grid of products from your selected categories.","supports":{"align":["wide","full"],"html":false},"example":{"attributes":{"isPreview":true}},"attributes":{"columns":{"type":"number","default":3},"rows":{"type":"number","default":3},"alignButtons":{"type":"boolean","default":false},"contentVisibility":{"type":"object","default":{"image":true,"title":true,"price":true,"rating":true,"button":true},"properties":{"image":{"type":"boolean","default":true},"title":{"type":"boolean","default":true},"price":{"type":"boolean","default":true},"rating":{"type":"boolean","default":true},"button":{"type":"boolean","default":true}}},"categories":{"type":"array","default":[]},"catOperator":{"type":"string","default":"any"},"isPreview":{"type":"boolean","default":false},"stockStatus":{"type":"array"},"editMode":{"type":"boolean","default":true},"orderby":{"type":"string","enum":["date","popularity","price_asc","price_desc","rating","title","menu_order"],"default":"date"}},"textdomain":"woo-gutenberg-products-block","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},3:function(e,t){e.exports=window.wp.components},32:function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(33);t.a=e=>{let{error:t}=e;return Object(r.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:c}=e;return t?"general"===c?Object(r.createElement)("span",null,Object(o.__)("The following error was returned","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(n.escapeHTML)(t))):"api"===c?Object(r.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(n.escapeHTML)(t))):t:Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},33:function(e,t){e.exports=window.wp.escapeHtml},352:function(e,t,c){e.exports=c(467)},353:function(e,t){},36:function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(6),o=c.n(r),n=c(0),l=c(19);const a=e=>{let{countLabel:t,className:c,depth:r=0,controlId:a="",item:s,isSelected:i,isSingle:u,onSelect:b,search:d="",...g}=e;const m=null!=t&&void 0!==s.count&&null!==s.count,p=[c,"woocommerce-search-list__item"];p.push("depth-"+r),u&&p.push("is-radio-button"),m&&p.push("has-count");const h=s.breadcrumbs&&s.breadcrumbs.length,O=g.name||"search-list-item-"+a,E=`${O}-${s.id}`;return Object(n.createElement)("label",{htmlFor:E,className:p.join(" ")},u?Object(n.createElement)("input",o()({type:"radio",id:E,name:O,value:s.value,onChange:b(s),checked:i,className:"woocommerce-search-list__item-input"},g)):Object(n.createElement)("input",o()({type:"checkbox",id:E,name:O,value:s.value,onChange:b(s),checked:i,className:"woocommerce-search-list__item-input"},g)),Object(n.createElement)("span",{className:"woocommerce-search-list__item-label"},h?Object(n.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(l.b)(s.breadcrumbs)):null,Object(n.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(l.d)(s.name,d))),!!m&&Object(n.createElement)("span",{className:"woocommerce-search-list__item-count"},t||s.count))};t.b=a},467:function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(8),n=c(7),l=c(113),a=c(500),s=(c(353),c(273)),i=c(74),u=c(6),b=c.n(u),d=c(5),g=c(3),m=c(1),p=c(55),h=c.n(p),O=c(141);const E=()=>Object(r.createElement)(g.Placeholder,{icon:Object(r.createElement)(l.a,{icon:a.a}),label:Object(m.__)("Products by Category","woo-gutenberg-products-block"),className:"wc-block-products-grid wc-block-products-category"},Object(m.__)("No products were found that matched your selection.","woo-gutenberg-products-block")),j=e=>{const{name:t,attributes:c}=e,o=c.categories.length;return c.isPreview?O.a:o?Object(r.createElement)(h.a,{block:t,attributes:c,EmptyResponsePlaceholder:E}):Object(r.createElement)(r.Fragment,null,Object(m.__)("Select at least one category to display its products.","woo-gutenberg-products-block"))};var w=c(56),f=c(63),_=c(2),y=c(62),k=c(98),x=c(81);const v=e=>{const{isEditing:t,attributes:c,setAttributes:o,setChangedAttributes:n}=e,{columns:l,catOperator:a,contentVisibility:s,orderby:i,rows:u,alignButtons:b,stockStatus:p}=c;return Object(r.createElement)(d.InspectorControls,{key:"inspector"},Object(r.createElement)(g.PanelBody,{title:Object(m.__)("Product Category","woo-gutenberg-products-block"),initialOpen:!c.categories.length&&!t},Object(r.createElement)(w.a,{selected:c.categories,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e.map(e=>{let{id:t}=e;return t}),c={categories:t};o(c),n(c)},operator:a,onOperatorChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";const t={catOperator:e};o(t),n(t)},isCompact:!0})),Object(r.createElement)(g.PanelBody,{title:Object(m.__)("Layout","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(f.a,{columns:l,rows:u,alignButtons:b,setAttributes:o,minColumns:Object(_.getSetting)("min_columns",1),maxColumns:Object(_.getSetting)("max_columns",6),minRows:Object(_.getSetting)("min_rows",1),maxRows:Object(_.getSetting)("max_rows",6)})),Object(r.createElement)(g.PanelBody,{title:Object(m.__)("Content","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(y.a,{settings:s,onChange:e=>o({contentVisibility:e})})),Object(r.createElement)(g.PanelBody,{title:Object(m.__)("Order By","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(k.a,{setAttributes:o,value:i})),Object(r.createElement)(g.PanelBody,{title:Object(m.__)("Filter by stock status","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(x.a,{setAttributes:o,value:p})))},S=e=>{const{debouncedSpeak:t,setIsEditing:c,changedAttributes:o,setChangedAttributes:n,attributes:s}=e,i={...s,...o},u=()=>{c(!1),n({})};return Object(r.createElement)(g.Placeholder,{icon:Object(r.createElement)(l.a,{icon:a.a}),label:Object(m.__)("Products by Category","woo-gutenberg-products-block"),className:"wc-block-products-grid wc-block-products-category"},Object(m.__)("Display a grid of products from your selected categories.","woo-gutenberg-products-block"),Object(r.createElement)("div",{className:"wc-block-products-category__selection"},Object(r.createElement)(w.a,{selected:i.categories,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e.map(e=>{let{id:t}=e;return t});n({categories:t})},operator:i.catOperator,onOperatorChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return n({catOperator:e})}}),Object(r.createElement)(g.Button,{isPrimary:!0,onClick:()=>{(()=>{const{setAttributes:t}=e;t(o),u()})(),t(Object(m.__)("Showing Products by Category block preview.","woo-gutenberg-products-block"))}},Object(m.__)("Done","woo-gutenberg-products-block")),Object(r.createElement)(g.Button,{className:"wc-block-products-category__cancel-button",isTertiary:!0,onClick:()=>{u(),t(Object(m.__)("Showing Products by Category block preview.","woo-gutenberg-products-block"))}},Object(m.__)("Cancel","woo-gutenberg-products-block"))))},C=Object(g.withSpokenMessages)(e=>{const t=Object(d.useBlockProps)(),{attributes:c}=e,[o,n]=Object(r.useState)(!c.categories.length),[l,a]=Object(r.useState)({});return Object(r.createElement)("div",t,Object(r.createElement)(d.BlockControls,null,Object(r.createElement)(g.ToolbarGroup,{controls:[{icon:"edit",title:Object(m.__)("Edit selected categories","woo-gutenberg-products-block"),onClick:()=>n(!o),isActive:o}]})),Object(r.createElement)(v,b()({isEditing:o,setChangedAttributes:a},e)),o?Object(r.createElement)(S,b()({isEditing:o,setIsEditing:n,changedAttributes:l,setChangedAttributes:a},e)):Object(r.createElement)(g.Disabled,null,Object(r.createElement)(j,e)))});Object(o.registerBlockType)(s,{icon:{src:Object(r.createElement)(l.a,{icon:a.a,className:"wc-block-editor-components-block-icon"})},attributes:{...s.attributes,...i.a},transforms:{from:[{type:"block",blocks:Object(n.without)(i.b,"woocommerce/product-category"),transform:e=>Object(o.createBlock)("woocommerce/product-category",{...e,editMode:!1})}]},edit:C,save:()=>null})},5:function(e,t){e.exports=window.wp.blockEditor},55:function(e,t){e.exports=window.wp.serverSideRender},56:function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),l=c(1),a=c(36),s=c(97),i=c(3),u=c(10),b=c(25),d=c(27),g=Object(u.createHigherOrderComponent)(e=>class extends n.Component{constructor(){super(...arguments),this.state={error:null,loading:!1,categories:[]},this.loadCategories=this.loadCategories.bind(this)}componentDidMount(){this.loadCategories()}loadCategories(){this.setState({loading:!0}),Object(b.c)().then(e=>{this.setState({categories:e,loading:!1,error:null})}).catch(async e=>{const t=await Object(d.a)(e);this.setState({categories:[],loading:!1,error:t})})}render(){const{error:t,loading:c,categories:r}=this.state;return Object(n.createElement)(e,o()({},this.props,{error:t,isLoading:c,categories:r}))}},"withCategories"),m=c(32),p=c(4),h=c.n(p);c(89);const O=e=>{let{categories:t,error:c,isLoading:r,onChange:u,onOperatorChange:b,operator:d,selected:g,isCompact:p,isSingle:O,showReviewCount:E}=e;const j={clear:Object(l.__)("Clear all product categories","woo-gutenberg-products-block"),list:Object(l.__)("Product Categories","woo-gutenberg-products-block"),noItems:Object(l.__)("Your store doesn't have any product categories.","woo-gutenberg-products-block"),search:Object(l.__)("Search for product categories","woo-gutenberg-products-block"),selected:e=>Object(l.sprintf)( +/* translators: %d is the count of selected categories. */ +Object(l._n)("%d category selected","%d categories selected",e,"woo-gutenberg-products-block"),e),updated:Object(l.__)("Category search results updated.","woo-gutenberg-products-block")};return c?Object(n.createElement)(m.a,{error:c}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(s.a,{className:"woocommerce-product-categories",list:t,isLoading:r,selected:g.map(e=>t.find(t=>t.id===e)).filter(Boolean),onChange:u,renderItem:e=>{const{item:t,search:c,depth:r=0}=e,s=t.breadcrumbs.length?`${t.breadcrumbs.join(", ")}, ${t.name}`:t.name,i=E?Object(l.sprintf)( +/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */ +Object(l._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,"woo-gutenberg-products-block"),s,t.review_count):Object(l.sprintf)( +/* translators: %1$s is the item name, %2$d is the count of products for the item. */ +Object(l._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,"woo-gutenberg-products-block"),s,t.count),u=E?Object(l.sprintf)( +/* translators: %d is the count of reviews. */ +Object(l._n)("%d review","%d reviews",t.review_count,"woo-gutenberg-products-block"),t.review_count):Object(l.sprintf)( +/* translators: %d is the count of products. */ +Object(l._n)("%d product","%d products",t.count,"woo-gutenberg-products-block"),t.count);return Object(n.createElement)(a.a,o()({className:h()("woocommerce-product-categories__item","has-count",{"is-searching":c.length>0,"is-skip-level":0===r&&0!==t.parent})},e,{countLabel:u,"aria-label":i}))},messages:j,isCompact:p,isHierarchical:!0,isSingle:O}),!!b&&Object(n.createElement)("div",{hidden:g.length<2},Object(n.createElement)(i.SelectControl,{className:"woocommerce-product-categories__operator",label:Object(l.__)("Display products matching","woo-gutenberg-products-block"),help:Object(l.__)("Pick at least two categories to use this setting.","woo-gutenberg-products-block"),value:d,onChange:b,options:[{label:Object(l.__)("Any selected categories","woo-gutenberg-products-block"),value:"any"},{label:Object(l.__)("All selected categories","woo-gutenberg-products-block"),value:"all"}]})))};O.defaultProps={operator:"any",isCompact:!1,isSingle:!1},t.a=g(O)},62:function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(3);t.a=e=>{let{onChange:t,settings:c}=e;const{image:l,button:a,price:s,rating:i,title:u}=c,b=!1!==l;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(n.ToggleControl,{label:Object(o.__)("Product image","woo-gutenberg-products-block"),help:b?Object(o.__)("Product image is visible.","woo-gutenberg-products-block"):Object(o.__)("Product image is hidden.","woo-gutenberg-products-block"),checked:b,onChange:()=>t({...c,image:!b})}),Object(r.createElement)(n.ToggleControl,{label:Object(o.__)("Product title","woo-gutenberg-products-block"),help:u?Object(o.__)("Product title is visible.","woo-gutenberg-products-block"):Object(o.__)("Product title is hidden.","woo-gutenberg-products-block"),checked:u,onChange:()=>t({...c,title:!u})}),Object(r.createElement)(n.ToggleControl,{label:Object(o.__)("Product price","woo-gutenberg-products-block"),help:s?Object(o.__)("Product price is visible.","woo-gutenberg-products-block"):Object(o.__)("Product price is hidden.","woo-gutenberg-products-block"),checked:s,onChange:()=>t({...c,price:!s})}),Object(r.createElement)(n.ToggleControl,{label:Object(o.__)("Product rating","woo-gutenberg-products-block"),help:i?Object(o.__)("Product rating is visible.","woo-gutenberg-products-block"):Object(o.__)("Product rating is hidden.","woo-gutenberg-products-block"),checked:i,onChange:()=>t({...c,rating:!i})}),Object(r.createElement)(n.ToggleControl,{label:Object(o.__)("Add to Cart button","woo-gutenberg-products-block"),help:a?Object(o.__)("Add to Cart button is visible.","woo-gutenberg-products-block"):Object(o.__)("Add to Cart button is hidden.","woo-gutenberg-products-block"),checked:a,onChange:()=>t({...c,button:!a})}))}},63:function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(7),l=c(3);t.a=e=>{let{columns:t,rows:c,setAttributes:a,alignButtons:s,minColumns:i=1,maxColumns:u=6,minRows:b=1,maxRows:d=6}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(l.RangeControl,{label:Object(o.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:e=>{const t=Object(n.clamp)(e,i,u);a({columns:Number.isNaN(t)?"":t})},min:i,max:u}),Object(r.createElement)(l.RangeControl,{label:Object(o.__)("Rows","woo-gutenberg-products-block"),value:c,onChange:e=>{const t=Object(n.clamp)(e,b,d);a({rows:Number.isNaN(t)?"":t})},min:b,max:d}),Object(r.createElement)(l.ToggleControl,{label:Object(o.__)("Align Last Block","woo-gutenberg-products-block"),help:s?Object(o.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(o.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:s,onChange:()=>a({alignButtons:!s})}))}},7:function(e,t){e.exports=window.lodash},74:function(e,t,c){"use strict";c.d(t,"b",(function(){return o}));var r=c(2);const o=["woocommerce/product-best-sellers","woocommerce/product-category","woocommerce/product-new","woocommerce/product-on-sale","woocommerce/product-top-rated"];t.a={columns:{type:"number",default:Object(r.getSetting)("default_columns",3)},rows:{type:"number",default:Object(r.getSetting)("default_rows",3)},alignButtons:{type:"boolean",default:!1},categories:{type:"array",default:[]},catOperator:{type:"string",default:"any"},contentVisibility:{type:"object",default:{image:!0,title:!0,price:!0,rating:!0,button:!0}},isPreview:{type:"boolean",default:!1},stockStatus:{type:"array",default:Object.keys(Object(r.getSetting)("stockStatusOptions",[]))}}},8:function(e,t){e.exports=window.wp.blocks},81:function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(2),l=c(3);const a=Object(n.getSetting)("hideOutOfStockItems",!1),s=Object(n.getSetting)("stockStatusOptions",{});t.a=e=>{let{value:t,setAttributes:c}=e;const{outofstock:n,...i}=s,u=a?i:s,b=Object.entries(u).map(e=>{let[t,c]=e;return{value:t,label:c}}).filter(e=>!!e.label),[d,g]=Object(r.useState)(t);Object(r.useEffect)(()=>{c({stockStatus:["",...d]})},[d,c]);const m=Object(r.useCallback)(e=>{const t=d.includes(e),c=d.filter(t=>t!==e);t||(c.push(e),c.sort()),g(c)},[d]);return Object(r.createElement)(r.Fragment,null,b.map(e=>{const t=d.includes(e.value)? +/* translators: %s stock status. */ +Object(o.__)('Stock status "%s" visible.',"woo-gutenberg-products-block"): +/* translators: %s stock status. */ +Object(o.__)('Stock status "%s" hidden.',"woo-gutenberg-products-block");return Object(r.createElement)(l.ToggleControl,{label:e.label,key:e.value,help:Object(o.sprintf)(t,e.label),checked:d.includes(e.value),onChange:()=>m(e.value)})}))}},89:function(e,t){},97:function(e,t,c){"use strict";c.d(t,"a",(function(){return y}));var r=c(6),o=c.n(r),n=c(0),l=c(1),a=c(3),s=c(113),i=c(498),u=c(4),b=c.n(u),d=c(10),g=c(19),m=c(36),p=c(497),h=c(13);const O=e=>{let{id:t,label:c,popoverContents:r,remove:o,screenReaderLabel:i,className:u=""}=e;const[g,m]=Object(n.useState)(!1),E=Object(d.useInstanceId)(O);if(i=i||c,!c)return null;c=Object(h.decodeEntities)(c);const j=b()("woocommerce-tag",u,{"has-remove":!!o}),w="woocommerce-tag__label-"+E,f=Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"screen-reader-text"},i),Object(n.createElement)("span",{"aria-hidden":"true"},c));return Object(n.createElement)("span",{className:j},r?Object(n.createElement)(a.Button,{className:"woocommerce-tag__text",id:w,onClick:()=>m(!0)},f):Object(n.createElement)("span",{className:"woocommerce-tag__text",id:w},f),r&&g&&Object(n.createElement)(a.Popover,{onClose:()=>m(!1)},r),o&&Object(n.createElement)(a.Button,{className:"woocommerce-tag__remove",onClick:o(t),label:Object(l.sprintf)(// Translators: %s label. +Object(l.__)("Remove %s","woo-gutenberg-products-block"),c),"aria-describedby":w},Object(n.createElement)(s.a,{icon:p.a,size:20,className:"clear-icon"})))};var E=O;const j=e=>Object(n.createElement)(m.b,e),w=e=>{const{list:t,selected:c,renderItem:r,depth:l=0,onSelect:a,instanceId:s,isSingle:i,search:u}=e;return t?Object(n.createElement)(n.Fragment,null,t.map(t=>{const b=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(n.createElement)(n.Fragment,{key:t.id},Object(n.createElement)("li",null,r({item:t,isSelected:b,onSelect:a,isSingle:i,search:u,depth:l,controlId:s})),Object(n.createElement)(w,o()({},e,{list:t.children,depth:l+1})))})):null},f=e=>{let{isLoading:t,isSingle:c,selected:r,messages:o,onChange:s,onRemove:i}=e;if(t||c||!r)return null;const u=r.length;return Object(n.createElement)("div",{className:"woocommerce-search-list__selected"},Object(n.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(n.createElement)("strong",null,o.selected(u)),u>0?Object(n.createElement)(a.Button,{isLink:!0,isDestructive:!0,onClick:()=>s([]),"aria-label":o.clear},Object(l.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(n.createElement)("ul",null,r.map((e,t)=>Object(n.createElement)("li",{key:t},Object(n.createElement)(E,{label:e.name,id:e.id,remove:i})))):null)},_=e=>{let{filteredList:t,search:c,onSelect:r,instanceId:o,...a}=e;const{messages:u,renderItem:b,selected:d,isSingle:g}=a,m=b||j;return 0===t.length?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(n.createElement)(s.a,{icon:i.a})),Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(l.sprintf)(u.noResults,c):u.noItems)):Object(n.createElement)("ul",{className:"woocommerce-search-list__list"},Object(n.createElement)(w,{list:t,selected:d,renderItem:m,onSelect:r,instanceId:o,isSingle:g,search:c}))},y=e=>{const{className:t="",isCompact:c,isHierarchical:r,isLoading:l,isSingle:s,list:i,messages:u=g.a,onChange:m,onSearch:p,selected:h,debouncedSpeak:O}=e,[E,j]=Object(n.useState)(""),w=Object(d.useInstanceId)(y),k=Object(n.useMemo)(()=>({...g.a,...u}),[u]),x=Object(n.useMemo)(()=>Object(g.c)(i,E,r),[i,E,r]);Object(n.useEffect)(()=>{O&&O(k.updated)},[O,k]),Object(n.useEffect)(()=>{"function"==typeof p&&p(E)},[E,p]);const v=Object(n.useCallback)(e=>()=>{s&&m([]);const t=h.findIndex(t=>{let{id:c}=t;return c===e});m([...h.slice(0,t),...h.slice(t+1)])},[s,h,m]),S=Object(n.useCallback)(e=>()=>{-1===h.findIndex(t=>{let{id:c}=t;return c===e.id})?m(s?[e]:[...h,e]):v(e.id)()},[s,v,m,h]);return Object(n.createElement)("div",{className:b()("woocommerce-search-list",t,{"is-compact":c})},Object(n.createElement)(f,o()({},e,{onRemove:v,messages:k})),Object(n.createElement)("div",{className:"woocommerce-search-list__search"},Object(n.createElement)(a.TextControl,{label:k.search,type:"search",value:E,onChange:e=>j(e)})),l?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(n.createElement)(a.Spinner,null)):Object(n.createElement)(_,o()({},e,{search:E,filteredList:x,messages:k,onSelect:S,instanceId:w})))};Object(a.withSpokenMessages)(y)},98:function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(3);t.a=e=>{let{value:t,setAttributes:c}=e;return Object(r.createElement)(n.SelectControl,{label:Object(o.__)("Order products by","woo-gutenberg-products-block"),value:t,options:[{label:Object(o.__)("Newness - newest first","woo-gutenberg-products-block"),value:"date"},{label:Object(o.__)("Price - low to high","woo-gutenberg-products-block"),value:"price_asc"},{label:Object(o.__)("Price - high to low","woo-gutenberg-products-block"),value:"price_desc"},{label:Object(o.__)("Rating - highest first","woo-gutenberg-products-block"),value:"rating"},{label:Object(o.__)("Sales - most first","woo-gutenberg-products-block"),value:"popularity"},{label:Object(o.__)("Title - alphabetical","woo-gutenberg-products-block"),value:"title"},{label:Object(o.__)("Menu Order","woo-gutenberg-products-block"),value:"menu_order"}],onChange:e=>c({orderby:e})})}}}); \ No newline at end of file diff --git a/build/product-category/block.json b/build/product-category/block.json new file mode 100644 index 00000000000..1aa2d8d01bd --- /dev/null +++ b/build/product-category/block.json @@ -0,0 +1,97 @@ +{ + "name": "woocommerce/product-category", + "title": "Products by Category", + "category": "woocommerce", + "keywords": [ "WooCommerce" ], + "description": "Display a grid of products from your selected categories.", + "supports": { + "align": [ "wide", "full" ], + "html": false + }, + "example": { + "attributes": { + "isPreview": true + } + }, + "attributes": { + "columns": { + "type": "number", + "default": 3 + }, + "rows": { + "type": "number", + "default": 3 + }, + "alignButtons": { + "type": "boolean", + "default": false + }, + "contentVisibility": { + "type": "object", + "default": { + "image": true, + "title": true, + "price": true, + "rating": true, + "button": true + }, + "properties": { + "image": { + "type": "boolean", + "default": true + }, + "title": { + "type": "boolean", + "default": true + }, + "price": { + "type": "boolean", + "default": true + }, + "rating": { + "type": "boolean", + "default": true + }, + "button": { + "type": "boolean", + "default": true + } + } + }, + "categories": { + "type": "array", + "default": [] + }, + "catOperator": { + "type": "string", + "default": "any" + }, + "isPreview": { + "type": "boolean", + "default": false + }, + "stockStatus": { + "type": "array" + }, + "editMode": { + "type": "boolean", + "default": true + }, + "orderby": { + "type": "string", + "enum": [ + "date", + "popularity", + "price_asc", + "price_desc", + "rating", + "title", + "menu_order" + ], + "default": "date" + } + }, + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2, + "$schema": "https://schemas.wp.org/trunk/block.json" +} diff --git a/build/product-image-frontend.js b/build/product-image-frontend.js new file mode 100644 index 00000000000..7af86aaa8be --- /dev/null +++ b/build/product-image-frontend.js @@ -0,0 +1,3 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[61,64],{121:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var c=n(45),a=n(18);const r=e=>Object(c.a)(e)?JSON.parse(e)||{}:Object(a.a)(e)?e:{}},18:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return a}));const c=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function a(e,t){return c(e)&&t in e}},200:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n(103);var c=n(48);const a=()=>c.m>1},22:function(e,t,n){"use strict";var c=n(0),a=n(4),r=n.n(a);t.a=e=>{let t,{label:n,screenReaderLabel:a,wrapperElement:s,wrapperProps:l={}}=e;const o=null!=n,i=null!=a;return!o&&i?(t=s||"span",l={...l,className:r()(l.className,"screen-reader-text")},Object(c.createElement)(t,l,a)):(t=s||c.Fragment,o&&i&&n!==a?Object(c.createElement)(t,l,Object(c.createElement)("span",{"aria-hidden":"true"},n),Object(c.createElement)("span",{className:"screen-reader-text"},a)):Object(c.createElement)(t,l,n))}},252:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var c=n(18),a=n(121);const r=e=>{const t=Object(c.a)(e)?e:{},n=Object(a.a)(t.style),r=Object(c.a)(n.typography)?n.typography:{};return{style:{fontSize:t.fontSize?`var(--wp--preset--font-size--${t.fontSize})`:r.fontSize,lineHeight:r.lineHeight,fontWeight:r.fontWeight,textTransform:r.textTransform,fontFamily:t.fontFamily}}}},254:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var c=n(114),a=n(200),r=n(18),s=n(121);const l=e=>{if(!Object(a.a)())return{className:"",style:{}};const t=Object(r.a)(e)?e:{},n=Object(s.a)(t.style);return Object(c.__experimentalUseBorderProps)({...t,style:n})}},272:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var c=n(114),a=n(200),r=n(18),s=n(121);const l=e=>{if(!Object(a.a)())return{className:"",style:{}};const t=Object(r.a)(e)?e:{},n=Object(s.a)(t.style);return Object(c.__experimentalUseColorProps)({...t,style:n})}},301:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var c=n(114),a=n(200),r=n(18),s=n(121);const l=e=>{if(!Object(a.a)()||"function"!=typeof c.__experimentalGetSpacingClassesAndStyles)return{style:{}};const t=Object(r.a)(e)?e:{},n=Object(s.a)(t.style);return Object(c.__experimentalGetSpacingClassesAndStyles)({...t,style:n})}},305:function(e,t){},323:function(e,t,n){"use strict";n.r(t);var c=n(0),a=n(1),r=n(4),s=n.n(r),l=n(22),o=n(47),i=n(254),u=n(272),b=n(252),d=n(301),m=n(119);n(305),t.default=Object(m.withProductDataContext)(e=>{const{className:t,align:n}=e,{parentClassName:r}=Object(o.useInnerBlockLayoutContext)(),{product:m}=Object(o.useProductDataContext)(),p=Object(i.a)(e),O=Object(u.a)(e),j=Object(b.a)(e),f=Object(d.a)(e);if(!m.id||!m.on_sale)return null;const g="string"==typeof n?"wc-block-components-product-sale-badge--align-"+n:"";return Object(c.createElement)("div",{className:s()("wc-block-components-product-sale-badge",t,g,{[r+"__product-onsale"]:r},O.className,p.className),style:{...O.style,...p.style,...j.style,...f.style}},Object(c.createElement)(l.a,{label:Object(a.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(a.__)("Product on sale","woo-gutenberg-products-block")}))})},351:function(e,t){},446:function(e,t,n){"use strict";n.r(t);var c=n(119),a=n(12),r=n.n(a),s=n(0),l=n(1),o=n(4),i=n.n(o),u=n(2),b=n(47),d=n(252),m=n(254),p=n(301),O=n(59),j=n(323);n(351);const f=()=>Object(s.createElement)("img",{src:u.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500}),g=e=>{let{image:t,onLoad:n,loaded:c,showFullSize:a,fallbackAlt:l}=e;const{thumbnail:o,src:i,srcset:u,sizes:b,alt:d}=t||{},m={alt:d||l,onLoad:n,hidden:!c,src:o,...a&&{src:i,srcSet:u,sizes:b}};return Object(s.createElement)(s.Fragment,null,m.src&&Object(s.createElement)("img",r()({"data-testid":"product-image"},m)),!c&&Object(s.createElement)(f,null))};var y=Object(c.withProductDataContext)(e=>{const{className:t,imageSizing:n="full-size",showProductLink:c=!0,showSaleBadge:a,saleBadgeAlign:r="right"}=e,{parentClassName:o}=Object(b.useInnerBlockLayoutContext)(),{product:u}=Object(b.useProductDataContext)(),[y,h]=Object(s.useState)(!1),{dispatchStoreEvent:w}=Object(O.a)(),_=Object(d.a)(e),k=Object(m.a)(e),E=Object(p.a)(e);if(!u.id)return Object(s.createElement)("div",{className:i()(t,"wc-block-components-product-image",{[o+"__product-image"]:o},k.className),style:{..._.style,...k.style,...E.style}},Object(s.createElement)(f,null));const S=!!u.images.length,N=S?u.images[0]:null,v=c?"a":s.Fragment,x=Object(l.sprintf)( +/* translators: %s is referring to the product name */ +Object(l.__)("Link to %s","woo-gutenberg-products-block"),u.name),C={href:u.permalink,...!S&&{"aria-label":x},onClick:()=>{w("product-view-link",{product:u})}};return Object(s.createElement)("div",{className:i()(t,"wc-block-components-product-image",{[o+"__product-image"]:o},k.className),style:{..._.style,...k.style,...E.style}},Object(s.createElement)(v,c&&C,!!a&&Object(s.createElement)(j.default,{align:r,product:u}),Object(s.createElement)(g,{fallbackAlt:u.name,image:N,onLoad:()=>h(!0),loaded:y,showFullSize:"cropped"!==n})))});t.default=Object(c.withFilteredAttributes)({showProductLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}})(y)}}]); \ No newline at end of file diff --git a/build/product-image.js b/build/product-image.js new file mode 100644 index 00000000000..3950a949199 --- /dev/null +++ b/build/product-image.js @@ -0,0 +1,3 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[24,29],{216:function(e,t,a){"use strict";a.r(t);var c=a(0),n=a(1),l=a(4),s=a.n(l),r=a(28),o=a(29),u=a(219),i=a(138),d=a(123),b=a(215),m=a(58);a(330),t.default=Object(m.withProductDataContext)(e=>{const{className:t,align:a}=e,{parentClassName:l}=Object(o.useInnerBlockLayoutContext)(),{product:m}=Object(o.useProductDataContext)(),p=Object(u.a)(e),g=Object(i.a)(e),O=Object(d.a)(e),j=Object(b.a)(e);if(!m.id||!m.on_sale)return null;const f="string"==typeof a?"wc-block-components-product-sale-badge--align-"+a:"";return Object(c.createElement)("div",{className:s()("wc-block-components-product-sale-badge",t,f,{[l+"__product-onsale"]:l},g.className,p.className),style:{...g.style,...p.style,...O.style,...j.style}},Object(c.createElement)(r.a,{label:Object(n.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(n.__)("Product on sale","woo-gutenberg-products-block")}))})},219:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var c=a(5),n=a(95),l=a(35),s=a(150);const r=e=>{if(!Object(n.b)())return{className:"",style:{}};const t=Object(l.a)(e)?e:{},a=Object(s.a)(t.style);return Object(c.__experimentalUseBorderProps)({...t,style:a})}},28:function(e,t,a){"use strict";var c=a(0),n=a(4),l=a.n(n);t.a=e=>{let t,{label:a,screenReaderLabel:n,wrapperElement:s,wrapperProps:r={}}=e;const o=null!=a,u=null!=n;return!o&&u?(t=s||"span",r={...r,className:l()(r.className,"screen-reader-text")},Object(c.createElement)(t,r,n)):(t=s||c.Fragment,o&&u&&a!==n?Object(c.createElement)(t,r,Object(c.createElement)("span",{"aria-hidden":"true"},a),Object(c.createElement)("span",{className:"screen-reader-text"},n)):Object(c.createElement)(t,r,a))}},288:function(e,t,a){"use strict";t.a={showProductLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}}},289:function(e,t,a){"use strict";var c=a(6),n=a.n(c),l=a(0),s=a(1),r=a(4),o=a.n(r),u=a(2),i=a(29),d=a(123),b=a(219),m=a(215),p=a(58),g=a(78),O=a(216);a(332);const j=()=>Object(l.createElement)("img",{src:u.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500}),f=e=>{let{image:t,onLoad:a,loaded:c,showFullSize:s,fallbackAlt:r}=e;const{thumbnail:o,src:u,srcset:i,sizes:d,alt:b}=t||{},m={alt:b||r,onLoad:a,hidden:!c,src:o,...s&&{src:u,srcSet:i,sizes:d}};return Object(l.createElement)(l.Fragment,null,m.src&&Object(l.createElement)("img",n()({"data-testid":"product-image"},m)),!c&&Object(l.createElement)(j,null))};t.a=Object(p.withProductDataContext)(e=>{const{className:t,imageSizing:a="full-size",showProductLink:c=!0,showSaleBadge:n,saleBadgeAlign:r="right"}=e,{parentClassName:u}=Object(i.useInnerBlockLayoutContext)(),{product:p}=Object(i.useProductDataContext)(),[w,y]=Object(l.useState)(!1),{dispatchStoreEvent:h}=Object(g.a)(),k=Object(d.a)(e),E=Object(b.a)(e),_=Object(m.a)(e);if(!p.id)return Object(l.createElement)("div",{className:o()(t,"wc-block-components-product-image",{[u+"__product-image"]:u},E.className),style:{...k.style,...E.style,..._.style}},Object(l.createElement)(j,null));const N=!!p.images.length,L=N?p.images[0]:null,C=c?"a":l.Fragment,S=Object(s.sprintf)( +/* translators: %s is referring to the product name */ +Object(s.__)("Link to %s","woo-gutenberg-products-block"),p.name),v={href:p.permalink,...!N&&{"aria-label":S},onClick:()=>{h("product-view-link",{product:p})}};return Object(l.createElement)("div",{className:o()(t,"wc-block-components-product-image",{[u+"__product-image"]:u},E.className),style:{...k.style,...E.style,..._.style}},Object(l.createElement)(C,c&&v,!!n&&Object(l.createElement)(O.default,{align:r,product:p}),Object(l.createElement)(f,{fallbackAlt:p.name,image:L,onLoad:()=>y(!0),loaded:w,showFullSize:"cropped"!==a})))})},330:function(e,t){},332:function(e,t){},537:function(e,t,a){"use strict";a.r(t);var c=a(58),n=a(289),l=a(288);t.default=Object(c.withFilteredAttributes)(l.a)(n.a)}}]); \ No newline at end of file diff --git a/build/product-new.asset.php b/build/product-new.asset.php new file mode 100644 index 00000000000..d71c37ee186 --- /dev/null +++ b/build/product-new.asset.php @@ -0,0 +1 @@ + array('lodash', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render', 'wp-url'), 'version' => '081130d3fac77e24548cc7c3b12cc7d5'); \ No newline at end of file diff --git a/build/product-new.js b/build/product-new.js new file mode 100644 index 00000000000..8b4c41e10fc --- /dev/null +++ b/build/product-new.js @@ -0,0 +1,20 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-new"]=function(e){function t(t){for(var r,l,i=t[0],s=t[1],a=t[2],b=0,d=[];bObject(o.sprintf)( +/* translators: Number of items selected from list. */ +Object(o._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(o.__)("Search results updated.","woo-gutenberg-products-block")},i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(n.groupBy)(e,"parent"),r=Object(n.keyBy)(t,"id"),o=["0"],l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=l(r[e.parent]);return[...t,e.name]},i=e=>e.map(e=>{const t=c[e.id];return o.push(""+e.id),{...e,breadcrumbs:l(r[e.parent]),children:t&&t.length?i(t):[]}}),s=i(c[0]||[]);return Object.entries(c).forEach(e=>{let[t,c]=e;o.includes(t)||s.push(...i(c||[]))}),s},s=(e,t,c)=>{if(!t)return c?i(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),n=e.map(e=>!!r.test(e.name)&&e).filter(Boolean);return c?i(n,e):n},a=(e,t)=>{if(!t)return e;const c=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(c).map((e,t)=>c.test(e)?Object(r.createElement)("strong",{key:t},e):Object(r.createElement)(r.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},2:function(e,t){e.exports=window.wc.wcSettings},23:function(e,t,c){"use strict";c.d(t,"o",(function(){return o})),c.d(t,"m",(function(){return l})),c.d(t,"l",(function(){return i})),c.d(t,"n",(function(){return s})),c.d(t,"j",(function(){return a})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return b})),c.d(t,"g",(function(){return d})),c.d(t,"k",(function(){return g})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return p})),c.d(t,"h",(function(){return h})),c.d(t,"a",(function(){return E})),c.d(t,"i",(function(){return O})),c.d(t,"b",(function(){return w}));var r,n=c(2);const o=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),l=o.pluginUrl+"images/",i=o.pluginUrl+"build/",s=o.buildPhase,a=null===(r=n.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=n.STORE_PAGES.checkout.id,b=n.STORE_PAGES.checkout.permalink,d=n.STORE_PAGES.privacy.permalink,g=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),m=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),p=n.STORE_PAGES.cart.permalink,h=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),E=Object(n.getSetting)("allowedCountries",{}),O=Object(n.getSetting)("shippingStates",{}),w=Object(n.getSetting)("allowedStates",{})},25:function(e,t,c){"use strict";c.d(t,"h",(function(){return a})),c.d(t,"e",(function(){return u})),c.d(t,"b",(function(){return b})),c.d(t,"i",(function(){return d})),c.d(t,"f",(function(){return g})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return p})),c.d(t,"g",(function(){return h})),c.d(t,"a",(function(){return E}));var r=c(15),n=c(14),o=c.n(n),l=c(7),i=c(2),s=c(23);const a=e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const i=(e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const o=s.o.productCount>100,l={per_page:o?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},i=[Object(r.addQueryArgs)("/wc/store/v1/products",{...l,...n})];return o&&t.length&&i.push(Object(r.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),i})({selected:t,search:c,queryArgs:n});return Promise.all(i.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>o()({path:"/wc/store/v1/products/"+e}),b=()=>o()({path:"wc/store/v1/products/attributes"}),d=e=>o()({path:`wc/store/v1/products/attributes/${e}/terms`}),g=e=>{let{selected:t=[],search:c}=e;const n=(e=>{let{selected:t=[],search:c}=e;const n=Object(i.getSetting)("limitTags",!1),o=[Object(r.addQueryArgs)("wc/store/v1/products/tags",{per_page:n?100:0,orderby:n?"count":"name",order:n?"desc":"asc",search:c})];return n&&t.length&&o.push(Object(r.addQueryArgs)("wc/store/v1/products/tags",{include:t})),o})({selected:t,search:c});return Promise.all(n.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id"))},m=e=>o()({path:Object(r.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),p=e=>o()({path:"wc/store/v1/products/categories/"+e}),h=e=>o()({path:Object(r.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),E=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},27:function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return l}));var r=c(1),n=c(13);const o=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},l=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(n.decodeEntities)(e.message):Object(r.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},3:function(e,t){e.exports=window.wp.components},32:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(33);t.a=e=>{let{error:t}=e;return Object(r.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:c}=e;return t?"general"===c?Object(r.createElement)("span",null,Object(n.__)("The following error was returned","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(o.escapeHTML)(t))):"api"===c?Object(r.createElement)("span",null,Object(n.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(o.escapeHTML)(t))):t:Object(n.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},33:function(e,t){e.exports=window.wp.escapeHtml},356:function(e,t,c){e.exports=c(479)},36:function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var r=c(6),n=c.n(r),o=c(0),l=c(19);const i=e=>{let{countLabel:t,className:c,depth:r=0,controlId:i="",item:s,isSelected:a,isSingle:u,onSelect:b,search:d="",...g}=e;const m=null!=t&&void 0!==s.count&&null!==s.count,p=[c,"woocommerce-search-list__item"];p.push("depth-"+r),u&&p.push("is-radio-button"),m&&p.push("has-count");const h=s.breadcrumbs&&s.breadcrumbs.length,E=g.name||"search-list-item-"+i,O=`${E}-${s.id}`;return Object(o.createElement)("label",{htmlFor:O,className:p.join(" ")},u?Object(o.createElement)("input",n()({type:"radio",id:O,name:E,value:s.value,onChange:b(s),checked:a,className:"woocommerce-search-list__item-input"},g)):Object(o.createElement)("input",n()({type:"checkbox",id:O,name:E,value:s.value,onChange:b(s),checked:a,className:"woocommerce-search-list__item-input"},g)),Object(o.createElement)("span",{className:"woocommerce-search-list__item-label"},h?Object(o.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(l.b)(s.breadcrumbs)):null,Object(o.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(l.d)(s.name,d))),!!m&&Object(o.createElement)("span",{className:"woocommerce-search-list__item-count"},t||s.count))};t.b=i},479:function(e,t,c){"use strict";c.r(t);var r=c(0),n=c(1),o=c(8),l=c(7),i=c(113),s=c(502),a=c(3),u=c(5),b=c(55),d=c.n(b),g=c(62),m=c(63),p=c(56),h=c(81),E=c(141),O=c(2);class w extends r.Component{getInspectorControls(){const{attributes:e,setAttributes:t}=this.props,{categories:c,catOperator:o,columns:l,contentVisibility:i,rows:s,alignButtons:b,stockStatus:d}=e;return Object(r.createElement)(u.InspectorControls,{key:"inspector"},Object(r.createElement)(a.PanelBody,{title:Object(n.__)("Layout","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(m.a,{columns:l,rows:s,alignButtons:b,setAttributes:t,minColumns:Object(O.getSetting)("min_columns",1),maxColumns:Object(O.getSetting)("max_columns",6),minRows:Object(O.getSetting)("min_rows",1),maxRows:Object(O.getSetting)("max_rows",6)})),Object(r.createElement)(a.PanelBody,{title:Object(n.__)("Content","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(g.a,{settings:i,onChange:e=>t({contentVisibility:e})})),Object(r.createElement)(a.PanelBody,{title:Object(n.__)("Filter by stock status","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(h.a,{setAttributes:t,value:d})),Object(r.createElement)(a.PanelBody,{title:Object(n.__)("Filter by Product Category","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(p.a,{selected:c,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const c=e.map(e=>{let{id:t}=e;return t});t({categories:c})},operator:o,onOperatorChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return t({catOperator:e})}})))}render(){const{attributes:e,name:t}=this.props;return e.isPreview?E.a:Object(r.createElement)(r.Fragment,null,this.getInspectorControls(),Object(r.createElement)(a.Disabled,null,Object(r.createElement)(d.a,{block:t,attributes:e})))}}var j=w,f=c(74);Object(o.registerBlockType)("woocommerce/product-new",{title:Object(n.__)("Newest Products","woo-gutenberg-products-block"),icon:{src:Object(r.createElement)(i.a,{icon:s.a,className:"wc-block-editor-components-block-icon wc-block-editor-components-block-icon--sparkles"})},category:"woocommerce",keywords:[Object(n.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(n.__)("Display a grid of your newest products.","woo-gutenberg-products-block"),supports:{align:["wide","full"],html:!1},attributes:{...f.a},example:{attributes:{isPreview:!0}},transforms:{from:[{type:"block",blocks:Object(l.without)(f.b,"woocommerce/product-new"),transform:e=>Object(o.createBlock)("woocommerce/product-new",e)}]},edit:e=>Object(r.createElement)(j,e),save:()=>null})},5:function(e,t){e.exports=window.wp.blockEditor},55:function(e,t){e.exports=window.wp.serverSideRender},56:function(e,t,c){"use strict";var r=c(6),n=c.n(r),o=c(0),l=c(1),i=c(36),s=c(97),a=c(3),u=c(10),b=c(25),d=c(27),g=Object(u.createHigherOrderComponent)(e=>class extends o.Component{constructor(){super(...arguments),this.state={error:null,loading:!1,categories:[]},this.loadCategories=this.loadCategories.bind(this)}componentDidMount(){this.loadCategories()}loadCategories(){this.setState({loading:!0}),Object(b.c)().then(e=>{this.setState({categories:e,loading:!1,error:null})}).catch(async e=>{const t=await Object(d.a)(e);this.setState({categories:[],loading:!1,error:t})})}render(){const{error:t,loading:c,categories:r}=this.state;return Object(o.createElement)(e,n()({},this.props,{error:t,isLoading:c,categories:r}))}},"withCategories"),m=c(32),p=c(4),h=c.n(p);c(89);const E=e=>{let{categories:t,error:c,isLoading:r,onChange:u,onOperatorChange:b,operator:d,selected:g,isCompact:p,isSingle:E,showReviewCount:O}=e;const w={clear:Object(l.__)("Clear all product categories","woo-gutenberg-products-block"),list:Object(l.__)("Product Categories","woo-gutenberg-products-block"),noItems:Object(l.__)("Your store doesn't have any product categories.","woo-gutenberg-products-block"),search:Object(l.__)("Search for product categories","woo-gutenberg-products-block"),selected:e=>Object(l.sprintf)( +/* translators: %d is the count of selected categories. */ +Object(l._n)("%d category selected","%d categories selected",e,"woo-gutenberg-products-block"),e),updated:Object(l.__)("Category search results updated.","woo-gutenberg-products-block")};return c?Object(o.createElement)(m.a,{error:c}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(s.a,{className:"woocommerce-product-categories",list:t,isLoading:r,selected:g.map(e=>t.find(t=>t.id===e)).filter(Boolean),onChange:u,renderItem:e=>{const{item:t,search:c,depth:r=0}=e,s=t.breadcrumbs.length?`${t.breadcrumbs.join(", ")}, ${t.name}`:t.name,a=O?Object(l.sprintf)( +/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */ +Object(l._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,"woo-gutenberg-products-block"),s,t.review_count):Object(l.sprintf)( +/* translators: %1$s is the item name, %2$d is the count of products for the item. */ +Object(l._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,"woo-gutenberg-products-block"),s,t.count),u=O?Object(l.sprintf)( +/* translators: %d is the count of reviews. */ +Object(l._n)("%d review","%d reviews",t.review_count,"woo-gutenberg-products-block"),t.review_count):Object(l.sprintf)( +/* translators: %d is the count of products. */ +Object(l._n)("%d product","%d products",t.count,"woo-gutenberg-products-block"),t.count);return Object(o.createElement)(i.a,n()({className:h()("woocommerce-product-categories__item","has-count",{"is-searching":c.length>0,"is-skip-level":0===r&&0!==t.parent})},e,{countLabel:u,"aria-label":a}))},messages:w,isCompact:p,isHierarchical:!0,isSingle:E}),!!b&&Object(o.createElement)("div",{hidden:g.length<2},Object(o.createElement)(a.SelectControl,{className:"woocommerce-product-categories__operator",label:Object(l.__)("Display products matching","woo-gutenberg-products-block"),help:Object(l.__)("Pick at least two categories to use this setting.","woo-gutenberg-products-block"),value:d,onChange:b,options:[{label:Object(l.__)("Any selected categories","woo-gutenberg-products-block"),value:"any"},{label:Object(l.__)("All selected categories","woo-gutenberg-products-block"),value:"all"}]})))};E.defaultProps={operator:"any",isCompact:!1,isSingle:!1},t.a=g(E)},62:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(3);t.a=e=>{let{onChange:t,settings:c}=e;const{image:l,button:i,price:s,rating:a,title:u}=c,b=!1!==l;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product image","woo-gutenberg-products-block"),help:b?Object(n.__)("Product image is visible.","woo-gutenberg-products-block"):Object(n.__)("Product image is hidden.","woo-gutenberg-products-block"),checked:b,onChange:()=>t({...c,image:!b})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product title","woo-gutenberg-products-block"),help:u?Object(n.__)("Product title is visible.","woo-gutenberg-products-block"):Object(n.__)("Product title is hidden.","woo-gutenberg-products-block"),checked:u,onChange:()=>t({...c,title:!u})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product price","woo-gutenberg-products-block"),help:s?Object(n.__)("Product price is visible.","woo-gutenberg-products-block"):Object(n.__)("Product price is hidden.","woo-gutenberg-products-block"),checked:s,onChange:()=>t({...c,price:!s})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product rating","woo-gutenberg-products-block"),help:a?Object(n.__)("Product rating is visible.","woo-gutenberg-products-block"):Object(n.__)("Product rating is hidden.","woo-gutenberg-products-block"),checked:a,onChange:()=>t({...c,rating:!a})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Add to Cart button","woo-gutenberg-products-block"),help:i?Object(n.__)("Add to Cart button is visible.","woo-gutenberg-products-block"):Object(n.__)("Add to Cart button is hidden.","woo-gutenberg-products-block"),checked:i,onChange:()=>t({...c,button:!i})}))}},63:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(7),l=c(3);t.a=e=>{let{columns:t,rows:c,setAttributes:i,alignButtons:s,minColumns:a=1,maxColumns:u=6,minRows:b=1,maxRows:d=6}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(l.RangeControl,{label:Object(n.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:e=>{const t=Object(o.clamp)(e,a,u);i({columns:Number.isNaN(t)?"":t})},min:a,max:u}),Object(r.createElement)(l.RangeControl,{label:Object(n.__)("Rows","woo-gutenberg-products-block"),value:c,onChange:e=>{const t=Object(o.clamp)(e,b,d);i({rows:Number.isNaN(t)?"":t})},min:b,max:d}),Object(r.createElement)(l.ToggleControl,{label:Object(n.__)("Align Last Block","woo-gutenberg-products-block"),help:s?Object(n.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(n.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:s,onChange:()=>i({alignButtons:!s})}))}},7:function(e,t){e.exports=window.lodash},74:function(e,t,c){"use strict";c.d(t,"b",(function(){return n}));var r=c(2);const n=["woocommerce/product-best-sellers","woocommerce/product-category","woocommerce/product-new","woocommerce/product-on-sale","woocommerce/product-top-rated"];t.a={columns:{type:"number",default:Object(r.getSetting)("default_columns",3)},rows:{type:"number",default:Object(r.getSetting)("default_rows",3)},alignButtons:{type:"boolean",default:!1},categories:{type:"array",default:[]},catOperator:{type:"string",default:"any"},contentVisibility:{type:"object",default:{image:!0,title:!0,price:!0,rating:!0,button:!0}},isPreview:{type:"boolean",default:!1},stockStatus:{type:"array",default:Object.keys(Object(r.getSetting)("stockStatusOptions",[]))}}},8:function(e,t){e.exports=window.wp.blocks},81:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(2),l=c(3);const i=Object(o.getSetting)("hideOutOfStockItems",!1),s=Object(o.getSetting)("stockStatusOptions",{});t.a=e=>{let{value:t,setAttributes:c}=e;const{outofstock:o,...a}=s,u=i?a:s,b=Object.entries(u).map(e=>{let[t,c]=e;return{value:t,label:c}}).filter(e=>!!e.label),[d,g]=Object(r.useState)(t);Object(r.useEffect)(()=>{c({stockStatus:["",...d]})},[d,c]);const m=Object(r.useCallback)(e=>{const t=d.includes(e),c=d.filter(t=>t!==e);t||(c.push(e),c.sort()),g(c)},[d]);return Object(r.createElement)(r.Fragment,null,b.map(e=>{const t=d.includes(e.value)? +/* translators: %s stock status. */ +Object(n.__)('Stock status "%s" visible.',"woo-gutenberg-products-block"): +/* translators: %s stock status. */ +Object(n.__)('Stock status "%s" hidden.',"woo-gutenberg-products-block");return Object(r.createElement)(l.ToggleControl,{label:e.label,key:e.value,help:Object(n.sprintf)(t,e.label),checked:d.includes(e.value),onChange:()=>m(e.value)})}))}},89:function(e,t){},97:function(e,t,c){"use strict";c.d(t,"a",(function(){return y}));var r=c(6),n=c.n(r),o=c(0),l=c(1),i=c(3),s=c(113),a=c(498),u=c(4),b=c.n(u),d=c(10),g=c(19),m=c(36),p=c(497),h=c(13);const E=e=>{let{id:t,label:c,popoverContents:r,remove:n,screenReaderLabel:a,className:u=""}=e;const[g,m]=Object(o.useState)(!1),O=Object(d.useInstanceId)(E);if(a=a||c,!c)return null;c=Object(h.decodeEntities)(c);const w=b()("woocommerce-tag",u,{"has-remove":!!n}),j="woocommerce-tag__label-"+O,f=Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},a),Object(o.createElement)("span",{"aria-hidden":"true"},c));return Object(o.createElement)("span",{className:w},r?Object(o.createElement)(i.Button,{className:"woocommerce-tag__text",id:j,onClick:()=>m(!0)},f):Object(o.createElement)("span",{className:"woocommerce-tag__text",id:j},f),r&&g&&Object(o.createElement)(i.Popover,{onClose:()=>m(!1)},r),n&&Object(o.createElement)(i.Button,{className:"woocommerce-tag__remove",onClick:n(t),label:Object(l.sprintf)(// Translators: %s label. +Object(l.__)("Remove %s","woo-gutenberg-products-block"),c),"aria-describedby":j},Object(o.createElement)(s.a,{icon:p.a,size:20,className:"clear-icon"})))};var O=E;const w=e=>Object(o.createElement)(m.b,e),j=e=>{const{list:t,selected:c,renderItem:r,depth:l=0,onSelect:i,instanceId:s,isSingle:a,search:u}=e;return t?Object(o.createElement)(o.Fragment,null,t.map(t=>{const b=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(o.createElement)(o.Fragment,{key:t.id},Object(o.createElement)("li",null,r({item:t,isSelected:b,onSelect:i,isSingle:a,search:u,depth:l,controlId:s})),Object(o.createElement)(j,n()({},e,{list:t.children,depth:l+1})))})):null},f=e=>{let{isLoading:t,isSingle:c,selected:r,messages:n,onChange:s,onRemove:a}=e;if(t||c||!r)return null;const u=r.length;return Object(o.createElement)("div",{className:"woocommerce-search-list__selected"},Object(o.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(o.createElement)("strong",null,n.selected(u)),u>0?Object(o.createElement)(i.Button,{isLink:!0,isDestructive:!0,onClick:()=>s([]),"aria-label":n.clear},Object(l.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(o.createElement)("ul",null,r.map((e,t)=>Object(o.createElement)("li",{key:t},Object(o.createElement)(O,{label:e.name,id:e.id,remove:a})))):null)},_=e=>{let{filteredList:t,search:c,onSelect:r,instanceId:n,...i}=e;const{messages:u,renderItem:b,selected:d,isSingle:g}=i,m=b||w;return 0===t.length?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(o.createElement)(s.a,{icon:a.a})),Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(l.sprintf)(u.noResults,c):u.noItems)):Object(o.createElement)("ul",{className:"woocommerce-search-list__list"},Object(o.createElement)(j,{list:t,selected:d,renderItem:m,onSelect:r,instanceId:n,isSingle:g,search:c}))},y=e=>{const{className:t="",isCompact:c,isHierarchical:r,isLoading:l,isSingle:s,list:a,messages:u=g.a,onChange:m,onSearch:p,selected:h,debouncedSpeak:E}=e,[O,w]=Object(o.useState)(""),j=Object(d.useInstanceId)(y),x=Object(o.useMemo)(()=>({...g.a,...u}),[u]),k=Object(o.useMemo)(()=>Object(g.c)(a,O,r),[a,O,r]);Object(o.useEffect)(()=>{E&&E(x.updated)},[E,x]),Object(o.useEffect)(()=>{"function"==typeof p&&p(O)},[O,p]);const v=Object(o.useCallback)(e=>()=>{s&&m([]);const t=h.findIndex(t=>{let{id:c}=t;return c===e});m([...h.slice(0,t),...h.slice(t+1)])},[s,h,m]),S=Object(o.useCallback)(e=>()=>{-1===h.findIndex(t=>{let{id:c}=t;return c===e.id})?m(s?[e]:[...h,e]):v(e.id)()},[s,v,m,h]);return Object(o.createElement)("div",{className:b()("woocommerce-search-list",t,{"is-compact":c})},Object(o.createElement)(f,n()({},e,{onRemove:v,messages:x})),Object(o.createElement)("div",{className:"woocommerce-search-list__search"},Object(o.createElement)(i.TextControl,{label:x.search,type:"search",value:O,onChange:e=>w(e)})),l?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(o.createElement)(i.Spinner,null)):Object(o.createElement)(_,n()({},e,{search:O,filteredList:k,messages:x,onSelect:S,instanceId:j})))};Object(i.withSpokenMessages)(y)}}); \ No newline at end of file diff --git a/build/product-on-sale.asset.php b/build/product-on-sale.asset.php new file mode 100644 index 00000000000..4aa88f1fe7a --- /dev/null +++ b/build/product-on-sale.asset.php @@ -0,0 +1 @@ + array('lodash', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render', 'wp-url'), 'version' => 'c645e5f1392334209547cd03a6d71cc3'); \ No newline at end of file diff --git a/build/product-on-sale.js b/build/product-on-sale.js new file mode 100644 index 00000000000..a8c6789d375 --- /dev/null +++ b/build/product-on-sale.js @@ -0,0 +1,20 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-on-sale"]=function(e){function t(t){for(var r,l,s=t[0],a=t[1],i=t[2],b=0,d=[];bObject(o.sprintf)( +/* translators: Number of items selected from list. */ +Object(o._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(o.__)("Search results updated.","woo-gutenberg-products-block")},s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(n.groupBy)(e,"parent"),r=Object(n.keyBy)(t,"id"),o=["0"],l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=l(r[e.parent]);return[...t,e.name]},s=e=>e.map(e=>{const t=c[e.id];return o.push(""+e.id),{...e,breadcrumbs:l(r[e.parent]),children:t&&t.length?s(t):[]}}),a=s(c[0]||[]);return Object.entries(c).forEach(e=>{let[t,c]=e;o.includes(t)||a.push(...s(c||[]))}),a},a=(e,t,c)=>{if(!t)return c?s(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),n=e.map(e=>!!r.test(e.name)&&e).filter(Boolean);return c?s(n,e):n},i=(e,t)=>{if(!t)return e;const c=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(c).map((e,t)=>c.test(e)?Object(r.createElement)("strong",{key:t},e):Object(r.createElement)(r.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},2:function(e,t){e.exports=window.wc.wcSettings},23:function(e,t,c){"use strict";c.d(t,"o",(function(){return o})),c.d(t,"m",(function(){return l})),c.d(t,"l",(function(){return s})),c.d(t,"n",(function(){return a})),c.d(t,"j",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return b})),c.d(t,"g",(function(){return d})),c.d(t,"k",(function(){return g})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return p})),c.d(t,"h",(function(){return h})),c.d(t,"a",(function(){return O})),c.d(t,"i",(function(){return E})),c.d(t,"b",(function(){return j}));var r,n=c(2);const o=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),l=o.pluginUrl+"images/",s=o.pluginUrl+"build/",a=o.buildPhase,i=null===(r=n.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=n.STORE_PAGES.checkout.id,b=n.STORE_PAGES.checkout.permalink,d=n.STORE_PAGES.privacy.permalink,g=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),m=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),p=n.STORE_PAGES.cart.permalink,h=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),O=Object(n.getSetting)("allowedCountries",{}),E=Object(n.getSetting)("shippingStates",{}),j=Object(n.getSetting)("allowedStates",{})},25:function(e,t,c){"use strict";c.d(t,"h",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"b",(function(){return b})),c.d(t,"i",(function(){return d})),c.d(t,"f",(function(){return g})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return p})),c.d(t,"g",(function(){return h})),c.d(t,"a",(function(){return O}));var r=c(15),n=c(14),o=c.n(n),l=c(7),s=c(2),a=c(23);const i=e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const s=(e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const o=a.o.productCount>100,l={per_page:o?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},s=[Object(r.addQueryArgs)("/wc/store/v1/products",{...l,...n})];return o&&t.length&&s.push(Object(r.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),s})({selected:t,search:c,queryArgs:n});return Promise.all(s.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>o()({path:"/wc/store/v1/products/"+e}),b=()=>o()({path:"wc/store/v1/products/attributes"}),d=e=>o()({path:`wc/store/v1/products/attributes/${e}/terms`}),g=e=>{let{selected:t=[],search:c}=e;const n=(e=>{let{selected:t=[],search:c}=e;const n=Object(s.getSetting)("limitTags",!1),o=[Object(r.addQueryArgs)("wc/store/v1/products/tags",{per_page:n?100:0,orderby:n?"count":"name",order:n?"desc":"asc",search:c})];return n&&t.length&&o.push(Object(r.addQueryArgs)("wc/store/v1/products/tags",{include:t})),o})({selected:t,search:c});return Promise.all(n.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id"))},m=e=>o()({path:Object(r.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),p=e=>o()({path:"wc/store/v1/products/categories/"+e}),h=e=>o()({path:Object(r.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),O=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},27:function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return l}));var r=c(1),n=c(13);const o=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},l=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(n.decodeEntities)(e.message):Object(r.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},3:function(e,t){e.exports=window.wp.components},32:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(33);t.a=e=>{let{error:t}=e;return Object(r.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:c}=e;return t?"general"===c?Object(r.createElement)("span",null,Object(n.__)("The following error was returned","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(o.escapeHTML)(t))):"api"===c?Object(r.createElement)("span",null,Object(n.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(o.escapeHTML)(t))):t:Object(n.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},33:function(e,t){e.exports=window.wp.escapeHtml},357:function(e,t,c){e.exports=c(480)},358:function(e,t){},36:function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var r=c(6),n=c.n(r),o=c(0),l=c(19);const s=e=>{let{countLabel:t,className:c,depth:r=0,controlId:s="",item:a,isSelected:i,isSingle:u,onSelect:b,search:d="",...g}=e;const m=null!=t&&void 0!==a.count&&null!==a.count,p=[c,"woocommerce-search-list__item"];p.push("depth-"+r),u&&p.push("is-radio-button"),m&&p.push("has-count");const h=a.breadcrumbs&&a.breadcrumbs.length,O=g.name||"search-list-item-"+s,E=`${O}-${a.id}`;return Object(o.createElement)("label",{htmlFor:E,className:p.join(" ")},u?Object(o.createElement)("input",n()({type:"radio",id:E,name:O,value:a.value,onChange:b(a),checked:i,className:"woocommerce-search-list__item-input"},g)):Object(o.createElement)("input",n()({type:"checkbox",id:E,name:O,value:a.value,onChange:b(a),checked:i,className:"woocommerce-search-list__item-input"},g)),Object(o.createElement)("span",{className:"woocommerce-search-list__item-label"},h?Object(o.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(l.b)(a.breadcrumbs)):null,Object(o.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(l.d)(a.name,d))),!!m&&Object(o.createElement)("span",{className:"woocommerce-search-list__item-count"},t||a.count))};t.b=s},480:function(e,t,c){"use strict";c.r(t);var r=c(0),n=c(1),o=c(8),l=c(7),s=c(113),a=c(503),i=c(3),u=c(5),b=c(55),d=c.n(b),g=c(62),m=c(63),p=c(56),h=c(98),O=c(81),E=c(141),j=c(2);const w=()=>Object(r.createElement)(i.Placeholder,{icon:Object(r.createElement)(s.a,{icon:a.a}),label:Object(n.__)("On Sale Products","woo-gutenberg-products-block"),className:"wc-block-product-on-sale"},Object(n.__)("This block shows on-sale products. There are currently no discounted products in your store.","woo-gutenberg-products-block"));class f extends r.Component{getInspectorControls(){const{attributes:e,setAttributes:t}=this.props,{categories:c,catOperator:o,columns:l,contentVisibility:s,rows:a,orderby:b,alignButtons:d,stockStatus:E}=e;return Object(r.createElement)(u.InspectorControls,{key:"inspector"},Object(r.createElement)(i.PanelBody,{title:Object(n.__)("Layout","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(m.a,{columns:l,rows:a,alignButtons:d,setAttributes:t,minColumns:Object(j.getSetting)("min_columns",1),maxColumns:Object(j.getSetting)("max_columns",6),minRows:Object(j.getSetting)("min_rows",1),maxRows:Object(j.getSetting)("max_rows",6)})),Object(r.createElement)(i.PanelBody,{title:Object(n.__)("Content","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(g.a,{settings:s,onChange:e=>t({contentVisibility:e})})),Object(r.createElement)(i.PanelBody,{title:Object(n.__)("Order By","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(h.a,{setAttributes:t,value:b})),Object(r.createElement)(i.PanelBody,{title:Object(n.__)("Filter by Product Category","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(p.a,{selected:c,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const c=e.map(e=>{let{id:t}=e;return t});t({categories:c})},operator:o,onOperatorChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return t({catOperator:e})}})),Object(r.createElement)(i.PanelBody,{title:Object(n.__)("Filter by stock status","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(O.a,{setAttributes:t,value:E})))}render(){const{attributes:e,name:t}=this.props;return e.isPreview?E.a:Object(r.createElement)(r.Fragment,null,this.getInspectorControls(),Object(r.createElement)(i.Disabled,null,Object(r.createElement)(d.a,{block:t,attributes:e,EmptyResponsePlaceholder:w})))}}var _=f,y=(c(358),c(74));Object(o.registerBlockType)("woocommerce/product-on-sale",{title:Object(n.__)("On Sale Products","woo-gutenberg-products-block"),icon:{src:Object(r.createElement)(s.a,{icon:a.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(n.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(n.__)("Display a grid of products currently on sale.","woo-gutenberg-products-block"),supports:{align:["wide","full"],html:!1},attributes:{...y.a,orderby:{type:"string",default:"date"}},example:{attributes:{isPreview:!0}},transforms:{from:[{type:"block",blocks:Object(l.without)(y.b,"woocommerce/product-on-sale"),transform:e=>Object(o.createBlock)("woocommerce/product-on-sale",e)}]},edit:e=>Object(r.createElement)(_,e),save:()=>null})},5:function(e,t){e.exports=window.wp.blockEditor},55:function(e,t){e.exports=window.wp.serverSideRender},56:function(e,t,c){"use strict";var r=c(6),n=c.n(r),o=c(0),l=c(1),s=c(36),a=c(97),i=c(3),u=c(10),b=c(25),d=c(27),g=Object(u.createHigherOrderComponent)(e=>class extends o.Component{constructor(){super(...arguments),this.state={error:null,loading:!1,categories:[]},this.loadCategories=this.loadCategories.bind(this)}componentDidMount(){this.loadCategories()}loadCategories(){this.setState({loading:!0}),Object(b.c)().then(e=>{this.setState({categories:e,loading:!1,error:null})}).catch(async e=>{const t=await Object(d.a)(e);this.setState({categories:[],loading:!1,error:t})})}render(){const{error:t,loading:c,categories:r}=this.state;return Object(o.createElement)(e,n()({},this.props,{error:t,isLoading:c,categories:r}))}},"withCategories"),m=c(32),p=c(4),h=c.n(p);c(89);const O=e=>{let{categories:t,error:c,isLoading:r,onChange:u,onOperatorChange:b,operator:d,selected:g,isCompact:p,isSingle:O,showReviewCount:E}=e;const j={clear:Object(l.__)("Clear all product categories","woo-gutenberg-products-block"),list:Object(l.__)("Product Categories","woo-gutenberg-products-block"),noItems:Object(l.__)("Your store doesn't have any product categories.","woo-gutenberg-products-block"),search:Object(l.__)("Search for product categories","woo-gutenberg-products-block"),selected:e=>Object(l.sprintf)( +/* translators: %d is the count of selected categories. */ +Object(l._n)("%d category selected","%d categories selected",e,"woo-gutenberg-products-block"),e),updated:Object(l.__)("Category search results updated.","woo-gutenberg-products-block")};return c?Object(o.createElement)(m.a,{error:c}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.a,{className:"woocommerce-product-categories",list:t,isLoading:r,selected:g.map(e=>t.find(t=>t.id===e)).filter(Boolean),onChange:u,renderItem:e=>{const{item:t,search:c,depth:r=0}=e,a=t.breadcrumbs.length?`${t.breadcrumbs.join(", ")}, ${t.name}`:t.name,i=E?Object(l.sprintf)( +/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */ +Object(l._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,"woo-gutenberg-products-block"),a,t.review_count):Object(l.sprintf)( +/* translators: %1$s is the item name, %2$d is the count of products for the item. */ +Object(l._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,"woo-gutenberg-products-block"),a,t.count),u=E?Object(l.sprintf)( +/* translators: %d is the count of reviews. */ +Object(l._n)("%d review","%d reviews",t.review_count,"woo-gutenberg-products-block"),t.review_count):Object(l.sprintf)( +/* translators: %d is the count of products. */ +Object(l._n)("%d product","%d products",t.count,"woo-gutenberg-products-block"),t.count);return Object(o.createElement)(s.a,n()({className:h()("woocommerce-product-categories__item","has-count",{"is-searching":c.length>0,"is-skip-level":0===r&&0!==t.parent})},e,{countLabel:u,"aria-label":i}))},messages:j,isCompact:p,isHierarchical:!0,isSingle:O}),!!b&&Object(o.createElement)("div",{hidden:g.length<2},Object(o.createElement)(i.SelectControl,{className:"woocommerce-product-categories__operator",label:Object(l.__)("Display products matching","woo-gutenberg-products-block"),help:Object(l.__)("Pick at least two categories to use this setting.","woo-gutenberg-products-block"),value:d,onChange:b,options:[{label:Object(l.__)("Any selected categories","woo-gutenberg-products-block"),value:"any"},{label:Object(l.__)("All selected categories","woo-gutenberg-products-block"),value:"all"}]})))};O.defaultProps={operator:"any",isCompact:!1,isSingle:!1},t.a=g(O)},62:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(3);t.a=e=>{let{onChange:t,settings:c}=e;const{image:l,button:s,price:a,rating:i,title:u}=c,b=!1!==l;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product image","woo-gutenberg-products-block"),help:b?Object(n.__)("Product image is visible.","woo-gutenberg-products-block"):Object(n.__)("Product image is hidden.","woo-gutenberg-products-block"),checked:b,onChange:()=>t({...c,image:!b})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product title","woo-gutenberg-products-block"),help:u?Object(n.__)("Product title is visible.","woo-gutenberg-products-block"):Object(n.__)("Product title is hidden.","woo-gutenberg-products-block"),checked:u,onChange:()=>t({...c,title:!u})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product price","woo-gutenberg-products-block"),help:a?Object(n.__)("Product price is visible.","woo-gutenberg-products-block"):Object(n.__)("Product price is hidden.","woo-gutenberg-products-block"),checked:a,onChange:()=>t({...c,price:!a})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product rating","woo-gutenberg-products-block"),help:i?Object(n.__)("Product rating is visible.","woo-gutenberg-products-block"):Object(n.__)("Product rating is hidden.","woo-gutenberg-products-block"),checked:i,onChange:()=>t({...c,rating:!i})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Add to Cart button","woo-gutenberg-products-block"),help:s?Object(n.__)("Add to Cart button is visible.","woo-gutenberg-products-block"):Object(n.__)("Add to Cart button is hidden.","woo-gutenberg-products-block"),checked:s,onChange:()=>t({...c,button:!s})}))}},63:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(7),l=c(3);t.a=e=>{let{columns:t,rows:c,setAttributes:s,alignButtons:a,minColumns:i=1,maxColumns:u=6,minRows:b=1,maxRows:d=6}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(l.RangeControl,{label:Object(n.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:e=>{const t=Object(o.clamp)(e,i,u);s({columns:Number.isNaN(t)?"":t})},min:i,max:u}),Object(r.createElement)(l.RangeControl,{label:Object(n.__)("Rows","woo-gutenberg-products-block"),value:c,onChange:e=>{const t=Object(o.clamp)(e,b,d);s({rows:Number.isNaN(t)?"":t})},min:b,max:d}),Object(r.createElement)(l.ToggleControl,{label:Object(n.__)("Align Last Block","woo-gutenberg-products-block"),help:a?Object(n.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(n.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:a,onChange:()=>s({alignButtons:!a})}))}},7:function(e,t){e.exports=window.lodash},74:function(e,t,c){"use strict";c.d(t,"b",(function(){return n}));var r=c(2);const n=["woocommerce/product-best-sellers","woocommerce/product-category","woocommerce/product-new","woocommerce/product-on-sale","woocommerce/product-top-rated"];t.a={columns:{type:"number",default:Object(r.getSetting)("default_columns",3)},rows:{type:"number",default:Object(r.getSetting)("default_rows",3)},alignButtons:{type:"boolean",default:!1},categories:{type:"array",default:[]},catOperator:{type:"string",default:"any"},contentVisibility:{type:"object",default:{image:!0,title:!0,price:!0,rating:!0,button:!0}},isPreview:{type:"boolean",default:!1},stockStatus:{type:"array",default:Object.keys(Object(r.getSetting)("stockStatusOptions",[]))}}},8:function(e,t){e.exports=window.wp.blocks},81:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(2),l=c(3);const s=Object(o.getSetting)("hideOutOfStockItems",!1),a=Object(o.getSetting)("stockStatusOptions",{});t.a=e=>{let{value:t,setAttributes:c}=e;const{outofstock:o,...i}=a,u=s?i:a,b=Object.entries(u).map(e=>{let[t,c]=e;return{value:t,label:c}}).filter(e=>!!e.label),[d,g]=Object(r.useState)(t);Object(r.useEffect)(()=>{c({stockStatus:["",...d]})},[d,c]);const m=Object(r.useCallback)(e=>{const t=d.includes(e),c=d.filter(t=>t!==e);t||(c.push(e),c.sort()),g(c)},[d]);return Object(r.createElement)(r.Fragment,null,b.map(e=>{const t=d.includes(e.value)? +/* translators: %s stock status. */ +Object(n.__)('Stock status "%s" visible.',"woo-gutenberg-products-block"): +/* translators: %s stock status. */ +Object(n.__)('Stock status "%s" hidden.',"woo-gutenberg-products-block");return Object(r.createElement)(l.ToggleControl,{label:e.label,key:e.value,help:Object(n.sprintf)(t,e.label),checked:d.includes(e.value),onChange:()=>m(e.value)})}))}},89:function(e,t){},97:function(e,t,c){"use strict";c.d(t,"a",(function(){return y}));var r=c(6),n=c.n(r),o=c(0),l=c(1),s=c(3),a=c(113),i=c(498),u=c(4),b=c.n(u),d=c(10),g=c(19),m=c(36),p=c(497),h=c(13);const O=e=>{let{id:t,label:c,popoverContents:r,remove:n,screenReaderLabel:i,className:u=""}=e;const[g,m]=Object(o.useState)(!1),E=Object(d.useInstanceId)(O);if(i=i||c,!c)return null;c=Object(h.decodeEntities)(c);const j=b()("woocommerce-tag",u,{"has-remove":!!n}),w="woocommerce-tag__label-"+E,f=Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},i),Object(o.createElement)("span",{"aria-hidden":"true"},c));return Object(o.createElement)("span",{className:j},r?Object(o.createElement)(s.Button,{className:"woocommerce-tag__text",id:w,onClick:()=>m(!0)},f):Object(o.createElement)("span",{className:"woocommerce-tag__text",id:w},f),r&&g&&Object(o.createElement)(s.Popover,{onClose:()=>m(!1)},r),n&&Object(o.createElement)(s.Button,{className:"woocommerce-tag__remove",onClick:n(t),label:Object(l.sprintf)(// Translators: %s label. +Object(l.__)("Remove %s","woo-gutenberg-products-block"),c),"aria-describedby":w},Object(o.createElement)(a.a,{icon:p.a,size:20,className:"clear-icon"})))};var E=O;const j=e=>Object(o.createElement)(m.b,e),w=e=>{const{list:t,selected:c,renderItem:r,depth:l=0,onSelect:s,instanceId:a,isSingle:i,search:u}=e;return t?Object(o.createElement)(o.Fragment,null,t.map(t=>{const b=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(o.createElement)(o.Fragment,{key:t.id},Object(o.createElement)("li",null,r({item:t,isSelected:b,onSelect:s,isSingle:i,search:u,depth:l,controlId:a})),Object(o.createElement)(w,n()({},e,{list:t.children,depth:l+1})))})):null},f=e=>{let{isLoading:t,isSingle:c,selected:r,messages:n,onChange:a,onRemove:i}=e;if(t||c||!r)return null;const u=r.length;return Object(o.createElement)("div",{className:"woocommerce-search-list__selected"},Object(o.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(o.createElement)("strong",null,n.selected(u)),u>0?Object(o.createElement)(s.Button,{isLink:!0,isDestructive:!0,onClick:()=>a([]),"aria-label":n.clear},Object(l.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(o.createElement)("ul",null,r.map((e,t)=>Object(o.createElement)("li",{key:t},Object(o.createElement)(E,{label:e.name,id:e.id,remove:i})))):null)},_=e=>{let{filteredList:t,search:c,onSelect:r,instanceId:n,...s}=e;const{messages:u,renderItem:b,selected:d,isSingle:g}=s,m=b||j;return 0===t.length?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(o.createElement)(a.a,{icon:i.a})),Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(l.sprintf)(u.noResults,c):u.noItems)):Object(o.createElement)("ul",{className:"woocommerce-search-list__list"},Object(o.createElement)(w,{list:t,selected:d,renderItem:m,onSelect:r,instanceId:n,isSingle:g,search:c}))},y=e=>{const{className:t="",isCompact:c,isHierarchical:r,isLoading:l,isSingle:a,list:i,messages:u=g.a,onChange:m,onSearch:p,selected:h,debouncedSpeak:O}=e,[E,j]=Object(o.useState)(""),w=Object(d.useInstanceId)(y),k=Object(o.useMemo)(()=>({...g.a,...u}),[u]),x=Object(o.useMemo)(()=>Object(g.c)(i,E,r),[i,E,r]);Object(o.useEffect)(()=>{O&&O(k.updated)},[O,k]),Object(o.useEffect)(()=>{"function"==typeof p&&p(E)},[E,p]);const v=Object(o.useCallback)(e=>()=>{a&&m([]);const t=h.findIndex(t=>{let{id:c}=t;return c===e});m([...h.slice(0,t),...h.slice(t+1)])},[a,h,m]),S=Object(o.useCallback)(e=>()=>{-1===h.findIndex(t=>{let{id:c}=t;return c===e.id})?m(a?[e]:[...h,e]):v(e.id)()},[a,v,m,h]);return Object(o.createElement)("div",{className:b()("woocommerce-search-list",t,{"is-compact":c})},Object(o.createElement)(f,n()({},e,{onRemove:v,messages:k})),Object(o.createElement)("div",{className:"woocommerce-search-list__search"},Object(o.createElement)(s.TextControl,{label:k.search,type:"search",value:E,onChange:e=>j(e)})),l?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(o.createElement)(s.Spinner,null)):Object(o.createElement)(_,n()({},e,{search:E,filteredList:x,messages:k,onSelect:S,instanceId:w})))};Object(s.withSpokenMessages)(y)},98:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(3);t.a=e=>{let{value:t,setAttributes:c}=e;return Object(r.createElement)(o.SelectControl,{label:Object(n.__)("Order products by","woo-gutenberg-products-block"),value:t,options:[{label:Object(n.__)("Newness - newest first","woo-gutenberg-products-block"),value:"date"},{label:Object(n.__)("Price - low to high","woo-gutenberg-products-block"),value:"price_asc"},{label:Object(n.__)("Price - high to low","woo-gutenberg-products-block"),value:"price_desc"},{label:Object(n.__)("Rating - highest first","woo-gutenberg-products-block"),value:"rating"},{label:Object(n.__)("Sales - most first","woo-gutenberg-products-block"),value:"popularity"},{label:Object(n.__)("Title - alphabetical","woo-gutenberg-products-block"),value:"title"},{label:Object(n.__)("Menu Order","woo-gutenberg-products-block"),value:"menu_order"}],onChange:e=>c({orderby:e})})}}}); \ No newline at end of file diff --git a/build/product-price-frontend.js b/build/product-price-frontend.js new file mode 100644 index 00000000000..c39ffa9da97 --- /dev/null +++ b/build/product-price-frontend.js @@ -0,0 +1,3 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[62],{102:function(e,c,t){"use strict";var r=t(12),n=t.n(r),a=t(0),i=t(137),l=t(4),o=t.n(l);t(197);const s=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});c.a=e=>{let{className:c,value:t,currency:r,onValueChange:l,displayType:u="text",...p}=e;const m="string"==typeof t?parseInt(t,10):t;if(!Number.isFinite(m))return null;const b=m/10**r.minorUnit;if(!Number.isFinite(b))return null;const d=o()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",c),y={...p,...s(r),value:void 0,currency:void 0,onValueChange:void 0},f=l?e=>{const c=+e.value*10**r.minorUnit;l(c)}:()=>{};return Object(a.createElement)(i.a,n()({className:d,displayType:u},y,{value:b,onValueChange:f}))}},121:function(e,c,t){"use strict";t.d(c,"a",(function(){return a}));var r=t(45),n=t(18);const a=e=>Object(r.a)(e)?JSON.parse(e)||{}:Object(n.a)(e)?e:{}},18:function(e,c,t){"use strict";t.d(c,"a",(function(){return r})),t.d(c,"b",(function(){return n}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function n(e,c){return r(e)&&c in e}},197:function(e,c){},200:function(e,c,t){"use strict";t.d(c,"a",(function(){return n})),t(103);var r=t(48);const n=()=>r.m>1},252:function(e,c,t){"use strict";t.d(c,"a",(function(){return a}));var r=t(18),n=t(121);const a=e=>{const c=Object(r.a)(e)?e:{},t=Object(n.a)(c.style),a=Object(r.a)(t.typography)?t.typography:{};return{style:{fontSize:c.fontSize?`var(--wp--preset--font-size--${c.fontSize})`:a.fontSize,lineHeight:a.lineHeight,fontWeight:a.fontWeight,textTransform:a.textTransform,fontFamily:c.fontFamily}}}},272:function(e,c,t){"use strict";t.d(c,"a",(function(){return l}));var r=t(114),n=t(200),a=t(18),i=t(121);const l=e=>{if(!Object(n.a)())return{className:"",style:{}};const c=Object(a.a)(e)?e:{},t=Object(i.a)(c.style);return Object(r.__experimentalUseColorProps)({...c,style:t})}},286:function(e,c,t){"use strict";var r=t(0),n=t(1),a=t(102),i=t(4),l=t.n(i),o=t(41);t(287);const s=e=>{let{currency:c,maxPrice:t,minPrice:i,priceClassName:s,priceStyle:u={}}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(n.sprintf)( +/* translators: %1$s min price, %2$s max price */ +Object(n.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(o.formatPrice)(i),Object(o.formatPrice)(t))),Object(r.createElement)("span",{"aria-hidden":!0},Object(r.createElement)(a.a,{className:l()("wc-block-components-product-price__value",s),currency:c,value:i,style:u})," — ",Object(r.createElement)(a.a,{className:l()("wc-block-components-product-price__value",s),currency:c,value:t,style:u})))},u=e=>{let{currency:c,regularPriceClassName:t,regularPriceStyle:i,regularPrice:o,priceClassName:s,priceStyle:u,price:p}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(n.__)("Previous price:","woo-gutenberg-products-block")),Object(r.createElement)(a.a,{currency:c,renderText:e=>Object(r.createElement)("del",{className:l()("wc-block-components-product-price__regular",t),style:i},e),value:o}),Object(r.createElement)("span",{className:"screen-reader-text"},Object(n.__)("Discounted price:","woo-gutenberg-products-block")),Object(r.createElement)(a.a,{currency:c,renderText:e=>Object(r.createElement)("ins",{className:l()("wc-block-components-product-price__value","is-discounted",s),style:u},e),value:p}))};c.a=e=>{let{align:c,className:t,currency:n,format:i="",maxPrice:o,minPrice:p,price:m,priceClassName:b,priceStyle:d,regularPrice:y,regularPriceClassName:f,regularPriceStyle:O}=e;const g=l()(t,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+c]:c});i.includes("")||(i="",console.error("Price formats need to include the `` tag."));const j=y&&m!==y;let _=Object(r.createElement)("span",{className:l()("wc-block-components-product-price__value",b)});return j?_=Object(r.createElement)(u,{currency:n,price:m,priceClassName:b,priceStyle:d,regularPrice:y,regularPriceClassName:f,regularPriceStyle:O}):void 0!==p&&void 0!==o?_=Object(r.createElement)(s,{currency:n,maxPrice:o,minPrice:p,priceClassName:b,priceStyle:d}):m&&(_=Object(r.createElement)(a.a,{className:l()("wc-block-components-product-price__value",b),currency:n,value:m,style:d})),Object(r.createElement)("span",{className:g},Object(r.createInterpolateElement)(i,{price:_}))}},287:function(e,c){},402:function(e,c,t){"use strict";t.r(c);var r=t(0),n=t(4),a=t.n(n),i=t(286),l=t(41),o=t(47),s=t(272),u=t(252),p=t(119);c.default=Object(p.withProductDataContext)(e=>{var c,t;const{className:n,textAlign:p}=e,{parentClassName:m}=Object(o.useInnerBlockLayoutContext)(),{product:b}=Object(o.useProductDataContext)(),d=Object(s.a)(e),y=Object(u.a)(e),f=a()("wc-block-components-product-price",n,d.className,{[m+"__product-price"]:m}),O={...y.style,...d.style};if(!b.id)return Object(r.createElement)(i.a,{align:p,className:f});const g=b.prices,j=Object(l.getCurrencyFromPriceResponse)(g),_=g.price!==g.regular_price,v=a()({[m+"__product-price__value"]:m,[m+"__product-price__value--on-sale"]:_});return Object(r.createElement)(i.a,{align:p,className:f,priceStyle:O,regularPriceStyle:O,priceClassName:v,currency:j,price:g.price,minPrice:null==g||null===(c=g.price_range)||void 0===c?void 0:c.min_amount,maxPrice:null==g||null===(t=g.price_range)||void 0===t?void 0:t.max_amount,regularPrice:g.regular_price,regularPriceClassName:a()({[m+"__product-price__regular"]:m})})})}}]); \ No newline at end of file diff --git a/build/product-price.js b/build/product-price.js new file mode 100644 index 00000000000..975dc34aa34 --- /dev/null +++ b/build/product-price.js @@ -0,0 +1,3 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[27],{131:function(e,c){},152:function(e,c){},301:function(e,c,r){"use strict";r.r(c);var t=r(0),a=r(4),n=r.n(a),l=r(92),i=r(26),s=r(29),o=r(138),u=r(123),p=r(58);c.default=Object(p.withProductDataContext)(e=>{var c,r;const{className:a,textAlign:p}=e,{parentClassName:m}=Object(s.useInnerBlockLayoutContext)(),{product:d}=Object(s.useProductDataContext)(),b=Object(o.a)(e),y=Object(u.a)(e),g=n()("wc-block-components-product-price",a,b.className,{[m+"__product-price"]:m}),_={...y.style,...b.style};if(!d.id)return Object(t.createElement)(l.a,{align:p,className:g});const j=d.prices,O=Object(i.getCurrencyFromPriceResponse)(j),N=j.price!==j.regular_price,v=n()({[m+"__product-price__value"]:m,[m+"__product-price__value--on-sale"]:N});return Object(t.createElement)(l.a,{align:p,className:g,priceStyle:_,regularPriceStyle:_,priceClassName:v,currency:O,price:j.price,minPrice:null==j||null===(c=j.price_range)||void 0===c?void 0:c.min_amount,maxPrice:null==j||null===(r=j.price_range)||void 0===r?void 0:r.max_amount,regularPrice:j.regular_price,regularPriceClassName:n()({[m+"__product-price__regular"]:m})})})},38:function(e,c,r){"use strict";var t=r(6),a=r.n(t),n=r(0),l=r(126),i=r(4),s=r.n(i);r(131);const o=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});c.a=e=>{let{className:c,value:r,currency:t,onValueChange:i,displayType:u="text",...p}=e;const m="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(m))return null;const d=m/10**t.minorUnit;if(!Number.isFinite(d))return null;const b=s()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",c),y={...p,...o(t),value:void 0,currency:void 0,onValueChange:void 0},g=i?e=>{const c=+e.value*10**t.minorUnit;i(c)}:()=>{};return Object(n.createElement)(l.a,a()({className:b,displayType:u},y,{value:d,onValueChange:g}))}},92:function(e,c,r){"use strict";var t=r(0),a=r(1),n=r(38),l=r(4),i=r.n(l),s=r(26);r(152);const o=e=>{let{currency:c,maxPrice:r,minPrice:l,priceClassName:o,priceStyle:u={}}=e;return Object(t.createElement)(t.Fragment,null,Object(t.createElement)("span",{className:"screen-reader-text"},Object(a.sprintf)( +/* translators: %1$s min price, %2$s max price */ +Object(a.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(s.formatPrice)(l),Object(s.formatPrice)(r))),Object(t.createElement)("span",{"aria-hidden":!0},Object(t.createElement)(n.a,{className:i()("wc-block-components-product-price__value",o),currency:c,value:l,style:u})," — ",Object(t.createElement)(n.a,{className:i()("wc-block-components-product-price__value",o),currency:c,value:r,style:u})))},u=e=>{let{currency:c,regularPriceClassName:r,regularPriceStyle:l,regularPrice:s,priceClassName:o,priceStyle:u,price:p}=e;return Object(t.createElement)(t.Fragment,null,Object(t.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:","woo-gutenberg-products-block")),Object(t.createElement)(n.a,{currency:c,renderText:e=>Object(t.createElement)("del",{className:i()("wc-block-components-product-price__regular",r),style:l},e),value:s}),Object(t.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:","woo-gutenberg-products-block")),Object(t.createElement)(n.a,{currency:c,renderText:e=>Object(t.createElement)("ins",{className:i()("wc-block-components-product-price__value","is-discounted",o),style:u},e),value:p}))};c.a=e=>{let{align:c,className:r,currency:a,format:l="",maxPrice:s,minPrice:p,price:m,priceClassName:d,priceStyle:b,regularPrice:y,regularPriceClassName:g,regularPriceStyle:_}=e;const j=i()(r,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+c]:c});l.includes("")||(l="",console.error("Price formats need to include the `` tag."));const O=y&&m!==y;let N=Object(t.createElement)("span",{className:i()("wc-block-components-product-price__value",d)});return O?N=Object(t.createElement)(u,{currency:a,price:m,priceClassName:d,priceStyle:b,regularPrice:y,regularPriceClassName:g,regularPriceStyle:_}):void 0!==p&&void 0!==s?N=Object(t.createElement)(o,{currency:a,maxPrice:s,minPrice:p,priceClassName:d,priceStyle:b}):m&&(N=Object(t.createElement)(n.a,{className:i()("wc-block-components-product-price__value",d),currency:a,value:m,style:b})),Object(t.createElement)("span",{className:j},Object(t.createInterpolateElement)(l,{price:N}))}}}]); \ No newline at end of file diff --git a/build/product-rating-frontend.js b/build/product-rating-frontend.js new file mode 100644 index 00000000000..169aa313f7d --- /dev/null +++ b/build/product-rating-frontend.js @@ -0,0 +1,5 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[63],{121:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(45),s=n(18);const c=t=>Object(r.a)(t)?JSON.parse(t)||{}:Object(s.a)(t)?t:{}},18:function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return s}));const r=t=>!(t=>null===t)(t)&&t instanceof Object&&t.constructor===Object;function s(t,e){return r(t)&&e in t}},200:function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n(103);var r=n(48);const s=()=>r.m>1},252:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(18),s=n(121);const c=t=>{const e=Object(r.a)(t)?t:{},n=Object(s.a)(e.style),c=Object(r.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}}}},272:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(114),s=n(200),c=n(18),o=n(121);const a=t=>{if(!Object(s.a)())return{className:"",style:{}};const e=Object(c.a)(t)?t:{},n=Object(o.a)(e.style);return Object(r.__experimentalUseColorProps)({...e,style:n})}},301:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(114),s=n(200),c=n(18),o=n(121);const a=t=>{if(!Object(s.a)()||"function"!=typeof r.__experimentalGetSpacingClassesAndStyles)return{style:{}};const e=Object(c.a)(t)?t:{},n=Object(o.a)(e.style);return Object(r.__experimentalGetSpacingClassesAndStyles)({...e,style:n})}},353:function(t,e){},403:function(t,e,n){"use strict";n.r(e);var r=n(0),s=n(1),c=n(4),o=n.n(c),a=n(47),i=n(272),u=n(252),l=n(301),b=n(119);n(353);e.default=Object(b.withProductDataContext)(t=>{const{parentClassName:e}=Object(a.useInnerBlockLayoutContext)(),{product:n}=Object(a.useProductDataContext)(),c=(t=>{const e=parseFloat(t.average_rating);return Number.isFinite(e)&&e>0?e:0})(n),b=Object(i.a)(t),f=Object(u.a)(t),p=Object(l.a)(t);if(!c)return null;const d={width:c/5*100+"%"},O=Object(s.sprintf)( +/* translators: %f is referring to the average rating value */ +Object(s.__)("Rated %f out of 5","woo-gutenberg-products-block"),c),j=(t=>{const e=parseInt(t.review_count,10);return Number.isFinite(e)&&e>0?e:0})(n),g={__html:Object(s.sprintf)( +/* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */ +Object(s._n)("Rated %1$s out of 5 based on %2$s customer rating","Rated %1$s out of 5 based on %2$s customer ratings",j,"woo-gutenberg-products-block"),Object(s.sprintf)('%f',c),Object(s.sprintf)('%d',j))};return Object(r.createElement)("div",{className:o()(b.className,"wc-block-components-product-rating",{[e+"__product-rating"]:e}),style:{...b.style,...f.style,...p.style}},Object(r.createElement)("div",{className:o()("wc-block-components-product-rating__stars",e+"__product-rating__stars"),role:"img","aria-label":O},Object(r.createElement)("span",{style:d,dangerouslySetInnerHTML:g})))})}}]); \ No newline at end of file diff --git a/build/product-rating.js b/build/product-rating.js new file mode 100644 index 00000000000..298ccff62b6 --- /dev/null +++ b/build/product-rating.js @@ -0,0 +1,5 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[28],{302:function(t,e,n){"use strict";n.r(e);var s=n(0),c=n(1),r=n(4),a=n.n(r),o=n(29),u=n(138),i=n(123),l=n(215),b=n(58);n(333);e.default=Object(b.withProductDataContext)(t=>{const{parentClassName:e}=Object(o.useInnerBlockLayoutContext)(),{product:n}=Object(o.useProductDataContext)(),r=(t=>{const e=parseFloat(t.average_rating);return Number.isFinite(e)&&e>0?e:0})(n),b=Object(u.a)(t),p=Object(i.a)(t),d=Object(l.a)(t);if(!r)return null;const g={width:r/5*100+"%"},j=Object(c.sprintf)( +/* translators: %f is referring to the average rating value */ +Object(c.__)("Rated %f out of 5","woo-gutenberg-products-block"),r),m=(t=>{const e=parseInt(t.review_count,10);return Number.isFinite(e)&&e>0?e:0})(n),O={__html:Object(c.sprintf)( +/* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */ +Object(c._n)("Rated %1$s out of 5 based on %2$s customer rating","Rated %1$s out of 5 based on %2$s customer ratings",m,"woo-gutenberg-products-block"),Object(c.sprintf)('%f',r),Object(c.sprintf)('%d',m))};return Object(s.createElement)("div",{className:a()(b.className,"wc-block-components-product-rating",{[e+"__product-rating"]:e}),style:{...b.style,...p.style,...d.style}},Object(s.createElement)("div",{className:a()("wc-block-components-product-rating__stars",e+"__product-rating__stars"),role:"img","aria-label":j},Object(s.createElement)("span",{style:g,dangerouslySetInnerHTML:O})))})},333:function(t,e){}}]); \ No newline at end of file diff --git a/build/product-sale-badge-frontend.js b/build/product-sale-badge-frontend.js new file mode 100644 index 00000000000..491013215a6 --- /dev/null +++ b/build/product-sale-badge-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[64],{121:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var c=n(45),r=n(18);const a=e=>Object(c.a)(e)?JSON.parse(e)||{}:Object(r.a)(e)?e:{}},18:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return r}));const c=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function r(e,t){return c(e)&&t in e}},200:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n(103);var c=n(48);const r=()=>c.m>1},22:function(e,t,n){"use strict";var c=n(0),r=n(4),a=n.n(r);t.a=e=>{let t,{label:n,screenReaderLabel:r,wrapperElement:s,wrapperProps:o={}}=e;const l=null!=n,u=null!=r;return!l&&u?(t=s||"span",o={...o,className:a()(o.className,"screen-reader-text")},Object(c.createElement)(t,o,r)):(t=s||c.Fragment,l&&u&&n!==r?Object(c.createElement)(t,o,Object(c.createElement)("span",{"aria-hidden":"true"},n),Object(c.createElement)("span",{className:"screen-reader-text"},r)):Object(c.createElement)(t,o,n))}},252:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var c=n(18),r=n(121);const a=e=>{const t=Object(c.a)(e)?e:{},n=Object(r.a)(t.style),a=Object(c.a)(n.typography)?n.typography:{};return{style:{fontSize:t.fontSize?`var(--wp--preset--font-size--${t.fontSize})`:a.fontSize,lineHeight:a.lineHeight,fontWeight:a.fontWeight,textTransform:a.textTransform,fontFamily:t.fontFamily}}}},254:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var c=n(114),r=n(200),a=n(18),s=n(121);const o=e=>{if(!Object(r.a)())return{className:"",style:{}};const t=Object(a.a)(e)?e:{},n=Object(s.a)(t.style);return Object(c.__experimentalUseBorderProps)({...t,style:n})}},272:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var c=n(114),r=n(200),a=n(18),s=n(121);const o=e=>{if(!Object(r.a)())return{className:"",style:{}};const t=Object(a.a)(e)?e:{},n=Object(s.a)(t.style);return Object(c.__experimentalUseColorProps)({...t,style:n})}},301:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var c=n(114),r=n(200),a=n(18),s=n(121);const o=e=>{if(!Object(r.a)()||"function"!=typeof c.__experimentalGetSpacingClassesAndStyles)return{style:{}};const t=Object(a.a)(e)?e:{},n=Object(s.a)(t.style);return Object(c.__experimentalGetSpacingClassesAndStyles)({...t,style:n})}},305:function(e,t){},323:function(e,t,n){"use strict";n.r(t);var c=n(0),r=n(1),a=n(4),s=n.n(a),o=n(22),l=n(47),u=n(254),i=n(272),b=n(252),f=n(301),p=n(119);n(305),t.default=Object(p.withProductDataContext)(e=>{const{className:t,align:n}=e,{parentClassName:a}=Object(l.useInnerBlockLayoutContext)(),{product:p}=Object(l.useProductDataContext)(),O=Object(u.a)(e),j=Object(i.a)(e),d=Object(b.a)(e),m=Object(f.a)(e);if(!p.id||!p.on_sale)return null;const y="string"==typeof n?"wc-block-components-product-sale-badge--align-"+n:"";return Object(c.createElement)("div",{className:s()("wc-block-components-product-sale-badge",t,y,{[a+"__product-onsale"]:a},j.className,O.className),style:{...j.style,...O.style,...d.style,...m.style}},Object(c.createElement)(o.a,{label:Object(r.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(r.__)("Product on sale","woo-gutenberg-products-block")}))})}}]); \ No newline at end of file diff --git a/build/product-sale-badge.js b/build/product-sale-badge.js new file mode 100644 index 00000000000..2b5f309d3d6 --- /dev/null +++ b/build/product-sale-badge.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[29],{216:function(e,t,c){"use strict";c.r(t);var a=c(0),n=c(1),s=c(4),r=c.n(s),l=c(28),o=c(29),b=c(219),u=c(138),p=c(123),d=c(215),i=c(58);c(330),t.default=Object(i.withProductDataContext)(e=>{const{className:t,align:c}=e,{parentClassName:s}=Object(o.useInnerBlockLayoutContext)(),{product:i}=Object(o.useProductDataContext)(),m=Object(b.a)(e),j=Object(u.a)(e),O=Object(p.a)(e),w=Object(d.a)(e);if(!i.id||!i.on_sale)return null;const g="string"==typeof c?"wc-block-components-product-sale-badge--align-"+c:"";return Object(a.createElement)("div",{className:r()("wc-block-components-product-sale-badge",t,g,{[s+"__product-onsale"]:s},j.className,m.className),style:{...j.style,...m.style,...O.style,...w.style}},Object(a.createElement)(l.a,{label:Object(n.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(n.__)("Product on sale","woo-gutenberg-products-block")}))})},219:function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var a=c(5),n=c(95),s=c(35),r=c(150);const l=e=>{if(!Object(n.b)())return{className:"",style:{}};const t=Object(s.a)(e)?e:{},c=Object(r.a)(t.style);return Object(a.__experimentalUseBorderProps)({...t,style:c})}},28:function(e,t,c){"use strict";var a=c(0),n=c(4),s=c.n(n);t.a=e=>{let t,{label:c,screenReaderLabel:n,wrapperElement:r,wrapperProps:l={}}=e;const o=null!=c,b=null!=n;return!o&&b?(t=r||"span",l={...l,className:s()(l.className,"screen-reader-text")},Object(a.createElement)(t,l,n)):(t=r||a.Fragment,o&&b&&c!==n?Object(a.createElement)(t,l,Object(a.createElement)("span",{"aria-hidden":"true"},c),Object(a.createElement)("span",{className:"screen-reader-text"},n)):Object(a.createElement)(t,l,c))}},330:function(e,t){}}]); \ No newline at end of file diff --git a/build/product-search.asset.php b/build/product-search.asset.php new file mode 100644 index 00000000000..d66736a7cbe --- /dev/null +++ b/build/product-search.asset.php @@ -0,0 +1 @@ + array('wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '697463cfb3ca404ba49230d608e7f47c'); \ No newline at end of file diff --git a/build/product-search.js b/build/product-search.js new file mode 100644 index 00000000000..26b16ab8c07 --- /dev/null +++ b/build/product-search.js @@ -0,0 +1 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-search"]=function(e){function t(t){for(var o,a,n=t[0],s=t[1],b=t[2],u=0,d=[];u{let{attributes:{label:t,placeholder:c,formId:l,className:a,hasLabel:n,align:s}}=e;const u=b()("wc-block-product-search",s?"align"+s:"",a);return Object(o.createElement)("div",{className:u},Object(o.createElement)("form",{role:"search",method:"get",action:i.HOME_URL},Object(o.createElement)("label",{htmlFor:l,className:n?"wc-block-product-search__label":"wc-block-product-search__label screen-reader-text"},t),Object(o.createElement)("div",{className:"wc-block-product-search__fields"},Object(o.createElement)("input",{type:"search",id:l,className:"wc-block-product-search__field",placeholder:c,name:"s"}),Object(o.createElement)("input",{type:"hidden",name:"post_type",value:"product"}),Object(o.createElement)("button",{type:"submit",className:"wc-block-product-search__button",label:Object(r.__)("Search","woo-gutenberg-products-block")},Object(o.createElement)("svg",{"aria-hidden":"true",role:"img",focusable:"false",className:"dashicon dashicons-arrow-right-alt2",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20"},Object(o.createElement)("path",{d:"M6 15l5-5-5-5 1-2 7 7-7 7z"}))))))},d=c(5),p=c(3),w=c(10),h=Object(w.withInstanceId)(e=>{let{attributes:{label:t,placeholder:c,formId:l,className:a,hasLabel:n,align:s},instanceId:i,setAttributes:u}=e;const w=b()("wc-block-product-search",s?"align"+s:"",a);return Object(o.useEffect)(()=>{l||u({formId:"wc-block-product-search-"+i})},[l,u,i]),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(d.InspectorControls,{key:"inspector"},Object(o.createElement)(p.PanelBody,{title:Object(r.__)("Content","woo-gutenberg-products-block"),initialOpen:!0},Object(o.createElement)(p.ToggleControl,{label:Object(r.__)("Show search field label","woo-gutenberg-products-block"),help:n?Object(r.__)("Label is visible.","woo-gutenberg-products-block"):Object(r.__)("Label is hidden.","woo-gutenberg-products-block"),checked:n,onChange:()=>u({hasLabel:!n})}))),Object(o.createElement)("div",{className:w},!!n&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)("label",{className:"screen-reader-text",htmlFor:"wc-block-product-search__label"},Object(r.__)("Search Label","woo-gutenberg-products-block")),Object(o.createElement)(d.PlainText,{className:"wc-block-product-search__label",id:"wc-block-product-search__label",value:t,onChange:e=>u({label:e})})),Object(o.createElement)("div",{className:"wc-block-product-search__fields"},Object(o.createElement)(p.TextControl,{className:"wc-block-product-search__field input-control",value:c,placeholder:Object(r.__)("Enter search placeholder text","woo-gutenberg-products-block"),onChange:e=>u({placeholder:e})}),Object(o.createElement)("button",{type:"submit",className:"wc-block-product-search__button",label:Object(r.__)("Search","woo-gutenberg-products-block"),onClick:e=>e.preventDefault(),tabIndex:"-1"},Object(o.createElement)("svg",{"aria-hidden":"true",role:"img",focusable:"false",className:"dashicon dashicons-arrow-right-alt2",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20"},Object(o.createElement)("path",{d:"M6 15l5-5-5-5 1-2 7 7-7 7z"}))))))});const m={hasLabel:{type:"boolean",default:!0},label:{type:"string",default:Object(r.__)("Search","woo-gutenberg-products-block")},placeholder:{type:"string",default:Object(r.__)("Search products…","woo-gutenberg-products-block")},formId:{type:"string",default:""}};Object(l.registerBlockType)("woocommerce/product-search",{title:Object(r.__)("Product Search","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(a.a,{icon:n.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(r.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(r.__)("A search box to allow customers to search for products by keyword.","woo-gutenberg-products-block"),supports:{align:["wide","full"]},example:{attributes:{hasLabel:!0}},attributes:m,transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:c}=e;return"woocommerce_product_search"===t&&!(null==c||!c.raw)},transform:e=>{let{instance:t}=e;return Object(l.createBlock)("woocommerce/product-search",{label:""===t.raw.title?Object(r.__)("Search","woo-gutenberg-products-block"):t.raw.title})}}]},deprecated:[{attributes:m,save:e=>Object(o.createElement)("div",null,Object(o.createElement)(u,e))}],edit:h,save:()=>null})},5:function(e,t){e.exports=window.wp.blockEditor},8:function(e,t){e.exports=window.wp.blocks}}); \ No newline at end of file diff --git a/build/product-sku-frontend.js b/build/product-sku-frontend.js new file mode 100644 index 00000000000..21df808b41c --- /dev/null +++ b/build/product-sku-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[65],{357:function(t,e){},406:function(t,e,c){"use strict";c.r(e);var o=c(0),n=c(1),s=c(4),u=c.n(s),a=c(47),r=c(119);c(357),e.default=Object(r.withProductDataContext)(t=>{let{className:e}=t;const{parentClassName:c}=Object(a.useInnerBlockLayoutContext)(),{product:s}=Object(a.useProductDataContext)(),r=s.sku;return r?Object(o.createElement)("div",{className:u()(e,"wc-block-components-product-sku",{[c+"__product-sku"]:c})},Object(n.__)("SKU:","woo-gutenberg-products-block")," ",Object(o.createElement)("strong",null,r)):null})}}]); \ No newline at end of file diff --git a/build/product-sku.js b/build/product-sku.js new file mode 100644 index 00000000000..21743e4cf10 --- /dev/null +++ b/build/product-sku.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[31],{305:function(t,e,c){"use strict";c.r(e);var o=c(0),n=c(1),s=c(4),u=c.n(s),a=c(29),r=c(58);c(336),e.default=Object(r.withProductDataContext)(t=>{let{className:e}=t;const{parentClassName:c}=Object(a.useInnerBlockLayoutContext)(),{product:s}=Object(a.useProductDataContext)(),r=s.sku;return r?Object(o.createElement)("div",{className:u()(e,"wc-block-components-product-sku",{[c+"__product-sku"]:c})},Object(n.__)("SKU:","woo-gutenberg-products-block")," ",Object(o.createElement)("strong",null,r)):null})},336:function(t,e){}}]); \ No newline at end of file diff --git a/build/product-stock-indicator-frontend.js b/build/product-stock-indicator-frontend.js new file mode 100644 index 00000000000..153a9b15e2a --- /dev/null +++ b/build/product-stock-indicator-frontend.js @@ -0,0 +1,3 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[66],{121:function(t,o,c){"use strict";c.d(o,"a",(function(){return r}));var n=c(45),e=c(18);const r=t=>Object(n.a)(t)?JSON.parse(t)||{}:Object(e.a)(t)?t:{}},18:function(t,o,c){"use strict";c.d(o,"a",(function(){return n})),c.d(o,"b",(function(){return e}));const n=t=>!(t=>null===t)(t)&&t instanceof Object&&t.constructor===Object;function e(t,o){return n(t)&&o in t}},200:function(t,o,c){"use strict";c.d(o,"a",(function(){return e})),c(103);var n=c(48);const e=()=>n.m>1},252:function(t,o,c){"use strict";c.d(o,"a",(function(){return r}));var n=c(18),e=c(121);const r=t=>{const o=Object(n.a)(t)?t:{},c=Object(e.a)(o.style),r=Object(n.a)(c.typography)?c.typography:{};return{style:{fontSize:o.fontSize?`var(--wp--preset--font-size--${o.fontSize})`:r.fontSize,lineHeight:r.lineHeight,fontWeight:r.fontWeight,textTransform:r.textTransform,fontFamily:o.fontFamily}}}},272:function(t,o,c){"use strict";c.d(o,"a",(function(){return a}));var n=c(114),e=c(200),r=c(18),s=c(121);const a=t=>{if(!Object(e.a)())return{className:"",style:{}};const o=Object(r.a)(t)?t:{},c=Object(s.a)(o.style);return Object(n.__experimentalUseColorProps)({...o,style:c})}},360:function(t,o){},409:function(t,o,c){"use strict";c.r(o);var n=c(0),e=c(1),r=c(4),s=c.n(r),a=c(47),i=c(272),u=c(252),l=c(119);c(360);o.default=Object(l.withProductDataContext)(t=>{const{className:o}=t,{parentClassName:c}=Object(a.useInnerBlockLayoutContext)(),{product:r}=Object(a.useProductDataContext)(),l=Object(i.a)(t),b=Object(u.a)(t);if(!r.id||!r.is_purchasable)return null;const d=!!r.is_in_stock,f=r.low_stock_remaining,p=r.is_on_backorder;return Object(n.createElement)("div",{className:s()(o,l.className,"wc-block-components-product-stock-indicator",{[c+"__stock-indicator"]:c,"wc-block-components-product-stock-indicator--in-stock":d,"wc-block-components-product-stock-indicator--out-of-stock":!d,"wc-block-components-product-stock-indicator--low-stock":!!f,"wc-block-components-product-stock-indicator--available-on-backorder":!!p}),style:{...l.style,...b.style}},f?(t=>Object(e.sprintf)( +/* translators: %d stock amount (number of items in stock for product) */ +Object(e.__)("%d left in stock","woo-gutenberg-products-block"),t))(f):((t,o)=>o?Object(e.__)("Available on backorder","woo-gutenberg-products-block"):t?Object(e.__)("In Stock","woo-gutenberg-products-block"):Object(e.__)("Out of Stock","woo-gutenberg-products-block"))(d,p))})}}]); \ No newline at end of file diff --git a/build/product-stock-indicator.js b/build/product-stock-indicator.js new file mode 100644 index 00000000000..532dd14de15 --- /dev/null +++ b/build/product-stock-indicator.js @@ -0,0 +1,3 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[32],{308:function(o,c,t){"use strict";t.r(c);var e=t(0),n=t(1),s=t(4),r=t.n(s),a=t(29),b=t(138),i=t(123),k=t(58);t(339);c.default=Object(k.withProductDataContext)(o=>{const{className:c}=o,{parentClassName:t}=Object(a.useInnerBlockLayoutContext)(),{product:s}=Object(a.useProductDataContext)(),k=Object(b.a)(o),l=Object(i.a)(o);if(!s.id||!s.is_purchasable)return null;const u=!!s.is_in_stock,d=s.low_stock_remaining,p=s.is_on_backorder;return Object(e.createElement)("div",{className:r()(c,k.className,"wc-block-components-product-stock-indicator",{[t+"__stock-indicator"]:t,"wc-block-components-product-stock-indicator--in-stock":u,"wc-block-components-product-stock-indicator--out-of-stock":!u,"wc-block-components-product-stock-indicator--low-stock":!!d,"wc-block-components-product-stock-indicator--available-on-backorder":!!p}),style:{...k.style,...l.style}},d?(o=>Object(n.sprintf)( +/* translators: %d stock amount (number of items in stock for product) */ +Object(n.__)("%d left in stock","woo-gutenberg-products-block"),o))(d):((o,c)=>c?Object(n.__)("Available on backorder","woo-gutenberg-products-block"):o?Object(n.__)("In Stock","woo-gutenberg-products-block"):Object(n.__)("Out of Stock","woo-gutenberg-products-block"))(u,p))})},339:function(o,c){}}]); \ No newline at end of file diff --git a/build/product-summary-frontend.js b/build/product-summary-frontend.js new file mode 100644 index 00000000000..5dfc0926ea4 --- /dev/null +++ b/build/product-summary-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[67],{121:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var c=n(45),o=n(18);const s=t=>Object(c.a)(t)?JSON.parse(t)||{}:Object(o.a)(t)?t:{}},18:function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return o}));const c=t=>!(t=>null===t)(t)&&t instanceof Object&&t.constructor===Object;function o(t,e){return c(t)&&e in t}},200:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n(103);var c=n(48);const o=()=>c.m>1},252:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var c=n(18),o=n(121);const s=t=>{const e=Object(c.a)(t)?t:{},n=Object(o.a)(e.style),s=Object(c.a)(n.typography)?n.typography:{};return{style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:s.fontSize,lineHeight:s.lineHeight,fontWeight:s.fontWeight,textTransform:s.textTransform,fontFamily:e.fontFamily}}}},272:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var c=n(114),o=n(200),s=n(18),r=n(121);const a=t=>{if(!Object(o.a)())return{className:"",style:{}};const e=Object(s.a)(t)?t:{},n=Object(r.a)(e.style);return Object(c.__experimentalUseColorProps)({...e,style:n})}},295:function(t,e,n){"use strict";var c=n(0),o=n(115),s=n(116);const r=t=>{const e=t.indexOf("

");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),o=c.split(" ").splice(0,e).join(" ");return Object(s.autop)(u(o,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 o=a(t),r=o.slice(0,e);if(n)return Object(s.autop)(u(r,c));const i=r.match(/([\s]+)/g),l=i?i.length:0,p=o.slice(0,e+l);return Object(s.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(s.autop)(t),a=Object(o.count)(c,n);if(a<=e)return c;const u=r(c),p=Object(o.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)}},356:function(t,e){},405:function(t,e,n){"use strict";n.r(e);var c=n(0),o=n(4),s=n.n(o),r=n(295),a=n(48),u=n(47),i=n(272),l=n(252),p=n(119);n(356),e.default=Object(p.withProductDataContext)(t=>{const{className:e}=t,{parentClassName:n}=Object(u.useInnerBlockLayoutContext)(),{product:o}=Object(u.useProductDataContext)(),p=Object(i.a)(t),f=Object(l.a)(t);if(!o)return Object(c.createElement)("div",{className:s()(e,"wc-block-components-product-summary",{[n+"__product-summary"]:n})});const b=o.short_description?o.short_description:o.description;return b?Object(c.createElement)(r.a,{className:s()(e,p.className,"wc-block-components-product-summary",{[n+"__product-summary"]:n}),source:b,maxLength:150,countType:a.n.wordCountType||"words",style:{...p.style,...f.style}}):null})}}]); \ No newline at end of file diff --git a/build/product-summary.js b/build/product-summary.js new file mode 100644 index 00000000000..9c261db0eee --- /dev/null +++ b/build/product-summary.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[33],{117:function(t,e,c){"use strict";var n=c(0),o=c(87),s=c(60);const r=t=>{const e=t.indexOf("

");return-1===e?t:t.substr(0,e+4)},a=t=>t.replace(/<\/?[a-z][^>]*?>/gi,""),u=(t,e)=>t.replace(/[\s|\.\,]+$/i,"")+e,l=function(t,e){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…";const n=a(t),o=n.split(" ").splice(0,e).join(" ");return Object(s.autop)(u(o,c))},i=function(t,e){let c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…";const o=a(t),r=o.slice(0,e);if(c)return Object(s.autop)(u(r,n));const l=r.match(/([\s]+)/g),i=l?l.length:0,p=o.slice(0,e+i);return Object(s.autop)(u(p,n))};e.a=t=>{let{source:e,maxLength:c=15,countType:a="words",className:u="",style:p={}}=t;const d=Object(n.useMemo)(()=>function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const n=Object(s.autop)(t),a=Object(o.count)(n,c);if(a<=e)return n;const u=r(n),p=Object(o.count)(u,c);return p<=e?u:"words"===c?l(u,e):i(u,e,"characters_including_spaces"===c)}(e,c,a),[e,c,a]);return Object(n.createElement)(n.RawHTML,{style:p,className:u},d)}},304:function(t,e,c){"use strict";c.r(e);var n=c(0),o=c(4),s=c.n(o),r=c(117),a=c(23),u=c(29),l=c(138),i=c(123),p=c(58);c(335),e.default=Object(p.withProductDataContext)(t=>{const{className:e}=t,{parentClassName:c}=Object(u.useInnerBlockLayoutContext)(),{product:o}=Object(u.useProductDataContext)(),p=Object(l.a)(t),d=Object(i.a)(t);if(!o)return Object(n.createElement)("div",{className:s()(e,"wc-block-components-product-summary",{[c+"__product-summary"]:c})});const m=o.short_description?o.short_description:o.description;return m?Object(n.createElement)(r.a,{className:s()(e,p.className,"wc-block-components-product-summary",{[c+"__product-summary"]:c}),source:m,maxLength:150,countType:a.o.wordCountType||"words",style:{...p.style,...d.style}}):null})},335:function(t,e){}}]); \ No newline at end of file diff --git a/build/product-tag-list-frontend.js b/build/product-tag-list-frontend.js new file mode 100644 index 00000000000..7e6bac5f084 --- /dev/null +++ b/build/product-tag-list-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[68],{121:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var c=n(45),s=n(18);const o=t=>Object(c.a)(t)?JSON.parse(t)||{}:Object(s.a)(t)?t:{}},18: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}},200:function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n(103);var c=n(48);const s=()=>c.m>1},252:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var c=n(18),s=n(121);const o=t=>{const e=Object(c.a)(t)?t:{},n=Object(s.a)(e.style),o=Object(c.a)(n.typography)?n.typography:{};return{style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:o.fontSize,lineHeight:o.lineHeight,fontWeight:o.fontWeight,textTransform:o.textTransform,fontFamily:e.fontFamily}}}},272:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var c=n(114),s=n(200),o=n(18),r=n(121);const a=t=>{if(!Object(s.a)())return{className:"",style:{}};const e=Object(o.a)(t)?t:{},n=Object(r.a)(e.style);return Object(c.__experimentalUseColorProps)({...e,style:n})}},359:function(t,e){},408:function(t,e,n){"use strict";n.r(e);var c=n(0),s=n(1),o=n(4),r=n.n(o),a=n(47),u=n(272),i=n(252),l=n(3),b=n(119);n(359),e.default=Object(b.withProductDataContext)(t=>{const{className:e}=t,{parentClassName:n}=Object(a.useInnerBlockLayoutContext)(),{product:o}=Object(a.useProductDataContext)(),b=Object(u.a)(t),f=Object(i.a)(t);return Object(l.isEmpty)(o.tags)?null:Object(c.createElement)("div",{className:r()(e,b.className,"wc-block-components-product-tag-list",{[n+"__product-tag-list"]:n}),style:{...b.style,...f.style}},Object(s.__)("Tags:","woo-gutenberg-products-block")," ",Object(c.createElement)("ul",null,Object.values(o.tags).map(t=>{let{name:e,link:n,slug:s}=t;return Object(c.createElement)("li",{key:"tag-list-item-"+s},Object(c.createElement)("a",{href:n},e))})))})}}]); \ No newline at end of file diff --git a/build/product-tag-list.js b/build/product-tag-list.js new file mode 100644 index 00000000000..621a22c9651 --- /dev/null +++ b/build/product-tag-list.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[35],{307:function(t,e,c){"use strict";c.r(e);var a=c(0),s=c(1),l=c(4),n=c.n(l),o=c(29),u=c(138),r=c(123),b=c(7),i=c(58);c(338),e.default=Object(i.withProductDataContext)(t=>{const{className:e}=t,{parentClassName:c}=Object(o.useInnerBlockLayoutContext)(),{product:l}=Object(o.useProductDataContext)(),i=Object(u.a)(t),m=Object(r.a)(t);return Object(b.isEmpty)(l.tags)?null:Object(a.createElement)("div",{className:n()(e,i.className,"wc-block-components-product-tag-list",{[c+"__product-tag-list"]:c}),style:{...i.style,...m.style}},Object(s.__)("Tags:","woo-gutenberg-products-block")," ",Object(a.createElement)("ul",null,Object.values(l.tags).map(t=>{let{name:e,link:c,slug:s}=t;return Object(a.createElement)("li",{key:"tag-list-item-"+s},Object(a.createElement)("a",{href:c},e))})))})},338:function(t,e){}}]); \ No newline at end of file diff --git a/build/product-tag.asset.php b/build/product-tag.asset.php new file mode 100644 index 00000000000..b0abf347514 --- /dev/null +++ b/build/product-tag.asset.php @@ -0,0 +1 @@ + array('lodash', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render', 'wp-url'), 'version' => '6e6eabae192945ce711184a0cdc1b5a7'); \ No newline at end of file diff --git a/build/product-tag.js b/build/product-tag.js new file mode 100644 index 00000000000..ac19b1ac952 --- /dev/null +++ b/build/product-tag.js @@ -0,0 +1,14 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-tag"]=function(e){function t(t){for(var r,l,s=t[0],i=t[1],a=t[2],b=0,d=[];bObject(o.sprintf)( +/* translators: Number of items selected from list. */ +Object(o._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(o.__)("Search results updated.","woo-gutenberg-products-block")},s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(n.groupBy)(e,"parent"),r=Object(n.keyBy)(t,"id"),o=["0"],l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=l(r[e.parent]);return[...t,e.name]},s=e=>e.map(e=>{const t=c[e.id];return o.push(""+e.id),{...e,breadcrumbs:l(r[e.parent]),children:t&&t.length?s(t):[]}}),i=s(c[0]||[]);return Object.entries(c).forEach(e=>{let[t,c]=e;o.includes(t)||i.push(...s(c||[]))}),i},i=(e,t,c)=>{if(!t)return c?s(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),n=e.map(e=>!!r.test(e.name)&&e).filter(Boolean);return c?s(n,e):n},a=(e,t)=>{if(!t)return e;const c=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(c).map((e,t)=>c.test(e)?Object(r.createElement)("strong",{key:t},e):Object(r.createElement)(r.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},2:function(e,t){e.exports=window.wc.wcSettings},23:function(e,t,c){"use strict";c.d(t,"o",(function(){return o})),c.d(t,"m",(function(){return l})),c.d(t,"l",(function(){return s})),c.d(t,"n",(function(){return i})),c.d(t,"j",(function(){return a})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return b})),c.d(t,"g",(function(){return d})),c.d(t,"k",(function(){return g})),c.d(t,"c",(function(){return h})),c.d(t,"d",(function(){return m})),c.d(t,"h",(function(){return p})),c.d(t,"a",(function(){return E})),c.d(t,"i",(function(){return O})),c.d(t,"b",(function(){return j}));var r,n=c(2);const o=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),l=o.pluginUrl+"images/",s=o.pluginUrl+"build/",i=o.buildPhase,a=null===(r=n.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=n.STORE_PAGES.checkout.id,b=n.STORE_PAGES.checkout.permalink,d=n.STORE_PAGES.privacy.permalink,g=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),h=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),m=n.STORE_PAGES.cart.permalink,p=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),E=Object(n.getSetting)("allowedCountries",{}),O=Object(n.getSetting)("shippingStates",{}),j=Object(n.getSetting)("allowedStates",{})},25:function(e,t,c){"use strict";c.d(t,"h",(function(){return a})),c.d(t,"e",(function(){return u})),c.d(t,"b",(function(){return b})),c.d(t,"i",(function(){return d})),c.d(t,"f",(function(){return g})),c.d(t,"c",(function(){return h})),c.d(t,"d",(function(){return m})),c.d(t,"g",(function(){return p})),c.d(t,"a",(function(){return E}));var r=c(15),n=c(14),o=c.n(n),l=c(7),s=c(2),i=c(23);const a=e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const s=(e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const o=i.o.productCount>100,l={per_page:o?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},s=[Object(r.addQueryArgs)("/wc/store/v1/products",{...l,...n})];return o&&t.length&&s.push(Object(r.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),s})({selected:t,search:c,queryArgs:n});return Promise.all(s.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>o()({path:"/wc/store/v1/products/"+e}),b=()=>o()({path:"wc/store/v1/products/attributes"}),d=e=>o()({path:`wc/store/v1/products/attributes/${e}/terms`}),g=e=>{let{selected:t=[],search:c}=e;const n=(e=>{let{selected:t=[],search:c}=e;const n=Object(s.getSetting)("limitTags",!1),o=[Object(r.addQueryArgs)("wc/store/v1/products/tags",{per_page:n?100:0,orderby:n?"count":"name",order:n?"desc":"asc",search:c})];return n&&t.length&&o.push(Object(r.addQueryArgs)("wc/store/v1/products/tags",{include:t})),o})({selected:t,search:c});return Promise.all(n.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id"))},h=e=>o()({path:Object(r.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),m=e=>o()({path:"wc/store/v1/products/categories/"+e}),p=e=>o()({path:Object(r.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),E=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},275:function(e){e.exports=JSON.parse('{"name":"woocommerce/product-tag","title":"Products by Tag","category":"woocommerce","keywords":["WooCommerce"],"description":"Display a grid of products with selected tags.","supports":{"align":["wide","full"],"html":false},"attributes":{"columns":{"type":"number","default":3},"rows":{"type":"number","default":3},"alignButtons":{"type":"boolean","default":false},"contentVisibility":{"type":"object","default":{"image":true,"title":true,"price":true,"rating":true,"button":true},"properties":{"image":{"type":"boolean","default":true},"title":{"type":"boolean","default":true},"price":{"type":"boolean","default":true},"rating":{"type":"boolean","default":true},"button":{"type":"boolean","default":true}}},"tags":{"type":"array","default":[]},"tagOperator":{"type":"string","default":"any"},"orderby":{"type":"string","default":"date"},"isPreview":{"type":"boolean","default":false},"stockStatus":{"type":"array"}},"example":{"attributes":{"isPreview":true}},"textdomain":"woo-gutenberg-products-block","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},3:function(e,t){e.exports=window.wp.components},300:function(e,t){},36:function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var r=c(6),n=c.n(r),o=c(0),l=c(19);const s=e=>{let{countLabel:t,className:c,depth:r=0,controlId:s="",item:i,isSelected:a,isSingle:u,onSelect:b,search:d="",...g}=e;const h=null!=t&&void 0!==i.count&&null!==i.count,m=[c,"woocommerce-search-list__item"];m.push("depth-"+r),u&&m.push("is-radio-button"),h&&m.push("has-count");const p=i.breadcrumbs&&i.breadcrumbs.length,E=g.name||"search-list-item-"+s,O=`${E}-${i.id}`;return Object(o.createElement)("label",{htmlFor:O,className:m.join(" ")},u?Object(o.createElement)("input",n()({type:"radio",id:O,name:E,value:i.value,onChange:b(i),checked:a,className:"woocommerce-search-list__item-input"},g)):Object(o.createElement)("input",n()({type:"checkbox",id:O,name:E,value:i.value,onChange:b(i),checked:a,className:"woocommerce-search-list__item-input"},g)),Object(o.createElement)("span",{className:"woocommerce-search-list__item-label"},p?Object(o.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(l.b)(i.breadcrumbs)):null,Object(o.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(l.d)(i.name,d))),!!h&&Object(o.createElement)("span",{className:"woocommerce-search-list__item-count"},t||i.count))};t.b=s},370:function(e,t,c){e.exports=c(471)},371:function(e,t){},471:function(e,t,c){"use strict";c.r(t);var r=c(0),n=c(8),o=c(2),l=c(113),s=c(508),i=(c(300),c(275)),a=c(5),u=c(1),b=c(55),d=c.n(b),g=c(3),h=c(62),m=c(63),p=c(6),E=c.n(p),O=c(7),j=c(36),w=c(97),f=c(4),_=c.n(f),y=c(25);c(371);class k extends r.Component{constructor(){super(...arguments),this.state={list:[],loading:!0},this.renderItem=this.renderItem.bind(this),this.debouncedOnSearch=Object(O.debounce)(this.onSearch.bind(this),400)}componentDidMount(){const{selected:e}=this.props;Object(y.f)({selected:e}).then(e=>{this.setState({list:e,loading:!1})}).catch(()=>{this.setState({list:[],loading:!1})})}onSearch(e){const{selected:t}=this.props;this.setState({loading:!0}),Object(y.f)({selected:t,search:e}).then(e=>{this.setState({list:e,loading:!1})}).catch(()=>{this.setState({list:[],loading:!1})})}renderItem(e){const{item:t,search:c,depth:n=0}=e,o=t.breadcrumbs.length?`${t.breadcrumbs.join(", ")}, ${t.name}`:t.name;return Object(r.createElement)(j.a,E()({className:_()("woocommerce-product-tags__item","has-count",{"is-searching":c.length>0,"is-skip-level":0===n&&0!==t.parent})},e,{"aria-label":Object(u.sprintf)( +/* translators: %1$d is the count of products, %2$s is the name of the tag. */ +Object(u._n)("%1$d product tagged as %2$s","%1$d products tagged as %2$s",t.count,"woo-gutenberg-products-block"),t.count,o)}))}render(){const{list:e,loading:t}=this.state,{isCompact:c,onChange:n,onOperatorChange:l,operator:s,selected:i}=this.props,a={clear:Object(u.__)("Clear all product tags","woo-gutenberg-products-block"),list:Object(u.__)("Product Tags","woo-gutenberg-products-block"),noItems:Object(u.__)("Your store doesn't have any product tags.","woo-gutenberg-products-block"),search:Object(u.__)("Search for product tags","woo-gutenberg-products-block"),selected:e=>Object(u.sprintf)( +/* translators: %d is the count of selected tags. */ +Object(u._n)("%d tag selected","%d tags selected",e,"woo-gutenberg-products-block"),e),updated:Object(u.__)("Tag search results updated.","woo-gutenberg-products-block")},b=Object(o.getSetting)("limitTags",!1);return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(w.a,{className:"woocommerce-product-tags",list:e,isLoading:t,selected:i.map(t=>e.find(e=>e.id===t)).filter(Boolean),onChange:n,onSearch:b?this.debouncedOnSearch:null,renderItem:this.renderItem,messages:a,isCompact:c,isHierarchical:!0}),!!l&&Object(r.createElement)("div",{hidden:i.length<2},Object(r.createElement)(g.SelectControl,{className:"woocommerce-product-tags__operator",label:Object(u.__)("Display products matching","woo-gutenberg-products-block"),help:Object(u.__)("Pick at least two tags to use this setting.","woo-gutenberg-products-block"),value:s,onChange:l,options:[{label:Object(u.__)("Any selected tags","woo-gutenberg-products-block"),value:"any"},{label:Object(u.__)("All selected tags","woo-gutenberg-products-block"),value:"all"}]})))}}k.defaultProps={isCompact:!1,operator:"any"};var x=k,v=c(98),S=c(81),C=c(141);class P extends r.Component{constructor(){super(...arguments),this.state={changedAttributes:{},isEditing:!1},this.startEditing=this.startEditing.bind(this),this.stopEditing=this.stopEditing.bind(this),this.setChangedAttributes=this.setChangedAttributes.bind(this),this.save=this.save.bind(this)}componentDidMount(){const{attributes:e}=this.props;e.tags.length||this.setState({isEditing:!0})}startEditing(){this.setState({isEditing:!0,changedAttributes:{}})}stopEditing(){this.setState({isEditing:!1,changedAttributes:{}})}setChangedAttributes(e){this.setState(t=>({changedAttributes:{...t.changedAttributes,...e}}))}save(){const{changedAttributes:e}=this.state,{setAttributes:t}=this.props;t(e),this.stopEditing()}getInspectorControls(){const{attributes:e,setAttributes:t}=this.props,{isEditing:c}=this.state,{columns:n,tagOperator:l,contentVisibility:s,orderby:i,rows:b,alignButtons:d,stockStatus:p}=e;return Object(r.createElement)(a.InspectorControls,{key:"inspector"},Object(r.createElement)(g.PanelBody,{title:Object(u.__)("Product Tag","woo-gutenberg-products-block"),initialOpen:!e.tags.length&&!c},Object(r.createElement)(x,{selected:e.tags,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const c=e.map(e=>{let{id:t}=e;return t});t({tags:c})},operator:l,onOperatorChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return t({tagOperator:e})},isCompact:!0})),Object(r.createElement)(g.PanelBody,{title:Object(u.__)("Layout","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(m.a,{columns:n,rows:b,alignButtons:d,setAttributes:t,minColumns:Object(o.getSetting)("min_columns",1),maxColumns:Object(o.getSetting)("max_columns",6),minRows:Object(o.getSetting)("min_rows",1),maxRows:Object(o.getSetting)("max_rows",6)})),Object(r.createElement)(g.PanelBody,{title:Object(u.__)("Content","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(h.a,{settings:s,onChange:e=>t({contentVisibility:e})})),Object(r.createElement)(g.PanelBody,{title:Object(u.__)("Order By","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(v.a,{setAttributes:t,value:i})),Object(r.createElement)(g.PanelBody,{title:Object(u.__)("Filter by stock status","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(S.a,{setAttributes:t,value:p})))}renderEditMode(){var e=this;const{attributes:t,debouncedSpeak:c}=this.props,{changedAttributes:n}=this.state,o={...t,...n};return Object(r.createElement)(g.Placeholder,{icon:Object(r.createElement)(l.a,{icon:s.a,className:"block-editor-block-icon"}),label:Object(u.__)("Products by Tag","woo-gutenberg-products-block"),className:"wc-block-products-grid wc-block-product-tag"},Object(u.__)("Display a grid of products from your selected tags.","woo-gutenberg-products-block"),Object(r.createElement)("div",{className:"wc-block-product-tag__selection"},Object(r.createElement)(x,{selected:o.tags,onChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const c=t.map(e=>{let{id:t}=e;return t});e.setChangedAttributes({tags:c})},operator:o.tagOperator,onOperatorChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return e.setChangedAttributes({tagOperator:t})}}),Object(r.createElement)(g.Button,{isPrimary:!0,onClick:()=>{this.save(),c(Object(u.__)("Showing Products by Tag block preview.","woo-gutenberg-products-block"))}},Object(u.__)("Done","woo-gutenberg-products-block")),Object(r.createElement)(g.Button,{className:"wc-block-product-tag__cancel-button",isTertiary:!0,onClick:()=>{this.stopEditing(),c(Object(u.__)("Showing Products by Tag block preview.","woo-gutenberg-products-block"))}},Object(u.__)("Cancel","woo-gutenberg-products-block"))))}renderViewMode(){const{attributes:e,name:t}=this.props,c=e.tags.length;return Object(r.createElement)(g.Disabled,null,c?Object(r.createElement)(d.a,{block:t,attributes:e}):Object(r.createElement)(g.Placeholder,{icon:Object(r.createElement)(l.a,{icon:s.a,className:"block-editor-block-icon"}),label:Object(u.__)("Products by Tag","woo-gutenberg-products-block"),className:"wc-block-products-grid wc-block-product-tag"},Object(u.__)("This block displays products from selected tags. Select at least one tag to display its products.","woo-gutenberg-products-block")))}render(){const{isEditing:e}=this.state,{attributes:t}=this.props;return t.isPreview?C.a:Object(o.getSetting)("hasTags",!0)?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.BlockControls,null,Object(r.createElement)(g.ToolbarGroup,{controls:[{icon:"edit",title:Object(u.__)("Edit selected tags","woo-gutenberg-products-block"),onClick:()=>e?this.stopEditing():this.startEditing(),isActive:e}]})),this.getInspectorControls(),e?this.renderEditMode():this.renderViewMode()):Object(r.createElement)(g.Placeholder,{icon:Object(r.createElement)(l.a,{icon:s.a,className:"block-editor-block-icon"}),label:Object(u.__)("Products by Tag","woo-gutenberg-products-block"),className:"wc-block-products-grid wc-block-product-tag"},Object(u.__)("This block displays products from selected tags. In order to preview this you'll first need to create a product and assign it some tags.","woo-gutenberg-products-block"))}}var A=Object(g.withSpokenMessages)(P);Object(n.registerBlockType)(i,{icon:{src:Object(r.createElement)(l.a,{icon:s.a,className:"wc-block-editor-components-block-icon"})},attributes:{...i.attributes,columns:{type:"number",default:Object(o.getSetting)("default_columns",3)},rows:{type:"number",default:Object(o.getSetting)("default_rows",3)},tags:{type:"array",default:[]},stockStatus:{type:"array",default:Object.keys(Object(o.getSetting)("stockStatusOptions",[]))}},edit:e=>{const t=Object(a.useBlockProps)();return Object(r.createElement)("div",t,Object(r.createElement)(A,e))},save:()=>null})},5:function(e,t){e.exports=window.wp.blockEditor},55:function(e,t){e.exports=window.wp.serverSideRender},62:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(3);t.a=e=>{let{onChange:t,settings:c}=e;const{image:l,button:s,price:i,rating:a,title:u}=c,b=!1!==l;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product image","woo-gutenberg-products-block"),help:b?Object(n.__)("Product image is visible.","woo-gutenberg-products-block"):Object(n.__)("Product image is hidden.","woo-gutenberg-products-block"),checked:b,onChange:()=>t({...c,image:!b})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product title","woo-gutenberg-products-block"),help:u?Object(n.__)("Product title is visible.","woo-gutenberg-products-block"):Object(n.__)("Product title is hidden.","woo-gutenberg-products-block"),checked:u,onChange:()=>t({...c,title:!u})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product price","woo-gutenberg-products-block"),help:i?Object(n.__)("Product price is visible.","woo-gutenberg-products-block"):Object(n.__)("Product price is hidden.","woo-gutenberg-products-block"),checked:i,onChange:()=>t({...c,price:!i})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product rating","woo-gutenberg-products-block"),help:a?Object(n.__)("Product rating is visible.","woo-gutenberg-products-block"):Object(n.__)("Product rating is hidden.","woo-gutenberg-products-block"),checked:a,onChange:()=>t({...c,rating:!a})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Add to Cart button","woo-gutenberg-products-block"),help:s?Object(n.__)("Add to Cart button is visible.","woo-gutenberg-products-block"):Object(n.__)("Add to Cart button is hidden.","woo-gutenberg-products-block"),checked:s,onChange:()=>t({...c,button:!s})}))}},63:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(7),l=c(3);t.a=e=>{let{columns:t,rows:c,setAttributes:s,alignButtons:i,minColumns:a=1,maxColumns:u=6,minRows:b=1,maxRows:d=6}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(l.RangeControl,{label:Object(n.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:e=>{const t=Object(o.clamp)(e,a,u);s({columns:Number.isNaN(t)?"":t})},min:a,max:u}),Object(r.createElement)(l.RangeControl,{label:Object(n.__)("Rows","woo-gutenberg-products-block"),value:c,onChange:e=>{const t=Object(o.clamp)(e,b,d);s({rows:Number.isNaN(t)?"":t})},min:b,max:d}),Object(r.createElement)(l.ToggleControl,{label:Object(n.__)("Align Last Block","woo-gutenberg-products-block"),help:i?Object(n.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(n.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:i,onChange:()=>s({alignButtons:!i})}))}},7:function(e,t){e.exports=window.lodash},8:function(e,t){e.exports=window.wp.blocks},81:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(2),l=c(3);const s=Object(o.getSetting)("hideOutOfStockItems",!1),i=Object(o.getSetting)("stockStatusOptions",{});t.a=e=>{let{value:t,setAttributes:c}=e;const{outofstock:o,...a}=i,u=s?a:i,b=Object.entries(u).map(e=>{let[t,c]=e;return{value:t,label:c}}).filter(e=>!!e.label),[d,g]=Object(r.useState)(t);Object(r.useEffect)(()=>{c({stockStatus:["",...d]})},[d,c]);const h=Object(r.useCallback)(e=>{const t=d.includes(e),c=d.filter(t=>t!==e);t||(c.push(e),c.sort()),g(c)},[d]);return Object(r.createElement)(r.Fragment,null,b.map(e=>{const t=d.includes(e.value)? +/* translators: %s stock status. */ +Object(n.__)('Stock status "%s" visible.',"woo-gutenberg-products-block"): +/* translators: %s stock status. */ +Object(n.__)('Stock status "%s" hidden.',"woo-gutenberg-products-block");return Object(r.createElement)(l.ToggleControl,{label:e.label,key:e.value,help:Object(n.sprintf)(t,e.label),checked:d.includes(e.value),onChange:()=>h(e.value)})}))}},97:function(e,t,c){"use strict";c.d(t,"a",(function(){return y}));var r=c(6),n=c.n(r),o=c(0),l=c(1),s=c(3),i=c(113),a=c(498),u=c(4),b=c.n(u),d=c(10),g=c(19),h=c(36),m=c(497),p=c(13);const E=e=>{let{id:t,label:c,popoverContents:r,remove:n,screenReaderLabel:a,className:u=""}=e;const[g,h]=Object(o.useState)(!1),O=Object(d.useInstanceId)(E);if(a=a||c,!c)return null;c=Object(p.decodeEntities)(c);const j=b()("woocommerce-tag",u,{"has-remove":!!n}),w="woocommerce-tag__label-"+O,f=Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},a),Object(o.createElement)("span",{"aria-hidden":"true"},c));return Object(o.createElement)("span",{className:j},r?Object(o.createElement)(s.Button,{className:"woocommerce-tag__text",id:w,onClick:()=>h(!0)},f):Object(o.createElement)("span",{className:"woocommerce-tag__text",id:w},f),r&&g&&Object(o.createElement)(s.Popover,{onClose:()=>h(!1)},r),n&&Object(o.createElement)(s.Button,{className:"woocommerce-tag__remove",onClick:n(t),label:Object(l.sprintf)(// Translators: %s label. +Object(l.__)("Remove %s","woo-gutenberg-products-block"),c),"aria-describedby":w},Object(o.createElement)(i.a,{icon:m.a,size:20,className:"clear-icon"})))};var O=E;const j=e=>Object(o.createElement)(h.b,e),w=e=>{const{list:t,selected:c,renderItem:r,depth:l=0,onSelect:s,instanceId:i,isSingle:a,search:u}=e;return t?Object(o.createElement)(o.Fragment,null,t.map(t=>{const b=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(o.createElement)(o.Fragment,{key:t.id},Object(o.createElement)("li",null,r({item:t,isSelected:b,onSelect:s,isSingle:a,search:u,depth:l,controlId:i})),Object(o.createElement)(w,n()({},e,{list:t.children,depth:l+1})))})):null},f=e=>{let{isLoading:t,isSingle:c,selected:r,messages:n,onChange:i,onRemove:a}=e;if(t||c||!r)return null;const u=r.length;return Object(o.createElement)("div",{className:"woocommerce-search-list__selected"},Object(o.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(o.createElement)("strong",null,n.selected(u)),u>0?Object(o.createElement)(s.Button,{isLink:!0,isDestructive:!0,onClick:()=>i([]),"aria-label":n.clear},Object(l.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(o.createElement)("ul",null,r.map((e,t)=>Object(o.createElement)("li",{key:t},Object(o.createElement)(O,{label:e.name,id:e.id,remove:a})))):null)},_=e=>{let{filteredList:t,search:c,onSelect:r,instanceId:n,...s}=e;const{messages:u,renderItem:b,selected:d,isSingle:g}=s,h=b||j;return 0===t.length?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(o.createElement)(i.a,{icon:a.a})),Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(l.sprintf)(u.noResults,c):u.noItems)):Object(o.createElement)("ul",{className:"woocommerce-search-list__list"},Object(o.createElement)(w,{list:t,selected:d,renderItem:h,onSelect:r,instanceId:n,isSingle:g,search:c}))},y=e=>{const{className:t="",isCompact:c,isHierarchical:r,isLoading:l,isSingle:i,list:a,messages:u=g.a,onChange:h,onSearch:m,selected:p,debouncedSpeak:E}=e,[O,j]=Object(o.useState)(""),w=Object(d.useInstanceId)(y),k=Object(o.useMemo)(()=>({...g.a,...u}),[u]),x=Object(o.useMemo)(()=>Object(g.c)(a,O,r),[a,O,r]);Object(o.useEffect)(()=>{E&&E(k.updated)},[E,k]),Object(o.useEffect)(()=>{"function"==typeof m&&m(O)},[O,m]);const v=Object(o.useCallback)(e=>()=>{i&&h([]);const t=p.findIndex(t=>{let{id:c}=t;return c===e});h([...p.slice(0,t),...p.slice(t+1)])},[i,p,h]),S=Object(o.useCallback)(e=>()=>{-1===p.findIndex(t=>{let{id:c}=t;return c===e.id})?h(i?[e]:[...p,e]):v(e.id)()},[i,v,h,p]);return Object(o.createElement)("div",{className:b()("woocommerce-search-list",t,{"is-compact":c})},Object(o.createElement)(f,n()({},e,{onRemove:v,messages:k})),Object(o.createElement)("div",{className:"woocommerce-search-list__search"},Object(o.createElement)(s.TextControl,{label:k.search,type:"search",value:O,onChange:e=>j(e)})),l?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(o.createElement)(s.Spinner,null)):Object(o.createElement)(_,n()({},e,{search:O,filteredList:x,messages:k,onSelect:S,instanceId:w})))};Object(s.withSpokenMessages)(y)},98:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(3);t.a=e=>{let{value:t,setAttributes:c}=e;return Object(r.createElement)(o.SelectControl,{label:Object(n.__)("Order products by","woo-gutenberg-products-block"),value:t,options:[{label:Object(n.__)("Newness - newest first","woo-gutenberg-products-block"),value:"date"},{label:Object(n.__)("Price - low to high","woo-gutenberg-products-block"),value:"price_asc"},{label:Object(n.__)("Price - high to low","woo-gutenberg-products-block"),value:"price_desc"},{label:Object(n.__)("Rating - highest first","woo-gutenberg-products-block"),value:"rating"},{label:Object(n.__)("Sales - most first","woo-gutenberg-products-block"),value:"popularity"},{label:Object(n.__)("Title - alphabetical","woo-gutenberg-products-block"),value:"title"},{label:Object(n.__)("Menu Order","woo-gutenberg-products-block"),value:"menu_order"}],onChange:e=>c({orderby:e})})}}}); \ No newline at end of file diff --git a/build/product-tag/block.json b/build/product-tag/block.json new file mode 100644 index 00000000000..04edc01d402 --- /dev/null +++ b/build/product-tag/block.json @@ -0,0 +1,84 @@ +{ + "name": "woocommerce/product-tag", + "title": "Products by Tag", + "category": "woocommerce", + "keywords": [ "WooCommerce" ], + "description": "Display a grid of products with selected tags.", + "supports": { + "align": [ "wide", "full" ], + "html": false + }, + "attributes": { + "columns": { + "type": "number", + "default": 3 + }, + "rows": { + "type": "number", + "default": 3 + }, + "alignButtons": { + "type": "boolean", + "default": false + }, + "contentVisibility": { + "type": "object", + "default": { + "image": true, + "title": true, + "price": true, + "rating": true, + "button": true + }, + "properties": { + "image": { + "type": "boolean", + "default": true + }, + "title": { + "type": "boolean", + "default": true + }, + "price": { + "type": "boolean", + "default": true + }, + "rating": { + "type": "boolean", + "default": true + }, + "button": { + "type": "boolean", + "default": true + } + } + }, + "tags": { + "type": "array", + "default": [] + }, + "tagOperator": { + "type": "string", + "default": "any" + }, + "orderby": { + "type": "string", + "default": "date" + }, + "isPreview": { + "type": "boolean", + "default": false + }, + "stockStatus": { + "type": "array" + } + }, + "example": { + "attributes": { + "isPreview": true + } + }, + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2, + "$schema": "https://schemas.wp.org/trunk/block.json" +} diff --git a/build/product-title-frontend.js b/build/product-title-frontend.js new file mode 100644 index 00000000000..8bc1c2d0d98 --- /dev/null +++ b/build/product-title-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[69],{121:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var c=n(45),a=n(18);const r=t=>Object(c.a)(t)?JSON.parse(t)||{}:Object(a.a)(t)?t:{}},18:function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return a}));const c=t=>!(t=>null===t)(t)&&t instanceof Object&&t.constructor===Object;function a(t,e){return c(t)&&e in t}},200:function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n(103);var c=n(48);const a=()=>c.m>1},252:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var c=n(18),a=n(121);const r=t=>{const e=Object(c.a)(t)?t:{},n=Object(a.a)(e.style),r=Object(c.a)(n.typography)?n.typography:{};return{style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:r.fontSize,lineHeight:r.lineHeight,fontWeight:r.fontWeight,textTransform:r.textTransform,fontFamily:e.fontFamily}}}},272:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var c=n(114),a=n(200),r=n(18),s=n(121);const o=t=>{if(!Object(a.a)())return{className:"",style:{}};const e=Object(r.a)(t)?t:{},n=Object(s.a)(e.style);return Object(c.__experimentalUseColorProps)({...e,style:n})}},288:function(t,e,n){"use strict";var c=n(12),a=n.n(c),r=n(0),s=n(17),o=n(4),l=n.n(o);n(289),e.a=t=>{let{className:e="",disabled:n=!1,name:c,permalink:o="",target:i,rel:u,style:b,onClick:d,...p}=t;const m=l()("wc-block-components-product-name",e);if(n){const t=p;return Object(r.createElement)("span",a()({className:m},t,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(c)}}))}return Object(r.createElement)("a",a()({className:m,href:o,target:i},p,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(c)},style:b}))}},289:function(t,e){},301:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var c=n(114),a=n(200),r=n(18),s=n(121);const o=t=>{if(!Object(a.a)()||"function"!=typeof c.__experimentalGetSpacingClassesAndStyles)return{style:{}};const e=Object(r.a)(t)?t:{},n=Object(s.a)(e.style);return Object(c.__experimentalGetSpacingClassesAndStyles)({...e,style:n})}},352:function(t,e){},447:function(t,e,n){"use strict";n.r(e);var c=n(119),a=n(0),r=n(4),s=n.n(r),o=n(47),l=n(200),i=n(288),u=n(59),b=n(272),d=n(301),p=n(252);n(352);const m=t=>{let{children:e,headingLevel:n,elementType:c="h"+n,...r}=t;return Object(a.createElement)(c,r,e)};var f=Object(c.withProductDataContext)(t=>{const{className:e,headingLevel:n=2,showProductLink:c=!0,linkTarget:r,align:f}=t,{parentClassName:O}=Object(o.useInnerBlockLayoutContext)(),{product:j}=Object(o.useProductDataContext)(),{dispatchStoreEvent:y}=Object(u.a)(),g=Object(b.a)(t),h=Object(d.a)(t),k=Object(p.a)(t);return j.id?Object(a.createElement)(m,{headingLevel:n,className:s()(e,g.className,"wc-block-components-product-title",{[O+"__product-title"]:O,["wc-block-components-product-title--align-"+f]:f&&Object(l.a)()}),style:Object(l.a)()?{...h.style,...k.style,...g.style}:{}},Object(a.createElement)(i.a,{disabled:!c,name:j.name,permalink:j.permalink,target:r,onClick:()=>{y("product-view-link",{product:j})}})):Object(a.createElement)(m,{headingLevel:n,className:s()(e,g.className,"wc-block-components-product-title",{[O+"__product-title"]:O,["wc-block-components-product-title--align-"+f]:f&&Object(l.a)()}),style:Object(l.a)()?{...h.style,...k.style,...g.style}:{}})});let O={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},linkTarget:{type:"string"},productId:{type:"number",default:0}};Object(l.a)()&&(O={...O,align:{type:"string"}});var j=O;e.default=Object(c.withFilteredAttributes)(j)(f)}}]); \ No newline at end of file diff --git a/build/product-title.js b/build/product-title.js new file mode 100644 index 00000000000..7e042303160 --- /dev/null +++ b/build/product-title.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[36],{115:function(e,t,c){"use strict";var n=c(6),a=c.n(n),l=c(0),s=c(13),o=c(4),r=c.n(o);c(151),t.a=e=>{let{className:t="",disabled:c=!1,name:n,permalink:o="",target:i,rel:u,style:d,onClick:b,...p}=e;const m=r()("wc-block-components-product-name",t);if(c){const e=p;return Object(l.createElement)("span",a()({className:m},e,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(n)}}))}return Object(l.createElement)("a",a()({className:m,href:o,target:i},p,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(n)},style:d}))}},151:function(e,t){},286:function(e,t,c){"use strict";var n=c(95);let a={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},linkTarget:{type:"string"},productId:{type:"number",default:0}};Object(n.b)()&&(a={...a,align:{type:"string"}}),t.a=a},287:function(e,t,c){"use strict";var n=c(0),a=c(4),l=c.n(a),s=c(29),o=c(95),r=c(58),i=c(115),u=c(78),d=c(138),b=c(215),p=c(123);c(331);const m=e=>{let{children:t,headingLevel:c,elementType:a="h"+c,...l}=e;return Object(n.createElement)(a,l,t)};t.a=Object(r.withProductDataContext)(e=>{const{className:t,headingLevel:c=2,showProductLink:a=!0,linkTarget:r,align:j}=e,{parentClassName:O}=Object(s.useInnerBlockLayoutContext)(),{product:k}=Object(s.useProductDataContext)(),{dispatchStoreEvent:y}=Object(u.a)(),g=Object(d.a)(e),h=Object(b.a)(e),w=Object(p.a)(e);return k.id?Object(n.createElement)(m,{headingLevel:c,className:l()(t,g.className,"wc-block-components-product-title",{[O+"__product-title"]:O,["wc-block-components-product-title--align-"+j]:j&&Object(o.b)()}),style:Object(o.b)()?{...h.style,...w.style,...g.style}:{}},Object(n.createElement)(i.a,{disabled:!a,name:k.name,permalink:k.permalink,target:r,onClick:()=>{y("product-view-link",{product:k})}})):Object(n.createElement)(m,{headingLevel:c,className:l()(t,g.className,"wc-block-components-product-title",{[O+"__product-title"]:O,["wc-block-components-product-title--align-"+j]:j&&Object(o.b)()}),style:Object(o.b)()?{...h.style,...w.style,...g.style}:{}})})},331:function(e,t){},538:function(e,t,c){"use strict";c.r(t);var n=c(58),a=c(287),l=c(286);t.default=Object(n.withFilteredAttributes)(l.a)(a.a)}}]); \ No newline at end of file diff --git a/build/product-top-rated.asset.php b/build/product-top-rated.asset.php new file mode 100644 index 00000000000..1b6445bfb85 --- /dev/null +++ b/build/product-top-rated.asset.php @@ -0,0 +1 @@ + array('lodash', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render', 'wp-url'), 'version' => '8922bda15f71d5995fac467abe369614'); \ No newline at end of file diff --git a/build/product-top-rated.js b/build/product-top-rated.js new file mode 100644 index 00000000000..aaa805afc55 --- /dev/null +++ b/build/product-top-rated.js @@ -0,0 +1,20 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-top-rated"]=function(e){function t(t){for(var r,l,i=t[0],a=t[1],s=t[2],b=0,d=[];bObject(o.sprintf)( +/* translators: Number of items selected from list. */ +Object(o._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(o.__)("Search results updated.","woo-gutenberg-products-block")},i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(n.groupBy)(e,"parent"),r=Object(n.keyBy)(t,"id"),o=["0"],l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=l(r[e.parent]);return[...t,e.name]},i=e=>e.map(e=>{const t=c[e.id];return o.push(""+e.id),{...e,breadcrumbs:l(r[e.parent]),children:t&&t.length?i(t):[]}}),a=i(c[0]||[]);return Object.entries(c).forEach(e=>{let[t,c]=e;o.includes(t)||a.push(...i(c||[]))}),a},a=(e,t,c)=>{if(!t)return c?i(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),n=e.map(e=>!!r.test(e.name)&&e).filter(Boolean);return c?i(n,e):n},s=(e,t)=>{if(!t)return e;const c=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(c).map((e,t)=>c.test(e)?Object(r.createElement)("strong",{key:t},e):Object(r.createElement)(r.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},2:function(e,t){e.exports=window.wc.wcSettings},23:function(e,t,c){"use strict";c.d(t,"o",(function(){return o})),c.d(t,"m",(function(){return l})),c.d(t,"l",(function(){return i})),c.d(t,"n",(function(){return a})),c.d(t,"j",(function(){return s})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return b})),c.d(t,"g",(function(){return d})),c.d(t,"k",(function(){return g})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return p})),c.d(t,"h",(function(){return h})),c.d(t,"a",(function(){return E})),c.d(t,"i",(function(){return O})),c.d(t,"b",(function(){return j}));var r,n=c(2);const o=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),l=o.pluginUrl+"images/",i=o.pluginUrl+"build/",a=o.buildPhase,s=null===(r=n.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=n.STORE_PAGES.checkout.id,b=n.STORE_PAGES.checkout.permalink,d=n.STORE_PAGES.privacy.permalink,g=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),m=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),p=n.STORE_PAGES.cart.permalink,h=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),E=Object(n.getSetting)("allowedCountries",{}),O=Object(n.getSetting)("shippingStates",{}),j=Object(n.getSetting)("allowedStates",{})},25:function(e,t,c){"use strict";c.d(t,"h",(function(){return s})),c.d(t,"e",(function(){return u})),c.d(t,"b",(function(){return b})),c.d(t,"i",(function(){return d})),c.d(t,"f",(function(){return g})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return p})),c.d(t,"g",(function(){return h})),c.d(t,"a",(function(){return E}));var r=c(15),n=c(14),o=c.n(n),l=c(7),i=c(2),a=c(23);const s=e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const i=(e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const o=a.o.productCount>100,l={per_page:o?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},i=[Object(r.addQueryArgs)("/wc/store/v1/products",{...l,...n})];return o&&t.length&&i.push(Object(r.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),i})({selected:t,search:c,queryArgs:n});return Promise.all(i.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>o()({path:"/wc/store/v1/products/"+e}),b=()=>o()({path:"wc/store/v1/products/attributes"}),d=e=>o()({path:`wc/store/v1/products/attributes/${e}/terms`}),g=e=>{let{selected:t=[],search:c}=e;const n=(e=>{let{selected:t=[],search:c}=e;const n=Object(i.getSetting)("limitTags",!1),o=[Object(r.addQueryArgs)("wc/store/v1/products/tags",{per_page:n?100:0,orderby:n?"count":"name",order:n?"desc":"asc",search:c})];return n&&t.length&&o.push(Object(r.addQueryArgs)("wc/store/v1/products/tags",{include:t})),o})({selected:t,search:c});return Promise.all(n.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id"))},m=e=>o()({path:Object(r.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),p=e=>o()({path:"wc/store/v1/products/categories/"+e}),h=e=>o()({path:Object(r.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),E=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},27:function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return l}));var r=c(1),n=c(13);const o=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},l=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(n.decodeEntities)(e.message):Object(r.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},3:function(e,t){e.exports=window.wp.components},32:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(33);t.a=e=>{let{error:t}=e;return Object(r.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:c}=e;return t?"general"===c?Object(r.createElement)("span",null,Object(n.__)("The following error was returned","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(o.escapeHTML)(t))):"api"===c?Object(r.createElement)("span",null,Object(n.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(o.escapeHTML)(t))):t:Object(n.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},33:function(e,t){e.exports=window.wp.escapeHtml},359:function(e,t,c){e.exports=c(473)},36:function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var r=c(6),n=c.n(r),o=c(0),l=c(19);const i=e=>{let{countLabel:t,className:c,depth:r=0,controlId:i="",item:a,isSelected:s,isSingle:u,onSelect:b,search:d="",...g}=e;const m=null!=t&&void 0!==a.count&&null!==a.count,p=[c,"woocommerce-search-list__item"];p.push("depth-"+r),u&&p.push("is-radio-button"),m&&p.push("has-count");const h=a.breadcrumbs&&a.breadcrumbs.length,E=g.name||"search-list-item-"+i,O=`${E}-${a.id}`;return Object(o.createElement)("label",{htmlFor:O,className:p.join(" ")},u?Object(o.createElement)("input",n()({type:"radio",id:O,name:E,value:a.value,onChange:b(a),checked:s,className:"woocommerce-search-list__item-input"},g)):Object(o.createElement)("input",n()({type:"checkbox",id:O,name:E,value:a.value,onChange:b(a),checked:s,className:"woocommerce-search-list__item-input"},g)),Object(o.createElement)("span",{className:"woocommerce-search-list__item-label"},h?Object(o.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(l.b)(a.breadcrumbs)):null,Object(o.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(l.d)(a.name,d))),!!m&&Object(o.createElement)("span",{className:"woocommerce-search-list__item-count"},t||a.count))};t.b=i},473:function(e,t,c){"use strict";c.r(t);var r=c(0),n=c(1),o=c(8),l=c(11),i=Object(r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(r.createElement)("path",{opacity:".87",fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M21 8h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2zm0 4l-3 7H9V9l4.34-4.34L12.23 10H21v2zM1 9h4v12H1z"})),a=c(113),s=c(7),u=c(3),b=c(5),d=c(55),g=c.n(d),m=c(62),p=c(63),h=c(56),E=c(81),O=c(141),j=c(2);class w extends r.Component{getInspectorControls(){const{attributes:e,setAttributes:t}=this.props,{categories:c,catOperator:o,columns:l,contentVisibility:i,rows:a,alignButtons:s,stockStatus:d}=e;return Object(r.createElement)(b.InspectorControls,{key:"inspector"},Object(r.createElement)(u.PanelBody,{title:Object(n.__)("Layout","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(p.a,{columns:l,rows:a,alignButtons:s,setAttributes:t,minColumns:Object(j.getSetting)("min_columns",1),maxColumns:Object(j.getSetting)("max_columns",6),minRows:Object(j.getSetting)("min_rows",1),maxRows:Object(j.getSetting)("max_rows",6)})),Object(r.createElement)(u.PanelBody,{title:Object(n.__)("Content","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(m.a,{settings:i,onChange:e=>t({contentVisibility:e})})),Object(r.createElement)(u.PanelBody,{title:Object(n.__)("Filter by Product Category","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(h.a,{selected:c,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const c=e.map(e=>{let{id:t}=e;return t});t({categories:c})},operator:o,onOperatorChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return t({catOperator:e})}})),Object(r.createElement)(u.PanelBody,{title:Object(n.__)("Filter by stock status","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(E.a,{setAttributes:t,value:d})))}render(){const{name:e,attributes:t}=this.props;return t.isPreview?O.a:Object(r.createElement)(r.Fragment,null,this.getInspectorControls(),Object(r.createElement)(u.Disabled,null,Object(r.createElement)(g.a,{block:e,attributes:t})))}}var f=w,_=c(74);Object(o.registerBlockType)("woocommerce/product-top-rated",{title:Object(n.__)("Top Rated Products","woo-gutenberg-products-block"),icon:{src:Object(r.createElement)(a.a,{icon:i,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(n.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(n.__)("Display a grid of your top rated products.","woo-gutenberg-products-block"),supports:{align:["wide","full"],html:!1},example:{attributes:{isPreview:!0}},attributes:{..._.a},transforms:{from:[{type:"block",blocks:Object(s.without)(_.b,"woocommerce/product-top-rated"),transform:e=>Object(o.createBlock)("woocommerce/product-top-rated",e)}]},edit:e=>Object(r.createElement)(f,e),save:()=>null})},5:function(e,t){e.exports=window.wp.blockEditor},55:function(e,t){e.exports=window.wp.serverSideRender},56:function(e,t,c){"use strict";var r=c(6),n=c.n(r),o=c(0),l=c(1),i=c(36),a=c(97),s=c(3),u=c(10),b=c(25),d=c(27),g=Object(u.createHigherOrderComponent)(e=>class extends o.Component{constructor(){super(...arguments),this.state={error:null,loading:!1,categories:[]},this.loadCategories=this.loadCategories.bind(this)}componentDidMount(){this.loadCategories()}loadCategories(){this.setState({loading:!0}),Object(b.c)().then(e=>{this.setState({categories:e,loading:!1,error:null})}).catch(async e=>{const t=await Object(d.a)(e);this.setState({categories:[],loading:!1,error:t})})}render(){const{error:t,loading:c,categories:r}=this.state;return Object(o.createElement)(e,n()({},this.props,{error:t,isLoading:c,categories:r}))}},"withCategories"),m=c(32),p=c(4),h=c.n(p);c(89);const E=e=>{let{categories:t,error:c,isLoading:r,onChange:u,onOperatorChange:b,operator:d,selected:g,isCompact:p,isSingle:E,showReviewCount:O}=e;const j={clear:Object(l.__)("Clear all product categories","woo-gutenberg-products-block"),list:Object(l.__)("Product Categories","woo-gutenberg-products-block"),noItems:Object(l.__)("Your store doesn't have any product categories.","woo-gutenberg-products-block"),search:Object(l.__)("Search for product categories","woo-gutenberg-products-block"),selected:e=>Object(l.sprintf)( +/* translators: %d is the count of selected categories. */ +Object(l._n)("%d category selected","%d categories selected",e,"woo-gutenberg-products-block"),e),updated:Object(l.__)("Category search results updated.","woo-gutenberg-products-block")};return c?Object(o.createElement)(m.a,{error:c}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.a,{className:"woocommerce-product-categories",list:t,isLoading:r,selected:g.map(e=>t.find(t=>t.id===e)).filter(Boolean),onChange:u,renderItem:e=>{const{item:t,search:c,depth:r=0}=e,a=t.breadcrumbs.length?`${t.breadcrumbs.join(", ")}, ${t.name}`:t.name,s=O?Object(l.sprintf)( +/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */ +Object(l._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,"woo-gutenberg-products-block"),a,t.review_count):Object(l.sprintf)( +/* translators: %1$s is the item name, %2$d is the count of products for the item. */ +Object(l._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,"woo-gutenberg-products-block"),a,t.count),u=O?Object(l.sprintf)( +/* translators: %d is the count of reviews. */ +Object(l._n)("%d review","%d reviews",t.review_count,"woo-gutenberg-products-block"),t.review_count):Object(l.sprintf)( +/* translators: %d is the count of products. */ +Object(l._n)("%d product","%d products",t.count,"woo-gutenberg-products-block"),t.count);return Object(o.createElement)(i.a,n()({className:h()("woocommerce-product-categories__item","has-count",{"is-searching":c.length>0,"is-skip-level":0===r&&0!==t.parent})},e,{countLabel:u,"aria-label":s}))},messages:j,isCompact:p,isHierarchical:!0,isSingle:E}),!!b&&Object(o.createElement)("div",{hidden:g.length<2},Object(o.createElement)(s.SelectControl,{className:"woocommerce-product-categories__operator",label:Object(l.__)("Display products matching","woo-gutenberg-products-block"),help:Object(l.__)("Pick at least two categories to use this setting.","woo-gutenberg-products-block"),value:d,onChange:b,options:[{label:Object(l.__)("Any selected categories","woo-gutenberg-products-block"),value:"any"},{label:Object(l.__)("All selected categories","woo-gutenberg-products-block"),value:"all"}]})))};E.defaultProps={operator:"any",isCompact:!1,isSingle:!1},t.a=g(E)},62:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(3);t.a=e=>{let{onChange:t,settings:c}=e;const{image:l,button:i,price:a,rating:s,title:u}=c,b=!1!==l;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product image","woo-gutenberg-products-block"),help:b?Object(n.__)("Product image is visible.","woo-gutenberg-products-block"):Object(n.__)("Product image is hidden.","woo-gutenberg-products-block"),checked:b,onChange:()=>t({...c,image:!b})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product title","woo-gutenberg-products-block"),help:u?Object(n.__)("Product title is visible.","woo-gutenberg-products-block"):Object(n.__)("Product title is hidden.","woo-gutenberg-products-block"),checked:u,onChange:()=>t({...c,title:!u})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product price","woo-gutenberg-products-block"),help:a?Object(n.__)("Product price is visible.","woo-gutenberg-products-block"):Object(n.__)("Product price is hidden.","woo-gutenberg-products-block"),checked:a,onChange:()=>t({...c,price:!a})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product rating","woo-gutenberg-products-block"),help:s?Object(n.__)("Product rating is visible.","woo-gutenberg-products-block"):Object(n.__)("Product rating is hidden.","woo-gutenberg-products-block"),checked:s,onChange:()=>t({...c,rating:!s})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Add to Cart button","woo-gutenberg-products-block"),help:i?Object(n.__)("Add to Cart button is visible.","woo-gutenberg-products-block"):Object(n.__)("Add to Cart button is hidden.","woo-gutenberg-products-block"),checked:i,onChange:()=>t({...c,button:!i})}))}},63:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(7),l=c(3);t.a=e=>{let{columns:t,rows:c,setAttributes:i,alignButtons:a,minColumns:s=1,maxColumns:u=6,minRows:b=1,maxRows:d=6}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(l.RangeControl,{label:Object(n.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:e=>{const t=Object(o.clamp)(e,s,u);i({columns:Number.isNaN(t)?"":t})},min:s,max:u}),Object(r.createElement)(l.RangeControl,{label:Object(n.__)("Rows","woo-gutenberg-products-block"),value:c,onChange:e=>{const t=Object(o.clamp)(e,b,d);i({rows:Number.isNaN(t)?"":t})},min:b,max:d}),Object(r.createElement)(l.ToggleControl,{label:Object(n.__)("Align Last Block","woo-gutenberg-products-block"),help:a?Object(n.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(n.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:a,onChange:()=>i({alignButtons:!a})}))}},7:function(e,t){e.exports=window.lodash},74:function(e,t,c){"use strict";c.d(t,"b",(function(){return n}));var r=c(2);const n=["woocommerce/product-best-sellers","woocommerce/product-category","woocommerce/product-new","woocommerce/product-on-sale","woocommerce/product-top-rated"];t.a={columns:{type:"number",default:Object(r.getSetting)("default_columns",3)},rows:{type:"number",default:Object(r.getSetting)("default_rows",3)},alignButtons:{type:"boolean",default:!1},categories:{type:"array",default:[]},catOperator:{type:"string",default:"any"},contentVisibility:{type:"object",default:{image:!0,title:!0,price:!0,rating:!0,button:!0}},isPreview:{type:"boolean",default:!1},stockStatus:{type:"array",default:Object.keys(Object(r.getSetting)("stockStatusOptions",[]))}}},8:function(e,t){e.exports=window.wp.blocks},81:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(2),l=c(3);const i=Object(o.getSetting)("hideOutOfStockItems",!1),a=Object(o.getSetting)("stockStatusOptions",{});t.a=e=>{let{value:t,setAttributes:c}=e;const{outofstock:o,...s}=a,u=i?s:a,b=Object.entries(u).map(e=>{let[t,c]=e;return{value:t,label:c}}).filter(e=>!!e.label),[d,g]=Object(r.useState)(t);Object(r.useEffect)(()=>{c({stockStatus:["",...d]})},[d,c]);const m=Object(r.useCallback)(e=>{const t=d.includes(e),c=d.filter(t=>t!==e);t||(c.push(e),c.sort()),g(c)},[d]);return Object(r.createElement)(r.Fragment,null,b.map(e=>{const t=d.includes(e.value)? +/* translators: %s stock status. */ +Object(n.__)('Stock status "%s" visible.',"woo-gutenberg-products-block"): +/* translators: %s stock status. */ +Object(n.__)('Stock status "%s" hidden.',"woo-gutenberg-products-block");return Object(r.createElement)(l.ToggleControl,{label:e.label,key:e.value,help:Object(n.sprintf)(t,e.label),checked:d.includes(e.value),onChange:()=>m(e.value)})}))}},89:function(e,t){},97:function(e,t,c){"use strict";c.d(t,"a",(function(){return y}));var r=c(6),n=c.n(r),o=c(0),l=c(1),i=c(3),a=c(113),s=c(498),u=c(4),b=c.n(u),d=c(10),g=c(19),m=c(36),p=c(497),h=c(13);const E=e=>{let{id:t,label:c,popoverContents:r,remove:n,screenReaderLabel:s,className:u=""}=e;const[g,m]=Object(o.useState)(!1),O=Object(d.useInstanceId)(E);if(s=s||c,!c)return null;c=Object(h.decodeEntities)(c);const j=b()("woocommerce-tag",u,{"has-remove":!!n}),w="woocommerce-tag__label-"+O,f=Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},s),Object(o.createElement)("span",{"aria-hidden":"true"},c));return Object(o.createElement)("span",{className:j},r?Object(o.createElement)(i.Button,{className:"woocommerce-tag__text",id:w,onClick:()=>m(!0)},f):Object(o.createElement)("span",{className:"woocommerce-tag__text",id:w},f),r&&g&&Object(o.createElement)(i.Popover,{onClose:()=>m(!1)},r),n&&Object(o.createElement)(i.Button,{className:"woocommerce-tag__remove",onClick:n(t),label:Object(l.sprintf)(// Translators: %s label. +Object(l.__)("Remove %s","woo-gutenberg-products-block"),c),"aria-describedby":w},Object(o.createElement)(a.a,{icon:p.a,size:20,className:"clear-icon"})))};var O=E;const j=e=>Object(o.createElement)(m.b,e),w=e=>{const{list:t,selected:c,renderItem:r,depth:l=0,onSelect:i,instanceId:a,isSingle:s,search:u}=e;return t?Object(o.createElement)(o.Fragment,null,t.map(t=>{const b=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(o.createElement)(o.Fragment,{key:t.id},Object(o.createElement)("li",null,r({item:t,isSelected:b,onSelect:i,isSingle:s,search:u,depth:l,controlId:a})),Object(o.createElement)(w,n()({},e,{list:t.children,depth:l+1})))})):null},f=e=>{let{isLoading:t,isSingle:c,selected:r,messages:n,onChange:a,onRemove:s}=e;if(t||c||!r)return null;const u=r.length;return Object(o.createElement)("div",{className:"woocommerce-search-list__selected"},Object(o.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(o.createElement)("strong",null,n.selected(u)),u>0?Object(o.createElement)(i.Button,{isLink:!0,isDestructive:!0,onClick:()=>a([]),"aria-label":n.clear},Object(l.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(o.createElement)("ul",null,r.map((e,t)=>Object(o.createElement)("li",{key:t},Object(o.createElement)(O,{label:e.name,id:e.id,remove:s})))):null)},_=e=>{let{filteredList:t,search:c,onSelect:r,instanceId:n,...i}=e;const{messages:u,renderItem:b,selected:d,isSingle:g}=i,m=b||j;return 0===t.length?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(o.createElement)(a.a,{icon:s.a})),Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(l.sprintf)(u.noResults,c):u.noItems)):Object(o.createElement)("ul",{className:"woocommerce-search-list__list"},Object(o.createElement)(w,{list:t,selected:d,renderItem:m,onSelect:r,instanceId:n,isSingle:g,search:c}))},y=e=>{const{className:t="",isCompact:c,isHierarchical:r,isLoading:l,isSingle:a,list:s,messages:u=g.a,onChange:m,onSearch:p,selected:h,debouncedSpeak:E}=e,[O,j]=Object(o.useState)(""),w=Object(d.useInstanceId)(y),x=Object(o.useMemo)(()=>({...g.a,...u}),[u]),k=Object(o.useMemo)(()=>Object(g.c)(s,O,r),[s,O,r]);Object(o.useEffect)(()=>{E&&E(x.updated)},[E,x]),Object(o.useEffect)(()=>{"function"==typeof p&&p(O)},[O,p]);const v=Object(o.useCallback)(e=>()=>{a&&m([]);const t=h.findIndex(t=>{let{id:c}=t;return c===e});m([...h.slice(0,t),...h.slice(t+1)])},[a,h,m]),S=Object(o.useCallback)(e=>()=>{-1===h.findIndex(t=>{let{id:c}=t;return c===e.id})?m(a?[e]:[...h,e]):v(e.id)()},[a,v,m,h]);return Object(o.createElement)("div",{className:b()("woocommerce-search-list",t,{"is-compact":c})},Object(o.createElement)(f,n()({},e,{onRemove:v,messages:x})),Object(o.createElement)("div",{className:"woocommerce-search-list__search"},Object(o.createElement)(i.TextControl,{label:x.search,type:"search",value:O,onChange:e=>j(e)})),l?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(o.createElement)(i.Spinner,null)):Object(o.createElement)(_,n()({},e,{search:O,filteredList:k,messages:x,onSelect:S,instanceId:w})))};Object(i.withSpokenMessages)(y)}}); \ No newline at end of file diff --git a/build/products-by-attribute.asset.php b/build/products-by-attribute.asset.php new file mode 100644 index 00000000000..f3e035c2c34 --- /dev/null +++ b/build/products-by-attribute.asset.php @@ -0,0 +1 @@ + array('lodash', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-server-side-render', 'wp-url'), 'version' => '0f8958eea1419f2e9e5aea2508b2f02e'); \ No newline at end of file diff --git a/build/products-by-attribute.js b/build/products-by-attribute.js new file mode 100644 index 00000000000..5307f621641 --- /dev/null +++ b/build/products-by-attribute.js @@ -0,0 +1,20 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["products-by-attribute"]=function(e){function t(t){for(var r,l,a=t[0],i=t[1],s=t[2],b=0,d=[];bObject(o.sprintf)( +/* translators: Number of items selected from list. */ +Object(o._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(o.__)("Search results updated.","woo-gutenberg-products-block")},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(n.groupBy)(e,"parent"),r=Object(n.keyBy)(t,"id"),o=["0"],l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=l(r[e.parent]);return[...t,e.name]},a=e=>e.map(e=>{const t=c[e.id];return o.push(""+e.id),{...e,breadcrumbs:l(r[e.parent]),children:t&&t.length?a(t):[]}}),i=a(c[0]||[]);return Object.entries(c).forEach(e=>{let[t,c]=e;o.includes(t)||i.push(...a(c||[]))}),i},i=(e,t,c)=>{if(!t)return c?a(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),n=e.map(e=>!!r.test(e.name)&&e).filter(Boolean);return c?a(n,e):n},s=(e,t)=>{if(!t)return e;const c=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(c).map((e,t)=>c.test(e)?Object(r.createElement)("strong",{key:t},e):Object(r.createElement)(r.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},2:function(e,t){e.exports=window.wc.wcSettings},23:function(e,t,c){"use strict";c.d(t,"o",(function(){return o})),c.d(t,"m",(function(){return l})),c.d(t,"l",(function(){return a})),c.d(t,"n",(function(){return i})),c.d(t,"j",(function(){return s})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return b})),c.d(t,"g",(function(){return d})),c.d(t,"k",(function(){return m})),c.d(t,"c",(function(){return g})),c.d(t,"d",(function(){return p})),c.d(t,"h",(function(){return h})),c.d(t,"a",(function(){return O})),c.d(t,"i",(function(){return E})),c.d(t,"b",(function(){return j}));var r,n=c(2);const o=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),l=o.pluginUrl+"images/",a=o.pluginUrl+"build/",i=o.buildPhase,s=null===(r=n.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=n.STORE_PAGES.checkout.id,b=n.STORE_PAGES.checkout.permalink,d=n.STORE_PAGES.privacy.permalink,m=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),g=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),p=n.STORE_PAGES.cart.permalink,h=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),O=Object(n.getSetting)("allowedCountries",{}),E=Object(n.getSetting)("shippingStates",{}),j=Object(n.getSetting)("allowedStates",{})},25:function(e,t,c){"use strict";c.d(t,"h",(function(){return s})),c.d(t,"e",(function(){return u})),c.d(t,"b",(function(){return b})),c.d(t,"i",(function(){return d})),c.d(t,"f",(function(){return m})),c.d(t,"c",(function(){return g})),c.d(t,"d",(function(){return p})),c.d(t,"g",(function(){return h})),c.d(t,"a",(function(){return O}));var r=c(15),n=c(14),o=c.n(n),l=c(7),a=c(2),i=c(23);const s=e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const a=(e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const o=i.o.productCount>100,l={per_page:o?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},a=[Object(r.addQueryArgs)("/wc/store/v1/products",{...l,...n})];return o&&t.length&&a.push(Object(r.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),a})({selected:t,search:c,queryArgs:n});return Promise.all(a.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>o()({path:"/wc/store/v1/products/"+e}),b=()=>o()({path:"wc/store/v1/products/attributes"}),d=e=>o()({path:`wc/store/v1/products/attributes/${e}/terms`}),m=e=>{let{selected:t=[],search:c}=e;const n=(e=>{let{selected:t=[],search:c}=e;const n=Object(a.getSetting)("limitTags",!1),o=[Object(r.addQueryArgs)("wc/store/v1/products/tags",{per_page:n?100:0,orderby:n?"count":"name",order:n?"desc":"asc",search:c})];return n&&t.length&&o.push(Object(r.addQueryArgs)("wc/store/v1/products/tags",{include:t})),o})({selected:t,search:c});return Promise.all(n.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id"))},g=e=>o()({path:Object(r.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),p=e=>o()({path:"wc/store/v1/products/categories/"+e}),h=e=>o()({path:Object(r.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),O=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},27:function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return l}));var r=c(1),n=c(13);const o=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},l=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(n.decodeEntities)(e.message):Object(r.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},274:function(e){e.exports=JSON.parse('{"name":"woocommerce/products-by-attribute","title":"Products by Attribute","category":"woocommerce","keywords":["WooCommerce"],"description":"Display a grid of products with selected attributes.","supports":{"align":["wide","full"],"html":false},"attributes":{"attributes":{"type":"array","default":[]},"attrOperator":{"type":"string","enum":["all","any"],"default":"any"},"columns":{"type":"number","default":3},"contentVisibility":{"type":"object","default":{"image":true,"title":true,"price":true,"rating":true,"button":true},"properties":{"image":{"type":"boolean","default":true},"title":{"type":"boolean","default":true},"price":{"type":"boolean","default":true},"rating":{"type":"boolean","default":true},"button":{"type":"boolean","default":true}}},"orderby":{"type":"string","enum":["date","popularity","price_asc","price_desc","rating","title","menu_order"],"default":"date"},"rows":{"type":"number","default":3},"alignButtons":{"type":"boolean","default":false},"isPreview":{"type":"boolean","default":false},"stockStatus":{"type":"array"}},"textdomain":"woo-gutenberg-products-block","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},298:function(e,t){},3:function(e,t){e.exports=window.wp.components},32:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(33);t.a=e=>{let{error:t}=e;return Object(r.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:c}=e;return t?"general"===c?Object(r.createElement)("span",null,Object(n.__)("The following error was returned","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(o.escapeHTML)(t))):"api"===c?Object(r.createElement)("span",null,Object(n.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(o.escapeHTML)(t))):t:Object(n.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},33:function(e,t){e.exports=window.wp.escapeHtml},36:function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(6),n=c.n(r),o=c(0),l=c(19);const a=e=>{let{countLabel:t,className:c,depth:r=0,controlId:a="",item:i,isSelected:s,isSingle:u,onSelect:b,search:d="",...m}=e;const g=null!=t&&void 0!==i.count&&null!==i.count,p=[c,"woocommerce-search-list__item"];p.push("depth-"+r),u&&p.push("is-radio-button"),g&&p.push("has-count");const h=i.breadcrumbs&&i.breadcrumbs.length,O=m.name||"search-list-item-"+a,E=`${O}-${i.id}`;return Object(o.createElement)("label",{htmlFor:E,className:p.join(" ")},u?Object(o.createElement)("input",n()({type:"radio",id:E,name:O,value:i.value,onChange:b(i),checked:s,className:"woocommerce-search-list__item-input"},m)):Object(o.createElement)("input",n()({type:"checkbox",id:E,name:O,value:i.value,onChange:b(i),checked:s,className:"woocommerce-search-list__item-input"},m)),Object(o.createElement)("span",{className:"woocommerce-search-list__item-label"},h?Object(o.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(l.b)(i.breadcrumbs)):null,Object(o.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(l.d)(i.name,d))),!!g&&Object(o.createElement)("span",{className:"woocommerce-search-list__item-count"},t||i.count))};t.b=a},360:function(e,t,c){e.exports=c(461)},361:function(e,t){},461:function(e,t,c){"use strict";c.r(t);var r=c(0),n=c(113),o=c(504),l=c(8),a=c(2),i=(c(298),c(274)),s=c(6),u=c.n(s),b=c(5),d=c(3),m=c(1),g=c(63),p=c(62),h=c(36),O=c(97),E=c(10),j=c(25),w=c(27);const f=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Array.isArray(t)?t.find(t=>t[c]===e):null};var _=c(32),y=c(4),k=c.n(y),x=c(82);c(361);const v=e=>{let{attributes:t,error:c,expandedAttribute:n,onChange:o,onExpandAttribute:l,onOperatorChange:a,instanceId:i,isCompact:s,isLoading:b,operator:g,selected:p,termsAreLoading:E,termsList:j}=e;const w=[...t,...j[n]||[]],f={clear:Object(m.__)("Clear all product attributes","woo-gutenberg-products-block"),list:Object(m.__)("Product Attributes","woo-gutenberg-products-block"),noItems:Object(m.__)("Your store doesn't have any product attributes.","woo-gutenberg-products-block"),search:Object(m.__)("Search for product attributes","woo-gutenberg-products-block"),selected:e=>Object(m.sprintf)( +/* translators: %d is the count of attributes selected. */ +Object(m._n)("%d attribute selected","%d attributes selected",e,"woo-gutenberg-products-block"),e),updated:Object(m.__)("Product attribute search results updated.","woo-gutenberg-products-block")};return c?Object(r.createElement)(_.a,{error:c}):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(O.a,{className:"woocommerce-product-attributes",list:w,isLoading:b,selected:p.map(e=>{let{id:t}=e;return w.find(e=>e.id===t)}).filter(Boolean),onChange:o,renderItem:e=>{const{item:t,search:c,depth:a=0}=e,s=["woocommerce-product-attributes__item","woocommerce-search-list__item",{"is-searching":c.length>0,"is-skip-level":0===a&&0!==t.parent}];if(!t.breadcrumbs.length){const c=n===t.id;return Object(r.createElement)(x.a,u()({},e,{className:k()(...s,{"is-selected":c}),isSelected:c,item:t,isLoading:E,disabled:"0"===t.count,onSelect:e=>{let{id:t}=e;return()=>{o([]),l(t)}},name:"attributes-"+i,countLabel:Object(m.sprintf)( +/* translators: %d is the count of terms. */ +Object(m._n)("%d term","%d terms",t.count,"woo-gutenberg-products-block"),t.count),"aria-label":Object(m.sprintf)( +/* translators: %1$s is the item name, %2$d is the count of terms for the item. */ +Object(m._n)("%1$s, has %2$d term","%1$s, has %2$d terms",t.count,"woo-gutenberg-products-block"),t.name,t.count)}))}const b=`${t.breadcrumbs[0]}: ${t.name}`;return Object(r.createElement)(h.a,u()({},e,{name:"terms-"+i,className:k()(...s,"has-count"),countLabel:Object(m.sprintf)( +/* translators: %d is the count of products. */ +Object(m._n)("%d product","%d products",t.count,"woo-gutenberg-products-block"),t.count),"aria-label":Object(m.sprintf)( +/* translators: %1$s is the attribute name, %2$d is the count of products for that attribute. */ +Object(m._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,"woo-gutenberg-products-block"),b,t.count)}))},messages:f,isCompact:s,isHierarchical:!0}),!!a&&Object(r.createElement)("div",{hidden:p.length<2},Object(r.createElement)(d.SelectControl,{className:"woocommerce-product-attributes__operator",label:Object(m.__)("Display products matching","woo-gutenberg-products-block"),help:Object(m.__)("Pick at least two attributes to use this setting.","woo-gutenberg-products-block"),value:g,onChange:a,options:[{label:Object(m.__)("Any selected attributes","woo-gutenberg-products-block"),value:"any"},{label:Object(m.__)("All selected attributes","woo-gutenberg-products-block"),value:"all"}]})))};v.defaultProps={isCompact:!1,operator:"any"};var S,C=(S=Object(E.withInstanceId)(v),e=>{const{selected:t=[]}=e,c=t.length?t[0].attr_slug:null,[n,o]=Object(r.useState)(null),[l,a]=Object(r.useState)(0),[i,s]=Object(r.useState)({}),[b,d]=Object(r.useState)(!0),[m,g]=Object(r.useState)(!1),[p,h]=Object(r.useState)(null);return Object(r.useEffect)(()=>{null===n&&Object(j.b)().then(e=>{if(e=e.map(e=>({...e,parent:0})),o(e),c){const t=f(c,e,"taxonomy");t&&a(t.id)}}).catch(async e=>{h(await Object(w.a)(e))}).finally(()=>{d(!1)})},[n,c]),Object(r.useEffect)(()=>{const e=f(l,n);e&&(g(!0),Object(j.i)(l).then(t=>{t=t.map(t=>({...t,parent:l,attr_slug:e.taxonomy})),s(e=>({...e,[l]:t}))}).catch(async e=>{h(await Object(w.a)(e))}).finally(()=>{g(!1)}))},[l,n]),Object(r.createElement)(S,u()({},e,{attributes:n||[],error:p,expandedAttribute:l,onExpandAttribute:a,isLoading:b,termsAreLoading:m,termsList:i}))}),P=c(98),A=c(81);const N=e=>{const{setAttributes:t}=e,{attributes:c,attrOperator:n,columns:o,contentVisibility:l,orderby:i,rows:s,alignButtons:u,stockStatus:h}=e.attributes;return Object(r.createElement)(b.InspectorControls,{key:"inspector"},Object(r.createElement)(d.PanelBody,{title:Object(m.__)("Layout","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(g.a,{columns:o,rows:s,alignButtons:u,setAttributes:t,minColumns:Object(a.getSetting)("min_columns",1),maxColumns:Object(a.getSetting)("max_columns",6),minRows:Object(a.getSetting)("min_rows",1),maxRows:Object(a.getSetting)("max_rows",6)})),Object(r.createElement)(d.PanelBody,{title:Object(m.__)("Content","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(p.a,{settings:l,onChange:e=>t({contentVisibility:e})})),Object(r.createElement)(d.PanelBody,{title:Object(m.__)("Filter by Product Attribute","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(C,{selected:c,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const c=e.map(e=>{let{id:t,attr_slug:c}=e;return{id:t,attr_slug:c}});t({attributes:c})},operator:n,onOperatorChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return t({attrOperator:e})},isCompact:!0})),Object(r.createElement)(d.PanelBody,{title:Object(m.__)("Order By","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(P.a,{setAttributes:t,value:i})),Object(r.createElement)(d.PanelBody,{title:Object(m.__)("Filter by stock status","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(A.a,{setAttributes:t,value:h})))},T=e=>{const{attributes:t,setAttributes:c,setIsEditing:l,isEditing:a,debouncedSpeak:i}=e;return Object(r.createElement)(d.Placeholder,{icon:Object(r.createElement)(n.a,{icon:o.a}),label:Object(m.__)("Products by Attribute","woo-gutenberg-products-block"),className:"wc-block-products-grid wc-block-products-by-attribute"},Object(m.__)("Display a grid of products from your selected attributes.","woo-gutenberg-products-block"),Object(r.createElement)("div",{className:"wc-block-products-by-attribute__selection"},Object(r.createElement)(C,{selected:t.attributes,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e.map(e=>{let{id:t,attr_slug:c}=e;return{id:t,attr_slug:c}});c({attributes:t})},operator:t.attrOperator,onOperatorChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return c({attrOperator:e})}}),Object(r.createElement)(d.Button,{isPrimary:!0,onClick:()=>{l(!a),i(Object(m.__)("Showing Products by Attribute block preview.","woo-gutenberg-products-block"))}},Object(m.__)("Done","woo-gutenberg-products-block"))))};var B=c(55),R=c.n(B),I=c(141);const L=e=>{const{attributes:t,name:c}=e;return t.isPreview?I.a:Object(r.createElement)(R.a,{block:c,attributes:t})},$=Object(d.withSpokenMessages)(e=>{const t=Object(b.useBlockProps)(),{attributes:{attributes:c}}=e,[n,o]=Object(r.useState)(!c.length);return Object(r.createElement)("div",t,Object(r.createElement)(b.BlockControls,null,Object(r.createElement)(d.ToolbarGroup,{controls:[{icon:"edit",title:Object(m.__)("Edit selected attribute","woo-gutenberg-products-block"),onClick:()=>o(!n),isActive:n}]})),Object(r.createElement)(N,e),n?Object(r.createElement)(T,u()({isEditing:n,setIsEditing:o},e)):Object(r.createElement)(d.Disabled,null,Object(r.createElement)(L,e)))});Object(l.registerBlockType)(i,{icon:{src:Object(r.createElement)(n.a,{icon:o.a,className:"wc-block-editor-components-block-icon"})},attributes:{...i.attributes,columns:{type:"number",default:Object(a.getSetting)("default_columns",3)},rows:{type:"number",default:Object(a.getSetting)("default_rows",3)},stockStatus:{type:"array",default:Object.keys(Object(a.getSetting)("stockStatusOptions",[]))}},edit:$,save:()=>null})},5:function(e,t){e.exports=window.wp.blockEditor},55:function(e,t){e.exports=window.wp.serverSideRender},62:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(3);t.a=e=>{let{onChange:t,settings:c}=e;const{image:l,button:a,price:i,rating:s,title:u}=c,b=!1!==l;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product image","woo-gutenberg-products-block"),help:b?Object(n.__)("Product image is visible.","woo-gutenberg-products-block"):Object(n.__)("Product image is hidden.","woo-gutenberg-products-block"),checked:b,onChange:()=>t({...c,image:!b})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product title","woo-gutenberg-products-block"),help:u?Object(n.__)("Product title is visible.","woo-gutenberg-products-block"):Object(n.__)("Product title is hidden.","woo-gutenberg-products-block"),checked:u,onChange:()=>t({...c,title:!u})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product price","woo-gutenberg-products-block"),help:i?Object(n.__)("Product price is visible.","woo-gutenberg-products-block"):Object(n.__)("Product price is hidden.","woo-gutenberg-products-block"),checked:i,onChange:()=>t({...c,price:!i})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product rating","woo-gutenberg-products-block"),help:s?Object(n.__)("Product rating is visible.","woo-gutenberg-products-block"):Object(n.__)("Product rating is hidden.","woo-gutenberg-products-block"),checked:s,onChange:()=>t({...c,rating:!s})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Add to Cart button","woo-gutenberg-products-block"),help:a?Object(n.__)("Add to Cart button is visible.","woo-gutenberg-products-block"):Object(n.__)("Add to Cart button is hidden.","woo-gutenberg-products-block"),checked:a,onChange:()=>t({...c,button:!a})}))}},63:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(7),l=c(3);t.a=e=>{let{columns:t,rows:c,setAttributes:a,alignButtons:i,minColumns:s=1,maxColumns:u=6,minRows:b=1,maxRows:d=6}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(l.RangeControl,{label:Object(n.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:e=>{const t=Object(o.clamp)(e,s,u);a({columns:Number.isNaN(t)?"":t})},min:s,max:u}),Object(r.createElement)(l.RangeControl,{label:Object(n.__)("Rows","woo-gutenberg-products-block"),value:c,onChange:e=>{const t=Object(o.clamp)(e,b,d);a({rows:Number.isNaN(t)?"":t})},min:b,max:d}),Object(r.createElement)(l.ToggleControl,{label:Object(n.__)("Align Last Block","woo-gutenberg-products-block"),help:i?Object(n.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(n.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:i,onChange:()=>a({alignButtons:!i})}))}},7:function(e,t){e.exports=window.lodash},8:function(e,t){e.exports=window.wp.blocks},81:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(2),l=c(3);const a=Object(o.getSetting)("hideOutOfStockItems",!1),i=Object(o.getSetting)("stockStatusOptions",{});t.a=e=>{let{value:t,setAttributes:c}=e;const{outofstock:o,...s}=i,u=a?s:i,b=Object.entries(u).map(e=>{let[t,c]=e;return{value:t,label:c}}).filter(e=>!!e.label),[d,m]=Object(r.useState)(t);Object(r.useEffect)(()=>{c({stockStatus:["",...d]})},[d,c]);const g=Object(r.useCallback)(e=>{const t=d.includes(e),c=d.filter(t=>t!==e);t||(c.push(e),c.sort()),m(c)},[d]);return Object(r.createElement)(r.Fragment,null,b.map(e=>{const t=d.includes(e.value)? +/* translators: %s stock status. */ +Object(n.__)('Stock status "%s" visible.',"woo-gutenberg-products-block"): +/* translators: %s stock status. */ +Object(n.__)('Stock status "%s" hidden.',"woo-gutenberg-products-block");return Object(r.createElement)(l.ToggleControl,{label:e.label,key:e.value,help:Object(n.sprintf)(t,e.label),checked:d.includes(e.value),onChange:()=>g(e.value)})}))}},82:function(e,t,c){"use strict";var r=c(6),n=c.n(r),o=c(0),l=c(36),a=c(3),i=c(4),s=c.n(i);t.a=e=>{let{className:t,item:c,isSelected:r,isLoading:i,onSelect:u,disabled:b,...d}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(l.a,n()({},d,{key:c.id,className:t,isSelected:r,item:c,onSelect:u,isSingle:!0,disabled:b})),r&&i&&Object(o.createElement)("div",{key:"loading",className:s()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(o.createElement)(a.Spinner,null)))}},97:function(e,t,c){"use strict";c.d(t,"a",(function(){return y}));var r=c(6),n=c.n(r),o=c(0),l=c(1),a=c(3),i=c(113),s=c(498),u=c(4),b=c.n(u),d=c(10),m=c(19),g=c(36),p=c(497),h=c(13);const O=e=>{let{id:t,label:c,popoverContents:r,remove:n,screenReaderLabel:s,className:u=""}=e;const[m,g]=Object(o.useState)(!1),E=Object(d.useInstanceId)(O);if(s=s||c,!c)return null;c=Object(h.decodeEntities)(c);const j=b()("woocommerce-tag",u,{"has-remove":!!n}),w="woocommerce-tag__label-"+E,f=Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},s),Object(o.createElement)("span",{"aria-hidden":"true"},c));return Object(o.createElement)("span",{className:j},r?Object(o.createElement)(a.Button,{className:"woocommerce-tag__text",id:w,onClick:()=>g(!0)},f):Object(o.createElement)("span",{className:"woocommerce-tag__text",id:w},f),r&&m&&Object(o.createElement)(a.Popover,{onClose:()=>g(!1)},r),n&&Object(o.createElement)(a.Button,{className:"woocommerce-tag__remove",onClick:n(t),label:Object(l.sprintf)(// Translators: %s label. +Object(l.__)("Remove %s","woo-gutenberg-products-block"),c),"aria-describedby":w},Object(o.createElement)(i.a,{icon:p.a,size:20,className:"clear-icon"})))};var E=O;const j=e=>Object(o.createElement)(g.b,e),w=e=>{const{list:t,selected:c,renderItem:r,depth:l=0,onSelect:a,instanceId:i,isSingle:s,search:u}=e;return t?Object(o.createElement)(o.Fragment,null,t.map(t=>{const b=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(o.createElement)(o.Fragment,{key:t.id},Object(o.createElement)("li",null,r({item:t,isSelected:b,onSelect:a,isSingle:s,search:u,depth:l,controlId:i})),Object(o.createElement)(w,n()({},e,{list:t.children,depth:l+1})))})):null},f=e=>{let{isLoading:t,isSingle:c,selected:r,messages:n,onChange:i,onRemove:s}=e;if(t||c||!r)return null;const u=r.length;return Object(o.createElement)("div",{className:"woocommerce-search-list__selected"},Object(o.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(o.createElement)("strong",null,n.selected(u)),u>0?Object(o.createElement)(a.Button,{isLink:!0,isDestructive:!0,onClick:()=>i([]),"aria-label":n.clear},Object(l.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(o.createElement)("ul",null,r.map((e,t)=>Object(o.createElement)("li",{key:t},Object(o.createElement)(E,{label:e.name,id:e.id,remove:s})))):null)},_=e=>{let{filteredList:t,search:c,onSelect:r,instanceId:n,...a}=e;const{messages:u,renderItem:b,selected:d,isSingle:m}=a,g=b||j;return 0===t.length?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(o.createElement)(i.a,{icon:s.a})),Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(l.sprintf)(u.noResults,c):u.noItems)):Object(o.createElement)("ul",{className:"woocommerce-search-list__list"},Object(o.createElement)(w,{list:t,selected:d,renderItem:g,onSelect:r,instanceId:n,isSingle:m,search:c}))},y=e=>{const{className:t="",isCompact:c,isHierarchical:r,isLoading:l,isSingle:i,list:s,messages:u=m.a,onChange:g,onSearch:p,selected:h,debouncedSpeak:O}=e,[E,j]=Object(o.useState)(""),w=Object(d.useInstanceId)(y),k=Object(o.useMemo)(()=>({...m.a,...u}),[u]),x=Object(o.useMemo)(()=>Object(m.c)(s,E,r),[s,E,r]);Object(o.useEffect)(()=>{O&&O(k.updated)},[O,k]),Object(o.useEffect)(()=>{"function"==typeof p&&p(E)},[E,p]);const v=Object(o.useCallback)(e=>()=>{i&&g([]);const t=h.findIndex(t=>{let{id:c}=t;return c===e});g([...h.slice(0,t),...h.slice(t+1)])},[i,h,g]),S=Object(o.useCallback)(e=>()=>{-1===h.findIndex(t=>{let{id:c}=t;return c===e.id})?g(i?[e]:[...h,e]):v(e.id)()},[i,v,g,h]);return Object(o.createElement)("div",{className:b()("woocommerce-search-list",t,{"is-compact":c})},Object(o.createElement)(f,n()({},e,{onRemove:v,messages:k})),Object(o.createElement)("div",{className:"woocommerce-search-list__search"},Object(o.createElement)(a.TextControl,{label:k.search,type:"search",value:E,onChange:e=>j(e)})),l?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(o.createElement)(a.Spinner,null)):Object(o.createElement)(_,n()({},e,{search:E,filteredList:x,messages:k,onSelect:S,instanceId:w})))};Object(a.withSpokenMessages)(y)},98:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(3);t.a=e=>{let{value:t,setAttributes:c}=e;return Object(r.createElement)(o.SelectControl,{label:Object(n.__)("Order products by","woo-gutenberg-products-block"),value:t,options:[{label:Object(n.__)("Newness - newest first","woo-gutenberg-products-block"),value:"date"},{label:Object(n.__)("Price - low to high","woo-gutenberg-products-block"),value:"price_asc"},{label:Object(n.__)("Price - high to low","woo-gutenberg-products-block"),value:"price_desc"},{label:Object(n.__)("Rating - highest first","woo-gutenberg-products-block"),value:"rating"},{label:Object(n.__)("Sales - most first","woo-gutenberg-products-block"),value:"popularity"},{label:Object(n.__)("Title - alphabetical","woo-gutenberg-products-block"),value:"title"},{label:Object(n.__)("Menu Order","woo-gutenberg-products-block"),value:"menu_order"}],onChange:e=>c({orderby:e})})}}}); \ No newline at end of file diff --git a/build/products-by-attribute/block.json b/build/products-by-attribute/block.json new file mode 100644 index 00000000000..968e28868f0 --- /dev/null +++ b/build/products-by-attribute/block.json @@ -0,0 +1,89 @@ +{ + "name": "woocommerce/products-by-attribute", + "title": "Products by Attribute", + "category": "woocommerce", + "keywords": [ "WooCommerce" ], + "description": "Display a grid of products with selected attributes.", + "supports": { + "align": [ "wide", "full" ], + "html": false + }, + "attributes": { + "attributes": { + "type": "array", + "default": [] + }, + "attrOperator": { + "type": "string", + "enum": [ "all", "any" ], + "default": "any" + }, + "columns": { + "type": "number", + "default": 3 + }, + "contentVisibility": { + "type": "object", + "default": { + "image": true, + "title": true, + "price": true, + "rating": true, + "button": true + }, + "properties": { + "image": { + "type": "boolean", + "default": true + }, + "title": { + "type": "boolean", + "default": true + }, + "price": { + "type": "boolean", + "default": true + }, + "rating": { + "type": "boolean", + "default": true + }, + "button": { + "type": "boolean", + "default": true + } + } + }, + "orderby": { + "type": "string", + "enum": [ + "date", + "popularity", + "price_asc", + "price_desc", + "rating", + "title", + "menu_order" + ], + "default": "date" + }, + "rows": { + "type": "number", + "default": 3 + }, + "alignButtons": { + "type": "boolean", + "default": false + }, + "isPreview": { + "type": "boolean", + "default": false + }, + "stockStatus": { + "type": "array" + } + }, + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2, + "$schema": "https://schemas.wp.org/trunk/block.json" +} diff --git a/build/reviews-by-category.asset.php b/build/reviews-by-category.asset.php new file mode 100644 index 00000000000..09d8aa61eba --- /dev/null +++ b/build/reviews-by-category.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '39b2cea702b283cfeb9da7402ef6b64f'); \ No newline at end of file diff --git a/build/reviews-by-category.js b/build/reviews-by-category.js new file mode 100644 index 00000000000..f1c80d5822f --- /dev/null +++ b/build/reviews-by-category.js @@ -0,0 +1,24 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["reviews-by-category"]=function(e){function t(t){for(var o,s,a=t[0],i=t[1],l=t[2],u=0,b=[];uObject(o.createElement)(n.BlockControls,null,Object(o.createElement)(a.ToolbarGroup,{controls:[{icon:"edit",title:r,onClick:()=>t({editMode:!e}),isActive:e}]})),l=(e,t)=>{const r=Object(s.getSetting)("showAvatars",!0),n=Object(s.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.ToggleControl,{label:Object(c.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:()=>t({showReviewRating:!e.showReviewRating})}),e.showReviewRating&&!n&&Object(o.createElement)(a.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(c.__)("Product rating is disabled in your store settings.","woo-gutenberg-products-block"),{a:Object(o.createElement)("a",{href:Object(s.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(o.createElement)(a.ToggleControl,{label:Object(c.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:()=>t({showReviewerName:!e.showReviewerName})}),Object(o.createElement)(a.ToggleControl,{label:Object(c.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:()=>t({showReviewImage:!e.showReviewImage})}),Object(o.createElement)(a.ToggleControl,{label:Object(c.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:()=>t({showReviewDate:!e.showReviewDate})}),Object(o.createElement)(a.ToggleControl,{label:Object(c.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:()=>t({showReviewContent:!e.showReviewContent})}),e.showReviewImage&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.__experimentalToggleGroupControl,{label:Object(c.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,onChange:e=>t({imageType:e})},Object(o.createElement)(a.__experimentalToggleGroupControlOption,{value:"reviewer",label:Object(c.__)("Reviewer photo","woo-gutenberg-products-block")}),Object(o.createElement)(a.__experimentalToggleGroupControlOption,{value:"product",label:Object(c.__)("Product","woo-gutenberg-products-block")})),"reviewer"===e.imageType&&!r&&Object(o.createElement)(a.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(c.__)("Reviewer photo is disabled in your site settings.","woo-gutenberg-products-block"),{a:Object(o.createElement)("a",{href:Object(s.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},d=(e,t)=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.ToggleControl,{label:Object(c.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:()=>t({showOrderby:!e.showOrderby})}),Object(o.createElement)(a.SelectControl,{label:Object(c.__)("Order Product Reviews by","woo-gutenberg-products-block"),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:e=>t({orderby:e})}),Object(o.createElement)(a.RangeControl,{label:Object(c.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:e=>t({reviewsOnPageLoad:e}),max:20,min:1}),Object(o.createElement)(a.ToggleControl,{label:Object(c.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:()=>t({showLoadMore:!e.showLoadMore})}),e.showLoadMore&&Object(o.createElement)(a.RangeControl,{label:Object(c.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:e=>t({reviewsOnLoadMore:e}),max:20,min:1}))},11:function(e,t){e.exports=window.wp.primitives},114:function(e,t){},119:function(e,t,r){"use strict";var o=r(0),c=r(4),n=r.n(c),s=r(28),a=r(10);r(157),t.a=Object(a.withInstanceId)(e=>{let{className:t,instanceId:r,label:c="",onChange:a,options:i,screenReaderLabel:l,value:d=""}=e;const u="wc-block-components-sort-select__select-"+r;return Object(o.createElement)("div",{className:n()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(o.createElement)(s.a,{label:c,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:u}}),Object(o.createElement)("select",{id:u,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:a,value:d},i&&i.map(e=>Object(o.createElement)("option",{key:e.key,value:e.key},e.label))))})},12:function(e,t){e.exports=window.React},122:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var o=r(1),c=r(23);const n={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(o.__)("July 15, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(o.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#", +/* translators: An example person name used for the block previews. */ +reviewer:Object(o.__)("Alice","woo-gutenberg-products-block"),review:`

${Object(o.__)("I bought this product last week and I'm very happy with it.","woo-gutenberg-products-block")}

\n`,reviewer_avatar_urls:{48:c.o.defaultAvatar,96:c.o.defaultAvatar},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(o.__)("July 12, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(o.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#", +/* translators: An example person name used for the block previews. */ +reviewer:Object(o.__)("Bob","woo-gutenberg-products-block"),review:`

${Object(o.__)("This product is awesome, I love it!","woo-gutenberg-products-block")}

\n`,reviewer_avatar_urls:{48:c.o.defaultAvatar,96:c.o.defaultAvatar},rating:null,verified:!1}]}}},13:function(e,t){e.exports=window.wp.htmlEntities},14:function(e,t){e.exports=window.wp.apiFetch},143:function(e,t,r){"use strict";t.a={editMode:{type:"boolean",default:!0},imageType:{type:"string",default:"reviewer"},orderby:{type:"string",default:"most-recent"},reviewsOnLoadMore:{type:"number",default:10},reviewsOnPageLoad:{type:"number",default:10},showLoadMore:{type:"boolean",default:!0},showOrderby:{type:"boolean",default:!0},showReviewDate:{type:"boolean",default:!0},showReviewerName:{type:"boolean",default:!0},showReviewImage:{type:"boolean",default:!0},showReviewRating:{type:"boolean",default:!0},showReviewContent:{type:"boolean",default:!0},previewReviews:{type:"array",default:null}}},144:function(e,t,r){"use strict";var o=r(6),c=r.n(o),n=r(0),s=r(5),a=(r(156),r(57));t.a=e=>{let{attributes:t}=e;return Object(n.createElement)("div",c()({},s.useBlockProps.save({className:Object(a.a)(t)}),Object(a.b)(t)))}},147:function(e,t,r){"use strict";var o=r(0),c=r(1),n=r(7),s=r(3),a=r(5),i=r(12),l=r(2),d=r(73),u=r(28);r(181);var b=e=>{let{onClick:t,label:r=Object(c.__)("Load more","woo-gutenberg-products-block"),screenReaderLabel:n=Object(c.__)("Load more","woo-gutenberg-products-block")}=e;return Object(o.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(o.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(o.createElement)(u.a,{label:r,screenReaderLabel:n})))},m=r(119);r(178);var p=e=>{let{onChange:t,readOnly:r,value:n}=e;return Object(o.createElement)(m.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:Object(c.__)("Order by","woo-gutenberg-products-block"),onChange:t,options:[{key:"most-recent",label:Object(c.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(c.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(c.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(c.__)("Order reviews by","woo-gutenberg-products-block"),value:n})},g=r(4),w=r.n(g),h=r(24),v=r.n(h),O=r(167),_=r.n(O);const j=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";const o=_()(e,{suffix:r,limit:t});return o.html},f=(e,t,r)=>(t<=r?e.start=e.middle+1:e.end=e.middle-1,e),y=(e,t,r,o)=>{const c=((e,t,r)=>{let o={start:0,middle:0,end:e.length};for(;o.start<=o.end;)o.middle=Math.floor((o.start+o.end)/2),t.innerHTML=j(e,o.middle),o=f(o,t.clientHeight,r);return o.middle})(e,t,r);return j(e,c-o.length,o)},k={className:"read-more-content",ellipsis:"…",lessText:Object(c.__)("Read less","woo-gutenberg-products-block"),maxLines:3,moreText:Object(c.__)("Read more","woo-gutenberg-products-block")};class E extends i.Component{constructor(e){super(e),this.state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},this.reviewContent=Object(i.createRef)(),this.reviewSummary=Object(i.createRef)(),this.getButton=this.getButton.bind(this),this.onClick=this.onClick.bind(this)}componentDidMount(){this.setSummary()}componentDidUpdate(e){e.maxLines===this.props.maxLines&&e.children===this.props.children||this.setState({clampEnabled:null,summary:"."},this.setSummary)}setSummary(){if(this.props.children){const{maxLines:e,ellipsis:t}=this.props;if(!this.reviewSummary.current||!this.reviewContent.current)return;const r=(this.reviewSummary.current.clientHeight+1)*e+1,o=this.reviewContent.current.clientHeight+1>r;this.setState({clampEnabled:o}),o&&this.setState({summary:y(this.reviewContent.current.innerHTML,this.reviewSummary.current,r,t)})}}getButton(){const{isExpanded:e}=this.state,{className:t,lessText:r,moreText:c}=this.props,n=e?r:c;if(n)return Object(o.createElement)("a",{href:"#more",className:t+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},n)}onClick(e){e.preventDefault();const{isExpanded:t}=this.state;this.setState({isExpanded:!t})}render(){const{className:e}=this.props,{content:t,summary:r,clampEnabled:c,isExpanded:n}=this.state;return t?!1===c?Object(o.createElement)("div",{className:e},Object(o.createElement)("div",{ref:this.reviewContent},t)):Object(o.createElement)("div",{className:e},(!n||null===c)&&Object(o.createElement)("div",{ref:this.reviewSummary,"aria-hidden":n,dangerouslySetInnerHTML:{__html:r}}),(n||null===c)&&Object(o.createElement)("div",{ref:this.reviewContent,"aria-hidden":!n},t),this.getButton()):null}}v()(E,"defaultProps",k);var R=E;r(180);var C=e=>{let{attributes:t,review:r={}}=e;const{imageType:n,showReviewDate:s,showReviewerName:a,showReviewImage:i,showReviewRating:l,showReviewContent:d,showProductName:u}=t,{rating:b}=r,m=!Object.keys(r).length>0,p=Number.isFinite(b)&&l;return Object(o.createElement)("li",{className:w()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":m,"wc-block-components-review-list-item__item--has-image":i}),"aria-hidden":m},(u||s||a||i||p)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},i&&function(e,t,r){var n,s;return r||!e?Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(o.createElement)("img",{"aria-hidden":"true",alt:(null===(n=e.product_image)||void 0===n?void 0:n.alt)||"",src:(null===(s=e.product_image)||void 0===s?void 0:s.thumbnail)||""}):Object(o.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[96]||""}),e.verified&&Object(o.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(c.__)("Verified buyer","woo-gutenberg-products-block")},Object(c.__)("Verified buyer","woo-gutenberg-products-block")))}(r,n,m),(u||a||p||s)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},p&&function(e){const{rating:t}=e,r={width:t/5*100+"%"},n=Object(c.sprintf)( +/* translators: %f is referring to the average rating value */ +Object(c.__)("Rated %f out of 5","woo-gutenberg-products-block"),t),s={__html:Object(c.sprintf)( +/* translators: %s is referring to the average rating value */ +Object(c.__)("Rated %s out of 5","woo-gutenberg-products-block"),Object(c.sprintf)('%f',t))};return Object(o.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(o.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":n},Object(o.createElement)("span",{style:r,dangerouslySetInnerHTML:s})))}(r),u&&function(e){return Object(o.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(o.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(r),a&&function(e){const{reviewer:t=""}=e;return Object(o.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},t)}(r),s&&function(e){const{date_created:t,formatted_date_created:r}=e;return Object(o.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(r))),d&&function(e){return Object(o.createElement)(R,{maxLines:10,moreText:Object(c.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(c.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(o.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(r))};r(179);var S=e=>{let{attributes:t,reviews:r}=e;const c=Object(l.getSetting)("showAvatars",!0),n=Object(l.getSetting)("reviewRatingsEnabled",!0),s=(c||"product"===t.imageType)&&t.showReviewImage,a=n&&t.showReviewRating,i={...t,showReviewImage:s,showReviewRating:a};return Object(o.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(o.createElement)(C,{attributes:i}):r.map((e,t)=>Object(o.createElement)(C,{key:e.id||t,attributes:i,review:e})))},N=r(6),P=r.n(N),L=r(22),T=r.n(L),I=r(57),x=r(27);class A extends i.Component{render(){const{attributes:e,error:t,isLoading:r,noReviewsPlaceholder:n,reviews:a,totalReviews:i}=this.props;if(t)return Object(o.createElement)(d.a,{className:"wc-block-featured-product-error",error:t,isLoading:r});if(0===a.length&&!r)return Object(o.createElement)(n,{attributes:e});const u=Object(l.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(s.Disabled,null,e.showOrderby&&u&&Object(o.createElement)(p,{readOnly:!0,value:e.orderby}),Object(o.createElement)(S,{attributes:e,reviews:a}),e.showLoadMore&&i>a.length&&Object(o.createElement)(b,{screenReaderLabel:Object(c.__)("Load more reviews","woo-gutenberg-products-block")}))}}var M=(e=>{class t extends i.Component{constructor(){super(...arguments),v()(this,"isPreview",!!this.props.attributes.previewReviews),v()(this,"delayedAppendReviews",this.props.delayFunction(this.appendReviews)),v()(this,"isMounted",!1),v()(this,"state",{error:null,loading:!0,reviews:this.isPreview?this.props.attributes.previewReviews:[],totalReviews:this.isPreview?this.props.attributes.previewReviews.length:0}),v()(this,"setError",async e=>{if(!this.isMounted)return;const{onReviewsLoadError:t}=this.props,r=await Object(x.a)(e);this.setState({reviews:[],loading:!1,error:r}),t(r)})}componentDidMount(){this.isMounted=!0,this.replaceReviews()}componentDidUpdate(e){e.reviewsToDisplay0&&void 0!==arguments[0]?arguments[0]:[];const{reviewsToDisplay:t}=this.props,{totalReviews:r}=this.state,o=Math.min(r,t)-e.length;return this.setState({loading:!0,reviews:e.concat(Array(o).fill({}))}),Object(I.c)(this.getArgs(e.length)).then(t=>{let{reviews:r,totalReviews:o}=t;return this.isMounted&&this.setState({reviews:e.filter(e=>Object.keys(e).length).concat(r),totalReviews:o,loading:!1,error:null}),{newReviews:r}}).catch(this.setError)}render(){const{reviewsToDisplay:t}=this.props,{error:r,loading:c,reviews:n,totalReviews:s}=this.state;return Object(o.createElement)(e,P()({},this.props,{error:r,isLoading:c,reviews:n.slice(0,t),totalReviews:s}))}}v()(t,"defaultProps",{delayFunction:e=>e,onReviewsAppended:()=>{},onReviewsLoadError:()=>{},onReviewsReplaced:()=>{}});const{displayName:r=e.name||"Component"}=e;return t.displayName=`WithReviews( ${r} )`,t})(A);t.a=e=>{let{attributes:t,icon:r,name:i,noReviewsPlaceholder:l}=e;const{categoryIds:d,productId:u,reviewsOnPageLoad:b,showProductName:m,showReviewDate:p,showReviewerName:g,showReviewContent:w,showReviewImage:h,showReviewRating:v}=t,{order:O,orderby:_}=Object(I.d)(t.orderby),j=!(w||v||p||g||h||m),f=Object(a.useBlockProps)({className:Object(I.a)(t)});return j?Object(o.createElement)(s.Placeholder,{icon:r,label:i},Object(c.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block")):Object(o.createElement)("div",f,Object(o.createElement)(M,{attributes:t,categoryIds:d,delayFunction:e=>Object(n.debounce)(e,400),noReviewsPlaceholder:l,orderby:_,order:O,productId:u,reviewsToDisplay:b}))}},15:function(e,t){e.exports=window.wp.url},156:function(e,t){},157:function(e,t){},178:function(e,t){},179:function(e,t){},180:function(e,t){},181:function(e,t){},19:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"c",(function(){return i})),r.d(t,"d",(function(){return l})),r.d(t,"b",(function(){return d}));var o=r(0),c=r(7),n=r(1);const s={clear:Object(n.__)("Clear all selected items","woo-gutenberg-products-block"),noItems:Object(n.__)("No items found.","woo-gutenberg-products-block"), +/* Translators: %s search term */ +noResults:Object(n.__)("No results for %s","woo-gutenberg-products-block"),search:Object(n.__)("Search for items","woo-gutenberg-products-block"),selected:e=>Object(n.sprintf)( +/* translators: Number of items selected from list. */ +Object(n._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(n.__)("Search results updated.","woo-gutenberg-products-block")},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const r=Object(c.groupBy)(e,"parent"),o=Object(c.keyBy)(t,"id"),n=["0"],s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=s(o[e.parent]);return[...t,e.name]},a=e=>e.map(e=>{const t=r[e.id];return n.push(""+e.id),{...e,breadcrumbs:s(o[e.parent]),children:t&&t.length?a(t):[]}}),i=a(r[0]||[]);return Object.entries(r).forEach(e=>{let[t,r]=e;n.includes(t)||i.push(...a(r||[]))}),i},i=(e,t,r)=>{if(!t)return r?a(e):e;const o=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),c=e.map(e=>!!o.test(e.name)&&e).filter(Boolean);return r?a(c,e):c},l=(e,t)=>{if(!t)return e;const r=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(r).map((e,t)=>r.test(e)?Object(o.createElement)("strong",{key:t},e):Object(o.createElement)(o.Fragment,{key:t},e))},d=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},2:function(e,t){e.exports=window.wc.wcSettings},22:function(e,t){e.exports=window.wp.isShallowEqual},23:function(e,t,r){"use strict";r.d(t,"o",(function(){return n})),r.d(t,"m",(function(){return s})),r.d(t,"l",(function(){return a})),r.d(t,"n",(function(){return i})),r.d(t,"j",(function(){return l})),r.d(t,"e",(function(){return d})),r.d(t,"f",(function(){return u})),r.d(t,"g",(function(){return b})),r.d(t,"k",(function(){return m})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return g})),r.d(t,"h",(function(){return w})),r.d(t,"a",(function(){return h})),r.d(t,"i",(function(){return v})),r.d(t,"b",(function(){return O}));var o,c=r(2);const n=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),s=n.pluginUrl+"images/",a=n.pluginUrl+"build/",i=n.buildPhase,l=null===(o=c.STORE_PAGES.shop)||void 0===o?void 0:o.permalink,d=c.STORE_PAGES.checkout.id,u=c.STORE_PAGES.checkout.permalink,b=c.STORE_PAGES.privacy.permalink,m=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),p=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),g=c.STORE_PAGES.cart.permalink,w=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),h=Object(c.getSetting)("allowedCountries",{}),v=Object(c.getSetting)("shippingStates",{}),O=Object(c.getSetting)("allowedStates",{})},25:function(e,t,r){"use strict";r.d(t,"h",(function(){return l})),r.d(t,"e",(function(){return d})),r.d(t,"b",(function(){return u})),r.d(t,"i",(function(){return b})),r.d(t,"f",(function(){return m})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return g})),r.d(t,"g",(function(){return w})),r.d(t,"a",(function(){return h}));var o=r(15),c=r(14),n=r.n(c),s=r(7),a=r(2),i=r(23);const l=e=>{let{selected:t=[],search:r="",queryArgs:c={}}=e;const a=(e=>{let{selected:t=[],search:r="",queryArgs:c={}}=e;const n=i.o.productCount>100,s={per_page:n?100:0,catalog_visibility:"any",search:r,orderby:"title",order:"asc"},a=[Object(o.addQueryArgs)("/wc/store/v1/products",{...s,...c})];return n&&t.length&&a.push(Object(o.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),a})({selected:t,search:r,queryArgs:c});return Promise.all(a.map(e=>n()({path:e}))).then(e=>Object(s.uniqBy)(Object(s.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},d=e=>n()({path:"/wc/store/v1/products/"+e}),u=()=>n()({path:"wc/store/v1/products/attributes"}),b=e=>n()({path:`wc/store/v1/products/attributes/${e}/terms`}),m=e=>{let{selected:t=[],search:r}=e;const c=(e=>{let{selected:t=[],search:r}=e;const c=Object(a.getSetting)("limitTags",!1),n=[Object(o.addQueryArgs)("wc/store/v1/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:r})];return c&&t.length&&n.push(Object(o.addQueryArgs)("wc/store/v1/products/tags",{include:t})),n})({selected:t,search:r});return Promise.all(c.map(e=>n()({path:e}))).then(e=>Object(s.uniqBy)(Object(s.flatten)(e),"id"))},p=e=>n()({path:Object(o.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),g=e=>n()({path:"wc/store/v1/products/categories/"+e}),w=e=>n()({path:Object(o.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),h=(e,t)=>{if(!e.title.raw)return e.slug;const r=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(r?"":" - "+e.slug)}},27:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return s}));var o=r(1),c=r(13);const n=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},s=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(c.decodeEntities)(e.message):Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},28:function(e,t,r){"use strict";var o=r(0),c=r(4),n=r.n(c);t.a=e=>{let t,{label:r,screenReaderLabel:c,wrapperElement:s,wrapperProps:a={}}=e;const i=null!=r,l=null!=c;return!i&&l?(t=s||"span",a={...a,className:n()(a.className,"screen-reader-text")},Object(o.createElement)(t,a,c)):(t=s||o.Fragment,i&&l&&r!==c?Object(o.createElement)(t,a,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},c)):Object(o.createElement)(t,a,r))}},3:function(e,t){e.exports=window.wp.components},32:function(e,t,r){"use strict";var o=r(0),c=r(1),n=r(33);t.a=e=>{let{error:t}=e;return Object(o.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:r}=e;return t?"general"===r?Object(o.createElement)("span",null,Object(c.__)("The following error was returned","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(n.escapeHTML)(t))):"api"===r?Object(o.createElement)("span",null,Object(c.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(n.escapeHTML)(t))):t:Object(c.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},33:function(e,t){e.exports=window.wp.escapeHtml},36:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var o=r(6),c=r.n(o),n=r(0),s=r(19);const a=e=>{let{countLabel:t,className:r,depth:o=0,controlId:a="",item:i,isSelected:l,isSingle:d,onSelect:u,search:b="",...m}=e;const p=null!=t&&void 0!==i.count&&null!==i.count,g=[r,"woocommerce-search-list__item"];g.push("depth-"+o),d&&g.push("is-radio-button"),p&&g.push("has-count");const w=i.breadcrumbs&&i.breadcrumbs.length,h=m.name||"search-list-item-"+a,v=`${h}-${i.id}`;return Object(n.createElement)("label",{htmlFor:v,className:g.join(" ")},d?Object(n.createElement)("input",c()({type:"radio",id:v,name:h,value:i.value,onChange:u(i),checked:l,className:"woocommerce-search-list__item-input"},m)):Object(n.createElement)("input",c()({type:"checkbox",id:v,name:h,value:i.value,onChange:u(i),checked:l,className:"woocommerce-search-list__item-input"},m)),Object(n.createElement)("span",{className:"woocommerce-search-list__item-label"},w?Object(n.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(s.b)(i.breadcrumbs)):null,Object(n.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(s.d)(i.name,b))),!!p&&Object(n.createElement)("span",{className:"woocommerce-search-list__item-count"},t||i.count))};t.b=a},368:function(e,t,r){e.exports=r(477)},477:function(e,t,r){"use strict";r.r(t);var o=r(0),c=r(1),n=r(8),s=r(113),a=r(329),i=r(5),l=r(3),d=r(56),u=r(147),b=()=>Object(o.createElement)(l.Placeholder,{className:"wc-block-reviews-by-category",icon:Object(o.createElement)(s.a,{icon:a.a,className:"block-editor-block-icon"}),label:Object(c.__)("Reviews by Category","woo-gutenberg-products-block")},Object(c.__)("This block lists reviews for products from selected categories. The selected categories do not have any reviews yet, but they will show up here when they do.","woo-gutenberg-products-block")),m=r(105),p=Object(l.withSpokenMessages)(e=>{let{attributes:t,debouncedSpeak:r,setAttributes:n}=e;const{editMode:p,categoryIds:g}=t;if(!g||p)return Object(o.createElement)(l.Placeholder,{icon:Object(o.createElement)(s.a,{icon:a.a,className:"block-editor-block-icon"}),label:Object(c.__)("Reviews by Category","woo-gutenberg-products-block"),className:"wc-block-reviews-by-category"},Object(c.__)("Show product reviews from specific categories.","woo-gutenberg-products-block"),Object(o.createElement)("div",{className:"wc-block-reviews__selection"},Object(o.createElement)(d.a,{selected:t.categoryIds,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e.map(e=>{let{id:t}=e;return t});n({categoryIds:t})},showReviewCount:!0}),Object(o.createElement)(l.Button,{isPrimary:!0,onClick:()=>{n({editMode:!1}),r(Object(c.__)("Showing Reviews by Category block preview.","woo-gutenberg-products-block"))}},Object(c.__)("Done","woo-gutenberg-products-block"))));const w=Object(c.__)("Edit selected categories","woo-gutenberg-products-block");return Object(o.createElement)(o.Fragment,null,Object(m.a)(p,n,w),Object(o.createElement)(i.InspectorControls,{key:"inspector"},Object(o.createElement)(l.PanelBody,{title:Object(c.__)("Category","woo-gutenberg-products-block"),initialOpen:!1},Object(o.createElement)(d.a,{selected:t.categoryIds,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e.map(e=>{let{id:t}=e;return t});n({categoryIds:t})},isCompact:!0,showReviewCount:!0})),Object(o.createElement)(l.PanelBody,{title:Object(c.__)("Content","woo-gutenberg-products-block")},Object(o.createElement)(l.ToggleControl,{label:Object(c.__)("Product name","woo-gutenberg-products-block"),checked:t.showProductName,onChange:()=>n({showProductName:!t.showProductName})}),Object(m.b)(t,n)),Object(o.createElement)(l.PanelBody,{title:Object(c.__)("List Settings","woo-gutenberg-products-block")},Object(m.c)(t,n))),Object(o.createElement)(u.a,{attributes:t,icon:Object(o.createElement)(s.a,{icon:a.a,className:"block-editor-block-icon"}),name:Object(c.__)("Reviews by Category","woo-gutenberg-products-block"),noReviewsPlaceholder:b}))}),g=r(143),w=r(144),h=r(122);Object(n.registerBlockType)("woocommerce/reviews-by-category",{apiVersion:2,title:Object(c.__)("Reviews by Category","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(s.a,{icon:a.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(c.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(c.__)("Show product reviews from specific categories.","woo-gutenberg-products-block"),supports:{html:!1,color:{background:!1},typography:{fontSize:!0}},example:{...h.a,attributes:{...h.a.attributes,categoryIds:[1],showProductName:!0}},attributes:{...g.a,categoryIds:{type:"array",default:[]},showProductName:{type:"boolean",default:!0}},edit:e=>Object(o.createElement)(p,e),save:w.a})},5:function(e,t){e.exports=window.wp.blockEditor},56:function(e,t,r){"use strict";var o=r(6),c=r.n(o),n=r(0),s=r(1),a=r(36),i=r(97),l=r(3),d=r(10),u=r(25),b=r(27),m=Object(d.createHigherOrderComponent)(e=>class extends n.Component{constructor(){super(...arguments),this.state={error:null,loading:!1,categories:[]},this.loadCategories=this.loadCategories.bind(this)}componentDidMount(){this.loadCategories()}loadCategories(){this.setState({loading:!0}),Object(u.c)().then(e=>{this.setState({categories:e,loading:!1,error:null})}).catch(async e=>{const t=await Object(b.a)(e);this.setState({categories:[],loading:!1,error:t})})}render(){const{error:t,loading:r,categories:o}=this.state;return Object(n.createElement)(e,c()({},this.props,{error:t,isLoading:r,categories:o}))}},"withCategories"),p=r(32),g=r(4),w=r.n(g);r(89);const h=e=>{let{categories:t,error:r,isLoading:o,onChange:d,onOperatorChange:u,operator:b,selected:m,isCompact:g,isSingle:h,showReviewCount:v}=e;const O={clear:Object(s.__)("Clear all product categories","woo-gutenberg-products-block"),list:Object(s.__)("Product Categories","woo-gutenberg-products-block"),noItems:Object(s.__)("Your store doesn't have any product categories.","woo-gutenberg-products-block"),search:Object(s.__)("Search for product categories","woo-gutenberg-products-block"),selected:e=>Object(s.sprintf)( +/* translators: %d is the count of selected categories. */ +Object(s._n)("%d category selected","%d categories selected",e,"woo-gutenberg-products-block"),e),updated:Object(s.__)("Category search results updated.","woo-gutenberg-products-block")};return r?Object(n.createElement)(p.a,{error:r}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.a,{className:"woocommerce-product-categories",list:t,isLoading:o,selected:m.map(e=>t.find(t=>t.id===e)).filter(Boolean),onChange:d,renderItem:e=>{const{item:t,search:r,depth:o=0}=e,i=t.breadcrumbs.length?`${t.breadcrumbs.join(", ")}, ${t.name}`:t.name,l=v?Object(s.sprintf)( +/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */ +Object(s._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,"woo-gutenberg-products-block"),i,t.review_count):Object(s.sprintf)( +/* translators: %1$s is the item name, %2$d is the count of products for the item. */ +Object(s._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,"woo-gutenberg-products-block"),i,t.count),d=v?Object(s.sprintf)( +/* translators: %d is the count of reviews. */ +Object(s._n)("%d review","%d reviews",t.review_count,"woo-gutenberg-products-block"),t.review_count):Object(s.sprintf)( +/* translators: %d is the count of products. */ +Object(s._n)("%d product","%d products",t.count,"woo-gutenberg-products-block"),t.count);return Object(n.createElement)(a.a,c()({className:w()("woocommerce-product-categories__item","has-count",{"is-searching":r.length>0,"is-skip-level":0===o&&0!==t.parent})},e,{countLabel:d,"aria-label":l}))},messages:O,isCompact:g,isHierarchical:!0,isSingle:h}),!!u&&Object(n.createElement)("div",{hidden:m.length<2},Object(n.createElement)(l.SelectControl,{className:"woocommerce-product-categories__operator",label:Object(s.__)("Display products matching","woo-gutenberg-products-block"),help:Object(s.__)("Pick at least two categories to use this setting.","woo-gutenberg-products-block"),value:b,onChange:u,options:[{label:Object(s.__)("Any selected categories","woo-gutenberg-products-block"),value:"any"},{label:Object(s.__)("All selected categories","woo-gutenberg-products-block"),value:"all"}]})))};h.defaultProps={operator:"any",isCompact:!1,isSingle:!1},t.a=m(h)},57:function(e,t,r){"use strict";r.d(t,"d",(function(){return i})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return u}));var o=r(14),c=r.n(o),n=r(4),s=r.n(n),a=r(2);const i=e=>{if(Object(a.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=e=>c()({path:"/wc/store/v1/products/reviews?"+Object.entries(e).map(e=>e.join("=")).join("&"),parse:!1}).then(e=>e.json().then(t=>({reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}))),d=e=>{const{className:t,categoryIds:r,productId:o,showReviewDate:c,showReviewerName:n,showReviewContent:a,showProductName:i,showReviewImage:l,showReviewRating:d}=e;let u="wc-block-all-reviews";return o&&(u="wc-block-reviews-by-product"),Array.isArray(r)&&(u="wc-block-reviews-by-category"),s()(u,t,{"has-image":l,"has-name":n,"has-date":c,"has-rating":d,"has-content":a,"has-product-name":i})},u=e=>{const{categoryIds:t,imageType:r,orderby:o,productId:c,reviewsOnPageLoad:n,reviewsOnLoadMore:s,showLoadMore:a,showOrderby:i}=e,l={"data-image-type":r,"data-orderby":o,"data-reviews-on-page-load":n,"data-reviews-on-load-more":s,"data-show-load-more":a,"data-show-orderby":i};return c&&(l["data-product-id"]=c),Array.isArray(t)&&(l["data-category-ids"]=t.join(",")),l}},7:function(e,t){e.exports=window.lodash},73:function(e,t,r){"use strict";var o=r(0),c=r(1),n=r(113),s=r(172),a=r(4),i=r.n(a),l=r(3),d=r(32);r(114),t.a=e=>{let{className:t,error:r,isLoading:a=!1,onRetry:u}=e;return Object(o.createElement)(l.Placeholder,{icon:Object(o.createElement)(n.a,{icon:s.a}),label:Object(c.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:i()("wc-block-api-error",t)},Object(o.createElement)(d.a,{error:r}),u&&Object(o.createElement)(o.Fragment,null,a?Object(o.createElement)(l.Spinner,null):Object(o.createElement)(l.Button,{isSecondary:!0,onClick:u},Object(c.__)("Retry","woo-gutenberg-products-block"))))}},8:function(e,t){e.exports=window.wp.blocks},89:function(e,t){},97:function(e,t,r){"use strict";r.d(t,"a",(function(){return y}));var o=r(6),c=r.n(o),n=r(0),s=r(1),a=r(3),i=r(113),l=r(498),d=r(4),u=r.n(d),b=r(10),m=r(19),p=r(36),g=r(497),w=r(13);const h=e=>{let{id:t,label:r,popoverContents:o,remove:c,screenReaderLabel:l,className:d=""}=e;const[m,p]=Object(n.useState)(!1),v=Object(b.useInstanceId)(h);if(l=l||r,!r)return null;r=Object(w.decodeEntities)(r);const O=u()("woocommerce-tag",d,{"has-remove":!!c}),_="woocommerce-tag__label-"+v,j=Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"screen-reader-text"},l),Object(n.createElement)("span",{"aria-hidden":"true"},r));return Object(n.createElement)("span",{className:O},o?Object(n.createElement)(a.Button,{className:"woocommerce-tag__text",id:_,onClick:()=>p(!0)},j):Object(n.createElement)("span",{className:"woocommerce-tag__text",id:_},j),o&&m&&Object(n.createElement)(a.Popover,{onClose:()=>p(!1)},o),c&&Object(n.createElement)(a.Button,{className:"woocommerce-tag__remove",onClick:c(t),label:Object(s.sprintf)(// Translators: %s label. +Object(s.__)("Remove %s","woo-gutenberg-products-block"),r),"aria-describedby":_},Object(n.createElement)(i.a,{icon:g.a,size:20,className:"clear-icon"})))};var v=h;const O=e=>Object(n.createElement)(p.b,e),_=e=>{const{list:t,selected:r,renderItem:o,depth:s=0,onSelect:a,instanceId:i,isSingle:l,search:d}=e;return t?Object(n.createElement)(n.Fragment,null,t.map(t=>{const u=-1!==r.findIndex(e=>{let{id:r}=e;return r===t.id});return Object(n.createElement)(n.Fragment,{key:t.id},Object(n.createElement)("li",null,o({item:t,isSelected:u,onSelect:a,isSingle:l,search:d,depth:s,controlId:i})),Object(n.createElement)(_,c()({},e,{list:t.children,depth:s+1})))})):null},j=e=>{let{isLoading:t,isSingle:r,selected:o,messages:c,onChange:i,onRemove:l}=e;if(t||r||!o)return null;const d=o.length;return Object(n.createElement)("div",{className:"woocommerce-search-list__selected"},Object(n.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(n.createElement)("strong",null,c.selected(d)),d>0?Object(n.createElement)(a.Button,{isLink:!0,isDestructive:!0,onClick:()=>i([]),"aria-label":c.clear},Object(s.__)("Clear all","woo-gutenberg-products-block")):null),d>0?Object(n.createElement)("ul",null,o.map((e,t)=>Object(n.createElement)("li",{key:t},Object(n.createElement)(v,{label:e.name,id:e.id,remove:l})))):null)},f=e=>{let{filteredList:t,search:r,onSelect:o,instanceId:c,...a}=e;const{messages:d,renderItem:u,selected:b,isSingle:m}=a,p=u||O;return 0===t.length?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(n.createElement)(i.a,{icon:l.a})),Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-text"},r?Object(s.sprintf)(d.noResults,r):d.noItems)):Object(n.createElement)("ul",{className:"woocommerce-search-list__list"},Object(n.createElement)(_,{list:t,selected:b,renderItem:p,onSelect:o,instanceId:c,isSingle:m,search:r}))},y=e=>{const{className:t="",isCompact:r,isHierarchical:o,isLoading:s,isSingle:i,list:l,messages:d=m.a,onChange:p,onSearch:g,selected:w,debouncedSpeak:h}=e,[v,O]=Object(n.useState)(""),_=Object(b.useInstanceId)(y),k=Object(n.useMemo)(()=>({...m.a,...d}),[d]),E=Object(n.useMemo)(()=>Object(m.c)(l,v,o),[l,v,o]);Object(n.useEffect)(()=>{h&&h(k.updated)},[h,k]),Object(n.useEffect)(()=>{"function"==typeof g&&g(v)},[v,g]);const R=Object(n.useCallback)(e=>()=>{i&&p([]);const t=w.findIndex(t=>{let{id:r}=t;return r===e});p([...w.slice(0,t),...w.slice(t+1)])},[i,w,p]),C=Object(n.useCallback)(e=>()=>{-1===w.findIndex(t=>{let{id:r}=t;return r===e.id})?p(i?[e]:[...w,e]):R(e.id)()},[i,R,p,w]);return Object(n.createElement)("div",{className:u()("woocommerce-search-list",t,{"is-compact":r})},Object(n.createElement)(j,c()({},e,{onRemove:R,messages:k})),Object(n.createElement)("div",{className:"woocommerce-search-list__search"},Object(n.createElement)(a.TextControl,{label:k.search,type:"search",value:v,onChange:e=>O(e)})),s?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(n.createElement)(a.Spinner,null)):Object(n.createElement)(f,c()({},e,{search:v,filteredList:E,messages:k,onSelect:C,instanceId:_})))};Object(a.withSpokenMessages)(y)}}); \ No newline at end of file diff --git a/build/reviews-by-product.asset.php b/build/reviews-by-product.asset.php new file mode 100644 index 00000000000..de26d86a57f --- /dev/null +++ b/build/reviews-by-product.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '874210ec1e2354ac4be260785c8aaf4e'); \ No newline at end of file diff --git a/build/reviews-by-product.js b/build/reviews-by-product.js new file mode 100644 index 00000000000..7924d6a6e8e --- /dev/null +++ b/build/reviews-by-product.js @@ -0,0 +1,24 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["reviews-by-product"]=function(e){function t(t){for(var o,s,a=t[0],i=t[1],l=t[2],u=0,b=[];uObject(o.createElement)(c.BlockControls,null,Object(o.createElement)(a.ToolbarGroup,{controls:[{icon:"edit",title:r,onClick:()=>t({editMode:!e}),isActive:e}]})),l=(e,t)=>{const r=Object(s.getSetting)("showAvatars",!0),c=Object(s.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.ToggleControl,{label:Object(n.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:()=>t({showReviewRating:!e.showReviewRating})}),e.showReviewRating&&!c&&Object(o.createElement)(a.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Product rating is disabled in your store settings.","woo-gutenberg-products-block"),{a:Object(o.createElement)("a",{href:Object(s.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(o.createElement)(a.ToggleControl,{label:Object(n.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:()=>t({showReviewerName:!e.showReviewerName})}),Object(o.createElement)(a.ToggleControl,{label:Object(n.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:()=>t({showReviewImage:!e.showReviewImage})}),Object(o.createElement)(a.ToggleControl,{label:Object(n.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:()=>t({showReviewDate:!e.showReviewDate})}),Object(o.createElement)(a.ToggleControl,{label:Object(n.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:()=>t({showReviewContent:!e.showReviewContent})}),e.showReviewImage&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.__experimentalToggleGroupControl,{label:Object(n.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,onChange:e=>t({imageType:e})},Object(o.createElement)(a.__experimentalToggleGroupControlOption,{value:"reviewer",label:Object(n.__)("Reviewer photo","woo-gutenberg-products-block")}),Object(o.createElement)(a.__experimentalToggleGroupControlOption,{value:"product",label:Object(n.__)("Product","woo-gutenberg-products-block")})),"reviewer"===e.imageType&&!r&&Object(o.createElement)(a.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Reviewer photo is disabled in your site settings.","woo-gutenberg-products-block"),{a:Object(o.createElement)("a",{href:Object(s.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},d=(e,t)=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.ToggleControl,{label:Object(n.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:()=>t({showOrderby:!e.showOrderby})}),Object(o.createElement)(a.SelectControl,{label:Object(n.__)("Order Product Reviews by","woo-gutenberg-products-block"),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:e=>t({orderby:e})}),Object(o.createElement)(a.RangeControl,{label:Object(n.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:e=>t({reviewsOnPageLoad:e}),max:20,min:1}),Object(o.createElement)(a.ToggleControl,{label:Object(n.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:()=>t({showLoadMore:!e.showLoadMore})}),e.showLoadMore&&Object(o.createElement)(a.RangeControl,{label:Object(n.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:e=>t({reviewsOnLoadMore:e}),max:20,min:1}))},11:function(e,t){e.exports=window.wp.primitives},114:function(e,t){},119:function(e,t,r){"use strict";var o=r(0),n=r(4),c=r.n(n),s=r(28),a=r(10);r(157),t.a=Object(a.withInstanceId)(e=>{let{className:t,instanceId:r,label:n="",onChange:a,options:i,screenReaderLabel:l,value:d=""}=e;const u="wc-block-components-sort-select__select-"+r;return Object(o.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(o.createElement)(s.a,{label:n,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:u}}),Object(o.createElement)("select",{id:u,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:a,value:d},i&&i.map(e=>Object(o.createElement)("option",{key:e.key,value:e.key},e.label))))})},12:function(e,t){e.exports=window.React},122:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var o=r(1),n=r(23);const c={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(o.__)("July 15, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(o.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#", +/* translators: An example person name used for the block previews. */ +reviewer:Object(o.__)("Alice","woo-gutenberg-products-block"),review:`

${Object(o.__)("I bought this product last week and I'm very happy with it.","woo-gutenberg-products-block")}

\n`,reviewer_avatar_urls:{48:n.o.defaultAvatar,96:n.o.defaultAvatar},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(o.__)("July 12, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(o.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#", +/* translators: An example person name used for the block previews. */ +reviewer:Object(o.__)("Bob","woo-gutenberg-products-block"),review:`

${Object(o.__)("This product is awesome, I love it!","woo-gutenberg-products-block")}

\n`,reviewer_avatar_urls:{48:n.o.defaultAvatar,96:n.o.defaultAvatar},rating:null,verified:!1}]}}},13:function(e,t){e.exports=window.wp.htmlEntities},134:function(e,t){},14:function(e,t){e.exports=window.wp.apiFetch},143:function(e,t,r){"use strict";t.a={editMode:{type:"boolean",default:!0},imageType:{type:"string",default:"reviewer"},orderby:{type:"string",default:"most-recent"},reviewsOnLoadMore:{type:"number",default:10},reviewsOnPageLoad:{type:"number",default:10},showLoadMore:{type:"boolean",default:!0},showOrderby:{type:"boolean",default:!0},showReviewDate:{type:"boolean",default:!0},showReviewerName:{type:"boolean",default:!0},showReviewImage:{type:"boolean",default:!0},showReviewRating:{type:"boolean",default:!0},showReviewContent:{type:"boolean",default:!0},previewReviews:{type:"array",default:null}}},144:function(e,t,r){"use strict";var o=r(6),n=r.n(o),c=r(0),s=r(5),a=(r(156),r(57));t.a=e=>{let{attributes:t}=e;return Object(c.createElement)("div",n()({},s.useBlockProps.save({className:Object(a.a)(t)}),Object(a.b)(t)))}},147:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(7),s=r(3),a=r(5),i=r(12),l=r(2),d=r(73),u=r(28);r(181);var b=e=>{let{onClick:t,label:r=Object(n.__)("Load more","woo-gutenberg-products-block"),screenReaderLabel:c=Object(n.__)("Load more","woo-gutenberg-products-block")}=e;return Object(o.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(o.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(o.createElement)(u.a,{label:r,screenReaderLabel:c})))},m=r(119);r(178);var p=e=>{let{onChange:t,readOnly:r,value:c}=e;return Object(o.createElement)(m.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:Object(n.__)("Order by","woo-gutenberg-products-block"),onChange:t,options:[{key:"most-recent",label:Object(n.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(n.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(n.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(n.__)("Order reviews by","woo-gutenberg-products-block"),value:c})},w=r(4),g=r.n(w),h=r(24),v=r.n(h),O=r(167),j=r.n(O);const _=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";const o=j()(e,{suffix:r,limit:t});return o.html},f=(e,t,r)=>(t<=r?e.start=e.middle+1:e.end=e.middle-1,e),y=(e,t,r,o)=>{const n=((e,t,r)=>{let o={start:0,middle:0,end:e.length};for(;o.start<=o.end;)o.middle=Math.floor((o.start+o.end)/2),t.innerHTML=_(e,o.middle),o=f(o,t.clientHeight,r);return o.middle})(e,t,r);return _(e,n-o.length,o)},k={className:"read-more-content",ellipsis:"…",lessText:Object(n.__)("Read less","woo-gutenberg-products-block"),maxLines:3,moreText:Object(n.__)("Read more","woo-gutenberg-products-block")};class E extends i.Component{constructor(e){super(e),this.state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},this.reviewContent=Object(i.createRef)(),this.reviewSummary=Object(i.createRef)(),this.getButton=this.getButton.bind(this),this.onClick=this.onClick.bind(this)}componentDidMount(){this.setSummary()}componentDidUpdate(e){e.maxLines===this.props.maxLines&&e.children===this.props.children||this.setState({clampEnabled:null,summary:"."},this.setSummary)}setSummary(){if(this.props.children){const{maxLines:e,ellipsis:t}=this.props;if(!this.reviewSummary.current||!this.reviewContent.current)return;const r=(this.reviewSummary.current.clientHeight+1)*e+1,o=this.reviewContent.current.clientHeight+1>r;this.setState({clampEnabled:o}),o&&this.setState({summary:y(this.reviewContent.current.innerHTML,this.reviewSummary.current,r,t)})}}getButton(){const{isExpanded:e}=this.state,{className:t,lessText:r,moreText:n}=this.props,c=e?r:n;if(c)return Object(o.createElement)("a",{href:"#more",className:t+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}onClick(e){e.preventDefault();const{isExpanded:t}=this.state;this.setState({isExpanded:!t})}render(){const{className:e}=this.props,{content:t,summary:r,clampEnabled:n,isExpanded:c}=this.state;return t?!1===n?Object(o.createElement)("div",{className:e},Object(o.createElement)("div",{ref:this.reviewContent},t)):Object(o.createElement)("div",{className:e},(!c||null===n)&&Object(o.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:r}}),(c||null===n)&&Object(o.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},t),this.getButton()):null}}v()(E,"defaultProps",k);var R=E;r(180);var S=e=>{let{attributes:t,review:r={}}=e;const{imageType:c,showReviewDate:s,showReviewerName:a,showReviewImage:i,showReviewRating:l,showReviewContent:d,showProductName:u}=t,{rating:b}=r,m=!Object.keys(r).length>0,p=Number.isFinite(b)&&l;return Object(o.createElement)("li",{className:g()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":m,"wc-block-components-review-list-item__item--has-image":i}),"aria-hidden":m},(u||s||a||i||p)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},i&&function(e,t,r){var c,s;return r||!e?Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(o.createElement)("img",{"aria-hidden":"true",alt:(null===(c=e.product_image)||void 0===c?void 0:c.alt)||"",src:(null===(s=e.product_image)||void 0===s?void 0:s.thumbnail)||""}):Object(o.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[96]||""}),e.verified&&Object(o.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(n.__)("Verified buyer","woo-gutenberg-products-block")},Object(n.__)("Verified buyer","woo-gutenberg-products-block")))}(r,c,m),(u||a||p||s)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},p&&function(e){const{rating:t}=e,r={width:t/5*100+"%"},c=Object(n.sprintf)( +/* translators: %f is referring to the average rating value */ +Object(n.__)("Rated %f out of 5","woo-gutenberg-products-block"),t),s={__html:Object(n.sprintf)( +/* translators: %s is referring to the average rating value */ +Object(n.__)("Rated %s out of 5","woo-gutenberg-products-block"),Object(n.sprintf)('%f',t))};return Object(o.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(o.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":c},Object(o.createElement)("span",{style:r,dangerouslySetInnerHTML:s})))}(r),u&&function(e){return Object(o.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(o.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(r),a&&function(e){const{reviewer:t=""}=e;return Object(o.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},t)}(r),s&&function(e){const{date_created:t,formatted_date_created:r}=e;return Object(o.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(r))),d&&function(e){return Object(o.createElement)(R,{maxLines:10,moreText:Object(n.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(n.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(o.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(r))};r(179);var C=e=>{let{attributes:t,reviews:r}=e;const n=Object(l.getSetting)("showAvatars",!0),c=Object(l.getSetting)("reviewRatingsEnabled",!0),s=(n||"product"===t.imageType)&&t.showReviewImage,a=c&&t.showReviewRating,i={...t,showReviewImage:s,showReviewRating:a};return Object(o.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(o.createElement)(S,{attributes:i}):r.map((e,t)=>Object(o.createElement)(S,{key:e.id||t,attributes:i,review:e})))},P=r(6),N=r.n(P),I=r(22),L=r.n(I),x=r(57),T=r(27);class A extends i.Component{render(){const{attributes:e,error:t,isLoading:r,noReviewsPlaceholder:c,reviews:a,totalReviews:i}=this.props;if(t)return Object(o.createElement)(d.a,{className:"wc-block-featured-product-error",error:t,isLoading:r});if(0===a.length&&!r)return Object(o.createElement)(c,{attributes:e});const u=Object(l.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(s.Disabled,null,e.showOrderby&&u&&Object(o.createElement)(p,{readOnly:!0,value:e.orderby}),Object(o.createElement)(C,{attributes:e,reviews:a}),e.showLoadMore&&i>a.length&&Object(o.createElement)(b,{screenReaderLabel:Object(n.__)("Load more reviews","woo-gutenberg-products-block")}))}}var M=(e=>{class t extends i.Component{constructor(){super(...arguments),v()(this,"isPreview",!!this.props.attributes.previewReviews),v()(this,"delayedAppendReviews",this.props.delayFunction(this.appendReviews)),v()(this,"isMounted",!1),v()(this,"state",{error:null,loading:!0,reviews:this.isPreview?this.props.attributes.previewReviews:[],totalReviews:this.isPreview?this.props.attributes.previewReviews.length:0}),v()(this,"setError",async e=>{if(!this.isMounted)return;const{onReviewsLoadError:t}=this.props,r=await Object(T.a)(e);this.setState({reviews:[],loading:!1,error:r}),t(r)})}componentDidMount(){this.isMounted=!0,this.replaceReviews()}componentDidUpdate(e){e.reviewsToDisplay0&&void 0!==arguments[0]?arguments[0]:[];const{reviewsToDisplay:t}=this.props,{totalReviews:r}=this.state,o=Math.min(r,t)-e.length;return this.setState({loading:!0,reviews:e.concat(Array(o).fill({}))}),Object(x.c)(this.getArgs(e.length)).then(t=>{let{reviews:r,totalReviews:o}=t;return this.isMounted&&this.setState({reviews:e.filter(e=>Object.keys(e).length).concat(r),totalReviews:o,loading:!1,error:null}),{newReviews:r}}).catch(this.setError)}render(){const{reviewsToDisplay:t}=this.props,{error:r,loading:n,reviews:c,totalReviews:s}=this.state;return Object(o.createElement)(e,N()({},this.props,{error:r,isLoading:n,reviews:c.slice(0,t),totalReviews:s}))}}v()(t,"defaultProps",{delayFunction:e=>e,onReviewsAppended:()=>{},onReviewsLoadError:()=>{},onReviewsReplaced:()=>{}});const{displayName:r=e.name||"Component"}=e;return t.displayName=`WithReviews( ${r} )`,t})(A);t.a=e=>{let{attributes:t,icon:r,name:i,noReviewsPlaceholder:l}=e;const{categoryIds:d,productId:u,reviewsOnPageLoad:b,showProductName:m,showReviewDate:p,showReviewerName:w,showReviewContent:g,showReviewImage:h,showReviewRating:v}=t,{order:O,orderby:j}=Object(x.d)(t.orderby),_=!(g||v||p||w||h||m),f=Object(a.useBlockProps)({className:Object(x.a)(t)});return _?Object(o.createElement)(s.Placeholder,{icon:r,label:i},Object(n.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block")):Object(o.createElement)("div",f,Object(o.createElement)(M,{attributes:t,categoryIds:d,delayFunction:e=>Object(c.debounce)(e,400),noReviewsPlaceholder:l,orderby:j,order:O,productId:u,reviewsToDisplay:b}))}},15:function(e,t){e.exports=window.wp.url},156:function(e,t){},157:function(e,t){},176:function(e,t,r){"use strict";var o=r(6),n=r.n(o),c=r(0),s=r(23),a=r(25),i=r(112),l=r(27);t.a=e=>t=>{let{selected:r,...o}=t;const[d,u]=Object(c.useState)(!0),[b,m]=Object(c.useState)(null),[p,w]=Object(c.useState)([]),g=s.o.productCount>100,h=async e=>{const t=await Object(l.a)(e);m(t),u(!1)},v=Object(c.useRef)(r);Object(c.useEffect)(()=>{Object(a.h)({selected:v.current}).then(e=>{w(e),u(!1)}).catch(h)},[v]);const O=Object(i.a)(e=>{Object(a.h)({selected:r,search:e}).then(e=>{w(e),u(!1)}).catch(h)},400),j=Object(c.useCallback)(e=>{u(!0),O(e)},[u,O]);return Object(c.createElement)(e,n()({},o,{selected:r,error:b,products:p,isLoading:d,onSearch:g?j:null}))}},178:function(e,t){},179:function(e,t){},180:function(e,t){},181:function(e,t){},19:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"c",(function(){return i})),r.d(t,"d",(function(){return l})),r.d(t,"b",(function(){return d}));var o=r(0),n=r(7),c=r(1);const s={clear:Object(c.__)("Clear all selected items","woo-gutenberg-products-block"),noItems:Object(c.__)("No items found.","woo-gutenberg-products-block"), +/* Translators: %s search term */ +noResults:Object(c.__)("No results for %s","woo-gutenberg-products-block"),search:Object(c.__)("Search for items","woo-gutenberg-products-block"),selected:e=>Object(c.sprintf)( +/* translators: Number of items selected from list. */ +Object(c._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(c.__)("Search results updated.","woo-gutenberg-products-block")},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const r=Object(n.groupBy)(e,"parent"),o=Object(n.keyBy)(t,"id"),c=["0"],s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=s(o[e.parent]);return[...t,e.name]},a=e=>e.map(e=>{const t=r[e.id];return c.push(""+e.id),{...e,breadcrumbs:s(o[e.parent]),children:t&&t.length?a(t):[]}}),i=a(r[0]||[]);return Object.entries(r).forEach(e=>{let[t,r]=e;c.includes(t)||i.push(...a(r||[]))}),i},i=(e,t,r)=>{if(!t)return r?a(e):e;const o=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),n=e.map(e=>!!o.test(e.name)&&e).filter(Boolean);return r?a(n,e):n},l=(e,t)=>{if(!t)return e;const r=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(r).map((e,t)=>r.test(e)?Object(o.createElement)("strong",{key:t},e):Object(o.createElement)(o.Fragment,{key:t},e))},d=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},2:function(e,t){e.exports=window.wc.wcSettings},22:function(e,t){e.exports=window.wp.isShallowEqual},23:function(e,t,r){"use strict";r.d(t,"o",(function(){return c})),r.d(t,"m",(function(){return s})),r.d(t,"l",(function(){return a})),r.d(t,"n",(function(){return i})),r.d(t,"j",(function(){return l})),r.d(t,"e",(function(){return d})),r.d(t,"f",(function(){return u})),r.d(t,"g",(function(){return b})),r.d(t,"k",(function(){return m})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return w})),r.d(t,"h",(function(){return g})),r.d(t,"a",(function(){return h})),r.d(t,"i",(function(){return v})),r.d(t,"b",(function(){return O}));var o,n=r(2);const c=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),s=c.pluginUrl+"images/",a=c.pluginUrl+"build/",i=c.buildPhase,l=null===(o=n.STORE_PAGES.shop)||void 0===o?void 0:o.permalink,d=n.STORE_PAGES.checkout.id,u=n.STORE_PAGES.checkout.permalink,b=n.STORE_PAGES.privacy.permalink,m=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),p=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),w=n.STORE_PAGES.cart.permalink,g=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),h=Object(n.getSetting)("allowedCountries",{}),v=Object(n.getSetting)("shippingStates",{}),O=Object(n.getSetting)("allowedStates",{})},25:function(e,t,r){"use strict";r.d(t,"h",(function(){return l})),r.d(t,"e",(function(){return d})),r.d(t,"b",(function(){return u})),r.d(t,"i",(function(){return b})),r.d(t,"f",(function(){return m})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return w})),r.d(t,"g",(function(){return g})),r.d(t,"a",(function(){return h}));var o=r(15),n=r(14),c=r.n(n),s=r(7),a=r(2),i=r(23);const l=e=>{let{selected:t=[],search:r="",queryArgs:n={}}=e;const a=(e=>{let{selected:t=[],search:r="",queryArgs:n={}}=e;const c=i.o.productCount>100,s={per_page:c?100:0,catalog_visibility:"any",search:r,orderby:"title",order:"asc"},a=[Object(o.addQueryArgs)("/wc/store/v1/products",{...s,...n})];return c&&t.length&&a.push(Object(o.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),a})({selected:t,search:r,queryArgs:n});return Promise.all(a.map(e=>c()({path:e}))).then(e=>Object(s.uniqBy)(Object(s.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},d=e=>c()({path:"/wc/store/v1/products/"+e}),u=()=>c()({path:"wc/store/v1/products/attributes"}),b=e=>c()({path:`wc/store/v1/products/attributes/${e}/terms`}),m=e=>{let{selected:t=[],search:r}=e;const n=(e=>{let{selected:t=[],search:r}=e;const n=Object(a.getSetting)("limitTags",!1),c=[Object(o.addQueryArgs)("wc/store/v1/products/tags",{per_page:n?100:0,orderby:n?"count":"name",order:n?"desc":"asc",search:r})];return n&&t.length&&c.push(Object(o.addQueryArgs)("wc/store/v1/products/tags",{include:t})),c})({selected:t,search:r});return Promise.all(n.map(e=>c()({path:e}))).then(e=>Object(s.uniqBy)(Object(s.flatten)(e),"id"))},p=e=>c()({path:Object(o.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),w=e=>c()({path:"wc/store/v1/products/categories/"+e}),g=e=>c()({path:Object(o.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),h=(e,t)=>{if(!e.title.raw)return e.slug;const r=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(r?"":" - "+e.slug)}},27:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return s}));var o=r(1),n=r(13);const c=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},s=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(n.decodeEntities)(e.message):Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},28:function(e,t,r){"use strict";var o=r(0),n=r(4),c=r.n(n);t.a=e=>{let t,{label:r,screenReaderLabel:n,wrapperElement:s,wrapperProps:a={}}=e;const i=null!=r,l=null!=n;return!i&&l?(t=s||"span",a={...a,className:c()(a.className,"screen-reader-text")},Object(o.createElement)(t,a,n)):(t=s||o.Fragment,i&&l&&r!==n?Object(o.createElement)(t,a,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,a,r))}},299:function(e,t,r){"use strict";var o=r(6),n=r.n(o),c=r(24),s=r.n(c),a=r(0),i=r(10),l=r(25),d=r(27);const u=Object(i.createHigherOrderComponent)(e=>class extends a.Component{constructor(){super(...arguments),s()(this,"state",{error:null,loading:!1,product:"preview"===this.props.attributes.productId?this.props.attributes.previewProduct:null}),s()(this,"loadProduct",()=>{const{productId:e}=this.props.attributes;"preview"!==e&&(e?(this.setState({loading:!0}),Object(l.e)(e).then(e=>{this.setState({product:e,loading:!1,error:null})}).catch(async e=>{const t=await Object(d.a)(e);this.setState({product:null,loading:!1,error:t})})):this.setState({product:null,loading:!1,error:null}))})}componentDidMount(){this.loadProduct()}componentDidUpdate(e){e.attributes.productId!==this.props.attributes.productId&&this.loadProduct()}render(){const{error:t,loading:r,product:o}=this.state;return Object(a.createElement)(e,n()({},this.props,{error:t,getProduct:this.loadProduct,isLoading:r,product:o}))}},"withProduct");t.a=u},3:function(e,t){e.exports=window.wp.components},32:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(33);t.a=e=>{let{error:t}=e;return Object(o.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:r}=e;return t?"general"===r?Object(o.createElement)("span",null,Object(n.__)("The following error was returned","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(t))):"api"===r?Object(o.createElement)("span",null,Object(n.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(t))):t:Object(n.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},33:function(e,t){e.exports=window.wp.escapeHtml},36:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var o=r(6),n=r.n(o),c=r(0),s=r(19);const a=e=>{let{countLabel:t,className:r,depth:o=0,controlId:a="",item:i,isSelected:l,isSingle:d,onSelect:u,search:b="",...m}=e;const p=null!=t&&void 0!==i.count&&null!==i.count,w=[r,"woocommerce-search-list__item"];w.push("depth-"+o),d&&w.push("is-radio-button"),p&&w.push("has-count");const g=i.breadcrumbs&&i.breadcrumbs.length,h=m.name||"search-list-item-"+a,v=`${h}-${i.id}`;return Object(c.createElement)("label",{htmlFor:v,className:w.join(" ")},d?Object(c.createElement)("input",n()({type:"radio",id:v,name:h,value:i.value,onChange:u(i),checked:l,className:"woocommerce-search-list__item-input"},m)):Object(c.createElement)("input",n()({type:"checkbox",id:v,name:h,value:i.value,onChange:u(i),checked:l,className:"woocommerce-search-list__item-input"},m)),Object(c.createElement)("span",{className:"woocommerce-search-list__item-label"},g?Object(c.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(s.b)(i.breadcrumbs)):null,Object(c.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(s.d)(i.name,b))),!!p&&Object(c.createElement)("span",{className:"woocommerce-search-list__item-count"},t||i.count))};t.b=a},367:function(e,t,r){e.exports=r(476)},476:function(e,t,r){"use strict";r.r(t);var o=r(0),n=r(1),c=r(8),s=r(113),a=r(329),i=(r(156),r(6)),l=r.n(i),d=r(5),u=r(3),b=r(36),m=r(93),p=r(147),w=r(73),g=r(299),h=Object(g.a)(e=>{let{error:t,getProduct:r,isLoading:c,product:i}=e;if(t)return Object(o.createElement)(w.a,{className:"wc-block-featured-product-error",error:t,isLoading:c,onRetry:r});const l=!i||c?Object(o.createElement)(u.Spinner,null):Object(n.sprintf)( +/* translators: %s is the product name. */ +Object(n.__)("This block lists reviews for a selected product. %s doesn't have any reviews yet, but they will show up here when it does.","woo-gutenberg-products-block"),i.name);return Object(o.createElement)(u.Placeholder,{className:"wc-block-reviews-by-product",icon:Object(o.createElement)(s.a,{icon:a.a,className:"block-editor-block-icon"}),label:Object(n.__)("Reviews by Product","woo-gutenberg-products-block")},l)}),v=r(105),O=Object(u.withSpokenMessages)(e=>{let{attributes:t,debouncedSpeak:r,setAttributes:c}=e;const{editMode:i,productId:w}=t,g=e=>{const{item:t=0}=e;return Object(o.createElement)(b.a,l()({},e,{countLabel:Object(n.sprintf)( +/* translators: %d is the review count. */ +Object(n._n)("%d review","%d reviews",t.review_count,"woo-gutenberg-products-block"),t.review_count),"aria-label":Object(n.sprintf)( +/* translators: %1$s is the item name, and %2$d is the number of reviews for the item. */ +Object(n._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,"woo-gutenberg-products-block"),t.name,t.review_count)}))};if(!w||i)return Object(o.createElement)(u.Placeholder,{icon:Object(o.createElement)(s.a,{icon:a.a,className:"block-editor-block-icon"}),label:Object(n.__)("Reviews by Product","woo-gutenberg-products-block"),className:"wc-block-reviews-by-product"},Object(n.__)("Show reviews of your product to build trust","woo-gutenberg-products-block"),Object(o.createElement)("div",{className:"wc-block-reviews__selection"},Object(o.createElement)(m.a,{selected:t.productId||0,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e[0]?e[0].id:0;c({productId:t})},queryArgs:{orderby:"comment_count",order:"desc"},renderItem:g}),Object(o.createElement)(u.Button,{isPrimary:!0,onClick:()=>{c({editMode:!1}),r(Object(n.__)("Showing Reviews by Product block preview.","woo-gutenberg-products-block"))}},Object(n.__)("Done","woo-gutenberg-products-block"))));const O=Object(n.__)("Edit selected product","woo-gutenberg-products-block");return Object(o.createElement)(o.Fragment,null,Object(v.a)(i,c,O),Object(o.createElement)(d.InspectorControls,{key:"inspector"},Object(o.createElement)(u.PanelBody,{title:Object(n.__)("Product","woo-gutenberg-products-block"),initialOpen:!1},Object(o.createElement)(m.a,{selected:t.productId||0,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e[0]?e[0].id:0;c({productId:t})},renderItem:g,isCompact:!0})),Object(o.createElement)(u.PanelBody,{title:Object(n.__)("Content","woo-gutenberg-products-block")},Object(v.b)(t,c)),Object(o.createElement)(u.PanelBody,{title:Object(n.__)("List Settings","woo-gutenberg-products-block")},Object(v.c)(t,c))),Object(o.createElement)(p.a,{attributes:t,icon:Object(o.createElement)(s.a,{icon:a.a,className:"block-editor-block-icon"}),name:Object(n.__)("Reviews by Product","woo-gutenberg-products-block"),noReviewsPlaceholder:h}))}),j=r(143),_=r(144),f=r(122);Object(c.registerBlockType)("woocommerce/reviews-by-product",{apiVersion:2,title:Object(n.__)("Reviews by Product","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(s.a,{icon:a.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(n.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(n.__)("Show reviews of your products to build trust.","woo-gutenberg-products-block"),supports:{html:!1,color:{background:!1},typography:{fontSize:!0}},example:{...f.a,attributes:{...f.a.attributes,productId:1}},attributes:{...j.a,productId:{type:"number"}},edit:e=>Object(o.createElement)(O,e),save:_.a})},5:function(e,t){e.exports=window.wp.blockEditor},57:function(e,t,r){"use strict";r.d(t,"d",(function(){return i})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return u}));var o=r(14),n=r.n(o),c=r(4),s=r.n(c),a=r(2);const i=e=>{if(Object(a.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=e=>n()({path:"/wc/store/v1/products/reviews?"+Object.entries(e).map(e=>e.join("=")).join("&"),parse:!1}).then(e=>e.json().then(t=>({reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}))),d=e=>{const{className:t,categoryIds:r,productId:o,showReviewDate:n,showReviewerName:c,showReviewContent:a,showProductName:i,showReviewImage:l,showReviewRating:d}=e;let u="wc-block-all-reviews";return o&&(u="wc-block-reviews-by-product"),Array.isArray(r)&&(u="wc-block-reviews-by-category"),s()(u,t,{"has-image":l,"has-name":c,"has-date":n,"has-rating":d,"has-content":a,"has-product-name":i})},u=e=>{const{categoryIds:t,imageType:r,orderby:o,productId:n,reviewsOnPageLoad:c,reviewsOnLoadMore:s,showLoadMore:a,showOrderby:i}=e,l={"data-image-type":r,"data-orderby":o,"data-reviews-on-page-load":c,"data-reviews-on-load-more":s,"data-show-load-more":a,"data-show-orderby":i};return n&&(l["data-product-id"]=n),Array.isArray(t)&&(l["data-category-ids"]=t.join(",")),l}},7:function(e,t){e.exports=window.lodash},73:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(113),s=r(172),a=r(4),i=r.n(a),l=r(3),d=r(32);r(114),t.a=e=>{let{className:t,error:r,isLoading:a=!1,onRetry:u}=e;return Object(o.createElement)(l.Placeholder,{icon:Object(o.createElement)(c.a,{icon:s.a}),label:Object(n.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:i()("wc-block-api-error",t)},Object(o.createElement)(d.a,{error:r}),u&&Object(o.createElement)(o.Fragment,null,a?Object(o.createElement)(l.Spinner,null):Object(o.createElement)(l.Button,{isSecondary:!0,onClick:u},Object(n.__)("Retry","woo-gutenberg-products-block"))))}},8:function(e,t){e.exports=window.wp.blocks},82:function(e,t,r){"use strict";var o=r(6),n=r.n(o),c=r(0),s=r(36),a=r(3),i=r(4),l=r.n(i);t.a=e=>{let{className:t,item:r,isSelected:o,isLoading:i,onSelect:d,disabled:u,...b}=e;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(s.a,n()({},b,{key:r.id,className:t,isSelected:o,item:r,onSelect:d,isSingle:!0,disabled:u})),o&&i&&Object(c.createElement)("div",{key:"loading",className:l()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(c.createElement)(a.Spinner,null)))}},93:function(e,t,r){"use strict";var o=r(6),n=r.n(o),c=r(0),s=r(1),a=r(7),i=r(36),l=r(97),d=r(10),u=Object(d.createHigherOrderComponent)(e=>{class t extends c.Component{render(){const{selected:t}=this.props,r=null==t;return Array.isArray(t)?Object(c.createElement)(e,this.props):Object(c.createElement)(e,n()({},this.props,{selected:r?[]:[t]}))}}return t.defaultProps={selected:null},t},"withTransformSingleSelectToMultipleSelect"),b=r(176),m=r(24),p=r.n(m),w=r(22),g=r.n(w),h=r(25),v=r(27),O=Object(d.createHigherOrderComponent)(e=>{class t extends c.Component{constructor(){super(...arguments),p()(this,"state",{error:null,loading:!1,variations:{}}),p()(this,"loadVariations",()=>{const{products:e}=this.props,{loading:t,variations:r}=this.state;if(t)return;const o=this.getExpandedProduct();if(!o||r[o])return;const n=e.find(e=>e.id===o);n.variations&&0!==n.variations.length?(this.setState({loading:!0}),Object(h.g)(o).then(e=>{const t=e.map(e=>({...e,parent:o}));this.setState({variations:{...this.state.variations,[o]:t},loading:!1,error:null})}).catch(async e=>{const t=await Object(v.a)(e);this.setState({variations:{...this.state.variations,[o]:null},loading:!1,error:t})})):this.setState({variations:{...this.state.variations,[o]:null},loading:!1,error:null})})}componentDidMount(){const{selected:e,showVariations:t}=this.props;e&&t&&this.loadVariations()}componentDidUpdate(e){const{isLoading:t,selected:r,showVariations:o}=this.props;o&&(!g()(e.selected,r)||e.isLoading&&!t)&&this.loadVariations()}isProductId(e){const{products:t}=this.props;return t.some(t=>t.id===e)}findParentProduct(e){var t;const{products:r}=this.props;return null===(t=r.filter(t=>t.variations&&t.variations.find(t=>{let{id:r}=t;return r===e}))[0])||void 0===t?void 0:t.id}getExpandedProduct(){const{isLoading:e,selected:t,showVariations:r}=this.props;if(!r)return null;let o=t&&t.length?t[0]:null;return o?this.prevSelectedItem=o:this.prevSelectedItem&&(e||this.isProductId(this.prevSelectedItem)||(o=this.prevSelectedItem)),!e&&o?this.isProductId(o)?o:this.findParentProduct(o):null}render(){const{error:t,isLoading:r}=this.props,{error:o,loading:s,variations:a}=this.state;return Object(c.createElement)(e,n()({},this.props,{error:o||t,expandedProduct:this.getExpandedProduct(),isLoading:r,variations:a,variationsLoading:s}))}}return p()(t,"defaultProps",{selected:[],showVariations:!1}),t},"withProductVariations"),j=r(32),_=r(4),f=r.n(_),y=r(82);r(134);const k={list:Object(s.__)("Products","woo-gutenberg-products-block"),noItems:Object(s.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(s.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(s.__)("Product search results updated.","woo-gutenberg-products-block")},E=e=>{let{expandedProduct:t,error:r,instanceId:o,isCompact:d,isLoading:u,onChange:b,onSearch:m,products:p,renderItem:w,selected:g,showVariations:h,variations:v,variationsLoading:O}=e;if(r)return Object(c.createElement)(j.a,{error:r});const _=[...p,...v&&v[t]?v[t]:[]];return Object(c.createElement)(l.a,{className:"woocommerce-products",list:_,isCompact:d,isLoading:u,isSingle:!0,selected:_.filter(e=>{let{id:t}=e;return g.includes(t)}),onChange:b,renderItem:w||(h?e=>{const{item:t,search:r,depth:l=0,isSelected:d,onSelect:b}=e,m=t.variations&&Array.isArray(t.variations)?t.variations.length:0,p=f()("woocommerce-search-product__item","woocommerce-search-list__item","depth-"+l,"has-count",{"is-searching":r.length>0,"is-skip-level":0===l&&0!==t.parent,"is-variable":m>0});if(!t.breadcrumbs.length)return Object(c.createElement)(y.a,n()({},e,{className:f()(p,{"is-selected":d}),isSelected:d,item:t,onSelect:()=>()=>{b(t)()},isLoading:u||O,countLabel:t.variations.length>0?Object(s.sprintf)( +/* translators: %1$d is the number of variations of a product product. */ +Object(s.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-"+o,"aria-label":Object(s.sprintf)( +/* translators: %1$s is the product name, %2$d is the number of variations of that product. */ +Object(s._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,"woo-gutenberg-products-block"),t.name,t.variations.length)}));const w=Object(a.isEmpty)(t.variation)?e:{...e,item:{...e.item,name:t.variation},"aria-label":`${t.breadcrumbs[0]}: ${t.variation}`};return Object(c.createElement)(i.a,n()({},w,{className:p,name:"variations-"+o}))}:null),onSearch:m,messages:k,isHierarchical:!0})};E.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=u(Object(b.a)(O(Object(d.withInstanceId)(E))))},97:function(e,t,r){"use strict";r.d(t,"a",(function(){return y}));var o=r(6),n=r.n(o),c=r(0),s=r(1),a=r(3),i=r(113),l=r(498),d=r(4),u=r.n(d),b=r(10),m=r(19),p=r(36),w=r(497),g=r(13);const h=e=>{let{id:t,label:r,popoverContents:o,remove:n,screenReaderLabel:l,className:d=""}=e;const[m,p]=Object(c.useState)(!1),v=Object(b.useInstanceId)(h);if(l=l||r,!r)return null;r=Object(g.decodeEntities)(r);const O=u()("woocommerce-tag",d,{"has-remove":!!n}),j="woocommerce-tag__label-"+v,_=Object(c.createElement)(c.Fragment,null,Object(c.createElement)("span",{className:"screen-reader-text"},l),Object(c.createElement)("span",{"aria-hidden":"true"},r));return Object(c.createElement)("span",{className:O},o?Object(c.createElement)(a.Button,{className:"woocommerce-tag__text",id:j,onClick:()=>p(!0)},_):Object(c.createElement)("span",{className:"woocommerce-tag__text",id:j},_),o&&m&&Object(c.createElement)(a.Popover,{onClose:()=>p(!1)},o),n&&Object(c.createElement)(a.Button,{className:"woocommerce-tag__remove",onClick:n(t),label:Object(s.sprintf)(// Translators: %s label. +Object(s.__)("Remove %s","woo-gutenberg-products-block"),r),"aria-describedby":j},Object(c.createElement)(i.a,{icon:w.a,size:20,className:"clear-icon"})))};var v=h;const O=e=>Object(c.createElement)(p.b,e),j=e=>{const{list:t,selected:r,renderItem:o,depth:s=0,onSelect:a,instanceId:i,isSingle:l,search:d}=e;return t?Object(c.createElement)(c.Fragment,null,t.map(t=>{const u=-1!==r.findIndex(e=>{let{id:r}=e;return r===t.id});return Object(c.createElement)(c.Fragment,{key:t.id},Object(c.createElement)("li",null,o({item:t,isSelected:u,onSelect:a,isSingle:l,search:d,depth:s,controlId:i})),Object(c.createElement)(j,n()({},e,{list:t.children,depth:s+1})))})):null},_=e=>{let{isLoading:t,isSingle:r,selected:o,messages:n,onChange:i,onRemove:l}=e;if(t||r||!o)return null;const d=o.length;return Object(c.createElement)("div",{className:"woocommerce-search-list__selected"},Object(c.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(c.createElement)("strong",null,n.selected(d)),d>0?Object(c.createElement)(a.Button,{isLink:!0,isDestructive:!0,onClick:()=>i([]),"aria-label":n.clear},Object(s.__)("Clear all","woo-gutenberg-products-block")):null),d>0?Object(c.createElement)("ul",null,o.map((e,t)=>Object(c.createElement)("li",{key:t},Object(c.createElement)(v,{label:e.name,id:e.id,remove:l})))):null)},f=e=>{let{filteredList:t,search:r,onSelect:o,instanceId:n,...a}=e;const{messages:d,renderItem:u,selected:b,isSingle:m}=a,p=u||O;return 0===t.length?Object(c.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(c.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(c.createElement)(i.a,{icon:l.a})),Object(c.createElement)("span",{className:"woocommerce-search-list__not-found-text"},r?Object(s.sprintf)(d.noResults,r):d.noItems)):Object(c.createElement)("ul",{className:"woocommerce-search-list__list"},Object(c.createElement)(j,{list:t,selected:b,renderItem:p,onSelect:o,instanceId:n,isSingle:m,search:r}))},y=e=>{const{className:t="",isCompact:r,isHierarchical:o,isLoading:s,isSingle:i,list:l,messages:d=m.a,onChange:p,onSearch:w,selected:g,debouncedSpeak:h}=e,[v,O]=Object(c.useState)(""),j=Object(b.useInstanceId)(y),k=Object(c.useMemo)(()=>({...m.a,...d}),[d]),E=Object(c.useMemo)(()=>Object(m.c)(l,v,o),[l,v,o]);Object(c.useEffect)(()=>{h&&h(k.updated)},[h,k]),Object(c.useEffect)(()=>{"function"==typeof w&&w(v)},[v,w]);const R=Object(c.useCallback)(e=>()=>{i&&p([]);const t=g.findIndex(t=>{let{id:r}=t;return r===e});p([...g.slice(0,t),...g.slice(t+1)])},[i,g,p]),S=Object(c.useCallback)(e=>()=>{-1===g.findIndex(t=>{let{id:r}=t;return r===e.id})?p(i?[e]:[...g,e]):R(e.id)()},[i,R,p,g]);return Object(c.createElement)("div",{className:u()("woocommerce-search-list",t,{"is-compact":r})},Object(c.createElement)(_,n()({},e,{onRemove:R,messages:k})),Object(c.createElement)("div",{className:"woocommerce-search-list__search"},Object(c.createElement)(a.TextControl,{label:k.search,type:"search",value:v,onChange:e=>O(e)})),s?Object(c.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(c.createElement)(a.Spinner,null)):Object(c.createElement)(f,n()({},e,{search:v,filteredList:E,messages:k,onSelect:S,instanceId:j})))};Object(a.withSpokenMessages)(y)}}); \ No newline at end of file diff --git a/build/reviews-frontend.asset.php b/build/reviews-frontend.asset.php new file mode 100644 index 00000000000..77a9d776321 --- /dev/null +++ b/build/reviews-frontend.asset.php @@ -0,0 +1 @@ + array('react', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-compose', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill'), 'version' => '6d2400cc0b0a80a3940c0b4b66433391'); \ No newline at end of file diff --git a/build/reviews-frontend.js b/build/reviews-frontend.js new file mode 100644 index 00000000000..89fb54d52c4 --- /dev/null +++ b/build/reviews-frontend.js @@ -0,0 +1,7 @@ +!function(e){var t={};function r(o){if(t[o])return t[o].exports;var s=t[o]={i:o,l:!1,exports:{}};return e[o].call(s.exports,s,s.exports,r),s.l=!0,s.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)r.d(o,s,function(t){return e[t]}.bind(null,s));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=241)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},108:function(e,t,r){"use strict";var o=r(0),s=r(4),n=r.n(s),i=r(22),c=r(9);r(122),t.a=Object(c.withInstanceId)(e=>{let{className:t,instanceId:r,label:s="",onChange:c,options:a,screenReaderLabel:l,value:p=""}=e;const u="wc-block-components-sort-select__select-"+r;return Object(o.createElement)("div",{className:n()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(o.createElement)(i.a,{label:s,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:u}}),Object(o.createElement)("select",{id:u,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:c,value:p},a&&a.map(e=>Object(o.createElement)("option",{key:e.key,value:e.key},e.label))))})},11:function(e,t){e.exports=window.wp.isShallowEqual},12:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t/g,">\n").replace(/\n\n/g,"\n").replace(/^\n/g,"").replace(/\n$/g,"").split("\n"),g=0,h=[],v=!1,f=0;f=a)r="";else if(g+_.length>=a){if(" "===_[(s=a-g)-1])for(;s&&" "===_[(s-=1)-1];);else n=_.slice(s).indexOf(" "),p||(-1!==n?s+=n:s=r.length);r=_.slice(0,s).join("")+u,d&&(r+=''+b+""),g=a,v=!0}else g+=_.length;else if(l){if(g>=a)if(c=(i=r.match(/[a-zA-Z]+/))?i[0]:"")if("{let{imageUrl:t=a.l+"/block-error.svg",header:r=Object(c.__)("Oops!","woo-gutenberg-products-block"),text:o=Object(c.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:s,errorMessagePrefix:i=Object(c.__)("Error:","woo-gutenberg-products-block"),button:l,showErrorBlock:p=!0}=e;return p?Object(n.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(n.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(n.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(n.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),o&&Object(n.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},o),s&&Object(n.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},i?i+" ":"",s),l&&Object(n.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};r(35);class p extends i.Component{constructor(){super(...arguments),s()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(n.createElement)(n.Fragment,null,Object(n.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:o=!0,text:s,errorMessagePrefix:i,renderError:c,button:a}=this.props,{errorMessage:p,hasError:u}=this.state;return u?"function"==typeof c?c({errorMessage:p}):Object(n.createElement)(l,{showErrorBlock:o,errorMessage:r?p:null,header:e,imageUrl:t,text:s,errorMessagePrefix:i,button:a}):this.props.children}}t.a=p},17:function(e,t){e.exports=window.wp.htmlEntities},19:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},2:function(e,t){e.exports=window.wc.wcSettings},209:function(e,t){},210:function(e,t){},211:function(e,t){},212:function(e,t){},22:function(e,t,r){"use strict";var o=r(0),s=r(4),n=r.n(s);t.a=e=>{let t,{label:r,screenReaderLabel:s,wrapperElement:i,wrapperProps:c={}}=e;const a=null!=r,l=null!=s;return!a&&l?(t=i||"span",c={...c,className:n()(c.className,"screen-reader-text")},Object(o.createElement)(t,c,s)):(t=i||o.Fragment,a&&l&&r!==s?Object(o.createElement)(t,c,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},s)):Object(o.createElement)(t,c,r))}},23:function(e,t){e.exports=window.wp.a11y},241:function(e,t,r){"use strict";r.r(t);var o=r(52),s=r(0),n=r(1),i=r(23),c=r(5),a=r(27),l=r.n(a),p=r(4),u=r.n(p),d=r(2),b=r(22);r(212);var w=e=>{let{onClick:t,label:r=Object(n.__)("Load more","woo-gutenberg-products-block"),screenReaderLabel:o=Object(n.__)("Load more","woo-gutenberg-products-block")}=e;return Object(s.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(s.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(s.createElement)(b.a,{label:r,screenReaderLabel:o})))},m=r(108);r(209);var g=e=>{let{onChange:t,readOnly:r,value:o}=e;return Object(s.createElement)(m.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:Object(n.__)("Order by","woo-gutenberg-products-block"),onChange:t,options:[{key:"most-recent",label:Object(n.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(n.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(n.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(n.__)("Order reviews by","woo-gutenberg-products-block"),value:o})},h=r(19),v=r.n(h),f=r(149),_=r.n(f);const O=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";const o=_()(e,{suffix:r,limit:t});return o.html},y=(e,t,r)=>(t<=r?e.start=e.middle+1:e.end=e.middle-1,e),k=(e,t,r,o)=>{const s=((e,t,r)=>{let o={start:0,middle:0,end:e.length};for(;o.start<=o.end;)o.middle=Math.floor((o.start+o.end)/2),t.innerHTML=O(e,o.middle),o=y(o,t.clientHeight,r);return o.middle})(e,t,r);return O(e,s-o.length,o)},j={className:"read-more-content",ellipsis:"…",lessText:Object(n.__)("Read less","woo-gutenberg-products-block"),maxLines:3,moreText:Object(n.__)("Read more","woo-gutenberg-products-block")};class E extends c.Component{constructor(e){super(e),this.state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},this.reviewContent=Object(c.createRef)(),this.reviewSummary=Object(c.createRef)(),this.getButton=this.getButton.bind(this),this.onClick=this.onClick.bind(this)}componentDidMount(){this.setSummary()}componentDidUpdate(e){e.maxLines===this.props.maxLines&&e.children===this.props.children||this.setState({clampEnabled:null,summary:"."},this.setSummary)}setSummary(){if(this.props.children){const{maxLines:e,ellipsis:t}=this.props;if(!this.reviewSummary.current||!this.reviewContent.current)return;const r=(this.reviewSummary.current.clientHeight+1)*e+1,o=this.reviewContent.current.clientHeight+1>r;this.setState({clampEnabled:o}),o&&this.setState({summary:k(this.reviewContent.current.innerHTML,this.reviewSummary.current,r,t)})}}getButton(){const{isExpanded:e}=this.state,{className:t,lessText:r,moreText:o}=this.props,n=e?r:o;if(n)return Object(s.createElement)("a",{href:"#more",className:t+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},n)}onClick(e){e.preventDefault();const{isExpanded:t}=this.state;this.setState({isExpanded:!t})}render(){const{className:e}=this.props,{content:t,summary:r,clampEnabled:o,isExpanded:n}=this.state;return t?!1===o?Object(s.createElement)("div",{className:e},Object(s.createElement)("div",{ref:this.reviewContent},t)):Object(s.createElement)("div",{className:e},(!n||null===o)&&Object(s.createElement)("div",{ref:this.reviewSummary,"aria-hidden":n,dangerouslySetInnerHTML:{__html:r}}),(n||null===o)&&Object(s.createElement)("div",{ref:this.reviewContent,"aria-hidden":!n},t),this.getButton()):null}}v()(E,"defaultProps",j);var R=E;r(211);var S=e=>{let{attributes:t,review:r={}}=e;const{imageType:o,showReviewDate:i,showReviewerName:c,showReviewImage:a,showReviewRating:l,showReviewContent:p,showProductName:d}=t,{rating:b}=r,w=!Object.keys(r).length>0,m=Number.isFinite(b)&&l;return Object(s.createElement)("li",{className:u()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":w,"wc-block-components-review-list-item__item--has-image":a}),"aria-hidden":w},(d||i||c||a||m)&&Object(s.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},a&&function(e,t,r){var o,i;return r||!e?Object(s.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):Object(s.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(s.createElement)("img",{"aria-hidden":"true",alt:(null===(o=e.product_image)||void 0===o?void 0:o.alt)||"",src:(null===(i=e.product_image)||void 0===i?void 0:i.thumbnail)||""}):Object(s.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[96]||""}),e.verified&&Object(s.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(n.__)("Verified buyer","woo-gutenberg-products-block")},Object(n.__)("Verified buyer","woo-gutenberg-products-block")))}(r,o,w),(d||c||m||i)&&Object(s.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},m&&function(e){const{rating:t}=e,r={width:t/5*100+"%"},o=Object(n.sprintf)( +/* translators: %f is referring to the average rating value */ +Object(n.__)("Rated %f out of 5","woo-gutenberg-products-block"),t),i={__html:Object(n.sprintf)( +/* translators: %s is referring to the average rating value */ +Object(n.__)("Rated %s out of 5","woo-gutenberg-products-block"),Object(n.sprintf)('%f',t))};return Object(s.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(s.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":o},Object(s.createElement)("span",{style:r,dangerouslySetInnerHTML:i})))}(r),d&&function(e){return Object(s.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(s.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(r),c&&function(e){const{reviewer:t=""}=e;return Object(s.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},t)}(r),i&&function(e){const{date_created:t,formatted_date_created:r}=e;return Object(s.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(r))),p&&function(e){return Object(s.createElement)(R,{maxLines:10,moreText:Object(n.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(n.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(s.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(r))};r(210);var x=e=>{let{attributes:t,reviews:r}=e;const o=Object(d.getSetting)("showAvatars",!0),n=Object(d.getSetting)("reviewRatingsEnabled",!0),i=(o||"product"===t.imageType)&&t.showReviewImage,c=n&&t.showReviewRating,a={...t,showReviewImage:i,showReviewRating:c};return Object(s.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(s.createElement)(S,{attributes:a}):r.map((e,t)=>Object(s.createElement)(S,{key:e.id||t,attributes:a,review:e})))},P=r(12),T=r.n(P),A=r(11),L=r.n(A),N=r(95),C=(e=>{class t extends c.Component{constructor(){super(...arguments),v()(this,"isPreview",!!this.props.attributes.previewReviews),v()(this,"delayedAppendReviews",this.props.delayFunction(this.appendReviews)),v()(this,"isMounted",!1),v()(this,"state",{error:null,loading:!0,reviews:this.isPreview?this.props.attributes.previewReviews:[],totalReviews:this.isPreview?this.props.attributes.previewReviews.length:0}),v()(this,"setError",async e=>{if(!this.isMounted)return;const{onReviewsLoadError:t}=this.props,r=await Object(N.a)(e);this.setState({reviews:[],loading:!1,error:r}),t(r)})}componentDidMount(){this.isMounted=!0,this.replaceReviews()}componentDidUpdate(e){e.reviewsToDisplay0&&void 0!==arguments[0]?arguments[0]:[];const{reviewsToDisplay:t}=this.props,{totalReviews:r}=this.state,o=Math.min(r,t)-e.length;return this.setState({loading:!0,reviews:e.concat(Array(o).fill({}))}),(s=this.getArgs(e.length),l()({path:"/wc/store/v1/products/reviews?"+Object.entries(s).map(e=>e.join("=")).join("&"),parse:!1}).then(e=>e.json().then(t=>({reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)})))).then(t=>{let{reviews:r,totalReviews:o}=t;return this.isMounted&&this.setState({reviews:e.filter(e=>Object.keys(e).length).concat(r),totalReviews:o,loading:!1,error:null}),{newReviews:r}}).catch(this.setError);var s}render(){const{reviewsToDisplay:t}=this.props,{error:r,loading:o,reviews:n,totalReviews:i}=this.state;return Object(s.createElement)(e,T()({},this.props,{error:r,isLoading:o,reviews:n.slice(0,t),totalReviews:i}))}}v()(t,"defaultProps",{delayFunction:e=>e,onReviewsAppended:()=>{},onReviewsLoadError:()=>{},onReviewsReplaced:()=>{}});const{displayName:r=e.name||"Component"}=e;return t.displayName=`WithReviews( ${r} )`,t})(e=>{let{attributes:t,onAppendReviews:r,onChangeOrderby:o,reviews:i,sortSelectValue:c,totalReviews:a}=e;if(0===i.length)return null;const l=Object(d.getSetting)("reviewRatingsEnabled",!0);return Object(s.createElement)(s.Fragment,null,"false"!==t.showOrderby&&l&&Object(s.createElement)(g,{value:c,onChange:o}),Object(s.createElement)(x,{attributes:t,reviews:i}),"false"!==t.showLoadMore&&a>i.length&&Object(s.createElement)(w,{onClick:r,screenReaderLabel:Object(n.__)("Load more reviews","woo-gutenberg-products-block")}))});class M extends c.Component{constructor(){super(...arguments);const{attributes:e}=this.props;this.state={orderby:e.orderby,reviewsToDisplay:parseInt(e.reviewsOnPageLoad,10)},this.onAppendReviews=this.onAppendReviews.bind(this),this.onChangeOrderby=this.onChangeOrderby.bind(this)}onAppendReviews(){const{attributes:e}=this.props,{reviewsToDisplay:t}=this.state;this.setState({reviewsToDisplay:t+parseInt(e.reviewsOnLoadMore,10)})}onChangeOrderby(e){const{attributes:t}=this.props;this.setState({orderby:e.target.value,reviewsToDisplay:parseInt(t.reviewsOnPageLoad,10)})}onReviewsAppended(e){let{newReviews:t}=e;Object(i.speak)(Object(n.sprintf)( +/* translators: %d is the count of reviews loaded. */ +Object(n._n)("%d review loaded.","%d reviews loaded.",t.length,"woo-gutenberg-products-block"),t.length))}onReviewsReplaced(){Object(i.speak)(Object(n.__)("Reviews list updated.","woo-gutenberg-products-block"))}onReviewsLoadError(){Object(i.speak)(Object(n.__)("There was an error loading the reviews.","woo-gutenberg-products-block"))}render(){const{attributes:e}=this.props,{categoryIds:t,productId:r}=e,{reviewsToDisplay:o}=this.state,{order:n,orderby:i}=(e=>{if(Object(d.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}})(this.state.orderby);return Object(s.createElement)(C,{attributes:e,categoryIds:t,onAppendReviews:this.onAppendReviews,onChangeOrderby:this.onChangeOrderby,onReviewsAppended:this.onReviewsAppended,onReviewsLoadError:this.onReviewsLoadError,onReviewsReplaced:this.onReviewsReplaced,order:n,orderby:i,productId:r,reviewsToDisplay:o,sortSelectValue:this.state.orderby})}}var B=M;Object(o.a)({selector:"\n\t.wp-block-woocommerce-all-reviews,\n\t.wp-block-woocommerce-reviews-by-product,\n\t.wp-block-woocommerce-reviews-by-category\n",Block:B,getProps:e=>({attributes:{showReviewDate:e.classList.contains("has-date"),showReviewerName:e.classList.contains("has-name"),showReviewImage:e.classList.contains("has-image"),showReviewRating:e.classList.contains("has-rating"),showReviewContent:e.classList.contains("has-content"),showProductName:e.classList.contains("has-product-name")}})})},27:function(e,t){e.exports=window.wp.apiFetch},35:function(e,t){},4:function(e,t,r){var o;!function(){"use strict";var r={}.hasOwnProperty;function s(){for(var e=[],t=0;t{let{Block:t,containers:r,getProps:o=(()=>({})),getErrorBoundaryProps:c=(()=>({}))}=e;0!==r.length&&Array.prototype.forEach.call(r,(e,r)=>{const a=o(e,r),l=c(e,r),p={...e.dataset,...a.attributes||{}};(e=>{let{Block:t,container:r,attributes:o={},props:c={},errorBoundaryProps:a={}}=e;Object(n.render)(Object(n.createElement)(i.a,a,Object(n.createElement)(n.Suspense,{fallback:Object(n.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(n.createElement)(t,s()({},c,{attributes:o})))),r,()=>{r.classList&&r.classList.remove("is-loading")})})({Block:t,container:e,props:a,attributes:p,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(c.join(",")),{Block:r,getProps:o,getErrorBoundaryProps:s,selector:n}=e;(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:o,selector:s,wrappers:n}=e;const i=document.body.querySelectorAll(s);n&&n.length>0&&Array.prototype.filter.call(i,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,n)),a({Block:t,containers:i,getProps:r,getErrorBoundaryProps:o})})({Block:r,getProps:o,getErrorBoundaryProps:s,selector:n,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:o,selector:s,wrapper:n}=e;const i=n.querySelectorAll(s);a({Block:t,containers:i,getProps:r,getErrorBoundaryProps:o})})({...e,wrapper:t})})})}},9:function(e,t){e.exports=window.wp.compose},95:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return i}));var o=r(1),s=r(17);const n=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},i=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(s.decodeEntities)(e.message):Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}}}); \ No newline at end of file diff --git a/build/single-product-frontend.asset.php b/build/single-product-frontend.asset.php new file mode 100644 index 00000000000..e46f8a36250 --- /dev/null +++ b/build/single-product-frontend.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'b9b316dab3c7a22c438f9dde50364ec2'); \ No newline at end of file diff --git a/build/single-product-frontend.js b/build/single-product-frontend.js new file mode 100644 index 00000000000..96334b6a216 --- /dev/null +++ b/build/single-product-frontend.js @@ -0,0 +1,3 @@ +!function(e){function t(t){for(var n,o,i=t[0],c=t[1],a=0,l=[];a{let{imageUrl:t=s.l+"/block-error.svg",header:n=Object(a.__)("Oops!","woo-gutenberg-products-block"),text:r=Object(a.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:c=Object(a.__)("Error:","woo-gutenberg-products-block"),button:l,showErrorBlock:u=!0}=e;return u?Object(i.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(i.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(i.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},n&&Object(i.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},n),r&&Object(i.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},r),o&&Object(i.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},c?c+" ":"",o),l&&Object(i.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};n(35);class u extends c.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(i.createElement)(i.Fragment,null,Object(i.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:n=!0,showErrorBlock:r=!0,text:o,errorMessagePrefix:c,renderError:a,button:s}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof a?a({errorMessage:u}):Object(i.createElement)(l,{showErrorBlock:r,errorMessage:n?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:c,button:s}):this.props.children}}t.a=u},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){e.exports=window.wp.htmlEntities},,function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},,,,function(e,t){e.exports=window.wp.a11y},function(e,t,n){"use strict";(function(e){var r=n(0);n(37);const o=Object(r.createContext)({slots:{},fills:{},registerSlot:()=>{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,n(55))},function(e,t){e.exports=window.wp.deprecated},,function(e,t){e.exports=window.wp.apiFetch},,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);n(7);const o=Object(r.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),i=()=>Object(r.useContext)(o)},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return w}));var r=n(3),o=n(0),i=n(6),c=n(7),a=n(17),s=n(118),l=n(29),u=n(70);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(c.dispatch)(i.CART_STORE_KEY).invalidateResolutionForStore()},p=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},m=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.b)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.b)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),p),[])},f={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},b={...f,email:""},h={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:i.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},g=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,n]=e;return[t,Object(a.decodeEntities)(n)]})),v={cartCoupons:i.EMPTY_CART_COUPONS,cartItems:i.EMPTY_CART_ITEMS,cartFees:i.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:i.EMPTY_CART_ITEM_ERRORS,cartTotals:h,cartIsLoading:!0,cartErrors:i.EMPTY_CART_ERRORS,billingAddress:b,shippingAddress:f,shippingRates:i.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:i.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:i.EMPTY_EXTENSIONS},w=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:n}=Object(l.a)(),a=null==n?void 0:n.previewCart,{shouldSelect:u}=e,d=Object(o.useRef)();m();const p=Object(c.useSelect)((e,n)=>{let{dispatch:r}=n;if(!u)return v;if(t)return{cartCoupons:a.coupons,cartItems:a.items,cartFees:a.fees,cartItemsCount:a.items_count,cartItemsWeight:a.items_weight,cartNeedsPayment:a.needs_payment,cartNeedsShipping:a.needs_shipping,cartItemErrors:i.EMPTY_CART_ITEM_ERRORS,cartTotals:a.totals,cartIsLoading:!1,cartErrors:i.EMPTY_CART_ERRORS,billingData:b,billingAddress:b,shippingAddress:f,extensions:i.EMPTY_EXTENSIONS,shippingRates:a.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:a.has_calculated_shipping,paymentRequirements:a.paymentRequirements,receiveCart:"function"==typeof(null==a?void 0:a.receiveCart)?a.receiveCart:()=>{}};const o=e(i.CART_STORE_KEY),c=o.getCartData(),l=o.getCartErrors(),d=o.getCartTotals(),p=!o.hasFinishedResolution("getCartData"),m=o.isCustomerDataUpdating(),{receiveCart:h}=r(i.CART_STORE_KEY),w=g(c.billingAddress),O=c.needsShipping?g(c.shippingAddress):w,y=c.fees.length>0?c.fees.map(e=>g(e)):i.EMPTY_CART_FEES;return{cartCoupons:c.coupons.length>0?c.coupons.map(e=>({...e,label:e.code})):i.EMPTY_CART_COUPONS,cartItems:c.items,cartFees:y,cartItemsCount:c.itemsCount,cartItemsWeight:c.itemsWeight,cartNeedsPayment:c.needsPayment,cartNeedsShipping:c.needsShipping,cartItemErrors:c.errors,cartTotals:d,cartIsLoading:p,cartErrors:l,billingData:Object(s.a)(w),billingAddress:Object(s.a)(w),shippingAddress:Object(s.a)(O),extensions:c.extensions,shippingRates:c.shippingRates,isLoadingRates:m,cartHasCalculatedShipping:c.hasCalculatedShipping,paymentRequirements:c.paymentRequirements,receiveCart:h}},[u]);return d.current&&Object(r.isEqual)(d.current,p)||(d.current=p),d.current}},,function(e,t,n){"use strict";var r=n(4),o=n.n(r),i=n(0);t.a=Object(i.forwardRef)((function({as:e="div",className:t,...n},r){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(i.createElement)(e,t)}({as:e,className:o()("components-visually-hidden",t),...n,ref:r})}))},function(e,t){},,function(e,t){e.exports=window.wp.warning},function(e,t,n){"use strict";var r=n(8),o=n(0),i=n(13),c=function({icon:e,className:t,...n}){const i=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(o.createElement)("span",Object(r.a)({className:i},n))};t.a=function({icon:e=null,size:t=24,...n}){if("string"==typeof e)return Object(o.createElement)(c,Object(r.a)({icon:e},n));if(Object(o.isValidElement)(e)&&c===e.type)return Object(o.cloneElement)(e,{...n});if("function"==typeof e)return e.prototype instanceof o.Component?Object(o.createElement)(e,{size:t,...n}):e({size:t,...n});if(e&&("svg"===e.type||e.type===i.SVG)){const r={width:t,height:t,...e.props,...n};return Object(o.createElement)(i.SVG,r)}return Object(o.isValidElement)(e)?Object(o.cloneElement)(e,{size:t,...n}):e}},,,function(e,t){e.exports=window.wc.priceFormat},function(e,t,n){"use strict";var r=n(8),o=n(0),i=n(4),c=n.n(i),a=n(3),s=n(25),l=n.n(s),u=n(9),d=n(44),p=n(71),m=n(1);function f(e,t,n){const{defaultView:r}=t,{frameElement:o}=r;if(!o||t===n.ownerDocument)return e;const i=o.getBoundingClientRect();return new r.DOMRect(e.left+i.left,e.top+i.top,e.width,e.height)}let b=0;function h(e){const t=document.scrollingElement||document.body;e&&(b=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=b)}let g=0;function v(){return Object(o.useEffect)(()=>(0===g&&h(!0),++g,()=>{1===g&&h(!1),--g}),[]),null}var w=n(24);function O(e){const t=Object(o.useContext)(w.a),n=t.slots[e]||{},r=t.fills[e],i=Object(o.useMemo)(()=>r||[],[r]);return{...n,updateSlot:Object(o.useCallback)(n=>{t.updateSlot(e,n)},[e,t.updateSlot]),unregisterSlot:Object(o.useCallback)(n=>{t.unregisterSlot(e,n)},[e,t.unregisterSlot]),fills:i,registerFill:Object(o.useCallback)(n=>{t.registerFill(e,n)},[e,t.registerFill]),unregisterFill:Object(o.useCallback)(n=>{t.unregisterFill(e,n)},[e,t.unregisterFill])}}var y=Object(o.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function E({name:e,children:t,registerFill:n,unregisterFill:r}){const i=(e=>{const{getSlot:t,subscribe:n}=Object(o.useContext)(y),[r,i]=Object(o.useState)(t(e));return Object(o.useEffect)(()=>(i(t(e)),n(()=>{i(t(e))})),[e]),r})(e),c=Object(o.useRef)({name:e,children:t});return Object(o.useLayoutEffect)(()=>(n(e,c.current),()=>r(e,c.current)),[]),Object(o.useLayoutEffect)(()=>{c.current.children=t,i&&i.forceUpdate()},[t]),Object(o.useLayoutEffect)(()=>{e!==c.current.name&&(r(c.current.name,c.current),c.current.name=e,n(e,c.current))},[e]),i&&i.node?(Object(a.isFunction)(t)&&(t=t(i.props.fillProps)),Object(o.createPortal)(t,i.node)):null}var k=e=>Object(o.createElement)(y.Consumer,null,({registerFill:t,unregisterFill:n})=>Object(o.createElement)(E,Object(r.a)({},e,{registerFill:t,unregisterFill:n})));class j extends o.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:n,registerSlot:r}=this.props;e.name!==t&&(n(e.name),r(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:n={},getFills:r}=this.props,i=Object(a.map)(r(t,this),e=>{const t=Object(a.isFunction)(e.children)?e.children(n):e.children;return o.Children.map(t,(e,t)=>{if(!e||Object(a.isString)(e))return e;const n=e.key||t;return Object(o.cloneElement)(e,{key:n})})}).filter(Object(a.negate)(o.isEmptyElement));return Object(o.createElement)(o.Fragment,null,Object(a.isFunction)(e)?e(i):i)}}var _=e=>Object(o.createElement)(y.Consumer,null,({registerSlot:t,unregisterSlot:n,getFills:i})=>Object(o.createElement)(j,Object(r.a)({},e,{registerSlot:t,unregisterSlot:n,getFills:i})));function x(){const[,e]=Object(o.useState)({}),t=Object(o.useRef)(!0);return Object(o.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function S({name:e,children:t}){const n=O(e),r=Object(o.useRef)({rerender:x()});return Object(o.useEffect)(()=>(n.registerFill(r),()=>{n.unregisterFill(r)}),[n.registerFill,n.unregisterFill]),n.ref&&n.ref.current?("function"==typeof t&&(t=t(n.fillProps)),Object(o.createPortal)(t,n.ref.current)):null}var C=Object(o.forwardRef)((function({name:e,fillProps:t={},as:n="div",...i},c){const a=Object(o.useContext)(w.a),s=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(a.registerSlot(e,s,t),()=>{a.unregisterSlot(e,s)}),[a.registerSlot,a.unregisterSlot,e]),Object(o.useLayoutEffect)(()=>{a.updateSlot(e,t)}),Object(o.createElement)(n,Object(r.a)({ref:Object(u.useMergeRefs)([c,s])},i))}));function T(e){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(k,e),Object(o.createElement)(S,e))}n(11),o.Component;const P=Object(o.forwardRef)(({bubblesVirtually:e,...t},n)=>e?Object(o.createElement)(C,Object(r.a)({},t,{ref:n})):Object(o.createElement)(_,t));function R(e){return"appear"===e?"top":"left"}function A(e,t){const{paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:i}=(c=t).ownerDocument.defaultView.getComputedStyle(c);var c;const a=n?parseInt(n,10):0,s=r?parseInt(r,10):0,l=o?parseInt(o,10):0,u=i?parseInt(i,10):0;return{x:e.left+l,y:e.top+a,width:e.width-l-u,height:e.height-a-s,left:e.left+l,right:e.right-u,top:e.top+a,bottom:e.bottom-s}}function N(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function M(e,t,n=""){e.style[t]!==n&&(e.style[t]=n)}function L(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const B=Object(o.forwardRef)(({headerTitle:e,onClose:t,children:n,className:i,noArrow:a=!0,isAlternate:s,position:b="bottom right",range:h,focusOnMount:g="firstElement",anchorRef:w,shouldAnchorIncludePadding:y,anchorRect:E,getAnchorRect:k,expandOnMobile:j,animate:_=!0,onClickOutside:x,onFocusOutside:S,__unstableStickyBoundaryElement:C,__unstableSlotName:P="Popover",__unstableObserveElement:B,__unstableBoundaryParent:F,__unstableForcePosition:D,__unstableForceXAlignment:I,...U},H)=>{const z=Object(o.useRef)(null),V=Object(o.useRef)(null),W=Object(o.useRef)(),Y=Object(u.useViewportMatch)("medium","<"),[q,X]=Object(o.useState)(),$=O(P),Z=j&&Y,[K,Q]=Object(u.useResizeObserver)();a=Z||a,Object(o.useLayoutEffect)(()=>{if(Z)return L(W.current,"is-without-arrow",a),L(W.current,"is-alternate",s),N(W.current,"data-x-axis"),N(W.current,"data-y-axis"),M(W.current,"top"),M(W.current,"left"),M(V.current,"maxHeight"),void M(V.current,"maxWidth");const e=()=>{if(!W.current||!V.current)return;let e=function(e,t,n,r=!1,o,i){if(t)return t;if(n){if(!e.current)return;const t=n(e.current);return f(t,t.ownerDocument||e.current.ownerDocument,i)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==r?void 0:r.cloneRange))return f(Object(d.getRectangleFromRange)(r),r.endContainer.ownerDocument,i);if("function"==typeof(null==r?void 0:r.getBoundingClientRect)){const e=f(r.getBoundingClientRect(),r.ownerDocument,i);return o?e:A(e,r)}const{top:e,bottom:t}=r,n=e.getBoundingClientRect(),c=t.getBoundingClientRect(),a=f(new window.DOMRect(n.left,n.top,n.width,c.bottom-n.top),e.ownerDocument,i);return o?a:A(a,r)}if(!e.current)return;const{parentNode:c}=e.current,a=c.getBoundingClientRect();return o?a:A(a,c)}(z,E,k,w,y,W.current);if(!e)return;const{offsetParent:t,ownerDocument:n}=W.current;let r,o=0;if(t&&t!==n.body){const n=t.getBoundingClientRect();o=n.top,e=new window.DOMRect(e.left-n.left,e.top-n.top,e.width,e.height)}var i;F&&(r=null===(i=W.current.closest(".popover-slot"))||void 0===i?void 0:i.parentNode);const c=Q.height?Q:V.current.getBoundingClientRect(),{popoverTop:l,popoverLeft:u,xAxis:p,yAxis:h,contentHeight:g,contentWidth:v}=function(e,t,n="top",r,o,i,c,a,s){const[l,u="center",d]=n.split(" "),p=function(e,t,n,r,o,i,c,a){const{height:s}=t;if(o){const t=o.getBoundingClientRect().top+s-c;if(e.top<=t)return{yAxis:n,popoverTop:Math.min(e.bottom,t)}}let l=e.top+e.height/2;"bottom"===r?l=e.bottom:"top"===r&&(l=e.top);const u={popoverTop:l,contentHeight:(l-s/2>0?s/2:l)+(l+s/2>window.innerHeight?window.innerHeight-l:s/2)},d={popoverTop:e.top,contentHeight:e.top-10-s>0?s:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+s>window.innerHeight?window.innerHeight-10-e.bottom:s};let m,f=n,b=null;if(!o&&!a)if("middle"===n&&u.contentHeight===s)f="middle";else if("top"===n&&d.contentHeight===s)f="top";else if("bottom"===n&&p.contentHeight===s)f="bottom";else{f=d.contentHeight>p.contentHeight?"top":"bottom";const e="top"===f?d.contentHeight:p.contentHeight;b=e!==s?e:null}return m="middle"===f?u.popoverTop:"top"===f?d.popoverTop:p.popoverTop,{yAxis:f,popoverTop:m,contentHeight:b}}(e,t,l,d,r,0,i,a);return{...function(e,t,n,r,o,i,c,a,s){const{width:l}=t;"left"===n&&Object(m.isRTL)()?n="right":"right"===n&&Object(m.isRTL)()&&(n="left"),"left"===r&&Object(m.isRTL)()?r="right":"right"===r&&Object(m.isRTL)()&&(r="left");const u=Math.round(e.left+e.width/2),d={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)};let p=e.left;"right"===r?p=e.right:"middle"===i||s||(p=u);let f=e.right;"left"===r?f=e.left:"middle"===i||s||(f=u);const b={popoverLeft:p,contentWidth:p-l>0?l:p},h={popoverLeft:f,contentWidth:f+l>window.innerWidth?window.innerWidth-f:l};let g,v=n,w=null;if(!o&&!a)if("center"===n&&d.contentWidth===l)v="center";else if("left"===n&&b.contentWidth===l)v="left";else if("right"===n&&h.contentWidth===l)v="right";else{v=b.contentWidth>h.contentWidth?"left":"right";const e="left"===v?b.contentWidth:h.contentWidth;l>window.innerWidth&&(w=window.innerWidth),e!==l&&(v="center",d.popoverLeft=window.innerWidth/2)}if(g="center"===v?d.popoverLeft:"left"===v?b.popoverLeft:h.popoverLeft,c){const e=c.getBoundingClientRect();g=Math.min(g,e.right-l),Object(m.isRTL)()||(g=Math.max(g,0))}return{xAxis:v,popoverLeft:g,contentWidth:w}}(e,t,u,d,r,p.yAxis,c,a,s),...p}}(e,c,b,C,W.current,o,r,D,I);"number"==typeof l&&"number"==typeof u&&(M(W.current,"top",l+"px"),M(W.current,"left",u+"px")),L(W.current,"is-without-arrow",a||"center"===p&&"middle"===h),L(W.current,"is-alternate",s),N(W.current,"data-x-axis",p),N(W.current,"data-y-axis",h),M(V.current,"maxHeight","number"==typeof g?g+"px":""),M(V.current,"maxWidth","number"==typeof v?v+"px":""),X(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[h]||"middle"))};e();const{ownerDocument:t}=W.current,{defaultView:n}=t,r=n.setInterval(e,500);let o;const i=()=>{n.cancelAnimationFrame(o),o=n.requestAnimationFrame(e)};n.addEventListener("click",i),n.addEventListener("resize",e),n.addEventListener("scroll",e,!0);const c=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(w);let l;return c&&c!==t&&(c.defaultView.addEventListener("resize",e),c.defaultView.addEventListener("scroll",e,!0)),B&&(l=new n.MutationObserver(e),l.observe(B,{attributes:!0})),()=>{n.clearInterval(r),n.removeEventListener("resize",e),n.removeEventListener("scroll",e,!0),n.removeEventListener("click",i),n.cancelAnimationFrame(o),c&&c!==t&&(c.defaultView.removeEventListener("resize",e),c.defaultView.removeEventListener("scroll",e,!0)),l&&l.disconnect()}},[Z,E,k,w,y,b,Q,C,B,F]);const J=(e,n)=>{if("focus-outside"===e&&S)S(n);else if("focus-outside"===e&&x){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>n.relatedTarget}),l()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),x(e)}else t&&t()},[ee,te]=Object(u.__experimentalUseDialog)({focusOnMount:g,__unstableOnClose:J,onClose:J}),ne=Object(u.useMergeRefs)([W,ee,H]),re=Boolean(_&&q)&&function(e){if("loading"===e.type)return c()("components-animate__loading");const{type:t,origin:n=R(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return c()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?c()("components-animate__slide-in","is-from-"+n):void 0}({type:"appear",origin:q});let oe=Object(o.createElement)("div",Object(r.a)({className:c()("components-popover",i,re,{"is-expanded":Z,"is-without-arrow":a,"is-alternate":s})},U,{ref:ne},te,{tabIndex:"-1"}),Z&&Object(o.createElement)(v,null),Z&&Object(o.createElement)("div",{className:"components-popover__header"},Object(o.createElement)("span",{className:"components-popover__header-title"},e),Object(o.createElement)(G,{className:"components-popover__close",icon:p.a,onClick:t})),Object(o.createElement)("div",{ref:V,className:"components-popover__content"},Object(o.createElement)("div",{style:{position:"relative"}},K,n)));return $.ref&&(oe=Object(o.createElement)(T,{name:P},oe)),w||E?oe:Object(o.createElement)("span",{ref:z},oe)});B.Slot=Object(o.forwardRef)((function({name:e="Popover"},t){return Object(o.createElement)(P,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var F=B,D=function({shortcut:e,className:t}){if(!e)return null;let n,r;return Object(a.isString)(e)&&(n=e),Object(a.isObject)(e)&&(n=e.display,r=e.ariaLabel),Object(o.createElement)("span",{className:t,"aria-label":r},n)};const I=Object(o.createElement)("div",{className:"event-catcher"}),U=({eventHandlers:e,child:t,childrenWithPopover:n})=>Object(o.cloneElement)(Object(o.createElement)("span",{className:"disabled-element-wrapper"},Object(o.cloneElement)(I,e),Object(o.cloneElement)(t,{children:n}),","),e),H=({child:e,eventHandlers:t,childrenWithPopover:n})=>Object(o.cloneElement)(e,{...t,children:n}),z=(e,t,n)=>{if(1!==o.Children.count(e))return;const r=o.Children.only(e);"function"==typeof r.props[t]&&r.props[t](n)};var V=function({children:e,position:t,text:n,shortcut:r}){const[i,c]=Object(o.useState)(!1),[s,l]=Object(o.useState)(!1),d=Object(u.useDebounce)(l,700),p=t=>{z(e,"onMouseDown",t),document.addEventListener("mouseup",b),c(!0)},m=t=>{z(e,"onMouseUp",t),document.removeEventListener("mouseup",b),c(!1)},f=e=>"mouseUp"===e?m:"mouseDown"===e?p:void 0,b=f("mouseUp"),h=(t,n)=>r=>{if(z(e,t,r),r.currentTarget.disabled)return;if("focus"===r.type&&i)return;d.cancel();const o=Object(a.includes)(["focus","mouseenter"],r.type);o!==s&&(n?d(o):l(o))},g=()=>{d.cancel(),document.removeEventListener("mouseup",b)};if(Object(o.useEffect)(()=>g,[]),1!==o.Children.count(e))return e;const v={onMouseEnter:h("onMouseEnter",!0),onMouseLeave:h("onMouseLeave"),onClick:h("onClick"),onFocus:h("onFocus"),onBlur:h("onBlur"),onMouseDown:f("mouseDown")},w=o.Children.only(e),{children:O,disabled:y}=w.props;return(y?U:H)({child:w,eventHandlers:v,childrenWithPopover:(({grandchildren:e,isOver:t,position:n,text:r,shortcut:i})=>Object(o.concatChildren)(e,t&&Object(o.createElement)(F,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(o.createElement)(D,{className:"components-tooltip__shortcut",shortcut:i}))))({grandchildren:O,isOver:s,position:t,text:n,shortcut:r})})},W=n(38),Y=n(34);const q=["onMouseDown","onClick"];var G=t.a=Object(o.forwardRef)((function(e,t){const{href:n,target:i,isSmall:s,isPressed:u,isBusy:d,isDestructive:p,className:m,disabled:f,icon:b,iconPosition:h="left",iconSize:g,showTooltip:v,tooltipPosition:w,shortcut:O,label:y,children:E,text:k,variant:j,__experimentalIsFocusable:_,describedBy:x,...S}=function({isDefault:e,isPrimary:t,isSecondary:n,isTertiary:r,isLink:o,variant:i,...c}){let a=i;var s,u,d,p,m;return t&&(null!==(s=a)&&void 0!==s||(a="primary")),r&&(null!==(u=a)&&void 0!==u||(a="tertiary")),n&&(null!==(d=a)&&void 0!==d||(a="secondary")),e&&(l()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(p=a)&&void 0!==p||(a="secondary")),o&&(null!==(m=a)&&void 0!==m||(a="link")),{...c,variant:a}}(e),C=c()("components-button",m,{"is-secondary":"secondary"===j,"is-primary":"primary"===j,"is-small":s,"is-tertiary":"tertiary"===j,"is-pressed":u,"is-busy":d,"is-link":"link"===j,"is-destructive":p,"has-text":!!b&&!!E,"has-icon":!!b}),T=f&&!_,P=void 0===n||T?"button":"a",R="a"===P?{href:n,target:i}:{type:"button",disabled:T,"aria-pressed":u};if(f&&_){R["aria-disabled"]=!0;for(const e of q)S[e]=e=>{e.stopPropagation(),e.preventDefault()}}const A=!T&&(v&&y||O||!!y&&(!E||Object(a.isArray)(E)&&!E.length)&&!1!==v),N=x?Object(a.uniqueId)():null,M=S["aria-describedby"]||N,L=Object(o.createElement)(P,Object(r.a)({},R,S,{className:C,"aria-label":S["aria-label"]||y,"aria-describedby":M,ref:t}),b&&"left"===h&&Object(o.createElement)(W.a,{icon:b,size:g}),k&&Object(o.createElement)(o.Fragment,null,k),b&&"right"===h&&Object(o.createElement)(W.a,{icon:b,size:g}),E);return A?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(V,{text:x||y,shortcut:O,position:w},L),x&&Object(o.createElement)(Y.a,null,Object(o.createElement)("span",{id:N},x))):Object(o.createElement)(o.Fragment,null,L,x&&Object(o.createElement)(Y.a,null,Object(o.createElement)("span",{id:N},x)))}))},function(e,t){e.exports=window.wp.hooks},function(e,t){e.exports=window.wp.dom},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"string"==typeof e},,function(e,t){e.exports=window.wc.wcBlocksSharedContext},function(e,t,n){"use strict";n.d(t,"n",(function(){return i})),n.d(t,"l",(function(){return c})),n.d(t,"k",(function(){return a})),n.d(t,"m",(function(){return s})),n.d(t,"i",(function(){return l})),n.d(t,"d",(function(){return u})),n.d(t,"f",(function(){return d})),n.d(t,"j",(function(){return p})),n.d(t,"c",(function(){return m})),n.d(t,"e",(function(){return f})),n.d(t,"g",(function(){return b})),n.d(t,"a",(function(){return h})),n.d(t,"h",(function(){return g})),n.d(t,"b",(function(){return v}));var r,o=n(2);const i=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),c=i.pluginUrl+"images/",a=i.pluginUrl+"build/",s=i.buildPhase,l=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),m=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),f=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),b=Object(o.getSetting)("shippingCountries",{}),h=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),v=Object(o.getSetting)("allowedStates",{})},function(e,t,n){"use strict";var r=n(2),o=n(1),i=n(72),c=n(45);const a=Object(r.getSetting)("countryLocale",{}),s=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(o.sprintf)( +/* translators: %s Field label. */ +Object(o.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(i.a)(e.priority)&&(t.index=e.priority),Object(c.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},l=Object.entries(a).map(e=>{let[t,n]=e;return[t,Object.entries(n).map(e=>{let[t,n]=e;return[t,s(n)]}).reduce((e,t)=>{let[n,r]=t;return e[n]=r,e},{})]}).reduce((e,t)=>{let[n,r]=t;return e[n]=r,e},{});t.a=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=n&&void 0!==l[n]?l[n]:{};return e.map(e=>({key:e,...r.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(12),o=n.n(r),i=n(0),c=n(15);const a=[".wp-block-woocommerce-cart"],s=e=>{let{Block:t,containers:n,getProps:r=(()=>({})),getErrorBoundaryProps:a=(()=>({}))}=e;0!==n.length&&Array.prototype.forEach.call(n,(e,n)=>{const s=r(e,n),l=a(e,n),u={...e.dataset,...s.attributes||{}};(e=>{let{Block:t,container:n,attributes:r={},props:a={},errorBoundaryProps:s={}}=e;Object(i.render)(Object(i.createElement)(c.a,s,Object(i.createElement)(i.Suspense,{fallback:Object(i.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(i.createElement)(t,o()({},a,{attributes:r})))),n,()=>{n.classList&&n.classList.remove("is-loading")})})({Block:t,container:e,props:s,attributes:u,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(a.join(",")),{Block:n,getProps:r,getErrorBoundaryProps:o,selector:i}=e;(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrappers:i}=e;const c=document.body.querySelectorAll(o);i&&i.length>0&&Array.prototype.filter.call(c,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,i)),s({Block:t,containers:c,getProps:n,getErrorBoundaryProps:r})})({Block:n,getProps:r,getErrorBoundaryProps:o,selector:i,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrapper:i}=e;const c=i.querySelectorAll(o);s({Block:t,containers:c,getProps:n,getErrorBoundaryProps:r})})({...e,wrapper:t})})})}},,,function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:c}catch(e){r=c}}();var s,l=[],u=!1,d=-1;function p(){u&&s&&(u=!1,s.length?l=s.concat(l):d=-1,l.length&&m())}function m(){if(!u){var e=a(p);u=!0;for(var t=l.length;t;){for(s=l,l=[];++d1)for(var n=1;n=16;e.exports={PRESERVE_CUSTOM_ATTRIBUTES:c,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var n,r,o="function"==typeof t,i={},c={};for(n in e)r=e[n],o&&(i=t(n,r))&&2===i.length?c[i[0]]=i[1]:"string"==typeof r&&(c[r]=n);return c},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){null!=e&&(t.style=o(e,i))}}},function(e,t,n){for(var r,o=n(93).CASE_SENSITIVE_TAG_NAMES,i={},c=0,a=o.length;c{const e=Object(i.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...n,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return c}));var r=n(0);const o=Object(r.createContext)({setIsSuppressed:e=>{},isSuppressed:!1}),i=()=>Object(r.useContext)(o),c=e=>{let{children:t}=e;const[n,i]=Object(r.useState)(!1),c={setIsSuppressed:i,isSuppressed:n};return Object(r.createElement)(o.Provider,{value:c},t)}},,function(e,t,n){var r=n(82),o=n(56),i=n(91),c={decodeEntities:!0,lowerCaseAttributeNames:!1};function a(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return""===e?[]:r(i(e,(t=t||{}).htmlparser2||c),t)}a.domToReact=r,a.htmlToDOM=i,a.attributesToProps=o,e.exports=a,e.exports.default=a},,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"d",(function(){return c})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return s}));const r=window.CustomEvent||null,o=(e,t)=>{let{bubbles:n=!1,cancelable:o=!1,element:i,detail:c={}}=t;if(!r)return;i||(i=document.body);const a=new r(e,{bubbles:n,cancelable:o,detail:c});i.dispatchEvent(a)};let i;const c=()=>{i&&clearTimeout(i),i=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},a=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},s=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const i=()=>{o(t,{bubbles:n,cancelable:r})};return jQuery(document).on(e,i),()=>jQuery(document).off(e,i)}},function(e,t,n){"use strict";var r=n(0),o=n(13);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"number"==typeof e},,,,function(e,t,n){"use strict";var r=n(0),o=n(3),i=n(4),c=n.n(i),a=n(1),s=n(23),l=n(71),u=n(42);function d(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}t.a=function({className:e,status:t="info",children:n,spokenMessage:i=n,onRemove:p=o.noop,isDismissible:m=!0,actions:f=[],politeness:b=d(t),__unstableHTML:h,onDismiss:g=o.noop}){!function(e,t){const n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)(()=>{n&&Object(s.speak)(n,t)},[n,t])}(i,b);const v=c()(e,"components-notice","is-"+t,{"is-dismissible":m});return h&&(n=Object(r.createElement)(r.RawHTML,null,n)),Object(r.createElement)("div",{className:v},Object(r.createElement)("div",{className:"components-notice__content"},n,Object(r.createElement)("div",{className:"components-notice__actions"},f.map(({className:e,label:t,isPrimary:n,variant:o,noDefaultClasses:i=!1,onClick:a,url:s},l)=>{let d=o;return"primary"===o||i||(d=s?"link":"secondary"),void 0===d&&n&&(d="primary"),Object(r.createElement)(u.a,{key:l,href:s,variant:d,onClick:s?void 0:a,className:c()("components-notice__action",e)},t)}))),m&&Object(r.createElement)(u.a,{className:"components-notice__dismiss",icon:l.a,label:Object(a.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),g(),p()},showTooltip:!1}))}},,,,,function(e,t){},function(e,t,n){var r=n(5),o=n(56),i=n(57),c=i.setStyleProp;function a(e){return i.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&i.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,n){for(var i,s,l,u,d=(n=n||{}).library||r,p=d.cloneElement,m=d.createElement,f=d.isValidElement,b=[],h="function"==typeof n.replace,g=n.trim,v=0,w=t.length;v1&&(s=p(s,{key:s.key||v})),b.push(s);else if("text"!==i.type){switch(l=i.attribs,a(i)?c(l.style,l):l&&(l=o(l)),u=null,i.type){case"script":case"style":i.children[0]&&(l.dangerouslySetInnerHTML={__html:i.children[0].data});break;case"tag":"textarea"===i.name&&i.children[0]?l.defaultValue=i.children[0].data:i.children&&i.children.length&&(u=e(i.children,n));break;default:continue}w>1&&(l.key=v),b.push(m(i.name,l,u))}else g?i.data.trim()&&b.push(i.data):b.push(i.data);return 1===b.length?b[0]:b}},function(e,t,n){var r=n(84),o=n(85),i=n(86),c=i.MUST_USE_PROPERTY,a=i.HAS_BOOLEAN_VALUE,s=i.HAS_NUMERIC_VALUE,l=i.HAS_POSITIVE_NUMERIC_VALUE,u=i.HAS_OVERLOADED_BOOLEAN_VALUE;function d(e,t){return(e&t)===t}function p(e,t,n){var r,o,i,p=e.Properties,m=e.DOMAttributeNames;for(o in p)r=m[o]||(n?o:o.toLowerCase()),i=p[o],t[r]={attributeName:r,propertyName:o,mustUseProperty:d(i,c),hasBooleanValue:d(i,a),hasNumericValue:d(i,s),hasPositiveNumericValue:d(i,l),hasOverloadedBooleanValue:d(i,u)}}var m={};p(r,m);var f={};p(o,f,!0);var b={};p(r,b),p(o,b,!0),e.exports={html:m,svg:f,properties:b,isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"))}},function(e,t){e.exports={Properties:{autoFocus:4,accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:4,allowTransparency:0,alt:0,as:0,async:4,autoComplete:0,autoPlay:4,capture:4,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:5,cite:0,classID:0,className:0,cols:24,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:4,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:4,defer:4,dir:0,disabled:4,download:32,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:4,formTarget:0,frameBorder:0,headers:0,height:0,hidden:4,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:4,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:5,muted:5,name:0,nonce:0,noValidate:4,open:4,optimum:0,pattern:0,placeholder:0,playsInline:4,poster:0,preload:0,profile:0,radioGroup:0,readOnly:4,referrerPolicy:0,rel:0,required:4,reversed:4,role:0,rows:24,rowSpan:8,sandbox:0,scope:0,scoped:4,scrolling:0,seamless:4,selected:5,shape:0,size:24,sizes:0,span:24,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:8,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:4,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"}}},function(e,t){e.exports={Properties:{accentHeight:0,accumulate:0,additive:0,alignmentBaseline:0,allowReorder:0,alphabetic:0,amplitude:0,arabicForm:0,ascent:0,attributeName:0,attributeType:0,autoReverse:0,azimuth:0,baseFrequency:0,baseProfile:0,baselineShift:0,bbox:0,begin:0,bias:0,by:0,calcMode:0,capHeight:0,clip:0,clipPath:0,clipRule:0,clipPathUnits:0,colorInterpolation:0,colorInterpolationFilters:0,colorProfile:0,colorRendering:0,contentScriptType:0,contentStyleType:0,cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:0,direction:0,display:0,divisor:0,dominantBaseline:0,dur:0,dx:0,dy:0,edgeMode:0,elevation:0,enableBackground:0,end:0,exponent:0,externalResourcesRequired:0,fill:0,fillOpacity:0,fillRule:0,filter:0,filterRes:0,filterUnits:0,floodColor:0,floodOpacity:0,focusable:0,fontFamily:0,fontSize:0,fontSizeAdjust:0,fontStretch:0,fontStyle:0,fontVariant:0,fontWeight:0,format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:0,glyphOrientationHorizontal:0,glyphOrientationVertical:0,glyphRef:0,gradientTransform:0,gradientUnits:0,hanging:0,horizAdvX:0,horizOriginX:0,ideographic:0,imageRendering:0,in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:0,kernelUnitLength:0,kerning:0,keyPoints:0,keySplines:0,keyTimes:0,lengthAdjust:0,letterSpacing:0,lightingColor:0,limitingConeAngle:0,local:0,markerEnd:0,markerMid:0,markerStart:0,markerHeight:0,markerUnits:0,markerWidth:0,mask:0,maskContentUnits:0,maskUnits:0,mathematical:0,mode:0,numOctaves:0,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:0,overlineThickness:0,paintOrder:0,panose1:0,pathLength:0,patternContentUnits:0,patternTransform:0,patternUnits:0,pointerEvents:0,points:0,pointsAtX:0,pointsAtY:0,pointsAtZ:0,preserveAlpha:0,preserveAspectRatio:0,primitiveUnits:0,r:0,radius:0,refX:0,refY:0,renderingIntent:0,repeatCount:0,repeatDur:0,requiredExtensions:0,requiredFeatures:0,restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:0,slope:0,spacing:0,specularConstant:0,specularExponent:0,speed:0,spreadMethod:0,startOffset:0,stdDeviation:0,stemh:0,stemv:0,stitchTiles:0,stopColor:0,stopOpacity:0,strikethroughPosition:0,strikethroughThickness:0,string:0,stroke:0,strokeDasharray:0,strokeDashoffset:0,strokeLinecap:0,strokeLinejoin:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0,surfaceScale:0,systemLanguage:0,tableValues:0,targetX:0,targetY:0,textAnchor:0,textDecoration:0,textRendering:0,textLength:0,to:0,transform:0,u1:0,u2:0,underlinePosition:0,underlineThickness:0,unicode:0,unicodeBidi:0,unicodeRange:0,unitsPerEm:0,vAlphabetic:0,vHanging:0,vIdeographic:0,vMathematical:0,values:0,vectorEffect:0,version:0,vertAdvY:0,vertOriginX:0,vertOriginY:0,viewBox:0,viewTarget:0,visibility:0,widths:0,wordSpacing:0,writingMode:0,x:0,xHeight:0,x1:0,x2:0,xChannelSelector:0,xlinkActuate:0,xlinkArcrole:0,xlinkHref:0,xlinkRole:0,xlinkShow:0,xlinkTitle:0,xlinkType:0,xmlBase:0,xmlns:0,xmlnsXlink:0,xmlLang:0,xmlSpace:0,y:0,y1:0,y2:0,yChannelSelector:0,z:0,zoomAndPan:0},DOMAttributeNames:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space"}}},function(e,t){e.exports={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=r(n(88)),i=n(90);t.default=function(e,t){var n={};return e&&"string"==typeof e?(o.default(e,(function(e,r){e&&r&&(n[i.camelCase(e,t)]=r)})),n):n}},function(e,t,n){var r=n(89);e.exports=function(e,t){var n,o=null;if(!e||"string"!=typeof e)return o;for(var i,c,a=r(e),s="function"==typeof t,l=0,u=a.length;l/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t,n=e.match(a);return n&&n[1]&&(t=n[1],c&&(e=e.replace(n[0],""))),i(r(e),null,t)}},function(e,t,n){var r=n(58),o=/<([a-zA-Z]+[0-9]?)/,i=//i,c=//i,a=/<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\/?>/gi,s=r.isIE(9),l=s||r.isIE(),u=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},d=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")};if("function"==typeof window.DOMParser){var p=new window.DOMParser,m=s?"text/xml":"text/html";u=d=function(e,t){return t&&(e="<"+t+">"+e+""),s&&(e=e.replace(a,"<$1$2$3/>")),p.parseFromString(e,m)}}if(document.implementation){var f=document.implementation.createHTMLDocument(l?"html-dom-parser":void 0);u=function(e,t){if(t)return f.documentElement.getElementsByTagName(t)[0].innerHTML=e,f;try{return f.documentElement.innerHTML=e,f}catch(t){if(d)return d(e)}}}var b,h=document.createElement("template");h.content&&(b=function(e){return h.innerHTML=e,h.content.childNodes}),e.exports=function(e){var t,n,r,a,s=e.match(o);switch(s&&s[1]&&(t=s[1].toLowerCase()),t){case"html":return n=d(e),i.test(e)||(r=n.getElementsByTagName("head")[0])&&r.parentNode.removeChild(r),c.test(e)||(r=n.getElementsByTagName("body")[0])&&r.parentNode.removeChild(r),n.getElementsByTagName("html");case"head":case"body":return a=u(e).getElementsByTagName(t),c.test(e)&&i.test(e)?a[0].parentNode.childNodes:a;default:return b?b(e):u(e,"body").getElementsByTagName("body")[0].childNodes}}},function(e,t){e.exports={CASE_SENSITIVE_TAG_NAMES:["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return c}));var r=n(1),o=n(17);const i=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},c=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(o.decodeEntities)(e.message):Object(r.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},,,,,,,,function(e,t){e.exports=window.wp.blocks},,,,,,,,,,,function(e,t){e.exports=window.wp.blockEditor},function(e,t){e.exports=window.wp.wordcount},function(e,t){e.exports=window.wp.autop},function(e,t,n){"use strict";var r=n(0);t.a=function(e){let{icon:t,size:n=24,...o}=e;return Object(r.cloneElement)(t,{width:n,height:n,...o})}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return c}));var r=n(49),o=(n(14),n(2));const i=(e,t)=>Object.keys(o.defaultAddressFields).every(n=>e[n]===t[n]),c=e=>{const t=Object.keys(o.defaultAddressFields),n=Object(r.a)(t,{},e.country),i=Object.assign({},e);return n.forEach(t=>{let{key:n="",hidden:r=!1}=t;r&&((e,t)=>e in t)(n,e)&&(i[n]="")}),i}},function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(12),o=n.n(r),i=n(0),c=n(4),a=n.n(c),s=n(76),l=n(7),u=(n(81),n(60));const d=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""},p=e=>{let{className:t,context:n="default",additionalNotices:r=[]}=e;const{isSuppressed:c}=Object(u.b)(),{notices:p}=Object(l.useSelect)(e=>({notices:e("core/notices").getNotices(n)})),{removeNotice:m}=Object(l.useDispatch)("core/notices"),f=p.filter(e=>"snackbar"!==e.type).concat(r);if(!f.length)return null;const b=a()(t,"wc-block-components-notices");return c?null:Object(i.createElement)("div",{className:b},f.map(e=>Object(i.createElement)(s.a,o()({key:"store-notice-"+e.id},e,{className:a()("wc-block-components-notices__notice",d(e)),onRemove:()=>{e.isDismissible&&m(e.id,n)}}),e.content)))}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(0),o=n(52),i=n(2),c=n(62),a=n.n(c),s=n(10),l=n(15);const u=(e,t)=>e&&t[e]?t[e]:null,d=e=>{let{block:t,blockMap:n,blockWrapper:o,children:c,depth:p=1}=e;return c&&0!==c.length?Array.from(c).map((e,c)=>{const{blockName:m="",...f}={key:`${t}_${p}_${c}`,...e instanceof HTMLElement?e.dataset:{},className:e instanceof Element?null==e?void 0:e.className:""},b=u(m,n);if(!b){const i=a()(e instanceof Element&&(null==e?void 0:e.outerHTML)||(null==e?void 0:e.textContent)||"");if("string"==typeof i&&i)return i;if(!Object(r.isValidElement)(i))return null;const c=e.childNodes.length?d({block:t,blockMap:n,children:e.childNodes,depth:p+1,blockWrapper:o}):void 0;return c?Object(r.cloneElement)(i,f,c):Object(r.cloneElement)(i,f)}const h=o||r.Fragment;return Object(r.createElement)(r.Suspense,{key:`${t}_${p}_${c}_suspense`,fallback:Object(r.createElement)("div",{className:"wc-block-placeholder"})},Object(r.createElement)(l.a,{text:"Unexpected error in: "+m,showErrorBlock:i.CURRENT_USER_IS_ADMIN},Object(r.createElement)(h,null,Object(r.createElement)(b,f,d({block:t,blockMap:n,children:e.childNodes,depth:p+1,blockWrapper:o}),((e,t,n,o)=>{if(!Object(s.hasInnerBlocks)(e))return null;const c=n?Array.from(n).map(e=>e instanceof HTMLElement&&(null==e?void 0:e.dataset.blockName)||null).filter(Boolean):[],a=Object(s.getRegisteredBlocks)(e).filter(e=>{let{blockName:t,force:n}=e;return!0===n&&!c.includes(t)}),d=o||r.Fragment;return Object(r.createElement)(r.Fragment,null,a.map((e,n)=>{let{blockName:o,component:c}=e;const a=c||u(o,t);return a?Object(r.createElement)(l.a,{key:o+"_blockerror",text:"Unexpected error in: "+o,showErrorBlock:i.CURRENT_USER_IS_ADMIN},Object(r.createElement)(d,null,Object(r.createElement)(a,{key:`${o}_forced_${n}`}))):null}))})(m,n,e.childNodes,o)))))}):null},p=e=>{let{Block:t,selector:n,blockName:r,getProps:i=(()=>({})),blockMap:c,blockWrapper:a}=e;Object(o.a)({Block:t,selector:n,getProps:(e,t)=>{const n=d({block:r,blockMap:c,children:e.children||[],blockWrapper:a});return{...i(e,t),children:n}}})}},,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(16),o=n(0),i=n(48);n.p=i.k,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)(()=>Promise.all([n.e(0),n.e(62)]).then(n.bind(null,402)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)(()=>n.e(61).then(n.bind(null,446)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)(()=>n.e(69).then(n.bind(null,447)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)(()=>n.e(63).then(n.bind(null,403)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)(()=>n.e(59).then(n.bind(null,404)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)(()=>n.e(67).then(n.bind(null,405)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)(()=>n.e(64).then(n.bind(null,323)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)(()=>n.e(65).then(n.bind(null,406)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)(()=>n.e(60).then(n.bind(null,407)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)(()=>n.e(68).then(n.bind(null,408)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)(()=>n.e(66).then(n.bind(null,409)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)(()=>Promise.all([n.e(1),n.e(74),n.e(58)]).then(n.bind(null,429)))});const c=e=>Object(r.getRegisteredBlockComponents)(e)},,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=(e,t)=>{const n=[];return Object.keys(e).forEach(r=>{if(void 0!==t[r])switch(e[r].type){case"boolean":n[r]="false"!==t[r]&&!1!==t[r];break;case"number":n[r]=parseInt(t[r],10);break;case"array":case"object":n[r]=JSON.parse(t[r]);break;default:n[r]=t[r]}else n[r]=e[r].default}),n}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){e.exports=n(245)},,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(146),o=n(127),i=n(133),c=n(52),a=n(0),s=n(12),l=n.n(s),u=n(19),d=n.n(u),p=n(9),m=(n(14),n(27)),f=n.n(m);n(3),n(2),n(48);var b=n(95),h=Object(p.createHigherOrderComponent)(e=>class extends a.Component{constructor(){super(...arguments),d()(this,"state",{error:null,loading:!1,product:"preview"===this.props.attributes.productId?this.props.attributes.previewProduct:null}),d()(this,"loadProduct",()=>{const{productId:e}=this.props.attributes;"preview"!==e&&(e?(this.setState({loading:!0}),(e=>f()({path:"/wc/store/v1/products/"+e}))(e).then(e=>{this.setState({product:e,loading:!1,error:null})}).catch(async e=>{const t=await Object(b.a)(e);this.setState({product:null,loading:!1,error:t})})):this.setState({product:null,loading:!1,error:null}))})}componentDidMount(){this.loadProduct()}componentDidUpdate(e){e.attributes.productId!==this.props.attributes.productId&&this.loadProduct()}render(){const{error:t,loading:n,product:r}=this.state;return Object(a.createElement)(e,l()({},this.props,{error:t,getProduct:this.loadProduct,isLoading:n,product:r}))}},"withProduct"),g=n(47),v=n(60),w=n(123),O=n(59),y=n(1),E=n(117),k=n(13),j=Object(a.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(k.Path,{d:"M3 18h8V6H3v12zM14 7.5V9h7V7.5h-7zm0 5.3h7v-1.5h-7v1.5zm0 3.7h7V15h-7v1.5z"}));const _="woocommerce/single-product";Object(y.__)("Single Product","woo-gutenberg-products-block"),Object(a.createElement)(E.a,{icon:j,className:"wc-block-editor-components-block-icon"}),Object(y.__)("Display a single product.","woo-gutenberg-products-block"),Object.keys(Object(i.a)(_));var x=h(e=>{let{isLoading:t,product:n,children:r}=e;const{dispatchStoreEvent:o}=Object(O.a)(),i="wc-block-single-product wc-block-layout",c="woocommerce/single-product/"+((null==n?void 0:n.id)||0);return Object(a.useEffect)(()=>{o("product-render",{product:n,listName:_})},[n,o]),Object(a.createElement)(g.InnerBlockLayoutContextProvider,{parentName:_,parentClassName:i},Object(a.createElement)(g.ProductDataContextProvider,{product:n,isLoading:t},Object(a.createElement)(v.a,null,Object(a.createElement)(w.a,{context:c})),Object(a.createElement)("div",{className:i},r)))}),S={isPreview:{type:"boolean",default:!1,save:!1},productId:{type:"number"}};Object(o.a)({Block:x,blockName:_,selector:".wp-block-woocommerce-single-product",getProps:e=>({attributes:Object(r.a)(S,e.dataset)}),blockMap:Object(i.a)(_)}),(()=>{const e=Object(i.a)("");Object.keys(e).forEach(t=>{const n=".wp-block-"+t.replace("/","-");Object(c.a)({Block:e[t],selector:n,getProps:e=>e.dataset})})})()}]); \ No newline at end of file diff --git a/build/single-product.asset.php b/build/single-product.asset.php new file mode 100644 index 00000000000..fbd0fe71b80 --- /dev/null +++ b/build/single-product.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '92e5bb490c1ebabb5dd06d7dd7238d8d'); \ No newline at end of file diff --git a/build/single-product.js b/build/single-product.js new file mode 100644 index 00000000000..3c657aacff1 --- /dev/null +++ b/build/single-product.js @@ -0,0 +1,10 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["single-product"]=function(e){function t(t){for(var c,s,a=t[0],i=t[1],l=t[2],d=0,m=[];d{const t=(Object(l.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(c.createElement)(i.InspectorControls,null,Object(c.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(c.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(c.createElement)("a",{href:`${a.ADMIN_URL}post.php?post=${t}&action=edit`,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Edit this product's details","woo-gutenberg-products-block"),Object(c.createElement)(n.a,{icon:s.a,size:16}))),Object(c.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(o.__)("Edit details such as title, price, description and more.","woo-gutenberg-products-block")))):null}},11:function(e,t){e.exports=window.wp.primitives},114:function(e,t){},12:function(e,t){e.exports=window.React},127:function(e,t,r){"use strict";var c=r(24),o=r.n(c),n=r(0),s=r(12),a=r(1),i=r(23),l=e=>{let{imageUrl:t=i.m+"/block-error.svg",header:r=Object(a.__)("Oops!","woo-gutenberg-products-block"),text:c=Object(a.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:s=Object(a.__)("Error:","woo-gutenberg-products-block"),button:l,showErrorBlock:u=!0}=e;return u?Object(n.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(n.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(n.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(n.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),c&&Object(n.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},c),o&&Object(n.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",o),l&&Object(n.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};r(192);class u extends s.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(n.createElement)(n.Fragment,null,Object(n.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:c=!0,text:o,errorMessagePrefix:s,renderError:a,button:i}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof a?a({errorMessage:u}):Object(n.createElement)(l,{showErrorBlock:c,errorMessage:r?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:s,button:i}):this.props.children}}t.a=u},13:function(e,t){e.exports=window.wp.htmlEntities},134:function(e,t){},14:function(e,t){e.exports=window.wp.apiFetch},15:function(e,t){e.exports=window.wp.url},17:function(e,t){e.exports=window.wc.wcBlocksData},176:function(e,t,r){"use strict";var c=r(6),o=r.n(c),n=r(0),s=r(23),a=r(25),i=r(112),l=r(27);t.a=e=>t=>{let{selected:r,...c}=t;const[u,d]=Object(n.useState)(!0),[m,p]=Object(n.useState)(null),[b,g]=Object(n.useState)([]),h=s.o.productCount>100,w=async e=>{const t=await Object(l.a)(e);p(t),d(!1)},O=Object(n.useRef)(r);Object(n.useEffect)(()=>{Object(a.h)({selected:O.current}).then(e=>{g(e),d(!1)}).catch(w)},[O]);const j=Object(i.a)(e=>{Object(a.h)({selected:r,search:e}).then(e=>{g(e),d(!1)}).catch(w)},400),f=Object(n.useCallback)(e=>{d(!0),j(e)},[d,j]);return Object(n.createElement)(e,o()({},c,{selected:r,error:m,products:b,isLoading:u,onSearch:h?f:null}))}},19:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"c",(function(){return i})),r.d(t,"d",(function(){return l})),r.d(t,"b",(function(){return u}));var c=r(0),o=r(7),n=r(1);const s={clear:Object(n.__)("Clear all selected items","woo-gutenberg-products-block"),noItems:Object(n.__)("No items found.","woo-gutenberg-products-block"), +/* Translators: %s search term */ +noResults:Object(n.__)("No results for %s","woo-gutenberg-products-block"),search:Object(n.__)("Search for items","woo-gutenberg-products-block"),selected:e=>Object(n.sprintf)( +/* translators: Number of items selected from list. */ +Object(n._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(n.__)("Search results updated.","woo-gutenberg-products-block")},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const r=Object(o.groupBy)(e,"parent"),c=Object(o.keyBy)(t,"id"),n=["0"],s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=s(c[e.parent]);return[...t,e.name]},a=e=>e.map(e=>{const t=r[e.id];return n.push(""+e.id),{...e,breadcrumbs:s(c[e.parent]),children:t&&t.length?a(t):[]}}),i=a(r[0]||[]);return Object.entries(r).forEach(e=>{let[t,r]=e;n.includes(t)||i.push(...a(r||[]))}),i},i=(e,t,r)=>{if(!t)return r?a(e):e;const c=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),o=e.map(e=>!!c.test(e.name)&&e).filter(Boolean);return r?a(o,e):o},l=(e,t)=>{if(!t)return e;const r=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(r).map((e,t)=>r.test(e)?Object(c.createElement)("strong",{key:t},e):Object(c.createElement)(c.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},192:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},22:function(e,t){e.exports=window.wp.isShallowEqual},23:function(e,t,r){"use strict";r.d(t,"o",(function(){return n})),r.d(t,"m",(function(){return s})),r.d(t,"l",(function(){return a})),r.d(t,"n",(function(){return i})),r.d(t,"j",(function(){return l})),r.d(t,"e",(function(){return u})),r.d(t,"f",(function(){return d})),r.d(t,"g",(function(){return m})),r.d(t,"k",(function(){return p})),r.d(t,"c",(function(){return b})),r.d(t,"d",(function(){return g})),r.d(t,"h",(function(){return h})),r.d(t,"a",(function(){return w})),r.d(t,"i",(function(){return O})),r.d(t,"b",(function(){return j}));var c,o=r(2);const n=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),s=n.pluginUrl+"images/",a=n.pluginUrl+"build/",i=n.buildPhase,l=null===(c=o.STORE_PAGES.shop)||void 0===c?void 0:c.permalink,u=o.STORE_PAGES.checkout.id,d=o.STORE_PAGES.checkout.permalink,m=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),b=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),g=o.STORE_PAGES.cart.permalink,h=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),w=Object(o.getSetting)("allowedCountries",{}),O=Object(o.getSetting)("shippingStates",{}),j=Object(o.getSetting)("allowedStates",{})},25:function(e,t,r){"use strict";r.d(t,"h",(function(){return l})),r.d(t,"e",(function(){return u})),r.d(t,"b",(function(){return d})),r.d(t,"i",(function(){return m})),r.d(t,"f",(function(){return p})),r.d(t,"c",(function(){return b})),r.d(t,"d",(function(){return g})),r.d(t,"g",(function(){return h})),r.d(t,"a",(function(){return w}));var c=r(15),o=r(14),n=r.n(o),s=r(7),a=r(2),i=r(23);const l=e=>{let{selected:t=[],search:r="",queryArgs:o={}}=e;const a=(e=>{let{selected:t=[],search:r="",queryArgs:o={}}=e;const n=i.o.productCount>100,s={per_page:n?100:0,catalog_visibility:"any",search:r,orderby:"title",order:"asc"},a=[Object(c.addQueryArgs)("/wc/store/v1/products",{...s,...o})];return n&&t.length&&a.push(Object(c.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),a})({selected:t,search:r,queryArgs:o});return Promise.all(a.map(e=>n()({path:e}))).then(e=>Object(s.uniqBy)(Object(s.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>n()({path:"/wc/store/v1/products/"+e}),d=()=>n()({path:"wc/store/v1/products/attributes"}),m=e=>n()({path:`wc/store/v1/products/attributes/${e}/terms`}),p=e=>{let{selected:t=[],search:r}=e;const o=(e=>{let{selected:t=[],search:r}=e;const o=Object(a.getSetting)("limitTags",!1),n=[Object(c.addQueryArgs)("wc/store/v1/products/tags",{per_page:o?100:0,orderby:o?"count":"name",order:o?"desc":"asc",search:r})];return o&&t.length&&n.push(Object(c.addQueryArgs)("wc/store/v1/products/tags",{include:t})),n})({selected:t,search:r});return Promise.all(o.map(e=>n()({path:e}))).then(e=>Object(s.uniqBy)(Object(s.flatten)(e),"id"))},b=e=>n()({path:Object(c.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),g=e=>n()({path:"wc/store/v1/products/categories/"+e}),h=e=>n()({path:Object(c.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),w=(e,t)=>{if(!e.title.raw)return e.slug;const r=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(r?"":" - "+e.slug)}},26:function(e,t){e.exports=window.wc.priceFormat},27:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return s}));var c=r(1),o=r(13);const n=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},s=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(o.decodeEntities)(e.message):Object(c.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},29:function(e,t){e.exports=window.wc.wcBlocksSharedContext},299:function(e,t,r){"use strict";var c=r(6),o=r.n(c),n=r(24),s=r.n(n),a=r(0),i=r(10),l=r(25),u=r(27);const d=Object(i.createHigherOrderComponent)(e=>class extends a.Component{constructor(){super(...arguments),s()(this,"state",{error:null,loading:!1,product:"preview"===this.props.attributes.productId?this.props.attributes.previewProduct:null}),s()(this,"loadProduct",()=>{const{productId:e}=this.props.attributes;"preview"!==e&&(e?(this.setState({loading:!0}),Object(l.e)(e).then(e=>{this.setState({product:e,loading:!1,error:null})}).catch(async e=>{const t=await Object(u.a)(e);this.setState({product:null,loading:!1,error:t})})):this.setState({product:null,loading:!1,error:null}))})}componentDidMount(){this.loadProduct()}componentDidUpdate(e){e.attributes.productId!==this.props.attributes.productId&&this.loadProduct()}render(){const{error:t,loading:r,product:c}=this.state;return Object(a.createElement)(e,o()({},this.props,{error:t,getProduct:this.loadProduct,isLoading:r,product:c}))}},"withProduct");t.a=d},3:function(e,t){e.exports=window.wp.components},32:function(e,t,r){"use strict";var c=r(0),o=r(1),n=r(33);t.a=e=>{let{error:t}=e;return Object(c.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:r}=e;return t?"general"===r?Object(c.createElement)("span",null,Object(o.__)("The following error was returned","woo-gutenberg-products-block"),Object(c.createElement)("br",null),Object(c.createElement)("code",null,Object(n.escapeHTML)(t))):"api"===r?Object(c.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(c.createElement)("br",null),Object(c.createElement)("code",null,Object(n.escapeHTML)(t))):t:Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},33:function(e,t){e.exports=window.wp.escapeHtml},36:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var c=r(6),o=r.n(c),n=r(0),s=r(19);const a=e=>{let{countLabel:t,className:r,depth:c=0,controlId:a="",item:i,isSelected:l,isSingle:u,onSelect:d,search:m="",...p}=e;const b=null!=t&&void 0!==i.count&&null!==i.count,g=[r,"woocommerce-search-list__item"];g.push("depth-"+c),u&&g.push("is-radio-button"),b&&g.push("has-count");const h=i.breadcrumbs&&i.breadcrumbs.length,w=p.name||"search-list-item-"+a,O=`${w}-${i.id}`;return Object(n.createElement)("label",{htmlFor:O,className:g.join(" ")},u?Object(n.createElement)("input",o()({type:"radio",id:O,name:w,value:i.value,onChange:d(i),checked:l,className:"woocommerce-search-list__item-input"},p)):Object(n.createElement)("input",o()({type:"checkbox",id:O,name:w,value:i.value,onChange:d(i),checked:l,className:"woocommerce-search-list__item-input"},p)),Object(n.createElement)("span",{className:"woocommerce-search-list__item-label"},h?Object(n.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(s.b)(i.breadcrumbs)):null,Object(n.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(s.d)(i.name,m))),!!b&&Object(n.createElement)("span",{className:"woocommerce-search-list__item-count"},t||i.count))};t.b=a},42:function(e,t){e.exports=window.wc.wcBlocksRegistry},448:function(e,t,r){e.exports=r(457)},449:function(e,t){},457:function(e,t,r){"use strict";r.r(t);var c=r(1),o=r(95),n=r(0),s=r(3),a=r(299),i=r(127),l=r(103);const u=Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 230 100"},Object(n.createElement)("path",{fill:"#E1E3E6",d:"M76 0h11v6H76zm0 11h88v11H76zm0 16h28v6H76zm0 17h154v28H76zm0 39h22v17H76zm28 0h44v17h-44zM0 0h66v66H0z",style:{width:"100%"}}));var d=r(5),m=(r(449),r(73)),p=e=>{let{error:t,isLoading:r,getProduct:c}=e;return Object(n.createElement)(m.a,{className:"wc-block-single-product-error",error:t,isLoading:r,onRetry:c})},b=r(93),g=e=>{let{attributes:t,setAttributes:r}=e;return Object(n.createElement)(b.a,{selected:t.productId||0,showVariations:!0,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e[0]?e[0].id:0;r({productId:t})}})},h=e=>{let{isEditing:t,setIsEditing:r}=e;return Object(n.createElement)(d.BlockControls,null,Object(n.createElement)(s.ToolbarGroup,{controls:[{icon:"edit",title:Object(c.__)("Edit selected product","woo-gutenberg-products-block"),onClick:()=>r(!t),isActive:t}]}))},w=r(9),O=r(29),j=r(8);const f=e=>e.map(e=>{let[t,r={},c=[]]=e;const o=c?f(c):[];return Object(j.createBlock)(t,r,o)});var E=r(113),_=r(532),v=r(531),k=r(482);const y="woocommerce/single-product",S=Object(c.__)("Single Product","woo-gutenberg-products-block"),P=Object(n.createElement)(E.a,{icon:v.a,className:"wc-block-editor-components-block-icon"}),x=Object(c.__)("Display a single product.","woo-gutenberg-products-block"),N=[["core/columns",{},[["core/column",{},[["woocommerce/product-image",{showSaleBadge:!1}]]],["core/column",{},[["woocommerce/product-sale-badge"],["woocommerce/product-title",{headingLevel:2}],["woocommerce/product-rating"],["woocommerce/product-price"],["woocommerce/product-summary"],["woocommerce/product-stock-indicator"],["woocommerce/product-add-to-cart",{showFormElements:!0}],["woocommerce/product-sku"],["woocommerce/product-category-list"],["woocommerce/product-tag-list"]]]]]],C=["core/columns","core/column",...Object.keys(Object(k.a)(y))];var I=e=>{let{isLoading:t,product:r,clientId:o}=e;const{replaceInnerBlocks:a}=Object(w.useDispatch)("core/block-editor"),i=Object(n.useCallback)(()=>{a(o,f(N),!1)},[o,a]);return Object(n.createElement)(O.InnerBlockLayoutContextProvider,{parentName:y,parentClassName:"wc-block-single-product wc-block-layout"},Object(n.createElement)(O.ProductDataContextProvider,{product:r,isLoading:t},Object(n.createElement)(d.InspectorControls,null,Object(n.createElement)(s.PanelBody,{title:Object(c.__)("Layout","woo-gutenberg-products-block"),initialOpen:!0},Object(n.createElement)(s.Button,{label:Object(c.__)("Reset layout to default","woo-gutenberg-products-block"),onClick:i,isTertiary:!0,className:"wc-block-single-product__reset-layout"},Object(n.createElement)(E.a,{icon:_.a})," ",Object(c.__)("Reset layout","woo-gutenberg-products-block")))),Object(n.createElement)("div",{className:"wc-block-single-product wc-block-layout"},Object(n.createElement)(d.InnerBlocks,{template:N,allowedBlocks:C,templateLock:!1,renderAppender:!1}))))},B=Object(a.a)(e=>{let{className:t,attributes:r,setAttributes:o,error:a,getProduct:m,product:b,isLoading:w,clientId:O}=e;const{productId:j,isPreview:f}=r,[E,_]=Object(n.useState)(!j);return f?u:a?Object(n.createElement)(p,{error:a,isLoading:w,getProduct:m}):Object(n.createElement)("div",{className:t},Object(n.createElement)(i.a,{header:Object(c.__)("Single Product Block Error","woo-gutenberg-products-block")},Object(n.createElement)(h,{setIsEditing:_,isEditing:E}),E?Object(n.createElement)(s.Placeholder,{icon:P,label:S,className:"wc-block-single-product"},x,Object(n.createElement)("div",{className:"wc-block-single-product__selection"},Object(n.createElement)(g,{attributes:r,setAttributes:o}),Object(n.createElement)(s.Button,{isSecondary:!0,onClick:()=>{_(!1)}},Object(c.__)("Done","woo-gutenberg-products-block")))):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(d.InspectorControls,null,Object(n.createElement)(s.PanelBody,{title:Object(c.__)("Product","woo-gutenberg-products-block"),initialOpen:!1},Object(n.createElement)(g,{attributes:r,setAttributes:o}))),Object(n.createElement)(l.a,{productId:j}),Object(n.createElement)(I,{clientId:O,product:b,isLoading:w}))))}),L=r(4),A=r.n(L);const R={title:S,icon:{src:P},category:"woocommerce",keywords:[Object(c.__)("WooCommerce","woo-gutenberg-products-block")],description:x,supports:{align:["wide","full"],html:!1},example:{attributes:{isPreview:!0}},attributes:{isPreview:{type:"boolean",default:!1,save:!1},productId:{type:"number"}},edit:B,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",{className:A()("is-loading",t.className)},Object(n.createElement)(d.InnerBlocks.Content,null))}};Object(o.c)(y,R)},48:function(e,t){e.exports=window.wp.hooks},482:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var c=r(42),o=r(0),n=r(23);r.p=n.l,Object(c.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)(()=>Promise.all([r.e(0),r.e(1),r.e(2),r.e(27)]).then(r.bind(null,301)))}),Object(c.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)(()=>Promise.all([r.e(1),r.e(2),r.e(3),r.e(4),r.e(24)]).then(r.bind(null,537)))}),Object(c.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)(()=>Promise.all([r.e(1),r.e(2),r.e(3),r.e(4),r.e(36)]).then(r.bind(null,538)))}),Object(c.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)(()=>Promise.all([r.e(1),r.e(2),r.e(3),r.e(28)]).then(r.bind(null,302)))}),Object(c.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)(()=>Promise.all([r.e(1),r.e(2),r.e(3),r.e(4),r.e(20)]).then(r.bind(null,303)))}),Object(c.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)(()=>Promise.all([r.e(1),r.e(2),r.e(33)]).then(r.bind(null,304)))}),Object(c.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)(()=>Promise.all([r.e(1),r.e(2),r.e(3),r.e(29)]).then(r.bind(null,216)))}),Object(c.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)(()=>r.e(31).then(r.bind(null,305)))}),Object(c.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)(()=>Promise.all([r.e(1),r.e(2),r.e(23)]).then(r.bind(null,306)))}),Object(c.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)(()=>Promise.all([r.e(1),r.e(2),r.e(35)]).then(r.bind(null,307)))}),Object(c.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)(()=>Promise.all([r.e(1),r.e(2),r.e(32)]).then(r.bind(null,308)))}),Object(c.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)(()=>Promise.all([r.e(0),r.e(1),r.e(4),r.e(18)]).then(r.bind(null,539)))});const s=e=>Object(c.getRegisteredBlockComponents)(e)},5:function(e,t){e.exports=window.wp.blockEditor},51:function(e,t){e.exports=window.wp.deprecated},58:function(e,t){e.exports=window.wc.wcBlocksSharedHocs},60:function(e,t){e.exports=window.wp.autop},7:function(e,t){e.exports=window.lodash},71:function(e,t){e.exports=window.wp.dom},73:function(e,t,r){"use strict";var c=r(0),o=r(1),n=r(113),s=r(172),a=r(4),i=r.n(a),l=r(3),u=r(32);r(114),t.a=e=>{let{className:t,error:r,isLoading:a=!1,onRetry:d}=e;return Object(c.createElement)(l.Placeholder,{icon:Object(c.createElement)(n.a,{icon:s.a}),label:Object(o.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:i()("wc-block-api-error",t)},Object(c.createElement)(u.a,{error:r}),d&&Object(c.createElement)(c.Fragment,null,a?Object(c.createElement)(l.Spinner,null):Object(c.createElement)(l.Button,{isSecondary:!0,onClick:d},Object(o.__)("Retry","woo-gutenberg-products-block"))))}},8:function(e,t){e.exports=window.wp.blocks},82:function(e,t,r){"use strict";var c=r(6),o=r.n(c),n=r(0),s=r(36),a=r(3),i=r(4),l=r.n(i);t.a=e=>{let{className:t,item:r,isSelected:c,isLoading:i,onSelect:u,disabled:d,...m}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(s.a,o()({},m,{key:r.id,className:t,isSelected:c,item:r,onSelect:u,isSingle:!0,disabled:d})),c&&i&&Object(n.createElement)("div",{key:"loading",className:l()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(n.createElement)(a.Spinner,null)))}},87:function(e,t){e.exports=window.wp.wordcount},9:function(e,t){e.exports=window.wp.data},93:function(e,t,r){"use strict";var c=r(6),o=r.n(c),n=r(0),s=r(1),a=r(7),i=r(36),l=r(97),u=r(10),d=Object(u.createHigherOrderComponent)(e=>{class t extends n.Component{render(){const{selected:t}=this.props,r=null==t;return Array.isArray(t)?Object(n.createElement)(e,this.props):Object(n.createElement)(e,o()({},this.props,{selected:r?[]:[t]}))}}return t.defaultProps={selected:null},t},"withTransformSingleSelectToMultipleSelect"),m=r(176),p=r(24),b=r.n(p),g=r(22),h=r.n(g),w=r(25),O=r(27),j=Object(u.createHigherOrderComponent)(e=>{class t extends n.Component{constructor(){super(...arguments),b()(this,"state",{error:null,loading:!1,variations:{}}),b()(this,"loadVariations",()=>{const{products:e}=this.props,{loading:t,variations:r}=this.state;if(t)return;const c=this.getExpandedProduct();if(!c||r[c])return;const o=e.find(e=>e.id===c);o.variations&&0!==o.variations.length?(this.setState({loading:!0}),Object(w.g)(c).then(e=>{const t=e.map(e=>({...e,parent:c}));this.setState({variations:{...this.state.variations,[c]:t},loading:!1,error:null})}).catch(async e=>{const t=await Object(O.a)(e);this.setState({variations:{...this.state.variations,[c]:null},loading:!1,error:t})})):this.setState({variations:{...this.state.variations,[c]:null},loading:!1,error:null})})}componentDidMount(){const{selected:e,showVariations:t}=this.props;e&&t&&this.loadVariations()}componentDidUpdate(e){const{isLoading:t,selected:r,showVariations:c}=this.props;c&&(!h()(e.selected,r)||e.isLoading&&!t)&&this.loadVariations()}isProductId(e){const{products:t}=this.props;return t.some(t=>t.id===e)}findParentProduct(e){var t;const{products:r}=this.props;return null===(t=r.filter(t=>t.variations&&t.variations.find(t=>{let{id:r}=t;return r===e}))[0])||void 0===t?void 0:t.id}getExpandedProduct(){const{isLoading:e,selected:t,showVariations:r}=this.props;if(!r)return null;let c=t&&t.length?t[0]:null;return c?this.prevSelectedItem=c:this.prevSelectedItem&&(e||this.isProductId(this.prevSelectedItem)||(c=this.prevSelectedItem)),!e&&c?this.isProductId(c)?c:this.findParentProduct(c):null}render(){const{error:t,isLoading:r}=this.props,{error:c,loading:s,variations:a}=this.state;return Object(n.createElement)(e,o()({},this.props,{error:c||t,expandedProduct:this.getExpandedProduct(),isLoading:r,variations:a,variationsLoading:s}))}}return b()(t,"defaultProps",{selected:[],showVariations:!1}),t},"withProductVariations"),f=r(32),E=r(4),_=r.n(E),v=r(82);r(134);const k={list:Object(s.__)("Products","woo-gutenberg-products-block"),noItems:Object(s.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(s.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(s.__)("Product search results updated.","woo-gutenberg-products-block")},y=e=>{let{expandedProduct:t,error:r,instanceId:c,isCompact:u,isLoading:d,onChange:m,onSearch:p,products:b,renderItem:g,selected:h,showVariations:w,variations:O,variationsLoading:j}=e;if(r)return Object(n.createElement)(f.a,{error:r});const E=[...b,...O&&O[t]?O[t]:[]];return Object(n.createElement)(l.a,{className:"woocommerce-products",list:E,isCompact:u,isLoading:d,isSingle:!0,selected:E.filter(e=>{let{id:t}=e;return h.includes(t)}),onChange:m,renderItem:g||(w?e=>{const{item:t,search:r,depth:l=0,isSelected:u,onSelect:m}=e,p=t.variations&&Array.isArray(t.variations)?t.variations.length:0,b=_()("woocommerce-search-product__item","woocommerce-search-list__item","depth-"+l,"has-count",{"is-searching":r.length>0,"is-skip-level":0===l&&0!==t.parent,"is-variable":p>0});if(!t.breadcrumbs.length)return Object(n.createElement)(v.a,o()({},e,{className:_()(b,{"is-selected":u}),isSelected:u,item:t,onSelect:()=>()=>{m(t)()},isLoading:d||j,countLabel:t.variations.length>0?Object(s.sprintf)( +/* translators: %1$d is the number of variations of a product product. */ +Object(s.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-"+c,"aria-label":Object(s.sprintf)( +/* translators: %1$s is the product name, %2$d is the number of variations of that product. */ +Object(s._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,"woo-gutenberg-products-block"),t.name,t.variations.length)}));const g=Object(a.isEmpty)(t.variation)?e:{...e,item:{...e.item,name:t.variation},"aria-label":`${t.breadcrumbs[0]}: ${t.variation}`};return Object(n.createElement)(i.a,o()({},g,{className:b,name:"variations-"+c}))}:null),onSearch:p,messages:k,isHierarchical:!0})};y.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=d(Object(m.a)(j(Object(u.withInstanceId)(y))))},95:function(e,t,r){"use strict";r.d(t,"c",(function(){return n})),r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return a}));var c=r(8),o=r(23);const n=(e,t)=>{if(o.n>2)return Object(c.registerBlockType)(e,t)},s=()=>o.n>2,a=()=>o.n>1},97:function(e,t,r){"use strict";r.d(t,"a",(function(){return v}));var c=r(6),o=r.n(c),n=r(0),s=r(1),a=r(3),i=r(113),l=r(498),u=r(4),d=r.n(u),m=r(10),p=r(19),b=r(36),g=r(497),h=r(13);const w=e=>{let{id:t,label:r,popoverContents:c,remove:o,screenReaderLabel:l,className:u=""}=e;const[p,b]=Object(n.useState)(!1),O=Object(m.useInstanceId)(w);if(l=l||r,!r)return null;r=Object(h.decodeEntities)(r);const j=d()("woocommerce-tag",u,{"has-remove":!!o}),f="woocommerce-tag__label-"+O,E=Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"screen-reader-text"},l),Object(n.createElement)("span",{"aria-hidden":"true"},r));return Object(n.createElement)("span",{className:j},c?Object(n.createElement)(a.Button,{className:"woocommerce-tag__text",id:f,onClick:()=>b(!0)},E):Object(n.createElement)("span",{className:"woocommerce-tag__text",id:f},E),c&&p&&Object(n.createElement)(a.Popover,{onClose:()=>b(!1)},c),o&&Object(n.createElement)(a.Button,{className:"woocommerce-tag__remove",onClick:o(t),label:Object(s.sprintf)(// Translators: %s label. +Object(s.__)("Remove %s","woo-gutenberg-products-block"),r),"aria-describedby":f},Object(n.createElement)(i.a,{icon:g.a,size:20,className:"clear-icon"})))};var O=w;const j=e=>Object(n.createElement)(b.b,e),f=e=>{const{list:t,selected:r,renderItem:c,depth:s=0,onSelect:a,instanceId:i,isSingle:l,search:u}=e;return t?Object(n.createElement)(n.Fragment,null,t.map(t=>{const d=-1!==r.findIndex(e=>{let{id:r}=e;return r===t.id});return Object(n.createElement)(n.Fragment,{key:t.id},Object(n.createElement)("li",null,c({item:t,isSelected:d,onSelect:a,isSingle:l,search:u,depth:s,controlId:i})),Object(n.createElement)(f,o()({},e,{list:t.children,depth:s+1})))})):null},E=e=>{let{isLoading:t,isSingle:r,selected:c,messages:o,onChange:i,onRemove:l}=e;if(t||r||!c)return null;const u=c.length;return Object(n.createElement)("div",{className:"woocommerce-search-list__selected"},Object(n.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(n.createElement)("strong",null,o.selected(u)),u>0?Object(n.createElement)(a.Button,{isLink:!0,isDestructive:!0,onClick:()=>i([]),"aria-label":o.clear},Object(s.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(n.createElement)("ul",null,c.map((e,t)=>Object(n.createElement)("li",{key:t},Object(n.createElement)(O,{label:e.name,id:e.id,remove:l})))):null)},_=e=>{let{filteredList:t,search:r,onSelect:c,instanceId:o,...a}=e;const{messages:u,renderItem:d,selected:m,isSingle:p}=a,b=d||j;return 0===t.length?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(n.createElement)(i.a,{icon:l.a})),Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-text"},r?Object(s.sprintf)(u.noResults,r):u.noItems)):Object(n.createElement)("ul",{className:"woocommerce-search-list__list"},Object(n.createElement)(f,{list:t,selected:m,renderItem:b,onSelect:c,instanceId:o,isSingle:p,search:r}))},v=e=>{const{className:t="",isCompact:r,isHierarchical:c,isLoading:s,isSingle:i,list:l,messages:u=p.a,onChange:b,onSearch:g,selected:h,debouncedSpeak:w}=e,[O,j]=Object(n.useState)(""),f=Object(m.useInstanceId)(v),k=Object(n.useMemo)(()=>({...p.a,...u}),[u]),y=Object(n.useMemo)(()=>Object(p.c)(l,O,c),[l,O,c]);Object(n.useEffect)(()=>{w&&w(k.updated)},[w,k]),Object(n.useEffect)(()=>{"function"==typeof g&&g(O)},[O,g]);const S=Object(n.useCallback)(e=>()=>{i&&b([]);const t=h.findIndex(t=>{let{id:r}=t;return r===e});b([...h.slice(0,t),...h.slice(t+1)])},[i,h,b]),P=Object(n.useCallback)(e=>()=>{-1===h.findIndex(t=>{let{id:r}=t;return r===e.id})?b(i?[e]:[...h,e]):S(e.id)()},[i,S,b,h]);return Object(n.createElement)("div",{className:d()("woocommerce-search-list",t,{"is-compact":r})},Object(n.createElement)(E,o()({},e,{onRemove:S,messages:k})),Object(n.createElement)("div",{className:"woocommerce-search-list__search"},Object(n.createElement)(a.TextControl,{label:k.search,type:"search",value:O,onChange:e=>j(e)})),s?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(n.createElement)(a.Spinner,null)):Object(n.createElement)(_,o()({},e,{search:O,filteredList:y,messages:k,onSelect:P,instanceId:f})))};Object(a.withSpokenMessages)(v)}}); \ No newline at end of file diff --git a/build/stock-filter-frontend.asset.php b/build/stock-filter-frontend.asset.php new file mode 100644 index 00000000000..0bdfc7c1efc --- /dev/null +++ b/build/stock-filter-frontend.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => 'f00c88858474e5a58e9559aaf77dc127'); \ No newline at end of file diff --git a/build/stock-filter-frontend.js b/build/stock-filter-frontend.js new file mode 100644 index 00000000000..e5ebc692bd3 --- /dev/null +++ b/build/stock-filter-frontend.js @@ -0,0 +1,13 @@ +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var c=t[n]={i:n,l:!1,exports:{}};return e[n].call(c.exports,c,c.exports,r),c.l=!0,c.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)r.d(n,c,function(t){return e[t]}.bind(null,c));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=225)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},100:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(5),c=r(51);function o(e,t){return e===t}function u(e){return"function"==typeof e?function(){return e}:e}function s(e,t,r){var s=r&&r.equalityFn||o,a=function(e){var t=Object(n.useState)(u(e)),r=t[0],c=t[1];return[r,Object(n.useCallback)((function(e){return c(u(e))}),[])]}(e),l=a[0],i=a[1],b=Object(c.a)(Object(n.useCallback)((function(e){return i(e)}),[i]),t,r),f=Object(n.useRef)(e);return s(f.current,e)||(b(e),f.current=e),[l,b]}},107:function(e,t){},11:function(e,t){e.exports=window.wp.isShallowEqual},110:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(4),u=r.n(o);r(126),t.a=e=>{let{className:t,onChange:r,options:o=[],checked:s=[],isLoading:a=!1,isDisabled:l=!1,limit:i=10}=e;const[b,f]=Object(n.useState)(!1),d=Object(n.useMemo)(()=>[...Array(5)].map((e,t)=>Object(n.createElement)("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})),[]),p=Object(n.useMemo)(()=>{const e=o.length-i;return!b&&Object(n.createElement)("li",{key:"show-more",className:"show-more"},Object(n.createElement)("button",{onClick:()=>{f(!0)},"aria-expanded":!1,"aria-label":Object(c.sprintf)( +/* translators: %s is referring the remaining count of options */ +Object(c._n)("Show %s more option","Show %s more options",e,"woo-gutenberg-products-block"),e)},Object(c.sprintf)( +/* translators: %s number of options to reveal. */ +Object(c._n)("Show %s more","Show %s more",e,"woo-gutenberg-products-block"),e)))},[o,i,b]),m=Object(n.useMemo)(()=>b&&Object(n.createElement)("li",{key:"show-less",className:"show-less"},Object(n.createElement)("button",{onClick:()=>{f(!1)},"aria-expanded":!0,"aria-label":Object(c.__)("Show less options","woo-gutenberg-products-block")},Object(c.__)("Show less","woo-gutenberg-products-block"))),[b]),O=Object(n.useMemo)(()=>{const e=o.length>i+5;return Object(n.createElement)(n.Fragment,null,o.map((t,c)=>Object(n.createElement)(n.Fragment,{key:t.value},Object(n.createElement)("li",e&&!b&&c>=i&&{hidden:!0},Object(n.createElement)("input",{type:"checkbox",id:t.value,value:t.value,onChange:e=>{r(e.target.value)},checked:s.includes(t.value),disabled:l}),Object(n.createElement)("label",{htmlFor:t.value},t.label)),e&&c===i-1&&p)),e&&m)},[o,r,s,b,i,m,p,l]),j=u()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":a},t);return Object(n.createElement)("ul",{className:j},a?d:O)}},12:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t{let{queryAttribute:t,queryPrices:r,queryStock:b,queryState:f}=e,d=Object(i.a)();d+="-collection-data";const[p]=Object(a.a)(d),[m,O]=Object(a.b)("calculate_attribute_counts",[],d),[j,g]=Object(a.b)("calculate_price_range",null,d),[w,h]=Object(a.b)("calculate_stock_status_counts",null,d),k=Object(u.a)(t||{}),_=Object(u.a)(r),E=Object(u.a)(b);Object(n.useEffect)(()=>{"object"==typeof k&&Object.keys(k).length&&(m.find(e=>Object(s.b)(k,"taxonomy")&&e.taxonomy===k.taxonomy)||O([...m,k]))},[k,m,O]),Object(n.useEffect)(()=>{j!==_&&void 0!==_&&g(_)},[_,g,j]),Object(n.useEffect)(()=>{w!==E&&void 0!==E&&h(E)},[E,h,w]);const[y,v]=Object(n.useState)(!1),[S]=Object(c.a)(y,200);y||v(!0);const x=Object(n.useMemo)(()=>(e=>{const t=e;return Array.isArray(e.calculate_attribute_counts)&&(t.calculate_attribute_counts=Object(o.sortBy)(e.calculate_attribute_counts.map(e=>{let{taxonomy:t,queryType:r}=e;return{taxonomy:t,query_type:r}}),["taxonomy","query_type"])),t})(p),[p]);return Object(l.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...f,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...x},shouldSelect:S})}},15:function(e,t,r){"use strict";var n=r(19),c=r.n(n),o=r(0),u=r(5),s=r(1),a=r(48),l=e=>{let{imageUrl:t=a.l+"/block-error.svg",header:r=Object(s.__)("Oops!","woo-gutenberg-products-block"),text:n=Object(s.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:c,errorMessagePrefix:u=Object(s.__)("Error:","woo-gutenberg-products-block"),button:l,showErrorBlock:i=!0}=e;return i?Object(o.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(o.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(o.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(o.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),n&&Object(o.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},n),c&&Object(o.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},u?u+" ":"",c),l&&Object(o.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};r(35);class i extends u.Component{constructor(){super(...arguments),c()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(o.createElement)(o.Fragment,null,Object(o.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:n=!0,text:c,errorMessagePrefix:u,renderError:s,button:a}=this.props,{errorMessage:i,hasError:b}=this.state;return b?"function"==typeof s?s({errorMessage:i}):Object(o.createElement)(l,{showErrorBlock:n,errorMessage:r?i:null,header:e,imageUrl:t,text:c,errorMessagePrefix:u,button:a}):this.props.children}}t.a=i},151:function(e){e.exports=JSON.parse('{"name":"woocommerce/stock-filter","version":"1.0.0","title":"Filter Products by Stock","description":"Allow customers to filter the grid by products stock status. Works in combination with the All Products block.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"multiple":false},"example":{"attributes":{"isPreview":true}},"attributes":{"className":{"type":"string","default":""},"headingLevel":{"type":"number","default":3},"showCounts":{"type":"boolean","default":true},"showFilterButton":{"type":"boolean","default":false},"isPreview":{"type":"boolean","default":false}},"textdomain":"woo-gutenberg-products-block","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},17:function(e,t){e.exports=window.wp.htmlEntities},18:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));const n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function c(e,t){return n(e)&&t in e}},19:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},2:function(e,t){e.exports=window.wc.wcSettings},22:function(e,t,r){"use strict";var n=r(0),c=r(4),o=r.n(c);t.a=e=>{let t,{label:r,screenReaderLabel:c,wrapperElement:u,wrapperProps:s={}}=e;const a=null!=r,l=null!=c;return!a&&l?(t=u||"span",s={...s,className:o()(s.className,"screen-reader-text")},Object(n.createElement)(t,s,c)):(t=u||n.Fragment,a&&l&&r!==c?Object(n.createElement)(t,s,Object(n.createElement)("span",{"aria-hidden":"true"},r),Object(n.createElement)("span",{className:"screen-reader-text"},c)):Object(n.createElement)(t,s,r))}},225:function(e,t,r){e.exports=r(248)},226:function(e,t){},23:function(e,t){e.exports=window.wp.a11y},248:function(e,t,r){"use strict";r.r(t);var n=r(52),c=r(0),o=r(1),u=r(23),s=r(31),a=r(61),l=r(39),i=r(145),b=r(2),f=r(110),d=r(75),p=r(54),m=r(11),O=r.n(m),j=r(17),g=r(77),w=r(18),h=r(14),k=r(124);const _=[{value:"preview-1",name:"In Stock",label:Object(c.createElement)(p.a,{name:"In Stock",count:3})},{value:"preview-2",name:"Out of sotck",label:Object(c.createElement)(p.a,{name:"Out of stock",count:3})},{value:"preview-3",name:"On backorder",label:Object(c.createElement)(p.a,{name:"On backorder",count:2})}];r(226);var E=r(45);const y=k.a+"stock_status";var v=r(151);const S={heading:{type:"string",default:Object(o.__)("Filter by stock status","woo-gutenberg-products-block")}};Object(n.a)({selector:".wp-block-woocommerce-stock-filter",Block:e=>{let{attributes:t,isEditor:r=!1}=e;const n=Object(b.getSettingWithCoercion)("is_rendering_php_template",!1,g.a),[m,v]=Object(c.useState)(!1),{outofstock:S,...x}=Object(b.getSetting)("stockStatusOptions",{}),P=Object(c.useRef)(Object(b.getSetting)("hideOutOfStockItems",!1)?x:{outofstock:S,...x}),A=Object(c.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"filter_stock_status";const r=Object(k.d)(t);if(!r)return[];const n=Object(E.a)(r)?r.split(","):r;return Object.keys(e).filter(e=>n.includes(e))}(P.current,y),[]),[R,C]=Object(c.useState)(A),[T,B]=Object(c.useState)(t.isPreview?_:[]),[N]=Object(c.useState)(Object.entries(P.current).map(e=>{let[t,r]=e;return{slug:t,name:r}}).filter(e=>!!e.name).sort((e,t)=>e.slug.localeCompare(t.slug))),[M]=Object(l.a)(),[F,L]=Object(l.b)("stock_status",A),{results:q,isLoading:G}=Object(i.a)({queryStock:!0,queryState:M}),Q=Object(c.useCallback)(e=>Object(w.b)(q,"stock_status_counts")&&Array.isArray(q.stock_status_counts)?q.stock_status_counts.find(t=>{let{status:r,count:n}=t;return r===e&&0!==Number(n)}):null,[q]);Object(c.useEffect)(()=>{if(G||t.isPreview)return;const e=N.map(e=>{const r=Q(e.slug);if(!(r||R.includes(e.slug)||(n=e.slug,null!=M&&M.stock_status&&M.stock_status.some(e=>{let{status:t=[]}=e;return t.includes(n)}))))return null;var n;const o=r?Number(r.count):0;return{value:e.slug,name:Object(j.decodeEntities)(e.name),label:Object(c.createElement)(p.a,{name:Object(j.decodeEntities)(e.name),count:t.showCounts?o:null})}}).filter(e=>!!e);B(e)},[t.showCounts,t.isPreview,G,Q,R,M.stock_status,N]);const U=Object(c.useCallback)(e=>{r||(e&&!n&&L(R),(e=>{if(!window)return;if(0===e.length){const e=Object(h.removeQueryArgs)(window.location.href,y);return void(e!==window.location.href&&Object(k.c)(e))}const t=Object(h.addQueryArgs)(window.location.href,{[y]:e.join(",")});t!==window.location.href&&Object(k.c)(t)})(R))},[r,L,R,n]);Object(c.useEffect)(()=>{t.showFilterButton||U(R)},[t.showFilterButton,R,U]);const D=Object(c.useMemo)(()=>F,[F]),Y=Object(s.a)(D),W=Object(a.a)(Y);Object(c.useEffect)(()=>{O()(W,Y)||O()(R,Y)||C(Y)},[R,Y,W]),Object(c.useEffect)(()=>{m||(L(A),v(!0))},[L,m,v,A]);const K=Object(c.useCallback)(e=>{const t=e=>{const t=T.find(t=>t.value===e);return t?t.name:null},r=e=>{let{filterAdded:r,filterRemoved:n}=e;const c=r?t(r):null,s=n?t(n):null;c?Object(u.speak)(Object(o.sprintf)( +/* translators: %s stock statuses (for example: 'instock'...) */ +Object(o.__)("%s filter added.","woo-gutenberg-products-block"),c)):s&&Object(u.speak)(Object(o.sprintf)( +/* translators: %s stock statuses (for example:'instock'...) */ +Object(o.__)("%s filter removed.","woo-gutenberg-products-block"),s))},n=R.includes(e),c=R.filter(t=>t!==e);n?r({filterRemoved:e}):(c.push(e),c.sort(),r({filterAdded:e})),C(c)},[R,T]);if(0===T.length)return null;const V="h"+t.headingLevel,I=!t.isPreview&&!P.current,J=!t.isPreview&&G;return Object(b.getSettingWithCoercion)("has_filterable_products",!1,g.a)?Object(c.createElement)(c.Fragment,null,!r&&t.heading&&Object(c.createElement)(V,{className:"wc-block-stock-filter__title"},t.heading),Object(c.createElement)("div",{className:"wc-block-stock-filter"},Object(c.createElement)(f.a,{className:"wc-block-stock-filter-list",options:T,checked:R,onChange:K,isLoading:I,isDisabled:J}),t.showFilterButton&&Object(c.createElement)(d.a,{className:"wc-block-stock-filter__button",disabled:I||J,onClick:()=>U(R)}))):null},getProps:e=>({attributes:{showCounts:"true"===e.dataset.showCounts,heading:e.dataset.heading||S.heading.default,headingLevel:e.dataset.headingLevel?parseInt(e.dataset.headingLevel,10):v.attributes.headingLevel.default,showFilterButton:"true"===e.dataset.showFilterButton},isEditor:!1})})},26:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const c=Object(n.createContext)("page"),o=()=>Object(n.useContext)(c);c.Provider},3:function(e,t){e.exports=window.lodash},31:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(0),c=r(11),o=r.n(c);function u(e){const t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},35:function(e,t){},39:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return f})),r.d(t,"c",(function(){return d}));var n=r(6),c=r(7),o=r(0),u=r(11),s=r.n(u),a=r(31),l=r(61),i=r(26);const b=e=>{const t=Object(i.a)();e=e||t;const r=Object(c.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:u}=Object(c.useDispatch)(n.QUERY_STATE_STORE_KEY);return[r,Object(o.useCallback)(t=>{u(e,t)},[e,u])]},f=(e,t,r)=>{const u=Object(i.a)();r=r||u;const s=Object(c.useSelect)(c=>c(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t),[r,e]),{setQueryValue:a}=Object(c.useDispatch)(n.QUERY_STATE_STORE_KEY);return[s,Object(o.useCallback)(t=>{a(r,e,t)},[r,e,a])]},d=(e,t)=>{const r=Object(i.a)();t=t||r;const[n,c]=b(t),u=Object(a.a)(n),f=Object(a.a)(e),d=Object(l.a)(f),p=Object(o.useRef)(!1);return Object(o.useEffect)(()=>{s()(d,f)||(c(Object.assign({},u,f)),p.current=!0)},[u,f,d,c]),p.current?[n,c]:[e,c]}},4:function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function c(){for(var e=[],t=0;t"string"==typeof e},48:function(e,t,r){"use strict";r.d(t,"n",(function(){return o})),r.d(t,"l",(function(){return u})),r.d(t,"k",(function(){return s})),r.d(t,"m",(function(){return a})),r.d(t,"i",(function(){return l})),r.d(t,"d",(function(){return i})),r.d(t,"f",(function(){return b})),r.d(t,"j",(function(){return f})),r.d(t,"c",(function(){return d})),r.d(t,"e",(function(){return p})),r.d(t,"g",(function(){return m})),r.d(t,"a",(function(){return O})),r.d(t,"h",(function(){return j})),r.d(t,"b",(function(){return g}));var n,c=r(2);const o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),u=o.pluginUrl+"images/",s=o.pluginUrl+"build/",a=o.buildPhase,l=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,i=(c.STORE_PAGES.checkout.id,c.STORE_PAGES.checkout.permalink),b=c.STORE_PAGES.privacy.permalink,f=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),d=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id,c.STORE_PAGES.cart.permalink),p=c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),m=Object(c.getSetting)("shippingCountries",{}),O=Object(c.getSetting)("allowedCountries",{}),j=Object(c.getSetting)("shippingStates",{}),g=Object(c.getSetting)("allowedStates",{})},5:function(e,t){e.exports=window.React},51:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(5);function c(e,t,r){var c=this,o=Object(n.useRef)(null),u=Object(n.useRef)(0),s=Object(n.useRef)(null),a=Object(n.useRef)([]),l=Object(n.useRef)(),i=Object(n.useRef)(),b=Object(n.useRef)(e),f=Object(n.useRef)(!0);b.current=e;var d=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var p=!!(r=r||{}).leading,m=!("trailing"in r)||!!r.trailing,O="maxWait"in r,j=O?Math.max(+r.maxWait||0,t):null;return Object(n.useEffect)((function(){return f.current=!0,function(){f.current=!1}}),[]),Object(n.useMemo)((function(){var e=function(e){var t=a.current,r=l.current;return a.current=l.current=null,u.current=e,i.current=b.current.apply(r,t)},r=function(e,t){d&&cancelAnimationFrame(s.current),s.current=d?requestAnimationFrame(e):setTimeout(e,t)},n=function(e){if(!f.current)return!1;var r=e-o.current,n=e-u.current;return!o.current||r>=t||r<0||O&&n>=j},g=function(t){return s.current=null,m&&a.current?e(t):(a.current=l.current=null,i.current)},w=function(){var e=Date.now();if(n(e))return g(e);if(f.current){var c=e-o.current,s=e-u.current,a=t-c,l=O?Math.min(a,j-s):a;r(w,l)}},h=function(){for(var b=[],d=0;d{let{Block:t,containers:r,getProps:n=(()=>({})),getErrorBoundaryProps:s=(()=>({}))}=e;0!==r.length&&Array.prototype.forEach.call(r,(e,r)=>{const a=n(e,r),l=s(e,r),i={...e.dataset,...a.attributes||{}};(e=>{let{Block:t,container:r,attributes:n={},props:s={},errorBoundaryProps:a={}}=e;Object(o.render)(Object(o.createElement)(u.a,a,Object(o.createElement)(o.Suspense,{fallback:Object(o.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(o.createElement)(t,c()({},s,{attributes:n})))),r,()=>{r.classList&&r.classList.remove("is-loading")})})({Block:t,container:e,props:a,attributes:i,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(s.join(",")),{Block:r,getProps:n,getErrorBoundaryProps:c,selector:o}=e;(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:c,wrappers:o}=e;const u=document.body.querySelectorAll(c);o&&o.length>0&&Array.prototype.filter.call(u,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,o)),a({Block:t,containers:u,getProps:r,getErrorBoundaryProps:n})})({Block:r,getProps:n,getErrorBoundaryProps:c,selector:o,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:c,wrapper:o}=e;const u=o.querySelectorAll(c);a({Block:t,containers:u,getProps:r,getErrorBoundaryProps:n})})({...e,wrapper:t})})})}},54:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(22);r(125),t.a=e=>{let{name:t,count:r}=e;return Object(n.createElement)(n.Fragment,null,t,r&&Number.isFinite(r)&&Object(n.createElement)(o.a,{label:r.toString(),screenReaderLabel:Object(c.sprintf)( +/* translators: %s number of products. */ +Object(c._n)("%s product","%s products",r,"woo-gutenberg-products-block"),r),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},6:function(e,t){e.exports=window.wc.wcBlocksData},61:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(5);function c(e,t){const r=Object(n.useRef)();return Object(n.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},65:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(6),c=r(7),o=r(0),u=r(31),s=r(73);const a=e=>{const{namespace:t,resourceName:r,resourceValues:a=[],query:l={},shouldSelect:i=!0}=e;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(o.useRef)({results:[],isLoading:!0}),f=Object(u.a)(l),d=Object(u.a)(a),p=Object(s.a)(),m=Object(c.useSelect)(e=>{if(!i)return null;const c=e(n.COLLECTIONS_STORE_KEY),o=[t,r,f,d],u=c.getCollectionError(...o);if(u){if(!(u instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");p(u)}return{results:c.getCollection(...o),isLoading:!c.hasFinishedResolution("getCollection",o)}},[t,r,d,f,i]);return null!==m&&(b.current=m),b.current}},7:function(e,t){e.exports=window.wp.data},73:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0);const c=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},75:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(4),u=r.n(o),s=r(22);r(107),t.a=e=>{let{className:t,disabled:r,label: +/* translators: Submit button text for filters. */ +o=Object(c.__)("Apply","woo-gutenberg-products-block"),onClick:a,screenReaderLabel:l=Object(c.__)("Apply filter","woo-gutenberg-products-block")}=e;return Object(n.createElement)("button",{type:"submit",className:u()("wp-block-button__link","wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:r,onClick:a},Object(n.createElement)(s.a,{label:o,screenReaderLabel:l}))}},77:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"boolean"==typeof e}}); \ No newline at end of file diff --git a/build/stock-filter.asset.php b/build/stock-filter.asset.php new file mode 100644 index 00000000000..9bb3cd19f5a --- /dev/null +++ b/build/stock-filter.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'e1c20d19d0d6ea80c57c0c1d0ea260d0'); \ No newline at end of file diff --git a/build/stock-filter.js b/build/stock-filter.js new file mode 100644 index 00000000000..158f5932fa6 --- /dev/null +++ b/build/stock-filter.js @@ -0,0 +1,15 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["stock-filter"]=function(e){function t(t){for(var n,s,l=t[0],a=t[1],u=t[2],b=0,d=[];b"string"==typeof e},106:function(e,t,c){"use strict";var n=c(0),o=c(1),r=c(28);c(246),t.a=e=>{let{name:t,count:c}=e;return Object(n.createElement)(n.Fragment,null,t,c&&Number.isFinite(c)&&Object(n.createElement)(r.a,{label:c.toString(),screenReaderLabel:Object(o.sprintf)( +/* translators: %s number of products. */ +Object(o._n)("%s product","%s products",c,"woo-gutenberg-products-block"),c),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},109:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var n=c(12);function o(e,t){const c=Object(n.useRef)();return Object(n.useEffect)(()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)},[e,t]),c.current}},11:function(e,t){e.exports=window.wp.primitives},12:function(e,t){e.exports=window.React},120:function(e,t,c){"use strict";var n=c(0),o=c(5),r=c(10),s=c(1);c(158),t.a=Object(r.withInstanceId)(e=>{let{className:t,headingLevel:c,onChange:r,heading:l,instanceId:a}=e;const u="h"+c;return Object(n.createElement)(u,{className:t},Object(n.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-"+a},Object(s.__)("Block title","woo-gutenberg-products-block")),Object(n.createElement)(o.PlainText,{id:"block-title-"+a,className:"wc-block-editor-components-title",value:l,onChange:r}))})},124:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var n=c(0);const o=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},125:function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var n=c(17),o=c(9),r=c(0),s=c(49),l=c(124);const a=e=>{const{namespace:t,resourceName:c,resourceValues:a=[],query:u={},shouldSelect:i=!0}=e;if(!t||!c)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(r.useRef)({results:[],isLoading:!0}),d=Object(s.a)(u),p=Object(s.a)(a),O=Object(l.a)(),f=Object(o.useSelect)(e=>{if(!i)return null;const o=e(n.COLLECTIONS_STORE_KEY),r=[t,c,d,p],s=o.getCollectionError(...r);if(s){if(!(s instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");O(s)}return{results:o.getCollection(...r),isLoading:!o.hasFinishedResolution("getCollection",r)}},[t,c,p,d,i]);return null!==f&&(b.current=f),b.current}},13:function(e,t){e.exports=window.wp.htmlEntities},146:function(e,t,c){"use strict";var n=c(0),o=c(1),r=c(4),s=c.n(r),l=c(28);c(183),t.a=e=>{let{className:t,disabled:c,label: +/* translators: Submit button text for filters. */ +r=Object(o.__)("Apply","woo-gutenberg-products-block"),onClick:a,screenReaderLabel:u=Object(o.__)("Apply filter","woo-gutenberg-products-block")}=e;return Object(n.createElement)("button",{type:"submit",className:s()("wp-block-button__link","wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:c,onClick:a},Object(n.createElement)(l.a,{label:r,screenReaderLabel:u}))}},15:function(e,t){e.exports=window.wp.url},158:function(e,t){},162:function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));const n=e=>"boolean"==typeof e},17:function(e,t){e.exports=window.wc.wcBlocksData},183:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},204:function(e,t,c){"use strict";var n=c(0),o=c(1),r=c(4),s=c.n(r);c(247),t.a=e=>{let{className:t,onChange:c,options:r=[],checked:l=[],isLoading:a=!1,isDisabled:u=!1,limit:i=10}=e;const[b,d]=Object(n.useState)(!1),p=Object(n.useMemo)(()=>[...Array(5)].map((e,t)=>Object(n.createElement)("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})),[]),O=Object(n.useMemo)(()=>{const e=r.length-i;return!b&&Object(n.createElement)("li",{key:"show-more",className:"show-more"},Object(n.createElement)("button",{onClick:()=>{d(!0)},"aria-expanded":!1,"aria-label":Object(o.sprintf)( +/* translators: %s is referring the remaining count of options */ +Object(o._n)("Show %s more option","Show %s more options",e,"woo-gutenberg-products-block"),e)},Object(o.sprintf)( +/* translators: %s number of options to reveal. */ +Object(o._n)("Show %s more","Show %s more",e,"woo-gutenberg-products-block"),e)))},[r,i,b]),f=Object(n.useMemo)(()=>b&&Object(n.createElement)("li",{key:"show-less",className:"show-less"},Object(n.createElement)("button",{onClick:()=>{d(!1)},"aria-expanded":!0,"aria-label":Object(o.__)("Show less options","woo-gutenberg-products-block")},Object(o.__)("Show less","woo-gutenberg-products-block"))),[b]),m=Object(n.useMemo)(()=>{const e=r.length>i+5;return Object(n.createElement)(n.Fragment,null,r.map((t,o)=>Object(n.createElement)(n.Fragment,{key:t.value},Object(n.createElement)("li",e&&!b&&o>=i&&{hidden:!0},Object(n.createElement)("input",{type:"checkbox",id:t.value,value:t.value,onChange:e=>{c(e.target.value)},checked:l.includes(t.value),disabled:u}),Object(n.createElement)("label",{htmlFor:t.value},t.label)),e&&o===i-1&&O)),e&&f)},[r,c,l,b,i,f,O,u]),j=s()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":a},t);return Object(n.createElement)("ul",{className:j},a?p:m)}},22:function(e,t){e.exports=window.wp.isShallowEqual},245:function(e,t,c){"use strict";c.d(t,"b",(function(){return l})),c.d(t,"a",(function(){return a})),c.d(t,"d",(function(){return u})),c.d(t,"c",(function(){return i}));var n=c(15),o=c(2),r=c(162);const s=Object(o.getSettingWithCoercion)("is_rendering_php_template",!1,r.a),l="query_type_",a="filter_";function u(e){return window?Object(n.getQueryArg)(window.location.href,e):null}function i(e){s?window.location.href=e:window.history.replaceState({},"",e)}},246:function(e,t){},247:function(e,t){},278:function(e){e.exports=JSON.parse('{"name":"woocommerce/stock-filter","version":"1.0.0","title":"Filter Products by Stock","description":"Allow customers to filter the grid by products stock status. Works in combination with the All Products block.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"multiple":false},"example":{"attributes":{"isPreview":true}},"attributes":{"className":{"type":"string","default":""},"headingLevel":{"type":"number","default":3},"showCounts":{"type":"boolean","default":true},"showFilterButton":{"type":"boolean","default":false},"isPreview":{"type":"boolean","default":false}},"textdomain":"woo-gutenberg-products-block","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},28:function(e,t,c){"use strict";var n=c(0),o=c(4),r=c.n(o);t.a=e=>{let t,{label:c,screenReaderLabel:o,wrapperElement:s,wrapperProps:l={}}=e;const a=null!=c,u=null!=o;return!a&&u?(t=s||"span",l={...l,className:r()(l.className,"screen-reader-text")},Object(n.createElement)(t,l,o)):(t=s||n.Fragment,a&&u&&c!==o?Object(n.createElement)(t,l,Object(n.createElement)("span",{"aria-hidden":"true"},c),Object(n.createElement)("span",{className:"screen-reader-text"},o)):Object(n.createElement)(t,l,c))}},3:function(e,t){e.exports=window.wp.components},309:function(e,t,c){"use strict";c.d(t,"a",(function(){return b}));var n=c(0),o=c(284),r=c(7),s=c(49),l=c(35),a=c(75),u=c(125),i=c(52);const b=e=>{let{queryAttribute:t,queryPrices:c,queryStock:b,queryState:d}=e,p=Object(i.a)();p+="-collection-data";const[O]=Object(a.a)(p),[f,m]=Object(a.b)("calculate_attribute_counts",[],p),[j,w]=Object(a.b)("calculate_price_range",null,p),[h,g]=Object(a.b)("calculate_stock_status_counts",null,p),v=Object(s.a)(t||{}),k=Object(s.a)(c),_=Object(s.a)(b);Object(n.useEffect)(()=>{"object"==typeof v&&Object.keys(v).length&&(f.find(e=>Object(l.b)(v,"taxonomy")&&e.taxonomy===v.taxonomy)||m([...f,v]))},[v,f,m]),Object(n.useEffect)(()=>{j!==k&&void 0!==k&&w(k)},[k,w,j]),Object(n.useEffect)(()=>{h!==_&&void 0!==_&&g(_)},[_,g,h]);const[E,y]=Object(n.useState)(!1),[S]=Object(o.a)(E,200);E||y(!0);const C=Object(n.useMemo)(()=>(e=>{const t=e;return Array.isArray(e.calculate_attribute_counts)&&(t.calculate_attribute_counts=Object(r.sortBy)(e.calculate_attribute_counts.map(e=>{let{taxonomy:t,queryType:c}=e;return{taxonomy:t,query_type:c}}),["taxonomy","query_type"])),t})(O),[O]);return Object(u.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...d,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...C},shouldSelect:S})}},35:function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return o}));const n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return n(e)&&t in e}},398:function(e,t,c){e.exports=c(466)},399:function(e,t){},400:function(e,t){},45:function(e,t){e.exports=window.wp.a11y},466:function(e,t,c){"use strict";c.r(t);var n=c(6),o=c.n(n),r=c(0),s=c(1),l=c(8),a=c(113),u=c(516),i=c(4),b=c.n(i),d=c(5),p=c(3),O=c(99),f=c(120),m=c(45),j=c(49),w=c(109),h=c(75),g=c(309),v=c(2),k=c(204),_=c(146),E=c(106),y=c(22),S=c.n(y),C=c(13),x=c(162),P=c(35),N=c(15),L=c(245);const F=[{value:"preview-1",name:"In Stock",label:Object(r.createElement)(E.a,{name:"In Stock",count:3})},{value:"preview-2",name:"Out of sotck",label:Object(r.createElement)(E.a,{name:"Out of stock",count:3})},{value:"preview-3",name:"On backorder",label:Object(r.createElement)(E.a,{name:"On backorder",count:2})}];c(400);var T=c(100);const A=L.a+"stock_status";var H=e=>{let{attributes:t,isEditor:c=!1}=e;const n=Object(v.getSettingWithCoercion)("is_rendering_php_template",!1,x.a),[o,l]=Object(r.useState)(!1),{outofstock:a,...u}=Object(v.getSetting)("stockStatusOptions",{}),i=Object(r.useRef)(Object(v.getSetting)("hideOutOfStockItems",!1)?u:{outofstock:a,...u}),b=Object(r.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"filter_stock_status";const c=Object(L.d)(t);if(!c)return[];const n=Object(T.a)(c)?c.split(","):c;return Object.keys(e).filter(e=>n.includes(e))}(i.current,A),[]),[d,p]=Object(r.useState)(b),[O,f]=Object(r.useState)(t.isPreview?F:[]),[y]=Object(r.useState)(Object.entries(i.current).map(e=>{let[t,c]=e;return{slug:t,name:c}}).filter(e=>!!e.name).sort((e,t)=>e.slug.localeCompare(t.slug))),[H]=Object(h.a)(),[V,M]=Object(h.b)("stock_status",b),{results:R,isLoading:B}=Object(g.a)({queryStock:!0,queryState:H}),z=Object(r.useCallback)(e=>Object(P.b)(R,"stock_status_counts")&&Array.isArray(R.stock_status_counts)?R.stock_status_counts.find(t=>{let{status:c,count:n}=t;return c===e&&0!==Number(n)}):null,[R]);Object(r.useEffect)(()=>{if(B||t.isPreview)return;const e=y.map(e=>{const c=z(e.slug);if(!(c||d.includes(e.slug)||(n=e.slug,null!=H&&H.stock_status&&H.stock_status.some(e=>{let{status:t=[]}=e;return t.includes(n)}))))return null;var n;const o=c?Number(c.count):0;return{value:e.slug,name:Object(C.decodeEntities)(e.name),label:Object(r.createElement)(E.a,{name:Object(C.decodeEntities)(e.name),count:t.showCounts?o:null})}}).filter(e=>!!e);f(e)},[t.showCounts,t.isPreview,B,z,d,H.stock_status,y]);const q=Object(r.useCallback)(e=>{c||(e&&!n&&M(d),(e=>{if(!window)return;if(0===e.length){const e=Object(N.removeQueryArgs)(window.location.href,A);return void(e!==window.location.href&&Object(L.c)(e))}const t=Object(N.addQueryArgs)(window.location.href,{[A]:e.join(",")});t!==window.location.href&&Object(L.c)(t)})(d))},[c,M,d,n]);Object(r.useEffect)(()=>{t.showFilterButton||q(d)},[t.showFilterButton,d,q]);const Q=Object(r.useMemo)(()=>V,[V]),Y=Object(j.a)(Q),I=Object(w.a)(Y);Object(r.useEffect)(()=>{S()(I,Y)||S()(d,Y)||p(Y)},[d,Y,I]),Object(r.useEffect)(()=>{o||(M(b),l(!0))},[M,o,l,b]);const W=Object(r.useCallback)(e=>{const t=e=>{const t=O.find(t=>t.value===e);return t?t.name:null},c=e=>{let{filterAdded:c,filterRemoved:n}=e;const o=c?t(c):null,r=n?t(n):null;o?Object(m.speak)(Object(s.sprintf)( +/* translators: %s stock statuses (for example: 'instock'...) */ +Object(s.__)("%s filter added.","woo-gutenberg-products-block"),o)):r&&Object(m.speak)(Object(s.sprintf)( +/* translators: %s stock statuses (for example:'instock'...) */ +Object(s.__)("%s filter removed.","woo-gutenberg-products-block"),r))},n=d.includes(e),o=d.filter(t=>t!==e);n?c({filterRemoved:e}):(o.push(e),o.sort(),c({filterAdded:e})),p(o)},[d,O]);if(0===O.length)return null;const D="h"+t.headingLevel,K=!t.isPreview&&!i.current,U=!t.isPreview&&B;return Object(v.getSettingWithCoercion)("has_filterable_products",!1,x.a)?Object(r.createElement)(r.Fragment,null,!c&&t.heading&&Object(r.createElement)(D,{className:"wc-block-stock-filter__title"},t.heading),Object(r.createElement)("div",{className:"wc-block-stock-filter"},Object(r.createElement)(k.a,{className:"wc-block-stock-filter-list",options:O,checked:d,onChange:W,isLoading:K,isDisabled:U}),t.showFilterButton&&Object(r.createElement)(_.a,{className:"wc-block-stock-filter__button",disabled:K||U,onClick:()=>q(d)}))):null};c(399);var V=Object(p.withSpokenMessages)(e=>{let{attributes:t,setAttributes:c}=e;const{className:n,heading:o,headingLevel:l,showCounts:a,showFilterButton:u}=t,i=Object(d.useBlockProps)({className:b()("wc-block-stock-filter",n)});return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(d.InspectorControls,{key:"inspector"},Object(r.createElement)(p.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(r.createElement)(p.ToggleControl,{label:Object(s.__)("Product count","woo-gutenberg-products-block"),help:a?Object(s.__)("Product count is visible.","woo-gutenberg-products-block"):Object(s.__)("Product count is hidden.","woo-gutenberg-products-block"),checked:a,onChange:()=>c({showCounts:!a})}),Object(r.createElement)("p",null,Object(s.__)("Heading Level","woo-gutenberg-products-block")),Object(r.createElement)(O.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:l,onChange:e=>c({headingLevel:e})})),Object(r.createElement)(p.PanelBody,{title:Object(s.__)("Block Settings","woo-gutenberg-products-block")},Object(r.createElement)(p.ToggleControl,{label:Object(s.__)("Filter button","woo-gutenberg-products-block"),help:u?Object(s.__)("Products will only update when the button is pressed.","woo-gutenberg-products-block"):Object(s.__)("Products will update as options are selected.","woo-gutenberg-products-block"),checked:u,onChange:e=>c({showFilterButton:e})}))),Object(r.createElement)("div",i,Object(r.createElement)(f.a,{className:"wc-block-stock-filter__title",headingLevel:l,heading:o,onChange:e=>c({heading:e})}),Object(r.createElement)(p.Disabled,null,Object(r.createElement)(H,{attributes:t,isEditor:!0}))))}),M=c(278);const R={heading:{type:"string",default:Object(s.__)("Filter by stock status","woo-gutenberg-products-block")}};Object(l.registerBlockType)(M,{title:Object(s.__)("Filter Products by Stock","woo-gutenberg-products-block"),description:Object(s.__)("Allow customers to filter the grid by products stock status. Works in combination with the All Products block.","woo-gutenberg-products-block"),icon:{src:Object(r.createElement)(a.a,{icon:u.a,className:"wc-block-editor-components-block-icon"})},attributes:{...M.attributes,...R},edit:V,save(e){let{attributes:t}=e;const{className:c,showCounts:n,heading:s,headingLevel:l,showFilterButton:a}=t,u={"data-show-counts":n,"data-heading":s,"data-heading-level":l};return a&&(u["data-show-filter-button"]=a),Object(r.createElement)("div",o()({},d.useBlockProps.save({className:b()("is-loading",c)}),u),Object(r.createElement)("span",{"aria-hidden":!0,className:"wc-block-product-stock-filter__placeholder"}))}})},49:function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var n=c(0),o=c(22),r=c.n(o);function s(e){const t=Object(n.useRef)(e);return r()(e,t.current)||(t.current=e),t.current}},5:function(e,t){e.exports=window.wp.blockEditor},52:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var n=c(0);const o=Object(n.createContext)("page"),r=()=>Object(n.useContext)(o);o.Provider},7:function(e,t){e.exports=window.lodash},75:function(e,t,c){"use strict";c.d(t,"a",(function(){return b})),c.d(t,"b",(function(){return d})),c.d(t,"c",(function(){return p}));var n=c(17),o=c(9),r=c(0),s=c(22),l=c.n(s),a=c(49),u=c(109),i=c(52);const b=e=>{const t=Object(i.a)();e=e||t;const c=Object(o.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:s}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[c,Object(r.useCallback)(t=>{s(e,t)},[e,s])]},d=(e,t,c)=>{const s=Object(i.a)();c=c||s;const l=Object(o.useSelect)(o=>o(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(c,e,t),[c,e]),{setQueryValue:a}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[l,Object(r.useCallback)(t=>{a(c,e,t)},[c,e,a])]},p=(e,t)=>{const c=Object(i.a)();t=t||c;const[n,o]=b(t),s=Object(a.a)(n),d=Object(a.a)(e),p=Object(u.a)(d),O=Object(r.useRef)(!1);return Object(r.useEffect)(()=>{l()(p,d)||(o(Object.assign({},s,d)),O.current=!0)},[s,d,p,o]),O.current?[n,o]:[e,o]}},8:function(e,t){e.exports=window.wp.blocks},9:function(e,t){e.exports=window.wp.data},99:function(e,t,c){"use strict";var n=c(0),o=c(7),r=c(1),s=c(3),l=c(11);function a(e){let{level:t}=e;const c={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return c.hasOwnProperty(t)?Object(n.createElement)(l.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)(l.Path,{d:c[t]})):null}class u extends n.Component{createLevelControl(e,t,c){const o=e===t;return{icon:Object(n.createElement)(a,{level:e}),title:Object(r.sprintf)( +/* translators: %s: heading level e.g: "2", "3", "4" */ +Object(r.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:o,onClick:()=>c(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:c,selectedLevel:r,onChange:l}=this.props;return Object(n.createElement)(s.ToolbarGroup,{isCollapsed:e,icon:Object(n.createElement)(a,{level:r}),controls:Object(o.range)(t,c).map(e=>this.createLevelControl(e,r,l))})}}t.a=u}}); \ No newline at end of file diff --git a/build/stock-filter/block.json b/build/stock-filter/block.json new file mode 100644 index 00000000000..5969f42c446 --- /dev/null +++ b/build/stock-filter/block.json @@ -0,0 +1,42 @@ +{ + "name": "woocommerce/stock-filter", + "version": "1.0.0", + "title": "Filter Products by Stock", + "description": "Allow customers to filter the grid by products stock status. Works in combination with the All Products block.", + "category": "woocommerce", + "keywords": [ "WooCommerce" ], + "supports": { + "html": false, + "multiple": false + }, + "example": { + "attributes": { + "isPreview": true + } + }, + "attributes": { + "className": { + "type": "string", + "default": "" + }, + "headingLevel": { + "type": "number", + "default": 3 + }, + "showCounts": { + "type": "boolean", + "default": true + }, + "showFilterButton": { + "type": "boolean", + "default": false + }, + "isPreview": { + "type": "boolean", + "default": false + } + }, + "textdomain": "woo-gutenberg-products-block", + "apiVersion": 2, + "$schema": "https://schemas.wp.org/trunk/block.json" +} diff --git a/build/vendors--cart-blocks/cart-line-items--cart-blocks/cart-order-summary--cart-blocks/order-summary-shi--c02aad66-frontend.js b/build/vendors--cart-blocks/cart-line-items--cart-blocks/cart-order-summary--cart-blocks/order-summary-shi--c02aad66-frontend.js new file mode 100644 index 00000000000..bf01c71a6ca --- /dev/null +++ b/build/vendors--cart-blocks/cart-line-items--cart-blocks/cart-order-summary--cart-blocks/order-summary-shi--c02aad66-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[0],{137:function(t,e,r){"use strict";var o=r(5),n=r.n(o);function a(){}function i(t){return!!(t||"").match(/\d/)}function s(t){return null==t}function u(t){return t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function l(t,e){void 0===e&&(e=!0);var r="-"===t[0],o=r&&e,n=(t=t.replace("-","")).split(".");return{beforeDecimal:n[0],afterDecimal:n[1]||"",hasNagation:r,addNegation:o}}function p(t,e,r){for(var o="",n=r?"0":"",a=0;a<=e-1;a++)o+=t[a]||n;return o}function c(t,e){return Array(e+1).join(t)}function f(t,e){if(t.value=t.value,null!==t){if(t.createTextRange){var r=t.createTextRange();return r.move("character",e),r.select(),!0}return t.selectionStart||0===t.selectionStart?(t.focus(),t.setSelectionRange(e,e),!0):(t.focus(),!1)}}function h(t,e,r){return Math.min(Math.max(t,e),r)}function m(t){return Math.max(t.selectionStart,t.selectionEnd)}var g={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:a,onChange:a,onKeyDown:a,onMouseUp:a,onFocus:a,onBlur:a,isAllowed:function(){return!0}},d=function(t){function e(e){t.call(this,e);var r=e.defaultValue;this.validateProps();var o=this.formatValueProp(r);this.state={value:o,numAsString:this.removeFormatting(o),mounted:!1},this.selectionBeforeInput={selectionStart:0,selectionEnd:0},this.onChange=this.onChange.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.componentDidMount=function(){this.setState({mounted:!0})},e.prototype.componentDidUpdate=function(t){this.updateValueIfRequired(t)},e.prototype.componentWillUnmount=function(){clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout)},e.prototype.updateValueIfRequired=function(t){var e=this.props,r=this.state,o=this.focusedElm,n=r.value,a=r.numAsString;if(void 0===a&&(a=""),t!==e){this.validateProps();var i=this.formatNumString(a),u=s(e.value)?i:this.formatValueProp(),l=this.removeFormatting(u),p=parseFloat(l),c=parseFloat(a);(isNaN(p)&&isNaN(c)||p===c)&&i===n&&(null!==o||u===n)||this.updateValue({formattedValue:u,numAsString:l,input:o,source:"prop",event:null})}},e.prototype.getFloatString=function(t){void 0===t&&(t="");var e=this.props.decimalScale,r=this.getSeparators().decimalSeparator,o=this.getNumberRegex(!0),n="-"===t[0];n&&(t=t.replace("-","")),r&&0===e&&(t=t.split(r)[0]);var a=(t=(t.match(o)||[]).join("").replace(r,".")).indexOf(".");return-1!==a&&(t=t.substring(0,a)+"."+t.substring(a+1,t.length).replace(new RegExp(u(r),"g"),"")),n&&(t="-"+t),t},e.prototype.getNumberRegex=function(t,e){var r=this.props,o=r.format,n=r.decimalScale,a=r.customNumerals,i=this.getSeparators().decimalSeparator;return new RegExp("[0-9"+(a?a.join(""):"")+"]"+(!i||0===n||e||o?"":"|"+u(i)),t?"g":void 0)},e.prototype.getSeparators=function(){var t=this.props.decimalSeparator,e=this.props,r=e.thousandSeparator,o=e.allowedDecimalSeparators;return!0===r&&(r=","),o||(o=[t,"."]),{decimalSeparator:t,thousandSeparator:r,allowedDecimalSeparators:o}},e.prototype.getMaskAtIndex=function(t){var e=this.props.mask;return void 0===e&&(e=" "),"string"==typeof e?e:e[t]||" "},e.prototype.getValueObject=function(t,e){var r=parseFloat(e);return{formattedValue:t,value:e,floatValue:isNaN(r)?void 0:r}},e.prototype.validateProps=function(){var t=this.props.mask,e=this.getSeparators(),r=e.decimalSeparator,o=e.thousandSeparator;if(r===o)throw new Error("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: "+o+' (thousandSeparator = {true} is same as thousandSeparator = ",")\n decimalSeparator: '+r+" (default value for decimalSeparator is .)\n ");if(t&&("string"===t?t:t.toString()).match(/\d/g))throw new Error("\n Mask "+t+" should not contain numeric character;\n ")},e.prototype.setPatchedCaretPosition=function(t,e,r){f(t,e),this.caretPositionTimeout=setTimeout((function(){t.value===r&&f(t,e)}),0)},e.prototype.correctCaretPosition=function(t,e,r){var o=this.props,n=o.prefix,a=o.suffix,s=o.format;if(""===t)return 0;if(e=h(e,0,t.length),!s){var u="-"===t[0];return h(e,n.length+(u?1:0),t.length-a.length)}if("function"==typeof s)return e;if("#"===s[e]&&i(t[e]))return e;if("#"===s[e-1]&&i(t[e-1]))return e;var l=s.indexOf("#");e=h(e,l,s.lastIndexOf("#")+1);for(var p=s.substring(e,s.length).indexOf("#"),c=e,f=e+(-1===p?0:p);c>l&&("#"!==s[c]||!i(t[c]));)c-=1;return!i(t[f])||"left"===r&&e!==l||e-c=i?o+=c("0",a-i):o=(o.substring(0,a)||"0")+"."+o.substring(a),e+o}(u),f=!0),"Infinity"===u&&f&&(u=""),f&&!r&&"number"==typeof o&&(u=function(t,e,r){if(-1!==["","-"].indexOf(t))return t;var o=-1!==t.indexOf(".")&&e,n=l(t),a=n.beforeDecimal,i=n.afterDecimal,s=n.hasNagation,u=parseFloat("0."+(i||"0")),c=(i.length<=e?"0."+i:u.toFixed(e)).split(".");return(s?"-":"")+a.split("").reverse().reduce((function(t,e,r){return t.length>r?(Number(t[0])+Number(e)).toString()+t.substring(1,t.length):e+t}),c[0])+(o?".":"")+p(c[1]||"",Math.min(e,i.length),r)}(u,o,n)),f?this.formatNumString(u):this.formatInput(u))},e.prototype.formatNegation=function(t){void 0===t&&(t="");var e=this.props.allowNegative,r=new RegExp("(-)"),o=new RegExp("(-)(.)*(-)"),n=r.test(t),a=o.test(t);return t=t.replace(/-/g,""),n&&!a&&e&&(t="-"+t),t},e.prototype.formatInput=function(t){return void 0===t&&(t=""),this.props.format||(t=this.removePrefixAndSuffix(t),t=this.formatNegation(t)),t=this.removeFormatting(t),this.formatNumString(t)},e.prototype.isCharacterAFormat=function(t,e){var r=this.props,o=r.format,n=r.prefix,a=r.suffix,i=r.decimalScale,s=r.fixedDecimalScale,u=this.getSeparators().decimalSeparator;return"string"==typeof o&&"#"!==o[t]||!(o||!(t=e.length-a.length||i&&s&&e[t]===u))},e.prototype.correctInputValue=function(t,e,r){var o=this,n=this.props,a=n.format,i=n.allowNegative,s=n.prefix,u=n.suffix,p=n.decimalScale,c=this.getSeparators(),f=c.allowedDecimalSeparators,h=c.decimalSeparator,m=this.state.numAsString||"",g=this.selectionBeforeInput,d=g.selectionStart,v=g.selectionEnd,S=function(t,e){for(var r=0,o=0,n=t.length,a=e.length;t[r]===e[r]&&rr&&n-o>r;)o++;return{start:r,end:n-o}}(e,r),y=S.start,x=S.end;if(!a&&y===x&&-1!==f.indexOf(r[d])){var b=0===p?"":h;return r.substr(0,d)+b+r.substr(d+1,r.length)}var w=a?0:s.length,N=e.length-(a?0:u.length);if(r.length>e.length||!r.length||y===x||0===d&&v===e.length||0===y&&x===e.length||d===w&&v===N)return r;var P=e.substr(y,x-y);if([].concat(P).find((function(t,r){return o.isCharacterAFormat(r+y,e)}))){var F=e.substr(y),D={},C=[];[].concat(F).forEach((function(t,r){o.isCharacterAFormat(r+y,e)?D[r]=t:r>P.length-1&&C.push(t)})),Object.keys(D).forEach((function(t){C.length>t?C.splice(t,0,D[t]):C.push(D[t])})),r=e.substr(0,y)+C.join("")}if(!a){var V=this.removeFormatting(r),A=l(V,i),E=A.beforeDecimal,O=A.afterDecimal,R=A.addNegation,j=ty;)S--;S=this.correctCaretPosition(i,S,"left")}}else for(;!g.test(i[S])&&Sx)&&(t.preventDefault(),this.setPatchedCaretPosition(r,S,i)),t.isUnitTestRun&&this.setPatchedCaretPosition(r,S,i),h(t)}else h(t)},e.prototype.onMouseUp=function(t){var e=t.target,r=e.selectionStart,o=e.selectionEnd,n=e.value;if(void 0===n&&(n=""),r===o){var a=this.correctCaretPosition(n,r);a!==r&&this.setPatchedCaretPosition(e,a,n)}this.props.onMouseUp(t)},e.prototype.onFocus=function(t){var e=this;t.persist(),this.focusedElm=t.target,this.focusTimeout=setTimeout((function(){var r=t.target,o=r.selectionStart,n=r.selectionEnd,a=r.value;void 0===a&&(a="");var i=e.correctCaretPosition(a,o);i===o||0===o&&n===a.length||e.setPatchedCaretPosition(r,i,a),e.props.onFocus(t)}),0)},e.prototype.render=function(){var t=this.props,e=t.type,r=t.displayType,o=t.customInput,a=t.renderText,i=t.getInputRef,s=t.format,u=(t.thousandSeparator,t.decimalSeparator,t.allowedDecimalSeparators,t.thousandsGroupStyle,t.decimalScale,t.fixedDecimalScale,t.prefix,t.suffix,t.removeFormatting,t.mask,t.defaultValue,t.isNumericString,t.allowNegative,t.allowEmptyFormatting,t.allowLeadingZeros,t.onValueChange,t.isAllowed,t.customNumerals,t.onChange,t.onKeyDown,t.onMouseUp,t.onFocus,t.onBlur,t.value,function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}(t,["type","displayType","customInput","renderText","getInputRef","format","thousandSeparator","decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","decimalScale","fixedDecimalScale","prefix","suffix","removeFormatting","mask","defaultValue","isNumericString","allowNegative","allowEmptyFormatting","allowLeadingZeros","onValueChange","isAllowed","customNumerals","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value"])),l=this.state,p=l.value,c=l.mounted&&function(t){return t||"undefined"!=typeof navigator&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}(s)?"numeric":void 0,f=Object.assign({inputMode:c},u,{type:e,value:p,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===r)return a?a(p,u)||null:n.a.createElement("span",Object.assign({},u,{ref:i}),p);if(o){var h=o;return n.a.createElement(h,Object.assign({},f,{ref:i}))}return n.a.createElement("input",Object.assign({},f,{ref:i}))},e}(n.a.Component);d.defaultProps=g,e.a=d}}]); \ No newline at end of file diff --git a/build/vendors--cart-blocks/cart-line-items--checkout-blocks/order-summary-cart-items--mini-cart-contents---233ab542-frontend.js b/build/vendors--cart-blocks/cart-line-items--checkout-blocks/order-summary-cart-items--mini-cart-contents---233ab542-frontend.js new file mode 100644 index 00000000000..c80ef7e685d --- /dev/null +++ b/build/vendors--cart-blocks/cart-line-items--checkout-blocks/order-summary-cart-items--mini-cart-contents---233ab542-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[3],{333:function(t,n,r){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return i(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,void 0):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,e=new Array(n);r1&&void 0!==arguments[1]?arguments[1]:{};for(var r in n)t.setRequestHeader(r,n[r]);return t}function h(t){return void 0===t}function d(){var t={HALF_ODD:function(t){var n=Math.round(t);return l(t)&&c(n)?n-1:n},HALF_EVEN:function(t){var n=Math.round(t);return l(t)?c(n)?n:n-1:n},HALF_UP:function(t){return Math.round(t)},HALF_DOWN:function(t){return l(t)?Math.floor(t):Math.round(t)},HALF_TOWARDS_ZERO:function(t){return l(t)?Math.sign(t)*Math.floor(Math.abs(t)):Math.round(t)},HALF_AWAY_FROM_ZERO:function(t){return l(t)?Math.sign(t)*Math.ceil(Math.abs(t)):Math.round(t)},DOWN:function(t){return Math.floor(t)}};return{add:function(t,n){return t+n},subtract:function(t,n){return t-n},multiply:function(t,n){return s(t)||s(n)?function(t,n){var r=function(t){return Math.pow(10,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=t.toString();if(n.indexOf("e-")>0)return parseInt(n.split("e-")[1]);var r=n.split(".")[1];return r?r.length:0}(t))},e=Math.max(r(t),r(n));return Math.round(t*e)*Math.round(n*e)/(e*e)}(t,n):t*n},divide:function(t,n){return t/n},modulo:function(t,n){return t%n},round:function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN";return t[r](n)}}}var g=d();function m(t){var n=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(t);return{getMatches:function(){return null!==n?n.slice(1).filter((function(t){return!h(t)})):[]},getMinimumFractionDigits:function(){var t=function(t){return"."===t};return h(this.getMatches().find(t))?0:this.getMatches()[g.add(this.getMatches().findIndex(t),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find((function(t){return"USD"===t||"dollar"===t||"$"===t}))]},getStyle:function(){return h(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!h(this.getMatches().find((function(t){return","===t})))}}}function v(t){var n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;for(var r in n)t=t.replace("{{".concat(r,"}}"),n[r]);return t};return{getExchangeRate:function(r,o){return(i=t.endpoint,!Boolean(i)||"object"!==e(i)&&"function"!=typeof i||"function"!=typeof i.then?function(r,e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,e){var o=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===o.readyState&&(o.status>=200&&o.status<400?r(JSON.parse(o.responseText)):e(new Error(o.statusText)))},onerror:function(){e(new Error("Network error"))}});o.open("GET",t,!0),f(o,n.headers),o.send()}))}(n(t.endpoint,{from:r,to:e}),{headers:t.headers})}(r,o):t.endpoint).then((function(i){return function t(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",o={};return Object.entries(n).forEach((function(n){if("object"===e(n[1])){var i=t(n[1]);Object.entries(i).forEach((function(t){o[n[0]+r+t[0]]=t[1]}))}else o[n[0]]=n[1]})),o}(i)[n(t.propertyPath,{from:r,to:o})]}));var i}}}function p(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!t)throw new r(n)}function y(t){p(function(t){return a(t)&&t<=100&&t>=0}(t),"You must provide a numeric value between 0 and 100.",RangeError)}function b(t){p(Number.isInteger(t),"You must provide an integer.",TypeError)}var A=d(),M=Object.assign((function t(n){var r=Object.assign({},{amount:t.defaultAmount,currency:t.defaultCurrency,precision:t.defaultPrecision},n),e=r.amount,o=r.currency,i=r.precision;b(e),b(i);var u=t.globalLocale,a=t.globalFormat,c=t.globalRoundingMode,s=t.globalFormatRoundingMode,l=Object.assign({},t.globalExchangeRatesApi),f=function(n){var r=Object.assign({},Object.assign({},{amount:e,currency:o,precision:i},n),Object.assign({},{locale:this.locale},n));return Object.assign(t({amount:r.amount,currency:r.currency,precision:r.precision}),{locale:r.locale})},d=function(t){p(this.hasSameCurrency(t),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return e},getCurrency:function(){return o},getLocale:function(){return this.locale||u},setLocale:function(t){return f.call(this,{locale:t})},getPrecision:function(){return i},convertPrecision:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;b(t);var r=this.getPrecision(),e=t>r,o=e?A.multiply:A.divide,i=e?[t,r]:[r,t],u=Math.pow(10,A.subtract.apply(A,i));return f.call(this,{amount:A.round(o(this.getAmount(),u),n),precision:t})},add:function(n){d.call(this,n);var r=t.normalizePrecision([this,n]);return f.call(this,{amount:A.add(r[0].getAmount(),r[1].getAmount()),precision:r[0].getPrecision()})},subtract:function(n){d.call(this,n);var r=t.normalizePrecision([this,n]);return f.call(this,{amount:A.subtract(r[0].getAmount(),r[1].getAmount()),precision:r[0].getPrecision()})},multiply:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return f.call(this,{amount:A.round(A.multiply(this.getAmount(),t),n)})},divide:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return f.call(this,{amount:A.round(A.divide(this.getAmount(),t),n)})},percentage:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return y(t),this.multiply(A.divide(t,100),n)},allocate:function(t){var n=this;!function(t){p(function(t){return t.length>0&&t.every((function(t){return t>=0}))&&t.some((function(t){return t>0}))}(t),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(t);for(var r=t.reduce((function(t,n){return A.add(t,n)})),e=this.getAmount(),o=t.map((function(t){var o=Math.floor(A.divide(A.multiply(n.getAmount(),t),r));return e=A.subtract(e,o),f.call(n,{amount:o})})),i=0;e>0;)t[i]>0&&(o[i]=o[i].add(f.call(this,{amount:1})),e=A.subtract(e,1)),i+=1;return o},convert:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=r.endpoint,o=void 0===e?l.endpoint:e,i=r.propertyPath,u=void 0===i?l.propertyPath||"rates.{{to}}":i,a=r.headers,s=void 0===a?l.headers:a,d=r.roundingMode,g=void 0===d?c:d,m=Object.assign({},{endpoint:o,propertyPath:u,headers:s,roundingMode:g});return v(m).getExchangeRate(this.getCurrency(),t).then((function(r){return p(!h(r),'No rate was found for the destination currency "'.concat(t,'".'),TypeError),f.call(n,{amount:A.round(A.multiply(n.getAmount(),parseFloat(r)),m.roundingMode),currency:t})}))},equalsTo:function(t){return this.hasSameAmount(t)&&this.hasSameCurrency(t)},lessThan:function(n){d.call(this,n);var r=t.normalizePrecision([this,n]);return r[0].getAmount()r[1].getAmount()},greaterThanOrEqual:function(n){d.call(this,n);var r=t.normalizePrecision([this,n]);return r[0].getAmount()>=r[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==A.modulo(this.getAmount(),Math.pow(10,i))},hasCents:function(){return 0!==A.modulo(this.getAmount(),Math.pow(10,i))},hasSameCurrency:function(t){return this.getCurrency()===t.getCurrency()},hasSameAmount:function(n){var r=t.normalizePrecision([this,n]);return r[0].getAmount()===r[1].getAmount()},toFormat:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,r=m(t);return this.toRoundedUnit(r.getMinimumFractionDigits(),n).toLocaleString(this.getLocale(),{currencyDisplay:r.getCurrencyDisplay(),useGrouping:r.getUseGrouping(),minimumFractionDigits:r.getMinimumFractionDigits(),style:r.getStyle(),currency:this.getCurrency()})},toUnit:function(){return A.divide(this.getAmount(),Math.pow(10,i))},toRoundedUnit:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,r=Math.pow(10,t);return A.divide(A.round(A.multiply(this.toUnit(),r),n),r)},toObject:function(){return{amount:e,currency:o,precision:i}},toJSON:function(){return this.toObject()}}}),{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},{globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}},u);n.a=M}}]); \ No newline at end of file diff --git a/build/vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--5b8feb0b-frontend.js b/build/vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--5b8feb0b-frontend.js new file mode 100644 index 00000000000..082fd3f8d5e --- /dev/null +++ b/build/vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--5b8feb0b-frontend.js @@ -0,0 +1,3 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{142:function(e,t,o){"use strict";var n=o(8),s=o(0),i=o(4),r=o.n(i);class l extends s.Component{constructor(){super(...arguments),this.onChange=this.onChange.bind(this),this.bindInput=this.bindInput.bind(this)}focus(){this.input.focus()}hasFocus(){return this.input===this.input.ownerDocument.activeElement}bindInput(e){this.input=e}onChange(e){this.props.onChange({value:e.target.value})}render(){const{value:e,isExpanded:t,instanceId:o,selectedSuggestionIndex:i,className:l,...c}=this.props,a=e?e.length+1:0;return Object(s.createElement)("input",Object(n.a)({ref:this.bindInput,id:"components-form-token-input-"+o,type:"text"},c,{value:e||"",onChange:this.onChange,size:a,className:r()(l,"components-form-token-field__input"),autoComplete:"off",role:"combobox","aria-expanded":t,"aria-autocomplete":"list","aria-owns":t?"components-form-token-suggestions-"+o:void 0,"aria-activedescendant":-1!==i?`components-form-token-suggestions-${o}-${i}`:void 0,"aria-describedby":"components-form-token-suggestions-howto-"+o}))}}t.a=l},143:function(e,t,o){"use strict";var n=o(0),s=o(3),i=o(144),r=o.n(i),l=o(4),c=o.n(l),a=o(9);class u extends n.Component{constructor(){super(...arguments),this.handleMouseDown=this.handleMouseDown.bind(this),this.bindList=this.bindList.bind(this)}componentDidUpdate(){this.props.selectedIndex>-1&&this.props.scrollIntoView&&this.list.children[this.props.selectedIndex]&&(this.scrollingIntoView=!0,r()(this.list.children[this.props.selectedIndex],this.list,{onlyScrollIfNeeded:!0}),this.props.setTimeout(()=>{this.scrollingIntoView=!1},100))}bindList(e){this.list=e}handleHover(e){return()=>{this.scrollingIntoView||this.props.onHover(e)}}handleClick(e){return()=>{this.props.onSelect(e)}}handleMouseDown(e){e.preventDefault()}computeSuggestionMatch(e){const t=this.props.displayTransform(this.props.match||"").toLocaleLowerCase();if(0===t.length)return null;const o=(e=this.props.displayTransform(e)).toLocaleLowerCase().indexOf(t);return{suggestionBeforeMatch:e.substring(0,o),suggestionMatch:e.substring(o,o+t.length),suggestionAfterMatch:e.substring(o+t.length)}}render(){return Object(n.createElement)("ul",{ref:this.bindList,className:"components-form-token-field__suggestions-list",id:"components-form-token-suggestions-"+this.props.instanceId,role:"listbox"},Object(s.map)(this.props.suggestions,(e,t)=>{const o=this.computeSuggestionMatch(e),s=c()("components-form-token-field__suggestion",{"is-selected":t===this.props.selectedIndex});return Object(n.createElement)("li",{id:`components-form-token-suggestions-${this.props.instanceId}-${t}`,role:"option",className:s,key:null!=e&&e.value?e.value:this.props.displayTransform(e),onMouseDown:this.handleMouseDown,onClick:this.handleClick(e),onMouseEnter:this.handleHover(e),"aria-selected":t===this.props.selectedIndex},o?Object(n.createElement)("span",{"aria-label":this.props.displayTransform(e)},o.suggestionBeforeMatch,Object(n.createElement)("strong",{className:"components-form-token-field__suggestion-match"},o.suggestionMatch),o.suggestionAfterMatch):this.props.displayTransform(e))}))}}u.defaultProps={match:"",onHover:()=>{},onSelect:()=>{},suggestions:Object.freeze([])},t.a=Object(a.withSafeTimeout)(u)},144:function(e,t,o){"use strict";e.exports=o(202)},202:function(e,t,o){"use strict";var n=o(203);e.exports=function(e,t,o){o=o||{},9===t.nodeType&&(t=n.getWindow(t));var s=o.allowHorizontalScroll,i=o.onlyScrollIfNeeded,r=o.alignWithTop,l=o.alignWithLeft,c=o.offsetTop||0,a=o.offsetLeft||0,u=o.offsetBottom||0,d=o.offsetRight||0;s=void 0===s||s;var p=n.isWindow(t),f=n.offset(e),h=n.outerHeight(e),m=n.outerWidth(e),b=void 0,v=void 0,g=void 0,w=void 0,O=void 0,y=void 0,j=void 0,x=void 0,L=void 0,k=void 0;p?(j=t,k=n.height(j),L=n.width(j),x={left:n.scrollLeft(j),top:n.scrollTop(j)},O={left:f.left-x.left-a,top:f.top-x.top-c},y={left:f.left+m-(x.left+L)+d,top:f.top+h-(x.top+k)+u},w=x):(b=n.offset(t),v=t.clientHeight,g=t.clientWidth,w={left:t.scrollLeft,top:t.scrollTop},O={left:f.left-(b.left+(parseFloat(n.css(t,"borderLeftWidth"))||0))-a,top:f.top-(b.top+(parseFloat(n.css(t,"borderTopWidth"))||0))-c},y={left:f.left+m-(b.left+g+(parseFloat(n.css(t,"borderRightWidth"))||0))+d,top:f.top+h-(b.top+v+(parseFloat(n.css(t,"borderBottomWidth"))||0))+u}),O.top<0||y.top>0?!0===r?n.scrollTop(t,w.top+O.top):!1===r?n.scrollTop(t,w.top+y.top):O.top<0?n.scrollTop(t,w.top+O.top):n.scrollTop(t,w.top+y.top):i||((r=void 0===r||!!r)?n.scrollTop(t,w.top+O.top):n.scrollTop(t,w.top+y.top)),s&&(O.left<0||y.left>0?!0===l?n.scrollLeft(t,w.left+O.left):!1===l?n.scrollLeft(t,w.left+y.left):O.left<0?n.scrollLeft(t,w.left+O.left):n.scrollLeft(t,w.left+y.left):i||((l=void 0===l||!!l)?n.scrollLeft(t,w.left+O.left):n.scrollLeft(t,w.left+y.left)))}},203:function(e,t,o){"use strict";var n=Object.assign||function(e){for(var t=1;tt=>{const[o,s]=Object(n.useState)(),i=Object(n.useCallback)(e=>s(()=>null!=e&&e.handleFocusOutside?e.handleFocusOutside.bind(e):void 0),[]);return Object(n.createElement)("div",Object(c.__experimentalUseFocusOutside)(o),Object(n.createElement)(e,Object(j.a)({ref:i},t)))},"withFocusOutside")(class extends n.Component{handleFocusOutside(e){this.props.onFocusOutside(e)}render(){return this.props.children}});t.a=function e({value:t,label:o,options:s,onChange:v,onFilterValueChange:g=r.noop,hideLabelFromVision:w,help:j,allowReset:L=!0,className:k,messages:E={selected:Object(l.__)("Item selected.")}}){var S;const T=Object(c.useInstanceId)(e),[C,I]=Object(n.useState)(null),[W,_]=Object(n.useState)(!1),[F,M]=Object(n.useState)(!1),[N,D]=Object(n.useState)(""),H=Object(n.useRef)(),B=s.find(e=>e.value===t),P=null!==(S=null==B?void 0:B.label)&&void 0!==S?S:"",V=Object(n.useMemo)(()=>{const e=[],t=[],o=Object(r.deburr)(N.toLocaleLowerCase());return s.forEach(n=>{const s=Object(r.deburr)(n.label).toLocaleLowerCase().indexOf(o);0===s?e.push(n):s>0&&t.push(n)}),e.concat(t)},[N,s,t]),R=e=>{v(e.value),Object(u.speak)(E.selected,"assertive"),I(e),D(""),_(!1)},$=(e=1)=>{let t=V.indexOf(C)+e;t<0?t=V.length-1:t>=V.length&&(t=0),I(V[t]),_(!0)};return Object(n.useEffect)(()=>{const e=V.length>0;if(W){const t=e?Object(l.sprintf)( +/* translators: %d: number of results. */ +Object(l._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",V.length),V.length):Object(l.__)("No results.");Object(u.speak)(t,"polite")}},[V,W]),Object(n.createElement)(x,{onFocusOutside:()=>{_(!1)}},Object(n.createElement)(h.a,{className:i()(k,"components-combobox-control"),tabIndex:"-1",label:o,id:"components-form-token-input-"+T,hideLabelFromVision:w,help:j},Object(n.createElement)("div",{className:"components-combobox-control__suggestions-container",tabIndex:"-1",onKeyDown:e=>{let t=!1;switch(e.keyCode){case a.ENTER:C&&(R(C),t=!0);break;case a.UP:$(-1),t=!0;break;case a.DOWN:$(1),t=!0;break;case a.ESCAPE:_(!1),I(null),t=!0,e.stopPropagation()}t&&e.preventDefault()}},Object(n.createElement)(b.a,null,Object(n.createElement)(O,null,Object(n.createElement)(p.a,{className:"components-combobox-control__input",instanceId:T,ref:H,value:W?N:P,"aria-label":P?`${P}, ${o}`:null,onFocus:()=>{M(!0),_(!0),g(""),D("")},onBlur:()=>{M(!1)},isExpanded:W,selectedSuggestionIndex:V.indexOf(C),onChange:e=>{const t=e.value;D(t),g(t),F&&_(!0)}})),L&&Object(n.createElement)(y.a,null,Object(n.createElement)(m.a,{className:"components-combobox-control__reset",icon:d.a,disabled:!t,onClick:()=>{v(null),H.current.input.focus()},label:Object(l.__)("Reset")}))),W&&Object(n.createElement)(f.a,{instanceId:T,match:{label:N},displayTransform:e=>e.label,suggestions:V,selectedIndex:V.indexOf(C),onHover:I,onSelect:R,scrollIntoView:!0}))))}}}]); \ No newline at end of file diff --git a/build/vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--decc3dc6-frontend.js b/build/vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--decc3dc6-frontend.js new file mode 100644 index 00000000000..ff1edcb36fc --- /dev/null +++ b/build/vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--decc3dc6-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{273:function(e,t,r){"use strict";r.d(t,"a",(function(){return g})),r.d(t,"b",(function(){return l})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return s})),r.d(t,"e",(function(){return d})),r.d(t,"f",(function(){return u}));var n=r(5),a=r(299),i=(r(8),r(307),r(325),r(324)),o=r(294),s={}.hasOwnProperty,c=Object(n.createContext)("undefined"!=typeof HTMLElement?Object(a.a)({key:"css"}):null);c.Provider;var u=function(e){return Object(n.forwardRef)((function(t,r){var a=Object(n.useContext)(c);return e(t,a,r)}))},l=Object(n.createContext)({}),f=n.useInsertionEffect?n.useInsertionEffect:function(e){e()};function d(e){f(e)}var h="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",p=function(e,t){var r={};for(var n in t)s.call(t,n)&&(r[n]=t[n]);return r[h]=e,r},m=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return Object(i.c)(t,r,n),d((function(){return Object(i.b)(t,r,n)})),null},g=u((function(e,t,r){var a=e.css;"string"==typeof a&&void 0!==t.registered[a]&&(a=t.registered[a]);var c=e[h],u=[a],f="";"string"==typeof e.className?f=Object(i.a)(t.registered,u,e.className):null!=e.className&&(f=e.className+" ");var d=Object(o.a)(u,void 0,Object(n.useContext)(l));f+=t.key+"-"+d.name;var p={};for(var g in e)s.call(e,g)&&"css"!==g&&g!==h&&(p[g]=e[g]);return p.ref=r,p.className=f,Object(n.createElement)(n.Fragment,null,Object(n.createElement)(m,{cache:t,serialized:d,isStringTag:"string"==typeof c}),Object(n.createElement)(c,p))}))},281:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f}));var n=r(299),a=r(294);function i(e,t,r){var n="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]+";"):n+=r+" "})),n}var o=function(e,t,r){var n=e.key+"-"+t.name;if(!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles),void 0===e.inserted[t.name]){var a=t;do{e.insert(t===a?"."+n:"",a,e.sheet,!0),a=a.next}while(void 0!==a)}};function s(e,t){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0)}function c(e,t,r){var n=[],a=i(e,n,r);return n.length<2?r:a+t(n)}var u=function e(t){for(var r="",n=0;n=4;++n,a-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(a){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)},a={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},i=r(306),o=/[A-Z]|^ms/g,s=/_EMO_([^_]+?)_([^]*?)_EMO_/g,c=function(e){return 45===e.charCodeAt(1)},u=function(e){return null!=e&&"boolean"!=typeof e},l=Object(i.a)((function(e){return c(e)?e:e.replace(o,"-$&").toLowerCase()})),f=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(s,(function(e,t,r){return h={name:t,styles:r,next:h},t}))}return 1===a[e]||c(e)||"number"!=typeof t||0===t?t:t+"px"};function d(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return h={name:r.name,styles:r.styles,next:h},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)h={name:n.name,styles:n.styles,next:h},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var a=0;a0?b(S,--A):0,w--,10===j&&(w=1,k--),j}function E(){return j=A2||T(j)>3?"":" "}function L(e,t){for(;--t&&E()&&!(j<48||j>102||j>57&&j<65||j>70&&j<97););return N(e,F()+(t<6&&32==P()&&32==E()))}function D(e,t){for(;E()&&e+j!==57&&(e+j!==84||47!==P()););return"/*"+N(t,A-1)+"*"+d(47===e?e:E())}function q(e){for(;!T(P());)E();return N(e,A)}function G(e,t,r,n,a,i,o,s,u,l,d){for(var h=a-1,g=0===a?i:[""],b=x(g),v=0,_=0,k=0;v0?g[w]+" "+O:m(O,/&\f/g,g[w])))&&(u[k++]=A);return C(e,t,r,0===a?c:s,u,l,d)}function B(e,t,r){return C(e,t,r,s,d(j),y(e,2,-2),0)}function U(e,t,r,n){return C(e,t,r,u,y(e,0,n),y(e,n+1,-1),n)}function W(e,t){for(var r="",n=x(e),a=0;a-1&&!e.return)switch(e.type){case u:e.return=function e(t,r){switch(function(e,t){return(((t<<2^b(e,0))<<2^b(e,1))<<2^b(e,2))<<2^b(e,3)}(t,r)){case 5103:return o+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return o+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return o+t+i+t+a+t+t;case 6828:case 4268:return o+t+a+t+t;case 6165:return o+t+a+"flex-"+t+t;case 5187:return o+t+m(t,/(\w+).+(:[^]+)/,o+"box-$1$2"+a+"flex-$1$2")+t;case 5443:return o+t+a+"flex-item-"+m(t,/flex-|-self/,"")+t;case 4675:return o+t+a+"flex-line-pack"+m(t,/align-content|flex-|-self/,"")+t;case 5548:return o+t+a+m(t,"shrink","negative")+t;case 5292:return o+t+a+m(t,"basis","preferred-size")+t;case 6060:return o+"box-"+m(t,"-grow","")+o+t+a+m(t,"grow","positive")+t;case 4554:return o+m(t,/([^-])(transform)/g,"$1"+o+"$2")+t;case 6187:return m(m(m(t,/(zoom-|grab)/,o+"$1"),/(image-set)/,o+"$1"),t,"")+t;case 5495:case 3959:return m(t,/(image-set\([^]*)/,o+"$1$`$1");case 4968:return m(m(t,/(.+:)(flex-)?(.*)/,o+"box-pack:$3"+a+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+o+t+t;case 4095:case 3583:case 4068:case 2532:return m(t,/(.+)-inline(.+)/,o+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(v(t)-1-r>6)switch(b(t,r+1)){case 109:if(45!==b(t,r+4))break;case 102:return m(t,/(.+:)(.+)-([^]+)/,"$1"+o+"$2-$3$1"+i+(108==b(t,r+3)?"$3":"$2-$3"))+t;case 115:return~g(t,"stretch")?e(m(t,"stretch","fill-available"),r)+t:t}break;case 4949:if(115!==b(t,r+1))break;case 6444:switch(b(t,v(t)-3-(~g(t,"!important")&&10))){case 107:return m(t,":",":"+o)+t;case 101:return m(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+o+(45===b(t,14)?"inline-":"")+"box$3$1"+o+"$2$3$1"+a+"$2box$3")+t}break;case 5936:switch(b(t,r+11)){case 114:return o+t+a+m(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return o+t+a+m(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return o+t+a+m(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return o+t+a+t+t}return t}(e.value,e.length);break;case l:return W([$(e,{value:m(e.value,"@","@"+o)})],n);case c:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return W([$(e,{props:[m(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return W([$(e,{props:[m(t,/:(plac\w+)/,":"+o+"input-$1")]}),$(e,{props:[m(t,/:(plac\w+)/,":-moz-$1")]}),$(e,{props:[m(t,/:(plac\w+)/,a+"input-$1")]})],n)}return""}))}}];t.a=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var a,i,o=e.stylisPlugins||Q,s={},c=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r0&&v($)-h&&_(b>32?U($+";",a,n,h-1):U(m($," ","")+";",a,n,h-2),u);break;case 59:$+=";";default:if(_(C=G($,r,n,l,f,i,c,A,j=[],S=[],h),o),123===O)if(0===f)e($,r,C,C,j,o,h,c,S);else switch(p){case 100:case 109:case 115:e(t,C,C,a&&_(G(t,C,C,0,0,i,c,A,i,j=[],h),S),i,S,h,c,a?j:S);break;default:e($,C,C,C,[""],S,0,c,S)}}l=f=b=0,x=w=1,A=$="",h=s;break;case 58:h=1+v($),b=y;default:if(x<1)if(123==O)--x;else if(125==O&&0==x++&&125==R())continue;switch($+=d(O),O*x){case 38:w=f>0?1:($+="\f",-1);break;case 44:c[l++]=(v($)-1)*w,w=1;break;case 64:45===P()&&($+=H(E())),p=P(),f=h=v(A=$+=q(F())),O++;break;case 45:45===y&&2==v($)&&(x=0)}}return o}("",null,null,null,[""],e=M(e),0,[0],e))}(e?e+"{"+t.styles+"}":t.styles),h),n&&(p.inserted[t.name]=!0)};var p={key:t,sheet:new n({key:t,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:i};return p.sheet.hydrate(c),p}},300:function(e,t,r){"use strict";var n=r(8),a=r(5),i=r(306),o=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,s=Object(i.a)((function(e){return o.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),c=r(273);function u(e,t,r){var n="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]+";"):n+=r+" "})),n}var l=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},f=r(294),d=s,h=function(e){return"theme"!==e},p=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?d:h},m=function(e,t,r){var n;if(t){var a=t.shouldForwardProp;n=e.__emotion_forwardProp&&a?function(t){return e.__emotion_forwardProp(t)&&a(t)}:a}return"function"!=typeof n&&r&&(n=e.__emotion_forwardProp),n},g=a.useInsertionEffect?a.useInsertionEffect:function(e){e()},b=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return l(t,r,n),g((function(){return function(e,t,r){l(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do{e.insert(t===a?"."+n:"",a,e.sheet,!0),a=a.next}while(void 0!==a)}}(t,r,n)})),null};t.a=function e(t,r){var i,o,s=t.__emotion_real===t,l=s&&t.__emotion_base||t;void 0!==r&&(i=r.label,o=r.target);var d=m(t,r,s),h=d||p(l),g=!h("as");return function(){var y=arguments,v=s&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==i&&v.push("label:"+i+";"),null==y[0]||void 0===y[0].raw)v.push.apply(v,y);else{v.push(y[0][0]);for(var x=y.length,_=1;_1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=F(e,360),t=F(t,100),r=F(r,100),0===t)n=a=i=r;else{var s=r<.5?r*(1+t):r+t-r*t,c=2*r-s;n=o(c,s,e+1/3),a=o(c,s,e),i=o(c,s,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,f,h),p=!0,m="hsl"),e.hasOwnProperty("a")&&(c=e.a)),c=P(c),{ok:p,format:e.format||m,r:u(255,l(s.r,0)),g:u(255,l(s.g,0)),b:u(255,l(s.b,0)),a:c}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=c(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=c(this._r)),this._g<1&&(this._g=c(this._g)),this._b<1&&(this._b=c(this._b)),this._ok=r.ok,this._tc_id=s++}function h(e,t,r){e=F(e,255),t=F(t,255),r=F(r,255);var n,a,i=l(e,t,r),o=u(e,t,r),s=(i+o)/2;if(i==o)n=a=0;else{var c=i-o;switch(a=s>.5?c/(2-i-o):c/(i+o),i){case e:n=(t-r)/c+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(d(n));return i}function $(e,t){t=t||6;for(var r=d(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/t;t--;)o.push(d({h:n,s:a,v:i})),i=(i+s)%1;return o}d.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,r=n.b/255,.2126*(e<=.03928?e/12.92:a.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:a.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:a.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=P(e),this._roundA=c(100*this._a)/100,this},toHsv:function(){var e=p(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=p(this._r,this._g,this._b),t=c(360*e.h),r=c(100*e.s),n=c(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=h(this._r,this._g,this._b),t=c(360*e.h),r=c(100*e.s),n=c(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return m(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var i=[M(c(e).toString(16)),M(c(t).toString(16)),M(c(r).toString(16)),M(H(n))];return a&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:c(this._r),g:c(this._g),b:c(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+c(this._r)+", "+c(this._g)+", "+c(this._b)+")":"rgba("+c(this._r)+", "+c(this._g)+", "+c(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:c(100*F(this._r,255))+"%",g:c(100*F(this._g,255))+"%",b:c(100*F(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+c(100*F(this._r,255))+"%, "+c(100*F(this._g,255))+"%, "+c(100*F(this._b,255))+"%)":"rgba("+c(100*F(this._r,255))+"%, "+c(100*F(this._g,255))+"%, "+c(100*F(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[m(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+g(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=d(e);r="#"+g(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return d(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(x,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(k,arguments)},desaturate:function(){return this._applyModification(b,arguments)},saturate:function(){return this._applyModification(y,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(w,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(C,arguments)},complement:function(){return this._applyCombination(O,arguments)},monochromatic:function(){return this._applyCombination($,arguments)},splitcomplement:function(){return this._applyCombination(S,arguments)},triad:function(){return this._applyCombination(A,arguments)},tetrad:function(){return this._applyCombination(j,arguments)}},d.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:z(e[n]));e=r}return d(e,t)},d.equals=function(e,t){return!(!e||!t)&&d(e).toRgbString()==d(t).toRgbString()},d.random=function(){return d.fromRatio({r:f(),g:f(),b:f()})},d.mix=function(e,t,r){r=0===r?0:r||50;var n=d(e).toRgb(),a=d(t).toRgb(),i=r/100;return d({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},d.readability=function(e,t){var r=d(e),n=d(t);return(a.max(r.getLuminance(),n.getLuminance())+.05)/(a.min(r.getLuminance(),n.getLuminance())+.05)},d.isReadable=function(e,t,r){var n,a,i,o,s,c=d.readability(e,t);switch(a=!1,(i=r,"AA"!==(o=((i=i||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==o&&(o="AA"),"small"!==(s=(i.size||"small").toLowerCase())&&"large"!==s&&(s="small"),n={level:o,size:s}).level+n.size){case"AAsmall":case"AAAlarge":a=c>=4.5;break;case"AAlarge":a=c>=3;break;case"AAAsmall":a=c>=7}return a},d.mostReadable=function(e,t,r){var n,a,i,o,s=null,c=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;uc&&(c=n,s=d(t[u]));return d.isReadable(e,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,d.mostReadable(e,["#fff","#000"],r))};var R=d.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},E=d.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(R);function P(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function F(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=u(t,l(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),a.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function N(e){return u(1,l(0,e))}function T(e){return parseInt(e,16)}function M(e){return 1==e.length?"0"+e:""+e}function z(e){return e<=1&&(e=100*e+"%"),e}function H(e){return a.round(255*parseFloat(e)).toString(16)}function I(e){return T(e)/255}var L,D,q,G=(D="[\\s|\\(]+("+(L="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+L+")[,|\\s]+("+L+")\\s*\\)?",q="[\\s|\\(]+("+L+")[,|\\s]+("+L+")[,|\\s]+("+L+")[,|\\s]+("+L+")\\s*\\)?",{CSS_UNIT:new RegExp(L),rgb:new RegExp("rgb"+D),rgba:new RegExp("rgba"+q),hsl:new RegExp("hsl"+D),hsla:new RegExp("hsla"+q),hsv:new RegExp("hsv"+D),hsva:new RegExp("hsva"+q),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function B(e){return!!G.CSS_UNIT.exec(e)}e.exports?e.exports=d:void 0===(n=function(){return d}.call(t,r,t,e))||(e.exports=n)}(Math)},328:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i}));const n="data-wp-component",a="data-wp-c16t",i="__contextSystemKey__"},329:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(3),a=r(308);const i=r.n(a)()((function(e){return"components-"+Object(n.kebabCase)(e)}))},330:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return i})),r.d(t,"e",(function(){return o})),r.d(t,"c",(function(){return s})),r.d(t,"d",(function(){return c}));var n=r(281);const a=Object(n.a)({name:"zjik7",styles:"display:flex"}),i=Object(n.a)({name:"qgaee5",styles:"display:block;max-height:100%;max-width:100%;min-height:0;min-width:0"}),o=Object(n.a)({name:"82a6rk",styles:"flex:1"}),s=Object(n.a)({name:"13nosa1",styles:">*{min-height:0;}"}),c=Object(n.a)({name:"1pwxzk4",styles:">*{min-width:0;}"})},331:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return i}));var n=r(0);const a=Object(n.createContext)({flexItemDisplay:void 0}),i=()=>Object(n.useContext)(a)},344:function(e,t,r){"use strict";var n=r(0),a=r(4),i=r.n(a),o=r(34),s=r(300),c=r(3),u={"default.fontFamily":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif","default.fontSize":"13px","helpText.fontSize":"12px",mobileTextMinFontSize:"16px"};function l(e){return Object(c.get)(u,e,"")}var f=r(397),d=r(296);const h=Object(s.a)("div",{target:"e1puf3u3"})("font-family:",l("default.fontFamily"),";font-size:",l("default.fontSize"),";"),p=Object(s.a)("div",{target:"e1puf3u2"})("margin-bottom:",Object(d.a)(2),";.components-panel__row &{margin-bottom:inherit;}"),m=Object(s.a)("label",{target:"e1puf3u1"})("display:inline-block;margin-bottom:",Object(d.a)(2),";"),g=Object(s.a)("p",{target:"e1puf3u0"})("font-size:",l("helpText.fontSize"),";font-style:normal;color:",f.a.mediumGray.text,";");function b({id:e,label:t,hideLabelFromVision:r,help:a,className:s,children:c}){return Object(n.createElement)(h,{className:i()("components-base-control",s)},Object(n.createElement)(p,{className:"components-base-control__field"},t&&e&&(r?Object(n.createElement)(o.a,{as:"label",htmlFor:e},t):Object(n.createElement)(m,{className:"components-base-control__label",htmlFor:e},t)),t&&!e&&(r?Object(n.createElement)(o.a,{as:"label"},t):Object(n.createElement)(b.VisualLabel,null,t)),c),!!a&&Object(n.createElement)(g,{id:e+"__help",className:"components-base-control__help"},a))}b.VisualLabel=({className:e,children:t})=>(e=i()("components-base-control__label",e),Object(n.createElement)("span",{className:e},t)),t.a=b},364:function(e,t,r){"use strict";e.exports=r(365)},365:function(e,t,r){"use strict";var n="function"==typeof Symbol&&Symbol.for,a=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,c=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,f=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,h=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,b=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,x=n?Symbol.for("react.responder"):60118,_=n?Symbol.for("react.scope"):60119;function k(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case f:case d:case o:case c:case s:case p:return e;default:switch(e=e&&e.$$typeof){case l:case h:case b:case g:case u:return e;default:return t}}case i:return t}}}function w(e){return k(e)===d}t.AsyncMode=f,t.ConcurrentMode=d,t.ContextConsumer=l,t.ContextProvider=u,t.Element=a,t.ForwardRef=h,t.Fragment=o,t.Lazy=b,t.Memo=g,t.Portal=i,t.Profiler=c,t.StrictMode=s,t.Suspense=p,t.isAsyncMode=function(e){return w(e)||k(e)===f},t.isConcurrentMode=w,t.isContextConsumer=function(e){return k(e)===l},t.isContextProvider=function(e){return k(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},t.isForwardRef=function(e){return k(e)===h},t.isFragment=function(e){return k(e)===o},t.isLazy=function(e){return k(e)===b},t.isMemo=function(e){return k(e)===g},t.isPortal=function(e){return k(e)===i},t.isProfiler=function(e){return k(e)===c},t.isStrictMode=function(e){return k(e)===s},t.isSuspense=function(e){return k(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===c||e===s||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===g||e.$$typeof===u||e.$$typeof===l||e.$$typeof===h||e.$$typeof===v||e.$$typeof===x||e.$$typeof===_||e.$$typeof===y)},t.typeOf=k},366:function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return o}));var n=r(0),a=r(3);r(37);const i=Object(n.createContext)({}),o=()=>Object(n.useContext)(i);function s({value:t}){const r=o(),i=Object(n.useRef)(t);return function(r,o){const s=Object(n.useRef)(!1);Object(n.useEffect)(()=>{s.current?Object(a.isEqual)(i.current,t)&&i.current!==t&&void 0!==e&&e.env:s.current=!0},o)}(0,[t]),Object(n.useMemo)(()=>Object(a.merge)(Object(a.cloneDeep)(r),t),[r,t])}Object(n.memo)(({children:e,value:t})=>{const r=s({value:t});return Object(n.createElement)(i.Provider,{value:r},e)})}).call(this,r(55))},367:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));var n=r(328);function a(e){return{[n.a]:e}}function i(){return{[n.b]:!0}}},369:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(281),a=r(410),i=r(331),o=r(330);function s(e){const{className:t,display:r,isBlock:s=!1,...c}=Object(a.a)(e,"FlexItem"),u={},l=Object(i.b)().flexItemDisplay;return u.Base=Object(n.a)({display:r||l},"",""),{...c,className:Object(n.b)(o.b,u.Base,s&&o.e,t)}}},397:function(e,t,r){"use strict";r.d(t,"a",(function(){return b}));var n=r(3),a=r(327),i=r.n(a);function o(e="",t=1){const{r:r,g:n,b:a}=i()(e).toRgb();return`rgba(${r}, ${n}, ${a}, ${t})`}const s={black:"#000",white:"#fff"},c={blue:{medium:{focus:"#007cba",focusDark:"#fff"}},gray:{900:"#1e1e1e",700:"#757575",600:"#949494",400:"#ccc",200:"#ddd",100:"#f0f0f0"},darkGray:{primary:"#1e1e1e",heading:"#050505"},mediumGray:{text:"#757575"},lightGray:{ui:"#949494",secondary:"#ccc",tertiary:"#e7e8e9"}},u={900:"#191e23",800:"#23282d",700:"#32373c",600:"#40464d",500:"#555d66",400:"#606a73",300:"#6c7781",200:"#7e8993",150:"#8d96a0",100:"#8f98a1",placeholder:o(c.gray[900],.62)},l={900:o("#000510",.9),800:o("#00000a",.85),700:o("#06060b",.8),600:o("#000913",.75),500:o("#0a1829",.7),400:o("#0a1829",.65),300:o("#0e1c2e",.62),200:o("#162435",.55),100:o("#223443",.5),backgroundFill:o(u[700],.7)},f={900:o("#304455",.45),800:o("#425863",.4),700:o("#667886",.35),600:o("#7b86a2",.3),500:o("#9197a2",.25),400:o("#95959c",.2),300:o("#829493",.15),200:o("#8b8b96",.1),100:o("#747474",.05)},d={900:"#a2aab2",800:"#b5bcc2",700:"#ccd0d4",600:"#d7dade",500:"#e2e4e7",400:"#e8eaeb",300:"#edeff0",200:"#f3f4f5",100:"#f8f9f9",placeholder:o(s.white,.65)},h={900:o(s.white,.5),800:o(s.white,.45),700:o(s.white,.4),600:o(s.white,.35),500:o(s.white,.3),400:o(s.white,.25),300:o(s.white,.2),200:o(s.white,.15),100:o(s.white,.1),backgroundFill:o(d[300],.8)},p={wordpress:{700:"#00669b"},dark:{900:"#0071a1"},medium:{900:"#006589",800:"#00739c",700:"#007fac",600:"#008dbe",500:"#00a0d2",400:"#33b3db",300:"#66c6e4",200:"#bfe7f3",100:"#e5f5fa",highlight:"#b3e7fe",focus:"#007cba"}},m={theme:`var( --wp-admin-theme-color, ${p.wordpress[700]})`,themeDark10:`var( --wp-admin-theme-color-darker-10, ${p.medium.focus})`},g={theme:m.theme,background:s.white,backgroundDisabled:d[200],border:c.gray[700],borderFocus:m.themeDark10,borderDisabled:c.gray[400],borderLight:c.gray[200],label:u[500],textDisabled:u[150],textDark:s.white,textLight:s.black},b={...s,darkGray:Object(n.merge)({},u,c.darkGray),darkOpacity:l,darkOpacityLight:f,mediumGray:c.mediumGray,gray:c.gray,lightGray:Object(n.merge)({},d,c.lightGray),lightGrayLight:h,blue:Object(n.merge)({},p,c.blue),alert:{yellow:"#f0b849",red:"#d94f4f",green:"#4ab866"},admin:m,ui:g}},410:function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return s}));var n=r(281),a=(r(37),r(366)),i=r(367),o=r(329);function s(t,r){const s=Object(a.a)();void 0===r&&void 0!==e&&e.env;const c=(null==s?void 0:s[r])||{},u={...Object(i.a)(),...Object(i.b)(r)},{_overrides:l,...f}=c,d=Object.entries(f).length?Object.assign({},f,t):t,h=Object(n.b)(Object(o.a)(r),t.className),p="function"==typeof d.renderChildren?d.renderChildren(d):d.children;for(const e in d)u[e]=d[e];for(const e in l)u[e]=l[e];return u.children=p,u.className=h,u}}).call(this,r(55))},411:function(e,t,r){"use strict";var n=r(300);const a=Object(n.a)("div",{target:"em57xhy0"})("");a.selector=".components-view",a.displayName="View",t.a=a},412:function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(3),a=r(0),i=(r(37),r(328)),o=r(329);function s(t,r,s={}){const{memo:c=!1}=s;let u=Object(a.forwardRef)(t);c&&(u=Object(a.memo)(u)),void 0===r&&void 0!==e&&e.env;let l=u[i.c]||[r];return Array.isArray(r)&&(l=[...l,...r]),"string"==typeof r&&(l=[...l,r]),u.displayName=r,u[i.c]=Object(n.uniq)(l),u.selector="."+Object(o.a)(r),u}function c(e){if(!e)return[];let t=[];return e[i.c]&&(t=e[i.c]),e.type&&e.type[i.c]&&(t=e.type[i.c]),t}function u(e,t){return!!e&&("string"==typeof t?c(e).includes(t):!!Array.isArray(t)&&t.some(t=>c(e).includes(t)))}}).call(this,r(55))},413:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(8),a=r(0),i=r(412),o=r(411);const s=({as:e,name:t,useHook:r,memo:s=!1})=>{function c(t,i){const s=r(t);return Object(a.createElement)(o.a,Object(n.a)({as:e||"div"},s,{ref:i}))}return c.displayName=t,Object(i.a)(c,t,{memo:s})}},414:function(e,t,r){"use strict";var n=r(413),a=r(369);const i=Object(n.a)({as:"div",useHook:a.a,name:"FlexItem"});t.a=i},448:function(e,t,r){"use strict";var n=r(8),a=r(0),i=r(412),o=r(281),s=r(25),c=r.n(s),u=r(410);const l=["40em","52em","64em"];var f=r(296),d=r(330);function h(e){const{align:t="center",className:r,direction:n="row",expanded:i=!0,gap:s=2,justify:h="space-between",wrap:p=!1,...m}=Object(u.a)(function({isReversed:e,...t}){return void 0!==e?(c()("Flex isReversed",{alternative:'Flex direction="row-reverse" or "column-reverse"',since:"5.9"}),{...t,direction:e?"row-reverse":"row"}):t}(e),"Flex"),g=function(e,t={}){const r=((e={})=>{const{defaultIndex:t=0}=e;if("number"!=typeof t)throw new TypeError(`Default breakpoint index should be a number. Got: ${t}, ${typeof t}`);if(t<0||t>l.length-1)throw new RangeError(`Default breakpoint index out of range. Theme has ${l.length} breakpoints, got index ${t}`);const[r,n]=Object(a.useState)(t);return Object(a.useEffect)(()=>{const e=()=>{const e=l.filter(e=>"undefined"!=typeof window&&window.matchMedia(`screen and (min-width: ${e})`).matches).length;r!==e&&n(e)};return e(),"undefined"!=typeof document&&document.addEventListener("resize",e),()=>{"undefined"!=typeof document&&document.removeEventListener("resize",e)}},[r]),r})(t);if(!Array.isArray(e)&&"function"!=typeof e)return e;const n=e||[];return n[r>=n.length?n.length-1:r]}(Array.isArray(n)?n:[n]),b="string"==typeof g&&!!g.includes("column"),y="string"==typeof g&&g.includes("reverse");return{...m,className:Object(a.useMemo)(()=>{const e={};return e.Base=Object(o.a)({alignItems:b?"normal":t,flexDirection:g,flexWrap:p?"wrap":void 0,justifyContent:h,height:b&&i?"100%":void 0,width:!b&&i?"100%":void 0,marginBottom:p?`calc(${Object(f.a)(s)} * -1)`:void 0},"",""),e.Items=Object(o.a)({"> * + *:not(marquee)":{marginTop:b?Object(f.a)(s):void 0,marginRight:!b&&y?Object(f.a)(s):void 0,marginLeft:b||y?void 0:Object(f.a)(s)}},"",""),e.WrapItems=Object(o.a)({"> *:not(marquee)":{marginBottom:Object(f.a)(s),marginLeft:!b&&y?Object(f.a)(s):void 0,marginRight:b||y?void 0:Object(f.a)(s)},"> *:last-child:not(marquee)":{marginLeft:!b&&y?0:void 0,marginRight:b||y?void 0:0}},"",""),Object(o.b)(d.a,e.Base,p?e.WrapItems:e.Items,b?d.c:d.d,r)},[t,r,g,i,s,b,y,h,p]),isColumn:b}}var p=r(331),m=r(411);const g=Object(i.a)((function(e,t){const{children:r,isColumn:i,...o}=h(e);return Object(a.createElement)(p.a.Provider,{value:{flexItemDisplay:i?"block":void 0}},Object(a.createElement)(m.a,Object(n.a)({},o,{ref:t}),r))}),"Flex");t.a=g}}]); \ No newline at end of file diff --git a/build/vendors--mini-cart-contents-block/footer-frontend.js b/build/vendors--mini-cart-contents-block/footer-frontend.js new file mode 100644 index 00000000000..84f29f931cb --- /dev/null +++ b/build/vendors--mini-cart-contents-block/footer-frontend.js @@ -0,0 +1 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[73],{24:function(e,t,n){"use strict";(function(e){var r=n(0);n(37);const o=Object(r.createContext)({slots:{},fills:{},registerSlot:()=>{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,n(55))},34:function(e,t,n){"use strict";var r=n(4),o=n.n(r),i=n(0);t.a=Object(i.forwardRef)((function({as:e="div",className:t,...n},r){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(i.createElement)(e,t)}({as:e,className:o()("components-visually-hidden",t),...n,ref:r})}))},38:function(e,t,n){"use strict";var r=n(8),o=n(0),i=n(13),c=function({icon:e,className:t,...n}){const i=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(o.createElement)("span",Object(r.a)({className:i},n))};t.a=function({icon:e=null,size:t=24,...n}){if("string"==typeof e)return Object(o.createElement)(c,Object(r.a)({icon:e},n));if(Object(o.isValidElement)(e)&&c===e.type)return Object(o.cloneElement)(e,{...n});if("function"==typeof e)return e.prototype instanceof o.Component?Object(o.createElement)(e,{size:t,...n}):e({size:t,...n});if(e&&("svg"===e.type||e.type===i.SVG)){const r={width:t,height:t,...e.props,...n};return Object(o.createElement)(i.SVG,r)}return Object(o.isValidElement)(e)?Object(o.cloneElement)(e,{size:t,...n}):e}},42:function(e,t,n){"use strict";var r=n(8),o=n(0),i=n(4),c=n.n(i),s=n(3),l=n(25),a=n.n(l),u=n(9),d=n(44),p=n(71),f=n(1);function m(e,t,n){const{defaultView:r}=t,{frameElement:o}=r;if(!o||t===n.ownerDocument)return e;const i=o.getBoundingClientRect();return new r.DOMRect(e.left+i.left,e.top+i.top,e.width,e.height)}let b=0;function h(e){const t=document.scrollingElement||document.body;e&&(b=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=b)}let g=0;function O(){return Object(o.useEffect)(()=>(0===g&&h(!0),++g,()=>{1===g&&h(!1),--g}),[]),null}var v=n(24);function j(e){const t=Object(o.useContext)(v.a),n=t.slots[e]||{},r=t.fills[e],i=Object(o.useMemo)(()=>r||[],[r]);return{...n,updateSlot:Object(o.useCallback)(n=>{t.updateSlot(e,n)},[e,t.updateSlot]),unregisterSlot:Object(o.useCallback)(n=>{t.unregisterSlot(e,n)},[e,t.unregisterSlot]),fills:i,registerFill:Object(o.useCallback)(n=>{t.registerFill(e,n)},[e,t.registerFill]),unregisterFill:Object(o.useCallback)(n=>{t.unregisterFill(e,n)},[e,t.unregisterFill])}}var w=Object(o.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function E({name:e,children:t,registerFill:n,unregisterFill:r}){const i=(e=>{const{getSlot:t,subscribe:n}=Object(o.useContext)(w),[r,i]=Object(o.useState)(t(e));return Object(o.useEffect)(()=>(i(t(e)),n(()=>{i(t(e))})),[e]),r})(e),c=Object(o.useRef)({name:e,children:t});return Object(o.useLayoutEffect)(()=>(n(e,c.current),()=>r(e,c.current)),[]),Object(o.useLayoutEffect)(()=>{c.current.children=t,i&&i.forceUpdate()},[t]),Object(o.useLayoutEffect)(()=>{e!==c.current.name&&(r(c.current.name,c.current),c.current.name=e,n(e,c.current))},[e]),i&&i.node?(Object(s.isFunction)(t)&&(t=t(i.props.fillProps)),Object(o.createPortal)(t,i.node)):null}var y=e=>Object(o.createElement)(w.Consumer,null,({registerFill:t,unregisterFill:n})=>Object(o.createElement)(E,Object(r.a)({},e,{registerFill:t,unregisterFill:n})));class L extends o.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:n,registerSlot:r}=this.props;e.name!==t&&(n(e.name),r(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:n={},getFills:r}=this.props,i=Object(s.map)(r(t,this),e=>{const t=Object(s.isFunction)(e.children)?e.children(n):e.children;return o.Children.map(t,(e,t)=>{if(!e||Object(s.isString)(e))return e;const n=e.key||t;return Object(o.cloneElement)(e,{key:n})})}).filter(Object(s.negate)(o.isEmptyElement));return Object(o.createElement)(o.Fragment,null,Object(s.isFunction)(e)?e(i):i)}}var x=e=>Object(o.createElement)(w.Consumer,null,({registerSlot:t,unregisterSlot:n,getFills:i})=>Object(o.createElement)(L,Object(r.a)({},e,{registerSlot:t,unregisterSlot:n,getFills:i})));function C(){const[,e]=Object(o.useState)({}),t=Object(o.useRef)(!0);return Object(o.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function F({name:e,children:t}){const n=j(e),r=Object(o.useRef)({rerender:C()});return Object(o.useEffect)(()=>(n.registerFill(r),()=>{n.unregisterFill(r)}),[n.registerFill,n.unregisterFill]),n.ref&&n.ref.current?("function"==typeof t&&(t=t(n.fillProps)),Object(o.createPortal)(t,n.ref.current)):null}var R=Object(o.forwardRef)((function({name:e,fillProps:t={},as:n="div",...i},c){const s=Object(o.useContext)(v.a),l=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(s.registerSlot(e,l,t),()=>{s.unregisterSlot(e,l)}),[s.registerSlot,s.unregisterSlot,e]),Object(o.useLayoutEffect)(()=>{s.updateSlot(e,t)}),Object(o.createElement)(n,Object(r.a)({ref:Object(u.useMergeRefs)([c,l])},i))}));function S(e){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(y,e),Object(o.createElement)(F,e))}n(11),o.Component;const T=Object(o.forwardRef)(({bubblesVirtually:e,...t},n)=>e?Object(o.createElement)(R,Object(r.a)({},t,{ref:n})):Object(o.createElement)(x,t));function _(e){return"appear"===e?"top":"left"}function D(e,t){const{paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:i}=(c=t).ownerDocument.defaultView.getComputedStyle(c);var c;const s=n?parseInt(n,10):0,l=r?parseInt(r,10):0,a=o?parseInt(o,10):0,u=i?parseInt(i,10):0;return{x:e.left+a,y:e.top+s,width:e.width-a-u,height:e.height-s-l,left:e.left+a,right:e.right-u,top:e.top+s,bottom:e.bottom-l}}function k(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function M(e,t,n=""){e.style[t]!==n&&(e.style[t]=n)}function W(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const N=Object(o.forwardRef)(({headerTitle:e,onClose:t,children:n,className:i,noArrow:s=!0,isAlternate:l,position:b="bottom right",range:h,focusOnMount:g="firstElement",anchorRef:v,shouldAnchorIncludePadding:w,anchorRect:E,getAnchorRect:y,expandOnMobile:L,animate:x=!0,onClickOutside:C,onFocusOutside:F,__unstableStickyBoundaryElement:R,__unstableSlotName:T="Popover",__unstableObserveElement:N,__unstableBoundaryParent:P,__unstableForcePosition:B,__unstableForceXAlignment:A,...H},V)=>{const z=Object(o.useRef)(null),U=Object(o.useRef)(null),I=Object(o.useRef)(),G=Object(u.useViewportMatch)("medium","<"),[q,X]=Object(o.useState)(),K=j(T),Q=L&&G,[Y,Z]=Object(u.useResizeObserver)();s=Q||s,Object(o.useLayoutEffect)(()=>{if(Q)return W(I.current,"is-without-arrow",s),W(I.current,"is-alternate",l),k(I.current,"data-x-axis"),k(I.current,"data-y-axis"),M(I.current,"top"),M(I.current,"left"),M(U.current,"maxHeight"),void M(U.current,"maxWidth");const e=()=>{if(!I.current||!U.current)return;let e=function(e,t,n,r=!1,o,i){if(t)return t;if(n){if(!e.current)return;const t=n(e.current);return m(t,t.ownerDocument||e.current.ownerDocument,i)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==r?void 0:r.cloneRange))return m(Object(d.getRectangleFromRange)(r),r.endContainer.ownerDocument,i);if("function"==typeof(null==r?void 0:r.getBoundingClientRect)){const e=m(r.getBoundingClientRect(),r.ownerDocument,i);return o?e:D(e,r)}const{top:e,bottom:t}=r,n=e.getBoundingClientRect(),c=t.getBoundingClientRect(),s=m(new window.DOMRect(n.left,n.top,n.width,c.bottom-n.top),e.ownerDocument,i);return o?s:D(s,r)}if(!e.current)return;const{parentNode:c}=e.current,s=c.getBoundingClientRect();return o?s:D(s,c)}(z,E,y,v,w,I.current);if(!e)return;const{offsetParent:t,ownerDocument:n}=I.current;let r,o=0;if(t&&t!==n.body){const n=t.getBoundingClientRect();o=n.top,e=new window.DOMRect(e.left-n.left,e.top-n.top,e.width,e.height)}var i;P&&(r=null===(i=I.current.closest(".popover-slot"))||void 0===i?void 0:i.parentNode);const c=Z.height?Z:U.current.getBoundingClientRect(),{popoverTop:a,popoverLeft:u,xAxis:p,yAxis:h,contentHeight:g,contentWidth:O}=function(e,t,n="top",r,o,i,c,s,l){const[a,u="center",d]=n.split(" "),p=function(e,t,n,r,o,i,c,s){const{height:l}=t;if(o){const t=o.getBoundingClientRect().top+l-c;if(e.top<=t)return{yAxis:n,popoverTop:Math.min(e.bottom,t)}}let a=e.top+e.height/2;"bottom"===r?a=e.bottom:"top"===r&&(a=e.top);const u={popoverTop:a,contentHeight:(a-l/2>0?l/2:a)+(a+l/2>window.innerHeight?window.innerHeight-a:l/2)},d={popoverTop:e.top,contentHeight:e.top-10-l>0?l:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+l>window.innerHeight?window.innerHeight-10-e.bottom:l};let f,m=n,b=null;if(!o&&!s)if("middle"===n&&u.contentHeight===l)m="middle";else if("top"===n&&d.contentHeight===l)m="top";else if("bottom"===n&&p.contentHeight===l)m="bottom";else{m=d.contentHeight>p.contentHeight?"top":"bottom";const e="top"===m?d.contentHeight:p.contentHeight;b=e!==l?e:null}return f="middle"===m?u.popoverTop:"top"===m?d.popoverTop:p.popoverTop,{yAxis:m,popoverTop:f,contentHeight:b}}(e,t,a,d,r,0,i,s);return{...function(e,t,n,r,o,i,c,s,l){const{width:a}=t;"left"===n&&Object(f.isRTL)()?n="right":"right"===n&&Object(f.isRTL)()&&(n="left"),"left"===r&&Object(f.isRTL)()?r="right":"right"===r&&Object(f.isRTL)()&&(r="left");const u=Math.round(e.left+e.width/2),d={popoverLeft:u,contentWidth:(u-a/2>0?a/2:u)+(u+a/2>window.innerWidth?window.innerWidth-u:a/2)};let p=e.left;"right"===r?p=e.right:"middle"===i||l||(p=u);let m=e.right;"left"===r?m=e.left:"middle"===i||l||(m=u);const b={popoverLeft:p,contentWidth:p-a>0?a:p},h={popoverLeft:m,contentWidth:m+a>window.innerWidth?window.innerWidth-m:a};let g,O=n,v=null;if(!o&&!s)if("center"===n&&d.contentWidth===a)O="center";else if("left"===n&&b.contentWidth===a)O="left";else if("right"===n&&h.contentWidth===a)O="right";else{O=b.contentWidth>h.contentWidth?"left":"right";const e="left"===O?b.contentWidth:h.contentWidth;a>window.innerWidth&&(v=window.innerWidth),e!==a&&(O="center",d.popoverLeft=window.innerWidth/2)}if(g="center"===O?d.popoverLeft:"left"===O?b.popoverLeft:h.popoverLeft,c){const e=c.getBoundingClientRect();g=Math.min(g,e.right-a),Object(f.isRTL)()||(g=Math.max(g,0))}return{xAxis:O,popoverLeft:g,contentWidth:v}}(e,t,u,d,r,p.yAxis,c,s,l),...p}}(e,c,b,R,I.current,o,r,B,A);"number"==typeof a&&"number"==typeof u&&(M(I.current,"top",a+"px"),M(I.current,"left",u+"px")),W(I.current,"is-without-arrow",s||"center"===p&&"middle"===h),W(I.current,"is-alternate",l),k(I.current,"data-x-axis",p),k(I.current,"data-y-axis",h),M(U.current,"maxHeight","number"==typeof g?g+"px":""),M(U.current,"maxWidth","number"==typeof O?O+"px":""),X(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[h]||"middle"))};e();const{ownerDocument:t}=I.current,{defaultView:n}=t,r=n.setInterval(e,500);let o;const i=()=>{n.cancelAnimationFrame(o),o=n.requestAnimationFrame(e)};n.addEventListener("click",i),n.addEventListener("resize",e),n.addEventListener("scroll",e,!0);const c=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(v);let a;return c&&c!==t&&(c.defaultView.addEventListener("resize",e),c.defaultView.addEventListener("scroll",e,!0)),N&&(a=new n.MutationObserver(e),a.observe(N,{attributes:!0})),()=>{n.clearInterval(r),n.removeEventListener("resize",e),n.removeEventListener("scroll",e,!0),n.removeEventListener("click",i),n.cancelAnimationFrame(o),c&&c!==t&&(c.defaultView.removeEventListener("resize",e),c.defaultView.removeEventListener("scroll",e,!0)),a&&a.disconnect()}},[Q,E,y,v,w,b,Z,R,N,P]);const $=(e,n)=>{if("focus-outside"===e&&F)F(n);else if("focus-outside"===e&&C){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>n.relatedTarget}),a()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),C(e)}else t&&t()},[ee,te]=Object(u.__experimentalUseDialog)({focusOnMount:g,__unstableOnClose:$,onClose:$}),ne=Object(u.useMergeRefs)([I,ee,V]),re=Boolean(x&&q)&&function(e){if("loading"===e.type)return c()("components-animate__loading");const{type:t,origin:n=_(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return c()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?c()("components-animate__slide-in","is-from-"+n):void 0}({type:"appear",origin:q});let oe=Object(o.createElement)("div",Object(r.a)({className:c()("components-popover",i,re,{"is-expanded":Q,"is-without-arrow":s,"is-alternate":l})},H,{ref:ne},te,{tabIndex:"-1"}),Q&&Object(o.createElement)(O,null),Q&&Object(o.createElement)("div",{className:"components-popover__header"},Object(o.createElement)("span",{className:"components-popover__header-title"},e),Object(o.createElement)(J,{className:"components-popover__close",icon:p.a,onClick:t})),Object(o.createElement)("div",{ref:U,className:"components-popover__content"},Object(o.createElement)("div",{style:{position:"relative"}},Y,n)));return K.ref&&(oe=Object(o.createElement)(S,{name:T},oe)),v||E?oe:Object(o.createElement)("span",{ref:z},oe)});N.Slot=Object(o.forwardRef)((function({name:e="Popover"},t){return Object(o.createElement)(T,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var P=N,B=function({shortcut:e,className:t}){if(!e)return null;let n,r;return Object(s.isString)(e)&&(n=e),Object(s.isObject)(e)&&(n=e.display,r=e.ariaLabel),Object(o.createElement)("span",{className:t,"aria-label":r},n)};const A=Object(o.createElement)("div",{className:"event-catcher"}),H=({eventHandlers:e,child:t,childrenWithPopover:n})=>Object(o.cloneElement)(Object(o.createElement)("span",{className:"disabled-element-wrapper"},Object(o.cloneElement)(A,e),Object(o.cloneElement)(t,{children:n}),","),e),V=({child:e,eventHandlers:t,childrenWithPopover:n})=>Object(o.cloneElement)(e,{...t,children:n}),z=(e,t,n)=>{if(1!==o.Children.count(e))return;const r=o.Children.only(e);"function"==typeof r.props[t]&&r.props[t](n)};var U=function({children:e,position:t,text:n,shortcut:r}){const[i,c]=Object(o.useState)(!1),[l,a]=Object(o.useState)(!1),d=Object(u.useDebounce)(a,700),p=t=>{z(e,"onMouseDown",t),document.addEventListener("mouseup",b),c(!0)},f=t=>{z(e,"onMouseUp",t),document.removeEventListener("mouseup",b),c(!1)},m=e=>"mouseUp"===e?f:"mouseDown"===e?p:void 0,b=m("mouseUp"),h=(t,n)=>r=>{if(z(e,t,r),r.currentTarget.disabled)return;if("focus"===r.type&&i)return;d.cancel();const o=Object(s.includes)(["focus","mouseenter"],r.type);o!==l&&(n?d(o):a(o))},g=()=>{d.cancel(),document.removeEventListener("mouseup",b)};if(Object(o.useEffect)(()=>g,[]),1!==o.Children.count(e))return e;const O={onMouseEnter:h("onMouseEnter",!0),onMouseLeave:h("onMouseLeave"),onClick:h("onClick"),onFocus:h("onFocus"),onBlur:h("onBlur"),onMouseDown:m("mouseDown")},v=o.Children.only(e),{children:j,disabled:w}=v.props;return(w?H:V)({child:v,eventHandlers:O,childrenWithPopover:(({grandchildren:e,isOver:t,position:n,text:r,shortcut:i})=>Object(o.concatChildren)(e,t&&Object(o.createElement)(P,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(o.createElement)(B,{className:"components-tooltip__shortcut",shortcut:i}))))({grandchildren:j,isOver:l,position:t,text:n,shortcut:r})})},I=n(38),G=n(34);const q=["onMouseDown","onClick"];var J=t.a=Object(o.forwardRef)((function(e,t){const{href:n,target:i,isSmall:l,isPressed:u,isBusy:d,isDestructive:p,className:f,disabled:m,icon:b,iconPosition:h="left",iconSize:g,showTooltip:O,tooltipPosition:v,shortcut:j,label:w,children:E,text:y,variant:L,__experimentalIsFocusable:x,describedBy:C,...F}=function({isDefault:e,isPrimary:t,isSecondary:n,isTertiary:r,isLink:o,variant:i,...c}){let s=i;var l,u,d,p,f;return t&&(null!==(l=s)&&void 0!==l||(s="primary")),r&&(null!==(u=s)&&void 0!==u||(s="tertiary")),n&&(null!==(d=s)&&void 0!==d||(s="secondary")),e&&(a()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(p=s)&&void 0!==p||(s="secondary")),o&&(null!==(f=s)&&void 0!==f||(s="link")),{...c,variant:s}}(e),R=c()("components-button",f,{"is-secondary":"secondary"===L,"is-primary":"primary"===L,"is-small":l,"is-tertiary":"tertiary"===L,"is-pressed":u,"is-busy":d,"is-link":"link"===L,"is-destructive":p,"has-text":!!b&&!!E,"has-icon":!!b}),S=m&&!x,T=void 0===n||S?"button":"a",_="a"===T?{href:n,target:i}:{type:"button",disabled:S,"aria-pressed":u};if(m&&x){_["aria-disabled"]=!0;for(const e of q)F[e]=e=>{e.stopPropagation(),e.preventDefault()}}const D=!S&&(O&&w||j||!!w&&(!E||Object(s.isArray)(E)&&!E.length)&&!1!==O),k=C?Object(s.uniqueId)():null,M=F["aria-describedby"]||k,W=Object(o.createElement)(T,Object(r.a)({},_,F,{className:R,"aria-label":F["aria-label"]||w,"aria-describedby":M,ref:t}),b&&"left"===h&&Object(o.createElement)(I.a,{icon:b,size:g}),y&&Object(o.createElement)(o.Fragment,null,y),b&&"right"===h&&Object(o.createElement)(I.a,{icon:b,size:g}),E);return D?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(U,{text:C||w,shortcut:j,position:v},W),C&&Object(o.createElement)(G.a,null,Object(o.createElement)("span",{id:k},C))):Object(o.createElement)(o.Fragment,null,W,C&&Object(o.createElement)(G.a,null,Object(o.createElement)("span",{id:k},C)))}))},55:function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:c}catch(e){r=c}}();var l,a=[],u=!1,d=-1;function p(){u&&l&&(u=!1,l.length?a=l.concat(a):d=-1,a.length&&f())}function f(){if(!u){var e=s(p);u=!0;for(var t=a.length;t;){for(l=a,a=[];++d1)for(var n=1;n=480,"is-medium":h>=160&&h<480,"is-small":h<160});const m=o()("components-placeholder",s,g),x=o()("components-placeholder__fieldset",{"is-column-layout":b});return Object(i.createElement)("div",Object(r.a)({},p,{className:m}),f,u,d&&Object(i.createElement)("div",{className:"components-placeholder__preview"},d),Object(i.createElement)("div",{className:"components-placeholder__label"},Object(i.createElement)(l.a,{icon:e}),n),!!a&&Object(i.createElement)("div",{className:"components-placeholder__instructions"},a),Object(i.createElement)("div",{className:x},t))}},362:function(e,t,n){"use strict";var r=n(0),i=n(13);const a=Object(r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(i.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));t.a=a},368:function(e,t){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);Object.defineProperty(t,"combineChunks",{enumerable:!0,get:function(){return r.combineChunks}}),Object.defineProperty(t,"fillInChunks",{enumerable:!0,get:function(){return r.fillInChunks}}),Object.defineProperty(t,"findAll",{enumerable:!0,get:function(){return r.findAll}}),Object.defineProperty(t,"findChunks",{enumerable:!0,get:function(){return r.findChunks}})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findAll=function(e){var t=e.autoEscape,a=e.caseSensitive,o=void 0!==a&&a,c=e.findChunks,l=void 0===c?r:c,s=e.sanitize,u=e.searchWords,d=e.textToHighlight;return i({chunksToHighlight:n({chunks:l({autoEscape:t,caseSensitive:o,sanitize:s,searchWords:u,textToHighlight:d})}),totalLength:d?d.length:0})};var n=t.combineChunks=function(e){var t=e.chunks;return t.sort((function(e,t){return e.start-t.start})).reduce((function(e,t){if(0===e.length)return[t];var n=e.pop();if(t.start<=n.end){var r=Math.max(n.end,t.end);e.push({highlight:!1,start:n.start,end:r})}else e.push(n,t);return e}),[])},r=function(e){var t=e.autoEscape,n=e.caseSensitive,r=e.sanitize,i=void 0===r?a:r,o=e.searchWords,c=e.textToHighlight;return c=i(c),o.filter((function(e){return e})).reduce((function(e,r){r=i(r),t&&(r=r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"));for(var a=new RegExp(r,n?"g":"gi"),o=void 0;o=a.exec(c);){var l=o.index,s=a.lastIndex;s>l&&e.push({highlight:!1,start:l,end:s}),o.index===a.lastIndex&&a.lastIndex++}return e}),[])};t.findChunks=r;var i=t.fillInChunks=function(e){var t=e.chunksToHighlight,n=e.totalLength,r=[],i=function(e,t,n){t-e>0&&r.push({start:e,end:t,highlight:n})};if(0===t.length)i(0,n,!1);else{var a=0;t.forEach((function(e){i(a,e.start,!1),i(e.start,e.end,!0),a=e.end})),i(a,n,!1)}return r};function a(e){return e}}])},430:function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"Text",(function(){return N})),n.d(r,"block",(function(){return P})),n.d(r,"positive",(function(){return R})),n.d(r,"destructive",(function(){return W})),n.d(r,"muted",(function(){return M})),n.d(r,"highlighterText",(function(){return $})),n.d(r,"upperCase",(function(){return I}));var i=n(8),a=n(0),o=n(3),c=n(4),l=n.n(c),s=n(9),u=function({icon:e,size:t=24,...n}){return Object(a.cloneElement)(e,{width:t,height:t,...n})},d=n(13),b=Object(a.createElement)(d.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(a.createElement)(d.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),p=n(344),f=n(300),h=n(297),g=n(448),m=n(414),x=n(413),O=n(281),j=n(410),v=n(412);const y=Object(O.a)({name:"hdknak",styles:"display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"}),w="…",k={auto:"auto",head:"head",middle:"middle",tail:"tail",none:"none"},z={ellipsis:w,ellipsizeMode:k.auto,limit:0,numberOfLines:0};var E=n(308),S=n.n(E),C=n(327),F=n.n(C);let H;const L=S()((function(e){var t,n;if("string"!=typeof e)return"";if("string"==typeof(n=e)&&F()(n).isValid())return e;if(!e.includes("var("))return"";if("undefined"==typeof document)return"";const r=function(){if("undefined"!=typeof document){if(!H){const e=document.createElement("div");e.setAttribute("data-g2-color-computation-node",""),document.body.appendChild(e),H=e}return H}}();if(!r)return"";r.style.background=e;const i=null===(t=window)||void 0===t?void 0:t.getComputedStyle(r).background;return r.style.background="",i||""}));var _=n(397),T=n(296),B={colorDivider:"rgba(0, 0, 0, 0.1)",colorScrollbarThumb:"rgba(0, 0, 0, 0.2)",colorScrollbarThumbHover:"rgba(0, 0, 0, 0.5)",colorScrollbarTrack:"rgba(0, 0, 0, 0.04)",elevationIntensity:1,radiusBlockUi:"2px",borderWidth:"1px",borderWidthFocus:"1.5px",borderWidthTab:"4px",spinnerSize:"18px",fontSize:"13px",fontSizeH1:"calc(2.44 * 13px)",fontSizeH2:"calc(1.95 * 13px)",fontSizeH3:"calc(1.56 * 13px)",fontSizeH4:"calc(1.25 * 13px)",fontSizeH5:"13px",fontSizeH6:"calc(0.8 * 13px)",fontSizeInputMobile:"16px",fontSizeMobile:"15px",fontSizeSmall:"calc(0.92 * 13px)",fontSizeXSmall:"calc(0.75 * 13px)",fontLineHeightBase:"1.2",fontWeight:"normal",fontWeightHeading:"600",gridBase:"4px",controlPaddingX:"12px",controlPaddingXLarge:"calc(12px * 1.3334)",controlPaddingXSmall:"calc(12px / 1.3334)",controlBackgroundColor:_.a.white,controlBorderRadius:"2px",controlBorderColor:_.a.gray[700],controlBoxShadow:"transparent",controlBorderColorHover:_.a.gray[700],controlBoxShadowFocus:"0 0 0, 0.5px, "+_.a.admin,controlDestructiveBorderColor:_.a.alert.red,controlHeight:"30px",controlHeightLarge:"calc( 30px * 1.2 )",controlHeightSmall:"calc( 30px * 0.8 )",controlHeightXSmall:"calc( 30px * 0.6 )",cardBorderRadius:"2px",cardPaddingXSmall:""+Object(T.a)(2),cardPaddingSmall:""+Object(T.a)(4),cardPaddingMedium:`${Object(T.a)(4)} ${Object(T.a)(6)}`,cardPaddingLarge:`${Object(T.a)(6)} ${Object(T.a)(8)}`,surfaceBackgroundColor:_.a.white,surfaceBackgroundSubtleColor:"#F3F3F3",surfaceBackgroundTintColor:"#F5F5F5",surfaceBorderColor:"rgba(0, 0, 0, 0.1)",surfaceBorderBoldColor:"rgba(0, 0, 0, 0.15)",surfaceBorderSubtleColor:"rgba(0, 0, 0, 0.05)",surfaceBackgroundTertiaryColor:_.a.white,surfaceColor:_.a.white,transitionDuration:"200ms",transitionDurationFast:"160ms",transitionDurationFaster:"120ms",transitionDurationFastest:"100ms",transitionTimingFunction:"cubic-bezier(0.08, 0.52, 0.52, 1)",transitionTimingFunctionControl:"cubic-bezier(0.12, 0.8, 0.32, 1)"};const N=Object(O.a)("color:",_.a.black,";line-height:",B.fontLineHeightBase,";margin:0;",""),P=Object(O.a)({name:"4zleql",styles:"display:block"}),R=Object(O.a)("color:",_.a.alert.green,";",""),W=Object(O.a)("color:",_.a.alert.red,";",""),M=Object(O.a)("color:",_.a.mediumGray.text,";",""),$=Object(O.a)("mark{background:",_.a.alert.yellow,";border-radius:2px;box-shadow:0 0 0 1px rgba( 0, 0, 0, 0.05 ) inset,0 -1px 0 rgba( 0, 0, 0, 0.1 ) inset;}",""),I=Object(O.a)({name:"50zrmy",styles:"text-transform:uppercase"});var D=n(368);const A=S()(e=>{const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}),V={body:13,caption:10,footnote:11,largeTitle:28,subheadline:12,title:20};function X(e=13){if(e in V)return X(V[e]);if("number"!=typeof e){const t=parseFloat(e);if(Number.isNaN(t))return e;e=t}return`calc((${e} / 13) * ${B.fontSize})`}[1,2,3,4,5,6].flatMap(e=>[e,e.toString()]);var q=Object(x.a)({as:"span",useHook:function(e){const{adjustLineHeightForInnerControls:t,align:n,children:i,className:c,color:l,ellipsizeMode:s,isDestructive:u=!1,display:d,highlightEscape:b=!1,highlightCaseSensitive:p=!1,highlightWords:f,highlightSanitize:h,isBlock:g=!1,letterSpacing:m,lineHeight:x,optimizeReadabilityFor:E,size:S,truncate:C=!1,upperCase:H=!1,variant:R,weight:I=B.fontWeight,...V}=Object(j.a)(e,"Text");let q=i;const G=Array.isArray(f),J="caption"===S;if(G){if("string"!=typeof i)throw new TypeError("`children` of `Text` must only be `string` types when `highlightWords` is defined");q=function({activeClassName:e="",activeIndex:t=-1,activeStyle:n,autoEscape:r,caseSensitive:i=!1,children:o,findChunks:c,highlightClassName:l="",highlightStyle:s={},highlightTag:u="mark",sanitize:d,searchWords:b=[],unhighlightClassName:p="",unhighlightStyle:f}){if(!o)return null;if("string"!=typeof o)return o;const h=o,g=Object(D.findAll)({autoEscape:r,caseSensitive:i,findChunks:c,sanitize:d,searchWords:b,textToHighlight:h}),m=u;let x,O=-1,j="";return g.map((r,o)=>{const c=h.substr(r.start,r.end-r.start);if(r.highlight){let r;O++,r="object"==typeof l?i?l[c]:(l=A(l))[c.toLowerCase()]:l;const u=O===+t;j=`${r} ${u?e:""}`,x=!0===u&&null!==n?Object.assign({},s,n):s;const d={children:c,className:j,key:o,style:x};return"string"!=typeof m&&(d.highlightIndex=O),Object(a.createElement)(m,d)}return Object(a.createElement)("span",{children:c,className:p,key:o,style:f})})}({autoEscape:b,children:i,caseSensitive:p,searchWords:f,sanitize:h})}let K;!0===C&&(K="auto"),!1===C&&(K="none");const U=function(e){const{className:t,children:n,ellipsis:r=w,ellipsizeMode:i=k.auto,limit:c=0,numberOfLines:l=0,...s}=Object(j.a)(e,"Truncate"),u=function(e="",t){const n={...z,...t},{ellipsis:r,ellipsizeMode:i,limit:a}=n;if(i===k.none)return e;let c,l;switch(i){case k.head:c=0,l=a;break;case k.middle:c=Math.floor(a/2),l=Math.floor(a/2);break;default:c=a,l=0}return i!==k.auto?function(e,t,n,r){if("string"!=typeof e)return"";const i=e.length,a=~~t,c=~~n,l=Object(o.isNil)(r)?w:r;return 0===a&&0===c||a>=i||c>=i||a+c>=i?e:0===c?e.slice(0,a)+l:e.slice(0,a)+l+e.slice(i-c)}(e,c,l,r):e}("string"==typeof n?n:"",{ellipsis:r,ellipsizeMode:i,limit:c,numberOfLines:l}),d=i===k.auto;return{...s,className:Object(a.useMemo)(()=>{const e={};return e.numberOfLines=Object(O.a)("-webkit-box-orient:vertical;-webkit-line-clamp:",l,";display:-webkit-box;overflow:hidden;",""),Object(O.b)(d&&!l&&y,d&&!!l&&e.numberOfLines,t)},[t,l,d]),children:u}}({...V,className:Object(a.useMemo)(()=>{const e={},i=function(e,t){if(t)return t;if(!e)return;let n=`calc(${B.controlHeight} + ${Object(T.a)(2)})`;switch(e){case"large":n=`calc(${B.controlHeightLarge} + ${Object(T.a)(2)})`;break;case"small":n=`calc(${B.controlHeightSmall} + ${Object(T.a)(2)})`;break;case"xSmall":n=`calc(${B.controlHeightXSmall} + ${Object(T.a)(2)})`}return n}(t,x);if(e.Base=Object(O.a)({color:l,display:d,fontSize:X(S),fontWeight:I,lineHeight:i,letterSpacing:m,textAlign:n},"",""),e.upperCase=Object(O.a)({name:"50zrmy",styles:"text-transform:uppercase"}),e.optimalTextColor=null,E){const t="dark"==("#000000"===function(e){const t=L(e);return F.a.isReadable(t,"#000000")?"#000000":"#ffffff"}(E)?"dark":"light");e.optimalTextColor=t?Object(O.a)({color:_.a.black},"",""):Object(O.a)({color:_.a.white},"","")}return Object(O.b)(N,e.Base,e.optimalTextColor,u&&W,!!G&&$,g&&P,J&&M,R&&r[R],H&&e.upperCase,c)},[t,n,c,l,d,g,J,u,G,m,x,E,S,H,R,I]),children:i,ellipsizeMode:s||K});return!C&&Array.isArray(i)&&(q=a.Children.map(i,e=>Object(o.isPlainObject)(e)&&"props"in e&&Object(v.b)(e,["Link"])?Object(a.cloneElement)(e,{size:e.props.size||"inherit"}):e)),{...U,children:C?U.children:q}},name:"Text"}),G=n(1);const J=new RegExp(/-left/g),K=new RegExp(/-right/g),U=new RegExp(/Left/g),Q=new RegExp(/Right/g);function Y(e={},t){return()=>t?Object(G.isRTL)()?Object(h.a)(t,""):Object(h.a)(e,""):Object(G.isRTL)()?Object(h.a)(((e={})=>Object(o.mapKeys)(e,(e,t)=>function(e){return"left"===e?"right":"right"===e?"left":J.test(e)?e.replace(J,"-right"):K.test(e)?e.replace(K,"-left"):U.test(e)?e.replace(U,"Right"):Q.test(e)?e.replace(Q,"Left"):e}(t)))(e),""):Object(h.a)(e,"")}var Z={name:"1n8met0",styles:"padding-top:0"};const ee=()=>Z;var te={name:"1739oy8",styles:"z-index:1"};const ne=({isFocused:e})=>e?te:"";var re={name:"2o6p8u",styles:"justify-content:space-between"},ie={name:"14qk3ip",styles:"align-items:flex-start;flex-direction:column-reverse"},ae={name:"hbng6e",styles:"align-items:flex-start;flex-direction:column"};const oe=({labelPosition:e})=>{switch(e){case"top":return ae;case"bottom":return ie;case"edge":return re;default:return""}},ce=Object(f.a)(g.a,{target:"e1cr7zh17"})("position:relative;border-radius:2px;",ee," ",ne," ",oe,";");var le={name:"wyxldh",styles:"margin:0 !important"},se={name:"1d3w5wq",styles:"width:100%"};const ue=Object(f.a)("div",{target:"e1cr7zh16"})("align-items:center;box-sizing:border-box;border-radius:inherit;display:flex;flex:1;position:relative;",({disabled:e})=>{const t=e?_.a.ui.backgroundDisabled:_.a.ui.background;return Object(h.a)({backgroundColor:t},"","")}," ",({hideLabel:e})=>e?le:null," ",({__unstableInputWidth:e,labelPosition:t})=>e?"side"===t?"":"edge"===t?Object(h.a)({flex:"0 0 "+e},"",""):Object(h.a)({width:e},"",""):se,";");var de={name:"103r1kr",styles:"&::-webkit-input-placeholder{line-height:normal;}"};Object(f.a)("input",{target:"e1cr7zh15"})("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:",_.a.black,";display:block;margin:0;outline:none;padding-left:8px;padding-right:8px;width:100%;",({isDragging:e,dragCursor:t})=>{let n="",r="";return e&&(n=Object(h.a)("cursor:",t,";user-select:none;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}","")),e&&t&&(r=Object(h.a)("&:active{cursor:",t,";}","")),Object(h.a)(n," ",r,";","")}," ",({disabled:e})=>e?Object(h.a)({color:_.a.ui.textDisabled},"",""):""," ",({size:e})=>{const t={default:"13px",small:"11px"}[e];return t?Object(h.a)("font-size:","16px",";@media ( min-width: 600px ){font-size:",t,";}",""):""}," ",({size:e})=>{const t={default:{height:30,lineHeight:1,minHeight:30},small:{height:24,lineHeight:1,minHeight:24}},n=t[e]||t.default;return Object(h.a)(n,"","")}," ",()=>de,";}");var be={name:"1h52dri",styles:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap"};const pe=()=>be,fe=({labelPosition:e})=>{let t=4;return"edge"!==e&&"side"!==e||(t=0),Object(h.a)({paddingTop:0,paddingBottom:t},"","")},he=Object(f.a)(q,{target:"e1cr7zh14"})("&&&{box-sizing:border-box;color:currentColor;display:block;margin:0;max-width:100%;z-index:1;",fe," ",pe,";}"),ge=e=>Object(a.createElement)(he,Object(i.a)({},e,{as:"label"})),me=Object(f.a)(m.a,{target:"e1cr7zh13"})({name:"1b6uupn",styles:"max-width:calc( 100% - 10px )"}),xe=Object(f.a)("div",{target:"e1cr7zh12"})("&&&{box-sizing:border-box;border-radius:inherit;bottom:0;left:0;margin:0;padding:0;pointer-events:none;position:absolute;right:0;top:0;",({disabled:e,isFocused:t})=>{let n=t?_.a.ui.borderFocus:_.a.ui.border,r=null;return t&&(r=`0 0 0 1px ${_.a.ui.borderFocus} inset`),e&&(n=_.a.ui.borderDisabled),Object(h.a)({boxShadow:r,borderColor:n,borderStyle:"solid",borderWidth:1},"","")}," ",Y({paddingLeft:2}),";}"),Oe=Object(f.a)("span",{target:"e1cr7zh11"})({name:"pvvbxf",styles:"box-sizing:border-box;display:block"}),je=Object(f.a)("span",{target:"e1cr7zh10"})({name:"pvvbxf",styles:"box-sizing:border-box;display:block"});var ve=Object(a.memo)((function({disabled:e=!1,isFocused:t=!1}){return Object(a.createElement)(xe,{"aria-hidden":"true",className:"components-input-control__backdrop",disabled:e,isFocused:t})})),ye=n(34);function we({children:e,hideLabelFromVision:t,htmlFor:n,...r}){return e?t?Object(a.createElement)(ye.a,{as:"label",htmlFor:n},e):Object(a.createElement)(ge,Object(i.a)({htmlFor:n},r),e):null}var ke=Object(a.forwardRef)((function e({__unstableInputWidth:t,children:n,className:r,disabled:o=!1,hideLabelFromVision:c=!1,labelPosition:l,id:u,isFocused:d=!1,label:b,prefix:p,size:f="default",suffix:h,...g},m){const x=function(t){const n=Object(s.useInstanceId)(e);return t||"input-base-control-"+n}(u),O=c||!b;return Object(a.createElement)(ce,Object(i.a)({},g,function({labelPosition:e}){const t={};switch(e){case"top":t.direction="column",t.gap=0;break;case"bottom":t.direction="column-reverse",t.gap=0;break;case"edge":t.justify="space-between"}return t}({labelPosition:l}),{className:r,isFocused:d,labelPosition:l,ref:m,__unstableVersion:"next"}),Object(a.createElement)(me,null,Object(a.createElement)(we,{className:"components-input-control__label",hideLabelFromVision:c,labelPosition:l,htmlFor:x,size:f},b)),Object(a.createElement)(ue,{__unstableInputWidth:t,className:"components-input-control__container",disabled:o,hideLabel:O,isFocused:d,labelPosition:l},p&&Object(a.createElement)(Oe,{className:"components-input-control__prefix"},p),n,h&&Object(a.createElement)(je,{className:"components-input-control__suffix"},h),Object(a.createElement)(ve,{"aria-hidden":"true",disabled:o,isFocused:d,label:b,size:f})))}));const ze=Object(f.a)("select",{target:"e12x0a391"})("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:",_.a.black,";display:block;margin:0;width:100%;",({disabled:e})=>e?Object(h.a)({color:_.a.ui.textDisabled},"",""):"",";",({size:e})=>{const t={default:"13px",small:"11px"}[e];return t?Object(h.a)("font-size:","16px",";@media ( min-width: 600px ){font-size:",t,";}",""):""},";",({size:e})=>{const t={default:{height:30,lineHeight:1,minHeight:30},small:{height:24,lineHeight:1,minHeight:24}},n=t[e]||t.default;return Object(h.a)(n,"","")},";",Y({paddingLeft:8,paddingRight:24})(),";}"),Ee=Object(f.a)("div",{target:"e12x0a390"})("align-items:center;bottom:0;box-sizing:border-box;display:flex;padding:0 4px;pointer-events:none;position:absolute;top:0;",Y({right:0})()," svg{display:block;}");const Se=Object(a.forwardRef)((function e({className:t,disabled:n=!1,help:r,hideLabelFromVision:c,id:d,label:f,multiple:h=!1,onBlur:g=o.noop,onChange:m=o.noop,onFocus:x=o.noop,options:O=[],size:j="default",value:v,labelPosition:y="top",...w},k){const[z,E]=Object(a.useState)(!1),S=function(t){const n=Object(s.useInstanceId)(e);return t||"inspector-select-control-"+n}(d),C=r?S+"__help":void 0;if(Object(o.isEmpty)(O))return null;const F=l()("components-select-control",t);return Object(a.createElement)(p.a,{help:r},Object(a.createElement)(ke,Object(i.a)({className:F,disabled:n,hideLabelFromVision:c,id:S,isFocused:z,label:f,size:j,suffix:Object(a.createElement)(Ee,null,Object(a.createElement)(u,{icon:b,size:18})),labelPosition:y},w),Object(a.createElement)(ze,Object(i.a)({},w,{"aria-describedby":C,className:"components-select-control__input",disabled:n,id:S,multiple:h,onBlur:e=>{g(e),E(!1)},onChange:e=>{if(h){const t=[...e.target.options].filter(({selected:e})=>e).map(({value:e})=>e);m(t)}else m(e.target.value,{event:e})},onFocus:e=>{x(e),E(!0)},ref:k,size:j,value:v}),O.map((e,t)=>{const n=e.id||`${e.label}-${e.value}-${t}`;return Object(a.createElement)("option",{key:n,value:e.value,disabled:e.disabled},e.label)}))))}));t.a=Se},51:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(5);function i(e,t,n){var i=this,a=Object(r.useRef)(null),o=Object(r.useRef)(0),c=Object(r.useRef)(null),l=Object(r.useRef)([]),s=Object(r.useRef)(),u=Object(r.useRef)(),d=Object(r.useRef)(e),b=Object(r.useRef)(!0);d.current=e;var p=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var f=!!(n=n||{}).leading,h=!("trailing"in n)||!!n.trailing,g="maxWait"in n,m=g?Math.max(+n.maxWait||0,t):null;return Object(r.useEffect)((function(){return b.current=!0,function(){b.current=!1}}),[]),Object(r.useMemo)((function(){var e=function(e){var t=l.current,n=s.current;return l.current=s.current=null,o.current=e,u.current=d.current.apply(n,t)},n=function(e,t){p&&cancelAnimationFrame(c.current),c.current=p?requestAnimationFrame(e):setTimeout(e,t)},r=function(e){if(!b.current)return!1;var n=e-a.current,r=e-o.current;return!a.current||n>=t||n<0||g&&r>=m},x=function(t){return c.current=null,h&&l.current?e(t):(l.current=s.current=null,u.current)},O=function(){var e=Date.now();if(r(e))return x(e);if(b.current){var i=e-a.current,c=e-o.current,l=t-i,s=g?Math.min(l,m-c):l;n(O,s)}},j=function(){for(var d=[],p=0;p array('lodash', 'wc-settings', 'wp-api-fetch', 'wp-data', 'wp-data-controls', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-notices', 'wp-polyfill', 'wp-url'), 'version' => '6cb607484ece35fcd57d880a8c2355b9'); \ No newline at end of file diff --git a/build/wc-blocks-data.js b/build/wc-blocks-data.js new file mode 100644 index 00000000000..c096eb3c723 --- /dev/null +++ b/build/wc-blocks-data.js @@ -0,0 +1,3 @@ +this.wc=this.wc||{},this.wc.wcBlocksData=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=136)}({1:function(e,t){e.exports=window.wp.i18n},11:function(e,t){e.exports=window.wp.apiFetch},123:function(e,t){e.exports=window.wp.notices},124:function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(125),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(28))},125:function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,c,s=1,u={},l=!1,d=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(a="setImmediate$"+Math.random()+"$",c=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&h(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",c,!1):e.attachEvent("onmessage",c),r=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(o=d.documentElement,r=function(e){var t=d.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(h,0,e)},p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;nfunction(t,n,r){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const i=e(m).hasFinishedResolution("getRoutes",[n]);let a="";if((t=t.routes)[n]?t[n][r]||(a=Object(g.sprintf)("There is no route for the given resource name (%s) in the store",r)):a=Object(g.sprintf)("There is no route for the given namespace (%s) in the store",n),""!==a){if(i)throw new Error(a);return""}const c=_(t[n][r],o);if(""===c&&i)throw new Error(Object(g.sprintf)("While there is a route for the given namespace (%1$s) and resource name (%2$s), there is no route utilizing the number of ids you included in the select arguments. The available routes are: (%3$s)",n,r,JSON.stringify(t[n][r])));return c}),E=Object(h.createRegistrySelector)(e=>(t,n)=>{const r=e(m).hasFinishedResolution("getRoutes",[n]),o=t.routes[n];if(!o){if(r)throw new Error(Object(g.sprintf)("There is no route for the given namespace (%s) in the store",n));return[]}let i=[];for(const e in o)i=[...i,...Object.keys(o[e])];return i}),_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=(e=Object.entries(e)).find(e=>{let[,n]=e;return t.length===n.length}),[r,o]=n||[];return r?0===t.length?r:b(r,o,t):""},b=(e,t,n)=>(t.forEach((t,r)=>{e=e.replace(`{${t}}`,n[r])}),e),T="wc/blocks",w=[],C=[],S=[],A=[],R=[],O=[],I=[],D={},P=[];function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:T;return{type:"RECEIVE_MODEL_ROUTES",routes:e,namespace:t}}function*N(e){yield h.controls.resolveSelect(m,"getRoutes",e)}function*j(e){const t=yield Object(y.apiFetch)({path:e}),n=t&&t.routes?Object.keys(t.routes):[];yield k(n,e)}const M=(e,t)=>(t=t.replace(e+"/","")).replace(/\/\(\?P\<[a-z_]*\>\[\\*[a-z]\]\+\)/g,""),L=e=>{const t=e.match(/\<[a-z_]*\>/g);return Array.isArray(t)&&0!==t.length?t.map(e=>e.replace(/<|>/g,"")):[]},x=(e,t)=>Array.isArray(t)&&0!==t.length?(t.forEach(t=>{const n=`\\(\\?P<${t}>.*?\\)`;e=e.replace(new RegExp(n),`{${t}}`)}),e):e;var F=n(4);function V(e,t){return Object(F.has)(e,t)}function G(e,t,n){return Object(F.setWith)(Object(F.clone)(e),t,n,F.clone)}var U=Object(h.combineReducers)({routes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;const{type:n,routes:r,namespace:o}=t;return"RECEIVE_MODEL_ROUTES"===n&&r.forEach(t=>{const n=M(o,t);if(n&&n!==o){const r=L(t),i=x(t,r);V(e,[o,n,i])||(e=G(e,[o,n,i],r))}}),e}});Object(h.registerStore)(m,{reducer:U,actions:o,controls:y.controls,selectors:r,resolvers:i});const K=m,Y=[];var H=n(18);const Q=e=>{let{state:t,namespace:n,resourceName:r,query:o,ids:i,type:a="items",fallback:c=Y}=e;return i=JSON.stringify(i),o=null!==o?Object(H.addQueryArgs)("",o):"",V(t,[n,r,i,o,a])?t[n][r][i][o][a]:c},q=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Y;return Q({state:e,namespace:t,resourceName:n,query:r,ids:o,type:"headers",fallback:void 0})},B=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Y;return Q({state:e,namespace:t,resourceName:n,query:r,ids:o})},z=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Y;return Q({state:e,namespace:t,resourceName:n,query:r,ids:o,type:"error",fallback:null})},J=function(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Y;const a=q(e,n,r,o,i);return a&&a.get?a.has(t)?a.get(t):void 0:null},$=e=>e.lastModified||0;let W=window.Headers||null;function X(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{items:[],headers:W},i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return{type:i?"RESET_COLLECTION":"RECEIVE_COLLECTION",namespace:e,resourceName:t,queryString:n,ids:r,response:o}}function Z(e,t,n,r,o){return{type:"ERROR",namespace:e,resourceName:t,queryString:n,ids:r,response:{items:[],headers:W,error:o}}}function ee(e){return{type:"RECEIVE_LAST_MODIFIED",timestamp:e}}W=W?new W:{get:()=>{},has:()=>{}};var te=n(11),ne=n.n(te),re=n(30),oe=n.n(re),ie=n(5);const ae=e=>({type:"API_FETCH_WITH_HEADERS",options:e}),ce={},se={code:"invalid_json",message:Object(g.__)("The response is not a valid JSON response.","woo-gutenberg-products-block")},ue=e=>{ne.a.setNonce&&"function"==typeof ne.a.setNonce?ne.a.setNonce(e):console.error('The monkey patched function on APIFetch, "setNonce", is not present, likely another plugin or some other code has removed this augmentation')},le=new oe.a(e=>ne()({path:"/wc/store/v1/batch",method:"POST",data:{requests:e.map(e=>({...e,body:null==e?void 0:e.data}))}}).then(t=>(function(e){if("object"!=typeof e||null===e||!e.hasOwnProperty("responses"))throw new Error("Response not valid")}(t),e.map((e,n)=>t.responses[n]||ce))),{batchScheduleFn:e=>setTimeout(e,300),cache:!1,maxBatchSize:25}),de={API_FETCH_WITH_HEADERS:e=>{let{options:t}=e;return new Promise((e,n)=>{!t.method||"GET"===t.method||Object(ie.isWpVersion)("5.6","<")?ne()({...t,parse:!1}).then(t=>{t.json().then(n=>{e({response:n,headers:t.headers}),ue(t.headers)}).catch(()=>{n(se)})}).catch(e=>{ue(e.headers),"function"==typeof e.json?e.json().then(e=>{n(e)}).catch(()=>{n(se)}):n(e.message)}):(async e=>await le.load(e))(t).then(t=>{throw function(e){if("object"!=typeof e||null===e||!e.hasOwnProperty("body")||!e.hasOwnProperty("headers"))throw new Error("Response not valid")}(t),t.status>=200&&t.status<300&&(e({response:t.body,headers:t.headers}),ue(t.headers)),t}).catch(e=>{e.headers&&ue(e.headers),e.body?n(e.body):n()})})}};function*pe(e,t,n,r){const o=yield h.controls.resolveSelect(m,"getRoute",e,t,r),i=Object(H.addQueryArgs)("",n);if(o)try{const{response:n=Y,headers:a}=yield ae({path:o+i});a&&a.get&&a.has("last-modified")&&(yield function*(e){const t=yield h.controls.resolveSelect("wc/store/collections","getCollectionLastModified");t?e>t&&(yield h.controls.dispatch("wc/store/collections","invalidateResolutionForStore"),yield h.controls.dispatch("wc/store/collections","receiveLastModified",e)):yield h.controls.dispatch("wc/store/collections","receiveLastModified",e)}(parseInt(a.get("last-modified"),10))),yield X(e,t,i,r,{items:n,headers:a})}catch(n){yield Z(e,t,i,r,n)}else yield X(e,t,i,r)}function*fe(e,t,n,r,o){const i=[t,n,r,o].filter(e=>void 0!==e);yield h.controls.resolveSelect("wc/store/collections","getCollection",...i)}Object(h.registerStore)("wc/store/collections",{reducer:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("RECEIVE_LAST_MODIFIED"===t.type)return t.timestamp===e.lastModified?e:{...e,lastModified:t.timestamp};if("INVALIDATE_RESOLUTION_FOR_STORE"===t.type)return{};const{type:n,namespace:r,resourceName:o,queryString:i,response:a}=t,c=t.ids?JSON.stringify(t.ids):"[]";switch(n){case"RECEIVE_COLLECTION":if(V(e,[r,o,c,i]))return e;e=G(e,[r,o,c,i],a);break;case"RESET_COLLECTION":case"ERROR":e=G(e,[r,o,c,i],a)}return e},actions:c,controls:{...y.controls,...de},selectors:a,resolvers:s});const he="wc/store/collections";var ye=n(9);const me={cartItemsPendingQuantity:[],cartItemsPendingDelete:[],cartData:{coupons:w,shippingRates:O,shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},billingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:"",email:""},items:C,itemsCount:0,itemsWeight:0,needsShipping:!0,needsPayment:!1,hasCalculatedShipping:!0,fees:S,totals:{currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"",currency_suffix:"",total_items:"0",total_items_tax:"0",total_fees:"0",total_fees_tax:"0",total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_price:"0",total_tax:"0",tax_lines:P},errors:A,paymentRequirements:I,extensions:D},metaData:{updatingCustomerData:!1,updatingSelectedRate:!1,applyingCoupon:"",removingCoupon:"",isCartDataStale:!1},errors:R},ge=e=>e.cartData,ve=e=>({shippingAddress:e.cartData.shippingAddress,billingAddress:e.cartData.billingAddress}),Ee=e=>e.cartData.shippingRates,_e=e=>e.cartData.needsShipping,be=e=>e.cartData.hasCalculatedShipping,Te=e=>e.cartData.totals||me.cartData.totals,we=e=>e.metaData||me.metaData,Ce=e=>e.errors,Se=e=>!!e.metaData.applyingCoupon,Ae=e=>e.metaData.isCartDataStale,Re=e=>e.metaData.applyingCoupon||"",Oe=e=>!!e.metaData.removingCoupon,Ie=e=>e.metaData.removingCoupon||"",De=(e,t)=>e.cartData.items.find(e=>e.key===t),Pe=(e,t)=>e.cartItemsPendingQuantity.includes(t),ke=(e,t)=>e.cartItemsPendingDelete.includes(t),Ne=e=>!!e.metaData.updatingCustomerData,je=e=>!!e.metaData.updatingSelectedRate,Me=e=>({type:"RECEIVE_CART",response:Object(F.mapKeys)(e,(e,t)=>Object(F.camelCase)(t))}),Le=e=>{const t=Object(F.mapKeys)(e,(e,t)=>Object(F.camelCase)(t)),{shippingAddress:n,billingAddress:r,...o}=t;return{type:"RECEIVE_CART",response:o}},xe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{type:t?"REPLACE_ERRORS":"RECEIVE_ERROR",error:e}},Fe=e=>({type:"APPLYING_COUPON",couponCode:e}),Ve=e=>({type:"REMOVING_COUPON",couponCode:e}),Ge=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return{type:"RECEIVE_CART_ITEM",cartItem:e}},Ue=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{type:"ITEM_PENDING_QUANTITY",cartItemKey:e,isPendingQuantity:t}},Ke=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{type:"RECEIVE_REMOVED_ITEM",cartItemKey:e,isPendingDelete:t}},Ye=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"SET_IS_CART_DATA_STALE",isCartDataStale:e}},He=e=>({type:"UPDATING_CUSTOMER_DATA",isResolving:e}),Qe=e=>({type:"UPDATING_SELECTED_SHIPPING_RATE",isResolving:e}),qe=()=>({type:"UPDATE_LEGACY_CART_FRAGMENTS"}),Be=()=>({type:"TRIGGER_ADDING_TO_CART_EVENT"}),ze=e=>{let{preserveCartData:t}=e;return{type:"TRIGGER_ADDED_TO_CART_EVENT",preserveCartData:t}};function*Je(e){try{const{response:t}=yield ae({path:"/wc/store/v1/cart/extensions",method:"POST",data:{namespace:e.namespace,data:e.data},cache:"no-store"});return yield Me(t),yield qe(),t}catch(e){var t;throw yield xe(e),null!==(t=e.data)&&void 0!==t&&t.cart&&(yield Me(e.data.cart)),e}}function*$e(e){yield Fe(e);try{const{response:t}=yield ae({path:"/wc/store/v1/cart/apply-coupon",method:"POST",data:{code:e},cache:"no-store"});yield Me(t),yield Fe(""),yield qe()}catch(e){var t;throw yield xe(e),yield Fe(""),null!==(t=e.data)&&void 0!==t&&t.cart&&(yield Me(e.data.cart)),e}return!0}function*We(e){yield Ve(e);try{const{response:t}=yield ae({path:"/wc/store/v1/cart/remove-coupon",method:"POST",data:{code:e},cache:"no-store"});yield Me(t),yield Ve(""),yield qe()}catch(e){var t;throw yield xe(e),yield Ve(""),null!==(t=e.data)&&void 0!==t&&t.cart&&(yield Me(e.data.cart)),e}return!0}function*Xe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;try{yield Be();const{response:n}=yield ae({path:"/wc/store/v1/cart/add-item",method:"POST",data:{id:e,quantity:t},cache:"no-store"});yield Me(n),yield ze({preserveCartData:!0}),yield qe()}catch(e){var n;throw yield xe(e),null!==(n=e.data)&&void 0!==n&&n.cart&&(yield Me(e.data.cart)),e}}function*Ze(e){yield Ke(e);try{const{response:t}=yield ae({path:"/wc/store/v1/cart/remove-item",data:{key:e},method:"POST",cache:"no-store"});yield Me(t),yield qe()}catch(e){var t;yield xe(e),null!==(t=e.data)&&void 0!==t&&t.cart&&(yield Me(e.data.cart))}yield Ke(e,!1)}function*et(e,t){const n=yield h.controls.resolveSelect(ye.b,"getCartItem",e);if((null==n?void 0:n.quantity)!==t){yield Ue(e);try{const{response:n}=yield ae({path:"/wc/store/v1/cart/update-item",method:"POST",data:{key:e,quantity:t},cache:"no-store"});yield Me(n),yield qe()}catch(e){var r;yield xe(e),null!==(r=e.data)&&void 0!==r&&r.cart&&(yield Me(e.data.cart))}yield Ue(e,!1)}}function*tt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;try{yield Qe(!0);const{response:n}=yield ae({path:"/wc/store/v1/cart/select-shipping-rate",method:"POST",data:{package_id:t,rate_id:e},cache:"no-store"});yield Me(n)}catch(e){var n;throw yield xe(e),yield Qe(!1),null!==(n=e.data)&&void 0!==n&&n.cart&&(yield Me(e.data.cart)),e}return yield Qe(!1),!0}const nt=e=>({type:"SET_BILLING_ADDRESS",billingAddress:e}),rt=e=>({type:"SET_SHIPPING_ADDRESS",shippingAddress:e});function*ot(e){yield He(!0);try{const{response:t}=yield ae({path:"/wc/store/v1/cart/update-customer",method:"POST",data:e,cache:"no-store"});yield Le(t)}catch(e){var t;throw yield xe(e),yield He(!1),null!==(t=e.data)&&void 0!==t&&t.cart&&(yield Me(e.data.cart)),e}return yield He(!1),!0}function*it(){const e=yield Object(y.apiFetch)({path:"/wc/store/v1/cart",method:"GET",cache:"no-store"});e?yield Me(e):yield xe(ye.a)}function*at(){yield h.controls.resolveSelect(ye.b,"getCartData")}const ct=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_CART_ITEM":return e.map(e=>{var n;return e.key===(null===(n=t.cartItem)||void 0===n?void 0:n.key)?t.cartItem:e})}return e};const st=window.CustomEvent||null,ut=(e,t)=>{let{bubbles:n=!1,cancelable:r=!1,element:o,detail:i={}}=t;if(!st)return;o||(o=document.body);const a=new st(e,{bubbles:n,cancelable:r,detail:i});o.dispatchEvent(a)};let lt;const dt={UPDATE_LEGACY_CART_FRAGMENTS(){lt&&clearTimeout(lt),lt=setTimeout(()=>{ut("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},TRIGGER_ADDING_TO_CART_EVENT(){ut("wc-blocks_adding_to_cart",{bubbles:!0,cancelable:!0})},TRIGGER_ADDED_TO_CART_EVENT(e){(e=>{let{preserveCartData:t=!1}=e;ut("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})})(e)}},pt=Object(ie.getSetting)("countryLocale",{}),ft=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(g.sprintf)( +/* translators: %s Field label. */ +Object(g.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&("number"==typeof e.priority&&(t.index=e.priority),(e=>"string"==typeof e)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t};Object.entries(pt).map(e=>{let[t,n]=e;return[t,Object.entries(n).map(e=>{let[t,n]=e;return[t,ft(n)]}).reduce((e,t)=>{let[n,r]=t;return e[n]=r,e},{})]}).reduce((e,t)=>{let[n,r]=t;return e[n]=r,e},{});const ht=e=>{let{country:t="",state:n="",city:r="",postcode:o=""}=e;return{country:t.trim(),state:n.trim(),city:r.trim(),postcode:o?o.replace(" ","").toUpperCase():""}},yt=e=>{let{email:t=""}=e;return Object(H.isEmail)(t)?t.trim():""};var mt=n(31),gt=n(16),vt=n.n(gt);const Et=(e,t)=>!(!(e=>"email"in e)(t)||yt(t)===yt(e))||!!t.country&&!vt()(ht(e),ht(t));let _t={billingAddress:{},shippingAddress:{}},bt=!1;const Tt={billingAddress:!1,shippingAddress:!1},wt=Object(F.debounce)(()=>{const{billingAddress:e,shippingAddress:t}=_t,n={};Tt.billingAddress&&(n.billing_address=e,Tt.billingAddress=!1),Tt.shippingAddress&&(n.shipping_address=t,Tt.shippingAddress=!1),Object.keys(n).length&&Object(h.dispatch)(ye.b).updateCustomerData(n).then(()=>{Object(h.dispatch)("core/notices").removeNotice("checkout","wc/checkout")}).catch(e=>{Object(h.dispatch)("core/notices").createNotice("error",(e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(mt.decodeEntities)(e.message):Object(g.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")})(e),{id:"checkout",context:"wc/checkout"})})},1e3);Object(h.registerStore)(ye.b,{reducer:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:me,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_ERROR":t.error&&(e={...e,errors:e.errors.concat(t.error)});break;case"REPLACE_ERRORS":t.error&&(e={...e,errors:[t.error]});break;case"RECEIVE_CART":t.response&&(e={...e,errors:R,cartData:{...e.cartData,...t.response}});break;case"APPLYING_COUPON":(t.couponCode||""===t.couponCode)&&(e={...e,metaData:{...e.metaData,applyingCoupon:t.couponCode}});break;case"SET_BILLING_ADDRESS":e={...e,cartData:{...e.cartData,billingAddress:{...e.cartData.billingAddress,...t.billingAddress}}};break;case"SET_SHIPPING_ADDRESS":e={...e,cartData:{...e.cartData,shippingAddress:{...e.cartData.shippingAddress,...t.shippingAddress}}};break;case"REMOVING_COUPON":(t.couponCode||""===t.couponCode)&&(e={...e,metaData:{...e.metaData,removingCoupon:t.couponCode}});break;case"ITEM_PENDING_QUANTITY":const n=e.cartItemsPendingQuantity.filter(e=>e!==t.cartItemKey);t.isPendingQuantity&&t.cartItemKey&&n.push(t.cartItemKey),e={...e,cartItemsPendingQuantity:n};break;case"RECEIVE_REMOVED_ITEM":const r=e.cartItemsPendingDelete.filter(e=>e!==t.cartItemKey);t.isPendingDelete&&t.cartItemKey&&r.push(t.cartItemKey),e={...e,cartItemsPendingDelete:r};break;case"RECEIVE_CART_ITEM":e={...e,errors:R,cartData:{...e.cartData,items:ct(e.cartData.items,t)}};break;case"UPDATING_CUSTOMER_DATA":e={...e,metaData:{...e.metaData,updatingCustomerData:!!t.isResolving}};break;case"UPDATING_SELECTED_SHIPPING_RATE":e={...e,metaData:{...e.metaData,updatingSelectedRate:!!t.isResolving}};break;case"SET_IS_CART_DATA_STALE":e={...e,metaData:{...e.metaData,isCartDataStale:t.isCartDataStale}}}return e},actions:l,controls:{...y.controls,...de,...dt},selectors:u,resolvers:d}).subscribe(()=>{const e=Object(h.select)(ye.b);if(!e.hasFinishedResolution("getCartData"))return;const t=e.getCustomerData();if(!bt)return _t=t,void(bt=!0);Et(_t.billingAddress,t.billingAddress)&&(Tt.billingAddress=!0),Et(_t.shippingAddress,t.shippingAddress)&&(Tt.shippingAddress=!0),_t=t,(Tt.billingAddress||Tt.shippingAddress)&&wt()});const Ct=ye.b,St=(e,t)=>void 0===e[t]?null:e[t],At=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=St(e,t);return null===o?r:(o=JSON.parse(o),void 0!==o[n]?o[n]:r)},Rt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=St(e,t);return null===r?n:JSON.parse(r)},Ot=(e,t,n)=>({type:"SET_QUERY_KEY_VALUE",context:e,queryKey:t,value:n}),It=(e,t)=>({type:"SET_QUERY_CONTEXT_VALUE",context:e,value:t});Object(h.registerStore)("wc/store/query-state",{reducer:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;const{type:n,context:r,queryKey:o,value:i}=t,a=St(e,r);let c;switch(n){case"SET_QUERY_KEY_VALUE":const t=null!==a?JSON.parse(a):{};t[o]=i,c=JSON.stringify(t),a!==c&&(e={...e,[r]:c});break;case"SET_QUERY_CONTEXT_VALUE":c=JSON.stringify(i),a!==c&&(e={...e,[r]:c})}return e},actions:f,selectors:p});const Dt="wc/store/query-state"},16:function(e,t){e.exports=window.wp.isShallowEqual},18:function(e,t){e.exports=window.wp.url},20:function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],l=!1,d=-1;function p(){l&&s&&(l=!1,s.length?u=s.concat(u):d=-1,u.length&&f())}function f(){if(!l){var e=c(p);l=!0;for(var t=u.length;t;){for(s=u,u=[];++d1)for(var n=1;n and returns Promise>, but got: "+e+".");this._batchLoadFn=e,this._maxBatchSize=function(e){if(e&&!1===e.batch)return 1;var t=e&&e.maxBatchSize;if(void 0===t)return 1/0;if("number"!=typeof t||t<1)throw new TypeError("maxBatchSize must be a positive number: "+t);return t}(t),this._batchScheduleFn=function(e){var t=e&&e.batchScheduleFn;if(void 0===t)return i;if("function"!=typeof t)throw new TypeError("batchScheduleFn must be a function: "+t);return t}(t),this._cacheKeyFn=function(e){var t=e&&e.cacheKeyFn;if(void 0===t)return function(e){return e};if("function"!=typeof t)throw new TypeError("cacheKeyFn must be a function: "+t);return t}(t),this._cacheMap=function(e){if(e&&!1===e.cache)return null;var t=e&&e.cacheMap;if(void 0===t)return new Map;if(null!==t){var n=["get","set","delete","clear"].filter((function(e){return t&&"function"!=typeof t[e]}));if(0!==n.length)throw new TypeError("Custom cacheMap missing methods: "+n.join(", "))}return t}(t),this._batch=null}var t=e.prototype;return t.load=function(e){if(null==e)throw new TypeError("The loader.load() function must be called with a value, but got: "+String(e)+".");var t=function(e){var t=e._batch;if(null!==t&&!t.hasDispatched&&t.keys.length and returns Promise>, but the function did not return a Promise: "+String(n)+"."));n.then((function(e){if(!s(e))throw new TypeError("DataLoader must be constructed with a function which accepts Array and returns Promise>, but the function did not return a Promise of an Array: "+String(e)+".");if(e.length!==t.keys.length)throw new TypeError("DataLoader must be constructed with a function which accepts Array and returns Promise>, but the function did not return a Promise of an Array of the same length as the Array of keys.\n\nKeys:\n"+String(t.keys)+"\n\nValues:\n"+String(e));c(t);for(var n=0;n but got: "+e+".");for(var t=[],n=0;n0&&Object.prototype.hasOwnProperty.call(e,e.length-1))}e.exports=o}).call(this,n(20),n(124).setImmediate)},31:function(e,t){e.exports=window.wp.htmlEntities},4:function(e,t){e.exports=window.lodash},5:function(e,t){e.exports=window.wc.wcSettings},9:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i}));var r=n(1);const o="wc/store/cart",i={code:"cart_api_error",message:Object(r.__)("Unable to get cart data from the API.","woo-gutenberg-products-block"),data:{status:500}}}}); \ No newline at end of file diff --git a/build/wc-blocks-editor-style-rtl.css b/build/wc-blocks-editor-style-rtl.css new file mode 100644 index 00000000000..1efc63662ce --- /dev/null +++ b/build/wc-blocks-editor-style-rtl.css @@ -0,0 +1 @@ +.editor-block-preview__content{overflow:hidden}.components-placeholder__label .gridicon,.components-placeholder__label .material-icon{fill:currentColor;margin-left:1ch}.editor-styles-wrapper .wc-block-grid .wc-block-grid__products{list-style:none;margin:0 -8px 16px;padding:0}.editor-styles-wrapper .wc-block-grid .wc-block-grid__products .wc-block-grid__product{margin:0 0 24px}.editor-styles-wrapper .wc-block-grid.components-placeholder{padding:2em 1em}.editor-styles-wrapper .wc-block-grid.is-loading,.editor-styles-wrapper .wc-block-grid.is-not-found{display:block}.components-base-control+.wc-block-base-control-notice{margin:-16px 0 16px}.components-base-control+.wc-block-base-control-notice:last-child{margin:-16px 0 12px}svg.wc-block-editor-components-block-icon{color:#7f54b3}svg.wc-block-editor-components-block-icon--sparkles path{fill:currentColor}.block-editor-list-view-leaf.is-selected .block-editor-list-view-block-contents svg.wc-block-editor-components-block-icon{color:currentColor}.woocommerce-search-list__list.woocommerce-search-list__list{box-sizing:border-box;margin:0;padding:0}.woocommerce-search-list__selected.woocommerce-search-list__selected>ul{list-style:none;margin:0;padding:0}.theme-twentytwenty .wp-block .wc-block-active-filters__title,.theme-twentytwenty .wp-block .wc-block-attribute-filter__title,.theme-twentytwenty .wp-block .wc-block-grid__product-title,.theme-twentytwenty .wp-block .wc-block-price-filter__title,.theme-twentytwenty .wp-block .wc-block-stock-filter__title{font-size:1em}.wc-atomic-blocks-product__selection{width:100%}.wc-atomic-blocks-product__edit-card{border-top:1px solid #e0e0e0;padding:16px}.wc-atomic-blocks-product__edit-card .wc-atomic-blocks-product__edit-card-title{margin:0 0 16px}.wc-block-components-product-summary p{font-size:inherit}.editor-styles-wrapper .wc-block-components-product-title a.wc-block-components-product-name{color:inherit}.editor-styles-wrapper .wc-block-components-product-title{display:block;font-size:inherit;font-weight:700;line-height:1.5;margin-bottom:12px;margin-top:0;padding:0}.wc-block-cart__page-notice{margin:0;padding-left:16px}.wc-block-cart__page-notice .components-notice__dismiss{min-width:24px}.wc-block-cart__page-notice svg{height:16px;width:16px}.wc-default-page-notice.is-dismissible{margin:0;padding-left:16px}.wc-default-page-notice.is-dismissible .components-notice__dismiss{min-width:24px}.wc-default-page-notice.is-dismissible svg{height:16px;width:16px}.wp-block-woocommerce-cart-items-block .block-list-appender,.wp-block-woocommerce-cart-totals-block .block-list-appender,.wp-block-woocommerce-empty-cart-block .block-list-appender{position:relative}.wp-block-woocommerce-cart-order-summary-block .block-editor-block-list__layout>div{margin:0!important}.wp-block-woocommerce-cart-order-summary-block .wc-block-components-totals-wrapper{box-sizing:border-box}.wp-block-woocommerce-cart-express-payment-block .components-placeholder__label svg{font-size:1em}.wp-block-woocommerce-cart-express-payment-block .wc-block-cart__payment-options{padding:0}.wp-block-woocommerce-cart-express-payment-block .wc-block-cart__payment-options .wc-block-components-express-payment-continue-rule{margin-bottom:-12px}.wp-block-woocommerce-cart-express-payment-block .wp-block-woocommerce-checkout-express-payment-block-placeholder,.wp-block-woocommerce-checkout-express-payment-block-placeholder .wp-block-woocommerce-checkout-express-payment-block-placeholder__description{margin:0 0 1em}.wp-block-woocommerce-cart-order-summary-heading-block textarea{height:auto;line-height:1;text-align:left;text-transform:uppercase}.wp-block-woocommerce-filled-cart-block .wc-block-components-sidebar-layout{display:block}.wp-block-woocommerce-filled-cart-block .block-editor-block-list__layout{align-items:flex-start;display:flex;flex-flow:row wrap}.wp-block-woocommerce-filled-cart-block .block-editor-block-list__layout>:first-child,.wp-block-woocommerce-filled-cart-block .wc-block-components-main>:first-child,.wp-block-woocommerce-filled-cart-block .wc-block-components-sidebar>:first-child{margin-top:0}.wp-block-woocommerce-filled-cart-block .wp-block-woocommerce-cart-items-block .block-editor-block-list__layout,.wp-block-woocommerce-filled-cart-block .wp-block-woocommerce-cart-totals-block .block-editor-block-list__layout{display:block}.wc-block-checkout__additional_fields{margin:1.5em 0 0}.wc-block-components-checkout-step__description-placeholder{opacity:.5}.wc-block-components-checkout-step__title{display:flex;width:100%}.wp-block-woocommerce-checkout-express-payment-block{margin:14px 0 28px}.wp-block-woocommerce-checkout-express-payment-block .components-placeholder__label svg{font-size:1em}.wp-block-woocommerce-checkout-express-payment-block .wc-block-components-express-payment-continue-rule--checkout{margin-bottom:0}.wp-block-woocommerce-checkout-express-payment-block.wp-block-woocommerce-checkout-express-payment-block--has-express-payment-methods{margin:-14px 0 14px!important;padding:14px 0;position:relative}.wp-block-woocommerce-checkout-express-payment-block-placeholder *{pointer-events:all}.wp-block-woocommerce-checkout-express-payment-block-placeholder .wp-block-woocommerce-checkout-express-payment-block-placeholder__description{display:block;margin:0 0 1em}.wp-block-woocommerce-checkout-order-note-block{margin-bottom:20px;margin-top:20px;padding-bottom:4px;padding-top:4px}.wp-block-woocommerce-checkout-order-note-block .wc-block-checkout__add-note{margin-bottom:0;margin-top:0}.wc-block-checkout__terms{align-items:flex-start;display:flex;margin:20px 0;padding-bottom:4px;padding-top:4px}.wc-block-checkout__terms .block-editor-rich-text__editable{line-height:1.5em;vertical-align:middle}.wc-block-components-checkbox{margin-top:0}.wc-block-components-checkbox.wc-block-checkout__create-account{margin-top:1em}.wc-block-checkout__terms_notice .components-notice__action{margin-right:0}.wc-block-checkout__terms_notice-button{align-items:center;display:flex;flex-direction:row}.wc-block-checkout__terms_notice-button .wc-block-checkout__terms_notice-button__icon{margin-right:4px}.wp-block-woocommerce-checkout .wc-block-components-sidebar-layout{display:block}.wp-block-woocommerce-checkout .block-editor-block-list__layout{align-items:flex-start;display:flex;flex-flow:row wrap}.wp-block-woocommerce-checkout .block-editor-block-list__layout .wc-block-checkout__additional_fields{padding:0}.wp-block-woocommerce-checkout .block-editor-block-list__layout>:first-child,.wp-block-woocommerce-checkout .wc-block-components-main>:first-child,.wp-block-woocommerce-checkout .wc-block-components-sidebar>:first-child{margin-top:0}.wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-fields-block .block-editor-block-list__layout,.wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-totals-block .block-editor-block-list__layout{display:block}.wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-fields-block .block-list-appender,.wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-totals-block .block-list-appender{position:relative}body.wc-lock-selected-block--move .block-editor-block-mover,body.wc-lock-selected-block--move .block-editor-block-mover__move-button-container,body.wc-lock-selected-block--remove .block-editor-block-settings-menu__popover .components-menu-group:last-child{display:none}body.wc-lock-selected-block--remove .block-editor-block-settings-menu__popover .components-menu-group:nth-last-child(2){margin-bottom:-12px}.wc-block-checkout__controls-text{color:#999;font-style:italic}.components-base-control--nested{margin-top:-12px;padding-right:52px}.components-panel__body-title .components-button{opacity:1}.wp-block-woocommerce-checkout.is-editor-preview{max-height:1000px;overflow:hidden}.wp-block-woocommerce-checkout-order-summary-block .block-editor-block-list__layout>div{margin:0!important}.wp-block-woocommerce-checkout-order-summary-block .wc-block-components-totals-wrapper{box-sizing:border-box}.wp-block-woocommerce-featured-category .is-applying .components-spinner{right:50%;margin-right:-9px;margin-top:-9px;position:absolute;top:50%}.wp-block-woocommerce-featured-category .is-applying img{opacity:.3}.wp-block-woocommerce-featured-category .components-resizable-box__container{bottom:0;right:0;min-height:50px;position:absolute!important;left:0;top:0}.wp-block-woocommerce-featured-category .components-resizable-box__container:not(.is-resizing){height:auto!important}.wp-block-woocommerce-featured-category .components-resizable-box__handle{z-index:10}.wp-block-woocommerce-featured-product .is-applying .components-spinner{right:50%;margin-right:-9px;margin-top:-9px;position:absolute;top:50%}.wp-block-woocommerce-featured-product .is-applying img{opacity:.3}.wp-block-woocommerce-featured-product .components-resizable-box__container{bottom:0;right:0;min-height:50px;position:absolute!important;left:0;top:0}.wp-block-woocommerce-featured-product .components-resizable-box__container:not(.is-resizing){height:auto!important}.wp-block-woocommerce-featured-product .components-resizable-box__handle{z-index:10}.wp-block-woocommerce-featured-product__message{margin-bottom:16px}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents{margin:0 auto!important;max-width:480px}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-empty-mini-cart-contents-block[hidden],.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-filled-mini-cart-contents-block[hidden]{display:none}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-filled-mini-cart-contents-block>.block-editor-inner-blocks>.block-editor-block-list__layout{display:flex;flex-direction:column;height:100vh}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-mini-cart-items-block{display:-ms-grid;display:grid;flex-grow:1;margin-bottom:16px;padding:0 16px}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-mini-cart-items-block>.block-editor-inner-blocks>.block-editor-block-list__layout{display:flex;flex-direction:column;height:100%}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-mini-cart-items-block .block-list-appender{position:relative}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-mini-cart-products-table-block{margin-bottom:auto;margin-top:16px}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents h2.wc-block-mini-cart__title{font-size:2em;margin:40px 16px 0}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents table.wc-block-cart-items{color:inherit}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .block-editor-button-block-appender{box-shadow:inset 0 0 0 1px;color:inherit}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-empty-mini-cart-contents-block{min-height:100vh;overflow-y:unset;padding:0}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-empty-mini-cart-contents-block>.block-editor-inner-blocks{box-sizing:border-box;max-height:100vh;overflow-y:auto;padding:40px 16px 16px}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-empty-mini-cart-contents-block .block-list-appender{margin-top:16px;position:relative}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wc-block-mini-cart__shopping-button a{color:currentColor}.wc-block-products .components-placeholder__instructions{border-bottom:1px solid #e0e2e6;margin-bottom:2em;padding-bottom:1em;width:100%}.wc-block-products .components-placeholder__label svg{fill:currentColor;margin-left:1ch}.wc-block-products .components-placeholder__fieldset{display:block}.wc-block-products .wc-block-products__add-product-button{height:auto;margin:0 0 1em;padding:.5em 1em;vertical-align:middle}.wc-block-products .wc-block-products__add-product-button svg{fill:currentColor;margin-right:.5ch;vertical-align:middle}.wc-block-products .wc-block-products__read_more_button{display:block;margin-bottom:1em}.wc-block-all-products .components-placeholder__fieldset{max-width:none;overflow:hidden}.wc-block-all-products .wc-block-all-products-grid-item-template{border-top:1px solid #e0e0e0;margin-top:20px;overflow:hidden;text-align:center;width:100%}.wc-block-all-products .wc-block-all-products-grid-item-template .components-tip{margin:20px auto;max-width:450px;text-align:right}.wc-block-all-products .wc-block-all-products-grid-item-template .components-tip p{margin:1em 0}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-all-products__actions{align-items:center;display:flex;margin:20px auto;max-width:450px;padding:1em 0 0;vertical-align:middle}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-all-products__actions .wc-block-all-products__done-button{height:auto;line-height:32px;margin:0;order:3}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-all-products__actions .wc-block-all-products__cancel-button{margin:0 auto 0 1em;order:2}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-all-products__actions .wc-block-all-products__reset-button{margin:0;order:1}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__products{margin:0 auto!important;max-width:450px;position:relative;text-align:center}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product{background:#fff;box-shadow:0 5px 7px -2px rgba(0,0,0,.2);margin:0 auto;padding:1px 20px;position:static}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product .wp-block-button__link{margin-top:0}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product:after,.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product:before{background:#e0e0e0;bottom:20px;content:"";display:block;position:absolute;top:20px;width:100%}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product:before{margin-left:30px;left:100%}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product:after{right:100%;margin-right:30px}.components-base-control+.wc-block-reviews-by-product__notice{margin:-16px 0 16px}.components-base-control:nth-last-child(2)+.wc-block-reviews-by-product__notice{margin:-16px 0 12px}.wc-block-single-product__selection{width:100%}.wc-block-single-product__reset-layout{padding:0}.wc-block-single-product__reset-layout svg{margin-left:4px}.wc-block-single-product__edit-card{border-top:1px solid #e0e0e0;padding:16px}.wc-block-single-product__edit-card .wc-block-single-product__edit-card-title{margin:0 0 16px}.wc-block-editor-components-title{background-color:transparent}.wc-block-error-message{margin-bottom:16px;margin-top:8px}.wc-block-api-error .components-placeholder__fieldset{display:block}.wc-block-api-error .wc-block-error-message{margin-top:0}.wc-block-api-error .components-spinner{float:none}.wc-block-editor-components-external-link-card{align-items:flex-start;color:inherit;display:flex;flex-direction:row;margin:24px 0;text-decoration:none}.wc-block-editor-components-external-link-card+.wc-block-editor-components-external-link-card{margin-top:-8px}.wc-block-editor-components-external-link-card .wc-block-editor-components-external-link-card__content{flex:1 1 0;padding-left:16px}.wc-block-editor-components-external-link-card .wc-block-editor-components-external-link-card__title{display:block;font-weight:500}.wc-block-editor-components-external-link-card .wc-block-editor-components-external-link-card__description{color:#757575;display:block;font-size:.875em;margin-top:.5em}.wc-block-editor-components-external-link-card .wc-block-editor-components-external-link-card__icon{color:inherit;flex:0 0 24px;margin:0;text-align:left;vertical-align:top}.wc-block-feedback-prompt{background-color:#f7f7f7;border-top:1px solid #e0e0e0;margin:0 -16px;padding:24px;text-align:center}.wc-block-feedback-prompt .wc-block-feedback-prompt__title{margin:0 0 12px}.wc-block-feedback-prompt .wc-block-feedback-prompt__link{color:inherit}.wc-block-feedback-prompt .wc-block-feedback-prompt__link>.gridicon{vertical-align:text-bottom}.woocommerce-product-attributes__operator .components-base-control__help{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;padding:0;position:absolute!important;width:1px}.woocommerce-product-attributes__operator .components-base-control__label{margin-bottom:0;margin-left:.5em}.woocommerce-search-list__item.woocommerce-product-attributes__item.is-searching .woocommerce-search-list__item-prefix:after,.woocommerce-search-list__item.woocommerce-product-attributes__item.is-skip-level .woocommerce-search-list__item-prefix:after{content:":"}.woocommerce-search-list__item.woocommerce-product-attributes__item.is-not-active:active,.woocommerce-search-list__item.woocommerce-product-attributes__item.is-not-active:focus,.woocommerce-search-list__item.woocommerce-product-attributes__item.is-not-active:hover{background:#fff}.woocommerce-search-list__item.woocommerce-product-attributes__item.is-loading{justify-content:center}.woocommerce-search-list__item.woocommerce-product-attributes__item.is-loading .components-spinner{margin-bottom:12px}.woocommerce-search-list__item.woocommerce-product-attributes__item.depth-0:after{background-image:url('data:image/svg+xml;utf8,');background-position:0;background-repeat:no-repeat;background-size:contain;content:"";height:24px;margin-right:8px;width:24px}.woocommerce-search-list__item.woocommerce-product-attributes__item.depth-0.is-selected:after{background-image:url('data:image/svg+xml;utf8,')}.woocommerce-search-list__item.woocommerce-product-attributes__item[disabled].depth-0:after{background:none;margin-right:0;width:auto}.woocommerce-product-categories__operator .components-base-control__help{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;padding:0;position:absolute!important;width:1px}.woocommerce-product-categories__operator .components-base-control__label{margin-bottom:0;margin-left:.5em}.woocommerce-search-product__item .woocommerce-search-list__item-name .description{display:block}.woocommerce-search-product__item.is-searching .woocommerce-search-list__item-prefix:after,.woocommerce-search-product__item.is-skip-level .woocommerce-search-list__item-prefix:after{content:":"}.woocommerce-search-product__item.is-not-active:active,.woocommerce-search-product__item.is-not-active:focus,.woocommerce-search-product__item.is-not-active:hover{background:#fff}.woocommerce-search-product__item.is-loading{justify-content:center}.woocommerce-search-product__item.is-loading .components-spinner{margin-bottom:12px}.woocommerce-search-product__item.depth-0.is-variable:after{background-image:url('data:image/svg+xml;utf8,');background-position:0;background-repeat:no-repeat;background-size:contain;content:"";height:24px;margin-right:8px;width:24px}.woocommerce-search-product__item.depth-0.is-variable.is-selected:after{background-image:url('data:image/svg+xml;utf8,')}.woocommerce-product-tags__operator .components-base-control__help{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;padding:0;position:absolute!important;width:1px}.woocommerce-product-tags__operator .components-base-control__label{margin-bottom:0;margin-left:.5em}.woocommerce-search-list{padding:0 0 16px;text-align:right;width:100%}.woocommerce-search-list__selected{border-top:1px solid #f0f0f0;margin:16px 0;min-height:76px;padding:16px 0 0}.woocommerce-search-list__selected .woocommerce-search-list__selected-header{margin-bottom:8px}.woocommerce-search-list__selected .woocommerce-search-list__selected-header button{margin-right:12px}.woocommerce-search-list__selected .woocommerce-tag__text{max-width:13em}.woocommerce-search-list__selected ul{list-style:none}.woocommerce-search-list__selected ul li{float:right}.woocommerce-search-list__search{border-top:1px solid #f0f0f0;margin:16px 0;padding:16px 0 0}.woocommerce-search-list__search .components-base-control__field{margin-bottom:16px}.woocommerce-search-list__list{border:1px solid #e0e0e0;max-height:17em;overflow-x:hidden;overflow-y:auto;padding:0}.woocommerce-search-list__list li{margin-bottom:0}.woocommerce-search-list__list.is-loading,.woocommerce-search-list__list.is-not-found{border:none;padding:12px 0;text-align:center}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon,.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-text{display:inline-block}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon{margin-left:16px}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon .gridicon{margin-top:-1px;vertical-align:top}.woocommerce-search-list__list .components-spinner{float:none;margin:0 auto}.woocommerce-search-list__list .components-menu-group__label{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;padding:0;position:absolute!important;width:1px}.woocommerce-search-list__list>[role=menu]{border:1px solid #f0f0f0;border-bottom:none}.woocommerce-search-list__list .woocommerce-search-list__item{align-items:center;background:#fff;border-bottom:1px solid #f0f0f0;color:#757575;display:flex;margin-bottom:0;padding:12px 16px}.woocommerce-search-list__list .woocommerce-search-list__item:active,.woocommerce-search-list__list .woocommerce-search-list__item:focus,.woocommerce-search-list__list .woocommerce-search-list__item:hover{background:#f0f0f0}.woocommerce-search-list__list .woocommerce-search-list__item:active,.woocommerce-search-list__list .woocommerce-search-list__item:focus{box-shadow:none}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-input{margin:0 0 0 8px}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-label{display:flex;flex:1}.woocommerce-search-list__list .woocommerce-search-list__item.depth-0+.depth-1{margin-top:-1px}.woocommerce-search-list__list .woocommerce-search-list__item:not(.depth-0){border-bottom:0!important}.woocommerce-search-list__list .woocommerce-search-list__item:not(.depth-0)+.depth-0{border-top:1px solid #f0f0f0}.woocommerce-search-list__list .woocommerce-search-list__item[class*=depth-] .woocommerce-search-list__item-label:before{content:str-repeat("— ",5);margin-left:4px}.woocommerce-search-list__list .woocommerce-search-list__item.depth-0 .woocommerce-search-list__item-label:before{content:"";margin-left:0}.woocommerce-search-list__list .woocommerce-search-list__item.depth-1 .woocommerce-search-list__item-label:before{content:str-repeat("— ",1)}.woocommerce-search-list__list .woocommerce-search-list__item.depth-2 .woocommerce-search-list__item-label:before{content:str-repeat("— ",2)}.woocommerce-search-list__list .woocommerce-search-list__item.depth-3 .woocommerce-search-list__item-label:before{content:str-repeat("— ",3)}.woocommerce-search-list__list .woocommerce-search-list__item.depth-4 .woocommerce-search-list__item-label:before{content:str-repeat("— ",4)}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-name{display:inline-block}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-prefix{color:#757575;display:none}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-label,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-label{display:inline-block}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-prefix,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-prefix{display:inline}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-prefix:after,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-prefix:after{content:" ›";margin-left:4px}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-name{color:#1e1e1e}.woocommerce-search-list__list .woocommerce-search-list__item.has-count>.components-menu-item__item{width:100%}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-count{background:#fff;border:1px solid #f0f0f0;border-radius:12px;color:#757575;flex:0 1 auto;font-size:.8em;line-height:1.4;padding:2px 8px;white-space:nowrap}.woocommerce-search-list__list li:last-child .woocommerce-search-list__item{border-bottom:none}.woocommerce-search-list.is-compact .woocommerce-search-list__selected{border-top:none;margin:0 0 16px;min-height:54px;padding:0}.woocommerce-search-list.is-compact .woocommerce-search-list__search{border-top:none;margin:0 0 16px;padding:0}.wc-blocks-sidebar-compatibility-notice{border-top:1px solid #e0e0e0}.wc-blocks-sidebar-compatibility-notice__notice.components-notice.is-dismissible{margin:0;padding:16px 16px 16px 12px}.wc-blocks-sidebar-compatibility-notice__notice.components-notice.is-dismissible .components-notice__content{margin-left:0}.woocommerce-tag{display:inline-flex;margin:1px 0 1px 4px;overflow:hidden;vertical-align:middle}.woocommerce-tag .woocommerce-tag__remove,.woocommerce-tag .woocommerce-tag__text{background:#f0f0f0;display:inline-block;line-height:24px;transition:all .2s cubic-bezier(.4,1,.4,1)}.woocommerce-tag .woocommerce-tag__text{-ms-grid-row-align:center;align-self:center;border-radius:12px;color:#757575;overflow:hidden;padding:0 8px;text-overflow:ellipsis;white-space:nowrap}.woocommerce-tag.has-remove .woocommerce-tag__text{border-radius:0 12px 12px 0;padding:0 8px 0 4px}.woocommerce-tag .woocommerce-tag__remove{border-radius:12px 0 0 12px;color:#757575;cursor:pointer;height:inherit;height:24px;line-height:10px;padding:0 2px;text-indent:0}.woocommerce-tag .woocommerce-tag__remove:hover{color:#1e1e1e}.wc-block-text-toolbar-button{align-items:center}.wc-block-text-toolbar-button.is-toggled,.wc-block-text-toolbar-button.is-toggled:focus{background:#757575;color:#fff}.block-editor-block-toolbar__slot{flex-shrink:0}.wc-block-view-switch-control{background:#f0f2f3;box-shadow:0 0 0 13px #f0f2f3;color:#757575;margin:0 0 27px;text-align:right;visibility:hidden}.has-child-selected .wc-block-view-switch-control,.is-selected .wc-block-view-switch-control{visibility:visible}.wc-block-handpicked-products__selection,.wc-block-products-category__selection,.wc-block-reviews__selection{width:100%}.wc-block-products-category__cancel-button.is-tertiary{margin:1em auto 0}.wc-block-product-categories.wc-block-product-categories ul{margin-right:20px}.wc-block-product-categories .components-placeholder__label svg,.wc-block-product-on-sale .components-placeholder__label svg{fill:currentColor;margin-left:1ch}.wc-block-products-by-attribute__selection{width:100%}.wc-block-product-search__field.input-control{color:#828b96!important;padding:0}.wc-block-product-search__field.input-control .components-base-control__field{margin-bottom:0}.wc-block-product-search .wc-block-product-search__fields .block-editor-rich-text{flex-grow:1}.wc-block-product-tag__selection{width:100%}.wc-block-product-tag__cancel-button.is-tertiary{margin:1em auto 0}.wp-block-woocommerce-price-filter .components-disabled{border-color:inherit;border-radius:inherit}.wp-block-woocommerce-price-filter .components-disabled .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input::-webkit-slider-thumb{pointer-events:none}.wp-block-woocommerce-price-filter .components-disabled .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input::-moz-range-thumb{pointer-events:none}.wp-block-woocommerce-price-filter .components-disabled .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input::-ms-thumb{pointer-events:none}.wc-block-price-filter__price-range-toggle{width:100%}.wc-block-price-filter__price-range-toggle>div{flex-grow:1}.components-base-control__label{font-size:.875em;text-transform:uppercase}.wc-block-price-slider .components-placeholder__instructions{border-bottom:1px solid #e0e2e6;margin-bottom:2em;padding-bottom:1em;width:100%}.wc-block-price-slider .components-placeholder__label svg{fill:currentColor;margin-left:1ch}.wc-block-price-slider .components-placeholder__fieldset{display:block}.wc-block-price-slider .wc-block-price-slider__add-product-button{height:auto;margin:0 0 1em;padding:.5em 1em;vertical-align:middle}.wc-block-price-slider .wc-block-price-slider__add-product-button svg{fill:currentColor;margin-right:.5ch;vertical-align:middle}.wc-block-price-slider .wc-block-price-slider__read_more_button{display:block;margin-bottom:1em}.editor-styles-wrapper .wp-block-woocommerce-attribute-filter{border-style:none!important}.wc-block-attribute-filter .components-placeholder__instructions{border-bottom:1px solid #e0e2e6;margin-bottom:2em;padding-bottom:1em;width:100%}.wc-block-attribute-filter .components-placeholder__label svg{fill:currentColor;margin-left:1ch}.wc-block-attribute-filter .components-placeholder__fieldset{display:block}.wc-block-attribute-filter .woocommerce-search-list__search{border-top:0;margin-top:0;padding-top:0}.wc-block-attribute-filter .wc-block-attribute-filter__add-attribute-button{height:auto;margin:0 0 1em;padding:.5em 1em;vertical-align:middle}.wc-block-attribute-filter .wc-block-attribute-filter__add-attribute-button svg{fill:currentColor;margin-right:.5ch;vertical-align:middle}.wc-block-attribute-filter .wc-block-attribute-filter__read_more_button{display:block;margin-bottom:1em}.wc-block-attribute-filter .components-disabled{border-color:inherit;border-radius:inherit}.wc-block-stock-filter .components-placeholder__instructions{border-bottom:1px solid #e0e2e6;margin-bottom:2em;padding-bottom:1em;width:100%}.wc-block-stock-filter .components-placeholder__label svg{fill:currentColor;margin-left:1ch}.wc-block-stock-filter .components-placeholder__fieldset{display:block}.wc-block-stock-filter .woocommerce-search-list__search{border-top:0;margin-top:0;padding-top:0}.wc-block-stock-filter .wc-block-stock-filter__add-stock-button{height:auto;margin:0 0 1em;padding:.5em 1em;vertical-align:middle}.wc-block-stock-filter .wc-block-stock-filter__add-stock-button svg{fill:currentColor;margin-right:.5ch;vertical-align:middle}.wc-block-stock-filter .wc-block-stock-filter__read_more_button{display:block;margin-bottom:1em}@-webkit-keyframes spinner__animation{0%{-webkit-animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(-1turn)}}@keyframes spinner__animation{0%{-webkit-animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(-1turn)}}@-webkit-keyframes loading__animation{to{transform:translateX(-100%)}}@keyframes loading__animation{to{transform:translateX(-100%)}}:where(.wp-block-woocommerce-legacy-template){margin-right:auto;margin-left:auto;max-width:1000px}.wp-block-woocommerce-classic-template__placeholder-copy{margin-bottom:30px;max-width:900px}.wp-block-woocommerce-classic-template__placeholder-warning{border-right:5px solid #2181d2;padding-right:2.5em}.wp-block-woocommerce-classic-template__placeholder-wireframe{background:#e5e5e5;height:250px;width:100%}@media only screen and (min-width:768px){.wp-block-woocommerce-classic-template__placeholder-wireframe{background:transparent;height:auto}}.wp-block-woocommerce-classic-template__placeholder .wp-block-woocommerce-classic-template__placeholder-image{display:none;height:auto;width:100%}@media only screen and (min-width:768px){.wp-block-woocommerce-classic-template__placeholder .wp-block-woocommerce-classic-template__placeholder-image{display:block}}.wp-block-woocommerce-classic-template__placeholder-wireframe{display:flex;flex-direction:column}.wp-block-woocommerce-classic-template__placeholder-migration-button-container{align-items:center;justify-content:center;margin:0 auto} \ No newline at end of file diff --git a/build/wc-blocks-editor-style.css b/build/wc-blocks-editor-style.css new file mode 100644 index 00000000000..4278202cf91 --- /dev/null +++ b/build/wc-blocks-editor-style.css @@ -0,0 +1 @@ +.editor-block-preview__content{overflow:hidden}.components-placeholder__label .gridicon,.components-placeholder__label .material-icon{fill:currentColor;margin-right:1ch}.editor-styles-wrapper .wc-block-grid .wc-block-grid__products{list-style:none;margin:0 -8px 16px;padding:0}.editor-styles-wrapper .wc-block-grid .wc-block-grid__products .wc-block-grid__product{margin:0 0 24px}.editor-styles-wrapper .wc-block-grid.components-placeholder{padding:2em 1em}.editor-styles-wrapper .wc-block-grid.is-loading,.editor-styles-wrapper .wc-block-grid.is-not-found{display:block}.components-base-control+.wc-block-base-control-notice{margin:-16px 0 16px}.components-base-control+.wc-block-base-control-notice:last-child{margin:-16px 0 12px}svg.wc-block-editor-components-block-icon{color:#7f54b3}svg.wc-block-editor-components-block-icon--sparkles path{fill:currentColor}.block-editor-list-view-leaf.is-selected .block-editor-list-view-block-contents svg.wc-block-editor-components-block-icon{color:currentColor}.woocommerce-search-list__list.woocommerce-search-list__list{box-sizing:border-box;margin:0;padding:0}.woocommerce-search-list__selected.woocommerce-search-list__selected>ul{list-style:none;margin:0;padding:0}.theme-twentytwenty .wp-block .wc-block-active-filters__title,.theme-twentytwenty .wp-block .wc-block-attribute-filter__title,.theme-twentytwenty .wp-block .wc-block-grid__product-title,.theme-twentytwenty .wp-block .wc-block-price-filter__title,.theme-twentytwenty .wp-block .wc-block-stock-filter__title{font-size:1em}.wc-atomic-blocks-product__selection{width:100%}.wc-atomic-blocks-product__edit-card{border-top:1px solid #e0e0e0;padding:16px}.wc-atomic-blocks-product__edit-card .wc-atomic-blocks-product__edit-card-title{margin:0 0 16px}.wc-block-components-product-summary p{font-size:inherit}.editor-styles-wrapper .wc-block-components-product-title a.wc-block-components-product-name{color:inherit}.editor-styles-wrapper .wc-block-components-product-title{display:block;font-size:inherit;font-weight:700;line-height:1.5;margin-bottom:12px;margin-top:0;padding:0}.wc-block-cart__page-notice{margin:0;padding-right:16px}.wc-block-cart__page-notice .components-notice__dismiss{min-width:24px}.wc-block-cart__page-notice svg{height:16px;width:16px}.wc-default-page-notice.is-dismissible{margin:0;padding-right:16px}.wc-default-page-notice.is-dismissible .components-notice__dismiss{min-width:24px}.wc-default-page-notice.is-dismissible svg{height:16px;width:16px}.wp-block-woocommerce-cart-items-block .block-list-appender,.wp-block-woocommerce-cart-totals-block .block-list-appender,.wp-block-woocommerce-empty-cart-block .block-list-appender{position:relative}.wp-block-woocommerce-cart-order-summary-block .block-editor-block-list__layout>div{margin:0!important}.wp-block-woocommerce-cart-order-summary-block .wc-block-components-totals-wrapper{box-sizing:border-box}.wp-block-woocommerce-cart-express-payment-block .components-placeholder__label svg{font-size:1em}.wp-block-woocommerce-cart-express-payment-block .wc-block-cart__payment-options{padding:0}.wp-block-woocommerce-cart-express-payment-block .wc-block-cart__payment-options .wc-block-components-express-payment-continue-rule{margin-bottom:-12px}.wp-block-woocommerce-cart-express-payment-block .wp-block-woocommerce-checkout-express-payment-block-placeholder,.wp-block-woocommerce-checkout-express-payment-block-placeholder .wp-block-woocommerce-checkout-express-payment-block-placeholder__description{margin:0 0 1em}.wp-block-woocommerce-cart-order-summary-heading-block textarea{height:auto;line-height:1;text-align:right;text-transform:uppercase}.wp-block-woocommerce-filled-cart-block .wc-block-components-sidebar-layout{display:block}.wp-block-woocommerce-filled-cart-block .block-editor-block-list__layout{align-items:flex-start;display:flex;flex-flow:row wrap}.wp-block-woocommerce-filled-cart-block .block-editor-block-list__layout>:first-child,.wp-block-woocommerce-filled-cart-block .wc-block-components-main>:first-child,.wp-block-woocommerce-filled-cart-block .wc-block-components-sidebar>:first-child{margin-top:0}.wp-block-woocommerce-filled-cart-block .wp-block-woocommerce-cart-items-block .block-editor-block-list__layout,.wp-block-woocommerce-filled-cart-block .wp-block-woocommerce-cart-totals-block .block-editor-block-list__layout{display:block}.wc-block-checkout__additional_fields{margin:1.5em 0 0}.wc-block-components-checkout-step__description-placeholder{opacity:.5}.wc-block-components-checkout-step__title{display:flex;width:100%}.wp-block-woocommerce-checkout-express-payment-block{margin:14px 0 28px}.wp-block-woocommerce-checkout-express-payment-block .components-placeholder__label svg{font-size:1em}.wp-block-woocommerce-checkout-express-payment-block .wc-block-components-express-payment-continue-rule--checkout{margin-bottom:0}.wp-block-woocommerce-checkout-express-payment-block.wp-block-woocommerce-checkout-express-payment-block--has-express-payment-methods{margin:-14px 0 14px!important;padding:14px 0;position:relative}.wp-block-woocommerce-checkout-express-payment-block-placeholder *{pointer-events:all}.wp-block-woocommerce-checkout-express-payment-block-placeholder .wp-block-woocommerce-checkout-express-payment-block-placeholder__description{display:block;margin:0 0 1em}.wp-block-woocommerce-checkout-order-note-block{margin-bottom:20px;margin-top:20px;padding-bottom:4px;padding-top:4px}.wp-block-woocommerce-checkout-order-note-block .wc-block-checkout__add-note{margin-bottom:0;margin-top:0}.wc-block-checkout__terms{align-items:flex-start;display:flex;margin:20px 0;padding-bottom:4px;padding-top:4px}.wc-block-checkout__terms .block-editor-rich-text__editable{line-height:1.5em;vertical-align:middle}.wc-block-components-checkbox{margin-top:0}.wc-block-components-checkbox.wc-block-checkout__create-account{margin-top:1em}.wc-block-checkout__terms_notice .components-notice__action{margin-left:0}.wc-block-checkout__terms_notice-button{align-items:center;display:flex;flex-direction:row}.wc-block-checkout__terms_notice-button .wc-block-checkout__terms_notice-button__icon{margin-left:4px}.wp-block-woocommerce-checkout .wc-block-components-sidebar-layout{display:block}.wp-block-woocommerce-checkout .block-editor-block-list__layout{align-items:flex-start;display:flex;flex-flow:row wrap}.wp-block-woocommerce-checkout .block-editor-block-list__layout .wc-block-checkout__additional_fields{padding:0}.wp-block-woocommerce-checkout .block-editor-block-list__layout>:first-child,.wp-block-woocommerce-checkout .wc-block-components-main>:first-child,.wp-block-woocommerce-checkout .wc-block-components-sidebar>:first-child{margin-top:0}.wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-fields-block .block-editor-block-list__layout,.wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-totals-block .block-editor-block-list__layout{display:block}.wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-fields-block .block-list-appender,.wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-totals-block .block-list-appender{position:relative}body.wc-lock-selected-block--move .block-editor-block-mover,body.wc-lock-selected-block--move .block-editor-block-mover__move-button-container,body.wc-lock-selected-block--remove .block-editor-block-settings-menu__popover .components-menu-group:last-child{display:none}body.wc-lock-selected-block--remove .block-editor-block-settings-menu__popover .components-menu-group:nth-last-child(2){margin-bottom:-12px}.wc-block-checkout__controls-text{color:#999;font-style:italic}.components-base-control--nested{margin-top:-12px;padding-left:52px}.components-panel__body-title .components-button{opacity:1}.wp-block-woocommerce-checkout.is-editor-preview{max-height:1000px;overflow:hidden}.wp-block-woocommerce-checkout-order-summary-block .block-editor-block-list__layout>div{margin:0!important}.wp-block-woocommerce-checkout-order-summary-block .wc-block-components-totals-wrapper{box-sizing:border-box}.wp-block-woocommerce-featured-category .is-applying .components-spinner{left:50%;margin-left:-9px;margin-top:-9px;position:absolute;top:50%}.wp-block-woocommerce-featured-category .is-applying img{opacity:.3}.wp-block-woocommerce-featured-category .components-resizable-box__container{bottom:0;left:0;min-height:50px;position:absolute!important;right:0;top:0}.wp-block-woocommerce-featured-category .components-resizable-box__container:not(.is-resizing){height:auto!important}.wp-block-woocommerce-featured-category .components-resizable-box__handle{z-index:10}.wp-block-woocommerce-featured-product .is-applying .components-spinner{left:50%;margin-left:-9px;margin-top:-9px;position:absolute;top:50%}.wp-block-woocommerce-featured-product .is-applying img{opacity:.3}.wp-block-woocommerce-featured-product .components-resizable-box__container{bottom:0;left:0;min-height:50px;position:absolute!important;right:0;top:0}.wp-block-woocommerce-featured-product .components-resizable-box__container:not(.is-resizing){height:auto!important}.wp-block-woocommerce-featured-product .components-resizable-box__handle{z-index:10}.wp-block-woocommerce-featured-product__message{margin-bottom:16px}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents{margin:0 auto!important;max-width:480px}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-empty-mini-cart-contents-block[hidden],.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-filled-mini-cart-contents-block[hidden]{display:none}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-filled-mini-cart-contents-block>.block-editor-inner-blocks>.block-editor-block-list__layout{display:flex;flex-direction:column;height:100vh}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-mini-cart-items-block{display:-ms-grid;display:grid;flex-grow:1;margin-bottom:16px;padding:0 16px}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-mini-cart-items-block>.block-editor-inner-blocks>.block-editor-block-list__layout{display:flex;flex-direction:column;height:100%}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-mini-cart-items-block .block-list-appender{position:relative}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-mini-cart-products-table-block{margin-bottom:auto;margin-top:16px}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents h2.wc-block-mini-cart__title{font-size:2em;margin:40px 16px 0}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents table.wc-block-cart-items{color:inherit}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .block-editor-button-block-appender{box-shadow:inset 0 0 0 1px;color:inherit}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-empty-mini-cart-contents-block{min-height:100vh;overflow-y:unset;padding:0}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-empty-mini-cart-contents-block>.block-editor-inner-blocks{box-sizing:border-box;max-height:100vh;overflow-y:auto;padding:40px 16px 16px}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wp-block-woocommerce-empty-mini-cart-contents-block .block-list-appender{margin-top:16px;position:relative}.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents .wc-block-mini-cart__shopping-button a{color:currentColor}.wc-block-products .components-placeholder__instructions{border-bottom:1px solid #e0e2e6;margin-bottom:2em;padding-bottom:1em;width:100%}.wc-block-products .components-placeholder__label svg{fill:currentColor;margin-right:1ch}.wc-block-products .components-placeholder__fieldset{display:block}.wc-block-products .wc-block-products__add-product-button{height:auto;margin:0 0 1em;padding:.5em 1em;vertical-align:middle}.wc-block-products .wc-block-products__add-product-button svg{fill:currentColor;margin-left:.5ch;vertical-align:middle}.wc-block-products .wc-block-products__read_more_button{display:block;margin-bottom:1em}.wc-block-all-products .components-placeholder__fieldset{max-width:none;overflow:hidden}.wc-block-all-products .wc-block-all-products-grid-item-template{border-top:1px solid #e0e0e0;margin-top:20px;overflow:hidden;text-align:center;width:100%}.wc-block-all-products .wc-block-all-products-grid-item-template .components-tip{margin:20px auto;max-width:450px;text-align:left}.wc-block-all-products .wc-block-all-products-grid-item-template .components-tip p{margin:1em 0}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-all-products__actions{align-items:center;display:flex;margin:20px auto;max-width:450px;padding:1em 0 0;vertical-align:middle}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-all-products__actions .wc-block-all-products__done-button{height:auto;line-height:32px;margin:0;order:3}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-all-products__actions .wc-block-all-products__cancel-button{margin:0 1em 0 auto;order:2}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-all-products__actions .wc-block-all-products__reset-button{margin:0;order:1}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__products{margin:0 auto!important;max-width:450px;position:relative;text-align:center}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product{background:#fff;box-shadow:0 5px 7px -2px rgba(0,0,0,.2);margin:0 auto;padding:1px 20px;position:static}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product .wp-block-button__link{margin-top:0}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product:after,.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product:before{background:#e0e0e0;bottom:20px;content:"";display:block;position:absolute;top:20px;width:100%}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product:before{margin-right:30px;right:100%}.wc-block-all-products .wc-block-all-products-grid-item-template .wc-block-grid__product:after{left:100%;margin-left:30px}.components-base-control+.wc-block-reviews-by-product__notice{margin:-16px 0 16px}.components-base-control:nth-last-child(2)+.wc-block-reviews-by-product__notice{margin:-16px 0 12px}.wc-block-single-product__selection{width:100%}.wc-block-single-product__reset-layout{padding:0}.wc-block-single-product__reset-layout svg{margin-right:4px}.wc-block-single-product__edit-card{border-top:1px solid #e0e0e0;padding:16px}.wc-block-single-product__edit-card .wc-block-single-product__edit-card-title{margin:0 0 16px}.wc-block-editor-components-title{background-color:transparent}.wc-block-error-message{margin-bottom:16px;margin-top:8px}.wc-block-api-error .components-placeholder__fieldset{display:block}.wc-block-api-error .wc-block-error-message{margin-top:0}.wc-block-api-error .components-spinner{float:none}.wc-block-editor-components-external-link-card{align-items:flex-start;color:inherit;display:flex;flex-direction:row;margin:24px 0;text-decoration:none}.wc-block-editor-components-external-link-card+.wc-block-editor-components-external-link-card{margin-top:-8px}.wc-block-editor-components-external-link-card .wc-block-editor-components-external-link-card__content{flex:1 1 0;padding-right:16px}.wc-block-editor-components-external-link-card .wc-block-editor-components-external-link-card__title{display:block;font-weight:500}.wc-block-editor-components-external-link-card .wc-block-editor-components-external-link-card__description{color:#757575;display:block;font-size:.875em;margin-top:.5em}.wc-block-editor-components-external-link-card .wc-block-editor-components-external-link-card__icon{color:inherit;flex:0 0 24px;margin:0;text-align:right;vertical-align:top}.wc-block-feedback-prompt{background-color:#f7f7f7;border-top:1px solid #e0e0e0;margin:0 -16px;padding:24px;text-align:center}.wc-block-feedback-prompt .wc-block-feedback-prompt__title{margin:0 0 12px}.wc-block-feedback-prompt .wc-block-feedback-prompt__link{color:inherit}.wc-block-feedback-prompt .wc-block-feedback-prompt__link>.gridicon{vertical-align:text-bottom}.woocommerce-product-attributes__operator .components-base-control__help{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;padding:0;position:absolute!important;width:1px}.woocommerce-product-attributes__operator .components-base-control__label{margin-bottom:0;margin-right:.5em}.woocommerce-search-list__item.woocommerce-product-attributes__item.is-searching .woocommerce-search-list__item-prefix:after,.woocommerce-search-list__item.woocommerce-product-attributes__item.is-skip-level .woocommerce-search-list__item-prefix:after{content:":"}.woocommerce-search-list__item.woocommerce-product-attributes__item.is-not-active:active,.woocommerce-search-list__item.woocommerce-product-attributes__item.is-not-active:focus,.woocommerce-search-list__item.woocommerce-product-attributes__item.is-not-active:hover{background:#fff}.woocommerce-search-list__item.woocommerce-product-attributes__item.is-loading{justify-content:center}.woocommerce-search-list__item.woocommerce-product-attributes__item.is-loading .components-spinner{margin-bottom:12px}.woocommerce-search-list__item.woocommerce-product-attributes__item.depth-0:after{background-image:url('data:image/svg+xml;utf8,');background-position:100%;background-repeat:no-repeat;background-size:contain;content:"";height:24px;margin-left:8px;width:24px}.woocommerce-search-list__item.woocommerce-product-attributes__item.depth-0.is-selected:after{background-image:url('data:image/svg+xml;utf8,')}.woocommerce-search-list__item.woocommerce-product-attributes__item[disabled].depth-0:after{background:none;margin-left:0;width:auto}.woocommerce-product-categories__operator .components-base-control__help{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;padding:0;position:absolute!important;width:1px}.woocommerce-product-categories__operator .components-base-control__label{margin-bottom:0;margin-right:.5em}.woocommerce-search-product__item .woocommerce-search-list__item-name .description{display:block}.woocommerce-search-product__item.is-searching .woocommerce-search-list__item-prefix:after,.woocommerce-search-product__item.is-skip-level .woocommerce-search-list__item-prefix:after{content:":"}.woocommerce-search-product__item.is-not-active:active,.woocommerce-search-product__item.is-not-active:focus,.woocommerce-search-product__item.is-not-active:hover{background:#fff}.woocommerce-search-product__item.is-loading{justify-content:center}.woocommerce-search-product__item.is-loading .components-spinner{margin-bottom:12px}.woocommerce-search-product__item.depth-0.is-variable:after{background-image:url('data:image/svg+xml;utf8,');background-position:100%;background-repeat:no-repeat;background-size:contain;content:"";height:24px;margin-left:8px;width:24px}.woocommerce-search-product__item.depth-0.is-variable.is-selected:after{background-image:url('data:image/svg+xml;utf8,')}.woocommerce-product-tags__operator .components-base-control__help{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;padding:0;position:absolute!important;width:1px}.woocommerce-product-tags__operator .components-base-control__label{margin-bottom:0;margin-right:.5em}.woocommerce-search-list{padding:0 0 16px;text-align:left;width:100%}.woocommerce-search-list__selected{border-top:1px solid #f0f0f0;margin:16px 0;min-height:76px;padding:16px 0 0}.woocommerce-search-list__selected .woocommerce-search-list__selected-header{margin-bottom:8px}.woocommerce-search-list__selected .woocommerce-search-list__selected-header button{margin-left:12px}.woocommerce-search-list__selected .woocommerce-tag__text{max-width:13em}.woocommerce-search-list__selected ul{list-style:none}.woocommerce-search-list__selected ul li{float:left}.woocommerce-search-list__search{border-top:1px solid #f0f0f0;margin:16px 0;padding:16px 0 0}.woocommerce-search-list__search .components-base-control__field{margin-bottom:16px}.woocommerce-search-list__list{border:1px solid #e0e0e0;max-height:17em;overflow-x:hidden;overflow-y:auto;padding:0}.woocommerce-search-list__list li{margin-bottom:0}.woocommerce-search-list__list.is-loading,.woocommerce-search-list__list.is-not-found{border:none;padding:12px 0;text-align:center}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon,.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-text{display:inline-block}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon{margin-right:16px}.woocommerce-search-list__list.is-not-found .woocommerce-search-list__not-found-icon .gridicon{margin-top:-1px;vertical-align:top}.woocommerce-search-list__list .components-spinner{float:none;margin:0 auto}.woocommerce-search-list__list .components-menu-group__label{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;padding:0;position:absolute!important;width:1px}.woocommerce-search-list__list>[role=menu]{border:1px solid #f0f0f0;border-bottom:none}.woocommerce-search-list__list .woocommerce-search-list__item{align-items:center;background:#fff;border-bottom:1px solid #f0f0f0;color:#757575;display:flex;margin-bottom:0;padding:12px 16px}.woocommerce-search-list__list .woocommerce-search-list__item:active,.woocommerce-search-list__list .woocommerce-search-list__item:focus,.woocommerce-search-list__list .woocommerce-search-list__item:hover{background:#f0f0f0}.woocommerce-search-list__list .woocommerce-search-list__item:active,.woocommerce-search-list__list .woocommerce-search-list__item:focus{box-shadow:none}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-input{margin:0 8px 0 0}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-label{display:flex;flex:1}.woocommerce-search-list__list .woocommerce-search-list__item.depth-0+.depth-1{margin-top:-1px}.woocommerce-search-list__list .woocommerce-search-list__item:not(.depth-0){border-bottom:0!important}.woocommerce-search-list__list .woocommerce-search-list__item:not(.depth-0)+.depth-0{border-top:1px solid #f0f0f0}.woocommerce-search-list__list .woocommerce-search-list__item[class*=depth-] .woocommerce-search-list__item-label:before{content:str-repeat("— ",5);margin-right:4px}.woocommerce-search-list__list .woocommerce-search-list__item.depth-0 .woocommerce-search-list__item-label:before{content:"";margin-right:0}.woocommerce-search-list__list .woocommerce-search-list__item.depth-1 .woocommerce-search-list__item-label:before{content:str-repeat("— ",1)}.woocommerce-search-list__list .woocommerce-search-list__item.depth-2 .woocommerce-search-list__item-label:before{content:str-repeat("— ",2)}.woocommerce-search-list__list .woocommerce-search-list__item.depth-3 .woocommerce-search-list__item-label:before{content:str-repeat("— ",3)}.woocommerce-search-list__list .woocommerce-search-list__item.depth-4 .woocommerce-search-list__item-label:before{content:str-repeat("— ",4)}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-name{display:inline-block}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-prefix{color:#757575;display:none}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-label,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-label{display:inline-block}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-prefix,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-prefix{display:inline}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-prefix:after,.woocommerce-search-list__list .woocommerce-search-list__item.is-skip-level .woocommerce-search-list__item-prefix:after{content:" ›";margin-right:4px}.woocommerce-search-list__list .woocommerce-search-list__item.is-searching .woocommerce-search-list__item-name{color:#1e1e1e}.woocommerce-search-list__list .woocommerce-search-list__item.has-count>.components-menu-item__item{width:100%}.woocommerce-search-list__list .woocommerce-search-list__item .woocommerce-search-list__item-count{background:#fff;border:1px solid #f0f0f0;border-radius:12px;color:#757575;flex:0 1 auto;font-size:.8em;line-height:1.4;padding:2px 8px;white-space:nowrap}.woocommerce-search-list__list li:last-child .woocommerce-search-list__item{border-bottom:none}.woocommerce-search-list.is-compact .woocommerce-search-list__selected{border-top:none;margin:0 0 16px;min-height:54px;padding:0}.woocommerce-search-list.is-compact .woocommerce-search-list__search{border-top:none;margin:0 0 16px;padding:0}.wc-blocks-sidebar-compatibility-notice{border-top:1px solid #e0e0e0}.wc-blocks-sidebar-compatibility-notice__notice.components-notice.is-dismissible{margin:0;padding:16px 12px 16px 16px}.wc-blocks-sidebar-compatibility-notice__notice.components-notice.is-dismissible .components-notice__content{margin-right:0}.woocommerce-tag{display:inline-flex;margin:1px 4px 1px 0;overflow:hidden;vertical-align:middle}.woocommerce-tag .woocommerce-tag__remove,.woocommerce-tag .woocommerce-tag__text{background:#f0f0f0;display:inline-block;line-height:24px;transition:all .2s cubic-bezier(.4,1,.4,1)}.woocommerce-tag .woocommerce-tag__text{-ms-grid-row-align:center;align-self:center;border-radius:12px;color:#757575;overflow:hidden;padding:0 8px;text-overflow:ellipsis;white-space:nowrap}.woocommerce-tag.has-remove .woocommerce-tag__text{border-radius:12px 0 0 12px;padding:0 4px 0 8px}.woocommerce-tag .woocommerce-tag__remove{border-radius:0 12px 12px 0;color:#757575;cursor:pointer;height:inherit;height:24px;line-height:10px;padding:0 2px;text-indent:0}.woocommerce-tag .woocommerce-tag__remove:hover{color:#1e1e1e}.wc-block-text-toolbar-button{align-items:center}.wc-block-text-toolbar-button.is-toggled,.wc-block-text-toolbar-button.is-toggled:focus{background:#757575;color:#fff}.block-editor-block-toolbar__slot{flex-shrink:0}.wc-block-view-switch-control{background:#f0f2f3;box-shadow:0 0 0 13px #f0f2f3;color:#757575;margin:0 0 27px;text-align:left;visibility:hidden}.has-child-selected .wc-block-view-switch-control,.is-selected .wc-block-view-switch-control{visibility:visible}.wc-block-handpicked-products__selection,.wc-block-products-category__selection,.wc-block-reviews__selection{width:100%}.wc-block-products-category__cancel-button.is-tertiary{margin:1em auto 0}.wc-block-product-categories.wc-block-product-categories ul{margin-left:20px}.wc-block-product-categories .components-placeholder__label svg,.wc-block-product-on-sale .components-placeholder__label svg{fill:currentColor;margin-right:1ch}.wc-block-products-by-attribute__selection{width:100%}.wc-block-product-search__field.input-control{color:#828b96!important;padding:0}.wc-block-product-search__field.input-control .components-base-control__field{margin-bottom:0}.wc-block-product-search .wc-block-product-search__fields .block-editor-rich-text{flex-grow:1}.wc-block-product-tag__selection{width:100%}.wc-block-product-tag__cancel-button.is-tertiary{margin:1em auto 0}.wp-block-woocommerce-price-filter .components-disabled{border-color:inherit;border-radius:inherit}.wp-block-woocommerce-price-filter .components-disabled .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input::-webkit-slider-thumb{pointer-events:none}.wp-block-woocommerce-price-filter .components-disabled .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input::-moz-range-thumb{pointer-events:none}.wp-block-woocommerce-price-filter .components-disabled .wc-block-price-filter__range-input-wrapper .wc-block-price-filter__range-input::-ms-thumb{pointer-events:none}.wc-block-price-filter__price-range-toggle{width:100%}.wc-block-price-filter__price-range-toggle>div{flex-grow:1}.components-base-control__label{font-size:.875em;text-transform:uppercase}.wc-block-price-slider .components-placeholder__instructions{border-bottom:1px solid #e0e2e6;margin-bottom:2em;padding-bottom:1em;width:100%}.wc-block-price-slider .components-placeholder__label svg{fill:currentColor;margin-right:1ch}.wc-block-price-slider .components-placeholder__fieldset{display:block}.wc-block-price-slider .wc-block-price-slider__add-product-button{height:auto;margin:0 0 1em;padding:.5em 1em;vertical-align:middle}.wc-block-price-slider .wc-block-price-slider__add-product-button svg{fill:currentColor;margin-left:.5ch;vertical-align:middle}.wc-block-price-slider .wc-block-price-slider__read_more_button{display:block;margin-bottom:1em}.editor-styles-wrapper .wp-block-woocommerce-attribute-filter{border-style:none!important}.wc-block-attribute-filter .components-placeholder__instructions{border-bottom:1px solid #e0e2e6;margin-bottom:2em;padding-bottom:1em;width:100%}.wc-block-attribute-filter .components-placeholder__label svg{fill:currentColor;margin-right:1ch}.wc-block-attribute-filter .components-placeholder__fieldset{display:block}.wc-block-attribute-filter .woocommerce-search-list__search{border-top:0;margin-top:0;padding-top:0}.wc-block-attribute-filter .wc-block-attribute-filter__add-attribute-button{height:auto;margin:0 0 1em;padding:.5em 1em;vertical-align:middle}.wc-block-attribute-filter .wc-block-attribute-filter__add-attribute-button svg{fill:currentColor;margin-left:.5ch;vertical-align:middle}.wc-block-attribute-filter .wc-block-attribute-filter__read_more_button{display:block;margin-bottom:1em}.wc-block-attribute-filter .components-disabled{border-color:inherit;border-radius:inherit}.wc-block-stock-filter .components-placeholder__instructions{border-bottom:1px solid #e0e2e6;margin-bottom:2em;padding-bottom:1em;width:100%}.wc-block-stock-filter .components-placeholder__label svg{fill:currentColor;margin-right:1ch}.wc-block-stock-filter .components-placeholder__fieldset{display:block}.wc-block-stock-filter .woocommerce-search-list__search{border-top:0;margin-top:0;padding-top:0}.wc-block-stock-filter .wc-block-stock-filter__add-stock-button{height:auto;margin:0 0 1em;padding:.5em 1em;vertical-align:middle}.wc-block-stock-filter .wc-block-stock-filter__add-stock-button svg{fill:currentColor;margin-left:.5ch;vertical-align:middle}.wc-block-stock-filter .wc-block-stock-filter__read_more_button{display:block;margin-bottom:1em}@-webkit-keyframes spinner__animation{0%{-webkit-animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes spinner__animation{0%{-webkit-animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(1turn)}}@-webkit-keyframes loading__animation{to{transform:translateX(100%)}}@keyframes loading__animation{to{transform:translateX(100%)}}:where(.wp-block-woocommerce-legacy-template){margin-left:auto;margin-right:auto;max-width:1000px}.wp-block-woocommerce-classic-template__placeholder-copy{margin-bottom:30px;max-width:900px}.wp-block-woocommerce-classic-template__placeholder-warning{border-left:5px solid #2181d2;padding-left:2.5em}.wp-block-woocommerce-classic-template__placeholder-wireframe{background:#e5e5e5;height:250px;width:100%}@media only screen and (min-width:768px){.wp-block-woocommerce-classic-template__placeholder-wireframe{background:transparent;height:auto}}.wp-block-woocommerce-classic-template__placeholder .wp-block-woocommerce-classic-template__placeholder-image{display:none;height:auto;width:100%}@media only screen and (min-width:768px){.wp-block-woocommerce-classic-template__placeholder .wp-block-woocommerce-classic-template__placeholder-image{display:block}}.wp-block-woocommerce-classic-template__placeholder-wireframe{display:flex;flex-direction:column}.wp-block-woocommerce-classic-template__placeholder-migration-button-container{align-items:center;justify-content:center;margin:0 auto} \ No newline at end of file diff --git a/build/wc-blocks-google-analytics.asset.php b/build/wc-blocks-google-analytics.asset.php new file mode 100644 index 00000000000..ce822c1ec30 --- /dev/null +++ b/build/wc-blocks-google-analytics.asset.php @@ -0,0 +1 @@ + array('wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => 'ca4afc6fb8557d3f4bf744a6446d1b9a'); \ No newline at end of file diff --git a/build/wc-blocks-google-analytics.js b/build/wc-blocks-google-analytics.js new file mode 100644 index 00000000000..7507e2a8dfb --- /dev/null +++ b/build/wc-blocks-google-analytics.js @@ -0,0 +1 @@ +!function(e){var t={};function o(c){if(t[c])return t[c].exports;var n=t[c]={i:c,l:!1,exports:{}};return e[c].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=t,o.d=function(e,t,c){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(o.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(c,n,function(t){return e[t]}.bind(null,n));return c},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=2)}([function(e,t){e.exports=window.wp.hooks},function(e,t){e.exports=window.wp.i18n},function(e,t,o){"use strict";o.r(t);var c=o(1),n=o(0);const r="woocommerce-google-analytics",i="experimental__woocommerce_blocks",a=(e,t)=>{const o=e.sku?e.sku:"#"+e.id,c="categories"in e&&e.categories.length?e.categories[0].name:"";return{id:o,name:e.name,quantity:t,category:c,price:(parseInt(e.prices.price,10)/10**e.prices.currency_minor_unit).toString()}},u=(e,t)=>{const o=e.sku?e.sku:"#"+e.id,c=e.categories.length?e.categories[0].name:"";return{id:o,name:e.name,list_name:t,category:c,price:(parseInt(e.prices.price,10)/10**e.prices.currency_minor_unit).toString()}},s=(e,t)=>{if("function"!=typeof gtag)throw new Error("Function gtag not implemented.");console.log("Tracking event "+e),window.gtag("event",e,t)};let d=-1;const l=e=>t=>{var o;let{storeCart:c}=t;d!==e&&(s(0===e?"begin_checkout":"checkout_progress",{items:c.cartItems.map(a),coupon:(null===(o=c.cartCoupons[0])||void 0===o?void 0:o.code)||"",currency:c.cartTotals.currency_code,value:(parseInt(c.cartTotals.total_price,10)/10**c.cartTotals.currency_minor_unit).toString(),checkout_step:e}),d=e)},p=e=>{let{step:t,option:o,value:c}=e;return()=>{s("set_checkout_option",{checkout_step:t,checkout_option:o,value:c}),d=t}};Object(n.addAction)(i+"-checkout-render-checkout-form",r,l(0)),Object(n.addAction)(i+"-checkout-set-email-address",r,l(1)),Object(n.addAction)(i+"-checkout-set-shipping-address",r,l(2)),Object(n.addAction)(i+"-checkout-set-billing-address",r,l(3)),Object(n.addAction)(i+"-checkout-set-phone-number",r,e=>{let{step:t,...o}=e;l("shipping"===t?2:3)(o)}),Object(n.addAction)(i+"-checkout-set-selected-shipping-rate",r,e=>{let{shippingRateId:t}=e;p({step:4,option:Object(c.__)("Shipping Method","woo-gutenberg-products-block"),value:t})()}),Object(n.addAction)(i+"-checkout-set-active-payment-method",r,e=>{let{paymentMethodSlug:t}=e;p({step:5,option:Object(c.__)("Payment Method","woo-gutenberg-products-block"),value:t})()}),Object(n.addAction)(i+"-checkout-submit",r,()=>{s("add_payment_info")}),Object(n.addAction)(i+"-cart-add-item",r,e=>{let{product:t,quantity:o=1}=e;s("add_to_cart",{event_category:"ecommerce",event_label:Object(c.__)("Add to Cart","woo-gutenberg-products-block"),items:[a(t,o)]})}),Object(n.addAction)(i+"-cart-remove-item",r,e=>{let{product:t,quantity:o=1}=e;s("remove_from_cart",{event_category:"ecommerce",event_label:Object(c.__)("Remove Cart Item","woo-gutenberg-products-block"),items:[a(t,o)]})}),Object(n.addAction)(i+"-cart-set-item-quantity",r,e=>{let{product:t,quantity:o=1}=e;s("change_cart_quantity",{event_category:"ecommerce",event_label:Object(c.__)("Change Cart Item Quantity","woo-gutenberg-products-block"),items:[a(t,o)]})}),Object(n.addAction)(i+"-product-list-render",r,e=>{let{products:t,listName:o=Object(c.__)("Product List","woo-gutenberg-products-block")}=e;0!==t.length&&s("view_item_list",{event_category:"engagement",event_label:Object(c.__)("Viewing products","woo-gutenberg-products-block"),items:t.map((e,t)=>({...u(e,o),list_position:t+1}))})}),Object(n.addAction)(i+"-product-view-link",r,e=>{let{product:t,listName:o}=e;s("select_content",{content_type:"product",items:[u(t,o)]})}),Object(n.addAction)(i+"-product-search",r,e=>{let{searchTerm:t}=e;s("search",{search_term:t})}),Object(n.addAction)(i+"-product-render",r,e=>{let{product:t,listName:o}=e;t&&s("view_item",{items:[u(t,o)]})}),Object(n.addAction)(i+"-store-notice-create",r,e=>{let{status:t,content:o}=e;"error"===t&&s("exception",{description:o,fatal:!1})})}]); \ No newline at end of file diff --git a/build/wc-blocks-middleware.asset.php b/build/wc-blocks-middleware.asset.php new file mode 100644 index 00000000000..ab985681fe0 --- /dev/null +++ b/build/wc-blocks-middleware.asset.php @@ -0,0 +1 @@ + array('wp-api-fetch', 'wp-polyfill'), 'version' => 'a36096851ce0eea876af8463335633e5'); \ No newline at end of file diff --git a/build/wc-blocks-middleware.js b/build/wc-blocks-middleware.js new file mode 100644 index 00000000000..5ea762eee2c --- /dev/null +++ b/build/wc-blocks-middleware.js @@ -0,0 +1 @@ +this.wc=this.wc||{},this.wc.wcBlocksMiddleware=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=142)}({11:function(e,t){e.exports=window.wp.apiFetch},142:function(e,t,n){"use strict";n.r(t);var o=n(11),r=n.n(o);let i="",c=0;try{const e=window.localStorage.getItem("storeApiNonce"),t=e?JSON.parse(e):{};i=(null==t?void 0:t.nonce)||"",c=(null==t?void 0:t.timestamp)||0}catch{}const u=(e,t)=>{e!==i&&(c&&t{const t=e.headers||{};return e.headers={...t,Nonce:i},e};r.a.use((e,t)=>{var n,o;return(e=>{const t=e.url||e.path;return!(!t||!e.method||"GET"===e.method)&&null!==/wc\/store\/v1\//.exec(t)})(e)&&(e=a(e),Array.isArray(null===(n=e)||void 0===n||null===(o=n.data)||void 0===o?void 0:o.requests)&&(e.data.requests=e.data.requests.map(a))),t(e,t)}),r.a.setNonce=e=>{const t="function"==typeof(null==e?void 0:e.get)?e.get("Nonce"):e.Nonce,n="function"==typeof(null==e?void 0:e.get)?e.get("Nonce-Timestamp"):e["Nonce-Timestamp"];t&&u(t,n)},u(wcBlocksMiddlewareConfig.storeApiNonce,wcBlocksMiddlewareConfig.storeApiNonceTimestamp)}}); \ No newline at end of file diff --git a/build/wc-blocks-registry.asset.php b/build/wc-blocks-registry.asset.php new file mode 100644 index 00000000000..8116b59c367 --- /dev/null +++ b/build/wc-blocks-registry.asset.php @@ -0,0 +1 @@ + array('wp-deprecated', 'wp-element', 'wp-polyfill'), 'version' => '89b67a14026ab63dee3e8ae630812221'); \ No newline at end of file diff --git a/build/wc-blocks-registry.js b/build/wc-blocks-registry.js new file mode 100644 index 00000000000..c9d100798c9 --- /dev/null +++ b/build/wc-blocks-registry.js @@ -0,0 +1 @@ +this.wc=this.wc||{},this.wc.wcBlocksRegistry=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=137)}({0:function(e,t){e.exports=window.wp.element},137:function(e,t,n){"use strict";n.r(t),n.d(t,"registerPaymentMethod",(function(){return g})),n.d(t,"registerExpressPaymentMethod",(function(){return v})),n.d(t,"registerPaymentMethodExtensionCallbacks",(function(){return w})),n.d(t,"__experimentalDeRegisterPaymentMethod",(function(){return k})),n.d(t,"__experimentalDeRegisterExpressPaymentMethod",(function(){return M})),n.d(t,"getPaymentMethods",(function(){return P})),n.d(t,"getExpressPaymentMethods",(function(){return T})),n.d(t,"getRegisteredBlockComponents",(function(){return C})),n.d(t,"getRegisteredInnerBlocks",(function(){return x})),n.d(t,"registerBlockComponent",(function(){return O})),n.d(t,"registerInnerBlock",(function(){return S}));var o=n(7),r=n.n(o),a=n(15),i=n.n(a),s=n(0);const c={},l=c,u=(e,t,n)=>{const o=((e,t)=>n=>((null==n?void 0:n.paymentRequirements)||[]).every(e=>t.includes(e))&&e(n))(e,t);return Object.values(l).some(e=>n in e)?((e,t,n)=>o=>{let r=e(o);if(r){const e={};Object.entries(t).forEach(t=>{let[o,r]=t;e[o]=r[n]}),r=Object.keys(e).every(t=>{try{return e[t](o)}catch(e){return console.error(`Error when executing callback for ${n} in ${t}`,e),!0}})}return r})(o,l,n):o},p=(e,t)=>{if(null!==e&&!Object(s.isValidElement)(e))throw new TypeError(`The ${t} property for the payment method must be a React element or null.`)},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=t.reduce((t,n)=>(e.hasOwnProperty(n)||t.push(n),t),[]);if(n.length>0)throw new TypeError("The payment method configuration object is missing the following properties:"+n.join(", "))},m=()=>null;class h{constructor(e){var t,n,o,r;h.assertValidConfig(e),this.name=e.name,this.label=e.label,this.placeOrderButtonLabel=e.placeOrderButtonLabel,this.ariaLabel=e.ariaLabel,this.content=e.content,this.savedTokenComponent=e.savedTokenComponent,this.icons=e.icons||null,this.edit=e.edit,this.paymentMethodId=e.paymentMethodId||this.name,this.supports={showSavedCards:(null==e||null===(t=e.supports)||void 0===t?void 0:t.showSavedCards)||(null==e||null===(n=e.supports)||void 0===n?void 0:n.savePaymentInfo)||!1,showSaveOption:(null==e||null===(o=e.supports)||void 0===o?void 0:o.showSaveOption)||!1,features:(null==e||null===(r=e.supports)||void 0===r?void 0:r.features)||["products"]},this.canMakePaymentFromConfig=e.canMakePayment}get canMakePayment(){return u(this.canMakePaymentFromConfig,this.supports.features,this.name)}}i()(h,"assertValidConfig",e=>{var t,n,o,a,i,c,l;if(e.savedTokenComponent=e.savedTokenComponent||Object(s.createElement)(m,null),d(e,["name","label","ariaLabel","content","edit","canMakePayment"]),"string"!=typeof e.name)throw new Error("The name property for the payment method must be a string");if(void 0!==e.icons&&!Array.isArray(e.icons)&&null!==e.icons)throw new Error("The icons property for the payment method must be an array or null.");if("string"!=typeof e.paymentMethodId&&void 0!==e.paymentMethodId)throw new Error("The paymentMethodId property for the payment method must be a string or undefined (in which case it will be the value of the name property).");if("string"!=typeof e.placeOrderButtonLabel&&void 0!==e.placeOrderButtonLabel)throw new TypeError("The placeOrderButtonLabel property for the payment method must be a string");if(((e,t)=>{if(null!==e&&!Object(s.isValidElement)(e)&&"string"!=typeof e)throw new TypeError("The label property for the payment method must be a React element, a string, or null.")})(e.label),p(e.content,"content"),p(e.edit,"edit"),p(e.savedTokenComponent,"savedTokenComponent"),"string"!=typeof e.ariaLabel)throw new TypeError("The ariaLabel property for the payment method must be a string");if("function"!=typeof e.canMakePayment)throw new TypeError("The canMakePayment property for the payment method must be a function.");if(void 0!==(null===(t=e.supports)||void 0===t?void 0:t.showSavedCards)&&"boolean"!=typeof(null===(n=e.supports)||void 0===n?void 0:n.showSavedCards))throw new TypeError("If the payment method includes the `supports.showSavedCards` property, it must be a boolean");if(void 0!==(null===(o=e.supports)||void 0===o?void 0:o.savePaymentInfo)&&r()("Passing savePaymentInfo when registering a payment method.",{alternative:"Pass showSavedCards and showSaveOption",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3686"}),void 0!==(null===(a=e.supports)||void 0===a?void 0:a.features)&&!Array.isArray(null===(i=e.supports)||void 0===i?void 0:i.features))throw new Error("The features property for the payment method must be an array or undefined.");if(void 0!==(null===(c=e.supports)||void 0===c?void 0:c.showSaveOption)&&"boolean"!=typeof(null===(l=e.supports)||void 0===l?void 0:l.showSaveOption))throw new TypeError("If the payment method includes the `supports.showSaveOption` property, it must be a boolean")});class f{constructor(e){var t;f.assertValidConfig(e),this.name=e.name,this.content=e.content,this.edit=e.edit,this.paymentMethodId=e.paymentMethodId||this.name,this.supports={features:(null==e||null===(t=e.supports)||void 0===t?void 0:t.features)||["products"]},this.canMakePaymentFromConfig=e.canMakePayment}get canMakePayment(){return u(this.canMakePaymentFromConfig,this.supports.features,this.name)}}i()(f,"assertValidConfig",e=>{var t,n;if(d(e,["name","content","edit"]),"string"!=typeof e.name)throw new TypeError("The name property for the express payment method must be a string");if("string"!=typeof e.paymentMethodId&&void 0!==e.paymentMethodId)throw new Error("The paymentMethodId property for the payment method must be a string or undefined (in which case it will be the value of the name property).");if(void 0!==(null===(t=e.supports)||void 0===t?void 0:t.features)&&!Array.isArray(null===(n=e.supports)||void 0===n?void 0:n.features))throw new Error("The features property for the payment method must be an array or undefined.");if(p(e.content,"content"),p(e.edit,"edit"),"function"!=typeof e.canMakePayment)throw new TypeError("The canMakePayment property for the express payment method must be a function.")});const y={},b={},g=e=>{let t;"function"==typeof e?(t=e(h),r()("Passing a callback to registerPaymentMethod()",{alternative:"a config options object",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3404"})):t=new h(e),t instanceof h&&(y[t.name]=t)},v=e=>{let t;"function"==typeof e?(t=e(f),r()("Passing a callback to registerExpressPaymentMethod()",{alternative:"a config options object",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3404"})):t=new f(e),t instanceof f&&(b[t.name]=t)},w=(e,t)=>{c[e]?console.error(`The namespace provided to registerPaymentMethodExtensionCallbacks must be unique. Callbacks have already been registered for the ${e} namespace.`):(c[e]={},Object.entries(t).forEach(t=>{let[n,o]=t;"function"==typeof o?c[e][n]=o:console.error(`All callbacks provided to registerPaymentMethodExtensionCallbacks must be functions. The callback for the ${n} payment method in the ${e} namespace was not a function.`)}))},k=e=>{delete y[e]},M=e=>{delete b[e]},P=()=>y,T=()=>b,E={};function C(e){return{..."object"==typeof E[e]&&Object.keys(E[e]).length>0?E[e]:{},...E.any}}function x(e){return r()("getRegisteredInnerBlocks",{version:"2.8.0",alternative:"getRegisteredBlockComponents",plugin:"WooCommerce Blocks"}),C(e)}function O(e){e.context||(e.context="any"),j(e,"context","string"),j(e,"blockName","string"),I(e,"component");const{context:t,blockName:n,component:o}=e;E[t]||(E[t]={}),E[t][n]=o}const I=(e,t)=>{if(e[t]){if("function"==typeof e[t])return;if(e[t].$$typeof&&e[t].$$typeof===Symbol.for("react.lazy"))return}throw new Error(`Incorrect value for the ${t} argument when registering a block component. Component must be a valid React Element or Lazy callback.`)},j=(e,t,n)=>{const o=typeof e[t];if(o!==n)throw new Error(`Incorrect value for the ${t} argument when registering a block component. It was a ${o}, but must be a ${n}.`)};function S(e){r()("registerInnerBlock",{version:"2.8.0",alternative:"registerBlockComponent",plugin:"WooCommerce Blocks",hint:'"main" has been replaced with "context" and is now optional.'}),j(e,"main","string"),O({...e,context:e.main})}},15:function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},7:function(e,t){e.exports=window.wp.deprecated}}); \ No newline at end of file diff --git a/build/wc-blocks-shared-context.asset.php b/build/wc-blocks-shared-context.asset.php new file mode 100644 index 00000000000..bc0da755983 --- /dev/null +++ b/build/wc-blocks-shared-context.asset.php @@ -0,0 +1 @@ + array('wp-element', 'wp-polyfill'), 'version' => 'f63cedb74014c3e52775e8ca5d10f94c'); \ No newline at end of file diff --git a/build/wc-blocks-shared-context.js b/build/wc-blocks-shared-context.js new file mode 100644 index 00000000000..e1bce59674b --- /dev/null +++ b/build/wc-blocks-shared-context.js @@ -0,0 +1 @@ +this.wc=this.wc||{},this.wc.wcBlocksSharedContext=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=140)}({0:function(e,t){e.exports=window.wp.element},126:function(e,t,r){"use strict";var n=r(127);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,a,c){if(c!==n){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return r.PropTypes=r,r}},127:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},140:function(e,t,r){"use strict";r.r(t),r.d(t,"useInnerBlockLayoutContext",(function(){return i})),r.d(t,"InnerBlockLayoutContextProvider",(function(){return u})),r.d(t,"useProductDataContext",(function(){return l})),r.d(t,"ProductDataContextProvider",(function(){return d}));var n=r(0),o=r(17),a=r.n(o);const c=Object(n.createContext)({parentName:"",parentClassName:"",isLoading:!1}),i=()=>Object(n.useContext)(c),u=e=>{let{parentName:t="",parentClassName:r="",children:o}=e;const a={parentName:t,parentClassName:r};return Object(n.createElement)(c.Provider,{value:a},o)};u.propTypes={children:a.a.node,parentName:a.a.string,parentClassName:a.a.string};const s={id:0,name:"",parent:0,type:"simple",variation:"",permalink:"",sku:"",short_description:"",description:"",on_sale:!1,prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:"0",regular_price:"0",sale_price:"0",price_range:null},price_html:"",average_rating:"0",review_count:0,images:[],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!1,is_in_stock:!1,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"Add to cart",description:"Add to cart",url:"",minimum:1,maximum:99,multiple_of:1}},p=Object(n.createContext)({product:s,hasContext:!1}),l=()=>Object(n.useContext)(p),d=e=>{let{product:t=null,children:r,isLoading:o=!1}=e;const a={product:t||s,hasContext:!0};return Object(n.createElement)(p.Provider,{value:a},o?Object(n.createElement)("div",{className:"is-loading"},r):r)};d.propTypes={children:a.a.node,product:a.a.object}},17:function(e,t,r){e.exports=r(126)()}}); \ No newline at end of file diff --git a/build/wc-blocks-shared-hocs.asset.php b/build/wc-blocks-shared-hocs.asset.php new file mode 100644 index 00000000000..f061b6fd797 --- /dev/null +++ b/build/wc-blocks-shared-hocs.asset.php @@ -0,0 +1 @@ + array('wc-blocks-shared-context', 'wp-api-fetch', 'wp-element', 'wp-polyfill'), 'version' => '3e1bbe92f6d0262f2cd5bb74eb9d26f8'); \ No newline at end of file diff --git a/build/wc-blocks-shared-hocs.js b/build/wc-blocks-shared-hocs.js new file mode 100644 index 00000000000..999843852a9 --- /dev/null +++ b/build/wc-blocks-shared-hocs.js @@ -0,0 +1 @@ +this.wc=this.wc||{},this.wc.wcBlocksSharedHocs=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=139)}({0:function(e,t){e.exports=window.wp.element},10:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t{const{productId:t,OriginalComponent:r}=e,[n,o]=Object(c.useState)(null),[u,i]=Object(c.useState)(!0);return Object(c.useEffect)(()=>{e.product&&(o(e.product),i(!1))},[e.product]),Object(c.useEffect)(()=>{t>0&&(i(!0),a()({path:"/wc/store/v1/products/"+t}).then(e=>{o(e)}).catch(async()=>{o(null)}).finally(()=>{i(!1)}))},[t]),u||n?Object(c.createElement)(s.ProductDataContextProvider,{product:n,isLoading:u},Object(c.createElement)(r,e)):null},l=e=>t=>{const r=Object(s.useProductDataContext)();return t.product||!r.hasContext?Object(c.createElement)(i,o()({},t,{OriginalComponent:e})):Object(c.createElement)(e,t)},f=e=>t=>r=>{const n=((e,t)=>{const r=[];return Object.keys(e).forEach(n=>{if(void 0!==t[n])switch(e[n].type){case"boolean":r[n]="false"!==t[n]&&!1!==t[n];break;case"number":r[n]=parseInt(t[n],10);break;case"array":case"object":r[n]=JSON.parse(t[n]);break;default:r[n]=t[n]}else r[n]=e[n].default}),r})(e,r);return Object(c.createElement)(t,o()({},r,n))}},21:function(e,t){e.exports=window.wc.wcBlocksSharedContext}}); \ No newline at end of file diff --git a/build/wc-blocks-style-rtl.css b/build/wc-blocks-style-rtl.css new file mode 100644 index 00000000000..dbfcd702b96 --- /dev/null +++ b/build/wc-blocks-style-rtl.css @@ -0,0 +1 @@ +.wc-block-link-button{border:0;border-radius:0;box-shadow:none;color:inherit;display:inline;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-decoration:inherit;text-decoration:underline;text-shadow:none;text-transform:inherit;vertical-align:baseline}.wc-block-link-button,.wc-block-link-button:active,.wc-block-link-button:focus,.wc-block-link-button:hover{background:transparent}.wc-block-suspense-placeholder{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-suspense-placeholder>*{visibility:hidden}.wc-block-suspense-placeholder:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.wc-block-suspense-placeholder{-webkit-animation:none;animation:none}}.wc-block-suspense-placeholder:before{content:" "}.wc-block-grid__products .wc-block-grid__product-image{display:block;position:relative;text-decoration:none}.wc-block-grid__products .wc-block-grid__product-image a{border:0;box-shadow:none;outline:0;text-decoration:none}.wc-block-grid__products .wc-block-grid__product-image img{height:auto;max-width:100%;width:auto}.wc-block-grid__products .wc-block-grid__product-image img[hidden]{display:none}.wc-block-grid__products .wc-block-grid__product-image img[alt=""]{border:1px solid #f2f2f2}.edit-post-visual-editor .editor-block-list__block .wc-block-grid__product-title,.editor-styles-wrapper .wc-block-grid__product-title,.wc-block-grid__product-title{color:inherit;display:block;font-family:inherit;font-size:inherit;font-weight:700;line-height:1.2;padding:0}.wc-block-grid__product-price{display:block}.wc-block-grid__product-price .wc-block-grid__product-price__regular{margin-left:.5em}.wc-block-grid__product-add-to-cart.wp-block-button{white-space:normal;word-break:break-word}.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link{display:inline-flex;font-size:1em;justify-content:center;margin:0 auto!important;padding:.5em 1em;text-align:center;white-space:normal;word-break:break-word}.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link.loading{opacity:.25}.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link.added:after{content:"";display:inline-block;font-family:WooCommerce;height:auto;margin-right:.5em;width:auto}.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link.loading:after{-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite;content:"";display:inline-block;font-family:WooCommerce;height:auto;margin-right:.5em;width:auto}.has-5-columns:not(.alignfull) .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after,.has-6-columns .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after,.has-7-columns .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after,.has-8-columns .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after,.has-9-columns .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after{content:"";margin:0}.wc-block-grid__product-rating{color:#000;display:block}.wc-block-grid__product-rating .star-rating,.wc-block-grid__product-rating .wc-block-grid__product-rating__stars{font-family:star;font-size:1em;font-weight:400;height:1.618em;line-height:1.618;margin:0 auto;overflow:hidden;position:relative;text-align:right;width:5.3em}.wc-block-grid__product-rating .star-rating:before,.wc-block-grid__product-rating .wc-block-grid__product-rating__stars:before{color:#aaa;content:"SSSSS";right:0;opacity:.5;position:absolute;left:0;top:0;white-space:nowrap}.wc-block-grid__product-rating .star-rating span,.wc-block-grid__product-rating .wc-block-grid__product-rating__stars span{right:0;overflow:hidden;padding-top:1.5em;position:absolute;left:0;top:0}.wc-block-grid__product-rating .star-rating span:before,.wc-block-grid__product-rating .wc-block-grid__product-rating__stars span:before{color:inherit;content:"SSSSS";right:0;position:absolute;left:0;top:0;white-space:nowrap}.wc-block-grid__product-onsale{background:#fff;border:1px solid #43454b;border-radius:3px;color:#43454b;display:inline-block;font-size:.875em;font-weight:600;padding:.25em .75em;position:relative;text-align:center;text-transform:uppercase;width:auto;z-index:9}.wc-block-grid__product .wc-block-grid__product-image:not(.wc-block-components-product-image),.wc-block-grid__product .wc-block-grid__product-title{margin:0 0 12px}.wc-block-grid__product .wc-block-grid__product-add-to-cart,.wc-block-grid__product .wc-block-grid__product-onsale,.wc-block-grid__product .wc-block-grid__product-price,.wc-block-grid__product .wc-block-grid__product-rating{margin:0 auto 12px}.theme-twentysixteen .wc-block-grid .price ins{color:#77a464}.theme-twentynineteen .wc-block-grid__product{font-size:.88889em}.theme-twentynineteen .wc-block-components-product-sale-badge,.theme-twentynineteen .wc-block-components-product-title,.theme-twentynineteen .wc-block-grid__product-onsale,.theme-twentynineteen .wc-block-grid__product-title{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.theme-twentynineteen .wc-block-grid__product-title:before{display:none}.theme-twentynineteen .wc-block-components-product-sale-badge,.theme-twentynineteen .wc-block-grid__product-onsale{line-height:1}.theme-twentynineteen .editor-styles-wrapper .wp-block-button .wp-block-button__link:not(.has-text-color){color:#fff}.theme-twentytwenty .wc-block-grid__product-link{color:#000}.theme-twentytwenty .wc-block-components-product-title,.theme-twentytwenty .wc-block-grid__product-title{color:#cd2653;font-family:-apple-system,blinkmacsystemfont,Helvetica Neue,helvetica,sans-serif;font-size:1em}.theme-twentytwenty .wp-block-columns .wc-block-components-product-title{margin-top:0}.theme-twentytwenty .wc-block-components-product-price .woocommerce-Price-amount,.theme-twentytwenty .wc-block-components-product-price__value,.theme-twentytwenty .wc-block-grid__product-price .woocommerce-Price-amount,.theme-twentytwenty .wc-block-grid__product-price__value{font-family:-apple-system,blinkmacsystemfont,Helvetica Neue,helvetica,sans-serif;font-size:.9em}.theme-twentytwenty .wc-block-components-product-price del,.theme-twentytwenty .wc-block-grid__product-price del{opacity:.5}.theme-twentytwenty .wc-block-components-product-price ins,.theme-twentytwenty .wc-block-grid__product-price ins{text-decoration:none}.theme-twentytwenty .star-rating,.theme-twentytwenty .wc-block-grid__product-rating{font-size:.7em}.theme-twentytwenty .star-rating .wc-block-components-product-rating__stars,.theme-twentytwenty .star-rating .wc-block-grid__product-rating__stars,.theme-twentytwenty .wc-block-grid__product-rating .wc-block-components-product-rating__stars,.theme-twentytwenty .wc-block-grid__product-rating .wc-block-grid__product-rating__stars{line-height:1}.theme-twentytwenty .wc-block-components-product-button>.wp-block-button__link,.theme-twentytwenty .wc-block-grid__product-add-to-cart>.wp-block-button__link{font-family:-apple-system,blinkmacsystemfont,Helvetica Neue,helvetica,sans-serif}.theme-twentytwenty .wc-block-components-product-sale-badge,.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-onsale{background:#cd2653;color:#fff;font-family:-apple-system,blinkmacsystemfont,Helvetica Neue,helvetica,sans-serif;font-weight:700;letter-spacing:-.02em;line-height:1.2;text-transform:uppercase}.theme-twentytwenty .wc-block-grid__products .wc-block-components-product-sale-badge{position:static}.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-image .wc-block-components-product-sale-badge{position:absolute}.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-onsale:not(.wc-block-components-product-sale-badge){position:absolute;left:4px;top:4px;z-index:1}.theme-twentytwenty .wc-block-active-filters__title,.theme-twentytwenty .wc-block-attribute-filter__title,.theme-twentytwenty .wc-block-price-filter__title,.theme-twentytwenty .wc-block-stock-filter__title{font-size:1em}.theme-twentytwenty .wc-block-active-filters .wc-block-active-filters__clear-all{font-size:.75em}.theme-twentytwenty .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link{font-size:.75em;padding:.5em}@media only screen and (min-width:768px){.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-onsale{font-size:.875em;padding:.5em}}@media only screen and (min-width:1168px){.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-onsale{font-size:.875em;padding:.5em}}.theme-twentytwentytwo .wc-block-grid__product-add-to-cart .added_to_cart{display:block;margin-top:12px}.theme-twentytwentytwo .wc-block-components-product-price ins,.theme-twentytwentytwo .wc-block-grid__product-price ins{text-decoration:none}.screen-reader-text{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;padding:0;position:absolute!important;width:1px}.screen-reader-text:focus{clip:auto!important;background-color:#fff;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);-webkit-clip-path:none;clip-path:none;color:#2b2d2f;display:block;font-size:.875rem;font-weight:700;height:auto;right:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}.wc-block-components-product-add-to-cart-attribute-picker{flex-basis:100%;margin:0}.wc-block-components-product-add-to-cart-attribute-picker label{display:block;font-size:1em}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__container{position:relative}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select{margin:0 0 .75em}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select select{min-height:1.75em;min-width:60%}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select.has-error{margin-bottom:24px}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select.has-error select{border-color:#cc1818}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select.has-error select:focus{outline-color:#cc1818}.wc-block-components-product-add-to-cart{display:flex;flex-wrap:wrap;margin:0}.wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button{margin:0 0 .75em}.wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button .wc-block-components-button__text{display:block}.wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button .wc-block-components-button__text>svg{fill:currentColor;height:1.5em;margin:-.25em .5em -.25em 0;vertical-align:top;width:1.5em}.wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity{background:#fff;border:1px solid #ccc;border-radius:2px;box-shadow:inset 0 1px 1px rgba(0,0,0,.125);color:#43454b;flex-basis:5em;margin:0 0 .75em 1em;padding:.618em;text-align:center}.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button,.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-button,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-quantity{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button>*,.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity>*,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-button>*,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-quantity>*{visibility:hidden}.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button:after,.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity:after,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-button:after,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-quantity:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button,.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-button,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-quantity{-webkit-animation:none;animation:none}}.wc-block-grid .wc-block-components-product-add-to-cart{justify-content:center}.wc-block-components-product-add-to-cart-notice{margin:0}.wp-block-button.wc-block-components-product-button{margin-bottom:12px;margin-top:0;white-space:normal;word-break:break-word}.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button{border-style:none;display:inline-flex;font-family:inherit;font-weight:inherit;justify-content:center;margin:0 auto;white-space:normal;word-break:break-word}.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button--placeholder{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;min-height:3em;min-width:8em;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button--placeholder>*{visibility:hidden}.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button--placeholder:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button--placeholder{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-product-button>.wc-block-components-product-button__button{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;min-height:3em;min-width:8em;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.is-loading .wc-block-components-product-button>.wc-block-components-product-button__button>*{visibility:hidden}.is-loading .wc-block-components-product-button>.wc-block-components-product-button__button:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-button>.wc-block-components-product-button__button{-webkit-animation:none;animation:none}}.theme-twentytwentyone .editor-styles-wrapper .wc-block-components-product-button .wp-block-button__link{background-color:var(--button--color-background);border-color:var(--button--color-background);color:var(--button--color-text)}.wc-block-components-product-category-list{margin-bottom:.75em;margin-top:0}.wc-block-components-product-category-list ul{display:inline;margin:0;padding:0}.wc-block-components-product-category-list ul li{display:inline;list-style:none}.wc-block-components-product-category-list ul li:after{content:", "}.wc-block-components-product-category-list ul li:last-child:after{content:""}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image,.wc-block-components-product-image{display:block;position:relative;text-decoration:none}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image a,.wc-block-components-product-image a{border:0;border-radius:inherit;box-shadow:none;outline:0;text-decoration:none}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image img,.wc-block-components-product-image img{border-radius:inherit;vertical-align:middle;width:100%}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image img[hidden],.wc-block-components-product-image img[hidden]{display:none}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image img[alt=""],.wc-block-components-product-image img[alt=""]{border:1px solid #f2f2f2}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image .wc-block-components-product-sale-badge--align-left,.wc-block-components-product-image .wc-block-components-product-sale-badge--align-left{right:4px;margin:0;position:absolute;left:auto;top:4px}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image .wc-block-components-product-sale-badge--align-center,.wc-block-components-product-image .wc-block-components-product-sale-badge--align-center{right:50%;margin:0;position:absolute;left:auto;top:4px;transform:translateX(50%)}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image .wc-block-components-product-sale-badge--align-right,.wc-block-components-product-image .wc-block-components-product-sale-badge--align-right{right:auto;margin:0;position:absolute;left:4px;top:4px}.is-loading .wc-block-components-product-image{background-color:#ebebeb!important;border:0!important;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;width:auto;z-index:1}.is-loading .wc-block-components-product-image>*{visibility:hidden}.is-loading .wc-block-components-product-image:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-image{-webkit-animation:none;animation:none}}.wc-block-components-product-image{margin:0 0 12px}.wc-block-components-product-rating{display:block;margin-bottom:12px;margin-top:0}.wc-block-components-product-rating__stars{font-family:star;font-size:1em;font-weight:400;height:1.618em;line-height:1.618;margin:0 auto;overflow:hidden;position:relative;text-align:right;width:5.3em}.wc-block-components-product-rating__stars:before{color:inherit;content:"SSSSS";right:0;opacity:.5;position:absolute;left:0;top:0;white-space:nowrap}.wc-block-components-product-rating__stars span{color:inherit;right:0;overflow:hidden;padding-top:1.5em;position:absolute;left:0;top:0}.wc-block-components-product-rating__stars span:before{color:inherit;content:"SSSSS";right:0;position:absolute;left:0;top:0;white-space:nowrap}.wc-block-single-product .wc-block-components-product-rating__stars{margin:0}.wc-block-components-product-sale-badge{background:#fff;border:1px solid #43454b;border-radius:3px;box-sizing:border-box;color:#43454b;display:inline-block;font-size:.875em;font-weight:600;margin:0 auto 12px;padding:.25em .75em;position:static;text-align:center;text-transform:uppercase;width:auto;z-index:9}.wc-block-components-product-sale-badge span{background-color:inherit;color:inherit}.wc-block-components-product-sku{display:block;font-size:.875em;margin-bottom:12px;margin-top:0;text-transform:uppercase}.wc-block-components-product-stock-indicator{display:block;font-size:.875em;margin-bottom:.75em;margin-top:0}.wc-block-components-product-summary{margin-bottom:12px;margin-top:0}.is-loading .wc-block-components-product-summary:before{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;content:".";display:block;height:6em;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.is-loading .wc-block-components-product-summary:before>*{visibility:hidden}.is-loading .wc-block-components-product-summary:before:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-summary:before{-webkit-animation:none;animation:none}}.wc-block-components-product-tag-list{margin-bottom:.75em;margin-top:0}.wc-block-components-product-tag-list ul{display:inline;margin:0;padding:0}.wc-block-components-product-tag-list ul li{display:inline;list-style:none}.wc-block-components-product-tag-list ul li:after{content:", "}.wc-block-components-product-tag-list ul li:last-child:after{content:""}.wc-block-components-product-title{display:block;font-size:inherit;font-weight:700;line-height:1.5;margin-bottom:12px;margin-top:0;padding:0}.wc-block-components-product-title a{color:inherit;font-size:inherit}.is-loading .wc-block-components-product-title:before{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;content:".";display:block;display:inline-block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;width:7em;z-index:1}.is-loading .wc-block-components-product-title:before>*{visibility:hidden}.is-loading .wc-block-components-product-title:before:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-title:before{-webkit-animation:none;animation:none}}.is-loading .wc-block-grid .wc-block-components-product-title:before{width:10em}.wc-block-components-product-title--align-left{text-align:right}.wc-block-components-product-title--align-center{text-align:center}.wc-block-components-product-title--align-right{text-align:left}.wc-block-components-error{align-items:center;color:#757575;display:flex;flex-direction:column;justify-content:center;margin:40px 0;padding:40px 0;text-align:center}.wc-block-components-error__header{color:#646970;font-size:2em;margin:0}.wc-block-components-error__image{margin:0 0 24px;width:25%}.wc-block-components-error__text{color:#8c8f94;font-size:1.25em;margin:1em 0 0;max-width:60ch}.wc-block-components-error__message{color:#8c8f94;font-style:italic;margin:1em auto 0;max-width:60ch}.wc-block-error__button{margin:40px 0 0}.wc-block-components-button:not(.is-link){align-items:center;color:inherit;display:inline-flex;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;font-weight:700;justify-content:center;letter-spacing:inherit;line-height:inherit;line-height:1;min-height:3em;padding:0 1em;position:relative;text-align:center;text-decoration:inherit;text-decoration:none;text-transform:inherit;text-transform:none;transition:box-shadow .1s linear}.wc-block-components-button:not(.is-link):focus{box-shadow:0 0 0 2px #0675c4;box-shadow:inset 0 0 0 1px #fff,0 0 0 2px #0675c4;outline:3px solid transparent}.wc-block-components-button:not(.is-link) .wc-block-components-button__text{display:block}.wc-block-components-button:not(.is-link) .wc-block-components-button__text>svg{fill:currentColor}.wc-block-components-button:not(.is-link) .wc-block-components-spinner+.wc-block-components-button__text{visibility:hidden}.wc-block-components-button:not(.is-link).text{color:#1e1e1e}.wc-block-components-button:not(.is-link).text:hover{opacity:.9}.wc-block-components-button:not(.is-link).contained,.wc-block-components-button:not(.is-link).contained:active,.wc-block-components-button:not(.is-link).contained:disabled,.wc-block-components-button:not(.is-link).contained:focus,.wc-block-components-button:not(.is-link).contained:hover{background-color:#1e1e1e;color:#fff}.wc-block-components-button:not(.is-link).contained:hover{opacity:.9}.wc-block-components-button:not(.is-link).outlined{background-color:transparent;color:#1e1e1e}.wc-block-components-button:not(.is-link).outlined:not(:focus){box-shadow:inset 0 0 0 1px #1e1e1e}.wc-block-components-button:not(.is-link).outlined:active,.wc-block-components-button:not(.is-link).outlined:disabled,.wc-block-components-button:not(.is-link).outlined:focus,.wc-block-components-button:not(.is-link).outlined:hover{background-color:#1e1e1e;color:#fff}.wc-block-components-button:not(.is-link).outlined:hover{background-color:#1e1e1e;color:#fff;opacity:1}.wc-block-components-form{counter-reset:checkout-step}.wc-block-components-form .wc-block-components-checkout-step{background:none;border:none;margin:0;padding:0 24px 0 0;position:relative}.is-mobile .wc-block-components-form .wc-block-components-checkout-step,.is-small .wc-block-components-form .wc-block-components-checkout-step{padding-right:0}.wc-block-components-checkout-step--disabled{opacity:.6}.wc-block-components-checkout-step__container{position:relative}.wc-block-components-checkout-step__content>*{margin-bottom:1em}.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__content>:last-child{margin-bottom:0;padding-bottom:1.5em}.wc-block-components-checkout-step__heading{align-content:center;align-items:center;display:flex;flex-wrap:wrap;gap:1em;justify-content:space-between;margin:.75em 0 1em;position:relative}.wc-block-components-checkout-step:first-child .wc-block-components-checkout-step__heading,.wc-block-components-express-payment-continue-rule+.wc-block-components-checkout-step .wc-block-components-checkout-step__heading{margin-top:0}.wc-block-components-checkout-step__title{margin:0 0 0 12px}.wc-block-components-checkout-step__heading-content{font-size:.75em}.wc-block-components-checkout-step__heading-content a{color:inherit;font-weight:700}.wc-block-components-checkout-step__description{font-size:.875em;line-height:1.25;margin-bottom:16px}.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__title:before{background:transparent;border:0;border-radius:0;content:" " counter(checkout-step) ".";content:" " counter(checkout-step) "."/"";counter-increment:checkout-step;right:-24px;margin:0;padding:0;position:absolute;text-align:center;top:0;transform:translateX(50%);vertical-align:baseline;width:24px}.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__container:after{border-right:1px solid;content:"";height:100%;right:-24px;opacity:.3;position:absolute;top:0}.is-mobile .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__title:before,.is-small .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__title:before{content:counter(checkout-step) ". ";content:counter(checkout-step) ". "/"";right:auto;position:static;top:auto;transform:none}.is-mobile .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__container:after,.is-small .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__container:after{content:unset}.editor-styles-wrapper .wp-block h4.wc-block-components-checkout-step__title{font-size:1em;line-height:24px;margin:0 0 0 12px}.wc-block-components-order-summary .wc-block-components-panel__button{margin-top:0;padding-top:0}.wc-block-components-order-summary .wc-block-components-panel__content{margin-bottom:0}.wc-block-components-order-summary__content{display:table;width:100%}.wc-block-components-order-summary-item{display:flex;font-size:.875em;padding-bottom:1px;padding-top:16px;position:relative;width:100%}.wc-block-components-order-summary-item:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-components-order-summary-item:first-child{padding-top:0}.wc-block-components-order-summary-item:last-child>div{padding-bottom:0}.wc-block-components-order-summary-item:last-child:after{display:none}.wc-block-components-order-summary-item .wc-block-components-product-metadata{font-size:1em}.wc-block-components-order-summary-item__description,.wc-block-components-order-summary-item__image{display:table-cell;vertical-align:top}.wc-block-components-order-summary-item__image{padding-bottom:16px;position:relative;width:48px}.wc-block-components-order-summary-item__image>img{max-width:48px;width:48px}.wc-block-components-order-summary-item__quantity{align-items:center;background:#fff;border:2px solid;border-radius:1em;box-shadow:0 0 0 2px #fff;color:#000;display:flex;justify-content:center;line-height:1;min-height:20px;min-width:20px;padding:0 .4em;position:absolute;left:0;top:0;transform:translate(-50%,-50%);white-space:nowrap;z-index:1}.wc-block-components-order-summary-item__description{padding-bottom:16px;padding-right:24px;padding-left:12px}.wc-block-components-order-summary-item__description .wc-block-components-product-metadata,.wc-block-components-order-summary-item__description p{line-height:1.375;margin-top:4px}.wc-block-components-order-summary-item__total-price{font-weight:700;margin-right:auto;text-align:left}.wc-block-components-order-summary-item__individual-prices{display:block}.wc-block-components-payment-method-icons{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;margin:0 0 14px}.wc-block-components-payment-method-icons .wc-block-components-payment-method-icon{display:inline-block;height:24px;margin:0 4px 2px;max-height:24px;max-width:38px;padding:0;width:auto}.wc-block-components-payment-method-icons--align-left{justify-content:flex-start}.wc-block-components-payment-method-icons--align-left .wc-block-components-payment-method-icon{margin-right:0;margin-left:8px}.wc-block-components-payment-method-icons--align-right{justify-content:flex-end}.wc-block-components-payment-method-icons--align-right .wc-block-components-payment-method-icon{margin-right:8px;margin-left:0}.wc-block-components-payment-method-icons:last-child{margin-bottom:0}.is-mobile .wc-block-components-payment-method-icons .wc-block-components-payment-method-icon,.is-small .wc-block-components-payment-method-icons .wc-block-components-payment-method-icon{height:16px}.wc-block-components-payment-method-label--with-icon{display:inline-block;vertical-align:middle}.wc-block-components-payment-method-label--with-icon>img,.wc-block-components-payment-method-label--with-icon>svg{margin:-2px 0 0 4px;vertical-align:middle}.is-mobile .wc-block-components-payment-method-label--with-icon>img,.is-mobile .wc-block-components-payment-method-label--with-icon>svg,.is-small .wc-block-components-payment-method-label--with-icon>img,.is-small .wc-block-components-payment-method-label--with-icon>svg{display:none}.editor-styles-wrapper .wc-block-components-checkout-policies,.wc-block-components-checkout-policies{font-size:.75em;line-height:1;list-style:none outside;margin:24px 0;text-align:center}.wc-block-components-checkout-policies__item{display:inline-block;list-style:none outside;margin:0;padding:0 .25em}.wc-block-components-checkout-policies__item:not(:first-child){border-right:1px solid #ccc}.wc-block-components-checkout-policies__item>a{color:inherit;padding:0 .25em}.wc-block-components-product-badge{border:1px solid;border-radius:2px;display:inline-block;font-size:.75em;font-weight:600;padding:0 .66em;text-transform:uppercase;white-space:nowrap}.wc-block-components-product-details.wc-block-components-product-details{list-style:none;margin:.5em 0;padding:0}.wc-block-components-product-details.wc-block-components-product-details:last-of-type{margin-bottom:0}.wc-block-components-product-details.wc-block-components-product-details li{margin-right:0}.wc-block-components-product-details__name,.wc-block-components-product-details__value{display:inline-block}.is-large:not(.wc-block-checkout) .wc-block-components-product-details__name{font-weight:700}img.wc-block-components-product-image[alt=""]{border:1px solid #f2f2f2}.wc-block-components-product-metadata{font-size:.75em}.wc-block-components-product-metadata .wc-block-components-product-metadata__description>p,.wc-block-components-product-metadata .wc-block-components-product-metadata__variation-data{margin:.25em 0}.wc-block-components-checkout-return-to-cart-button{box-shadow:none;color:inherit;padding-right:calc(24px + .25em);position:relative;text-decoration:none}.wc-block-components-checkout-return-to-cart-button svg{right:0;position:absolute;top:50%;transform:translateY(-50%)}.wc-block-components-shipping-calculator-address{margin-bottom:0}.wc-block-components-shipping-calculator-address__button{margin-top:1.5em;width:100%}.wc-block-components-shipping-calculator{padding:.5em 0 .75em}.wc-block-components-shipping-rates-control__package{margin-bottom:36px}.wc-block-components-shipping-rates-control__package:last-child{margin-bottom:0}.wc-block-components-shipping-rates-control__package .wc-block-components-panel__button{margin-bottom:0;margin-top:0;padding-bottom:.75em;padding-top:.75em}.wc-block-components-shipping-rates-control__package .wc-block-components-panel__content,.wc-block-components-shipping-rates-control__package .wc-block-components-radio-control,.wc-block-components-shipping-rates-control__package .wc-block-components-radio-control .wc-block-components-radio-control__option-layout,.wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__option-layout{padding-bottom:0}.wc-block-components-shipping-rates-control__package-items{display:block;font-size:.875em;list-style:none;margin:0;padding:0}.wc-block-components-shipping-rates-control__package-item{display:inline-block;margin:0;overflow-wrap:anywhere;padding:0;word-break:break-word;-ms-word-break:break-all}.wc-block-components-shipping-rates-control__package-item:not(:last-child):after{content:", ";white-space:pre}.wc-block-components-totals-coupon .wc-block-components-panel__button{margin-top:0;padding-top:0}.wc-block-components-totals-coupon .wc-block-components-panel__content{padding-bottom:0}.wc-block-components-totals-coupon__form{display:flex;margin-bottom:0;width:100%}.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__input{flex-grow:1;margin-bottom:0;margin-top:0}.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button{flex-shrink:0;height:3em;margin-right:8px;padding-right:24px;padding-left:24px;white-space:nowrap}.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button.no-margin{margin:0}.wc-block-components-totals-coupon__content{flex-direction:column;position:relative}.wc-block-components-totals-discount__coupon-list{list-style:none;margin:0;padding:0}.wc-block-components-totals-discount .wc-block-components-totals-item__value{color:#4ab866}.wc-block-components-totals-footer-item .wc-block-components-totals-item__label,.wc-block-components-totals-footer-item .wc-block-components-totals-item__value{font-size:1.25em}.wc-block-components-totals-footer-item .wc-block-components-totals-item__label{font-weight:700}.wc-block-components-totals-footer-item .wc-block-components-totals-footer-item-tax{margin-bottom:0}.wc-block-components-totals-shipping fieldset.wc-block-components-totals-shipping__fieldset{background-color:transparent;border:0;margin:0;padding:0}.wc-block-components-totals-shipping .wc-block-components-totals-shipping__via{margin-bottom:16px}.wc-block-components-totals-shipping .wc-block-components-totals-shipping__options .wc-block-components-radio-control__description,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__options .wc-block-components-radio-control__label,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__options .wc-block-components-radio-control__secondary-description,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__options .wc-block-components-radio-control__secondary-label{flex-basis:100%;text-align:right}.wc-block-components-totals-shipping .wc-block-components-shipping-rates-control__no-results-notice{margin:0 0 .75em}.wc-block-components-totals-shipping .wc-block-components-totals-shipping__change-address-button{background:transparent;border:0;border-radius:0;box-shadow:none;color:inherit;display:inline;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-decoration:inherit;text-decoration:underline;text-shadow:none;text-transform:inherit;vertical-align:baseline}.wc-block-components-totals-shipping .wc-block-components-totals-shipping__change-address-button:active,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__change-address-button:focus,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__change-address-button:hover{background:transparent;opacity:.8}.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-totals-shipping__change-address-button{background:transparent;border:0;border-radius:0;box-shadow:none;color:inherit;display:inline;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-decoration:inherit;text-decoration:underline;text-shadow:none;text-transform:inherit;vertical-align:baseline}.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-totals-shipping__change-address-button:active,.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-totals-shipping__change-address-button:focus,.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-totals-shipping__change-address-button:hover{background:transparent}.editor-styles-wrapper .wc-block-components-checkbox-list,.wc-block-components-checkbox-list{list-style:none outside;margin:0;padding:0}.editor-styles-wrapper .wc-block-components-checkbox-list li,.wc-block-components-checkbox-list li{list-style:none outside;margin:0 0 4px;padding:0}.editor-styles-wrapper .wc-block-components-checkbox-list li.show-less button,.editor-styles-wrapper .wc-block-components-checkbox-list li.show-more button,.wc-block-components-checkbox-list li.show-less button,.wc-block-components-checkbox-list li.show-more button{background:none;border:none;cursor:pointer;padding:0;text-decoration:underline}.editor-styles-wrapper .wc-block-components-checkbox-list.is-loading li,.wc-block-components-checkbox-list.is-loading li{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.editor-styles-wrapper .wc-block-components-checkbox-list.is-loading li>*,.wc-block-components-checkbox-list.is-loading li>*{visibility:hidden}.editor-styles-wrapper .wc-block-components-checkbox-list.is-loading li:after,.wc-block-components-checkbox-list.is-loading li:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.editor-styles-wrapper .wc-block-components-checkbox-list.is-loading li,.wc-block-components-checkbox-list.is-loading li{-webkit-animation:none;animation:none}}.wc-block-components-chip{align-items:center;border:0;border-radius:0;color:inherit;display:inline-flex;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;line-height:1;margin:0 0 .365em .365em;max-width:100%;padding:.125em .5em .25em;text-decoration:inherit;text-transform:inherit}.wc-block-components-chip,.wc-block-components-chip:active,.wc-block-components-chip:focus,.wc-block-components-chip:hover{background:#e0e0e0;color:#1e1e1e}.wc-block-components-chip.wc-block-components-chip--radius-small{border-radius:3px}.wc-block-components-chip.wc-block-components-chip--radius-medium{border-radius:.433em}.wc-block-components-chip.wc-block-components-chip--radius-large{border-radius:2em;padding-right:.75em;padding-left:.75em}.wc-block-components-chip .wc-block-components-chip__text{flex-grow:1}.wc-block-components-chip.is-removable{padding-left:.5em}.wc-block-components-chip.is-removable .wc-block-components-chip__text{padding-left:.25em}.wc-block-components-chip .wc-block-components-chip__remove{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;font-size:.75em;padding:0}.wc-block-components-chip .wc-block-components-chip__remove-icon{vertical-align:middle}.theme-twentytwentyone .wc-block-components-chip,.theme-twentytwentyone .wc-block-components-chip:active,.theme-twentytwentyone .wc-block-components-chip:focus,.theme-twentytwentyone .wc-block-components-chip:hover{background:#fff}.theme-twentytwentyone .wc-block-components-chip:active button.wc-block-components-chip__remove:not(:hover):not(:active):not(.has-background),.theme-twentytwentyone .wc-block-components-chip:focus button.wc-block-components-chip__remove:not(:hover):not(:active):not(.has-background),.theme-twentytwentyone .wc-block-components-chip:hover button.wc-block-components-chip__remove:not(:hover):not(:active):not(.has-background),.theme-twentytwentyone .wc-block-components-chip button.wc-block-components-chip__remove:not(:hover):not(:active):not(.has-background){background:transparent}.wc-block-components-chip__remove:focus,.wc-block-components-chip__remove:hover,button.wc-block-components-chip:focus>.wc-block-components-chip__remove,button.wc-block-components-chip:hover>.wc-block-components-chip__remove{fill:#cc1818}.wc-block-components-chip__remove:disabled,button.wc-block-components-chip:disabled>.wc-block-components-chip__remove{fill:#949494;cursor:not-allowed}.wc-block-components-combobox .wc-block-components-combobox-control,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control{border:0;border-radius:0;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-decoration:inherit;text-transform:inherit;vertical-align:baseline}.wc-block-components-combobox .wc-block-components-combobox-control .components-base-control__field,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-base-control__field{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline}.wc-block-components-combobox .wc-block-components-combobox-control .components-combobox-control__suggestions-container,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-combobox-control__suggestions-container{border:0;border-radius:0;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;position:relative;text-decoration:inherit;text-transform:inherit;vertical-align:baseline}.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input{background:#fff;border:1px solid #50575e;border-radius:4px;box-shadow:none;box-sizing:border-box;color:inherit;color:#2b2d2f;font-family:inherit;font-size:inherit;font-size:1em;font-style:inherit;font-weight:inherit;font-weight:400;height:3em;letter-spacing:inherit;line-height:inherit;line-height:1;opacity:1;outline:inherit;padding:1.5em 16px .25em;text-align:right;text-decoration:inherit;text-overflow:ellipsis;text-transform:inherit;text-transform:none;white-space:nowrap;width:100%}.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input[aria-expanded=true],.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input[aria-expanded=true]{background-color:#fff;box-shadow:0 0 0 1px #50575e;color:#2b2d2f;outline:0}.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input[aria-expanded=true],.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input[aria-expanded=true]{border-bottom-right-radius:0;border-bottom-left-radius:0}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input{background-color:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.4);color:#fff}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus{background-color:rgba(0,0,0,.1);box-shadow:0 0 0 1px hsla(0,0%,100%,.4);color:#fff}.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list{background-color:#fff;border:1px solid #50575e;border-top:0;color:#2b2d2f;margin:3em 0 0;max-height:300px;min-width:100%;overflow:auto;padding:0;position:absolute;z-index:10}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list{background-color:#1e1e1e;color:#fff}.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion{color:#757575;cursor:default;font-size:1em;list-style:none;margin:0;padding:.25em 16px}.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-selected,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-selected{background-color:#ddd}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-selected,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-selected{background-color:rgba(0,0,0,.4)}.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-highlighted,.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:active,.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:focus,.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:hover,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-highlighted,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:active,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:focus,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:hover{background-color:#00669e;color:#fff}.wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label{color:inherit;color:#757575;font-family:inherit;font-size:inherit;font-size:1em;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;line-height:1.375;margin:0 17px 0 0;max-width:calc(100% - 32px);overflow:hidden;position:absolute;text-decoration:inherit;text-overflow:ellipsis;text-transform:inherit;transform:translateY(.75em);transform-origin:top right;transition:all .2s ease;white-space:nowrap;z-index:1}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label{color:hsla(0,0%,100%,.6)}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label{transition:none}}.wc-block-components-combobox.is-active .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-combobox:focus-within .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox.is-active .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox:focus-within .wc-block-components-combobox-control label.components-base-control__label{transform:translateY(4px) scale(.75)}.wc-block-components-combobox.has-error .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control label.components-base-control__label{color:#cc1818}.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input,.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:active,.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:hover,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:active,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:hover{border-color:#cc1818}.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:focus{box-shadow:0 0 0 1px #cc1818}.wc-block-components-country-input{margin-top:1.5em}@-webkit-keyframes fadein{0%{opacity:0}to{opacity:1}}@keyframes fadein{0%{opacity:0}to{opacity:1}}@-webkit-keyframes slidein{0%{transform:translateX(0)}to{transform:translateX(480px)}}@keyframes slidein{0%{transform:translateX(0)}to{transform:translateX(480px)}}@media only screen and (max-width:480px){@-webkit-keyframes slidein{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes slidein{0%{transform:translateX(0)}to{transform:translateX(100vw)}}}.wc-block-components-drawer__screen-overlay{background-color:rgba(95,95,95,.35);bottom:0;right:0;opacity:1;position:fixed;left:0;top:0;transition:opacity .3s;z-index:9999}.wc-block-components-drawer__screen-overlay--with-slide-out{transition:opacity .3s}.wc-block-components-drawer__screen-overlay--with-slide-in{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-name:fadein;animation-name:fadein}.wc-block-components-drawer__screen-overlay--is-hidden{opacity:0;pointer-events:none}.wc-block-components-drawer{background:#fff;display:block;height:100%;right:100%;position:relative;position:fixed;left:0;top:0;transform:translateX(480px);width:480px}.wc-block-components-drawer:after{border-style:solid;border-width:0 1px 0 0;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}@media only screen and (max-width:480px){.wc-block-components-drawer{transform:translateX(100vw);width:100vw}}.wc-block-components-drawer__screen-overlay--with-slide-out .wc-block-components-drawer{transition:transform .3s}.wc-block-components-drawer__screen-overlay--with-slide-in .wc-block-components-drawer{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-name:slidein;animation-name:slidein}.wc-block-components-drawer__screen-overlay--is-hidden .wc-block-components-drawer{transform:translateX(0)}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-drawer,.wc-block-components-drawer__screen-overlay{-webkit-animation-name:none!important;animation-name:none!important;transition:none!important}}.wc-block-components-drawer .components-modal__content{padding:40px 16px}.wc-block-components-drawer .components-modal__header{position:relative}.wc-block-components-drawer .components-modal__header .components-button{background:transparent;border:0;border-radius:0;margin:-1em;padding:1em;position:absolute;left:0;top:0;vertical-align:baseline}.wc-block-components-drawer .components-modal__header .components-button>span{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;padding:0;position:absolute!important;width:1px}.wc-block-components-drawer .components-modal__header-heading{border:0;border-radius:0;font-size:1.25rem;margin:0;padding:0;vertical-align:baseline;word-break:break-word}.wc-filter-element-label-list-count{opacity:.6}.wc-filter-element-label-list-count:before{content:" ("}.wc-filter-element-label-list-count:after{content:")"}.wc-block-components-filter-reset-button{background:transparent;border:none;cursor:pointer;font-size:inherit}.wc-block-components-filter-reset-button:not([disabled]):hover{text-decoration:underline}.wc-block-components-filter-reset-button[disabled]{cursor:not-allowed}.wc-block-components-filter-submit-button{border:none;display:block;margin-right:auto;white-space:nowrap}.wc-blocks-components-form-token-field-wrapper .components-popover{right:0;opacity:0;position:fixed;top:0;z-index:z-index(".components-popover")}.wc-blocks-components-form-token-field-wrapper .components-popover.is-expanded,.wc-blocks-components-form-token-field-wrapper .components-popover[data-x-axis][data-y-axis]{opacity:1}.wc-blocks-components-form-token-field-wrapper .components-popover.is-expanded{bottom:0;right:0;left:0;top:0;z-index:z-index(".components-popover")!important}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow){margin-right:2px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):before{border:8px solid #ccc}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow).is-alternate:before{border-color:#1e1e1e}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):after{border:8px solid #fff}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):before{content:"";height:0;line-height:0;position:absolute;width:0}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]{margin-top:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{bottom:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:after{bottom:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{border-bottom:none;border-right-color:transparent;border-left-color:transparent;border-top-style:solid;margin-right:-10px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]{margin-top:8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{top:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after{top:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{border-bottom-style:solid;border-right-color:transparent;border-left-color:transparent;border-top:none;margin-right:-10px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]{margin-right:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:before{left:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:after{left:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:before{border-bottom-color:transparent;border-right-style:solid;border-left:none;border-top-color:transparent}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]{margin-right:8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:before{right:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:after{right:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:before{border-bottom-color:transparent;border-right:none;border-left-style:solid;border-top-color:transparent}.wc-blocks-components-form-token-field-wrapper .components-popover[data-y-axis=top]{bottom:100%}.wc-blocks-components-form-token-field-wrapper .components-popover[data-y-axis=bottom]{top:100%}.wc-blocks-components-form-token-field-wrapper .components-popover[data-y-axis=middle]{align-items:center;display:flex}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-top{margin-top:12px}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-bottom{margin-top:-12px}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-left:not(.is-from-top):not(.is-from-bottom){margin-right:12px}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-right:not(.is-from-top):not(.is-from-bottom){margin-left:12px}.wc-blocks-components-form-token-field-wrapper .components-popover__content{background:#fff;border:1px solid #ccc;border-radius:2px;box-shadow:0 2px 6px rgba(0,0,0,.05);height:100%}.is-alternate .wc-blocks-components-form-token-field-wrapper .components-popover__content{border:1px solid #1e1e1e;box-shadow:none}.components-popover .wc-blocks-components-form-token-field-wrapper .components-popover__content{height:auto;overflow-y:auto;position:absolute}.components-popover.is-expanded .wc-blocks-components-form-token-field-wrapper .components-popover__content{border:none;border-top:1px solid #1e1e1e;height:calc(100% - 48px);min-width:auto;overflow-y:visible;position:static}.components-popover[data-y-axis=top] .wc-blocks-components-form-token-field-wrapper .components-popover__content{bottom:100%}.components-popover[data-x-axis=center] .wc-blocks-components-form-token-field-wrapper .components-popover__content{right:50%;transform:translateX(50%)}.components-popover[data-x-axis=right] .wc-blocks-components-form-token-field-wrapper .components-popover__content{right:100%;position:absolute}.components-popover:not([data-y-axis=middle])[data-x-axis=right] .wc-blocks-components-form-token-field-wrapper .components-popover__content{margin-right:-25px}.components-popover[data-x-axis=left] .wc-blocks-components-form-token-field-wrapper .components-popover__content{position:absolute;left:100%}.components-popover:not([data-y-axis=middle])[data-x-axis=left] .wc-blocks-components-form-token-field-wrapper .components-popover__content{margin-left:-25px}.wc-blocks-components-form-token-field-wrapper .components-popover__header{align-items:center;background:#fff;display:flex;height:48px;justify-content:space-between;padding:0 16px 0 8px}.wc-blocks-components-form-token-field-wrapper .components-popover__header-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.wc-blocks-components-form-token-field-wrapper .components-popover__close.components-button{z-index:z-index(".components-popover__close")}.wc-blocks-components-form-token-field-wrapper .components-tooltip.components-popover{z-index:z-index(".components-tooltip")}.wc-blocks-components-form-token-field-wrapper .components-tooltip.components-popover .components-popover__content{min-width:0}.wc-blocks-components-form-token-field-wrapper .components-tooltip .components-popover__content{background:#1e1e1e;border-radius:2px;border-width:0;box-shadow:none;color:#fff;font-size:12px;line-height:1.4;text-align:center;white-space:nowrap}.wc-blocks-components-form-token-field-wrapper .components-tooltip .components-popover__content>div{padding:4px 8px}.wc-blocks-components-form-token-field-wrapper .components-tooltip__shortcut{display:inline-block;margin-right:8px}.wc-blocks-components-form-token-field-wrapper .disabled-element-wrapper{position:relative}.wc-blocks-components-form-token-field-wrapper .disabled-element-wrapper .event-catcher{bottom:0;height:100%;right:0;position:absolute;left:0;top:0;width:100%;z-index:z-index(".components-tooltip .event-catcher")}.wc-blocks-components-form-token-field-wrapper{border-color:#949494}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__label,.wc-blocks-components-form-token-field-wrapper .components-visually-hidden{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;padding:0;position:absolute!important;width:1px}.wc-blocks-components-form-token-field-wrapper .components-form-token-field,.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container{border-color:inherit;box-sizing:border-box;margin-bottom:0}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container{border-radius:0;box-shadow:none;position:relative}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container input[type=text].components-form-token-field__input{min-height:30px}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__remove-token.components-button,.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token-text{background:#e0e0e0}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__remove-token{border:none}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__suggestions-list{background-color:#fff;border:1px solid #949494;border-top:0 solid #949494;right:-1px;margin:1px 0 0;position:absolute;left:-1px;top:100%;z-index:50}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__suggestions-list:empty{display:none}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__suggestion{padding:8px}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__suggestion.is-selected{background:#f0f0f0;color:#2f2f2f}.wc-blocks-components-form-token-field-wrapper.single-selection .components-form-token-field__token{margin-left:0;position:relative;width:100%}.wc-blocks-components-form-token-field-wrapper.single-selection .components-form-token-field__remove-token.components-button,.wc-blocks-components-form-token-field-wrapper.single-selection .components-form-token-field__token-text{background:transparent}.wc-blocks-components-form-token-field-wrapper.single-selection .components-form-token-field__token-text{padding-right:4px;width:100%}.wc-blocks-components-form-token-field-wrapper.single-selection .components-form-token-field__token+input[type=text].components-form-token-field__input{position:absolute}.wc-blocks-components-form-token-field-wrapper.single-selection .is-active .components-form-token-field__token+input[type=text].components-form-token-field__input{border:1px solid #949494;margin:0 2px 4px;padding:0 5px;position:static}.wc-block-components-formatted-money-amount{white-space:nowrap}.wc-block-components-load-more{text-align:center;width:100%}.wc-block-components-loading-mask{min-height:34px;pointer-events:none;position:relative}.wc-block-components-loading-mask .components-spinner{right:50%;margin:0;position:absolute;top:50%;transform:translate(50%,-50%)}.wc-block-components-loading-mask .wc-block-components-loading-mask__children{opacity:.25}.wc-block-components-pagination{margin:0 auto 16px}.wc-block-components-pagination__ellipsis,.wc-block-components-pagination__page{color:#333;display:inline-block;font-size:1em;font-weight:400}.wc-block-components-pagination__page{border-color:transparent;min-width:2.2em;padding:.3em .6em}@media(max-width:782px){.wc-block-components-pagination__page{min-width:1.6em;padding:.1em .2em}}.wc-block-components-pagination__page:not(.toggle){background-color:transparent}.wc-block-components-pagination__ellipsis{padding:.3em}@media(max-width:782px){.wc-block-components-pagination__ellipsis{padding:.1em}}.wc-block-components-pagination__page--active[disabled]{color:#333;font-weight:700;opacity:1!important}.wc-block-components-pagination__page--active[disabled]:focus,.wc-block-components-pagination__page--active[disabled]:hover{background-color:inherit;color:#333;opacity:1!important}html[dir=rtl] .wc-block-components-pagination-page--arrow span{display:inline-block;transform:scaleX(-1)}.wc-block-components-price-slider{margin-bottom:24px}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-filter-reset-button,.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-filter-submit-button,.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-filter-reset-button>*,.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-filter-submit-button>*,.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper>*{visibility:hidden}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-filter-reset-button:after,.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-filter-submit-button:after,.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-filter-reset-button,.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-filter-submit-button,.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__amount{display:none}.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__amount,.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__button,.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}.wc-block-components-price-slider__range-input-wrapper{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;background:#ddd;border:0!important;border-radius:4px;clear:both;flex-grow:1;height:4px;margin:15px 0;outline:none;padding:0!important;position:relative}.wc-block-components-price-slider__range-input-progress{--track-background:linear-gradient(90deg,transparent var(--low),var(--range-color) 0,var(--range-color) var(--high),transparent 0) no-repeat 0 100%/100% 100%;--range-color:#1e1e1e;background:var(--track-background);height:4px;right:0;position:absolute;top:0;width:100%}.wc-block-components-price-slider__controls{align-items:center;display:flex;gap:8px;justify-content:space-between;margin:24px 0}.wc-block-components-price-slider__controls .wc-block-components-price-slider__amount{border-radius:4px;border-width:1px;margin:0;max-width:100px;min-width:0;padding:8px;width:auto}.wc-block-components-price-slider__range-text{align-items:center;display:flex;justify-content:space-between;margin:24px 0}.wc-block-components-price-slider__actions{align-items:center;display:flex;gap:16px;justify-content:flex-end}.wc-block-components-price-slider__actions .wc-block-components-filter-submit-button{margin-right:0}.wc-block-components-price-slider__range-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0!important;display:block;height:0;right:0;margin:0;outline:none;outline:none!important;padding:0!important;pointer-events:none;position:relative;position:absolute;top:0;width:100%}.wc-block-components-price-slider__range-input::-webkit-slider-runnable-track{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:default;height:1px;outline:0}.wc-block-components-price-slider__range-input::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;background-position:100% 0;background:#fff;border:2px solid #1e1e1e;border-radius:100%;box-sizing:content-box;cursor:pointer;height:12px;margin:-5px 0 0;padding:0;pointer-events:auto;-webkit-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;vertical-align:top;width:12px;z-index:20}.wc-block-components-price-slider__range-input::-webkit-slider-thumb:hover{background:#1e1e1e}.wc-block-components-price-slider__range-input::-webkit-slider-progress{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0!important;margin:0;outline:none;padding:0!important}.wc-block-components-price-slider__range-input::-moz-focus-outer{border:0}.wc-block-components-price-slider__range-input::-moz-range-track{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:default;height:1px;outline:0}.wc-block-components-price-slider__range-input::-moz-range-progress{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0!important;margin:0;outline:none;padding:0!important}.wc-block-components-price-slider__range-input::-moz-range-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;background-position:100% 0;background:#fff;border:2px solid #1e1e1e;border-radius:100%;box-sizing:content-box;cursor:pointer;height:12px;margin:0;padding:0;pointer-events:auto;-moz-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;vertical-align:top;width:12px;z-index:20}.wc-block-components-price-slider__range-input::-moz-range-thumb:hover{background:#1e1e1e}.wc-block-components-price-slider__range-input::-ms-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;background-position:100% 0;background:#fff;border:2px solid #1e1e1e;border-radius:100%;box-sizing:content-box;cursor:pointer;height:12px;margin:0;padding:0;pointer-events:auto;-ms-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;vertical-align:top;width:12px;z-index:20}.wc-block-components-price-slider__range-input::-ms-thumb:hover{background:#1e1e1e}.wc-block-components-price-slider__range-input:focus::-webkit-slider-thumb{background:#1e1e1e}.wc-block-components-price-slider__range-input:focus::-moz-range-thumb{background:#1e1e1e}.wc-block-components-price-slider__range-input:focus::-ms-thumb{background:#1e1e1e}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--min{z-index:21}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--min::-webkit-slider-thumb{background-position-x:right;margin-right:-2px}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--min::-moz-range-thumb{background-position-x:right;transform:translate(2px,2px)}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--min::-ms-thumb{background-position-x:right}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--max{z-index:20}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--max::-webkit-slider-thumb{background-position-x:left;margin-right:2px}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--max::-moz-range-thumb{background-position-x:left;transform:translate(-2px,2px)}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--max::-ms-thumb{background-position-x:left}.rtl .wc-block-components-price-slider__range-input-progress{--track-background:linear-gradient(270deg,transparent var(--low),var(--range-color) 0,var(--range-color) var(--high),transparent 0) no-repeat 0 100%/100% 100%;--range-color:#af7dd1;background:var(--track-background)}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.wc-block-components-price-slider__range-input-wrapper{background:transparent;box-shadow:none;height:24px}.wc-block-components-price-slider__range-input-progress{background:#af7dd1;top:7px;width:100%}.wc-block-components-price-slider__range-input{height:24px;pointer-events:auto}.wc-block-components-price-slider__range-input::-ms-track{background:transparent;border-color:transparent;border-width:7px 0;color:transparent}.wc-block-components-price-slider__range-input::-ms-fill-lower{background:#e1e1e1;box-shadow:inset 0 0 0 1px #b8b8b8}.wc-block-components-price-slider__range-input::-ms-fill-upper{background:transparent}.wc-block-components-price-slider__range-input::-ms-tooltip{display:none}.wc-block-components-price-slider__range-input::-ms-thumb{pointer-events:auto;transform:translate(-1px)}.wc-block-components-price-slider__range-input--max::-ms-fill-upper{background:#e1e1e1;box-shadow:inset 0 0 0 1px #b8b8b8}.wc-block-components-price-slider__range-input--max::-ms-fill-lower{background:transparent}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper>*{visibility:hidden}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}}@media screen and (-ms-high-contrast:active)and (prefers-reduced-motion:reduce),screen and (-ms-high-contrast:none)and (prefers-reduced-motion:reduce){.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}@supports(-ms-ime-align:auto){.wc-block-components-price-slider__range-input-wrapper{background:transparent;box-shadow:none;height:24px}.wc-block-components-price-slider__range-input-progress{background:#af7dd1;top:7px;width:100%}.wc-block-components-price-slider__range-input{height:24px;pointer-events:auto}.wc-block-components-price-slider__range-input::-ms-track{background:transparent;border-color:transparent;border-width:7px 0;color:transparent}.wc-block-components-price-slider__range-input::-ms-fill-lower{background:#e1e1e1;box-shadow:inset 0 0 0 1px #b8b8b8}.wc-block-components-price-slider__range-input::-ms-fill-upper{background:transparent}.wc-block-components-price-slider__range-input::-ms-tooltip{display:none}.wc-block-components-price-slider__range-input::-ms-thumb{pointer-events:auto;transform:translate(-1px)}.wc-block-components-price-slider__range-input--max::-ms-fill-upper{background:#e1e1e1;box-shadow:inset 0 0 0 1px #b8b8b8}.wc-block-components-price-slider__range-input--max::-ms-fill-lower{background:transparent}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper>*{visibility:hidden}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}.theme-twentytwentyone .wc-block-components-price-slider__range-input-wrapper{background:transparent;border:3px solid;box-sizing:border-box}.theme-twentytwentyone .wc-block-components-price-slider__range-input-progress{--range-color:currentColor;margin:-3px}.theme-twentytwentyone .wc-block-price-filter__range-input{background:transparent;margin:-3px;width:calc(100% + 6px)}.theme-twentytwentyone .wc-block-price-filter__range-input:focus::-webkit-slider-thumb,.theme-twentytwentyone .wc-block-price-filter__range-input:hover::-webkit-slider-thumb{filter:none}.theme-twentytwentyone .wc-block-price-filter__range-input:focus::-moz-range-thumb,.theme-twentytwentyone .wc-block-price-filter__range-input:hover::-moz-range-thumb{filter:none}.theme-twentytwentyone .wc-block-price-filter__range-input:focus::-ms-thumb,.theme-twentytwentyone .wc-block-price-filter__range-input:hover::-ms-thumb{filter:none}.theme-twentytwentyone .wc-block-price-filter__range-input::-webkit-slider-thumb{margin-top:-9px}.theme-twentytwentyone .wc-block-price-filter__range-input.wc-block-components-price-slider__range-input--max::-moz-range-thumb{transform:translate(-2px,1px)}.theme-twentytwentyone .wc-block-price-filter__range-input.wc-block-components-price-slider__range-input--min::-moz-range-thumb{transform:translate(2px,1px)}.theme-twentytwentyone .wc-block-price-filter__range-input::-ms-track{border-color:transparent!important}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.theme-twentytwentyone .wc-block-components-price-slider__range-input-wrapper{border:0;height:auto;height:50px;position:relative}.theme-twentytwentyone .wc-block-components-price-slider__range-input-progress{display:none}.theme-twentytwentyone .wc-block-price-filter__range-input{height:100%;margin:0;width:100%}}.wc-block-components-product-sort-select{margin-bottom:24px;text-align:right}@-webkit-keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(-1turn)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(-1turn)}}.wc-block-grid{text-align:center}.wc-block-grid__no-products{padding:40px;text-align:center;width:100%}.wc-block-grid__no-products .wc-block-grid__no-products-image{color:inherit;display:block;margin:0 auto 1em;max-width:150px}.wc-block-grid__no-products .wc-block-grid__no-products-title{display:block;font-weight:700;margin:0}.wc-block-grid__no-products .wc-block-grid__no-products-description{display:block;margin:.25em 0 1em}.wc-block-grid__products{background-clip:padding-box;display:flex;flex-wrap:wrap;margin:0 -8px 16px;padding:0}.wc-block-grid__product{border-bottom:16px solid transparent;border-right:8px solid transparent;border-left:8px solid transparent;box-sizing:border-box;float:none;list-style:none;margin:0;padding:0;position:relative;text-align:center;width:auto}.wc-block-grid__product.wc-block-grid__product{box-sizing:border-box}.theme-twentytwenty .wc-block-grid.has-aligned-buttons .wc-block-grid__product,.wc-block-grid.has-aligned-buttons .wc-block-grid__product{display:flex;flex-direction:column}.theme-twentytwenty .wc-block-grid.has-aligned-buttons .wc-block-grid__product>:last-child,.wc-block-grid.has-aligned-buttons .wc-block-grid__product>:last-child{margin-bottom:0;margin-top:auto;padding-bottom:12px}.theme-twentytwenty .wc-block-grid.has-1-columns .wc-block-grid__product,.wc-block-grid.has-1-columns .wc-block-grid__product{flex:1 0 100%;max-width:100%}.theme-twentytwenty .wc-block-grid.has-2-columns .wc-block-grid__product,.wc-block-grid.has-2-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%}.theme-twentytwenty .wc-block-grid.has-3-columns .wc-block-grid__product,.wc-block-grid.has-3-columns .wc-block-grid__product{flex:1 0 33.3333333333%;max-width:33.3333333333%}.theme-twentytwenty .wc-block-grid.has-4-columns .wc-block-grid__product,.wc-block-grid.has-4-columns .wc-block-grid__product{flex:1 0 25%;max-width:25%}.theme-twentytwenty .wc-block-grid.has-5-columns .wc-block-grid__product,.wc-block-grid.has-5-columns .wc-block-grid__product{flex:1 0 20%;max-width:20%}.theme-twentytwenty .wc-block-grid.has-6-columns .wc-block-grid__product,.wc-block-grid.has-6-columns .wc-block-grid__product{flex:1 0 16.6666666667%;max-width:16.6666666667%}.theme-twentytwenty .wc-block-grid.has-7-columns .wc-block-grid__product,.wc-block-grid.has-7-columns .wc-block-grid__product{flex:1 0 14.2857142857%;max-width:14.2857142857%}.theme-twentytwenty .wc-block-grid.has-8-columns .wc-block-grid__product,.wc-block-grid.has-8-columns .wc-block-grid__product{flex:1 0 12.5%;max-width:12.5%}.theme-twentytwenty .wc-block-grid.has-6-columns .wc-block-grid__product,.wc-block-grid.has-6-columns .wc-block-grid__product{font-size:.5em}.theme-twentytwenty .wc-block-grid.has-5-columns .wc-block-grid__product,.theme-twentytwenty .wc-block-grid.has-6-columns.alignfull .wc-block-grid__product,.wc-block-grid.has-5-columns .wc-block-grid__product,.wc-block-grid.has-6-columns.alignfull .wc-block-grid__product{font-size:.58em}.theme-twentytwenty .wc-block-grid.has-4-columns:not(.alignwide):not(.alignfull) .wc-block-grid__product,.theme-twentytwenty .wc-block-grid.has-5-columns.alignfull .wc-block-grid__product,.wc-block-grid.has-4-columns:not(.alignwide):not(.alignfull) .wc-block-grid__product,.wc-block-grid.has-5-columns.alignfull .wc-block-grid__product{font-size:.75em}.theme-twentytwenty .wc-block-grid.has-3-columns:not(.alignwide):not(.alignfull),.wc-block-grid.has-3-columns:not(.alignwide):not(.alignfull){font-size:.92em}@media(max-width:480px){.wc-block-grid.has-2-columns .wc-block-grid__products{display:block}.wc-block-grid.has-2-columns .wc-block-grid__product{flex:1 0 100%;margin-right:auto;margin-left:auto;max-width:100%;padding:0}.wc-block-grid.has-3-columns .wc-block-grid__products{display:block}.wc-block-grid.has-3-columns .wc-block-grid__product{flex:1 0 100%;margin-right:auto;margin-left:auto;max-width:100%;padding:0}.wc-block-grid.has-4-columns .wc-block-grid__products{display:block}.wc-block-grid.has-4-columns .wc-block-grid__product{flex:1 0 100%;margin-right:auto;margin-left:auto;max-width:100%;padding:0}.wc-block-grid.has-5-columns .wc-block-grid__products{display:block}.wc-block-grid.has-5-columns .wc-block-grid__product{flex:1 0 100%;margin-right:auto;margin-left:auto;max-width:100%;padding:0}.wc-block-grid.has-6-columns .wc-block-grid__products{display:block}.wc-block-grid.has-6-columns .wc-block-grid__product{flex:1 0 100%;margin-right:auto;margin-left:auto;max-width:100%;padding:0}.wc-block-grid.has-7-columns .wc-block-grid__products{display:block}.wc-block-grid.has-7-columns .wc-block-grid__product{flex:1 0 100%;margin-right:auto;margin-left:auto;max-width:100%;padding:0}.wc-block-grid.has-8-columns .wc-block-grid__products{display:block}.wc-block-grid.has-8-columns .wc-block-grid__product{flex:1 0 100%;margin-right:auto;margin-left:auto;max-width:100%;padding:0}}@media(min-width:481px)and (max-width:600px){.wc-block-grid.has-2-columns .wc-block-grid__product{flex:1 0 50%;margin:0 0 24px;max-width:50%;padding:0}.wc-block-grid.has-2-columns .wc-block-grid__product:nth-child(odd){padding-left:8px}.wc-block-grid.has-2-columns .wc-block-grid__product:nth-child(2n){padding-right:8px}.wc-block-grid.has-3-columns .wc-block-grid__product{flex:1 0 50%;margin:0 0 24px;max-width:50%;padding:0}.wc-block-grid.has-3-columns .wc-block-grid__product:nth-child(odd){padding-left:8px}.wc-block-grid.has-3-columns .wc-block-grid__product:nth-child(2n){padding-right:8px}.wc-block-grid.has-4-columns .wc-block-grid__product{flex:1 0 50%;margin:0 0 24px;max-width:50%;padding:0}.wc-block-grid.has-4-columns .wc-block-grid__product:nth-child(odd){padding-left:8px}.wc-block-grid.has-4-columns .wc-block-grid__product:nth-child(2n){padding-right:8px}.wc-block-grid.has-5-columns .wc-block-grid__product{flex:1 0 50%;margin:0 0 24px;max-width:50%;padding:0}.wc-block-grid.has-5-columns .wc-block-grid__product:nth-child(odd){padding-left:8px}.wc-block-grid.has-5-columns .wc-block-grid__product:nth-child(2n){padding-right:8px}.wc-block-grid.has-6-columns .wc-block-grid__product{flex:1 0 50%;margin:0 0 24px;max-width:50%;padding:0}.wc-block-grid.has-6-columns .wc-block-grid__product:nth-child(odd){padding-left:8px}.wc-block-grid.has-6-columns .wc-block-grid__product:nth-child(2n){padding-right:8px}.wc-block-grid.has-7-columns .wc-block-grid__product{flex:1 0 50%;margin:0 0 24px;max-width:50%;padding:0}.wc-block-grid.has-7-columns .wc-block-grid__product:nth-child(odd){padding-left:8px}.wc-block-grid.has-7-columns .wc-block-grid__product:nth-child(2n){padding-right:8px}.wc-block-grid.has-8-columns .wc-block-grid__product{flex:1 0 50%;margin:0 0 24px;max-width:50%;padding:0}.wc-block-grid.has-8-columns .wc-block-grid__product:nth-child(odd){padding-left:8px}.wc-block-grid.has-8-columns .wc-block-grid__product:nth-child(2n){padding-right:8px}}.wc-block-components-product-name{font-size:1em;overflow-wrap:anywhere;word-break:break-word;-ms-word-break:break-all}.wc-block-components-product-price--align-left{display:block;text-align:right}.wc-block-components-product-price--align-center{display:block;text-align:center}.wc-block-components-product-price--align-right{display:block;text-align:left}.wc-block-components-product-price__value.is-discounted{margin-right:.5em}.is-loading .wc-block-components-product-price:before{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;content:".";display:block;display:inline-block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;width:5em;z-index:1}.is-loading .wc-block-components-product-price:before>*{visibility:hidden}.is-loading .wc-block-components-product-price:before:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-price:before{-webkit-animation:none;animation:none}}.wc-block-components-quantity-selector{border-radius:4px;box-sizing:content-box;display:flex;margin:0 0 .25em;position:relative;width:107px}.wc-block-components-quantity-selector:after{border:1px solid;border-radius:4px;bottom:0;content:"";right:0;opacity:.45;pointer-events:none;position:absolute;left:0;top:0}.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;background:transparent;border:0;box-shadow:none;color:currentColor;flex:1 1 auto;font-size:1em;font-weight:600;line-height:1;margin:0;min-width:40px;order:2;padding:.4em 0;text-align:center;vertical-align:middle}.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input:focus{box-shadow:inset 0 0 1px 1px currentColor;outline:none}.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input:disabled{opacity:.6}.wc-block-components-quantity-selector input::-webkit-inner-spin-button,.wc-block-components-quantity-selector input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button{background:none transparent;border:0;box-shadow:none;color:currentColor;cursor:pointer;font-size:.9em;font-style:normal;font-weight:400;margin:0;min-width:30px;opacity:.6;padding:0;text-align:center;text-decoration:none}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus{box-shadow:inset 0 0 1px 1px currentColor;outline:none}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus,.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover{opacity:1}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:disabled{box-shadow:none;cursor:default;opacity:.6}.wc-block-components-quantity-selector>.wc-block-components-quantity-selector__button--minus{border-radius:0 4px 4px 0;order:1}.wc-block-components-quantity-selector>.wc-block-components-quantity-selector__button--plus{border-radius:4px 0 0 4px;order:3}.theme-twentyseventeen .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus,.theme-twentyseventeen .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover{background:none transparent}.wc-block-components-radio-control__option{color:inherit;display:block;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:1em 0;padding:0 2.5em 0 0;position:relative;text-decoration:inherit;text-transform:inherit}.wc-block-components-radio-control__option:first-child{margin-top:0}.wc-block-components-radio-control__option:last-child{margin-bottom:0}.wc-block-components-radio-control__option-layout{display:table;width:100%}.wc-block-components-radio-control__option .wc-block-components-radio-control__option-layout:after{display:none}.wc-block-components-radio-control__description-group,.wc-block-components-radio-control__label-group{display:table-row}.wc-block-components-radio-control__description-group>span,.wc-block-components-radio-control__label-group>span{display:table-cell}.wc-block-components-radio-control__description-group .wc-block-components-radio-control__secondary-description,.wc-block-components-radio-control__description-group .wc-block-components-radio-control__secondary-label,.wc-block-components-radio-control__label-group .wc-block-components-radio-control__secondary-description,.wc-block-components-radio-control__label-group .wc-block-components-radio-control__secondary-label{min-width:50%;text-align:left}.wc-block-components-radio-control__label,.wc-block-components-radio-control__secondary-label{line-height:max(1.5rem,24px)}.wc-block-components-radio-control__description,.wc-block-components-radio-control__secondary-description{font-size:.875em;line-height:20px}.wc-block-components-radio-control .wc-block-components-radio-control__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;border:2px solid #50575e;border-radius:50%;display:inline-block;height:1.5em;right:0;min-height:24px;min-width:24px;position:absolute;top:50%;transform:translateY(-50%);width:1.5em}.wc-block-components-radio-control .wc-block-components-radio-control__input:checked:before{background:#000;border-radius:50%;content:"";display:block;height:.75em;right:50%;margin:0;min-height:12px;min-width:12px;position:absolute;top:50%;transform:translate(50%,-50%);width:.75em}.has-dark-controls .wc-block-components-radio-control .wc-block-components-radio-control__input{background-color:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.6)}.has-dark-controls .wc-block-components-radio-control .wc-block-components-radio-control__input:checked:before{background:#fff}.theme-twentytwentyone .wc-block-components-radio-control .wc-block-components-radio-control__input:checked{border-width:2px}.theme-twentytwentyone .wc-block-components-radio-control .wc-block-components-radio-control__input:checked:before{background-color:var(--form--color-text)}.theme-twentytwentyone .wc-block-components-radio-control .wc-block-components-radio-control__input:after{display:none}.is-loading .wc-block-components-review-list-item__text{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;width:60%;z-index:1}.is-loading .wc-block-components-review-list-item__text>*{visibility:hidden}.is-loading .wc-block-components-review-list-item__text:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-review-list-item__text{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-review-list-item__text:before{content:" "}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image>*{visibility:hidden}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image:before{content:" "}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;font-size:1em;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;width:80px;z-index:1}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author>*{visibility:hidden}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author:before{content:" "}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__product,.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__rating .wc-block-components-review-list-item__rating__stars>span{display:none}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;height:1em;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;width:120px;z-index:1}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date>*{visibility:hidden}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date:before{content:" "}.editor-styles-wrapper .wc-block-components-review-list-item__item,.wc-block-components-review-list-item__item{list-style:none;margin:0 0 48px}.wc-block-components-review-list-item__info{-ms-grid-columns:1fr;display:-ms-grid;display:grid;grid-template-columns:1fr;margin-bottom:24px}.wc-block-components-review-list-item__meta{-ms-grid-column:1;grid-column:1;-ms-grid-row:1;grid-row:1}.wc-block-components-review-list-item__item--has-image .wc-block-components-review-list-item__info{-ms-grid-columns:calc(3em + 16px) 1fr;grid-template-columns:calc(3em + 16px) 1fr}.wc-block-components-review-list-item__item--has-image .wc-block-components-review-list-item__meta{-ms-grid-column:2;grid-column:2}.wc-block-components-review-list-item__image{-ms-grid-row-span:2;align-items:center;display:flex;-ms-grid-column:1;grid-column:1;-ms-grid-row:1;grid-row:1/3;height:3em;justify-content:center;position:relative;width:3em}.wc-block-components-review-list-item__image>img{display:block;max-height:100%;-o-object-fit:contain;object-fit:contain}.wc-block-components-review-list-item__verified{bottom:-7px;height:21px;line-height:21px;margin:0;overflow:hidden;position:absolute;left:-7px;text-indent:21px;width:21px}.wc-block-components-review-list-item__verified:before{background:transparent url('data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="21" height="21" fill="none"%3E%3Ccircle cx="10.5" cy="10.5" r="10.5" fill="%23fff"/%3E%3Cpath fill="%23008A21" fill-rule="evenodd" d="M2.1667 10.5003c0-4.6 3.7333-8.3333 8.3333-8.3333s8.3334 3.7333 8.3334 8.3333S15.1 18.8337 10.5 18.8337s-8.3333-3.7334-8.3333-8.3334zm2.5 0l4.1666 4.1667 7.5001-7.5-1.175-1.1833-6.325 6.325-2.9917-2.9834-1.175 1.175z" clip-rule="evenodd"/%3E%3Cmask id="a" width="17" height="17" x="2" y="2" maskUnits="userSpaceOnUse"%3E%3Cpath fill="%23fff" fill-rule="evenodd" d="M2.1667 10.5003c0-4.6 3.7333-8.3333 8.3333-8.3333s8.3334 3.7333 8.3334 8.3333S15.1 18.8337 10.5 18.8337s-8.3333-3.7334-8.3333-8.3334zm2.5 0l4.1666 4.1667 7.5001-7.5-1.175-1.1833-6.325 6.325-2.9917-2.9834-1.175 1.175z" clip-rule="evenodd"/%3E%3C/mask%3E%3Cg mask="url(%23a)"%3E%3Cpath fill="%23008A21" d="M.5.5h20v20H.5z"/%3E%3C/g%3E%3C/svg%3E') 50% no-repeat;content:"";display:block;height:21px;width:21px}.wc-block-components-review-list-item__meta{align-items:center;display:flex;flex-flow:row wrap}.wc-block-components-review-list-item__meta:after{content:"";flex-basis:100%;order:3}.wc-block-components-review-list-item__author,.wc-block-components-review-list-item__product{display:block;font-weight:700;margin-left:8px;order:1}.wc-block-components-review-list-item__product+.wc-block-components-review-list-item__author{font-weight:400;order:4}.wc-block-components-review-list-item__published-date{order:5}.wc-block-components-review-list-item__product+.wc-block-components-review-list-item__author+.wc-block-components-review-list-item__published-date{padding-right:8px;position:relative}.wc-block-components-review-list-item__product+.wc-block-components-review-list-item__author+.wc-block-components-review-list-item__published-date:before{border-left:1px solid;content:"";display:inline-block;height:1em;margin-right:-8px;opacity:.5;position:absolute;top:calc(50% + .1em);transform:translateY(-50%);vertical-align:middle}.wc-block-components-review-list-item__author:first-child+.wc-block-components-review-list-item__published-date:before,.wc-block-components-review-list-item__rating+.wc-block-components-review-list-item__author+.wc-block-components-review-list-item__published-date:before{display:none}.wc-block-components-review-list-item__rating{order:2}.wc-block-components-review-list-item__rating>.wc-block-components-review-list-item__rating__stars{display:block;font-family:star;font-size:1em;font-weight:400;height:1em;line-height:1;overflow:hidden;position:relative;top:0;width:5.3em}.wc-block-components-review-list-item__rating>.wc-block-components-review-list-item__rating__stars:before{content:"SSSSS";float:right;right:0;opacity:.25;position:absolute;top:0}.wc-block-components-review-list-item__rating>.wc-block-components-review-list-item__rating__stars span{float:right;right:0;overflow:hidden;padding-top:1.5em;position:absolute;top:0}.wc-block-components-review-list-item__rating>.wc-block-components-review-list-item__rating__stars span:before{color:#e6a237;content:"SSSSS";right:0;position:absolute;top:0}.wc-block-components-review-list-item__text p{font-size:inherit}.wc-block-components-review-list.wc-block-components-review-list{margin:0}.wc-block-components-review-sort-select{text-align:left}.wc-block-components-sidebar-layout{display:flex;flex-wrap:wrap;margin:0 auto 16px;position:relative}.wc-block-components-sidebar-layout .wc-block-components-main{box-sizing:border-box;margin:0;padding-left:3.7735849057%;width:65%}.wc-block-components-sidebar{box-sizing:border-box;margin:0;padding-right:2.2641509434%;width:35%}.wc-block-components-sidebar .wc-block-components-panel>h2{border:0;border-radius:0;font-size:1em;margin:0;padding:0;vertical-align:baseline}.is-medium.wc-block-components-sidebar-layout,.is-mobile.wc-block-components-sidebar-layout,.is-small.wc-block-components-sidebar-layout{flex-direction:column;margin:0 auto 16px}.is-medium.wc-block-components-sidebar-layout .wc-block-components-main,.is-medium.wc-block-components-sidebar-layout .wc-block-components-sidebar,.is-mobile.wc-block-components-sidebar-layout .wc-block-components-main,.is-mobile.wc-block-components-sidebar-layout .wc-block-components-sidebar,.is-small.wc-block-components-sidebar-layout .wc-block-components-main,.is-small.wc-block-components-sidebar-layout .wc-block-components-sidebar{padding:0;width:100%}.is-large .wc-block-components-sidebar .wc-block-components-panel,.is-large .wc-block-components-sidebar .wc-block-components-totals-item{padding-right:16px;padding-left:16px}.is-large .wc-block-components-sidebar .wc-block-components-panel .wc-block-components-totals-item{padding:0}.wc-block-components-sidebar .wc-block-components-panel>h2{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit}.wc-block-components-sidebar .wc-block-components-panel>h2 .wc-block-components-panel__button{font-weight:400}.theme-twentytwenty .wc-block-components-sidebar .wc-block-components-panel>h2{border:0;border-radius:0;font-size:1.25em;margin:0;padding:0;vertical-align:baseline}.wc-block-components-sort-select{margin-bottom:12px}.wc-block-components-sort-select__label{display:inline-block;font-weight:400;margin-left:12px}.wc-block-components-sort-select__select{font-size:inherit;width:-webkit-max-content;width:-moz-max-content;width:max-content}.wc-block-components-spinner{box-sizing:content-box;color:inherit;font-size:1.25em;height:100%;position:absolute;text-align:center;width:100%}.wc-block-components-spinner:after{-webkit-animation:spinner__animation 1s linear infinite;animation:spinner__animation 1s linear infinite;-webkit-backface-visibility:hidden;backface-visibility:hidden;border:.2em solid;border-right:.2em solid transparent;border-radius:50%;box-sizing:border-box;content:" ";height:1em;right:50%;margin:-.5em -.5em 0 0;position:absolute;top:50%;transform:translateZ(0) scale(.5);transform-origin:50% 50%;width:1em}.wc-block-components-state-input{margin-top:1.5em}.wc-block-components-tabs .wc-block-components-tabs__list{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item{background:transparent;border:none;border-radius:0;box-shadow:inset 0 -1px currentColor;color:inherit;flex:auto;outline-offset:-1px;padding:12px 16px;text-align:center;transition:box-shadow .1s linear}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item.is-active{box-shadow:inset 0 -3px currentColor;font-weight:600;position:relative}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item:focus{outline:1px dotted currentColor;outline-offset:-1px}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item:active,.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item:hover{background:transparent}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content{display:inline-block;font-size:1em;font-weight:700;line-height:1;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content>img,.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content>svg{height:1.2em;margin:.2em 0 -.2em;vertical-align:middle}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content .wc-block-components-payment-method-icons{margin:.2em 0 -.2em}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content .wc-block-components-payment-method-icons .wc-block-components-payment-method-icon{height:1.2em;vertical-align:middle}.wc-block-components-tabs .wc-block-components-tabs__content{padding:16px 0;text-transform:none}.wc-block-components-form .wc-block-components-text-input,.wc-block-components-text-input{margin-top:1.5em;position:relative;white-space:nowrap}.wc-block-components-form .wc-block-components-text-input label,.wc-block-components-text-input label{color:inherit;color:#757575;cursor:text;font-family:inherit;font-size:inherit;font-size:1em;font-style:inherit;font-weight:inherit;right:0;letter-spacing:inherit;line-height:inherit;line-height:1.375;margin:0 17px 0 0;max-width:calc(100% - 32px);overflow:hidden;position:absolute;text-decoration:inherit;text-overflow:ellipsis;text-transform:inherit;top:0;transform:translateY(.75em);transform-origin:top right;transition:transform .2s ease}.has-dark-controls .wc-block-components-form .wc-block-components-text-input label,.has-dark-controls .wc-block-components-text-input label{color:hsla(0,0%,100%,.6)}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-form .wc-block-components-text-input label,.wc-block-components-text-input label{transition:none}}.wc-block-components-form .wc-block-components-text-input input:-webkit-autofill+label,.wc-block-components-text-input input:-webkit-autofill+label{transform:translateY(4px) scale(.75)}.wc-block-components-form .wc-block-components-text-input.is-active label,.wc-block-components-text-input.is-active label{transform:translateY(4px) scale(.75)}.wc-block-components-form .wc-block-components-text-input input[type=email],.wc-block-components-form .wc-block-components-text-input input[type=number],.wc-block-components-form .wc-block-components-text-input input[type=tel],.wc-block-components-form .wc-block-components-text-input input[type=text],.wc-block-components-form .wc-block-components-text-input input[type=url],.wc-block-components-text-input input[type=email],.wc-block-components-text-input input[type=number],.wc-block-components-text-input input[type=tel],.wc-block-components-text-input input[type=text],.wc-block-components-text-input input[type=url]{background-color:#fff;border:1px solid #50575e;border-radius:4px;box-sizing:border-box;color:#2b2d2f;font-family:inherit;font-size:1em;height:3em;line-height:1.375;margin:0;min-height:0;padding:.75em 0;text-indent:16px;width:100%}.wc-block-components-form .wc-block-components-text-input input[type=email]:focus,.wc-block-components-form .wc-block-components-text-input input[type=number]:focus,.wc-block-components-form .wc-block-components-text-input input[type=tel]:focus,.wc-block-components-form .wc-block-components-text-input input[type=text]:focus,.wc-block-components-form .wc-block-components-text-input input[type=url]:focus,.wc-block-components-text-input input[type=email]:focus,.wc-block-components-text-input input[type=number]:focus,.wc-block-components-text-input input[type=tel]:focus,.wc-block-components-text-input input[type=text]:focus,.wc-block-components-text-input input[type=url]:focus{background-color:#fff;box-shadow:0 0 0 1px #50575e;color:#2b2d2f;outline:0}.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=email],.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=number],.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=tel],.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=text],.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=url],.has-dark-controls .wc-block-components-text-input input[type=email],.has-dark-controls .wc-block-components-text-input input[type=number],.has-dark-controls .wc-block-components-text-input input[type=tel],.has-dark-controls .wc-block-components-text-input input[type=text],.has-dark-controls .wc-block-components-text-input input[type=url]{background-color:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.4);color:#fff}.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=email]:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=number]:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=tel]:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=text]:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=url]:focus,.has-dark-controls .wc-block-components-text-input input[type=email]:focus,.has-dark-controls .wc-block-components-text-input input[type=number]:focus,.has-dark-controls .wc-block-components-text-input input[type=tel]:focus,.has-dark-controls .wc-block-components-text-input input[type=text]:focus,.has-dark-controls .wc-block-components-text-input input[type=url]:focus{background-color:rgba(0,0,0,.1);box-shadow:0 0 0 1px hsla(0,0%,100%,.4);color:#fff}.wc-block-components-form .wc-block-components-text-input input[type=number],.wc-block-components-text-input input[type=number]{-moz-appearance:textfield}.wc-block-components-form .wc-block-components-text-input input[type=number]::-webkit-inner-spin-button,.wc-block-components-form .wc-block-components-text-input input[type=number]::-webkit-outer-spin-button,.wc-block-components-text-input input[type=number]::-webkit-inner-spin-button,.wc-block-components-text-input input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.wc-block-components-form .wc-block-components-text-input.is-active input[type=email],.wc-block-components-form .wc-block-components-text-input.is-active input[type=number],.wc-block-components-form .wc-block-components-text-input.is-active input[type=tel],.wc-block-components-form .wc-block-components-text-input.is-active input[type=text],.wc-block-components-form .wc-block-components-text-input.is-active input[type=url],.wc-block-components-text-input.is-active input[type=email],.wc-block-components-text-input.is-active input[type=number],.wc-block-components-text-input.is-active input[type=tel],.wc-block-components-text-input.is-active input[type=text],.wc-block-components-text-input.is-active input[type=url]{padding:1.5em 0 .25em}.wc-block-components-form .wc-block-components-text-input.has-error input,.wc-block-components-form .wc-block-components-text-input.has-error input:active,.wc-block-components-form .wc-block-components-text-input.has-error input:focus,.wc-block-components-form .wc-block-components-text-input.has-error input:hover,.wc-block-components-text-input.has-error input,.wc-block-components-text-input.has-error input:active,.wc-block-components-text-input.has-error input:focus,.wc-block-components-text-input.has-error input:hover{border-color:#cc1818}.wc-block-components-form .wc-block-components-text-input.has-error input:focus,.wc-block-components-text-input.has-error input:focus{box-shadow:0 0 0 1px #cc1818}.has-dark-controls .wc-block-components-form .wc-block-components-text-input.has-error input,.has-dark-controls .wc-block-components-form .wc-block-components-text-input.has-error input:active,.has-dark-controls .wc-block-components-form .wc-block-components-text-input.has-error input:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input.has-error input:hover,.has-dark-controls .wc-block-components-text-input.has-error input,.has-dark-controls .wc-block-components-text-input.has-error input:active,.has-dark-controls .wc-block-components-text-input.has-error input:focus,.has-dark-controls .wc-block-components-text-input.has-error input:hover{border-color:#f18c8c}.has-dark-controls .wc-block-components-form .wc-block-components-text-input.has-error input:focus,.has-dark-controls .wc-block-components-text-input.has-error input:focus{box-shadow:0 0 0 1px #f18c8c}.wc-block-components-form .wc-block-components-text-input.has-error label,.wc-block-components-text-input.has-error label{color:#cc1818}.has-dark-controls .wc-block-components-form .wc-block-components-text-input.has-error label,.has-dark-controls .wc-block-components-text-input.has-error label{color:#f18c8c}.wc-block-components-form .wc-block-components-text-input:only-child,.wc-block-components-text-input:only-child{margin-top:1.5em}.wc-block-components-textarea{background-color:#fff;border:1px solid #50575e;border-radius:4px;color:#2b2d2f;font-family:inherit;font-size:1em;line-height:1.375;margin:0;padding:.75em 16px;width:100%}.has-dark-controls .wc-block-components-textarea{background-color:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.4);color:#fff}.has-dark-controls .wc-block-components-textarea::-moz-placeholder{color:hsla(0,0%,100%,.6)}.has-dark-controls .wc-block-components-textarea:-ms-input-placeholder{color:hsla(0,0%,100%,.6)}.has-dark-controls .wc-block-components-textarea::placeholder{color:hsla(0,0%,100%,.6)}.theme-twentytwentyone .has-dark-controls .wc-block-components-textarea{background-color:rgba(0,0,0,.1);color:#fff}.theme-twentytwenty .wc-block-components-title.wc-block-components-title,.wc-block-components-title.wc-block-components-title{border:0;border-radius:0;font-size:1.25em;margin:0;padding:0;vertical-align:baseline;word-break:break-word}.wc-block-components-notices{display:block;margin-bottom:2em}.wc-block-components-notices .wc-block-components-notices__notice{display:flex;flex-wrap:nowrap;margin:0}.wc-block-components-notices .wc-block-components-notices__notice .components-notice__dismiss{background:transparent none;border:0;color:currentColor;margin:0 auto 0 0;outline:0;padding:0}.wc-block-components-notices .wc-block-components-notices__notice .components-notice__dismiss svg{fill:currentColor;vertical-align:text-top}.wc-block-components-notices .wc-block-components-notices__notice+.wc-block-components-notices__notice{margin-top:1em}.theme-twentytwenty .wc-block-components-notices__notice,.theme-twentytwentyone .wc-block-components-notices__notice{padding:1.5rem 3rem}.wc-block-components-notices__snackbar{bottom:20px;right:16px;position:fixed;width:auto}@media(max-width:782px){.wc-block-components-notices__snackbar{bottom:auto;right:0;position:fixed;top:10px}.wc-block-components-notices__snackbar .components-snackbar-list__notice-container{margin-right:10px;margin-left:10px}}.wc-block-components-validation-error{color:#cc1818;font-size:.75em;max-width:100%;white-space:normal}.wc-block-components-validation-error>p{margin:0;padding:4px 0 0}.has-dark-mode-palette .wc-block-components-validation-error{color:#f18c8c}.wc-block-components-select+.wc-block-components-validation-error{margin-bottom:24px}.with-scroll-to-top__scroll-point{position:relative;top:-36px}.wc-block-components-express-payment{margin:auto;position:relative}.wc-block-components-express-payment .wc-block-components-express-payment__event-buttons{display:flex;flex-direction:row;flex-wrap:wrap;list-style:none;margin:0;overflow:hidden;padding:0;text-align:center;width:100%}.wc-block-components-express-payment .wc-block-components-express-payment__event-buttons>li{margin:0}.wc-block-components-express-payment .wc-block-components-express-payment__event-buttons>li>img{height:48px;width:100%}.wc-block-components-express-payment--checkout{margin-top:5px}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__title-container{display:flex;flex-direction:row;right:0;position:absolute;left:0;top:-5px;vertical-align:middle}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__title-container:before{border-right:1px solid;border-radius:0 5px 0 0;border-top:1px solid;content:"";display:block;height:4px;margin-left:12px;opacity:.3;pointer-events:none;width:10px}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__title-container:after{border-radius:5px 0 0 0;border-left:1px solid;border-top:1px solid;content:"";display:block;flex-grow:1;height:4px;margin-right:12px;opacity:.3;pointer-events:none}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__title{flex-grow:0;transform:translateY(-50%)}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__content{padding:1.5em 23px;position:relative}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__content:after{border-radius:0 0 5px 5px;border-style:solid;border-width:0 1px 1px;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__content>p{margin-bottom:1em}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__event-buttons>li{display:inline-block;width:50%}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__event-buttons>li:only-child{display:block;width:100%}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__event-buttons>li:nth-child(2n){padding-right:8px}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__event-buttons>li:nth-child(odd){padding-left:8px}.wc-block-components-express-payment--cart .wc-block-components-express-payment__event-buttons>li{padding-bottom:16px;text-align:center;width:100%}.wc-block-components-express-payment--cart .wc-block-components-express-payment__event-buttons>li:last-child{padding-bottom:0}.wc-block-components-express-payment-continue-rule{align-items:center;display:flex;margin:24px 0;padding:0 24px;text-align:center}.wc-block-components-express-payment-continue-rule:before{margin-left:10px}.wc-block-components-express-payment-continue-rule:after{margin-right:10px}.wc-block-components-express-payment-continue-rule:after,.wc-block-components-express-payment-continue-rule:before{border-bottom:1px solid;content:" ";flex:1;opacity:.3}.wc-block-components-express-payment-continue-rule--cart{margin:16px 0;text-transform:uppercase}.theme-twentynineteen .wc-block-components-express-payment__title:before{display:none}.theme-twentytwenty .wc-block-components-express-payment .wc-block-components-express-payment__title{padding-right:12px;padding-left:12px}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder{margin-bottom:16px}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder *{pointer-events:all}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder .components-placeholder__fieldset{display:block}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder .components-placeholder__fieldset .components-button{background-color:#1e1e1e;color:#fff}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder .components-placeholder__fieldset .wc-block-checkout__no-payment-methods-placeholder-description{display:block;margin:.25em 0 1em}.components-notice.wc-block-checkout__no-payment-methods-notice{margin-bottom:16px}.wc-block-card-elements{display:flex;width:100%}.wc-block-card-elements .wc-block-components-validation-error{position:static}.wc-block-gateway-container{margin-bottom:1.5em;position:relative;white-space:nowrap}.wc-block-gateway-container.wc-card-number-element{flex-basis:15em;flex-grow:1;min-width:min(15em,60%)}.wc-block-gateway-container.wc-card-expiry-element{flex-basis:7em;margin-right:12px;min-width:min(7em,calc(24% - 12px))}.wc-block-gateway-container.wc-card-cvc-element{flex-basis:7em;margin-right:12px;min-width:min(5em,calc(16% - 12px))}.wc-block-gateway-container .wc-block-gateway-input{background-color:#fff;border:1px solid #50575e;border-radius:4px;box-sizing:border-box;color:#2b2d2f;cursor:text;font-family:inherit;font-size:1em;height:3em;line-height:1.375;margin:0;padding:.75em 16px .75em 0;width:100%}.wc-block-gateway-container .wc-block-gateway-input:focus,.wc-block-gateway-container:focus{background-color:#fff}.wc-block-gateway-container label{color:inherit;color:#757575;cursor:text;font-family:inherit;font-size:inherit;font-size:1em;font-style:inherit;font-weight:inherit;right:0;letter-spacing:inherit;line-height:inherit;line-height:1.375;margin:0 17px 0 0;max-width:calc(100% - 24px);overflow:hidden;position:absolute;text-decoration:inherit;text-overflow:ellipsis;text-transform:inherit;top:0;transform:translateY(.75em);transform-origin:top right;transition:transform .2s ease}@media screen and (prefers-reduced-motion:reduce){.wc-block-gateway-container label{transition:none}}.wc-block-gateway-container.wc-inline-card-element label{margin-right:calc(24px + 1.5em)}.wc-block-gateway-container.wc-inline-card-element .wc-block-gateway-input.focused.empty+label,.wc-block-gateway-container.wc-inline-card-element .wc-block-gateway-input:not(.empty)+label{margin-right:16px;transform:translateY(4px) scale(.75)}.wc-block-gateway-container.wc-inline-card-element+.wc-block-components-validation-error{margin-top:-24px;position:static}.wc-block-gateway-container .wc-block-gateway-input.focused.empty,.wc-block-gateway-container .wc-block-gateway-input:not(.empty){padding:1.5em 16px .25em 0}.wc-block-gateway-container .wc-block-gateway-input.focused.empty+label,.wc-block-gateway-container .wc-block-gateway-input:not(.empty)+label{transform:translateY(4px) scale(.75)}.wc-block-gateway-container .wc-block-gateway-input.has-error{border-color:#cc1818}.wc-block-gateway-container .wc-block-gateway-input.has-error:focus{outline-color:#cc1818}.wc-block-gateway-container .wc-block-gateway-input.has-error+label{color:#cc1818}.is-large .wc-card-cvc-element .wc-block-components-validation-error>p,.is-large .wc-card-expiry-element .wc-block-components-validation-error>p,.is-medium .wc-card-cvc-element .wc-block-components-validation-error>p,.is-medium .wc-card-expiry-element .wc-block-components-validation-error>p{line-height:16px;padding-top:4px}.is-mobile .wc-card-cvc-element .wc-block-components-validation-error>p,.is-mobile .wc-card-expiry-element .wc-block-components-validation-error>p,.is-small .wc-card-cvc-element .wc-block-components-validation-error>p,.is-small .wc-card-expiry-element .wc-block-components-validation-error>p{min-height:28px}.wc-block-components-checkout-payment-methods *{pointer-events:all}.is-mobile .wc-block-card-elements,.is-small .wc-block-card-elements{flex-wrap:wrap}.is-mobile .wc-block-gateway-container.wc-card-number-element,.is-small .wc-block-gateway-container.wc-card-number-element{flex-basis:100%}.is-mobile .wc-block-gateway-container.wc-card-expiry-element,.is-small .wc-block-gateway-container.wc-card-expiry-element{flex-basis:calc(50% - 8px);margin-right:0;margin-left:8px}.is-mobile .wc-block-gateway-container.wc-card-cvc-element,.is-small .wc-block-gateway-container.wc-card-cvc-element{flex-basis:calc(50% - 8px);margin-right:8px}.wc-block-checkout__payment-method .wc-block-components-radio-control__option{padding-right:56px}.wc-block-checkout__payment-method .wc-block-components-radio-control__option:after{content:none}.wc-block-checkout__payment-method .wc-block-components-radio-control__option .wc-block-components-radio-control__input{right:16px}.wc-block-checkout__payment-method .wc-block-components-radio-control__option,.wc-block-checkout__payment-method .wc-block-components-radio-control__option:first-child,.wc-block-checkout__payment-method .wc-block-components-radio-control__option:last-child{margin:0;padding-bottom:1em;padding-top:1em}.wc-block-checkout__payment-method .wc-block-components-radio-control__option-checked{font-weight:700}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option,.wc-block-checkout__payment-method .wc-block-components-radio-control__option{position:relative}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:after,.wc-block-checkout__payment-method .wc-block-components-radio-control__option:after{border-style:solid;border-width:1px 1px 0;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:last-child:after,.wc-block-checkout__payment-method .wc-block-components-radio-control__option:last-child:after{border-width:1px}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__option:after{border-width:0}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__label{align-items:center;display:flex;justify-content:flex-start}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__label img{height:24px;max-height:24px;-o-object-fit:contain;object-fit:contain;-o-object-position:left;object-position:left}.wc-block-checkout__payment-method .wc-block-components-radio-control.disable-radio-control .wc-block-components-radio-control__option{padding-right:16px}.wc-block-checkout__payment-method .wc-block-components-radio-control.disable-radio-control .wc-block-components-radio-control__input{display:none}.wc-block-checkout__payment-method .wc-block-components-checkout-step__description-payments-aligned{height:28px;padding-top:14px}.wc-block-components-radio-control-accordion-content{padding:0 16px 1em}.wc-block-components-radio-control-accordion-content:empty{display:none}.wc-block-checkout__order-notes .wc-block-components-checkout-step__content{padding-bottom:0}.is-medium .wc-block-cart__sidebar,.is-mobile .wc-block-cart__sidebar,.is-small .wc-block-cart__sidebar{margin-bottom:24px;order:0}.editor-styles-wrapper .wc-block-cart__empty-cart__title,.wc-block-cart__empty-cart__title{font-size:inherit}.wc-block-cart__submit{margin:0 0 16px;position:relative}.wc-block-cart__submit-button{box-sizing:border-box;margin:0;width:100%}.wc-block-cart .wc-block-cart__submit-container{padding:0}@media(min-width:783px){.wc-block-cart .wc-block-cart__submit-container--sticky{display:none}}@media(max-width:782px){.wc-block-cart .wc-block-cart__submit-container--sticky{background:#fff;bottom:0;right:0;padding:16px;position:fixed;width:100%;z-index:9999}.wc-block-cart .wc-block-cart__submit-container--sticky:before{box-shadow:0 -10px 20px 10px currentColor;color:hsla(0,0%,80%,.5);content:"";height:100%;right:0;position:absolute;left:0;top:0}}.wc-block-checkout-error{padding:40px;text-align:center;width:100%}.wc-block-checkout-error .wc-block-checkout-error__image{color:inherit;display:block;margin:0 auto 1em;max-width:150px}.wc-block-checkout-error .wc-block-checkout-error__title{display:block;font-weight:700;margin:0}.wc-block-checkout-error .wc-block-checkout-error__description{display:block;margin:.25em 0 1em}.wc-block-checkout-empty{padding:40px;text-align:center;width:100%}.wc-block-checkout-empty .wc-block-checkout-empty__image{color:inherit;display:block;margin:0 auto 1em;max-width:150px}.wc-block-checkout-empty .wc-block-checkout-empty__title{display:block;font-weight:700;margin:0}.wc-block-checkout-empty .wc-block-checkout-empty__description{display:block;margin:.25em 0 1em}.wc-block-checkout__actions{align-items:center;display:flex;justify-content:space-between}.wc-block-checkout__actions .wc-block-components-checkout-place-order-button{height:auto;padding:1em;width:50%}.wc-block-checkout__actions .wc-block-components-checkout-place-order-button .wc-block-components-button__text{line-height:24px}.wc-block-checkout__actions .wc-block-components-checkout-place-order-button .wc-block-components-button__text>svg{fill:#fff;vertical-align:top}.is-mobile .wc-block-checkout__actions .wc-block-components-checkout-return-to-cart-button{display:none}.is-mobile .wc-block-checkout__actions .wc-block-components-checkout-place-order-button{width:100%}.is-large .wc-block-checkout__actions{padding:1.5em 0;position:relative}.is-large .wc-block-checkout__actions:after{border-style:solid;border-width:1px 0 0;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-checkout__form{margin:0;max-width:100%}.is-medium .wc-block-checkout__main,.is-mobile .wc-block-checkout__main,.is-small .wc-block-checkout__main{order:1}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form{margin-right:-6px;margin-left:-6px}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form:after,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form:after,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form:after,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form:after,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form:after,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form:after{clear:both;content:"";display:block}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input{float:right;margin-right:6px;margin-left:6px;position:relative;width:calc(50% - 12px)}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2){margin-top:0}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__company{width:calc(100% - 12px)}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-checkbox{clear:both}.components-placeholder.wc-block-checkout__no-shipping-placeholder{margin-bottom:16px}.components-placeholder.wc-block-checkout__no-shipping-placeholder *{pointer-events:all}.components-placeholder.wc-block-checkout__no-shipping-placeholder .components-placeholder__fieldset{display:block}.components-placeholder.wc-block-checkout__no-shipping-placeholder .components-placeholder__fieldset .components-button{background-color:#1e1e1e;color:#fff}.components-placeholder.wc-block-checkout__no-shipping-placeholder .components-placeholder__fieldset .wc-block-checkout__no-shipping-placeholder-description{display:block;margin:.25em 0 1em}.wc-block-checkout__shipping-option .wc-block-components-radio-control__option{margin:0;padding:.75em 2.5em .75em 0;position:relative}.wc-block-checkout__shipping-option .wc-block-components-radio-control__option:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-checkout__shipping-option .wc-block-components-shipping-rates-control__no-results-notice{margin:.75em 0}.wc-block-checkout__terms{margin:1.5em 0}.wc-block-checkout__terms textarea{position:relative;top:-5px}.wc-block-checkout__terms.wc-block-checkout__terms--disabled{opacity:.6}.wc-block-checkout__sidebar .wc-block-components-product-name{color:inherit;display:block;flex-basis:0;flex-grow:1}.wc-block-checkout__sidebar .wc-block-components-totals-footer-item{margin:0;padding:0}.is-medium .wc-block-checkout__sidebar,.is-mobile .wc-block-checkout__sidebar,.is-small .wc-block-checkout__sidebar{margin-bottom:24px;order:0}.wc-block-checkout__add-note{margin:1.5em 0}.is-medium .wc-block-checkout__add-note,.is-mobile .wc-block-checkout__add-note,.is-small .wc-block-checkout__add-note{margin-bottom:1em;margin-top:1em;padding:1em 0;position:relative}.is-medium .wc-block-checkout__add-note:after,.is-mobile .wc-block-checkout__add-note:after,.is-small .wc-block-checkout__add-note:after{border-style:solid;border-width:1px 0;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-checkout__add-note .wc-block-components-textarea{margin-top:16px}.wc-block-checkout__order-notes.wc-block-components-checkout-step{padding-right:0}.wp-block-woocommerce-checkout{margin:0}.wp-block-woocommerce-checkout .with-scroll-to-top__scroll-point{top:-96px}.wp-block-woocommerce-checkout.is-loading{display:flex;flex-wrap:wrap;margin:0 auto 16px;position:relative}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block{padding-right:2.2641509434%;width:35%}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block{padding-left:3.7735849057%;width:65%}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block{box-sizing:border-box;margin:0}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block>div,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block>div{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;display:none;line-height:1;margin:0 0 1.5em;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block>div>*,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block>div>*{visibility:hidden}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block>div:after,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block>div:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block>div,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block>div{-webkit-animation:none;animation:none}}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-contact-information-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-payment-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-contact-information-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-payment-block{display:block;min-height:10em}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-shipping-address-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-shipping-address-block{display:block;min-height:24em}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-actions-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-actions-block{display:block;margin-right:50%;min-height:4em;width:50%}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-order-summary-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-order-summary-block{display:block;min-height:47em}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wc-block-components-panel>h2,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel>h2{border:0;border-radius:0;color:inherit;font-family:inherit;font-size:1em;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-decoration:inherit;text-transform:inherit;vertical-align:baseline}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wc-block-components-panel>h2 .wc-block-components-panel__button,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel>h2 .wc-block-components-panel__button{font-weight:400}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wc-block-components-panel,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wc-block-components-totals-item,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-totals-item{padding-right:16px;padding-left:16px}@media only screen and (max-width:700px){.wp-block-woocommerce-checkout.is-loading{flex-direction:column;margin:0 auto 16px}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block{padding:0;width:100%}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-totals-item{padding-right:0;padding-left:0}}.theme-twentytwenty .wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel>h2{border:0;border-radius:0;font-size:1.25em;margin:0;padding:0;vertical-align:baseline}.wp-block-woocommerce-featured-category{background-color:transparent;border-color:transparent;box-sizing:border-box;color:#fff}.wc-block-featured-category{align-content:center;align-items:center;background-color:inherit;background-position:50%;background-size:cover;display:flex;flex-wrap:wrap;justify-content:center;margin:0;overflow:hidden;position:relative;width:100%}.wc-block-featured-category.has-background-dim .background-dim__overlay:before{background:inherit;border-radius:inherit;bottom:0;content:"";right:0;opacity:.5;position:absolute;left:0;top:0;z-index:1}.wc-block-featured-category.has-background-dim-10 .background-dim__overlay:before{opacity:.1}.wc-block-featured-category.has-background-dim-20 .background-dim__overlay:before{opacity:.2}.wc-block-featured-category.has-background-dim-30 .background-dim__overlay:before{opacity:.3}.wc-block-featured-category.has-background-dim-40 .background-dim__overlay:before{opacity:.4}.wc-block-featured-category.has-background-dim-50 .background-dim__overlay:before{opacity:.5}.wc-block-featured-category.has-background-dim-60 .background-dim__overlay:before{opacity:.6}.wc-block-featured-category.has-background-dim-70 .background-dim__overlay:before{opacity:.7}.wc-block-featured-category.has-background-dim-80 .background-dim__overlay:before{opacity:.8}.wc-block-featured-category.has-background-dim-90 .background-dim__overlay:before{opacity:.9}.wc-block-featured-category.has-background-dim-100 .background-dim__overlay:before{opacity:1}.wc-block-featured-category__selection{width:100%}.wc-block-featured-category.has-left-content{justify-content:flex-start}.wc-block-featured-category.has-left-content .wc-block-featured-category__description,.wc-block-featured-category.has-left-content .wc-block-featured-category__price,.wc-block-featured-category.has-left-content .wc-block-featured-category__title,.wc-block-featured-category.has-left-content .wc-block-featured-category__variation{margin-right:0;text-align:right}.wc-block-featured-category.has-right-content{justify-content:flex-end}.wc-block-featured-category.has-right-content .wc-block-featured-category__description,.wc-block-featured-category.has-right-content .wc-block-featured-category__price,.wc-block-featured-category.has-right-content .wc-block-featured-category__title,.wc-block-featured-category.has-right-content .wc-block-featured-category__variation{margin-left:0;text-align:left}.wc-block-featured-category.is-repeated{background-repeat:repeat;background-size:auto}.wc-block-featured-category__description,.wc-block-featured-category__price,.wc-block-featured-category__title,.wc-block-featured-category__variation{line-height:1.25;margin-bottom:0;text-align:center}.wc-block-featured-category__description a,.wc-block-featured-category__description a:active,.wc-block-featured-category__description a:focus,.wc-block-featured-category__description a:hover,.wc-block-featured-category__price a,.wc-block-featured-category__price a:active,.wc-block-featured-category__price a:focus,.wc-block-featured-category__price a:hover,.wc-block-featured-category__title a,.wc-block-featured-category__title a:active,.wc-block-featured-category__title a:focus,.wc-block-featured-category__title a:hover,.wc-block-featured-category__variation a,.wc-block-featured-category__variation a:active,.wc-block-featured-category__variation a:focus,.wc-block-featured-category__variation a:hover{color:#fff}.wc-block-featured-category__description,.wc-block-featured-category__link,.wc-block-featured-category__price,.wc-block-featured-category__title,.wc-block-featured-category__variation{color:inherit;padding:0 48px 16px;width:100%;z-index:1}.wc-block-featured-category .wc-block-featured-category__background-image{bottom:0;height:100%;right:0;margin:0;-o-object-fit:none;object-fit:none;padding:0;position:absolute;left:0;top:0;width:100%}.wc-block-featured-category .wc-block-featured-category__background-image.has-parallax{background-attachment:fixed}@supports(-webkit-overflow-scrolling:touch){.wc-block-featured-category .wc-block-featured-category__background-image.has-parallax{background-attachment:scroll}}@media(prefers-reduced-motion:reduce){.wc-block-featured-category .wc-block-featured-category__background-image.has-parallax{background-attachment:scroll}}.wc-block-featured-category__description{color:inherit}.wc-block-featured-category__description p{margin:0}.wc-block-featured-category .wc-block-featured-category__title{color:inherit;margin-top:0}.wc-block-featured-category .wc-block-featured-category__title div{color:inherit}.wc-block-featured-category .wc-block-featured-category__title:before{display:none}.wc-block-featured-category__wrapper{align-content:center;align-items:center;box-sizing:border-box;display:flex;flex-wrap:wrap;height:100%;justify-content:center;overflow:hidden;width:100%}.wc-block-featured-category .wp-block-button.aligncenter{text-align:center}.wp-block-woocommerce-featured-product{background-color:transparent;border-color:transparent;box-sizing:border-box;color:#fff}.wc-block-featured-product{align-content:center;align-items:center;background-color:inherit;background-position:50%;background-size:cover;display:flex;flex-wrap:wrap;justify-content:center;margin:0;overflow:hidden;position:relative;width:100%}.wc-block-featured-product.has-background-dim .background-dim__overlay:before{background:inherit;border-radius:inherit;bottom:0;content:"";right:0;opacity:.5;position:absolute;left:0;top:0;z-index:1}.wc-block-featured-product.has-background-dim-10 .background-dim__overlay:before{opacity:.1}.wc-block-featured-product.has-background-dim-20 .background-dim__overlay:before{opacity:.2}.wc-block-featured-product.has-background-dim-30 .background-dim__overlay:before{opacity:.3}.wc-block-featured-product.has-background-dim-40 .background-dim__overlay:before{opacity:.4}.wc-block-featured-product.has-background-dim-50 .background-dim__overlay:before{opacity:.5}.wc-block-featured-product.has-background-dim-60 .background-dim__overlay:before{opacity:.6}.wc-block-featured-product.has-background-dim-70 .background-dim__overlay:before{opacity:.7}.wc-block-featured-product.has-background-dim-80 .background-dim__overlay:before{opacity:.8}.wc-block-featured-product.has-background-dim-90 .background-dim__overlay:before{opacity:.9}.wc-block-featured-product.has-background-dim-100 .background-dim__overlay:before{opacity:1}.wc-block-featured-product__selection{width:100%}.wc-block-featured-product.has-left-content{justify-content:flex-start}.wc-block-featured-product.has-left-content .wc-block-featured-product__description,.wc-block-featured-product.has-left-content .wc-block-featured-product__price,.wc-block-featured-product.has-left-content .wc-block-featured-product__title,.wc-block-featured-product.has-left-content .wc-block-featured-product__variation{margin-right:0;text-align:right}.wc-block-featured-product.has-right-content{justify-content:flex-end}.wc-block-featured-product.has-right-content .wc-block-featured-product__description,.wc-block-featured-product.has-right-content .wc-block-featured-product__price,.wc-block-featured-product.has-right-content .wc-block-featured-product__title,.wc-block-featured-product.has-right-content .wc-block-featured-product__variation{margin-left:0;text-align:left}.wc-block-featured-product.is-repeated{background-repeat:repeat;background-size:auto}.wc-block-featured-product__description,.wc-block-featured-product__price,.wc-block-featured-product__title,.wc-block-featured-product__variation{line-height:1.25;margin-bottom:0;text-align:center}.wc-block-featured-product__description a,.wc-block-featured-product__description a:active,.wc-block-featured-product__description a:focus,.wc-block-featured-product__description a:hover,.wc-block-featured-product__price a,.wc-block-featured-product__price a:active,.wc-block-featured-product__price a:focus,.wc-block-featured-product__price a:hover,.wc-block-featured-product__title a,.wc-block-featured-product__title a:active,.wc-block-featured-product__title a:focus,.wc-block-featured-product__title a:hover,.wc-block-featured-product__variation a,.wc-block-featured-product__variation a:active,.wc-block-featured-product__variation a:focus,.wc-block-featured-product__variation a:hover{color:#fff}.wc-block-featured-product__description,.wc-block-featured-product__link,.wc-block-featured-product__price,.wc-block-featured-product__title,.wc-block-featured-product__variation{color:inherit;padding:0 48px 16px;width:100%;z-index:1}.wc-block-featured-product .wc-block-featured-product__background-image{bottom:0;height:100%;right:0;margin:0;-o-object-fit:none;object-fit:none;padding:0;position:absolute;left:0;top:0;width:100%}.wc-block-featured-product .wc-block-featured-product__background-image.has-parallax{background-attachment:fixed}@supports(-webkit-overflow-scrolling:touch){.wc-block-featured-product .wc-block-featured-product__background-image.has-parallax{background-attachment:scroll}}@media(prefers-reduced-motion:reduce){.wc-block-featured-product .wc-block-featured-product__background-image.has-parallax{background-attachment:scroll}}.wc-block-featured-product__description{color:inherit}.wc-block-featured-product__description p{margin:0}.wc-block-featured-product .wc-block-featured-product__title{color:inherit;margin-top:0}.wc-block-featured-product .wc-block-featured-product__title div{color:inherit}.wc-block-featured-product .wc-block-featured-product__title:before{display:none}.wc-block-featured-product__wrapper{align-content:center;align-items:center;box-sizing:border-box;display:flex;flex-wrap:wrap;height:100%;justify-content:center;overflow:hidden;width:100%}.wc-block-featured-product .wp-block-button.aligncenter{text-align:center}.wc-block-featured-product .wc-block-featured-product__title,.wc-block-featured-product .wc-block-featured-product__variation{border:0;margin-top:0}.wc-block-featured-product .wc-block-featured-product__title:before,.wc-block-featured-product .wc-block-featured-product__variation:before{display:none}.wc-block-featured-product .wc-block-featured-product__variation{font-style:italic;padding-top:0}.wc-block-featured-product .wc-block-featured-product__description p{line-height:1.5;margin:0}.wc-block-mini-cart__badge,.wc-block-mini-cart__quantity-badge{align-items:center;display:flex}.wc-block-mini-cart__badge{background:transparent;border:.15em solid;border-radius:1em;box-sizing:border-box;color:inherit;font-size:.875em;font-weight:600;height:1.4285714286em;justify-content:center;margin-right:-.7142857143em;min-width:1.4285714286em;padding:0 .25em;transform:translateY(-50%);white-space:nowrap;z-index:1}.wc-block-mini-cart__icon{display:block;height:1.5em;width:1.5em}html[dir=rtl] .wc-block-mini-cart__icon{transform:scaleX(-1)}.wc-block-cart .wc-block-components-shipping-calculator{white-space:nowrap}.wc-block-cart .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.wc-block-cart .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.wc-block-cart .wc-block-components-address-form .wc-block-components-text-input:first-of-type{margin-top:0}table.wc-block-cart-items,table.wc-block-cart-items td,table.wc-block-cart-items th{background:none!important;border:0;margin:0}.editor-styles-wrapper table.wc-block-cart-items,table.wc-block-cart-items{width:100%}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__header,table.wc-block-cart-items .wc-block-cart-items__header{font-size:.75em;text-transform:uppercase}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-image,table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-image{width:100px}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-product,table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-product{visibility:hidden}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-total,table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-total{text-align:left;width:100px}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image img,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image img{margin:0;width:100%}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link{background:transparent;border:0;border-radius:0;box-shadow:none;color:inherit;display:inline;font-family:inherit;font-size:inherit;font-size:.75em;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-decoration:inherit;text-decoration:underline;text-shadow:none;text-transform:inherit;text-transform:none;vertical-align:baseline;white-space:nowrap}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:active,.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:focus,.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:hover,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:active,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:focus,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:hover{background:transparent}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-name,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-name{display:block;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total{font-size:1em;line-height:inherit;text-align:left}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-metadata,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-metadata{margin-bottom:.75em}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row.is-disabled,table.wc-block-cart-items .wc-block-cart-items__row.is-disabled{opacity:.5;pointer-events:none;transition:opacity .2s ease}.wc-block-cart .wc-block-components-totals-footer-item,.wc-block-cart .wc-block-components-totals-taxes{margin:0}.wc-block-cart--is-loading h2 span,.wc-block-cart--is-loading th span,.wc-block-mini-cart__drawer.is-loading h2 span,.wc-block-mini-cart__drawer.is-loading th span{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;display:inline-block;line-height:1;max-width:100%!important;min-width:84px;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-cart--is-loading h2 span>*,.wc-block-cart--is-loading th span>*,.wc-block-mini-cart__drawer.is-loading h2 span>*,.wc-block-mini-cart__drawer.is-loading th span>*{visibility:hidden}.wc-block-cart--is-loading h2 span:after,.wc-block-cart--is-loading th span:after,.wc-block-mini-cart__drawer.is-loading h2 span:after,.wc-block-mini-cart__drawer.is-loading th span:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading h2 span,.wc-block-cart--is-loading th span,.wc-block-mini-cart__drawer.is-loading h2 span,.wc-block-mini-cart__drawer.is-loading th span{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading h2 span:before,.wc-block-cart--is-loading th span:before,.wc-block-mini-cart__drawer.is-loading h2 span:before,.wc-block-mini-cart__drawer.is-loading th span:before{content:" "}.wc-block-cart--is-loading h2 span,.wc-block-mini-cart__drawer.is-loading h2 span{min-width:33%}.wc-block-cart--is-loading .wc-block-components-product-metadata,.wc-block-cart--is-loading .wc-block-components-product-price,.wc-block-cart--is-loading .wc-block-components-quantity-selector,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price,.wc-block-mini-cart__drawer.is-loading .wc-block-components-quantity-selector{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-cart--is-loading .wc-block-components-product-metadata>*,.wc-block-cart--is-loading .wc-block-components-product-price>*,.wc-block-cart--is-loading .wc-block-components-quantity-selector>*,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata>*,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price>*,.wc-block-mini-cart__drawer.is-loading .wc-block-components-quantity-selector>*{visibility:hidden}.wc-block-cart--is-loading .wc-block-components-product-metadata:after,.wc-block-cart--is-loading .wc-block-components-product-price:after,.wc-block-cart--is-loading .wc-block-components-quantity-selector:after,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata:after,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price:after,.wc-block-mini-cart__drawer.is-loading .wc-block-components-quantity-selector:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading .wc-block-components-product-metadata,.wc-block-cart--is-loading .wc-block-components-product-price,.wc-block-cart--is-loading .wc-block-components-quantity-selector,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price,.wc-block-mini-cart__drawer.is-loading .wc-block-components-quantity-selector{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading .wc-block-components-product-name,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;display:inline-block;line-height:1;max-width:100%!important;min-width:84px;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-cart--is-loading .wc-block-components-product-name>*,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name>*{visibility:hidden}.wc-block-cart--is-loading .wc-block-components-product-name:after,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading .wc-block-components-product-name,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading .wc-block-components-product-name:before,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name:before{content:" "}.wc-block-cart--is-loading .wc-block-components-product-metadata,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata{margin-top:.25em;min-width:8em}.wc-block-cart--is-loading .wc-block-cart-item__remove-link,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__remove-link{visibility:hidden}.wc-block-cart--is-loading .wc-block-cart-item__image>a,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__image>a{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-cart--is-loading .wc-block-cart-item__image>a>*,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__image>a>*{visibility:hidden}.wc-block-cart--is-loading .wc-block-cart-item__image>a:after,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__image>a:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading .wc-block-cart-item__image>a,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__image>a{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading .wc-block-components-product-price,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price{display:block;margin-top:.25em;max-width:3em}.wc-block-cart--is-loading .wc-block-components-product-price:before,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price:before{content:" "}.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;min-height:460px;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card>*,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card>*{visibility:hidden}.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card:after,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card:before,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card:before{content:" "}.wc-block-components-sidebar-layout.wc-block-cart--skeleton{display:none}.is-loading+.wc-block-components-sidebar-layout.wc-block-cart--skeleton{display:flex}.wc-block-cart-item__total-price-and-sale-badge-wrapper{align-items:flex-end;display:flex;flex-direction:column}.wc-block-cart-item__total-price-and-sale-badge-wrapper .wc-block-components-sale-badge{margin-top:4px}.is-medium.wc-block-cart .wc-block-components-sidebar .wc-block-cart__totals-title,.is-mobile .wc-block-cart-item__total .wc-block-components-sale-badge,.is-mobile.wc-block-cart .wc-block-components-sidebar .wc-block-cart__totals-title,.is-small .wc-block-cart-item__total .wc-block-components-sale-badge,.is-small.wc-block-cart .wc-block-components-sidebar .wc-block-cart__totals-title{display:none}.is-medium table.wc-block-cart-items td,.is-mobile table.wc-block-cart-items td,.is-small table.wc-block-cart-items td{padding:0}.is-medium table.wc-block-cart-items .wc-block-cart-item__remove-link,.is-medium table.wc-block-cart-items .wc-block-cart-items__header,.is-mobile table.wc-block-cart-items .wc-block-cart-item__remove-link,.is-mobile table.wc-block-cart-items .wc-block-cart-items__header,.is-small table.wc-block-cart-items .wc-block-cart-item__remove-link,.is-small table.wc-block-cart-items .wc-block-cart-items__header{display:none}.is-medium table.wc-block-cart-items:not(.wc-block-mini-cart-items) .wc-block-cart-items__row,.is-mobile table.wc-block-cart-items:not(.wc-block-mini-cart-items) .wc-block-cart-items__row,.is-small table.wc-block-cart-items:not(.wc-block-mini-cart-items) .wc-block-cart-items__row{position:relative}.is-medium table.wc-block-cart-items:not(.wc-block-mini-cart-items) .wc-block-cart-items__row:after,.is-mobile table.wc-block-cart-items:not(.wc-block-mini-cart-items) .wc-block-cart-items__row:after,.is-small table.wc-block-cart-items:not(.wc-block-mini-cart-items) .wc-block-cart-items__row:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.is-medium table.wc-block-cart-items .wc-block-cart-items__row,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row,.is-small table.wc-block-cart-items .wc-block-cart-items__row{-ms-grid-columns:80px 132px;display:-ms-grid;display:grid;grid-template-columns:80px 132px;padding:16px 0}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image{-ms-grid-column:1;grid-column-start:1;-ms-grid-row:1;grid-row-start:1;padding-left:16px}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product{-ms-grid-column-span:2;-ms-grid-column-align:stretch;-ms-grid-column:2;grid-column-end:4;grid-column-start:2;-ms-grid-row:1;grid-row-start:1;justify-self:stretch;padding:0 0 16px 16px}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity{-ms-grid-row-align:end;align-self:end;-ms-grid-column:1;grid-column-start:1;-ms-grid-row:2;grid-row-start:2;padding-left:16px;padding-top:16px;vertical-align:bottom}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total{-ms-grid-row:1;grid-row-start:1}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total .wc-block-components-formatted-money-amount,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total .wc-block-components-formatted-money-amount,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total .wc-block-components-formatted-money-amount{display:inline-block}.is-large.wc-block-cart{margin-bottom:3em}.is-large.wc-block-cart .wc-block-cart-items{position:relative}.is-large.wc-block-cart .wc-block-cart-items:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.is-large.wc-block-cart .wc-block-cart-items th{padding:.25rem 0 .25rem 16px;white-space:nowrap}.is-large.wc-block-cart .wc-block-cart-items td{padding:16px 16px 16px 0;position:relative;vertical-align:top}.is-large.wc-block-cart .wc-block-cart-items td:after{border-style:solid;border-width:1px 0 0;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.is-large.wc-block-cart .wc-block-cart-items th:last-child{padding-left:0}.is-large.wc-block-cart .wc-block-cart-items td:last-child{padding-left:16px}.is-large.wc-block-cart .wc-block-components-radio-control__input{right:0}.is-large.wc-block-cart .wc-block-cart__totals-title{background:transparent;border:0;border-radius:0;box-shadow:none;color:inherit;display:inline;display:block;font-family:inherit;font-size:inherit;font-size:.75em;font-style:inherit;font-weight:inherit;font-weight:600;letter-spacing:inherit;line-height:inherit;margin:0;padding:.25rem 0;text-align:left;text-decoration:inherit;text-transform:inherit;text-transform:uppercase;vertical-align:baseline}.is-large.wc-block-cart .wc-block-components-sidebar .wc-block-components-shipping-calculator,.is-large.wc-block-cart .wc-block-components-sidebar .wc-block-components-shipping-rates-control__package:not(.wc-block-components-panel){padding-right:16px;padding-left:16px}.is-large.wc-block-cart .wc-block-cart__payment-options{padding:16px 0 0}.is-large.wc-block-cart .wc-block-cart__payment-options:empty{padding:0}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-empty-cart-block{display:none}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-filled-cart-block{display:flex;flex-wrap:wrap;margin:0 auto 16px;position:relative}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-items-block{box-sizing:border-box;margin:0;min-height:10em;padding-left:3.7735849057%;width:65%}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-line-items-block{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;min-height:15em;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-line-items-block>*{visibility:hidden}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-line-items-block:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-line-items-block{-webkit-animation:none;animation:none}}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-totals-block{box-sizing:border-box;margin:0;min-height:12em;padding-right:2.2641509434%;width:35%}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-accepted-payment-methods-block,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-express-payment-block,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-order-summary-block,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-proceed-to-checkout-block{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;margin:0 0 1em;max-width:100%!important;min-height:3em;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-accepted-payment-methods-block>*,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-express-payment-block>*,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-order-summary-block>*,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-proceed-to-checkout-block>*{visibility:hidden}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-accepted-payment-methods-block:after,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-express-payment-block:after,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-order-summary-block:after,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-proceed-to-checkout-block:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-accepted-payment-methods-block,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-express-payment-block,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-order-summary-block,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-proceed-to-checkout-block{-webkit-animation:none;animation:none}}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-order-summary-block{height:20em}@media only screen and (max-width:700px){.wp-block-woocommerce-cart.is-loading{padding-top:16px}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-filled-cart-block{flex-direction:column;margin:0 auto 16px}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-items-block,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-totals-block{padding:0;width:100%}}.wc-block-mini-cart{display:inline-block}.wc-block-mini-cart__button{align-items:center;background-color:transparent;border:none;color:inherit;display:flex;font-family:inherit;font-size:inherit;font-weight:400;padding:.75em .5em}.wc-block-mini-cart__button:hover:not([disabled]){opacity:.6}.wc-block-mini-cart__amount{display:none}.wc-block-mini-cart__tax-label{margin-left:.5em}@media screen and (min-width:768px){.wc-block-mini-cart__amount{display:initial;font-weight:600;margin-left:8px}}.modal-open .wc-block-mini-cart__button{pointer-events:none}.wc-block-mini-cart__drawer{font-size:1rem}.wc-block-mini-cart__drawer .components-modal__content{padding:0;position:relative}.wc-block-mini-cart__drawer .components-modal__header{position:absolute;left:16px;top:40px}.wc-block-mini-cart__drawer .components-modal__header button{color:inherit;z-index:9999}.wc-block-mini-cart__drawer .components-modal__header svg{fill:currentColor}.wp-block-woocommerce-mini-cart-contents{background:#fff;box-sizing:border-box;height:100vh;justify-content:center;padding:0}.wp-block-woocommerce-empty-mini-cart-contents-block,.wp-block-woocommerce-filled-mini-cart-contents-block{display:flex;flex-direction:column;height:100%}.wp-block-woocommerce-empty-mini-cart-contents-block{justify-content:center}.wp-block-woocommerce-filled-mini-cart-contents-block{justify-content:space-between}.wp-block-woocommerce-empty-mini-cart-contents-block .wc-block-mini-cart__empty-cart-wrapper{overflow-y:auto;padding:40px 16px 16px}h2.wc-block-mini-cart__title{font-size:2em;margin:40px 16px 0}.wc-block-mini-cart__items{display:flex;flex-direction:column;flex-grow:1;overflow-y:auto;padding:16px 16px 0}.wc-block-mini-cart__items .wc-block-mini-cart__products-table{margin-bottom:auto;margin-left:-16px;padding-left:16px}.wc-block-mini-cart__items .wc-block-mini-cart__products-table .wc-block-cart-items__row{padding-bottom:8px;padding-top:8px}.wc-block-mini-cart__items .wc-block-mini-cart__products-table .wc-block-cart-items__row:last-child:after{content:none}.wc-block-mini-cart__footer{border-top:1px solid #ddd;padding:24px 16px}.wc-block-mini-cart__footer .wc-block-components-totals-item.wc-block-mini-cart__footer-subtotal{font-weight:600;margin-bottom:16px}.wc-block-mini-cart__footer .wc-block-components-totals-item.wc-block-mini-cart__footer-subtotal .wc-block-components-totals-item__description{display:none;font-size:.75em;font-weight:400}@media only screen and (min-width:480px){.wc-block-mini-cart__footer .wc-block-components-totals-item.wc-block-mini-cart__footer-subtotal .wc-block-components-totals-item__description{display:unset}}.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions{display:flex;gap:16px}.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-components-button{flex-grow:1;font-weight:600}.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-components-button.outlined{color:currentColor;display:none}.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-components-button.outlined:not(:focus){box-shadow:inset 0 0 0 1px currentColor}.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-components-button.outlined:focus,.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-components-button.outlined:hover{color:#fff}@media only screen and (min-width:480px){.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-components-button.outlined{display:inline-flex}}.wc-block-mini-cart__footer .wc-block-components-payment-method-icons{margin-top:16px}.wc-block-mini-cart__shopping-button{display:flex;justify-content:center}.wc-block-mini-cart__shopping-button a{border:2px solid;color:currentColor;font-weight:600;padding:12px 24px;text-decoration:none}.wc-block-mini-cart__shopping-button a:focus,.wc-block-mini-cart__shopping-button a:hover{background-color:#1e1e1e;border-color:#1e1e1e;color:#fff}.wc-block-components-checkbox{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin-top:1.5em;text-decoration:inherit;text-transform:inherit}.wc-block-components-checkbox label{align-items:flex-start;display:flex;position:relative}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:2px solid #50575e;border-radius:2px;box-sizing:border-box;font-size:1em;height:1.5em;margin:0 0 0 16px;min-height:1.5em;min-width:1.5em;overflow:hidden;position:static;vertical-align:middle;width:1.5em}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:checked{background:#fff;border-color:#50575e}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus{outline:2px solid #50575e;outline-offset:2px}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:after,.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:before{content:""}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:not(:checked)+.wc-block-components-checkbox__mark{display:none}.has-dark-controls .wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]{background-color:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.6)}.has-dark-controls .wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:checked{background:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.6)}.has-dark-controls .wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus{outline:2px solid hsla(0,0%,100%,.6);outline-offset:2px}.wc-block-components-checkbox.has-error,.wc-block-components-checkbox.has-error a{color:#cc1818}.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input,.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input:active,.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input:focus,.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input:hover{border-color:#cc1818}.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input:focus{outline:2px solid #cc1818;outline-offset:2px}.wc-block-components-checkbox .wc-block-components-checkbox__mark{fill:#000;height:1.125em;margin-right:.1875em;margin-top:.0625em;pointer-events:none;position:absolute;width:1.125em}.has-dark-controls .wc-block-components-checkbox .wc-block-components-checkbox__mark{fill:#fff}.wc-block-components-checkbox .wc-block-components-checkbox__label,.wc-block-components-checkbox>span{line-height:1.5em;vertical-align:middle}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.wc-block-components-checkbox__mark{display:none}}.theme-twentytwentyone .has-dark-controls .wc-block-components-checkbox__input[type=checkbox],.theme-twentytwentyone .wc-block-components-checkbox__input[type=checkbox]{background-color:#fff;border-color:var(--form--border-color);position:relative}.theme-twentytwentyone .has-dark-controls .wc-block-components-checkbox__input[type=checkbox]:checked,.theme-twentytwentyone .wc-block-components-checkbox__input[type=checkbox]:checked{background-color:#fff;border-color:var(--form--border-color)}.theme-twentytwentyone .wc-block-components-checkbox__mark{display:none}.wc-block-components-panel.has-border{position:relative}.wc-block-components-panel.has-border:after{border-style:solid;border-width:1px 0;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-components-panel.has-border+.wc-block-components-panel.has-border:after{border-top-width:0}.wc-block-components-panel.has-border.no-top-border{position:relative}.wc-block-components-panel.has-border.no-top-border:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-components-panel__button{border:0;border-radius:0;height:auto;line-height:1;margin:.375em 0 0;padding:.375em 0 0 32px;position:relative;text-align:right;vertical-align:baseline;width:100%;word-break:break-word}.wc-block-components-panel__button[aria-expanded=true]{margin-bottom:.375em;padding-bottom:.375em}.wc-block-components-panel__button,.wc-block-components-panel__button:active,.wc-block-components-panel__button:focus,.wc-block-components-panel__button:hover{background:transparent;box-shadow:none;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit}.wc-block-components-panel__button>.wc-block-components-panel__button-icon{fill:currentColor;position:absolute;left:0;top:50%;transform:translateY(-50%);width:auto}.wc-block-components-panel__content[hidden]{display:none}.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-panel__button{background-color:inherit;color:inherit}.theme-twentyseventeen .wc-block-components-panel__button,.theme-twentytwenty .wc-block-components-panel__button{background:none transparent;color:inherit}.theme-twentyseventeen .wc-block-components-panel__button.wc-block-components-panel__button:focus,.theme-twentyseventeen .wc-block-components-panel__button.wc-block-components-panel__button:hover,.theme-twentytwenty .wc-block-components-panel__button.wc-block-components-panel__button:focus,.theme-twentytwenty .wc-block-components-panel__button.wc-block-components-panel__button:hover{background:none transparent}.wc-block-components-totals-wrapper{padding:16px 0;position:relative}.wc-block-components-totals-wrapper:after{border-style:solid;border-width:1px 0 0;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-components-totals-wrapper.has-bottom-border:after{border-bottom-width:1px}.wc-block-components-totals-wrapper:empty{padding:0}.wc-block-components-totals-wrapper:empty:after{content:none}.wc-block-components-totals-wrapper.slot-wrapper{padding:0}.wc-block-components-totals-wrapper.slot-wrapper>*>*{padding:16px 0;position:relative}.wc-block-components-totals-wrapper.slot-wrapper>*>:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-components-totals-wrapper.slot-wrapper>*>:last-child:after{border-bottom-width:0}.wc-block-components-discounts-meta .wc-block-components-totals-wrapper:first-child{position:relative}.wc-block-components-discounts-meta .wc-block-components-totals-wrapper:first-child:after{border-style:solid;border-width:1px 0 0;bottom:0;content:"";display:block;right:0;opacity:.3;pointer-events:none;position:absolute;left:0;top:0}.wc-block-components-totals-item{box-sizing:border-box;display:flex;flex-wrap:wrap;width:100%}.wc-block-components-totals-item__label{flex-grow:1}.wc-block-components-totals-item__value{font-weight:700;white-space:nowrap}.wc-block-components-totals-item__description{font-size:.875em;width:100%}.wc-block-product-categories{margin-bottom:1em}.wc-block-product-categories.is-dropdown{display:flex}.wc-block-product-categories select{margin-left:.5em}.wc-block-product-categories-list--has-images{list-style:none outside}.wc-block-product-categories-list--has-images .wc-block-product-categories-list-item{clear:both;list-style:none outside;margin:4px 60px 4px 0}.wc-block-product-categories-list--has-images .wc-block-product-categories-list-item ul{margin:4px 0 0}.wc-block-product-categories-list--has-images .wc-block-product-categories-list-item__image{border:1px solid #eee;display:inline-block;margin:0 -60px 0 .5em;max-width:50px;padding:0;position:relative;vertical-align:middle}.wc-block-product-categories-list--has-images .wc-block-product-categories-list-item__image img{display:block;height:auto;margin:0;max-width:100%;padding:0}.wc-block-product-categories-list-item-count:before{content:" ("}.wc-block-product-categories-list-item-count:after{content:")"}.wp-block-woocommerce-product-categories.is-loading .wc-block-product-categories__placeholder{background:currentColor;display:inline-block;height:1em;min-width:200px;opacity:.2;width:50%}.wc-block-product-categories__button{align-items:center;display:flex;margin:0;overflow:hidden;padding:0 .5em;position:relative}.wc-block-product-categories__button svg{fill:currentColor;outline:none}.rtl .wc-block-product-categories__button svg{transform:rotate(-180deg)}.wc-block-product-categories__button:active{color:currentColor}.wc-block-product-categories__button:disabled,.wc-block-product-categories__button[aria-disabled=true]{cursor:default;opacity:.3}.wc-block-product-categories__button:disabled:focus,.wc-block-product-categories__button[aria-disabled=true]:focus{box-shadow:none}.wc-block-product-search .wc-block-product-search__fields{display:flex}.wc-block-product-search .wc-block-product-search__field{flex-grow:1;line-height:1.8;padding:6px 8px}.wc-block-product-search .wc-block-product-search__button{align-items:center;cursor:pointer;display:flex;margin:0 6px 0 0;overflow:hidden;padding:0 .5em;position:relative}.wc-block-product-search .wc-block-product-search__button svg{fill:currentColor;outline:none}.rtl .wc-block-product-search .wc-block-product-search__button svg{transform:rotate(-180deg)}.wc-block-product-search .wc-block-product-search__button:active{color:currentColor}.wc-block-product-search .wc-block-product-search__button:disabled,.wc-block-product-search .wc-block-product-search__button[aria-disabled=true]{cursor:default;opacity:.3}.wc-block-product-search .wc-block-product-search__button:disabled:focus,.wc-block-product-search .wc-block-product-search__button[aria-disabled=true]:focus{box-shadow:none}.wp-block-woocommerce-price-filter{border-color:#757575;border-radius:4px;border-style:none!important}.wc-block-price-filter,.wc-block-price-filter__controls,.wc-block-price-slider{border-color:inherit;border-radius:inherit}.wc-block-price-filter__controls input{border-color:inherit!important;border-radius:inherit!important;border-style:solid}.wp-block-woocommerce-attribute-filter{border-style:none!important}.wc-block-attribute-filter{border-color:inherit;border-radius:inherit;margin-bottom:24px}.wc-block-attribute-filter.style-dropdown{align-items:flex-start;border-color:inherit;border-radius:inherit;display:flex;gap:16px}.wc-block-attribute-filter.style-dropdown .wc-block-components-filter-submit-button{height:36px;line-height:1}.wc-block-attribute-filter .wc-block-attribute-filter-list{margin:0;width:100%}.wc-block-attribute-filter .wc-block-attribute-filter-list li label{cursor:pointer}.wc-block-attribute-filter .wc-block-attribute-filter-list li input{cursor:pointer;display:inline-block}.wc-block-attribute-filter .wc-blocks-components-form-token-field-wrapper{flex-grow:1;max-width:unset;width:0}.wc-block-attribute-filter .is-single .wc-block-attribute-filter-list-count,.wc-block-attribute-filter .wc-blocks-components-form-token-field-wrapper .wc-block-attribute-filter-list-count{opacity:.6}.wc-block-stock-filter{margin-bottom:24px}.wc-block-stock-filter .wc-block-stock-filter-list{margin:0}.wc-block-stock-filter .wc-block-stock-filter-list li label{cursor:pointer}.wc-block-stock-filter .wc-block-stock-filter-list li input{cursor:pointer;display:inline-block}.wc-block-stock-filter .is-single,.wc-block-stock-filter .wc-block-dropdown-selector .wc-block-dropdown-selector__list{opacity:.6}.wc-block-stock-filter .wc-block-stock-filter__button{margin-top:8px}.wc-block-active-filters{margin-bottom:24px;overflow:hidden}.wc-block-active-filters .wc-block-active-filters__clear-all{border:none;cursor:pointer;float:left;font-size:1em;padding:0;text-decoration:underline}.wc-block-active-filters .wc-block-active-filters__clear-all,.wc-block-active-filters .wc-block-active-filters__clear-all:active,.wc-block-active-filters .wc-block-active-filters__clear-all:focus,.wc-block-active-filters .wc-block-active-filters__clear-all:hover{background:transparent;color:inherit}.wc-block-active-filters .wc-block-active-filters__list{clear:both;list-style:none outside;margin:0 0 4px;padding:0}.wc-block-active-filters .wc-block-active-filters__list li{clear:both;list-style:none outside;margin:0;padding:0}.wc-block-active-filters .wc-block-active-filters__list li ul{list-style:none outside;margin:0;padding:0}.wc-block-active-filters .wc-block-active-filters__list li:first-child .wc-block-active-filters__list-item-type{margin:0}.wc-block-active-filters .wc-block-active-filters__list-item-type{display:block;font-size:.75em;letter-spacing:.1em;margin:16px 0 0;text-transform:uppercase}.wc-block-active-filters .wc-block-active-filters__list-item-operator{font-style:italic;font-weight:400}.wc-block-active-filters .wc-block-active-filters__list-item-name{display:block;font-weight:700;padding:0 0 0 16px;position:relative}.wc-block-active-filters .wc-block-active-filters__list-item-remove{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:currentColor;height:16px;margin:-8px 0 0;padding:0;position:absolute;left:0;top:50%;width:16px}.wc-block-active-filters .wc-block-active-filters__list--chips li,.wc-block-active-filters .wc-block-active-filters__list--chips ul{display:inline}.wc-block-active-filters .wc-block-active-filters__list--chips .wc-block-active-filters__list-item-type{display:none}.wc-block-active-filters .wc-block-active-filters__list--chips .wc-block-components-chip{font-size:.875em;margin-bottom:.1875em;margin-top:.1875em}@-webkit-keyframes spinner__animation{0%{-webkit-animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(-1turn)}}@keyframes spinner__animation{0%{-webkit-animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(-1turn)}}@-webkit-keyframes loading__animation{to{transform:translateX(-100%)}}@keyframes loading__animation{to{transform:translateX(-100%)}}:where(div[data-block-name="woocommerce/legacy-template"]){margin-right:auto;margin-left:auto;max-width:1000px} \ No newline at end of file diff --git a/build/wc-blocks-style.css b/build/wc-blocks-style.css new file mode 100644 index 00000000000..ede57b2b616 --- /dev/null +++ b/build/wc-blocks-style.css @@ -0,0 +1 @@ +.wc-block-link-button{border:0;border-radius:0;box-shadow:none;color:inherit;display:inline;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-decoration:inherit;text-decoration:underline;text-shadow:none;text-transform:inherit;vertical-align:baseline}.wc-block-link-button,.wc-block-link-button:active,.wc-block-link-button:focus,.wc-block-link-button:hover{background:transparent}.wc-block-suspense-placeholder{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-suspense-placeholder>*{visibility:hidden}.wc-block-suspense-placeholder:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.wc-block-suspense-placeholder{-webkit-animation:none;animation:none}}.wc-block-suspense-placeholder:before{content:" "}.wc-block-grid__products .wc-block-grid__product-image{display:block;position:relative;text-decoration:none}.wc-block-grid__products .wc-block-grid__product-image a{border:0;box-shadow:none;outline:0;text-decoration:none}.wc-block-grid__products .wc-block-grid__product-image img{height:auto;max-width:100%;width:auto}.wc-block-grid__products .wc-block-grid__product-image img[hidden]{display:none}.wc-block-grid__products .wc-block-grid__product-image img[alt=""]{border:1px solid #f2f2f2}.edit-post-visual-editor .editor-block-list__block .wc-block-grid__product-title,.editor-styles-wrapper .wc-block-grid__product-title,.wc-block-grid__product-title{color:inherit;display:block;font-family:inherit;font-size:inherit;font-weight:700;line-height:1.2;padding:0}.wc-block-grid__product-price{display:block}.wc-block-grid__product-price .wc-block-grid__product-price__regular{margin-right:.5em}.wc-block-grid__product-add-to-cart.wp-block-button{white-space:normal;word-break:break-word}.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link{display:inline-flex;font-size:1em;justify-content:center;margin:0 auto!important;padding:.5em 1em;text-align:center;white-space:normal;word-break:break-word}.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link.loading{opacity:.25}.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link.added:after{content:"";display:inline-block;font-family:WooCommerce;height:auto;margin-left:.5em;width:auto}.wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link.loading:after{-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite;content:"";display:inline-block;font-family:WooCommerce;height:auto;margin-left:.5em;width:auto}.has-5-columns:not(.alignfull) .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after,.has-6-columns .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after,.has-7-columns .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after,.has-8-columns .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after,.has-9-columns .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:after{content:"";margin:0}.wc-block-grid__product-rating{color:#000;display:block}.wc-block-grid__product-rating .star-rating,.wc-block-grid__product-rating .wc-block-grid__product-rating__stars{font-family:star;font-size:1em;font-weight:400;height:1.618em;line-height:1.618;margin:0 auto;overflow:hidden;position:relative;text-align:left;width:5.3em}.wc-block-grid__product-rating .star-rating:before,.wc-block-grid__product-rating .wc-block-grid__product-rating__stars:before{color:#aaa;content:"SSSSS";left:0;opacity:.5;position:absolute;right:0;top:0;white-space:nowrap}.wc-block-grid__product-rating .star-rating span,.wc-block-grid__product-rating .wc-block-grid__product-rating__stars span{left:0;overflow:hidden;padding-top:1.5em;position:absolute;right:0;top:0}.wc-block-grid__product-rating .star-rating span:before,.wc-block-grid__product-rating .wc-block-grid__product-rating__stars span:before{color:inherit;content:"SSSSS";left:0;position:absolute;right:0;top:0;white-space:nowrap}.wc-block-grid__product-onsale{background:#fff;border:1px solid #43454b;border-radius:3px;color:#43454b;display:inline-block;font-size:.875em;font-weight:600;padding:.25em .75em;position:relative;text-align:center;text-transform:uppercase;width:auto;z-index:9}.wc-block-grid__product .wc-block-grid__product-image:not(.wc-block-components-product-image),.wc-block-grid__product .wc-block-grid__product-title{margin:0 0 12px}.wc-block-grid__product .wc-block-grid__product-add-to-cart,.wc-block-grid__product .wc-block-grid__product-onsale,.wc-block-grid__product .wc-block-grid__product-price,.wc-block-grid__product .wc-block-grid__product-rating{margin:0 auto 12px}.theme-twentysixteen .wc-block-grid .price ins{color:#77a464}.theme-twentynineteen .wc-block-grid__product{font-size:.88889em}.theme-twentynineteen .wc-block-components-product-sale-badge,.theme-twentynineteen .wc-block-components-product-title,.theme-twentynineteen .wc-block-grid__product-onsale,.theme-twentynineteen .wc-block-grid__product-title{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.theme-twentynineteen .wc-block-grid__product-title:before{display:none}.theme-twentynineteen .wc-block-components-product-sale-badge,.theme-twentynineteen .wc-block-grid__product-onsale{line-height:1}.theme-twentynineteen .editor-styles-wrapper .wp-block-button .wp-block-button__link:not(.has-text-color){color:#fff}.theme-twentytwenty .wc-block-grid__product-link{color:#000}.theme-twentytwenty .wc-block-components-product-title,.theme-twentytwenty .wc-block-grid__product-title{color:#cd2653;font-family:-apple-system,blinkmacsystemfont,Helvetica Neue,helvetica,sans-serif;font-size:1em}.theme-twentytwenty .wp-block-columns .wc-block-components-product-title{margin-top:0}.theme-twentytwenty .wc-block-components-product-price .woocommerce-Price-amount,.theme-twentytwenty .wc-block-components-product-price__value,.theme-twentytwenty .wc-block-grid__product-price .woocommerce-Price-amount,.theme-twentytwenty .wc-block-grid__product-price__value{font-family:-apple-system,blinkmacsystemfont,Helvetica Neue,helvetica,sans-serif;font-size:.9em}.theme-twentytwenty .wc-block-components-product-price del,.theme-twentytwenty .wc-block-grid__product-price del{opacity:.5}.theme-twentytwenty .wc-block-components-product-price ins,.theme-twentytwenty .wc-block-grid__product-price ins{text-decoration:none}.theme-twentytwenty .star-rating,.theme-twentytwenty .wc-block-grid__product-rating{font-size:.7em}.theme-twentytwenty .star-rating .wc-block-components-product-rating__stars,.theme-twentytwenty .star-rating .wc-block-grid__product-rating__stars,.theme-twentytwenty .wc-block-grid__product-rating .wc-block-components-product-rating__stars,.theme-twentytwenty .wc-block-grid__product-rating .wc-block-grid__product-rating__stars{line-height:1}.theme-twentytwenty .wc-block-components-product-button>.wp-block-button__link,.theme-twentytwenty .wc-block-grid__product-add-to-cart>.wp-block-button__link{font-family:-apple-system,blinkmacsystemfont,Helvetica Neue,helvetica,sans-serif}.theme-twentytwenty .wc-block-components-product-sale-badge,.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-onsale{background:#cd2653;color:#fff;font-family:-apple-system,blinkmacsystemfont,Helvetica Neue,helvetica,sans-serif;font-weight:700;letter-spacing:-.02em;line-height:1.2;text-transform:uppercase}.theme-twentytwenty .wc-block-grid__products .wc-block-components-product-sale-badge{position:static}.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-image .wc-block-components-product-sale-badge{position:absolute}.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-onsale:not(.wc-block-components-product-sale-badge){position:absolute;right:4px;top:4px;z-index:1}.theme-twentytwenty .wc-block-active-filters__title,.theme-twentytwenty .wc-block-attribute-filter__title,.theme-twentytwenty .wc-block-price-filter__title,.theme-twentytwenty .wc-block-stock-filter__title{font-size:1em}.theme-twentytwenty .wc-block-active-filters .wc-block-active-filters__clear-all{font-size:.75em}.theme-twentytwenty .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link{font-size:.75em;padding:.5em}@media only screen and (min-width:768px){.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-onsale{font-size:.875em;padding:.5em}}@media only screen and (min-width:1168px){.theme-twentytwenty .wc-block-grid__products .wc-block-grid__product-onsale{font-size:.875em;padding:.5em}}.theme-twentytwentytwo .wc-block-grid__product-add-to-cart .added_to_cart{display:block;margin-top:12px}.theme-twentytwentytwo .wc-block-components-product-price ins,.theme-twentytwentytwo .wc-block-grid__product-price ins{text-decoration:none}.screen-reader-text{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;padding:0;position:absolute!important;width:1px}.screen-reader-text:focus{clip:auto!important;background-color:#fff;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);-webkit-clip-path:none;clip-path:none;color:#2b2d2f;display:block;font-size:.875rem;font-weight:700;height:auto;left:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}.wc-block-components-product-add-to-cart-attribute-picker{flex-basis:100%;margin:0}.wc-block-components-product-add-to-cart-attribute-picker label{display:block;font-size:1em}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__container{position:relative}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select{margin:0 0 .75em}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select select{min-height:1.75em;min-width:60%}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select.has-error{margin-bottom:24px}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select.has-error select{border-color:#cc1818}.wc-block-components-product-add-to-cart-attribute-picker .wc-block-components-product-add-to-cart-attribute-picker__select.has-error select:focus{outline-color:#cc1818}.wc-block-components-product-add-to-cart{display:flex;flex-wrap:wrap;margin:0}.wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button{margin:0 0 .75em}.wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button .wc-block-components-button__text{display:block}.wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button .wc-block-components-button__text>svg{fill:currentColor;height:1.5em;margin:-.25em 0 -.25em .5em;vertical-align:top;width:1.5em}.wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity{background:#fff;border:1px solid #ccc;border-radius:2px;box-shadow:inset 0 1px 1px rgba(0,0,0,.125);color:#43454b;flex-basis:5em;margin:0 1em .75em 0;padding:.618em;text-align:center}.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button,.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-button,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-quantity{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button>*,.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity>*,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-button>*,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-quantity>*{visibility:hidden}.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button:after,.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity:after,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-button:after,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-quantity:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-button,.is-loading .wc-block-components-product-add-to-cart .wc-block-components-product-add-to-cart-quantity,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-button,.wc-block-components-product-add-to-cart--placeholder .wc-block-components-product-add-to-cart-quantity{-webkit-animation:none;animation:none}}.wc-block-grid .wc-block-components-product-add-to-cart{justify-content:center}.wc-block-components-product-add-to-cart-notice{margin:0}.wp-block-button.wc-block-components-product-button{margin-bottom:12px;margin-top:0;white-space:normal;word-break:break-word}.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button{border-style:none;display:inline-flex;font-family:inherit;font-weight:inherit;justify-content:center;margin:0 auto;white-space:normal;word-break:break-word}.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button--placeholder{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;min-height:3em;min-width:8em;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button--placeholder>*{visibility:hidden}.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button--placeholder:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button--placeholder{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-product-button>.wc-block-components-product-button__button{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;min-height:3em;min-width:8em;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.is-loading .wc-block-components-product-button>.wc-block-components-product-button__button>*{visibility:hidden}.is-loading .wc-block-components-product-button>.wc-block-components-product-button__button:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-button>.wc-block-components-product-button__button{-webkit-animation:none;animation:none}}.theme-twentytwentyone .editor-styles-wrapper .wc-block-components-product-button .wp-block-button__link{background-color:var(--button--color-background);border-color:var(--button--color-background);color:var(--button--color-text)}.wc-block-components-product-category-list{margin-bottom:.75em;margin-top:0}.wc-block-components-product-category-list ul{display:inline;margin:0;padding:0}.wc-block-components-product-category-list ul li{display:inline;list-style:none}.wc-block-components-product-category-list ul li:after{content:", "}.wc-block-components-product-category-list ul li:last-child:after{content:""}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image,.wc-block-components-product-image{display:block;position:relative;text-decoration:none}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image a,.wc-block-components-product-image a{border:0;border-radius:inherit;box-shadow:none;outline:0;text-decoration:none}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image img,.wc-block-components-product-image img{border-radius:inherit;vertical-align:middle;width:100%}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image img[hidden],.wc-block-components-product-image img[hidden]{display:none}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image img[alt=""],.wc-block-components-product-image img[alt=""]{border:1px solid #f2f2f2}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image .wc-block-components-product-sale-badge--align-left,.wc-block-components-product-image .wc-block-components-product-sale-badge--align-left{left:4px;margin:0;position:absolute;right:auto;top:4px}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image .wc-block-components-product-sale-badge--align-center,.wc-block-components-product-image .wc-block-components-product-sale-badge--align-center{left:50%;margin:0;position:absolute;right:auto;top:4px;transform:translateX(-50%)}.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image .wc-block-components-product-sale-badge--align-right,.wc-block-components-product-image .wc-block-components-product-sale-badge--align-right{left:auto;margin:0;position:absolute;right:4px;top:4px}.is-loading .wc-block-components-product-image{background-color:#ebebeb!important;border:0!important;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;width:auto;z-index:1}.is-loading .wc-block-components-product-image>*{visibility:hidden}.is-loading .wc-block-components-product-image:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-image{-webkit-animation:none;animation:none}}.wc-block-components-product-image{margin:0 0 12px}.wc-block-components-product-rating{display:block;margin-bottom:12px;margin-top:0}.wc-block-components-product-rating__stars{font-family:star;font-size:1em;font-weight:400;height:1.618em;line-height:1.618;margin:0 auto;overflow:hidden;position:relative;text-align:left;width:5.3em}.wc-block-components-product-rating__stars:before{color:inherit;content:"SSSSS";left:0;opacity:.5;position:absolute;right:0;top:0;white-space:nowrap}.wc-block-components-product-rating__stars span{color:inherit;left:0;overflow:hidden;padding-top:1.5em;position:absolute;right:0;top:0}.wc-block-components-product-rating__stars span:before{color:inherit;content:"SSSSS";left:0;position:absolute;right:0;top:0;white-space:nowrap}.wc-block-single-product .wc-block-components-product-rating__stars{margin:0}.wc-block-components-product-sale-badge{background:#fff;border:1px solid #43454b;border-radius:3px;box-sizing:border-box;color:#43454b;display:inline-block;font-size:.875em;font-weight:600;margin:0 auto 12px;padding:.25em .75em;position:static;text-align:center;text-transform:uppercase;width:auto;z-index:9}.wc-block-components-product-sale-badge span{background-color:inherit;color:inherit}.wc-block-components-product-sku{display:block;font-size:.875em;margin-bottom:12px;margin-top:0;text-transform:uppercase}.wc-block-components-product-stock-indicator{display:block;font-size:.875em;margin-bottom:.75em;margin-top:0}.wc-block-components-product-summary{margin-bottom:12px;margin-top:0}.is-loading .wc-block-components-product-summary:before{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;content:".";display:block;height:6em;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.is-loading .wc-block-components-product-summary:before>*{visibility:hidden}.is-loading .wc-block-components-product-summary:before:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-summary:before{-webkit-animation:none;animation:none}}.wc-block-components-product-tag-list{margin-bottom:.75em;margin-top:0}.wc-block-components-product-tag-list ul{display:inline;margin:0;padding:0}.wc-block-components-product-tag-list ul li{display:inline;list-style:none}.wc-block-components-product-tag-list ul li:after{content:", "}.wc-block-components-product-tag-list ul li:last-child:after{content:""}.wc-block-components-product-title{display:block;font-size:inherit;font-weight:700;line-height:1.5;margin-bottom:12px;margin-top:0;padding:0}.wc-block-components-product-title a{color:inherit;font-size:inherit}.is-loading .wc-block-components-product-title:before{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;content:".";display:block;display:inline-block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;width:7em;z-index:1}.is-loading .wc-block-components-product-title:before>*{visibility:hidden}.is-loading .wc-block-components-product-title:before:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-title:before{-webkit-animation:none;animation:none}}.is-loading .wc-block-grid .wc-block-components-product-title:before{width:10em}.wc-block-components-product-title--align-left{text-align:left}.wc-block-components-product-title--align-center{text-align:center}.wc-block-components-product-title--align-right{text-align:right}.wc-block-components-error{align-items:center;color:#757575;display:flex;flex-direction:column;justify-content:center;margin:40px 0;padding:40px 0;text-align:center}.wc-block-components-error__header{color:#646970;font-size:2em;margin:0}.wc-block-components-error__image{margin:0 0 24px;width:25%}.wc-block-components-error__text{color:#8c8f94;font-size:1.25em;margin:1em 0 0;max-width:60ch}.wc-block-components-error__message{color:#8c8f94;font-style:italic;margin:1em auto 0;max-width:60ch}.wc-block-error__button{margin:40px 0 0}.wc-block-components-button:not(.is-link){align-items:center;color:inherit;display:inline-flex;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;font-weight:700;justify-content:center;letter-spacing:inherit;line-height:inherit;line-height:1;min-height:3em;padding:0 1em;position:relative;text-align:center;text-decoration:inherit;text-decoration:none;text-transform:inherit;text-transform:none;transition:box-shadow .1s linear}.wc-block-components-button:not(.is-link):focus{box-shadow:0 0 0 2px #0675c4;box-shadow:inset 0 0 0 1px #fff,0 0 0 2px #0675c4;outline:3px solid transparent}.wc-block-components-button:not(.is-link) .wc-block-components-button__text{display:block}.wc-block-components-button:not(.is-link) .wc-block-components-button__text>svg{fill:currentColor}.wc-block-components-button:not(.is-link) .wc-block-components-spinner+.wc-block-components-button__text{visibility:hidden}.wc-block-components-button:not(.is-link).text{color:#1e1e1e}.wc-block-components-button:not(.is-link).text:hover{opacity:.9}.wc-block-components-button:not(.is-link).contained,.wc-block-components-button:not(.is-link).contained:active,.wc-block-components-button:not(.is-link).contained:disabled,.wc-block-components-button:not(.is-link).contained:focus,.wc-block-components-button:not(.is-link).contained:hover{background-color:#1e1e1e;color:#fff}.wc-block-components-button:not(.is-link).contained:hover{opacity:.9}.wc-block-components-button:not(.is-link).outlined{background-color:transparent;color:#1e1e1e}.wc-block-components-button:not(.is-link).outlined:not(:focus){box-shadow:inset 0 0 0 1px #1e1e1e}.wc-block-components-button:not(.is-link).outlined:active,.wc-block-components-button:not(.is-link).outlined:disabled,.wc-block-components-button:not(.is-link).outlined:focus,.wc-block-components-button:not(.is-link).outlined:hover{background-color:#1e1e1e;color:#fff}.wc-block-components-button:not(.is-link).outlined:hover{background-color:#1e1e1e;color:#fff;opacity:1}.wc-block-components-form{counter-reset:checkout-step}.wc-block-components-form .wc-block-components-checkout-step{background:none;border:none;margin:0;padding:0 0 0 24px;position:relative}.is-mobile .wc-block-components-form .wc-block-components-checkout-step,.is-small .wc-block-components-form .wc-block-components-checkout-step{padding-left:0}.wc-block-components-checkout-step--disabled{opacity:.6}.wc-block-components-checkout-step__container{position:relative}.wc-block-components-checkout-step__content>*{margin-bottom:1em}.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__content>:last-child{margin-bottom:0;padding-bottom:1.5em}.wc-block-components-checkout-step__heading{align-content:center;align-items:center;display:flex;flex-wrap:wrap;gap:1em;justify-content:space-between;margin:.75em 0 1em;position:relative}.wc-block-components-checkout-step:first-child .wc-block-components-checkout-step__heading,.wc-block-components-express-payment-continue-rule+.wc-block-components-checkout-step .wc-block-components-checkout-step__heading{margin-top:0}.wc-block-components-checkout-step__title{margin:0 12px 0 0}.wc-block-components-checkout-step__heading-content{font-size:.75em}.wc-block-components-checkout-step__heading-content a{color:inherit;font-weight:700}.wc-block-components-checkout-step__description{font-size:.875em;line-height:1.25;margin-bottom:16px}.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__title:before{background:transparent;border:0;border-radius:0;content:" " counter(checkout-step) ".";content:" " counter(checkout-step) "."/"";counter-increment:checkout-step;left:-24px;margin:0;padding:0;position:absolute;text-align:center;top:0;transform:translateX(-50%);vertical-align:baseline;width:24px}.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__container:after{border-left:1px solid;content:"";height:100%;left:-24px;opacity:.3;position:absolute;top:0}.is-mobile .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__title:before,.is-small .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__title:before{content:counter(checkout-step) ". ";content:counter(checkout-step) ". "/"";left:auto;position:static;top:auto;transform:none}.is-mobile .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__container:after,.is-small .wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__container:after{content:unset}.editor-styles-wrapper .wp-block h4.wc-block-components-checkout-step__title{font-size:1em;line-height:24px;margin:0 12px 0 0}.wc-block-components-order-summary .wc-block-components-panel__button{margin-top:0;padding-top:0}.wc-block-components-order-summary .wc-block-components-panel__content{margin-bottom:0}.wc-block-components-order-summary__content{display:table;width:100%}.wc-block-components-order-summary-item{display:flex;font-size:.875em;padding-bottom:1px;padding-top:16px;position:relative;width:100%}.wc-block-components-order-summary-item:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-components-order-summary-item:first-child{padding-top:0}.wc-block-components-order-summary-item:last-child>div{padding-bottom:0}.wc-block-components-order-summary-item:last-child:after{display:none}.wc-block-components-order-summary-item .wc-block-components-product-metadata{font-size:1em}.wc-block-components-order-summary-item__description,.wc-block-components-order-summary-item__image{display:table-cell;vertical-align:top}.wc-block-components-order-summary-item__image{padding-bottom:16px;position:relative;width:48px}.wc-block-components-order-summary-item__image>img{max-width:48px;width:48px}.wc-block-components-order-summary-item__quantity{align-items:center;background:#fff;border:2px solid;border-radius:1em;box-shadow:0 0 0 2px #fff;color:#000;display:flex;justify-content:center;line-height:1;min-height:20px;min-width:20px;padding:0 .4em;position:absolute;right:0;top:0;transform:translate(50%,-50%);white-space:nowrap;z-index:1}.wc-block-components-order-summary-item__description{padding-bottom:16px;padding-left:24px;padding-right:12px}.wc-block-components-order-summary-item__description .wc-block-components-product-metadata,.wc-block-components-order-summary-item__description p{line-height:1.375;margin-top:4px}.wc-block-components-order-summary-item__total-price{font-weight:700;margin-left:auto;text-align:right}.wc-block-components-order-summary-item__individual-prices{display:block}.wc-block-components-payment-method-icons{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;margin:0 0 14px}.wc-block-components-payment-method-icons .wc-block-components-payment-method-icon{display:inline-block;height:24px;margin:0 4px 2px;max-height:24px;max-width:38px;padding:0;width:auto}.wc-block-components-payment-method-icons--align-left{justify-content:flex-start}.wc-block-components-payment-method-icons--align-left .wc-block-components-payment-method-icon{margin-left:0;margin-right:8px}.wc-block-components-payment-method-icons--align-right{justify-content:flex-end}.wc-block-components-payment-method-icons--align-right .wc-block-components-payment-method-icon{margin-left:8px;margin-right:0}.wc-block-components-payment-method-icons:last-child{margin-bottom:0}.is-mobile .wc-block-components-payment-method-icons .wc-block-components-payment-method-icon,.is-small .wc-block-components-payment-method-icons .wc-block-components-payment-method-icon{height:16px}.wc-block-components-payment-method-label--with-icon{display:inline-block;vertical-align:middle}.wc-block-components-payment-method-label--with-icon>img,.wc-block-components-payment-method-label--with-icon>svg{margin:-2px 4px 0 0;vertical-align:middle}.is-mobile .wc-block-components-payment-method-label--with-icon>img,.is-mobile .wc-block-components-payment-method-label--with-icon>svg,.is-small .wc-block-components-payment-method-label--with-icon>img,.is-small .wc-block-components-payment-method-label--with-icon>svg{display:none}.editor-styles-wrapper .wc-block-components-checkout-policies,.wc-block-components-checkout-policies{font-size:.75em;line-height:1;list-style:none outside;margin:24px 0;text-align:center}.wc-block-components-checkout-policies__item{display:inline-block;list-style:none outside;margin:0;padding:0 .25em}.wc-block-components-checkout-policies__item:not(:first-child){border-left:1px solid #ccc}.wc-block-components-checkout-policies__item>a{color:inherit;padding:0 .25em}.wc-block-components-product-badge{border:1px solid;border-radius:2px;display:inline-block;font-size:.75em;font-weight:600;padding:0 .66em;text-transform:uppercase;white-space:nowrap}.wc-block-components-product-details.wc-block-components-product-details{list-style:none;margin:.5em 0;padding:0}.wc-block-components-product-details.wc-block-components-product-details:last-of-type{margin-bottom:0}.wc-block-components-product-details.wc-block-components-product-details li{margin-left:0}.wc-block-components-product-details__name,.wc-block-components-product-details__value{display:inline-block}.is-large:not(.wc-block-checkout) .wc-block-components-product-details__name{font-weight:700}img.wc-block-components-product-image[alt=""]{border:1px solid #f2f2f2}.wc-block-components-product-metadata{font-size:.75em}.wc-block-components-product-metadata .wc-block-components-product-metadata__description>p,.wc-block-components-product-metadata .wc-block-components-product-metadata__variation-data{margin:.25em 0}.wc-block-components-checkout-return-to-cart-button{box-shadow:none;color:inherit;padding-left:calc(24px + .25em);position:relative;text-decoration:none}.wc-block-components-checkout-return-to-cart-button svg{left:0;position:absolute;top:50%;transform:translateY(-50%)}.wc-block-components-shipping-calculator-address{margin-bottom:0}.wc-block-components-shipping-calculator-address__button{margin-top:1.5em;width:100%}.wc-block-components-shipping-calculator{padding:.5em 0 .75em}.wc-block-components-shipping-rates-control__package{margin-bottom:36px}.wc-block-components-shipping-rates-control__package:last-child{margin-bottom:0}.wc-block-components-shipping-rates-control__package .wc-block-components-panel__button{margin-bottom:0;margin-top:0;padding-bottom:.75em;padding-top:.75em}.wc-block-components-shipping-rates-control__package .wc-block-components-panel__content,.wc-block-components-shipping-rates-control__package .wc-block-components-radio-control,.wc-block-components-shipping-rates-control__package .wc-block-components-radio-control .wc-block-components-radio-control__option-layout,.wc-block-components-shipping-rates-control__package .wc-block-components-radio-control__option-layout{padding-bottom:0}.wc-block-components-shipping-rates-control__package-items{display:block;font-size:.875em;list-style:none;margin:0;padding:0}.wc-block-components-shipping-rates-control__package-item{display:inline-block;margin:0;overflow-wrap:anywhere;padding:0;word-break:break-word;-ms-word-break:break-all}.wc-block-components-shipping-rates-control__package-item:not(:last-child):after{content:", ";white-space:pre}.wc-block-components-totals-coupon .wc-block-components-panel__button{margin-top:0;padding-top:0}.wc-block-components-totals-coupon .wc-block-components-panel__content{padding-bottom:0}.wc-block-components-totals-coupon__form{display:flex;margin-bottom:0;width:100%}.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__input{flex-grow:1;margin-bottom:0;margin-top:0}.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button{flex-shrink:0;height:3em;margin-left:8px;padding-left:24px;padding-right:24px;white-space:nowrap}.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button.no-margin{margin:0}.wc-block-components-totals-coupon__content{flex-direction:column;position:relative}.wc-block-components-totals-discount__coupon-list{list-style:none;margin:0;padding:0}.wc-block-components-totals-discount .wc-block-components-totals-item__value{color:#4ab866}.wc-block-components-totals-footer-item .wc-block-components-totals-item__label,.wc-block-components-totals-footer-item .wc-block-components-totals-item__value{font-size:1.25em}.wc-block-components-totals-footer-item .wc-block-components-totals-item__label{font-weight:700}.wc-block-components-totals-footer-item .wc-block-components-totals-footer-item-tax{margin-bottom:0}.wc-block-components-totals-shipping fieldset.wc-block-components-totals-shipping__fieldset{background-color:transparent;border:0;margin:0;padding:0}.wc-block-components-totals-shipping .wc-block-components-totals-shipping__via{margin-bottom:16px}.wc-block-components-totals-shipping .wc-block-components-totals-shipping__options .wc-block-components-radio-control__description,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__options .wc-block-components-radio-control__label,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__options .wc-block-components-radio-control__secondary-description,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__options .wc-block-components-radio-control__secondary-label{flex-basis:100%;text-align:left}.wc-block-components-totals-shipping .wc-block-components-shipping-rates-control__no-results-notice{margin:0 0 .75em}.wc-block-components-totals-shipping .wc-block-components-totals-shipping__change-address-button{background:transparent;border:0;border-radius:0;box-shadow:none;color:inherit;display:inline;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-decoration:inherit;text-decoration:underline;text-shadow:none;text-transform:inherit;vertical-align:baseline}.wc-block-components-totals-shipping .wc-block-components-totals-shipping__change-address-button:active,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__change-address-button:focus,.wc-block-components-totals-shipping .wc-block-components-totals-shipping__change-address-button:hover{background:transparent;opacity:.8}.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-totals-shipping__change-address-button{background:transparent;border:0;border-radius:0;box-shadow:none;color:inherit;display:inline;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-decoration:inherit;text-decoration:underline;text-shadow:none;text-transform:inherit;vertical-align:baseline}.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-totals-shipping__change-address-button:active,.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-totals-shipping__change-address-button:focus,.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-totals-shipping__change-address-button:hover{background:transparent}.editor-styles-wrapper .wc-block-components-checkbox-list,.wc-block-components-checkbox-list{list-style:none outside;margin:0;padding:0}.editor-styles-wrapper .wc-block-components-checkbox-list li,.wc-block-components-checkbox-list li{list-style:none outside;margin:0 0 4px;padding:0}.editor-styles-wrapper .wc-block-components-checkbox-list li.show-less button,.editor-styles-wrapper .wc-block-components-checkbox-list li.show-more button,.wc-block-components-checkbox-list li.show-less button,.wc-block-components-checkbox-list li.show-more button{background:none;border:none;cursor:pointer;padding:0;text-decoration:underline}.editor-styles-wrapper .wc-block-components-checkbox-list.is-loading li,.wc-block-components-checkbox-list.is-loading li{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.editor-styles-wrapper .wc-block-components-checkbox-list.is-loading li>*,.wc-block-components-checkbox-list.is-loading li>*{visibility:hidden}.editor-styles-wrapper .wc-block-components-checkbox-list.is-loading li:after,.wc-block-components-checkbox-list.is-loading li:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.editor-styles-wrapper .wc-block-components-checkbox-list.is-loading li,.wc-block-components-checkbox-list.is-loading li{-webkit-animation:none;animation:none}}.wc-block-components-chip{align-items:center;border:0;border-radius:0;color:inherit;display:inline-flex;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;line-height:1;margin:0 .365em .365em 0;max-width:100%;padding:.125em .5em .25em;text-decoration:inherit;text-transform:inherit}.wc-block-components-chip,.wc-block-components-chip:active,.wc-block-components-chip:focus,.wc-block-components-chip:hover{background:#e0e0e0;color:#1e1e1e}.wc-block-components-chip.wc-block-components-chip--radius-small{border-radius:3px}.wc-block-components-chip.wc-block-components-chip--radius-medium{border-radius:.433em}.wc-block-components-chip.wc-block-components-chip--radius-large{border-radius:2em;padding-left:.75em;padding-right:.75em}.wc-block-components-chip .wc-block-components-chip__text{flex-grow:1}.wc-block-components-chip.is-removable{padding-right:.5em}.wc-block-components-chip.is-removable .wc-block-components-chip__text{padding-right:.25em}.wc-block-components-chip .wc-block-components-chip__remove{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;font-size:.75em;padding:0}.wc-block-components-chip .wc-block-components-chip__remove-icon{vertical-align:middle}.theme-twentytwentyone .wc-block-components-chip,.theme-twentytwentyone .wc-block-components-chip:active,.theme-twentytwentyone .wc-block-components-chip:focus,.theme-twentytwentyone .wc-block-components-chip:hover{background:#fff}.theme-twentytwentyone .wc-block-components-chip:active button.wc-block-components-chip__remove:not(:hover):not(:active):not(.has-background),.theme-twentytwentyone .wc-block-components-chip:focus button.wc-block-components-chip__remove:not(:hover):not(:active):not(.has-background),.theme-twentytwentyone .wc-block-components-chip:hover button.wc-block-components-chip__remove:not(:hover):not(:active):not(.has-background),.theme-twentytwentyone .wc-block-components-chip button.wc-block-components-chip__remove:not(:hover):not(:active):not(.has-background){background:transparent}.wc-block-components-chip__remove:focus,.wc-block-components-chip__remove:hover,button.wc-block-components-chip:focus>.wc-block-components-chip__remove,button.wc-block-components-chip:hover>.wc-block-components-chip__remove{fill:#cc1818}.wc-block-components-chip__remove:disabled,button.wc-block-components-chip:disabled>.wc-block-components-chip__remove{fill:#949494;cursor:not-allowed}.wc-block-components-combobox .wc-block-components-combobox-control,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control{border:0;border-radius:0;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-decoration:inherit;text-transform:inherit;vertical-align:baseline}.wc-block-components-combobox .wc-block-components-combobox-control .components-base-control__field,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-base-control__field{border:0;border-radius:0;margin:0;padding:0;vertical-align:baseline}.wc-block-components-combobox .wc-block-components-combobox-control .components-combobox-control__suggestions-container,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-combobox-control__suggestions-container{border:0;border-radius:0;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;position:relative;text-decoration:inherit;text-transform:inherit;vertical-align:baseline}.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input{background:#fff;border:1px solid #50575e;border-radius:4px;box-shadow:none;box-sizing:border-box;color:inherit;color:#2b2d2f;font-family:inherit;font-size:inherit;font-size:1em;font-style:inherit;font-weight:inherit;font-weight:400;height:3em;letter-spacing:inherit;line-height:inherit;line-height:1;opacity:1;outline:inherit;padding:1.5em 16px .25em;text-align:left;text-decoration:inherit;text-overflow:ellipsis;text-transform:inherit;text-transform:none;white-space:nowrap;width:100%}.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input[aria-expanded=true],.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input[aria-expanded=true]{background-color:#fff;box-shadow:0 0 0 1px #50575e;color:#2b2d2f;outline:0}.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input[aria-expanded=true],.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input[aria-expanded=true]{border-bottom-left-radius:0;border-bottom-right-radius:0}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input{background-color:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.4);color:#fff}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus{background-color:rgba(0,0,0,.1);box-shadow:0 0 0 1px hsla(0,0%,100%,.4);color:#fff}.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list{background-color:#fff;border:1px solid #50575e;border-top:0;color:#2b2d2f;margin:3em 0 0;max-height:300px;min-width:100%;overflow:auto;padding:0;position:absolute;z-index:10}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list{background-color:#1e1e1e;color:#fff}.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion{color:#757575;cursor:default;font-size:1em;list-style:none;margin:0;padding:.25em 16px}.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-selected,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-selected{background-color:#ddd}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-selected,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-selected{background-color:rgba(0,0,0,.4)}.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-highlighted,.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:active,.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:focus,.wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:hover,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion.is-highlighted,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:active,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:focus,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control .components-form-token-field__suggestions-list .components-form-token-field__suggestion:hover{background-color:#00669e;color:#fff}.wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label{color:inherit;color:#757575;font-family:inherit;font-size:inherit;font-size:1em;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;line-height:1.375;margin:0 0 0 17px;max-width:calc(100% - 32px);overflow:hidden;position:absolute;text-decoration:inherit;text-overflow:ellipsis;text-transform:inherit;transform:translateY(.75em);transform-origin:top left;transition:all .2s ease;white-space:nowrap;z-index:1}.has-dark-controls .wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label,.has-dark-controls .wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label{color:hsla(0,0%,100%,.6)}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox .wc-block-components-combobox-control label.components-base-control__label{transition:none}}.wc-block-components-combobox.is-active .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-combobox:focus-within .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox.is-active .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox:focus-within .wc-block-components-combobox-control label.components-base-control__label{transform:translateY(4px) scale(.75)}.wc-block-components-combobox.has-error .wc-block-components-combobox-control label.components-base-control__label,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control label.components-base-control__label{color:#cc1818}.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input,.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:active,.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:hover,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:active,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:hover{border-color:#cc1818}.wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:focus,.wc-block-components-form .wc-block-components-combobox.has-error .wc-block-components-combobox-control input.components-combobox-control__input:focus{box-shadow:0 0 0 1px #cc1818}.wc-block-components-country-input{margin-top:1.5em}@-webkit-keyframes fadein{0%{opacity:0}to{opacity:1}}@keyframes fadein{0%{opacity:0}to{opacity:1}}@-webkit-keyframes slidein{0%{transform:translateX(0)}to{transform:translateX(-480px)}}@keyframes slidein{0%{transform:translateX(0)}to{transform:translateX(-480px)}}@media only screen and (max-width:480px){@-webkit-keyframes slidein{0%{transform:translateX(0)}to{transform:translateX(-100vw)}}@keyframes slidein{0%{transform:translateX(0)}to{transform:translateX(-100vw)}}}.wc-block-components-drawer__screen-overlay{background-color:rgba(95,95,95,.35);bottom:0;left:0;opacity:1;position:fixed;right:0;top:0;transition:opacity .3s;z-index:9999}.wc-block-components-drawer__screen-overlay--with-slide-out{transition:opacity .3s}.wc-block-components-drawer__screen-overlay--with-slide-in{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-name:fadein;animation-name:fadein}.wc-block-components-drawer__screen-overlay--is-hidden{opacity:0;pointer-events:none}.wc-block-components-drawer{background:#fff;display:block;height:100%;left:100%;position:relative;position:fixed;right:0;top:0;transform:translateX(-480px);width:480px}.wc-block-components-drawer:after{border-style:solid;border-width:0 0 0 1px;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}@media only screen and (max-width:480px){.wc-block-components-drawer{transform:translateX(-100vw);width:100vw}}.wc-block-components-drawer__screen-overlay--with-slide-out .wc-block-components-drawer{transition:transform .3s}.wc-block-components-drawer__screen-overlay--with-slide-in .wc-block-components-drawer{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-name:slidein;animation-name:slidein}.wc-block-components-drawer__screen-overlay--is-hidden .wc-block-components-drawer{transform:translateX(0)}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-drawer,.wc-block-components-drawer__screen-overlay{-webkit-animation-name:none!important;animation-name:none!important;transition:none!important}}.wc-block-components-drawer .components-modal__content{padding:40px 16px}.wc-block-components-drawer .components-modal__header{position:relative}.wc-block-components-drawer .components-modal__header .components-button{background:transparent;border:0;border-radius:0;margin:-1em;padding:1em;position:absolute;right:0;top:0;vertical-align:baseline}.wc-block-components-drawer .components-modal__header .components-button>span{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;padding:0;position:absolute!important;width:1px}.wc-block-components-drawer .components-modal__header-heading{border:0;border-radius:0;font-size:1.25rem;margin:0;padding:0;vertical-align:baseline;word-break:break-word}.wc-filter-element-label-list-count{opacity:.6}.wc-filter-element-label-list-count:before{content:" ("}.wc-filter-element-label-list-count:after{content:")"}.wc-block-components-filter-reset-button{background:transparent;border:none;cursor:pointer;font-size:inherit}.wc-block-components-filter-reset-button:not([disabled]):hover{text-decoration:underline}.wc-block-components-filter-reset-button[disabled]{cursor:not-allowed}.wc-block-components-filter-submit-button{border:none;display:block;margin-left:auto;white-space:nowrap}.wc-blocks-components-form-token-field-wrapper .components-popover{left:0;opacity:0;position:fixed;top:0;z-index:z-index(".components-popover")}.wc-blocks-components-form-token-field-wrapper .components-popover.is-expanded,.wc-blocks-components-form-token-field-wrapper .components-popover[data-x-axis][data-y-axis]{opacity:1}.wc-blocks-components-form-token-field-wrapper .components-popover.is-expanded{bottom:0;left:0;right:0;top:0;z-index:z-index(".components-popover")!important}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow){margin-left:2px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):before{border:8px solid #ccc}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow).is-alternate:before{border-color:#1e1e1e}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):after{border:8px solid #fff}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):before{content:"";height:0;line-height:0;position:absolute;width:0}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]{margin-top:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{bottom:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:after{bottom:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{border-bottom:none;border-left-color:transparent;border-right-color:transparent;border-top-style:solid;margin-left:-10px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]{margin-top:8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{top:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after{top:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{border-bottom-style:solid;border-left-color:transparent;border-right-color:transparent;border-top:none;margin-left:-10px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]{margin-left:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:before{right:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:after{right:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:before{border-bottom-color:transparent;border-left-style:solid;border-right:none;border-top-color:transparent}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]{margin-left:8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:before{left:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:after{left:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:before{border-bottom-color:transparent;border-left:none;border-right-style:solid;border-top-color:transparent}.wc-blocks-components-form-token-field-wrapper .components-popover[data-y-axis=top]{bottom:100%}.wc-blocks-components-form-token-field-wrapper .components-popover[data-y-axis=bottom]{top:100%}.wc-blocks-components-form-token-field-wrapper .components-popover[data-y-axis=middle]{align-items:center;display:flex}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-top{margin-top:12px}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-bottom{margin-top:-12px}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-left:not(.is-from-top):not(.is-from-bottom){margin-left:12px}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-right:not(.is-from-top):not(.is-from-bottom){margin-right:12px}.wc-blocks-components-form-token-field-wrapper .components-popover__content{background:#fff;border:1px solid #ccc;border-radius:2px;box-shadow:0 2px 6px rgba(0,0,0,.05);height:100%}.is-alternate .wc-blocks-components-form-token-field-wrapper .components-popover__content{border:1px solid #1e1e1e;box-shadow:none}.components-popover .wc-blocks-components-form-token-field-wrapper .components-popover__content{height:auto;overflow-y:auto;position:absolute}.components-popover.is-expanded .wc-blocks-components-form-token-field-wrapper .components-popover__content{border:none;border-top:1px solid #1e1e1e;height:calc(100% - 48px);min-width:auto;overflow-y:visible;position:static}.components-popover[data-y-axis=top] .wc-blocks-components-form-token-field-wrapper .components-popover__content{bottom:100%}.components-popover[data-x-axis=center] .wc-blocks-components-form-token-field-wrapper .components-popover__content{left:50%;transform:translateX(-50%)}.components-popover[data-x-axis=right] .wc-blocks-components-form-token-field-wrapper .components-popover__content{left:100%;position:absolute}.components-popover:not([data-y-axis=middle])[data-x-axis=right] .wc-blocks-components-form-token-field-wrapper .components-popover__content{margin-left:-25px}.components-popover[data-x-axis=left] .wc-blocks-components-form-token-field-wrapper .components-popover__content{position:absolute;right:100%}.components-popover:not([data-y-axis=middle])[data-x-axis=left] .wc-blocks-components-form-token-field-wrapper .components-popover__content{margin-right:-25px}.wc-blocks-components-form-token-field-wrapper .components-popover__header{align-items:center;background:#fff;display:flex;height:48px;justify-content:space-between;padding:0 8px 0 16px}.wc-blocks-components-form-token-field-wrapper .components-popover__header-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.wc-blocks-components-form-token-field-wrapper .components-popover__close.components-button{z-index:z-index(".components-popover__close")}.wc-blocks-components-form-token-field-wrapper .components-tooltip.components-popover{z-index:z-index(".components-tooltip")}.wc-blocks-components-form-token-field-wrapper .components-tooltip.components-popover .components-popover__content{min-width:0}.wc-blocks-components-form-token-field-wrapper .components-tooltip .components-popover__content{background:#1e1e1e;border-radius:2px;border-width:0;box-shadow:none;color:#fff;font-size:12px;line-height:1.4;text-align:center;white-space:nowrap}.wc-blocks-components-form-token-field-wrapper .components-tooltip .components-popover__content>div{padding:4px 8px}.wc-blocks-components-form-token-field-wrapper .components-tooltip__shortcut{display:inline-block;margin-left:8px}.wc-blocks-components-form-token-field-wrapper .disabled-element-wrapper{position:relative}.wc-blocks-components-form-token-field-wrapper .disabled-element-wrapper .event-catcher{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%;z-index:z-index(".components-tooltip .event-catcher")}.wc-blocks-components-form-token-field-wrapper{border-color:#949494}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__label,.wc-blocks-components-form-token-field-wrapper .components-visually-hidden{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;padding:0;position:absolute!important;width:1px}.wc-blocks-components-form-token-field-wrapper .components-form-token-field,.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container{border-color:inherit;box-sizing:border-box;margin-bottom:0}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container{border-radius:0;box-shadow:none;position:relative}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container input[type=text].components-form-token-field__input{min-height:30px}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__remove-token.components-button,.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token-text{background:#e0e0e0}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__remove-token{border:none}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__suggestions-list{background-color:#fff;border:1px solid #949494;border-top:0 solid #949494;left:-1px;margin:1px 0 0;position:absolute;right:-1px;top:100%;z-index:50}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__suggestions-list:empty{display:none}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__suggestion{padding:8px}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__suggestion.is-selected{background:#f0f0f0;color:#2f2f2f}.wc-blocks-components-form-token-field-wrapper.single-selection .components-form-token-field__token{margin-right:0;position:relative;width:100%}.wc-blocks-components-form-token-field-wrapper.single-selection .components-form-token-field__remove-token.components-button,.wc-blocks-components-form-token-field-wrapper.single-selection .components-form-token-field__token-text{background:transparent}.wc-blocks-components-form-token-field-wrapper.single-selection .components-form-token-field__token-text{padding-left:4px;width:100%}.wc-blocks-components-form-token-field-wrapper.single-selection .components-form-token-field__token+input[type=text].components-form-token-field__input{position:absolute}.wc-blocks-components-form-token-field-wrapper.single-selection .is-active .components-form-token-field__token+input[type=text].components-form-token-field__input{border:1px solid #949494;margin:0 2px 4px;padding:0 5px;position:static}.wc-block-components-formatted-money-amount{white-space:nowrap}.wc-block-components-load-more{text-align:center;width:100%}.wc-block-components-loading-mask{min-height:34px;pointer-events:none;position:relative}.wc-block-components-loading-mask .components-spinner{left:50%;margin:0;position:absolute;top:50%;transform:translate(-50%,-50%)}.wc-block-components-loading-mask .wc-block-components-loading-mask__children{opacity:.25}.wc-block-components-pagination{margin:0 auto 16px}.wc-block-components-pagination__ellipsis,.wc-block-components-pagination__page{color:#333;display:inline-block;font-size:1em;font-weight:400}.wc-block-components-pagination__page{border-color:transparent;min-width:2.2em;padding:.3em .6em}@media(max-width:782px){.wc-block-components-pagination__page{min-width:1.6em;padding:.1em .2em}}.wc-block-components-pagination__page:not(.toggle){background-color:transparent}.wc-block-components-pagination__ellipsis{padding:.3em}@media(max-width:782px){.wc-block-components-pagination__ellipsis{padding:.1em}}.wc-block-components-pagination__page--active[disabled]{color:#333;font-weight:700;opacity:1!important}.wc-block-components-pagination__page--active[disabled]:focus,.wc-block-components-pagination__page--active[disabled]:hover{background-color:inherit;color:#333;opacity:1!important}html[dir=rtl] .wc-block-components-pagination-page--arrow span{display:inline-block;transform:scaleX(-1)}.wc-block-components-price-slider{margin-bottom:24px}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-filter-reset-button,.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-filter-submit-button,.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-filter-reset-button>*,.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-filter-submit-button>*,.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper>*{visibility:hidden}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-filter-reset-button:after,.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-filter-submit-button:after,.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-filter-reset-button,.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-filter-submit-button,.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__amount{display:none}.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__amount,.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__button,.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}.wc-block-components-price-slider__range-input-wrapper{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;background:#ddd;border:0!important;border-radius:4px;clear:both;flex-grow:1;height:4px;margin:15px 0;outline:none;padding:0!important;position:relative}.wc-block-components-price-slider__range-input-progress{--track-background:linear-gradient(90deg,transparent var(--low),var(--range-color) 0,var(--range-color) var(--high),transparent 0) no-repeat 0 100%/100% 100%;--range-color:#1e1e1e;background:var(--track-background);height:4px;left:0;position:absolute;top:0;width:100%}.wc-block-components-price-slider__controls{align-items:center;display:flex;gap:8px;justify-content:space-between;margin:24px 0}.wc-block-components-price-slider__controls .wc-block-components-price-slider__amount{border-radius:4px;border-width:1px;margin:0;max-width:100px;min-width:0;padding:8px;width:auto}.wc-block-components-price-slider__range-text{align-items:center;display:flex;justify-content:space-between;margin:24px 0}.wc-block-components-price-slider__actions{align-items:center;display:flex;gap:16px;justify-content:flex-end}.wc-block-components-price-slider__actions .wc-block-components-filter-submit-button{margin-left:0}.wc-block-components-price-slider__range-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0!important;display:block;height:0;left:0;margin:0;outline:none;outline:none!important;padding:0!important;pointer-events:none;position:relative;position:absolute;top:0;width:100%}.wc-block-components-price-slider__range-input::-webkit-slider-runnable-track{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:default;height:1px;outline:0}.wc-block-components-price-slider__range-input::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;background-position:0 0;background:#fff;border:2px solid #1e1e1e;border-radius:100%;box-sizing:content-box;cursor:pointer;height:12px;margin:-5px 0 0;padding:0;pointer-events:auto;-webkit-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;vertical-align:top;width:12px;z-index:20}.wc-block-components-price-slider__range-input::-webkit-slider-thumb:hover{background:#1e1e1e}.wc-block-components-price-slider__range-input::-webkit-slider-progress{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0!important;margin:0;outline:none;padding:0!important}.wc-block-components-price-slider__range-input::-moz-focus-outer{border:0}.wc-block-components-price-slider__range-input::-moz-range-track{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:default;height:1px;outline:0}.wc-block-components-price-slider__range-input::-moz-range-progress{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0!important;margin:0;outline:none;padding:0!important}.wc-block-components-price-slider__range-input::-moz-range-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;background-position:0 0;background:#fff;border:2px solid #1e1e1e;border-radius:100%;box-sizing:content-box;cursor:pointer;height:12px;margin:0;padding:0;pointer-events:auto;-moz-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;vertical-align:top;width:12px;z-index:20}.wc-block-components-price-slider__range-input::-moz-range-thumb:hover{background:#1e1e1e}.wc-block-components-price-slider__range-input::-ms-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;background-position:0 0;background:#fff;border:2px solid #1e1e1e;border-radius:100%;box-sizing:content-box;cursor:pointer;height:12px;margin:0;padding:0;pointer-events:auto;-ms-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;vertical-align:top;width:12px;z-index:20}.wc-block-components-price-slider__range-input::-ms-thumb:hover{background:#1e1e1e}.wc-block-components-price-slider__range-input:focus::-webkit-slider-thumb{background:#1e1e1e}.wc-block-components-price-slider__range-input:focus::-moz-range-thumb{background:#1e1e1e}.wc-block-components-price-slider__range-input:focus::-ms-thumb{background:#1e1e1e}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--min{z-index:21}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--min::-webkit-slider-thumb{background-position-x:left;margin-left:-2px}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--min::-moz-range-thumb{background-position-x:left;transform:translate(-2px,2px)}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--min::-ms-thumb{background-position-x:left}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--max{z-index:20}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--max::-webkit-slider-thumb{background-position-x:right;margin-left:2px}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--max::-moz-range-thumb{background-position-x:right;transform:translate(2px,2px)}.wc-block-components-price-slider__range-input.wc-block-components-price-slider__range-input--max::-ms-thumb{background-position-x:right}.rtl .wc-block-components-price-slider__range-input-progress{--track-background:linear-gradient(270deg,transparent var(--low),var(--range-color) 0,var(--range-color) var(--high),transparent 0) no-repeat 0 100%/100% 100%;--range-color:#af7dd1;background:var(--track-background)}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.wc-block-components-price-slider__range-input-wrapper{background:transparent;box-shadow:none;height:24px}.wc-block-components-price-slider__range-input-progress{background:#af7dd1;top:7px;width:100%}.wc-block-components-price-slider__range-input{height:24px;pointer-events:auto}.wc-block-components-price-slider__range-input::-ms-track{background:transparent;border-color:transparent;border-width:7px 0;color:transparent}.wc-block-components-price-slider__range-input::-ms-fill-lower{background:#e1e1e1;box-shadow:inset 0 0 0 1px #b8b8b8}.wc-block-components-price-slider__range-input::-ms-fill-upper{background:transparent}.wc-block-components-price-slider__range-input::-ms-tooltip{display:none}.wc-block-components-price-slider__range-input::-ms-thumb{pointer-events:auto;transform:translate(1px)}.wc-block-components-price-slider__range-input--max::-ms-fill-upper{background:#e1e1e1;box-shadow:inset 0 0 0 1px #b8b8b8}.wc-block-components-price-slider__range-input--max::-ms-fill-lower{background:transparent}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper>*{visibility:hidden}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}}@media screen and (-ms-high-contrast:active)and (prefers-reduced-motion:reduce),screen and (-ms-high-contrast:none)and (prefers-reduced-motion:reduce){.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}@supports(-ms-ime-align:auto){.wc-block-components-price-slider__range-input-wrapper{background:transparent;box-shadow:none;height:24px}.wc-block-components-price-slider__range-input-progress{background:#af7dd1;top:7px;width:100%}.wc-block-components-price-slider__range-input{height:24px;pointer-events:auto}.wc-block-components-price-slider__range-input::-ms-track{background:transparent;border-color:transparent;border-width:7px 0;color:transparent}.wc-block-components-price-slider__range-input::-ms-fill-lower{background:#e1e1e1;box-shadow:inset 0 0 0 1px #b8b8b8}.wc-block-components-price-slider__range-input::-ms-fill-upper{background:transparent}.wc-block-components-price-slider__range-input::-ms-tooltip{display:none}.wc-block-components-price-slider__range-input::-ms-thumb{pointer-events:auto;transform:translate(1px)}.wc-block-components-price-slider__range-input--max::-ms-fill-upper{background:#e1e1e1;box-shadow:inset 0 0 0 1px #b8b8b8}.wc-block-components-price-slider__range-input--max::-ms-fill-lower{background:transparent}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper>*{visibility:hidden}.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-price-slider.is-loading.is-disabled .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}.wc-block-components-price-slider.is-disabled:not(.is-loading) .wc-block-components-price-slider__range-input-wrapper{-webkit-animation:none;animation:none}}.theme-twentytwentyone .wc-block-components-price-slider__range-input-wrapper{background:transparent;border:3px solid;box-sizing:border-box}.theme-twentytwentyone .wc-block-components-price-slider__range-input-progress{--range-color:currentColor;margin:-3px}.theme-twentytwentyone .wc-block-price-filter__range-input{background:transparent;margin:-3px;width:calc(100% + 6px)}.theme-twentytwentyone .wc-block-price-filter__range-input:focus::-webkit-slider-thumb,.theme-twentytwentyone .wc-block-price-filter__range-input:hover::-webkit-slider-thumb{filter:none}.theme-twentytwentyone .wc-block-price-filter__range-input:focus::-moz-range-thumb,.theme-twentytwentyone .wc-block-price-filter__range-input:hover::-moz-range-thumb{filter:none}.theme-twentytwentyone .wc-block-price-filter__range-input:focus::-ms-thumb,.theme-twentytwentyone .wc-block-price-filter__range-input:hover::-ms-thumb{filter:none}.theme-twentytwentyone .wc-block-price-filter__range-input::-webkit-slider-thumb{margin-top:-9px}.theme-twentytwentyone .wc-block-price-filter__range-input.wc-block-components-price-slider__range-input--max::-moz-range-thumb{transform:translate(2px,1px)}.theme-twentytwentyone .wc-block-price-filter__range-input.wc-block-components-price-slider__range-input--min::-moz-range-thumb{transform:translate(-2px,1px)}.theme-twentytwentyone .wc-block-price-filter__range-input::-ms-track{border-color:transparent!important}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.theme-twentytwentyone .wc-block-components-price-slider__range-input-wrapper{border:0;height:auto;height:50px;position:relative}.theme-twentytwentyone .wc-block-components-price-slider__range-input-progress{display:none}.theme-twentytwentyone .wc-block-price-filter__range-input{height:100%;margin:0;width:100%}}.wc-block-components-product-sort-select{margin-bottom:24px;text-align:left}@-webkit-keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.wc-block-grid{text-align:center}.wc-block-grid__no-products{padding:40px;text-align:center;width:100%}.wc-block-grid__no-products .wc-block-grid__no-products-image{color:inherit;display:block;margin:0 auto 1em;max-width:150px}.wc-block-grid__no-products .wc-block-grid__no-products-title{display:block;font-weight:700;margin:0}.wc-block-grid__no-products .wc-block-grid__no-products-description{display:block;margin:.25em 0 1em}.wc-block-grid__products{background-clip:padding-box;display:flex;flex-wrap:wrap;margin:0 -8px 16px;padding:0}.wc-block-grid__product{border-bottom:16px solid transparent;border-left:8px solid transparent;border-right:8px solid transparent;box-sizing:border-box;float:none;list-style:none;margin:0;padding:0;position:relative;text-align:center;width:auto}.wc-block-grid__product.wc-block-grid__product{box-sizing:border-box}.theme-twentytwenty .wc-block-grid.has-aligned-buttons .wc-block-grid__product,.wc-block-grid.has-aligned-buttons .wc-block-grid__product{display:flex;flex-direction:column}.theme-twentytwenty .wc-block-grid.has-aligned-buttons .wc-block-grid__product>:last-child,.wc-block-grid.has-aligned-buttons .wc-block-grid__product>:last-child{margin-bottom:0;margin-top:auto;padding-bottom:12px}.theme-twentytwenty .wc-block-grid.has-1-columns .wc-block-grid__product,.wc-block-grid.has-1-columns .wc-block-grid__product{flex:1 0 100%;max-width:100%}.theme-twentytwenty .wc-block-grid.has-2-columns .wc-block-grid__product,.wc-block-grid.has-2-columns .wc-block-grid__product{flex:1 0 50%;max-width:50%}.theme-twentytwenty .wc-block-grid.has-3-columns .wc-block-grid__product,.wc-block-grid.has-3-columns .wc-block-grid__product{flex:1 0 33.3333333333%;max-width:33.3333333333%}.theme-twentytwenty .wc-block-grid.has-4-columns .wc-block-grid__product,.wc-block-grid.has-4-columns .wc-block-grid__product{flex:1 0 25%;max-width:25%}.theme-twentytwenty .wc-block-grid.has-5-columns .wc-block-grid__product,.wc-block-grid.has-5-columns .wc-block-grid__product{flex:1 0 20%;max-width:20%}.theme-twentytwenty .wc-block-grid.has-6-columns .wc-block-grid__product,.wc-block-grid.has-6-columns .wc-block-grid__product{flex:1 0 16.6666666667%;max-width:16.6666666667%}.theme-twentytwenty .wc-block-grid.has-7-columns .wc-block-grid__product,.wc-block-grid.has-7-columns .wc-block-grid__product{flex:1 0 14.2857142857%;max-width:14.2857142857%}.theme-twentytwenty .wc-block-grid.has-8-columns .wc-block-grid__product,.wc-block-grid.has-8-columns .wc-block-grid__product{flex:1 0 12.5%;max-width:12.5%}.theme-twentytwenty .wc-block-grid.has-6-columns .wc-block-grid__product,.wc-block-grid.has-6-columns .wc-block-grid__product{font-size:.5em}.theme-twentytwenty .wc-block-grid.has-5-columns .wc-block-grid__product,.theme-twentytwenty .wc-block-grid.has-6-columns.alignfull .wc-block-grid__product,.wc-block-grid.has-5-columns .wc-block-grid__product,.wc-block-grid.has-6-columns.alignfull .wc-block-grid__product{font-size:.58em}.theme-twentytwenty .wc-block-grid.has-4-columns:not(.alignwide):not(.alignfull) .wc-block-grid__product,.theme-twentytwenty .wc-block-grid.has-5-columns.alignfull .wc-block-grid__product,.wc-block-grid.has-4-columns:not(.alignwide):not(.alignfull) .wc-block-grid__product,.wc-block-grid.has-5-columns.alignfull .wc-block-grid__product{font-size:.75em}.theme-twentytwenty .wc-block-grid.has-3-columns:not(.alignwide):not(.alignfull),.wc-block-grid.has-3-columns:not(.alignwide):not(.alignfull){font-size:.92em}@media(max-width:480px){.wc-block-grid.has-2-columns .wc-block-grid__products{display:block}.wc-block-grid.has-2-columns .wc-block-grid__product{flex:1 0 100%;margin-left:auto;margin-right:auto;max-width:100%;padding:0}.wc-block-grid.has-3-columns .wc-block-grid__products{display:block}.wc-block-grid.has-3-columns .wc-block-grid__product{flex:1 0 100%;margin-left:auto;margin-right:auto;max-width:100%;padding:0}.wc-block-grid.has-4-columns .wc-block-grid__products{display:block}.wc-block-grid.has-4-columns .wc-block-grid__product{flex:1 0 100%;margin-left:auto;margin-right:auto;max-width:100%;padding:0}.wc-block-grid.has-5-columns .wc-block-grid__products{display:block}.wc-block-grid.has-5-columns .wc-block-grid__product{flex:1 0 100%;margin-left:auto;margin-right:auto;max-width:100%;padding:0}.wc-block-grid.has-6-columns .wc-block-grid__products{display:block}.wc-block-grid.has-6-columns .wc-block-grid__product{flex:1 0 100%;margin-left:auto;margin-right:auto;max-width:100%;padding:0}.wc-block-grid.has-7-columns .wc-block-grid__products{display:block}.wc-block-grid.has-7-columns .wc-block-grid__product{flex:1 0 100%;margin-left:auto;margin-right:auto;max-width:100%;padding:0}.wc-block-grid.has-8-columns .wc-block-grid__products{display:block}.wc-block-grid.has-8-columns .wc-block-grid__product{flex:1 0 100%;margin-left:auto;margin-right:auto;max-width:100%;padding:0}}@media(min-width:481px)and (max-width:600px){.wc-block-grid.has-2-columns .wc-block-grid__product{flex:1 0 50%;margin:0 0 24px;max-width:50%;padding:0}.wc-block-grid.has-2-columns .wc-block-grid__product:nth-child(odd){padding-right:8px}.wc-block-grid.has-2-columns .wc-block-grid__product:nth-child(2n){padding-left:8px}.wc-block-grid.has-3-columns .wc-block-grid__product{flex:1 0 50%;margin:0 0 24px;max-width:50%;padding:0}.wc-block-grid.has-3-columns .wc-block-grid__product:nth-child(odd){padding-right:8px}.wc-block-grid.has-3-columns .wc-block-grid__product:nth-child(2n){padding-left:8px}.wc-block-grid.has-4-columns .wc-block-grid__product{flex:1 0 50%;margin:0 0 24px;max-width:50%;padding:0}.wc-block-grid.has-4-columns .wc-block-grid__product:nth-child(odd){padding-right:8px}.wc-block-grid.has-4-columns .wc-block-grid__product:nth-child(2n){padding-left:8px}.wc-block-grid.has-5-columns .wc-block-grid__product{flex:1 0 50%;margin:0 0 24px;max-width:50%;padding:0}.wc-block-grid.has-5-columns .wc-block-grid__product:nth-child(odd){padding-right:8px}.wc-block-grid.has-5-columns .wc-block-grid__product:nth-child(2n){padding-left:8px}.wc-block-grid.has-6-columns .wc-block-grid__product{flex:1 0 50%;margin:0 0 24px;max-width:50%;padding:0}.wc-block-grid.has-6-columns .wc-block-grid__product:nth-child(odd){padding-right:8px}.wc-block-grid.has-6-columns .wc-block-grid__product:nth-child(2n){padding-left:8px}.wc-block-grid.has-7-columns .wc-block-grid__product{flex:1 0 50%;margin:0 0 24px;max-width:50%;padding:0}.wc-block-grid.has-7-columns .wc-block-grid__product:nth-child(odd){padding-right:8px}.wc-block-grid.has-7-columns .wc-block-grid__product:nth-child(2n){padding-left:8px}.wc-block-grid.has-8-columns .wc-block-grid__product{flex:1 0 50%;margin:0 0 24px;max-width:50%;padding:0}.wc-block-grid.has-8-columns .wc-block-grid__product:nth-child(odd){padding-right:8px}.wc-block-grid.has-8-columns .wc-block-grid__product:nth-child(2n){padding-left:8px}}.wc-block-components-product-name{font-size:1em;overflow-wrap:anywhere;word-break:break-word;-ms-word-break:break-all}.wc-block-components-product-price--align-left{display:block;text-align:left}.wc-block-components-product-price--align-center{display:block;text-align:center}.wc-block-components-product-price--align-right{display:block;text-align:right}.wc-block-components-product-price__value.is-discounted{margin-left:.5em}.is-loading .wc-block-components-product-price:before{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;content:".";display:block;display:inline-block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;width:5em;z-index:1}.is-loading .wc-block-components-product-price:before>*{visibility:hidden}.is-loading .wc-block-components-product-price:before:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-product-price:before{-webkit-animation:none;animation:none}}.wc-block-components-quantity-selector{border-radius:4px;box-sizing:content-box;display:flex;margin:0 0 .25em;position:relative;width:107px}.wc-block-components-quantity-selector:after{border:1px solid;border-radius:4px;bottom:0;content:"";left:0;opacity:.45;pointer-events:none;position:absolute;right:0;top:0}.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;background:transparent;border:0;box-shadow:none;color:currentColor;flex:1 1 auto;font-size:1em;font-weight:600;line-height:1;margin:0;min-width:40px;order:2;padding:.4em 0;text-align:center;vertical-align:middle}.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input:focus{box-shadow:inset 0 0 1px 1px currentColor;outline:none}.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input:disabled{opacity:.6}.wc-block-components-quantity-selector input::-webkit-inner-spin-button,.wc-block-components-quantity-selector input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button{background:none transparent;border:0;box-shadow:none;color:currentColor;cursor:pointer;font-size:.9em;font-style:normal;font-weight:400;margin:0;min-width:30px;opacity:.6;padding:0;text-align:center;text-decoration:none}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus{box-shadow:inset 0 0 1px 1px currentColor;outline:none}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus,.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover{opacity:1}.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:disabled{box-shadow:none;cursor:default;opacity:.6}.wc-block-components-quantity-selector>.wc-block-components-quantity-selector__button--minus{border-radius:4px 0 0 4px;order:1}.wc-block-components-quantity-selector>.wc-block-components-quantity-selector__button--plus{border-radius:0 4px 4px 0;order:3}.theme-twentyseventeen .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus,.theme-twentyseventeen .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover{background:none transparent}.wc-block-components-radio-control__option{color:inherit;display:block;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:1em 0;padding:0 0 0 2.5em;position:relative;text-decoration:inherit;text-transform:inherit}.wc-block-components-radio-control__option:first-child{margin-top:0}.wc-block-components-radio-control__option:last-child{margin-bottom:0}.wc-block-components-radio-control__option-layout{display:table;width:100%}.wc-block-components-radio-control__option .wc-block-components-radio-control__option-layout:after{display:none}.wc-block-components-radio-control__description-group,.wc-block-components-radio-control__label-group{display:table-row}.wc-block-components-radio-control__description-group>span,.wc-block-components-radio-control__label-group>span{display:table-cell}.wc-block-components-radio-control__description-group .wc-block-components-radio-control__secondary-description,.wc-block-components-radio-control__description-group .wc-block-components-radio-control__secondary-label,.wc-block-components-radio-control__label-group .wc-block-components-radio-control__secondary-description,.wc-block-components-radio-control__label-group .wc-block-components-radio-control__secondary-label{min-width:50%;text-align:right}.wc-block-components-radio-control__label,.wc-block-components-radio-control__secondary-label{line-height:max(1.5rem,24px)}.wc-block-components-radio-control__description,.wc-block-components-radio-control__secondary-description{font-size:.875em;line-height:20px}.wc-block-components-radio-control .wc-block-components-radio-control__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;border:2px solid #50575e;border-radius:50%;display:inline-block;height:1.5em;left:0;min-height:24px;min-width:24px;position:absolute;top:50%;transform:translateY(-50%);width:1.5em}.wc-block-components-radio-control .wc-block-components-radio-control__input:checked:before{background:#000;border-radius:50%;content:"";display:block;height:.75em;left:50%;margin:0;min-height:12px;min-width:12px;position:absolute;top:50%;transform:translate(-50%,-50%);width:.75em}.has-dark-controls .wc-block-components-radio-control .wc-block-components-radio-control__input{background-color:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.6)}.has-dark-controls .wc-block-components-radio-control .wc-block-components-radio-control__input:checked:before{background:#fff}.theme-twentytwentyone .wc-block-components-radio-control .wc-block-components-radio-control__input:checked{border-width:2px}.theme-twentytwentyone .wc-block-components-radio-control .wc-block-components-radio-control__input:checked:before{background-color:var(--form--color-text)}.theme-twentytwentyone .wc-block-components-radio-control .wc-block-components-radio-control__input:after{display:none}.is-loading .wc-block-components-review-list-item__text{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;width:60%;z-index:1}.is-loading .wc-block-components-review-list-item__text>*{visibility:hidden}.is-loading .wc-block-components-review-list-item__text:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-review-list-item__text{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-review-list-item__text:before{content:" "}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image>*{visibility:hidden}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__image:before{content:" "}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;font-size:1em;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;width:80px;z-index:1}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author>*{visibility:hidden}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__author:before{content:" "}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__product,.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__meta .wc-block-components-review-list-item__rating .wc-block-components-review-list-item__rating__stars>span{display:none}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;height:1em;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;width:120px;z-index:1}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date>*{visibility:hidden}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date{-webkit-animation:none;animation:none}}.is-loading .wc-block-components-review-list-item__info .wc-block-components-review-list-item__published-date:before{content:" "}.editor-styles-wrapper .wc-block-components-review-list-item__item,.wc-block-components-review-list-item__item{list-style:none;margin:0 0 48px}.wc-block-components-review-list-item__info{-ms-grid-columns:1fr;display:-ms-grid;display:grid;grid-template-columns:1fr;margin-bottom:24px}.wc-block-components-review-list-item__meta{-ms-grid-column:1;grid-column:1;-ms-grid-row:1;grid-row:1}.wc-block-components-review-list-item__item--has-image .wc-block-components-review-list-item__info{-ms-grid-columns:calc(3em + 16px) 1fr;grid-template-columns:calc(3em + 16px) 1fr}.wc-block-components-review-list-item__item--has-image .wc-block-components-review-list-item__meta{-ms-grid-column:2;grid-column:2}.wc-block-components-review-list-item__image{-ms-grid-row-span:2;align-items:center;display:flex;-ms-grid-column:1;grid-column:1;-ms-grid-row:1;grid-row:1/3;height:3em;justify-content:center;position:relative;width:3em}.wc-block-components-review-list-item__image>img{display:block;max-height:100%;-o-object-fit:contain;object-fit:contain}.wc-block-components-review-list-item__verified{bottom:-7px;height:21px;line-height:21px;margin:0;overflow:hidden;position:absolute;right:-7px;text-indent:21px;width:21px}.wc-block-components-review-list-item__verified:before{background:transparent url('data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="21" height="21" fill="none"%3E%3Ccircle cx="10.5" cy="10.5" r="10.5" fill="%23fff"/%3E%3Cpath fill="%23008A21" fill-rule="evenodd" d="M2.1667 10.5003c0-4.6 3.7333-8.3333 8.3333-8.3333s8.3334 3.7333 8.3334 8.3333S15.1 18.8337 10.5 18.8337s-8.3333-3.7334-8.3333-8.3334zm2.5 0l4.1666 4.1667 7.5001-7.5-1.175-1.1833-6.325 6.325-2.9917-2.9834-1.175 1.175z" clip-rule="evenodd"/%3E%3Cmask id="a" width="17" height="17" x="2" y="2" maskUnits="userSpaceOnUse"%3E%3Cpath fill="%23fff" fill-rule="evenodd" d="M2.1667 10.5003c0-4.6 3.7333-8.3333 8.3333-8.3333s8.3334 3.7333 8.3334 8.3333S15.1 18.8337 10.5 18.8337s-8.3333-3.7334-8.3333-8.3334zm2.5 0l4.1666 4.1667 7.5001-7.5-1.175-1.1833-6.325 6.325-2.9917-2.9834-1.175 1.175z" clip-rule="evenodd"/%3E%3C/mask%3E%3Cg mask="url(%23a)"%3E%3Cpath fill="%23008A21" d="M.5.5h20v20H.5z"/%3E%3C/g%3E%3C/svg%3E') 50% no-repeat;content:"";display:block;height:21px;width:21px}.wc-block-components-review-list-item__meta{align-items:center;display:flex;flex-flow:row wrap}.wc-block-components-review-list-item__meta:after{content:"";flex-basis:100%;order:3}.wc-block-components-review-list-item__author,.wc-block-components-review-list-item__product{display:block;font-weight:700;margin-right:8px;order:1}.wc-block-components-review-list-item__product+.wc-block-components-review-list-item__author{font-weight:400;order:4}.wc-block-components-review-list-item__published-date{order:5}.wc-block-components-review-list-item__product+.wc-block-components-review-list-item__author+.wc-block-components-review-list-item__published-date{padding-left:8px;position:relative}.wc-block-components-review-list-item__product+.wc-block-components-review-list-item__author+.wc-block-components-review-list-item__published-date:before{border-right:1px solid;content:"";display:inline-block;height:1em;margin-left:-8px;opacity:.5;position:absolute;top:calc(50% + .1em);transform:translateY(-50%);vertical-align:middle}.wc-block-components-review-list-item__author:first-child+.wc-block-components-review-list-item__published-date:before,.wc-block-components-review-list-item__rating+.wc-block-components-review-list-item__author+.wc-block-components-review-list-item__published-date:before{display:none}.wc-block-components-review-list-item__rating{order:2}.wc-block-components-review-list-item__rating>.wc-block-components-review-list-item__rating__stars{display:block;font-family:star;font-size:1em;font-weight:400;height:1em;line-height:1;overflow:hidden;position:relative;top:0;width:5.3em}.wc-block-components-review-list-item__rating>.wc-block-components-review-list-item__rating__stars:before{content:"SSSSS";float:left;left:0;opacity:.25;position:absolute;top:0}.wc-block-components-review-list-item__rating>.wc-block-components-review-list-item__rating__stars span{float:left;left:0;overflow:hidden;padding-top:1.5em;position:absolute;top:0}.wc-block-components-review-list-item__rating>.wc-block-components-review-list-item__rating__stars span:before{color:#e6a237;content:"SSSSS";left:0;position:absolute;top:0}.wc-block-components-review-list-item__text p{font-size:inherit}.wc-block-components-review-list.wc-block-components-review-list{margin:0}.wc-block-components-review-sort-select{text-align:right}.wc-block-components-sidebar-layout{display:flex;flex-wrap:wrap;margin:0 auto 16px;position:relative}.wc-block-components-sidebar-layout .wc-block-components-main{box-sizing:border-box;margin:0;padding-right:3.7735849057%;width:65%}.wc-block-components-sidebar{box-sizing:border-box;margin:0;padding-left:2.2641509434%;width:35%}.wc-block-components-sidebar .wc-block-components-panel>h2{border:0;border-radius:0;font-size:1em;margin:0;padding:0;vertical-align:baseline}.is-medium.wc-block-components-sidebar-layout,.is-mobile.wc-block-components-sidebar-layout,.is-small.wc-block-components-sidebar-layout{flex-direction:column;margin:0 auto 16px}.is-medium.wc-block-components-sidebar-layout .wc-block-components-main,.is-medium.wc-block-components-sidebar-layout .wc-block-components-sidebar,.is-mobile.wc-block-components-sidebar-layout .wc-block-components-main,.is-mobile.wc-block-components-sidebar-layout .wc-block-components-sidebar,.is-small.wc-block-components-sidebar-layout .wc-block-components-main,.is-small.wc-block-components-sidebar-layout .wc-block-components-sidebar{padding:0;width:100%}.is-large .wc-block-components-sidebar .wc-block-components-panel,.is-large .wc-block-components-sidebar .wc-block-components-totals-item{padding-left:16px;padding-right:16px}.is-large .wc-block-components-sidebar .wc-block-components-panel .wc-block-components-totals-item{padding:0}.wc-block-components-sidebar .wc-block-components-panel>h2{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit}.wc-block-components-sidebar .wc-block-components-panel>h2 .wc-block-components-panel__button{font-weight:400}.theme-twentytwenty .wc-block-components-sidebar .wc-block-components-panel>h2{border:0;border-radius:0;font-size:1.25em;margin:0;padding:0;vertical-align:baseline}.wc-block-components-sort-select{margin-bottom:12px}.wc-block-components-sort-select__label{display:inline-block;font-weight:400;margin-right:12px}.wc-block-components-sort-select__select{font-size:inherit;width:-webkit-max-content;width:-moz-max-content;width:max-content}.wc-block-components-spinner{box-sizing:content-box;color:inherit;font-size:1.25em;height:100%;position:absolute;text-align:center;width:100%}.wc-block-components-spinner:after{-webkit-animation:spinner__animation 1s linear infinite;animation:spinner__animation 1s linear infinite;-webkit-backface-visibility:hidden;backface-visibility:hidden;border:.2em solid;border-left:.2em solid transparent;border-radius:50%;box-sizing:border-box;content:" ";height:1em;left:50%;margin:-.5em 0 0 -.5em;position:absolute;top:50%;transform:translateZ(0) scale(.5);transform-origin:50% 50%;width:1em}.wc-block-components-state-input{margin-top:1.5em}.wc-block-components-tabs .wc-block-components-tabs__list{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item{background:transparent;border:none;border-radius:0;box-shadow:inset 0 -1px currentColor;color:inherit;flex:auto;outline-offset:-1px;padding:12px 16px;text-align:center;transition:box-shadow .1s linear}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item.is-active{box-shadow:inset 0 -3px currentColor;font-weight:600;position:relative}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item:focus{outline:1px dotted currentColor;outline-offset:-1px}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item:active,.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item:hover{background:transparent}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content{display:inline-block;font-size:1em;font-weight:700;line-height:1;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content>img,.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content>svg{height:1.2em;margin:.2em 0 -.2em;vertical-align:middle}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content .wc-block-components-payment-method-icons{margin:.2em 0 -.2em}.wc-block-components-tabs .wc-block-components-tabs__list>.wc-block-components-tabs__item .wc-block-components-tabs__item-content .wc-block-components-payment-method-icons .wc-block-components-payment-method-icon{height:1.2em;vertical-align:middle}.wc-block-components-tabs .wc-block-components-tabs__content{padding:16px 0;text-transform:none}.wc-block-components-form .wc-block-components-text-input,.wc-block-components-text-input{margin-top:1.5em;position:relative;white-space:nowrap}.wc-block-components-form .wc-block-components-text-input label,.wc-block-components-text-input label{color:inherit;color:#757575;cursor:text;font-family:inherit;font-size:inherit;font-size:1em;font-style:inherit;font-weight:inherit;left:0;letter-spacing:inherit;line-height:inherit;line-height:1.375;margin:0 0 0 17px;max-width:calc(100% - 32px);overflow:hidden;position:absolute;text-decoration:inherit;text-overflow:ellipsis;text-transform:inherit;top:0;transform:translateY(.75em);transform-origin:top left;transition:transform .2s ease}.has-dark-controls .wc-block-components-form .wc-block-components-text-input label,.has-dark-controls .wc-block-components-text-input label{color:hsla(0,0%,100%,.6)}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-form .wc-block-components-text-input label,.wc-block-components-text-input label{transition:none}}.wc-block-components-form .wc-block-components-text-input input:-webkit-autofill+label,.wc-block-components-text-input input:-webkit-autofill+label{transform:translateY(4px) scale(.75)}.wc-block-components-form .wc-block-components-text-input.is-active label,.wc-block-components-text-input.is-active label{transform:translateY(4px) scale(.75)}.wc-block-components-form .wc-block-components-text-input input[type=email],.wc-block-components-form .wc-block-components-text-input input[type=number],.wc-block-components-form .wc-block-components-text-input input[type=tel],.wc-block-components-form .wc-block-components-text-input input[type=text],.wc-block-components-form .wc-block-components-text-input input[type=url],.wc-block-components-text-input input[type=email],.wc-block-components-text-input input[type=number],.wc-block-components-text-input input[type=tel],.wc-block-components-text-input input[type=text],.wc-block-components-text-input input[type=url]{background-color:#fff;border:1px solid #50575e;border-radius:4px;box-sizing:border-box;color:#2b2d2f;font-family:inherit;font-size:1em;height:3em;line-height:1.375;margin:0;min-height:0;padding:.75em 0;text-indent:16px;width:100%}.wc-block-components-form .wc-block-components-text-input input[type=email]:focus,.wc-block-components-form .wc-block-components-text-input input[type=number]:focus,.wc-block-components-form .wc-block-components-text-input input[type=tel]:focus,.wc-block-components-form .wc-block-components-text-input input[type=text]:focus,.wc-block-components-form .wc-block-components-text-input input[type=url]:focus,.wc-block-components-text-input input[type=email]:focus,.wc-block-components-text-input input[type=number]:focus,.wc-block-components-text-input input[type=tel]:focus,.wc-block-components-text-input input[type=text]:focus,.wc-block-components-text-input input[type=url]:focus{background-color:#fff;box-shadow:0 0 0 1px #50575e;color:#2b2d2f;outline:0}.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=email],.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=number],.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=tel],.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=text],.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=url],.has-dark-controls .wc-block-components-text-input input[type=email],.has-dark-controls .wc-block-components-text-input input[type=number],.has-dark-controls .wc-block-components-text-input input[type=tel],.has-dark-controls .wc-block-components-text-input input[type=text],.has-dark-controls .wc-block-components-text-input input[type=url]{background-color:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.4);color:#fff}.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=email]:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=number]:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=tel]:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=text]:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input input[type=url]:focus,.has-dark-controls .wc-block-components-text-input input[type=email]:focus,.has-dark-controls .wc-block-components-text-input input[type=number]:focus,.has-dark-controls .wc-block-components-text-input input[type=tel]:focus,.has-dark-controls .wc-block-components-text-input input[type=text]:focus,.has-dark-controls .wc-block-components-text-input input[type=url]:focus{background-color:rgba(0,0,0,.1);box-shadow:0 0 0 1px hsla(0,0%,100%,.4);color:#fff}.wc-block-components-form .wc-block-components-text-input input[type=number],.wc-block-components-text-input input[type=number]{-moz-appearance:textfield}.wc-block-components-form .wc-block-components-text-input input[type=number]::-webkit-inner-spin-button,.wc-block-components-form .wc-block-components-text-input input[type=number]::-webkit-outer-spin-button,.wc-block-components-text-input input[type=number]::-webkit-inner-spin-button,.wc-block-components-text-input input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.wc-block-components-form .wc-block-components-text-input.is-active input[type=email],.wc-block-components-form .wc-block-components-text-input.is-active input[type=number],.wc-block-components-form .wc-block-components-text-input.is-active input[type=tel],.wc-block-components-form .wc-block-components-text-input.is-active input[type=text],.wc-block-components-form .wc-block-components-text-input.is-active input[type=url],.wc-block-components-text-input.is-active input[type=email],.wc-block-components-text-input.is-active input[type=number],.wc-block-components-text-input.is-active input[type=tel],.wc-block-components-text-input.is-active input[type=text],.wc-block-components-text-input.is-active input[type=url]{padding:1.5em 0 .25em}.wc-block-components-form .wc-block-components-text-input.has-error input,.wc-block-components-form .wc-block-components-text-input.has-error input:active,.wc-block-components-form .wc-block-components-text-input.has-error input:focus,.wc-block-components-form .wc-block-components-text-input.has-error input:hover,.wc-block-components-text-input.has-error input,.wc-block-components-text-input.has-error input:active,.wc-block-components-text-input.has-error input:focus,.wc-block-components-text-input.has-error input:hover{border-color:#cc1818}.wc-block-components-form .wc-block-components-text-input.has-error input:focus,.wc-block-components-text-input.has-error input:focus{box-shadow:0 0 0 1px #cc1818}.has-dark-controls .wc-block-components-form .wc-block-components-text-input.has-error input,.has-dark-controls .wc-block-components-form .wc-block-components-text-input.has-error input:active,.has-dark-controls .wc-block-components-form .wc-block-components-text-input.has-error input:focus,.has-dark-controls .wc-block-components-form .wc-block-components-text-input.has-error input:hover,.has-dark-controls .wc-block-components-text-input.has-error input,.has-dark-controls .wc-block-components-text-input.has-error input:active,.has-dark-controls .wc-block-components-text-input.has-error input:focus,.has-dark-controls .wc-block-components-text-input.has-error input:hover{border-color:#f18c8c}.has-dark-controls .wc-block-components-form .wc-block-components-text-input.has-error input:focus,.has-dark-controls .wc-block-components-text-input.has-error input:focus{box-shadow:0 0 0 1px #f18c8c}.wc-block-components-form .wc-block-components-text-input.has-error label,.wc-block-components-text-input.has-error label{color:#cc1818}.has-dark-controls .wc-block-components-form .wc-block-components-text-input.has-error label,.has-dark-controls .wc-block-components-text-input.has-error label{color:#f18c8c}.wc-block-components-form .wc-block-components-text-input:only-child,.wc-block-components-text-input:only-child{margin-top:1.5em}.wc-block-components-textarea{background-color:#fff;border:1px solid #50575e;border-radius:4px;color:#2b2d2f;font-family:inherit;font-size:1em;line-height:1.375;margin:0;padding:.75em 16px;width:100%}.has-dark-controls .wc-block-components-textarea{background-color:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.4);color:#fff}.has-dark-controls .wc-block-components-textarea::-moz-placeholder{color:hsla(0,0%,100%,.6)}.has-dark-controls .wc-block-components-textarea:-ms-input-placeholder{color:hsla(0,0%,100%,.6)}.has-dark-controls .wc-block-components-textarea::placeholder{color:hsla(0,0%,100%,.6)}.theme-twentytwentyone .has-dark-controls .wc-block-components-textarea{background-color:rgba(0,0,0,.1);color:#fff}.theme-twentytwenty .wc-block-components-title.wc-block-components-title,.wc-block-components-title.wc-block-components-title{border:0;border-radius:0;font-size:1.25em;margin:0;padding:0;vertical-align:baseline;word-break:break-word}.wc-block-components-notices{display:block;margin-bottom:2em}.wc-block-components-notices .wc-block-components-notices__notice{display:flex;flex-wrap:nowrap;margin:0}.wc-block-components-notices .wc-block-components-notices__notice .components-notice__dismiss{background:transparent none;border:0;color:currentColor;margin:0 0 0 auto;outline:0;padding:0}.wc-block-components-notices .wc-block-components-notices__notice .components-notice__dismiss svg{fill:currentColor;vertical-align:text-top}.wc-block-components-notices .wc-block-components-notices__notice+.wc-block-components-notices__notice{margin-top:1em}.theme-twentytwenty .wc-block-components-notices__notice,.theme-twentytwentyone .wc-block-components-notices__notice{padding:1.5rem 3rem}.wc-block-components-notices__snackbar{bottom:20px;left:16px;position:fixed;width:auto}@media(max-width:782px){.wc-block-components-notices__snackbar{bottom:auto;left:0;position:fixed;top:10px}.wc-block-components-notices__snackbar .components-snackbar-list__notice-container{margin-left:10px;margin-right:10px}}.wc-block-components-validation-error{color:#cc1818;font-size:.75em;max-width:100%;white-space:normal}.wc-block-components-validation-error>p{margin:0;padding:4px 0 0}.has-dark-mode-palette .wc-block-components-validation-error{color:#f18c8c}.wc-block-components-select+.wc-block-components-validation-error{margin-bottom:24px}.with-scroll-to-top__scroll-point{position:relative;top:-36px}.wc-block-components-express-payment{margin:auto;position:relative}.wc-block-components-express-payment .wc-block-components-express-payment__event-buttons{display:flex;flex-direction:row;flex-wrap:wrap;list-style:none;margin:0;overflow:hidden;padding:0;text-align:center;width:100%}.wc-block-components-express-payment .wc-block-components-express-payment__event-buttons>li{margin:0}.wc-block-components-express-payment .wc-block-components-express-payment__event-buttons>li>img{height:48px;width:100%}.wc-block-components-express-payment--checkout{margin-top:5px}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__title-container{display:flex;flex-direction:row;left:0;position:absolute;right:0;top:-5px;vertical-align:middle}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__title-container:before{border-left:1px solid;border-radius:5px 0 0 0;border-top:1px solid;content:"";display:block;height:4px;margin-right:12px;opacity:.3;pointer-events:none;width:10px}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__title-container:after{border-radius:0 5px 0 0;border-right:1px solid;border-top:1px solid;content:"";display:block;flex-grow:1;height:4px;margin-left:12px;opacity:.3;pointer-events:none}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__title{flex-grow:0;transform:translateY(-50%)}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__content{padding:1.5em 23px;position:relative}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__content:after{border-radius:0 0 5px 5px;border-style:solid;border-width:0 1px 1px;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__content>p{margin-bottom:1em}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__event-buttons>li{display:inline-block;width:50%}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__event-buttons>li:only-child{display:block;width:100%}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__event-buttons>li:nth-child(2n){padding-left:8px}.wc-block-components-express-payment--checkout .wc-block-components-express-payment__event-buttons>li:nth-child(odd){padding-right:8px}.wc-block-components-express-payment--cart .wc-block-components-express-payment__event-buttons>li{padding-bottom:16px;text-align:center;width:100%}.wc-block-components-express-payment--cart .wc-block-components-express-payment__event-buttons>li:last-child{padding-bottom:0}.wc-block-components-express-payment-continue-rule{align-items:center;display:flex;margin:24px 0;padding:0 24px;text-align:center}.wc-block-components-express-payment-continue-rule:before{margin-right:10px}.wc-block-components-express-payment-continue-rule:after{margin-left:10px}.wc-block-components-express-payment-continue-rule:after,.wc-block-components-express-payment-continue-rule:before{border-bottom:1px solid;content:" ";flex:1;opacity:.3}.wc-block-components-express-payment-continue-rule--cart{margin:16px 0;text-transform:uppercase}.theme-twentynineteen .wc-block-components-express-payment__title:before{display:none}.theme-twentytwenty .wc-block-components-express-payment .wc-block-components-express-payment__title{padding-left:12px;padding-right:12px}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder{margin-bottom:16px}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder *{pointer-events:all}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder .components-placeholder__fieldset{display:block}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder .components-placeholder__fieldset .components-button{background-color:#1e1e1e;color:#fff}.components-placeholder.wc-block-checkout__no-payment-methods-placeholder .components-placeholder__fieldset .wc-block-checkout__no-payment-methods-placeholder-description{display:block;margin:.25em 0 1em}.components-notice.wc-block-checkout__no-payment-methods-notice{margin-bottom:16px}.wc-block-card-elements{display:flex;width:100%}.wc-block-card-elements .wc-block-components-validation-error{position:static}.wc-block-gateway-container{margin-bottom:1.5em;position:relative;white-space:nowrap}.wc-block-gateway-container.wc-card-number-element{flex-basis:15em;flex-grow:1;min-width:min(15em,60%)}.wc-block-gateway-container.wc-card-expiry-element{flex-basis:7em;margin-left:12px;min-width:min(7em,calc(24% - 12px))}.wc-block-gateway-container.wc-card-cvc-element{flex-basis:7em;margin-left:12px;min-width:min(5em,calc(16% - 12px))}.wc-block-gateway-container .wc-block-gateway-input{background-color:#fff;border:1px solid #50575e;border-radius:4px;box-sizing:border-box;color:#2b2d2f;cursor:text;font-family:inherit;font-size:1em;height:3em;line-height:1.375;margin:0;padding:.75em 0 .75em 16px;width:100%}.wc-block-gateway-container .wc-block-gateway-input:focus,.wc-block-gateway-container:focus{background-color:#fff}.wc-block-gateway-container label{color:inherit;color:#757575;cursor:text;font-family:inherit;font-size:inherit;font-size:1em;font-style:inherit;font-weight:inherit;left:0;letter-spacing:inherit;line-height:inherit;line-height:1.375;margin:0 0 0 17px;max-width:calc(100% - 24px);overflow:hidden;position:absolute;text-decoration:inherit;text-overflow:ellipsis;text-transform:inherit;top:0;transform:translateY(.75em);transform-origin:top left;transition:transform .2s ease}@media screen and (prefers-reduced-motion:reduce){.wc-block-gateway-container label{transition:none}}.wc-block-gateway-container.wc-inline-card-element label{margin-left:calc(24px + 1.5em)}.wc-block-gateway-container.wc-inline-card-element .wc-block-gateway-input.focused.empty+label,.wc-block-gateway-container.wc-inline-card-element .wc-block-gateway-input:not(.empty)+label{margin-left:16px;transform:translateY(4px) scale(.75)}.wc-block-gateway-container.wc-inline-card-element+.wc-block-components-validation-error{margin-top:-24px;position:static}.wc-block-gateway-container .wc-block-gateway-input.focused.empty,.wc-block-gateway-container .wc-block-gateway-input:not(.empty){padding:1.5em 0 .25em 16px}.wc-block-gateway-container .wc-block-gateway-input.focused.empty+label,.wc-block-gateway-container .wc-block-gateway-input:not(.empty)+label{transform:translateY(4px) scale(.75)}.wc-block-gateway-container .wc-block-gateway-input.has-error{border-color:#cc1818}.wc-block-gateway-container .wc-block-gateway-input.has-error:focus{outline-color:#cc1818}.wc-block-gateway-container .wc-block-gateway-input.has-error+label{color:#cc1818}.is-large .wc-card-cvc-element .wc-block-components-validation-error>p,.is-large .wc-card-expiry-element .wc-block-components-validation-error>p,.is-medium .wc-card-cvc-element .wc-block-components-validation-error>p,.is-medium .wc-card-expiry-element .wc-block-components-validation-error>p{line-height:16px;padding-top:4px}.is-mobile .wc-card-cvc-element .wc-block-components-validation-error>p,.is-mobile .wc-card-expiry-element .wc-block-components-validation-error>p,.is-small .wc-card-cvc-element .wc-block-components-validation-error>p,.is-small .wc-card-expiry-element .wc-block-components-validation-error>p{min-height:28px}.wc-block-components-checkout-payment-methods *{pointer-events:all}.is-mobile .wc-block-card-elements,.is-small .wc-block-card-elements{flex-wrap:wrap}.is-mobile .wc-block-gateway-container.wc-card-number-element,.is-small .wc-block-gateway-container.wc-card-number-element{flex-basis:100%}.is-mobile .wc-block-gateway-container.wc-card-expiry-element,.is-small .wc-block-gateway-container.wc-card-expiry-element{flex-basis:calc(50% - 8px);margin-left:0;margin-right:8px}.is-mobile .wc-block-gateway-container.wc-card-cvc-element,.is-small .wc-block-gateway-container.wc-card-cvc-element{flex-basis:calc(50% - 8px);margin-left:8px}.wc-block-checkout__payment-method .wc-block-components-radio-control__option{padding-left:56px}.wc-block-checkout__payment-method .wc-block-components-radio-control__option:after{content:none}.wc-block-checkout__payment-method .wc-block-components-radio-control__option .wc-block-components-radio-control__input{left:16px}.wc-block-checkout__payment-method .wc-block-components-radio-control__option,.wc-block-checkout__payment-method .wc-block-components-radio-control__option:first-child,.wc-block-checkout__payment-method .wc-block-components-radio-control__option:last-child{margin:0;padding-bottom:1em;padding-top:1em}.wc-block-checkout__payment-method .wc-block-components-radio-control__option-checked{font-weight:700}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option,.wc-block-checkout__payment-method .wc-block-components-radio-control__option{position:relative}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:after,.wc-block-checkout__payment-method .wc-block-components-radio-control__option:after{border-style:solid;border-width:1px 1px 0;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option:last-child:after,.wc-block-checkout__payment-method .wc-block-components-radio-control__option:last-child:after{border-width:1px}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__option:after{border-width:0}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__label{align-items:center;display:flex;justify-content:flex-start}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__label img{height:24px;max-height:24px;-o-object-fit:contain;object-fit:contain;-o-object-position:left;object-position:left}.wc-block-checkout__payment-method .wc-block-components-radio-control.disable-radio-control .wc-block-components-radio-control__option{padding-left:16px}.wc-block-checkout__payment-method .wc-block-components-radio-control.disable-radio-control .wc-block-components-radio-control__input{display:none}.wc-block-checkout__payment-method .wc-block-components-checkout-step__description-payments-aligned{height:28px;padding-top:14px}.wc-block-components-radio-control-accordion-content{padding:0 16px 1em}.wc-block-components-radio-control-accordion-content:empty{display:none}.wc-block-checkout__order-notes .wc-block-components-checkout-step__content{padding-bottom:0}.is-medium .wc-block-cart__sidebar,.is-mobile .wc-block-cart__sidebar,.is-small .wc-block-cart__sidebar{margin-bottom:24px;order:0}.editor-styles-wrapper .wc-block-cart__empty-cart__title,.wc-block-cart__empty-cart__title{font-size:inherit}.wc-block-cart__submit{margin:0 0 16px;position:relative}.wc-block-cart__submit-button{box-sizing:border-box;margin:0;width:100%}.wc-block-cart .wc-block-cart__submit-container{padding:0}@media(min-width:783px){.wc-block-cart .wc-block-cart__submit-container--sticky{display:none}}@media(max-width:782px){.wc-block-cart .wc-block-cart__submit-container--sticky{background:#fff;bottom:0;left:0;padding:16px;position:fixed;width:100%;z-index:9999}.wc-block-cart .wc-block-cart__submit-container--sticky:before{box-shadow:0 -10px 20px 10px currentColor;color:hsla(0,0%,80%,.5);content:"";height:100%;left:0;position:absolute;right:0;top:0}}.wc-block-checkout-error{padding:40px;text-align:center;width:100%}.wc-block-checkout-error .wc-block-checkout-error__image{color:inherit;display:block;margin:0 auto 1em;max-width:150px}.wc-block-checkout-error .wc-block-checkout-error__title{display:block;font-weight:700;margin:0}.wc-block-checkout-error .wc-block-checkout-error__description{display:block;margin:.25em 0 1em}.wc-block-checkout-empty{padding:40px;text-align:center;width:100%}.wc-block-checkout-empty .wc-block-checkout-empty__image{color:inherit;display:block;margin:0 auto 1em;max-width:150px}.wc-block-checkout-empty .wc-block-checkout-empty__title{display:block;font-weight:700;margin:0}.wc-block-checkout-empty .wc-block-checkout-empty__description{display:block;margin:.25em 0 1em}.wc-block-checkout__actions{align-items:center;display:flex;justify-content:space-between}.wc-block-checkout__actions .wc-block-components-checkout-place-order-button{height:auto;padding:1em;width:50%}.wc-block-checkout__actions .wc-block-components-checkout-place-order-button .wc-block-components-button__text{line-height:24px}.wc-block-checkout__actions .wc-block-components-checkout-place-order-button .wc-block-components-button__text>svg{fill:#fff;vertical-align:top}.is-mobile .wc-block-checkout__actions .wc-block-components-checkout-return-to-cart-button{display:none}.is-mobile .wc-block-checkout__actions .wc-block-components-checkout-place-order-button{width:100%}.is-large .wc-block-checkout__actions{padding:1.5em 0;position:relative}.is-large .wc-block-checkout__actions:after{border-style:solid;border-width:1px 0 0;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-checkout__form{margin:0;max-width:100%}.is-medium .wc-block-checkout__main,.is-mobile .wc-block-checkout__main,.is-small .wc-block-checkout__main{order:1}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form{margin-left:-6px;margin-right:-6px}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form:after,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form:after,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form:after,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form:after,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form:after,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form:after{clear:both;content:"";display:block}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input{float:left;margin-left:6px;margin-right:6px;position:relative;width:calc(50% - 12px)}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2),.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-country-input:nth-of-type(2),.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-state-input:nth-of-type(2),.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:first-of-type,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-text-input:nth-of-type(2){margin-top:0}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-address-form__company,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_1,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__address_2,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-address-form__company{width:calc(100% - 12px)}.is-large .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-large .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-medium .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-medium .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-small .wc-block-checkout__billing-fields .wc-block-components-address-form .wc-block-components-checkbox,.is-small .wc-block-checkout__shipping-fields .wc-block-components-address-form .wc-block-components-checkbox{clear:both}.components-placeholder.wc-block-checkout__no-shipping-placeholder{margin-bottom:16px}.components-placeholder.wc-block-checkout__no-shipping-placeholder *{pointer-events:all}.components-placeholder.wc-block-checkout__no-shipping-placeholder .components-placeholder__fieldset{display:block}.components-placeholder.wc-block-checkout__no-shipping-placeholder .components-placeholder__fieldset .components-button{background-color:#1e1e1e;color:#fff}.components-placeholder.wc-block-checkout__no-shipping-placeholder .components-placeholder__fieldset .wc-block-checkout__no-shipping-placeholder-description{display:block;margin:.25em 0 1em}.wc-block-checkout__shipping-option .wc-block-components-radio-control__option{margin:0;padding:.75em 0 .75em 2.5em;position:relative}.wc-block-checkout__shipping-option .wc-block-components-radio-control__option:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-checkout__shipping-option .wc-block-components-shipping-rates-control__no-results-notice{margin:.75em 0}.wc-block-checkout__terms{margin:1.5em 0}.wc-block-checkout__terms textarea{position:relative;top:-5px}.wc-block-checkout__terms.wc-block-checkout__terms--disabled{opacity:.6}.wc-block-checkout__sidebar .wc-block-components-product-name{color:inherit;display:block;flex-basis:0;flex-grow:1}.wc-block-checkout__sidebar .wc-block-components-totals-footer-item{margin:0;padding:0}.is-medium .wc-block-checkout__sidebar,.is-mobile .wc-block-checkout__sidebar,.is-small .wc-block-checkout__sidebar{margin-bottom:24px;order:0}.wc-block-checkout__add-note{margin:1.5em 0}.is-medium .wc-block-checkout__add-note,.is-mobile .wc-block-checkout__add-note,.is-small .wc-block-checkout__add-note{margin-bottom:1em;margin-top:1em;padding:1em 0;position:relative}.is-medium .wc-block-checkout__add-note:after,.is-mobile .wc-block-checkout__add-note:after,.is-small .wc-block-checkout__add-note:after{border-style:solid;border-width:1px 0;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-checkout__add-note .wc-block-components-textarea{margin-top:16px}.wc-block-checkout__order-notes.wc-block-components-checkout-step{padding-left:0}.wp-block-woocommerce-checkout{margin:0}.wp-block-woocommerce-checkout .with-scroll-to-top__scroll-point{top:-96px}.wp-block-woocommerce-checkout.is-loading{display:flex;flex-wrap:wrap;margin:0 auto 16px;position:relative}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block{padding-left:2.2641509434%;width:35%}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block{padding-right:3.7735849057%;width:65%}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block{box-sizing:border-box;margin:0}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block>div,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block>div{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;display:none;line-height:1;margin:0 0 1.5em;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block>div>*,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block>div>*{visibility:hidden}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block>div:after,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block>div:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block>div,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block>div{-webkit-animation:none;animation:none}}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-contact-information-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-payment-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-contact-information-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-payment-block{display:block;min-height:10em}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-shipping-address-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-shipping-address-block{display:block;min-height:24em}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-actions-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-actions-block{display:block;margin-left:50%;min-height:4em;width:50%}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wp-block-woocommerce-checkout-order-summary-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wp-block-woocommerce-checkout-order-summary-block{display:block;min-height:47em}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wc-block-components-panel>h2,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel>h2{border:0;border-radius:0;color:inherit;font-family:inherit;font-size:1em;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-decoration:inherit;text-transform:inherit;vertical-align:baseline}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wc-block-components-panel>h2 .wc-block-components-panel__button,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel>h2 .wc-block-components-panel__button{font-weight:400}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wc-block-components-panel,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block .wc-block-components-totals-item,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-totals-item{padding-left:16px;padding-right:16px}@media only screen and (max-width:700px){.wp-block-woocommerce-checkout.is-loading{flex-direction:column;margin:0 auto 16px}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-fields-block,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block{padding:0;width:100%}.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel,.wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-totals-item{padding-left:0;padding-right:0}}.theme-twentytwenty .wp-block-woocommerce-checkout.is-loading .wp-block-woocommerce-checkout-totals-block .wc-block-components-panel>h2{border:0;border-radius:0;font-size:1.25em;margin:0;padding:0;vertical-align:baseline}.wp-block-woocommerce-featured-category{background-color:transparent;border-color:transparent;box-sizing:border-box;color:#fff}.wc-block-featured-category{align-content:center;align-items:center;background-color:inherit;background-position:50%;background-size:cover;display:flex;flex-wrap:wrap;justify-content:center;margin:0;overflow:hidden;position:relative;width:100%}.wc-block-featured-category.has-background-dim .background-dim__overlay:before{background:inherit;border-radius:inherit;bottom:0;content:"";left:0;opacity:.5;position:absolute;right:0;top:0;z-index:1}.wc-block-featured-category.has-background-dim-10 .background-dim__overlay:before{opacity:.1}.wc-block-featured-category.has-background-dim-20 .background-dim__overlay:before{opacity:.2}.wc-block-featured-category.has-background-dim-30 .background-dim__overlay:before{opacity:.3}.wc-block-featured-category.has-background-dim-40 .background-dim__overlay:before{opacity:.4}.wc-block-featured-category.has-background-dim-50 .background-dim__overlay:before{opacity:.5}.wc-block-featured-category.has-background-dim-60 .background-dim__overlay:before{opacity:.6}.wc-block-featured-category.has-background-dim-70 .background-dim__overlay:before{opacity:.7}.wc-block-featured-category.has-background-dim-80 .background-dim__overlay:before{opacity:.8}.wc-block-featured-category.has-background-dim-90 .background-dim__overlay:before{opacity:.9}.wc-block-featured-category.has-background-dim-100 .background-dim__overlay:before{opacity:1}.wc-block-featured-category__selection{width:100%}.wc-block-featured-category.has-left-content{justify-content:flex-start}.wc-block-featured-category.has-left-content .wc-block-featured-category__description,.wc-block-featured-category.has-left-content .wc-block-featured-category__price,.wc-block-featured-category.has-left-content .wc-block-featured-category__title,.wc-block-featured-category.has-left-content .wc-block-featured-category__variation{margin-left:0;text-align:left}.wc-block-featured-category.has-right-content{justify-content:flex-end}.wc-block-featured-category.has-right-content .wc-block-featured-category__description,.wc-block-featured-category.has-right-content .wc-block-featured-category__price,.wc-block-featured-category.has-right-content .wc-block-featured-category__title,.wc-block-featured-category.has-right-content .wc-block-featured-category__variation{margin-right:0;text-align:right}.wc-block-featured-category.is-repeated{background-repeat:repeat;background-size:auto}.wc-block-featured-category__description,.wc-block-featured-category__price,.wc-block-featured-category__title,.wc-block-featured-category__variation{line-height:1.25;margin-bottom:0;text-align:center}.wc-block-featured-category__description a,.wc-block-featured-category__description a:active,.wc-block-featured-category__description a:focus,.wc-block-featured-category__description a:hover,.wc-block-featured-category__price a,.wc-block-featured-category__price a:active,.wc-block-featured-category__price a:focus,.wc-block-featured-category__price a:hover,.wc-block-featured-category__title a,.wc-block-featured-category__title a:active,.wc-block-featured-category__title a:focus,.wc-block-featured-category__title a:hover,.wc-block-featured-category__variation a,.wc-block-featured-category__variation a:active,.wc-block-featured-category__variation a:focus,.wc-block-featured-category__variation a:hover{color:#fff}.wc-block-featured-category__description,.wc-block-featured-category__link,.wc-block-featured-category__price,.wc-block-featured-category__title,.wc-block-featured-category__variation{color:inherit;padding:0 48px 16px;width:100%;z-index:1}.wc-block-featured-category .wc-block-featured-category__background-image{bottom:0;height:100%;left:0;margin:0;-o-object-fit:none;object-fit:none;padding:0;position:absolute;right:0;top:0;width:100%}.wc-block-featured-category .wc-block-featured-category__background-image.has-parallax{background-attachment:fixed}@supports(-webkit-overflow-scrolling:touch){.wc-block-featured-category .wc-block-featured-category__background-image.has-parallax{background-attachment:scroll}}@media(prefers-reduced-motion:reduce){.wc-block-featured-category .wc-block-featured-category__background-image.has-parallax{background-attachment:scroll}}.wc-block-featured-category__description{color:inherit}.wc-block-featured-category__description p{margin:0}.wc-block-featured-category .wc-block-featured-category__title{color:inherit;margin-top:0}.wc-block-featured-category .wc-block-featured-category__title div{color:inherit}.wc-block-featured-category .wc-block-featured-category__title:before{display:none}.wc-block-featured-category__wrapper{align-content:center;align-items:center;box-sizing:border-box;display:flex;flex-wrap:wrap;height:100%;justify-content:center;overflow:hidden;width:100%}.wc-block-featured-category .wp-block-button.aligncenter{text-align:center}.wp-block-woocommerce-featured-product{background-color:transparent;border-color:transparent;box-sizing:border-box;color:#fff}.wc-block-featured-product{align-content:center;align-items:center;background-color:inherit;background-position:50%;background-size:cover;display:flex;flex-wrap:wrap;justify-content:center;margin:0;overflow:hidden;position:relative;width:100%}.wc-block-featured-product.has-background-dim .background-dim__overlay:before{background:inherit;border-radius:inherit;bottom:0;content:"";left:0;opacity:.5;position:absolute;right:0;top:0;z-index:1}.wc-block-featured-product.has-background-dim-10 .background-dim__overlay:before{opacity:.1}.wc-block-featured-product.has-background-dim-20 .background-dim__overlay:before{opacity:.2}.wc-block-featured-product.has-background-dim-30 .background-dim__overlay:before{opacity:.3}.wc-block-featured-product.has-background-dim-40 .background-dim__overlay:before{opacity:.4}.wc-block-featured-product.has-background-dim-50 .background-dim__overlay:before{opacity:.5}.wc-block-featured-product.has-background-dim-60 .background-dim__overlay:before{opacity:.6}.wc-block-featured-product.has-background-dim-70 .background-dim__overlay:before{opacity:.7}.wc-block-featured-product.has-background-dim-80 .background-dim__overlay:before{opacity:.8}.wc-block-featured-product.has-background-dim-90 .background-dim__overlay:before{opacity:.9}.wc-block-featured-product.has-background-dim-100 .background-dim__overlay:before{opacity:1}.wc-block-featured-product__selection{width:100%}.wc-block-featured-product.has-left-content{justify-content:flex-start}.wc-block-featured-product.has-left-content .wc-block-featured-product__description,.wc-block-featured-product.has-left-content .wc-block-featured-product__price,.wc-block-featured-product.has-left-content .wc-block-featured-product__title,.wc-block-featured-product.has-left-content .wc-block-featured-product__variation{margin-left:0;text-align:left}.wc-block-featured-product.has-right-content{justify-content:flex-end}.wc-block-featured-product.has-right-content .wc-block-featured-product__description,.wc-block-featured-product.has-right-content .wc-block-featured-product__price,.wc-block-featured-product.has-right-content .wc-block-featured-product__title,.wc-block-featured-product.has-right-content .wc-block-featured-product__variation{margin-right:0;text-align:right}.wc-block-featured-product.is-repeated{background-repeat:repeat;background-size:auto}.wc-block-featured-product__description,.wc-block-featured-product__price,.wc-block-featured-product__title,.wc-block-featured-product__variation{line-height:1.25;margin-bottom:0;text-align:center}.wc-block-featured-product__description a,.wc-block-featured-product__description a:active,.wc-block-featured-product__description a:focus,.wc-block-featured-product__description a:hover,.wc-block-featured-product__price a,.wc-block-featured-product__price a:active,.wc-block-featured-product__price a:focus,.wc-block-featured-product__price a:hover,.wc-block-featured-product__title a,.wc-block-featured-product__title a:active,.wc-block-featured-product__title a:focus,.wc-block-featured-product__title a:hover,.wc-block-featured-product__variation a,.wc-block-featured-product__variation a:active,.wc-block-featured-product__variation a:focus,.wc-block-featured-product__variation a:hover{color:#fff}.wc-block-featured-product__description,.wc-block-featured-product__link,.wc-block-featured-product__price,.wc-block-featured-product__title,.wc-block-featured-product__variation{color:inherit;padding:0 48px 16px;width:100%;z-index:1}.wc-block-featured-product .wc-block-featured-product__background-image{bottom:0;height:100%;left:0;margin:0;-o-object-fit:none;object-fit:none;padding:0;position:absolute;right:0;top:0;width:100%}.wc-block-featured-product .wc-block-featured-product__background-image.has-parallax{background-attachment:fixed}@supports(-webkit-overflow-scrolling:touch){.wc-block-featured-product .wc-block-featured-product__background-image.has-parallax{background-attachment:scroll}}@media(prefers-reduced-motion:reduce){.wc-block-featured-product .wc-block-featured-product__background-image.has-parallax{background-attachment:scroll}}.wc-block-featured-product__description{color:inherit}.wc-block-featured-product__description p{margin:0}.wc-block-featured-product .wc-block-featured-product__title{color:inherit;margin-top:0}.wc-block-featured-product .wc-block-featured-product__title div{color:inherit}.wc-block-featured-product .wc-block-featured-product__title:before{display:none}.wc-block-featured-product__wrapper{align-content:center;align-items:center;box-sizing:border-box;display:flex;flex-wrap:wrap;height:100%;justify-content:center;overflow:hidden;width:100%}.wc-block-featured-product .wp-block-button.aligncenter{text-align:center}.wc-block-featured-product .wc-block-featured-product__title,.wc-block-featured-product .wc-block-featured-product__variation{border:0;margin-top:0}.wc-block-featured-product .wc-block-featured-product__title:before,.wc-block-featured-product .wc-block-featured-product__variation:before{display:none}.wc-block-featured-product .wc-block-featured-product__variation{font-style:italic;padding-top:0}.wc-block-featured-product .wc-block-featured-product__description p{line-height:1.5;margin:0}.wc-block-mini-cart__badge,.wc-block-mini-cart__quantity-badge{align-items:center;display:flex}.wc-block-mini-cart__badge{background:transparent;border:.15em solid;border-radius:1em;box-sizing:border-box;color:inherit;font-size:.875em;font-weight:600;height:1.4285714286em;justify-content:center;margin-left:-.7142857143em;min-width:1.4285714286em;padding:0 .25em;transform:translateY(-50%);white-space:nowrap;z-index:1}.wc-block-mini-cart__icon{display:block;height:1.5em;width:1.5em}html[dir=rtl] .wc-block-mini-cart__icon{transform:scaleX(-1)}.wc-block-cart .wc-block-components-shipping-calculator{white-space:nowrap}.wc-block-cart .wc-block-components-address-form .wc-block-components-country-input:first-of-type,.wc-block-cart .wc-block-components-address-form .wc-block-components-state-input:first-of-type,.wc-block-cart .wc-block-components-address-form .wc-block-components-text-input:first-of-type{margin-top:0}table.wc-block-cart-items,table.wc-block-cart-items td,table.wc-block-cart-items th{background:none!important;border:0;margin:0}.editor-styles-wrapper table.wc-block-cart-items,table.wc-block-cart-items{width:100%}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__header,table.wc-block-cart-items .wc-block-cart-items__header{font-size:.75em;text-transform:uppercase}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-image,table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-image{width:100px}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-product,table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-product{visibility:hidden}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-total,table.wc-block-cart-items .wc-block-cart-items__header .wc-block-cart-items__header-total{text-align:right;width:100px}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image img,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image img{margin:0;width:100%}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link{background:transparent;border:0;border-radius:0;box-shadow:none;color:inherit;display:inline;font-family:inherit;font-size:inherit;font-size:.75em;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-decoration:inherit;text-decoration:underline;text-shadow:none;text-transform:inherit;text-transform:none;vertical-align:baseline;white-space:nowrap}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:active,.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:focus,.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:hover,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:active,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:focus,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:hover{background:transparent}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-name,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-name{display:block;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total{font-size:1em;line-height:inherit;text-align:right}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-metadata,table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-metadata{margin-bottom:.75em}.editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row.is-disabled,table.wc-block-cart-items .wc-block-cart-items__row.is-disabled{opacity:.5;pointer-events:none;transition:opacity .2s ease}.wc-block-cart .wc-block-components-totals-footer-item,.wc-block-cart .wc-block-components-totals-taxes{margin:0}.wc-block-cart--is-loading h2 span,.wc-block-cart--is-loading th span,.wc-block-mini-cart__drawer.is-loading h2 span,.wc-block-mini-cart__drawer.is-loading th span{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;display:inline-block;line-height:1;max-width:100%!important;min-width:84px;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-cart--is-loading h2 span>*,.wc-block-cart--is-loading th span>*,.wc-block-mini-cart__drawer.is-loading h2 span>*,.wc-block-mini-cart__drawer.is-loading th span>*{visibility:hidden}.wc-block-cart--is-loading h2 span:after,.wc-block-cart--is-loading th span:after,.wc-block-mini-cart__drawer.is-loading h2 span:after,.wc-block-mini-cart__drawer.is-loading th span:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading h2 span,.wc-block-cart--is-loading th span,.wc-block-mini-cart__drawer.is-loading h2 span,.wc-block-mini-cart__drawer.is-loading th span{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading h2 span:before,.wc-block-cart--is-loading th span:before,.wc-block-mini-cart__drawer.is-loading h2 span:before,.wc-block-mini-cart__drawer.is-loading th span:before{content:" "}.wc-block-cart--is-loading h2 span,.wc-block-mini-cart__drawer.is-loading h2 span{min-width:33%}.wc-block-cart--is-loading .wc-block-components-product-metadata,.wc-block-cart--is-loading .wc-block-components-product-price,.wc-block-cart--is-loading .wc-block-components-quantity-selector,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price,.wc-block-mini-cart__drawer.is-loading .wc-block-components-quantity-selector{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-cart--is-loading .wc-block-components-product-metadata>*,.wc-block-cart--is-loading .wc-block-components-product-price>*,.wc-block-cart--is-loading .wc-block-components-quantity-selector>*,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata>*,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price>*,.wc-block-mini-cart__drawer.is-loading .wc-block-components-quantity-selector>*{visibility:hidden}.wc-block-cart--is-loading .wc-block-components-product-metadata:after,.wc-block-cart--is-loading .wc-block-components-product-price:after,.wc-block-cart--is-loading .wc-block-components-quantity-selector:after,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata:after,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price:after,.wc-block-mini-cart__drawer.is-loading .wc-block-components-quantity-selector:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading .wc-block-components-product-metadata,.wc-block-cart--is-loading .wc-block-components-product-price,.wc-block-cart--is-loading .wc-block-components-quantity-selector,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price,.wc-block-mini-cart__drawer.is-loading .wc-block-components-quantity-selector{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading .wc-block-components-product-name,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;display:inline-block;line-height:1;max-width:100%!important;min-width:84px;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-cart--is-loading .wc-block-components-product-name>*,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name>*{visibility:hidden}.wc-block-cart--is-loading .wc-block-components-product-name:after,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading .wc-block-components-product-name,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading .wc-block-components-product-name:before,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-name:before{content:" "}.wc-block-cart--is-loading .wc-block-components-product-metadata,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-metadata{margin-top:.25em;min-width:8em}.wc-block-cart--is-loading .wc-block-cart-item__remove-link,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__remove-link{visibility:hidden}.wc-block-cart--is-loading .wc-block-cart-item__image>a,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__image>a{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-cart--is-loading .wc-block-cart-item__image>a>*,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__image>a>*{visibility:hidden}.wc-block-cart--is-loading .wc-block-cart-item__image>a:after,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__image>a:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading .wc-block-cart-item__image>a,.wc-block-mini-cart__drawer.is-loading .wc-block-cart-item__image>a{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading .wc-block-components-product-price,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price{display:block;margin-top:.25em;max-width:3em}.wc-block-cart--is-loading .wc-block-components-product-price:before,.wc-block-mini-cart__drawer.is-loading .wc-block-components-product-price:before{content:" "}.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;min-height:460px;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card>*,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card>*{visibility:hidden}.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card:after,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card{-webkit-animation:none;animation:none}}.wc-block-cart--is-loading .wc-block-cart__sidebar .components-card:before,.wc-block-mini-cart__drawer.is-loading .wc-block-cart__sidebar .components-card:before{content:" "}.wc-block-components-sidebar-layout.wc-block-cart--skeleton{display:none}.is-loading+.wc-block-components-sidebar-layout.wc-block-cart--skeleton{display:flex}.wc-block-cart-item__total-price-and-sale-badge-wrapper{align-items:flex-end;display:flex;flex-direction:column}.wc-block-cart-item__total-price-and-sale-badge-wrapper .wc-block-components-sale-badge{margin-top:4px}.is-medium.wc-block-cart .wc-block-components-sidebar .wc-block-cart__totals-title,.is-mobile .wc-block-cart-item__total .wc-block-components-sale-badge,.is-mobile.wc-block-cart .wc-block-components-sidebar .wc-block-cart__totals-title,.is-small .wc-block-cart-item__total .wc-block-components-sale-badge,.is-small.wc-block-cart .wc-block-components-sidebar .wc-block-cart__totals-title{display:none}.is-medium table.wc-block-cart-items td,.is-mobile table.wc-block-cart-items td,.is-small table.wc-block-cart-items td{padding:0}.is-medium table.wc-block-cart-items .wc-block-cart-item__remove-link,.is-medium table.wc-block-cart-items .wc-block-cart-items__header,.is-mobile table.wc-block-cart-items .wc-block-cart-item__remove-link,.is-mobile table.wc-block-cart-items .wc-block-cart-items__header,.is-small table.wc-block-cart-items .wc-block-cart-item__remove-link,.is-small table.wc-block-cart-items .wc-block-cart-items__header{display:none}.is-medium table.wc-block-cart-items:not(.wc-block-mini-cart-items) .wc-block-cart-items__row,.is-mobile table.wc-block-cart-items:not(.wc-block-mini-cart-items) .wc-block-cart-items__row,.is-small table.wc-block-cart-items:not(.wc-block-mini-cart-items) .wc-block-cart-items__row{position:relative}.is-medium table.wc-block-cart-items:not(.wc-block-mini-cart-items) .wc-block-cart-items__row:after,.is-mobile table.wc-block-cart-items:not(.wc-block-mini-cart-items) .wc-block-cart-items__row:after,.is-small table.wc-block-cart-items:not(.wc-block-mini-cart-items) .wc-block-cart-items__row:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.is-medium table.wc-block-cart-items .wc-block-cart-items__row,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row,.is-small table.wc-block-cart-items .wc-block-cart-items__row{-ms-grid-columns:80px 132px;display:-ms-grid;display:grid;grid-template-columns:80px 132px;padding:16px 0}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image{-ms-grid-column:1;grid-column-start:1;-ms-grid-row:1;grid-row-start:1;padding-right:16px}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product{-ms-grid-column-span:2;-ms-grid-column-align:stretch;-ms-grid-column:2;grid-column-end:4;grid-column-start:2;-ms-grid-row:1;grid-row-start:1;justify-self:stretch;padding:0 16px 16px 0}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity{-ms-grid-row-align:end;align-self:end;-ms-grid-column:1;grid-column-start:1;-ms-grid-row:2;grid-row-start:2;padding-right:16px;padding-top:16px;vertical-align:bottom}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total{-ms-grid-row:1;grid-row-start:1}.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total .wc-block-components-formatted-money-amount,.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total .wc-block-components-formatted-money-amount,.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total .wc-block-components-formatted-money-amount{display:inline-block}.is-large.wc-block-cart{margin-bottom:3em}.is-large.wc-block-cart .wc-block-cart-items{position:relative}.is-large.wc-block-cart .wc-block-cart-items:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.is-large.wc-block-cart .wc-block-cart-items th{padding:.25rem 16px .25rem 0;white-space:nowrap}.is-large.wc-block-cart .wc-block-cart-items td{padding:16px 0 16px 16px;position:relative;vertical-align:top}.is-large.wc-block-cart .wc-block-cart-items td:after{border-style:solid;border-width:1px 0 0;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.is-large.wc-block-cart .wc-block-cart-items th:last-child{padding-right:0}.is-large.wc-block-cart .wc-block-cart-items td:last-child{padding-right:16px}.is-large.wc-block-cart .wc-block-components-radio-control__input{left:0}.is-large.wc-block-cart .wc-block-cart__totals-title{background:transparent;border:0;border-radius:0;box-shadow:none;color:inherit;display:inline;display:block;font-family:inherit;font-size:inherit;font-size:.75em;font-style:inherit;font-weight:inherit;font-weight:600;letter-spacing:inherit;line-height:inherit;margin:0;padding:.25rem 0;text-align:right;text-decoration:inherit;text-transform:inherit;text-transform:uppercase;vertical-align:baseline}.is-large.wc-block-cart .wc-block-components-sidebar .wc-block-components-shipping-calculator,.is-large.wc-block-cart .wc-block-components-sidebar .wc-block-components-shipping-rates-control__package:not(.wc-block-components-panel){padding-left:16px;padding-right:16px}.is-large.wc-block-cart .wc-block-cart__payment-options{padding:16px 0 0}.is-large.wc-block-cart .wc-block-cart__payment-options:empty{padding:0}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-empty-cart-block{display:none}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-filled-cart-block{display:flex;flex-wrap:wrap;margin:0 auto 16px;position:relative}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-items-block{box-sizing:border-box;margin:0;min-height:10em;padding-right:3.7735849057%;width:65%}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-line-items-block{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;max-width:100%!important;min-height:15em;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-line-items-block>*{visibility:hidden}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-line-items-block:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-line-items-block{-webkit-animation:none;animation:none}}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-totals-block{box-sizing:border-box;margin:0;min-height:12em;padding-left:2.2641509434%;width:35%}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-accepted-payment-methods-block,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-express-payment-block,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-order-summary-block,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-proceed-to-checkout-block{background-color:#ebebeb!important;border:0!important;border-radius:.25rem;box-shadow:none;color:transparent!important;display:block;line-height:1;margin:0 0 1em;max-width:100%!important;min-height:3em;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;z-index:1}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-accepted-payment-methods-block>*,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-express-payment-block>*,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-order-summary-block>*,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-proceed-to-checkout-block>*{visibility:hidden}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-accepted-payment-methods-block:after,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-express-payment-block:after,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-order-summary-block:after,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-proceed-to-checkout-block:after{-webkit-animation:loading__animation 1.5s ease-in-out infinite;animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(90deg,#ebebeb,#f5f5f5,#ebebeb);background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;top:0;transform:translateX(-100%)}@media screen and (prefers-reduced-motion:reduce){.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-accepted-payment-methods-block,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-express-payment-block,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-order-summary-block,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-proceed-to-checkout-block{-webkit-animation:none;animation:none}}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-order-summary-block{height:20em}@media only screen and (max-width:700px){.wp-block-woocommerce-cart.is-loading{padding-top:16px}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-filled-cart-block{flex-direction:column;margin:0 auto 16px}.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-items-block,.wp-block-woocommerce-cart.is-loading .wp-block-woocommerce-cart-totals-block{padding:0;width:100%}}.wc-block-mini-cart{display:inline-block}.wc-block-mini-cart__button{align-items:center;background-color:transparent;border:none;color:inherit;display:flex;font-family:inherit;font-size:inherit;font-weight:400;padding:.75em .5em}.wc-block-mini-cart__button:hover:not([disabled]){opacity:.6}.wc-block-mini-cart__amount{display:none}.wc-block-mini-cart__tax-label{margin-right:.5em}@media screen and (min-width:768px){.wc-block-mini-cart__amount{display:initial;font-weight:600;margin-right:8px}}.modal-open .wc-block-mini-cart__button{pointer-events:none}.wc-block-mini-cart__drawer{font-size:1rem}.wc-block-mini-cart__drawer .components-modal__content{padding:0;position:relative}.wc-block-mini-cart__drawer .components-modal__header{position:absolute;right:16px;top:40px}.wc-block-mini-cart__drawer .components-modal__header button{color:inherit;z-index:9999}.wc-block-mini-cart__drawer .components-modal__header svg{fill:currentColor}.wp-block-woocommerce-mini-cart-contents{background:#fff;box-sizing:border-box;height:100vh;justify-content:center;padding:0}.wp-block-woocommerce-empty-mini-cart-contents-block,.wp-block-woocommerce-filled-mini-cart-contents-block{display:flex;flex-direction:column;height:100%}.wp-block-woocommerce-empty-mini-cart-contents-block{justify-content:center}.wp-block-woocommerce-filled-mini-cart-contents-block{justify-content:space-between}.wp-block-woocommerce-empty-mini-cart-contents-block .wc-block-mini-cart__empty-cart-wrapper{overflow-y:auto;padding:40px 16px 16px}h2.wc-block-mini-cart__title{font-size:2em;margin:40px 16px 0}.wc-block-mini-cart__items{display:flex;flex-direction:column;flex-grow:1;overflow-y:auto;padding:16px 16px 0}.wc-block-mini-cart__items .wc-block-mini-cart__products-table{margin-bottom:auto;margin-right:-16px;padding-right:16px}.wc-block-mini-cart__items .wc-block-mini-cart__products-table .wc-block-cart-items__row{padding-bottom:8px;padding-top:8px}.wc-block-mini-cart__items .wc-block-mini-cart__products-table .wc-block-cart-items__row:last-child:after{content:none}.wc-block-mini-cart__footer{border-top:1px solid #ddd;padding:24px 16px}.wc-block-mini-cart__footer .wc-block-components-totals-item.wc-block-mini-cart__footer-subtotal{font-weight:600;margin-bottom:16px}.wc-block-mini-cart__footer .wc-block-components-totals-item.wc-block-mini-cart__footer-subtotal .wc-block-components-totals-item__description{display:none;font-size:.75em;font-weight:400}@media only screen and (min-width:480px){.wc-block-mini-cart__footer .wc-block-components-totals-item.wc-block-mini-cart__footer-subtotal .wc-block-components-totals-item__description{display:unset}}.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions{display:flex;gap:16px}.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-components-button{flex-grow:1;font-weight:600}.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-components-button.outlined{color:currentColor;display:none}.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-components-button.outlined:not(:focus){box-shadow:inset 0 0 0 1px currentColor}.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-components-button.outlined:focus,.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-components-button.outlined:hover{color:#fff}@media only screen and (min-width:480px){.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-components-button.outlined{display:inline-flex}}.wc-block-mini-cart__footer .wc-block-components-payment-method-icons{margin-top:16px}.wc-block-mini-cart__shopping-button{display:flex;justify-content:center}.wc-block-mini-cart__shopping-button a{border:2px solid;color:currentColor;font-weight:600;padding:12px 24px;text-decoration:none}.wc-block-mini-cart__shopping-button a:focus,.wc-block-mini-cart__shopping-button a:hover{background-color:#1e1e1e;border-color:#1e1e1e;color:#fff}.wc-block-components-checkbox{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin-top:1.5em;text-decoration:inherit;text-transform:inherit}.wc-block-components-checkbox label{align-items:flex-start;display:flex;position:relative}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:2px solid #50575e;border-radius:2px;box-sizing:border-box;font-size:1em;height:1.5em;margin:0 16px 0 0;min-height:1.5em;min-width:1.5em;overflow:hidden;position:static;vertical-align:middle;width:1.5em}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:checked{background:#fff;border-color:#50575e}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus{outline:2px solid #50575e;outline-offset:2px}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:after,.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:before{content:""}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:not(:checked)+.wc-block-components-checkbox__mark{display:none}.has-dark-controls .wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]{background-color:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.6)}.has-dark-controls .wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:checked{background:rgba(0,0,0,.1);border-color:hsla(0,0%,100%,.6)}.has-dark-controls .wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus{outline:2px solid hsla(0,0%,100%,.6);outline-offset:2px}.wc-block-components-checkbox.has-error,.wc-block-components-checkbox.has-error a{color:#cc1818}.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input,.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input:active,.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input:focus,.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input:hover{border-color:#cc1818}.wc-block-components-checkbox.has-error .wc-block-components-checkbox__input:focus{outline:2px solid #cc1818;outline-offset:2px}.wc-block-components-checkbox .wc-block-components-checkbox__mark{fill:#000;height:1.125em;margin-left:.1875em;margin-top:.0625em;pointer-events:none;position:absolute;width:1.125em}.has-dark-controls .wc-block-components-checkbox .wc-block-components-checkbox__mark{fill:#fff}.wc-block-components-checkbox .wc-block-components-checkbox__label,.wc-block-components-checkbox>span{line-height:1.5em;vertical-align:middle}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.wc-block-components-checkbox__mark{display:none}}.theme-twentytwentyone .has-dark-controls .wc-block-components-checkbox__input[type=checkbox],.theme-twentytwentyone .wc-block-components-checkbox__input[type=checkbox]{background-color:#fff;border-color:var(--form--border-color);position:relative}.theme-twentytwentyone .has-dark-controls .wc-block-components-checkbox__input[type=checkbox]:checked,.theme-twentytwentyone .wc-block-components-checkbox__input[type=checkbox]:checked{background-color:#fff;border-color:var(--form--border-color)}.theme-twentytwentyone .wc-block-components-checkbox__mark{display:none}.wc-block-components-panel.has-border{position:relative}.wc-block-components-panel.has-border:after{border-style:solid;border-width:1px 0;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-components-panel.has-border+.wc-block-components-panel.has-border:after{border-top-width:0}.wc-block-components-panel.has-border.no-top-border{position:relative}.wc-block-components-panel.has-border.no-top-border:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-components-panel__button{border:0;border-radius:0;height:auto;line-height:1;margin:.375em 0 0;padding:.375em 32px 0 0;position:relative;text-align:left;vertical-align:baseline;width:100%;word-break:break-word}.wc-block-components-panel__button[aria-expanded=true]{margin-bottom:.375em;padding-bottom:.375em}.wc-block-components-panel__button,.wc-block-components-panel__button:active,.wc-block-components-panel__button:focus,.wc-block-components-panel__button:hover{background:transparent;box-shadow:none;color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit}.wc-block-components-panel__button>.wc-block-components-panel__button-icon{fill:currentColor;position:absolute;right:0;top:50%;transform:translateY(-50%);width:auto}.wc-block-components-panel__content[hidden]{display:none}.theme-twentytwentyone.theme-twentytwentyone.theme-twentytwentyone .wc-block-components-panel__button{background-color:inherit;color:inherit}.theme-twentyseventeen .wc-block-components-panel__button,.theme-twentytwenty .wc-block-components-panel__button{background:none transparent;color:inherit}.theme-twentyseventeen .wc-block-components-panel__button.wc-block-components-panel__button:focus,.theme-twentyseventeen .wc-block-components-panel__button.wc-block-components-panel__button:hover,.theme-twentytwenty .wc-block-components-panel__button.wc-block-components-panel__button:focus,.theme-twentytwenty .wc-block-components-panel__button.wc-block-components-panel__button:hover{background:none transparent}.wc-block-components-totals-wrapper{padding:16px 0;position:relative}.wc-block-components-totals-wrapper:after{border-style:solid;border-width:1px 0 0;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-components-totals-wrapper.has-bottom-border:after{border-bottom-width:1px}.wc-block-components-totals-wrapper:empty{padding:0}.wc-block-components-totals-wrapper:empty:after{content:none}.wc-block-components-totals-wrapper.slot-wrapper{padding:0}.wc-block-components-totals-wrapper.slot-wrapper>*>*{padding:16px 0;position:relative}.wc-block-components-totals-wrapper.slot-wrapper>*>:after{border-style:solid;border-width:0 0 1px;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-components-totals-wrapper.slot-wrapper>*>:last-child:after{border-bottom-width:0}.wc-block-components-discounts-meta .wc-block-components-totals-wrapper:first-child{position:relative}.wc-block-components-discounts-meta .wc-block-components-totals-wrapper:first-child:after{border-style:solid;border-width:1px 0 0;bottom:0;content:"";display:block;left:0;opacity:.3;pointer-events:none;position:absolute;right:0;top:0}.wc-block-components-totals-item{box-sizing:border-box;display:flex;flex-wrap:wrap;width:100%}.wc-block-components-totals-item__label{flex-grow:1}.wc-block-components-totals-item__value{font-weight:700;white-space:nowrap}.wc-block-components-totals-item__description{font-size:.875em;width:100%}.wc-block-product-categories{margin-bottom:1em}.wc-block-product-categories.is-dropdown{display:flex}.wc-block-product-categories select{margin-right:.5em}.wc-block-product-categories-list--has-images{list-style:none outside}.wc-block-product-categories-list--has-images .wc-block-product-categories-list-item{clear:both;list-style:none outside;margin:4px 0 4px 60px}.wc-block-product-categories-list--has-images .wc-block-product-categories-list-item ul{margin:4px 0 0}.wc-block-product-categories-list--has-images .wc-block-product-categories-list-item__image{border:1px solid #eee;display:inline-block;margin:0 .5em 0 -60px;max-width:50px;padding:0;position:relative;vertical-align:middle}.wc-block-product-categories-list--has-images .wc-block-product-categories-list-item__image img{display:block;height:auto;margin:0;max-width:100%;padding:0}.wc-block-product-categories-list-item-count:before{content:" ("}.wc-block-product-categories-list-item-count:after{content:")"}.wp-block-woocommerce-product-categories.is-loading .wc-block-product-categories__placeholder{background:currentColor;display:inline-block;height:1em;min-width:200px;opacity:.2;width:50%}.wc-block-product-categories__button{align-items:center;display:flex;margin:0;overflow:hidden;padding:0 .5em;position:relative}.wc-block-product-categories__button svg{fill:currentColor;outline:none}.rtl .wc-block-product-categories__button svg{transform:rotate(180deg)}.wc-block-product-categories__button:active{color:currentColor}.wc-block-product-categories__button:disabled,.wc-block-product-categories__button[aria-disabled=true]{cursor:default;opacity:.3}.wc-block-product-categories__button:disabled:focus,.wc-block-product-categories__button[aria-disabled=true]:focus{box-shadow:none}.wc-block-product-search .wc-block-product-search__fields{display:flex}.wc-block-product-search .wc-block-product-search__field{flex-grow:1;line-height:1.8;padding:6px 8px}.wc-block-product-search .wc-block-product-search__button{align-items:center;cursor:pointer;display:flex;margin:0 0 0 6px;overflow:hidden;padding:0 .5em;position:relative}.wc-block-product-search .wc-block-product-search__button svg{fill:currentColor;outline:none}.rtl .wc-block-product-search .wc-block-product-search__button svg{transform:rotate(180deg)}.wc-block-product-search .wc-block-product-search__button:active{color:currentColor}.wc-block-product-search .wc-block-product-search__button:disabled,.wc-block-product-search .wc-block-product-search__button[aria-disabled=true]{cursor:default;opacity:.3}.wc-block-product-search .wc-block-product-search__button:disabled:focus,.wc-block-product-search .wc-block-product-search__button[aria-disabled=true]:focus{box-shadow:none}.wp-block-woocommerce-price-filter{border-color:#757575;border-radius:4px;border-style:none!important}.wc-block-price-filter,.wc-block-price-filter__controls,.wc-block-price-slider{border-color:inherit;border-radius:inherit}.wc-block-price-filter__controls input{border-color:inherit!important;border-radius:inherit!important;border-style:solid}.wp-block-woocommerce-attribute-filter{border-style:none!important}.wc-block-attribute-filter{border-color:inherit;border-radius:inherit;margin-bottom:24px}.wc-block-attribute-filter.style-dropdown{align-items:flex-start;border-color:inherit;border-radius:inherit;display:flex;gap:16px}.wc-block-attribute-filter.style-dropdown .wc-block-components-filter-submit-button{height:36px;line-height:1}.wc-block-attribute-filter .wc-block-attribute-filter-list{margin:0;width:100%}.wc-block-attribute-filter .wc-block-attribute-filter-list li label{cursor:pointer}.wc-block-attribute-filter .wc-block-attribute-filter-list li input{cursor:pointer;display:inline-block}.wc-block-attribute-filter .wc-blocks-components-form-token-field-wrapper{flex-grow:1;max-width:unset;width:0}.wc-block-attribute-filter .is-single .wc-block-attribute-filter-list-count,.wc-block-attribute-filter .wc-blocks-components-form-token-field-wrapper .wc-block-attribute-filter-list-count{opacity:.6}.wc-block-stock-filter{margin-bottom:24px}.wc-block-stock-filter .wc-block-stock-filter-list{margin:0}.wc-block-stock-filter .wc-block-stock-filter-list li label{cursor:pointer}.wc-block-stock-filter .wc-block-stock-filter-list li input{cursor:pointer;display:inline-block}.wc-block-stock-filter .is-single,.wc-block-stock-filter .wc-block-dropdown-selector .wc-block-dropdown-selector__list{opacity:.6}.wc-block-stock-filter .wc-block-stock-filter__button{margin-top:8px}.wc-block-active-filters{margin-bottom:24px;overflow:hidden}.wc-block-active-filters .wc-block-active-filters__clear-all{border:none;cursor:pointer;float:right;font-size:1em;padding:0;text-decoration:underline}.wc-block-active-filters .wc-block-active-filters__clear-all,.wc-block-active-filters .wc-block-active-filters__clear-all:active,.wc-block-active-filters .wc-block-active-filters__clear-all:focus,.wc-block-active-filters .wc-block-active-filters__clear-all:hover{background:transparent;color:inherit}.wc-block-active-filters .wc-block-active-filters__list{clear:both;list-style:none outside;margin:0 0 4px;padding:0}.wc-block-active-filters .wc-block-active-filters__list li{clear:both;list-style:none outside;margin:0;padding:0}.wc-block-active-filters .wc-block-active-filters__list li ul{list-style:none outside;margin:0;padding:0}.wc-block-active-filters .wc-block-active-filters__list li:first-child .wc-block-active-filters__list-item-type{margin:0}.wc-block-active-filters .wc-block-active-filters__list-item-type{display:block;font-size:.75em;letter-spacing:.1em;margin:16px 0 0;text-transform:uppercase}.wc-block-active-filters .wc-block-active-filters__list-item-operator{font-style:italic;font-weight:400}.wc-block-active-filters .wc-block-active-filters__list-item-name{display:block;font-weight:700;padding:0 16px 0 0;position:relative}.wc-block-active-filters .wc-block-active-filters__list-item-remove{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:currentColor;height:16px;margin:-8px 0 0;padding:0;position:absolute;right:0;top:50%;width:16px}.wc-block-active-filters .wc-block-active-filters__list--chips li,.wc-block-active-filters .wc-block-active-filters__list--chips ul{display:inline}.wc-block-active-filters .wc-block-active-filters__list--chips .wc-block-active-filters__list-item-type{display:none}.wc-block-active-filters .wc-block-active-filters__list--chips .wc-block-components-chip{font-size:.875em;margin-bottom:.1875em;margin-top:.1875em}@-webkit-keyframes spinner__animation{0%{-webkit-animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes spinner__animation{0%{-webkit-animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(1turn)}}@-webkit-keyframes loading__animation{to{transform:translateX(100%)}}@keyframes loading__animation{to{transform:translateX(100%)}}:where(div[data-block-name="woocommerce/legacy-template"]){margin-left:auto;margin-right:auto;max-width:1000px} \ No newline at end of file diff --git a/build/wc-blocks-vendors-style-rtl.css b/build/wc-blocks-vendors-style-rtl.css new file mode 100644 index 00000000000..351529547bf --- /dev/null +++ b/build/wc-blocks-vendors-style-rtl.css @@ -0,0 +1 @@ +.components-custom-select-control{position:relative}.components-custom-select-control__label{display:block;margin-bottom:8px}.components-custom-select-control__button{border:1px solid #757575;border-radius:2px;min-height:30px;min-width:130px;position:relative;text-align:right}.components-custom-select-control__button.components-custom-select-control__button{padding-left:24px}.components-custom-select-control__button:focus:not(:disabled){border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.components-custom-select-control__button .components-custom-select-control__button-icon{height:100%;padding:0;position:absolute;left:0;top:0}.components-custom-select-control__menu{background-color:#fff;border:1px solid #1e1e1e;border-radius:2px;max-height:400px;min-width:100%;outline:none;overflow:auto;padding:0;position:absolute;transition:none;z-index:1000000}.components-custom-select-control__menu[aria-hidden=true]{display:none}.components-custom-select-control__item{align-items:center;cursor:default;display:flex;line-height:28px;list-style-type:none;padding:8px}.components-custom-select-control__item.is-highlighted{background:#ddd}.components-custom-select-control__item .components-custom-select-control__item-icon{margin-right:auto;margin-left:0}.components-custom-select-control__item:last-child{margin-bottom:0}.components-snackbar{background-color:#1e1e1e;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.3);box-sizing:border-box;color:#fff;cursor:pointer;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;max-width:600px;padding:16px 24px;pointer-events:auto;width:100%}@media(min-width:600px){.components-snackbar{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}}.components-snackbar:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px var(--wp-admin-theme-color)}.components-snackbar.components-snackbar-explicit-dismiss{cursor:default}.components-snackbar .components-snackbar__content-with-icon{margin-right:24px}.components-snackbar .components-snackbar__icon{right:28px;position:absolute;top:24px}.components-snackbar .components-snackbar__dismiss-button{cursor:pointer;margin-right:32px}.components-snackbar__action.components-button{color:#fff;flex-shrink:0;height:auto;line-height:1.4;margin-right:32px;padding:0}.components-snackbar__action.components-button:not(:disabled):not([aria-disabled=true]):not(.is-secondary){background-color:transparent;text-decoration:underline}.components-snackbar__action.components-button:not(:disabled):not([aria-disabled=true]):not(.is-secondary):focus{box-shadow:none;color:#fff;outline:1px dotted #fff}.components-snackbar__action.components-button:not(:disabled):not([aria-disabled=true]):not(.is-secondary):hover{color:var(--wp-admin-theme-color)}.components-snackbar__content{align-items:baseline;display:flex;justify-content:space-between;line-height:1.4}.components-snackbar-list{box-sizing:border-box;pointer-events:none;position:absolute;width:100%;z-index:100000}.components-snackbar-list__notice-container{padding-top:8px;position:relative}.components-combobox-control{width:100%}input.components-combobox-control__input[type=text]{border:none;box-shadow:none;font-size:16px;line-height:inherit;margin:0;min-height:auto;padding:2px;width:100%}@media(min-width:600px){input.components-combobox-control__input[type=text]{font-size:13px}}input.components-combobox-control__input[type=text]:focus{box-shadow:none;outline:none}.components-combobox-control__suggestions-container{align-items:flex-start;border:1px solid #757575;border-radius:2px;box-shadow:0 0 0 transparent;display:flex;flex-wrap:wrap;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;margin:0 0 8px;padding:4px;transition:box-shadow .1s linear;width:100%}@media(prefers-reduced-motion:reduce){.components-combobox-control__suggestions-container{transition-delay:0s;transition-duration:0s}}@media(min-width:600px){.components-combobox-control__suggestions-container{font-size:13px;line-height:normal}}.components-combobox-control__suggestions-container:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid transparent}.components-combobox-control__suggestions-container::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.components-combobox-control__suggestions-container::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.components-combobox-control__suggestions-container:-ms-input-placeholder{color:rgba(30,30,30,.62)}.components-combobox-control__suggestions-container:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid transparent}.components-combobox-control__reset.components-button{display:flex;height:24px;min-width:24px;padding:0}.components-form-token-field__input-container{align-items:center;border:1px solid #757575;border-radius:2px;box-shadow:0 0 0 transparent;cursor:text;display:flex;flex-wrap:wrap;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;margin:0 0 8px;padding:2px 4px;transition:box-shadow .1s linear;width:100%}@media(prefers-reduced-motion:reduce){.components-form-token-field__input-container{transition-delay:0s;transition-duration:0s}}@media(min-width:600px){.components-form-token-field__input-container{font-size:13px;line-height:normal}}.components-form-token-field__input-container:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid transparent}.components-form-token-field__input-container::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.components-form-token-field__input-container::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.components-form-token-field__input-container:-ms-input-placeholder{color:rgba(30,30,30,.62)}.components-form-token-field__input-container.is-disabled{background:#ddd;border-color:#ddd}.components-form-token-field__input-container.is-active{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid transparent}.components-form-token-field__input-container input[type=text].components-form-token-field__input{background:inherit;border:0;box-shadow:none;color:#1e1e1e;display:inline-block;flex:1;font-size:16px;margin-right:4px;max-width:100%;min-height:24px;min-width:50px;padding:0;width:100%}@media(min-width:600px){.components-form-token-field__input-container input[type=text].components-form-token-field__input{font-size:13px}}.components-form-token-field.is-active .components-form-token-field__input-container input[type=text].components-form-token-field__input,.components-form-token-field__input-container input[type=text].components-form-token-field__input:focus{box-shadow:none;outline:none}.components-form-token-field__input-container .components-form-token-field__token+input[type=text].components-form-token-field__input{width:auto}.components-form-token-field__label{display:inline-block;margin-bottom:4px}.components-form-token-field__help{color:#757575;font-size:12px;font-style:normal}.components-form-token-field__token{color:#1e1e1e;display:flex;font-size:13px;margin:2px 0 2px 4px;max-width:100%}.components-form-token-field__token.is-success .components-form-token-field__remove-token,.components-form-token-field__token.is-success .components-form-token-field__token-text{background:#4ab866}.components-form-token-field__token.is-error .components-form-token-field__remove-token,.components-form-token-field__token.is-error .components-form-token-field__token-text{background:#cc1818}.components-form-token-field__token.is-validating .components-form-token-field__remove-token,.components-form-token-field__token.is-validating .components-form-token-field__token-text{color:#757575}.components-form-token-field__token.is-borderless{padding:0 0 0 16px;position:relative}.components-form-token-field__token.is-borderless .components-form-token-field__token-text{background:transparent;color:var(--wp-admin-theme-color)}.components-form-token-field__token.is-borderless .components-form-token-field__remove-token{background:transparent;color:#757575;position:absolute;left:0;top:1px}.components-form-token-field__token.is-borderless.is-success .components-form-token-field__token-text{color:#4ab866}.components-form-token-field__token.is-borderless.is-error .components-form-token-field__token-text{border-radius:0 4px 4px 0;color:#cc1818;padding:0 6px 0 4px}.components-form-token-field__token.is-borderless.is-validating .components-form-token-field__token-text{color:#1e1e1e}.components-form-token-field__token.is-disabled .components-form-token-field__remove-token{cursor:default}.components-form-token-field__remove-token.components-button,.components-form-token-field__token-text{background:#ddd;display:inline-block;height:auto;line-height:24px;min-width:unset;transition:all .2s cubic-bezier(.4,1,.4,1)}@media(prefers-reduced-motion:reduce){.components-form-token-field__remove-token.components-button,.components-form-token-field__token-text{-webkit-animation-delay:0s;animation-delay:0s;-webkit-animation-duration:1ms;animation-duration:1ms;transition-delay:0s;transition-duration:0s}}.components-form-token-field__token-text{border-radius:0 2px 2px 0;overflow:hidden;padding:0 8px 0 0;text-overflow:ellipsis;white-space:nowrap}.components-form-token-field__remove-token.components-button{border-radius:2px 0 0 2px;color:#1e1e1e;cursor:pointer;line-height:10px;overflow:initial;padding:0 2px}.components-form-token-field__remove-token.components-button:hover{color:#1e1e1e}.components-form-token-field__suggestions-list{border-top:1px solid #757575;flex:1 0 100%;list-style:none;margin:4px -4px -4px;max-height:9em;min-width:100%;overflow-y:auto;padding:0;transition:all .15s ease-in-out}@media(prefers-reduced-motion:reduce){.components-form-token-field__suggestions-list{transition-delay:0s;transition-duration:0s}}.components-form-token-field__suggestion{color:#757575;cursor:pointer;display:block;font-size:13px;margin:0;padding:4px 8px}.components-form-token-field__suggestion.is-selected{background:var(--wp-admin-theme-color);color:#fff}.components-form-token-field__suggestion-match{text-decoration:underline} \ No newline at end of file diff --git a/build/wc-blocks-vendors-style.css b/build/wc-blocks-vendors-style.css new file mode 100644 index 00000000000..203f87c27f0 --- /dev/null +++ b/build/wc-blocks-vendors-style.css @@ -0,0 +1 @@ +.components-custom-select-control{position:relative}.components-custom-select-control__label{display:block;margin-bottom:8px}.components-custom-select-control__button{border:1px solid #757575;border-radius:2px;min-height:30px;min-width:130px;position:relative;text-align:left}.components-custom-select-control__button.components-custom-select-control__button{padding-right:24px}.components-custom-select-control__button:focus:not(:disabled){border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.components-custom-select-control__button .components-custom-select-control__button-icon{height:100%;padding:0;position:absolute;right:0;top:0}.components-custom-select-control__menu{background-color:#fff;border:1px solid #1e1e1e;border-radius:2px;max-height:400px;min-width:100%;outline:none;overflow:auto;padding:0;position:absolute;transition:none;z-index:1000000}.components-custom-select-control__menu[aria-hidden=true]{display:none}.components-custom-select-control__item{align-items:center;cursor:default;display:flex;line-height:28px;list-style-type:none;padding:8px}.components-custom-select-control__item.is-highlighted{background:#ddd}.components-custom-select-control__item .components-custom-select-control__item-icon{margin-left:auto;margin-right:0}.components-custom-select-control__item:last-child{margin-bottom:0}.components-snackbar{background-color:#1e1e1e;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.3);box-sizing:border-box;color:#fff;cursor:pointer;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;max-width:600px;padding:16px 24px;pointer-events:auto;width:100%}@media(min-width:600px){.components-snackbar{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}}.components-snackbar:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px var(--wp-admin-theme-color)}.components-snackbar.components-snackbar-explicit-dismiss{cursor:default}.components-snackbar .components-snackbar__content-with-icon{margin-left:24px}.components-snackbar .components-snackbar__icon{left:28px;position:absolute;top:24px}.components-snackbar .components-snackbar__dismiss-button{cursor:pointer;margin-left:32px}.components-snackbar__action.components-button{color:#fff;flex-shrink:0;height:auto;line-height:1.4;margin-left:32px;padding:0}.components-snackbar__action.components-button:not(:disabled):not([aria-disabled=true]):not(.is-secondary){background-color:transparent;text-decoration:underline}.components-snackbar__action.components-button:not(:disabled):not([aria-disabled=true]):not(.is-secondary):focus{box-shadow:none;color:#fff;outline:1px dotted #fff}.components-snackbar__action.components-button:not(:disabled):not([aria-disabled=true]):not(.is-secondary):hover{color:var(--wp-admin-theme-color)}.components-snackbar__content{align-items:baseline;display:flex;justify-content:space-between;line-height:1.4}.components-snackbar-list{box-sizing:border-box;pointer-events:none;position:absolute;width:100%;z-index:100000}.components-snackbar-list__notice-container{padding-top:8px;position:relative}.components-combobox-control{width:100%}input.components-combobox-control__input[type=text]{border:none;box-shadow:none;font-size:16px;line-height:inherit;margin:0;min-height:auto;padding:2px;width:100%}@media(min-width:600px){input.components-combobox-control__input[type=text]{font-size:13px}}input.components-combobox-control__input[type=text]:focus{box-shadow:none;outline:none}.components-combobox-control__suggestions-container{align-items:flex-start;border:1px solid #757575;border-radius:2px;box-shadow:0 0 0 transparent;display:flex;flex-wrap:wrap;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;margin:0 0 8px;padding:4px;transition:box-shadow .1s linear;width:100%}@media(prefers-reduced-motion:reduce){.components-combobox-control__suggestions-container{transition-delay:0s;transition-duration:0s}}@media(min-width:600px){.components-combobox-control__suggestions-container{font-size:13px;line-height:normal}}.components-combobox-control__suggestions-container:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid transparent}.components-combobox-control__suggestions-container::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.components-combobox-control__suggestions-container::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.components-combobox-control__suggestions-container:-ms-input-placeholder{color:rgba(30,30,30,.62)}.components-combobox-control__suggestions-container:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid transparent}.components-combobox-control__reset.components-button{display:flex;height:24px;min-width:24px;padding:0}.components-form-token-field__input-container{align-items:center;border:1px solid #757575;border-radius:2px;box-shadow:0 0 0 transparent;cursor:text;display:flex;flex-wrap:wrap;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;margin:0 0 8px;padding:2px 4px;transition:box-shadow .1s linear;width:100%}@media(prefers-reduced-motion:reduce){.components-form-token-field__input-container{transition-delay:0s;transition-duration:0s}}@media(min-width:600px){.components-form-token-field__input-container{font-size:13px;line-height:normal}}.components-form-token-field__input-container:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid transparent}.components-form-token-field__input-container::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.components-form-token-field__input-container::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.components-form-token-field__input-container:-ms-input-placeholder{color:rgba(30,30,30,.62)}.components-form-token-field__input-container.is-disabled{background:#ddd;border-color:#ddd}.components-form-token-field__input-container.is-active{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid transparent}.components-form-token-field__input-container input[type=text].components-form-token-field__input{background:inherit;border:0;box-shadow:none;color:#1e1e1e;display:inline-block;flex:1;font-size:16px;margin-left:4px;max-width:100%;min-height:24px;min-width:50px;padding:0;width:100%}@media(min-width:600px){.components-form-token-field__input-container input[type=text].components-form-token-field__input{font-size:13px}}.components-form-token-field.is-active .components-form-token-field__input-container input[type=text].components-form-token-field__input,.components-form-token-field__input-container input[type=text].components-form-token-field__input:focus{box-shadow:none;outline:none}.components-form-token-field__input-container .components-form-token-field__token+input[type=text].components-form-token-field__input{width:auto}.components-form-token-field__label{display:inline-block;margin-bottom:4px}.components-form-token-field__help{color:#757575;font-size:12px;font-style:normal}.components-form-token-field__token{color:#1e1e1e;display:flex;font-size:13px;margin:2px 4px 2px 0;max-width:100%}.components-form-token-field__token.is-success .components-form-token-field__remove-token,.components-form-token-field__token.is-success .components-form-token-field__token-text{background:#4ab866}.components-form-token-field__token.is-error .components-form-token-field__remove-token,.components-form-token-field__token.is-error .components-form-token-field__token-text{background:#cc1818}.components-form-token-field__token.is-validating .components-form-token-field__remove-token,.components-form-token-field__token.is-validating .components-form-token-field__token-text{color:#757575}.components-form-token-field__token.is-borderless{padding:0 16px 0 0;position:relative}.components-form-token-field__token.is-borderless .components-form-token-field__token-text{background:transparent;color:var(--wp-admin-theme-color)}.components-form-token-field__token.is-borderless .components-form-token-field__remove-token{background:transparent;color:#757575;position:absolute;right:0;top:1px}.components-form-token-field__token.is-borderless.is-success .components-form-token-field__token-text{color:#4ab866}.components-form-token-field__token.is-borderless.is-error .components-form-token-field__token-text{border-radius:4px 0 0 4px;color:#cc1818;padding:0 4px 0 6px}.components-form-token-field__token.is-borderless.is-validating .components-form-token-field__token-text{color:#1e1e1e}.components-form-token-field__token.is-disabled .components-form-token-field__remove-token{cursor:default}.components-form-token-field__remove-token.components-button,.components-form-token-field__token-text{background:#ddd;display:inline-block;height:auto;line-height:24px;min-width:unset;transition:all .2s cubic-bezier(.4,1,.4,1)}@media(prefers-reduced-motion:reduce){.components-form-token-field__remove-token.components-button,.components-form-token-field__token-text{-webkit-animation-delay:0s;animation-delay:0s;-webkit-animation-duration:1ms;animation-duration:1ms;transition-delay:0s;transition-duration:0s}}.components-form-token-field__token-text{border-radius:2px 0 0 2px;overflow:hidden;padding:0 0 0 8px;text-overflow:ellipsis;white-space:nowrap}.components-form-token-field__remove-token.components-button{border-radius:0 2px 2px 0;color:#1e1e1e;cursor:pointer;line-height:10px;overflow:initial;padding:0 2px}.components-form-token-field__remove-token.components-button:hover{color:#1e1e1e}.components-form-token-field__suggestions-list{border-top:1px solid #757575;flex:1 0 100%;list-style:none;margin:4px -4px -4px;max-height:9em;min-width:100%;overflow-y:auto;padding:0;transition:all .15s ease-in-out}@media(prefers-reduced-motion:reduce){.components-form-token-field__suggestions-list{transition-delay:0s;transition-duration:0s}}.components-form-token-field__suggestion{color:#757575;cursor:pointer;display:block;font-size:13px;margin:0;padding:4px 8px}.components-form-token-field__suggestion.is-selected{background:var(--wp-admin-theme-color);color:#fff}.components-form-token-field__suggestion-match{text-decoration:underline} \ No newline at end of file diff --git a/build/wc-blocks-vendors.js b/build/wc-blocks-vendors.js new file mode 100644 index 00000000000..cf40063fe9c --- /dev/null +++ b/build/wc-blocks-vendors.js @@ -0,0 +1,7 @@ +(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[0],{107:function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var r=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},o={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},i=n(200),a=/[A-Z]|^ms/g,s=/_EMO_([^_]+?)_([^]*?)_EMO_/g,c=function(e){return 45===e.charCodeAt(1)},l=function(e){return null!=e&&"boolean"!=typeof e},u=Object(i.a)((function(e){return c(e)?e:e.replace(a,"-$&").toLowerCase()})),d=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(s,(function(e,t,n){return h={name:t,styles:n,next:h},t}))}return 1===o[e]||c(e)||"number"!=typeof t||0===t?t:t+"px"};function f(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return h={name:n.name,styles:n.styles,next:h},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)h={name:r.name,styles:r.styles,next:h},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};for(var n in t)e.setRequestHeader(n,t[n]);return e}function f(e){return void 0===e}function h(){var e={HALF_ODD:function(e){var t=Math.round(e);return u(e)&&c(t)?t-1:t},HALF_EVEN:function(e){var t=Math.round(e);return u(e)?c(t)?t:t-1:t},HALF_UP:function(e){return Math.round(e)},HALF_DOWN:function(e){return u(e)?Math.floor(e):Math.round(e)},HALF_TOWARDS_ZERO:function(e){return u(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e)},HALF_AWAY_FROM_ZERO:function(e){return u(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e)},DOWN:function(e){return Math.floor(e)}};return{add:function(e,t){return e+t},subtract:function(e,t){return e-t},multiply:function(e,t){return l(e)||l(t)?function(e,t){var n=function(e){return Math.pow(10,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=e.toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var n=t.split(".")[1];return n?n.length:0}(e))},r=Math.max(n(e),n(t));return Math.round(e*r)*Math.round(t*r)/(r*r)}(e,t):e*t},divide:function(e,t){return e/t},modulo:function(e,t){return e%t},round:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN";return e[n](t)}}}var p=h();function m(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return null!==t?t.slice(1).filter((function(e){return!f(e)})):[]},getMinimumFractionDigits:function(){var e=function(e){return"."===e};return f(this.getMatches().find(e))?0:this.getMatches()[p.add(this.getMatches().findIndex(e),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find((function(e){return"USD"===e||"dollar"===e||"$"===e}))]},getStyle:function(){return f(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!f(this.getMatches().find((function(e){return","===e})))}}}function g(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;for(var n in t)e=e.replace("{{".concat(n,"}}"),t[n]);return e};return{getExchangeRate:function(n,o){return(i=e.endpoint,!Boolean(i)||"object"!==r(i)&&"function"!=typeof i||"function"!=typeof i.then?function(n,r){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(n,r){var o=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===o.readyState&&(o.status>=200&&o.status<400?n(JSON.parse(o.responseText)):r(new Error(o.statusText)))},onerror:function(){r(new Error("Network error"))}});o.open("GET",e,!0),d(o,t.headers),o.send()}))}(t(e.endpoint,{from:n,to:r}),{headers:e.headers})}(n,o):e.endpoint).then((function(i){return function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",o={};return Object.entries(t).forEach((function(t){if("object"===r(t[1])){var i=e(t[1]);Object.entries(i).forEach((function(e){o[t[0]+n+e[0]]=e[1]}))}else o[t[0]]=t[1]})),o}(i)[t(e.propertyPath,{from:n,to:o})]}));var i}}}function b(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!e)throw new n(t)}function v(e){b(function(e){return s(e)&&e<=100&&e>=0}(e),"You must provide a numeric value between 0 and 100.",RangeError)}function y(e){b(Number.isInteger(e),"You must provide an integer.",TypeError)}var w=h(),O=Object.assign((function e(t){var n=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),r=n.amount,o=n.currency,i=n.precision;y(r),y(i);var a=e.globalLocale,s=e.globalFormat,c=e.globalRoundingMode,l=e.globalFormatRoundingMode,u=Object.assign({},e.globalExchangeRatesApi),d=function(t){var n=Object.assign({},Object.assign({},{amount:r,currency:o,precision:i},t),Object.assign({},{locale:this.locale},t));return Object.assign(e({amount:n.amount,currency:n.currency,precision:n.precision}),{locale:n.locale})},h=function(e){b(this.hasSameCurrency(e),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return o},getLocale:function(){return this.locale||a},setLocale:function(e){return d.call(this,{locale:e})},getPrecision:function(){return i},convertPrecision:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;y(e);var n=this.getPrecision(),r=e>n,o=r?w.multiply:w.divide,i=r?[e,n]:[n,e],a=Math.pow(10,w.subtract.apply(w,i));return d.call(this,{amount:w.round(o(this.getAmount(),a),t),precision:e})},add:function(t){h.call(this,t);var n=e.normalizePrecision([this,t]);return d.call(this,{amount:w.add(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},subtract:function(t){h.call(this,t);var n=e.normalizePrecision([this,t]);return d.call(this,{amount:w.subtract(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},multiply:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return d.call(this,{amount:w.round(w.multiply(this.getAmount(),e),t)})},divide:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return d.call(this,{amount:w.round(w.divide(this.getAmount(),e),t)})},percentage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return v(e),this.multiply(w.divide(e,100),t)},allocate:function(e){var t=this;!function(e){b(function(e){return e.length>0&&e.every((function(e){return e>=0}))&&e.some((function(e){return e>0}))}(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(e);for(var n=e.reduce((function(e,t){return w.add(e,t)})),r=this.getAmount(),o=e.map((function(e){var o=Math.floor(w.divide(w.multiply(t.getAmount(),e),n));return r=w.subtract(r,o),d.call(t,{amount:o})})),i=0;r>0;)e[i]>0&&(o[i]=o[i].add(d.call(this,{amount:1})),r=w.subtract(r,1)),i+=1;return o},convert:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.endpoint,o=void 0===r?u.endpoint:r,i=n.propertyPath,a=void 0===i?u.propertyPath||"rates.{{to}}":i,s=n.headers,l=void 0===s?u.headers:s,h=n.roundingMode,p=void 0===h?c:h,m=Object.assign({},{endpoint:o,propertyPath:a,headers:l,roundingMode:p});return g(m).getExchangeRate(this.getCurrency(),e).then((function(n){return b(!f(n),'No rate was found for the destination currency "'.concat(e,'".'),TypeError),d.call(t,{amount:w.round(w.multiply(t.getAmount(),parseFloat(n)),m.roundingMode),currency:e})}))},equalsTo:function(e){return this.hasSameAmount(e)&&this.hasSameCurrency(e)},lessThan:function(t){h.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()n[1].getAmount()},greaterThanOrEqual:function(t){h.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()>=n[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==w.modulo(this.getAmount(),Math.pow(10,i))},hasCents:function(){return 0!==w.modulo(this.getAmount(),Math.pow(10,i))},hasSameCurrency:function(e){return this.getCurrency()===e.getCurrency()},hasSameAmount:function(t){var n=e.normalizePrecision([this,t]);return n[0].getAmount()===n[1].getAmount()},toFormat:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l,n=m(e);return this.toRoundedUnit(n.getMinimumFractionDigits(),t).toLocaleString(this.getLocale(),{currencyDisplay:n.getCurrencyDisplay(),useGrouping:n.getUseGrouping(),minimumFractionDigits:n.getMinimumFractionDigits(),style:n.getStyle(),currency:this.getCurrency()})},toUnit:function(){return w.divide(this.getAmount(),Math.pow(10,i))},toRoundedUnit:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l,n=Math.pow(10,e);return w.divide(w.round(w.multiply(this.toUnit(),n),t),n)},toObject:function(){return{amount:r,currency:o,precision:i}},toJSON:function(){return this.toObject()}}}),{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},{globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}},a);t.a=O},112:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(12);function o(e,t,n){var o=this,i=Object(r.useRef)(null),a=Object(r.useRef)(0),s=Object(r.useRef)(null),c=Object(r.useRef)([]),l=Object(r.useRef)(),u=Object(r.useRef)(),d=Object(r.useRef)(e),f=Object(r.useRef)(!0);d.current=e;var h=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var p=!!(n=n||{}).leading,m=!("trailing"in n)||!!n.trailing,g="maxWait"in n,b=g?Math.max(+n.maxWait||0,t):null;return Object(r.useEffect)((function(){return f.current=!0,function(){f.current=!1}}),[]),Object(r.useMemo)((function(){var e=function(e){var t=c.current,n=l.current;return c.current=l.current=null,a.current=e,u.current=d.current.apply(n,t)},n=function(e,t){h&&cancelAnimationFrame(s.current),s.current=h?requestAnimationFrame(e):setTimeout(e,t)},r=function(e){if(!f.current)return!1;var n=e-i.current,r=e-a.current;return!i.current||n>=t||n<0||g&&r>=b},v=function(t){return s.current=null,m&&c.current?e(t):(c.current=l.current=null,u.current)},y=function(){var e=Date.now();if(r(e))return v(e);if(f.current){var o=e-i.current,s=e-a.current,c=t-o,l=g?Math.min(c,b-s):c;n(y,l)}},w=function(){for(var d=[],h=0;hl&&("#"!==s[d]||!a(e[d]));)d-=1;return!a(e[f])||"left"===n&&t!==l||t-d=a?r+=d("0",i-a):r=(r.substring(0,i)||"0")+"."+r.substring(i),t+r}(c),f=!0),"Infinity"===c&&f&&(c=""),f&&!n&&"number"==typeof r&&(c=function(e,t,n){if(-1!==["","-"].indexOf(e))return e;var r=-1!==e.indexOf(".")&&t,o=l(e),i=o.beforeDecimal,a=o.afterDecimal,s=o.hasNagation,c=parseFloat("0."+(a||"0")),d=(a.length<=t?"0."+a:c.toFixed(t)).split(".");return(s?"-":"")+i.split("").reverse().reduce((function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e}),d[0])+(r?".":"")+u(d[1]||"",Math.min(t,a.length),n)}(c,r,o)),f?this.formatNumString(c):this.formatInput(c))},t.prototype.formatNegation=function(e){void 0===e&&(e="");var t=this.props.allowNegative,n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),i=r.test(e);return e=e.replace(/-/g,""),o&&!i&&t&&(e="-"+e),e},t.prototype.formatInput=function(e){return void 0===e&&(e=""),this.props.format||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)},t.prototype.isCharacterAFormat=function(e,t){var n=this.props,r=n.format,o=n.prefix,i=n.suffix,a=n.decimalScale,s=n.fixedDecimalScale,c=this.getSeparators().decimalSeparator;return"string"==typeof r&&"#"!==r[e]||!(r||!(e=t.length-i.length||a&&s&&t[e]===c))},t.prototype.correctInputValue=function(e,t,n){var r=this,o=this.props,i=o.format,a=o.allowNegative,s=o.prefix,c=o.suffix,u=o.decimalScale,d=this.getSeparators(),f=d.allowedDecimalSeparators,h=d.decimalSeparator,p=this.state.numAsString||"",m=this.selectionBeforeInput,g=m.selectionStart,b=m.selectionEnd,v=function(e,t){for(var n=0,r=0,o=e.length,i=t.length;e[n]===t[n]&&nn&&o-r>n;)r++;return{start:n,end:o-r}}(t,n),y=v.start,w=v.end;if(!i&&y===w&&-1!==f.indexOf(n[g])){var O=0===u?"":h;return n.substr(0,g)+O+n.substr(g+1,n.length)}var x=i?0:s.length,j=t.length-(i?0:c.length);if(n.length>t.length||!n.length||y===w||0===g&&b===t.length||0===y&&w===t.length||g===x&&b===j)return n;var S=t.substr(y,w-y);if([].concat(S).find((function(e,n){return r.isCharacterAFormat(n+y,t)}))){var k=t.substr(y),E={},C=[];[].concat(k).forEach((function(e,n){r.isCharacterAFormat(n+y,t)?E[n]=e:n>S.length-1&&C.push(e)})),Object.keys(E).forEach((function(e){C.length>e?C.splice(e,0,E[e]):C.push(E[e])})),n=t.substr(0,y)+C.join("")}if(!i){var _=this.removeFormatting(n),A=l(_,a),T=A.beforeDecimal,M=A.afterDecimal,z=A.addNegation,P=ey;)v--;v=this.correctCaretPosition(a,v,"left")}}else for(;!m.test(a[v])&&vw)&&(e.preventDefault(),this.setPatchedCaretPosition(n,v,a)),e.isUnitTestRun&&this.setPatchedCaretPosition(n,v,a),h(e)}else h(e)},t.prototype.onMouseUp=function(e){var t=e.target,n=t.selectionStart,r=t.selectionEnd,o=t.value;if(void 0===o&&(o=""),n===r){var i=this.correctCaretPosition(o,n);i!==n&&this.setPatchedCaretPosition(t,i,o)}this.props.onMouseUp(e)},t.prototype.onFocus=function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout((function(){var n=e.target,r=n.selectionStart,o=n.selectionEnd,i=n.value;void 0===i&&(i="");var a=t.correctCaretPosition(i,r);a===r||0===r&&o===i.length||t.setPatchedCaretPosition(n,a,i),t.props.onFocus(e)}),0)},t.prototype.render=function(){var e=this.props,t=e.type,n=e.displayType,r=e.customInput,i=e.renderText,a=e.getInputRef,s=e.format,c=(e.thousandSeparator,e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle,e.decimalScale,e.fixedDecimalScale,e.prefix,e.suffix,e.removeFormatting,e.mask,e.defaultValue,e.isNumericString,e.allowNegative,e.allowEmptyFormatting,e.allowLeadingZeros,e.onValueChange,e.isAllowed,e.customNumerals,e.onChange,e.onKeyDown,e.onMouseUp,e.onFocus,e.onBlur,e.value,function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}(e,["type","displayType","customInput","renderText","getInputRef","format","thousandSeparator","decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","decimalScale","fixedDecimalScale","prefix","suffix","removeFormatting","mask","defaultValue","isNumericString","allowNegative","allowEmptyFormatting","allowLeadingZeros","onValueChange","isAllowed","customNumerals","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value"])),l=this.state,u=l.value,d=l.mounted&&function(e){return e||"undefined"!=typeof navigator&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}(s)?"numeric":void 0,f=Object.assign({inputMode:d},c,{type:t,value:u,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===n)return i?i(u,c)||null:o.a.createElement("span",Object.assign({},c,{ref:a}),u);if(r){var h=r;return o.a.createElement(h,Object.assign({},f,{ref:a}))}return o.a.createElement("input",Object.assign({},f,{ref:a}))},t}(o.a.Component);g.defaultProps=m,t.a=g},128:function(e,t,n){"use strict";var r=n(4),o=n.n(r),i=n(0);t.a=Object(i.forwardRef)((function({as:e="div",className:t,...n},r){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(i.createElement)(e,t)}({as:e,className:o()("components-visually-hidden",t),...n,ref:r})}))},129:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return i}));const r="data-wp-component",o="data-wp-c16t",i="__contextSystemKey__"},130:function(e,t,n){"use strict";var r=n(40),o=n(0),i=n(4),a=n.n(i),s=n(7),c=n(51),l=n.n(c),u=n(10),d=n(71),f=n(484),h=n(1);function p(e,t,n){const{defaultView:r}=t,{frameElement:o}=r;if(!o||t===n.ownerDocument)return e;const i=o.getBoundingClientRect();return new r.DOMRect(e.left+i.left,e.top+i.top,e.width,e.height)}let m=0;function g(e){const t=document.scrollingElement||document.body;e&&(m=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=m)}let b=0;function v(){return Object(o.useEffect)(()=>(0===b&&g(!0),++b,()=>{1===b&&g(!1),--b}),[]),null}var y=n(168);function w(e){const t=Object(o.useContext)(y.a),n=t.slots[e]||{},r=t.fills[e],i=Object(o.useMemo)(()=>r||[],[r]);return{...n,updateSlot:Object(o.useCallback)(n=>{t.updateSlot(e,n)},[e,t.updateSlot]),unregisterSlot:Object(o.useCallback)(n=>{t.unregisterSlot(e,n)},[e,t.unregisterSlot]),fills:i,registerFill:Object(o.useCallback)(n=>{t.registerFill(e,n)},[e,t.registerFill]),unregisterFill:Object(o.useCallback)(n=>{t.unregisterFill(e,n)},[e,t.unregisterFill])}}var O=Object(o.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function x({name:e,children:t,registerFill:n,unregisterFill:r}){const i=(e=>{const{getSlot:t,subscribe:n}=Object(o.useContext)(O),[r,i]=Object(o.useState)(t(e));return Object(o.useEffect)(()=>(i(t(e)),n(()=>{i(t(e))})),[e]),r})(e),a=Object(o.useRef)({name:e,children:t});return Object(o.useLayoutEffect)(()=>(n(e,a.current),()=>r(e,a.current)),[]),Object(o.useLayoutEffect)(()=>{a.current.children=t,i&&i.forceUpdate()},[t]),Object(o.useLayoutEffect)(()=>{e!==a.current.name&&(r(a.current.name,a.current),a.current.name=e,n(e,a.current))},[e]),i&&i.node?(Object(s.isFunction)(t)&&(t=t(i.props.fillProps)),Object(o.createPortal)(t,i.node)):null}var j=e=>Object(o.createElement)(O.Consumer,null,({registerFill:t,unregisterFill:n})=>Object(o.createElement)(x,Object(r.a)({},e,{registerFill:t,unregisterFill:n})));class S extends o.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:n,registerSlot:r}=this.props;e.name!==t&&(n(e.name),r(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:n={},getFills:r}=this.props,i=Object(s.map)(r(t,this),e=>{const t=Object(s.isFunction)(e.children)?e.children(n):e.children;return o.Children.map(t,(e,t)=>{if(!e||Object(s.isString)(e))return e;const n=e.key||t;return Object(o.cloneElement)(e,{key:n})})}).filter(Object(s.negate)(o.isEmptyElement));return Object(o.createElement)(o.Fragment,null,Object(s.isFunction)(e)?e(i):i)}}var k=e=>Object(o.createElement)(O.Consumer,null,({registerSlot:t,unregisterSlot:n,getFills:i})=>Object(o.createElement)(S,Object(r.a)({},e,{registerSlot:t,unregisterSlot:n,getFills:i})));function E(){const[,e]=Object(o.useState)({}),t=Object(o.useRef)(!0);return Object(o.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function C({name:e,children:t}){const n=w(e),r=Object(o.useRef)({rerender:E()});return Object(o.useEffect)(()=>(n.registerFill(r),()=>{n.unregisterFill(r)}),[n.registerFill,n.unregisterFill]),n.ref&&n.ref.current?("function"==typeof t&&(t=t(n.fillProps)),Object(o.createPortal)(t,n.ref.current)):null}var _=Object(o.forwardRef)((function({name:e,fillProps:t={},as:n="div",...i},a){const s=Object(o.useContext)(y.a),c=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(s.registerSlot(e,c,t),()=>{s.unregisterSlot(e,c)}),[s.registerSlot,s.unregisterSlot,e]),Object(o.useLayoutEffect)(()=>{s.updateSlot(e,t)}),Object(o.createElement)(n,Object(r.a)({ref:Object(u.useMergeRefs)([a,c])},i))}));function A(e){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(j,e),Object(o.createElement)(C,e))}n(22),o.Component;const T=Object(o.forwardRef)(({bubblesVirtually:e,...t},n)=>e?Object(o.createElement)(_,Object(r.a)({},t,{ref:n})):Object(o.createElement)(k,t));function M(e){return"appear"===e?"top":"left"}function z(e,t){const{paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:i}=(a=t).ownerDocument.defaultView.getComputedStyle(a);var a;const s=n?parseInt(n,10):0,c=r?parseInt(r,10):0,l=o?parseInt(o,10):0,u=i?parseInt(i,10):0;return{x:e.left+l,y:e.top+s,width:e.width-l-u,height:e.height-s-c,left:e.left+l,right:e.right-u,top:e.top+s,bottom:e.bottom-c}}function P(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function F(e,t,n=""){e.style[t]!==n&&(e.style[t]=n)}function L(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const V=Object(o.forwardRef)(({headerTitle:e,onClose:t,children:n,className:i,noArrow:s=!0,isAlternate:c,position:m="bottom right",range:g,focusOnMount:b="firstElement",anchorRef:y,shouldAnchorIncludePadding:O,anchorRect:x,getAnchorRect:j,expandOnMobile:S,animate:k=!0,onClickOutside:E,onFocusOutside:C,__unstableStickyBoundaryElement:_,__unstableSlotName:T="Popover",__unstableObserveElement:V,__unstableBoundaryParent:H,__unstableForcePosition:R,__unstableForceXAlignment:N,...I},D)=>{const B=Object(o.useRef)(null),$=Object(o.useRef)(null),W=Object(o.useRef)(),G=Object(u.useViewportMatch)("medium","<"),[U,K]=Object(o.useState)(),Z=w(T),X=S&&G,[Y,J]=Object(u.useResizeObserver)();s=X||s,Object(o.useLayoutEffect)(()=>{if(X)return L(W.current,"is-without-arrow",s),L(W.current,"is-alternate",c),P(W.current,"data-x-axis"),P(W.current,"data-y-axis"),F(W.current,"top"),F(W.current,"left"),F($.current,"maxHeight"),void F($.current,"maxWidth");const e=()=>{if(!W.current||!$.current)return;let e=function(e,t,n,r=!1,o,i){if(t)return t;if(n){if(!e.current)return;const t=n(e.current);return p(t,t.ownerDocument||e.current.ownerDocument,i)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==r?void 0:r.cloneRange))return p(Object(d.getRectangleFromRange)(r),r.endContainer.ownerDocument,i);if("function"==typeof(null==r?void 0:r.getBoundingClientRect)){const e=p(r.getBoundingClientRect(),r.ownerDocument,i);return o?e:z(e,r)}const{top:e,bottom:t}=r,n=e.getBoundingClientRect(),a=t.getBoundingClientRect(),s=p(new window.DOMRect(n.left,n.top,n.width,a.bottom-n.top),e.ownerDocument,i);return o?s:z(s,r)}if(!e.current)return;const{parentNode:a}=e.current,s=a.getBoundingClientRect();return o?s:z(s,a)}(B,x,j,y,O,W.current);if(!e)return;const{offsetParent:t,ownerDocument:n}=W.current;let r,o=0;if(t&&t!==n.body){const n=t.getBoundingClientRect();o=n.top,e=new window.DOMRect(e.left-n.left,e.top-n.top,e.width,e.height)}var i;H&&(r=null===(i=W.current.closest(".popover-slot"))||void 0===i?void 0:i.parentNode);const a=J.height?J:$.current.getBoundingClientRect(),{popoverTop:l,popoverLeft:u,xAxis:f,yAxis:g,contentHeight:b,contentWidth:v}=function(e,t,n="top",r,o,i,a,s,c){const[l,u="center",d]=n.split(" "),f=function(e,t,n,r,o,i,a,s){const{height:c}=t;if(o){const t=o.getBoundingClientRect().top+c-a;if(e.top<=t)return{yAxis:n,popoverTop:Math.min(e.bottom,t)}}let l=e.top+e.height/2;"bottom"===r?l=e.bottom:"top"===r&&(l=e.top);const u={popoverTop:l,contentHeight:(l-c/2>0?c/2:l)+(l+c/2>window.innerHeight?window.innerHeight-l:c/2)},d={popoverTop:e.top,contentHeight:e.top-10-c>0?c:e.top-10},f={popoverTop:e.bottom,contentHeight:e.bottom+10+c>window.innerHeight?window.innerHeight-10-e.bottom:c};let h,p=n,m=null;if(!o&&!s)if("middle"===n&&u.contentHeight===c)p="middle";else if("top"===n&&d.contentHeight===c)p="top";else if("bottom"===n&&f.contentHeight===c)p="bottom";else{p=d.contentHeight>f.contentHeight?"top":"bottom";const e="top"===p?d.contentHeight:f.contentHeight;m=e!==c?e:null}return h="middle"===p?u.popoverTop:"top"===p?d.popoverTop:f.popoverTop,{yAxis:p,popoverTop:h,contentHeight:m}}(e,t,l,d,r,0,i,s);return{...function(e,t,n,r,o,i,a,s,c){const{width:l}=t;"left"===n&&Object(h.isRTL)()?n="right":"right"===n&&Object(h.isRTL)()&&(n="left"),"left"===r&&Object(h.isRTL)()?r="right":"right"===r&&Object(h.isRTL)()&&(r="left");const u=Math.round(e.left+e.width/2),d={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)};let f=e.left;"right"===r?f=e.right:"middle"===i||c||(f=u);let p=e.right;"left"===r?p=e.left:"middle"===i||c||(p=u);const m={popoverLeft:f,contentWidth:f-l>0?l:f},g={popoverLeft:p,contentWidth:p+l>window.innerWidth?window.innerWidth-p:l};let b,v=n,y=null;if(!o&&!s)if("center"===n&&d.contentWidth===l)v="center";else if("left"===n&&m.contentWidth===l)v="left";else if("right"===n&&g.contentWidth===l)v="right";else{v=m.contentWidth>g.contentWidth?"left":"right";const e="left"===v?m.contentWidth:g.contentWidth;l>window.innerWidth&&(y=window.innerWidth),e!==l&&(v="center",d.popoverLeft=window.innerWidth/2)}if(b="center"===v?d.popoverLeft:"left"===v?m.popoverLeft:g.popoverLeft,a){const e=a.getBoundingClientRect();b=Math.min(b,e.right-l),Object(h.isRTL)()||(b=Math.max(b,0))}return{xAxis:v,popoverLeft:b,contentWidth:y}}(e,t,u,d,r,f.yAxis,a,s,c),...f}}(e,a,m,_,W.current,o,r,R,N);"number"==typeof l&&"number"==typeof u&&(F(W.current,"top",l+"px"),F(W.current,"left",u+"px")),L(W.current,"is-without-arrow",s||"center"===f&&"middle"===g),L(W.current,"is-alternate",c),P(W.current,"data-x-axis",f),P(W.current,"data-y-axis",g),F($.current,"maxHeight","number"==typeof b?b+"px":""),F($.current,"maxWidth","number"==typeof v?v+"px":""),K(({left:"right",right:"left"}[f]||"center")+" "+({top:"bottom",bottom:"top"}[g]||"middle"))};e();const{ownerDocument:t}=W.current,{defaultView:n}=t,r=n.setInterval(e,500);let o;const i=()=>{n.cancelAnimationFrame(o),o=n.requestAnimationFrame(e)};n.addEventListener("click",i),n.addEventListener("resize",e),n.addEventListener("scroll",e,!0);const a=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(y);let l;return a&&a!==t&&(a.defaultView.addEventListener("resize",e),a.defaultView.addEventListener("scroll",e,!0)),V&&(l=new n.MutationObserver(e),l.observe(V,{attributes:!0})),()=>{n.clearInterval(r),n.removeEventListener("resize",e),n.removeEventListener("scroll",e,!0),n.removeEventListener("click",i),n.cancelAnimationFrame(o),a&&a!==t&&(a.defaultView.removeEventListener("resize",e),a.defaultView.removeEventListener("scroll",e,!0)),l&&l.disconnect()}},[X,x,j,y,O,m,J,_,V,H]);const Q=(e,n)=>{if("focus-outside"===e&&C)C(n);else if("focus-outside"===e&&E){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>n.relatedTarget}),l()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),E(e)}else t&&t()},[ee,te]=Object(u.__experimentalUseDialog)({focusOnMount:b,__unstableOnClose:Q,onClose:Q}),ne=Object(u.useMergeRefs)([W,ee,D]),re=Boolean(k&&U)&&function(e){if("loading"===e.type)return a()("components-animate__loading");const{type:t,origin:n=M(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return a()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?a()("components-animate__slide-in","is-from-"+n):void 0}({type:"appear",origin:U});let oe=Object(o.createElement)("div",Object(r.a)({className:a()("components-popover",i,re,{"is-expanded":X,"is-without-arrow":s,"is-alternate":c})},I,{ref:ne},te,{tabIndex:"-1"}),X&&Object(o.createElement)(v,null),X&&Object(o.createElement)("div",{className:"components-popover__header"},Object(o.createElement)("span",{className:"components-popover__header-title"},e),Object(o.createElement)(q,{className:"components-popover__close",icon:f.a,onClick:t})),Object(o.createElement)("div",{ref:$,className:"components-popover__content"},Object(o.createElement)("div",{style:{position:"relative"}},Y,n)));return Z.ref&&(oe=Object(o.createElement)(A,{name:T},oe)),y||x?oe:Object(o.createElement)("span",{ref:B},oe)});V.Slot=Object(o.forwardRef)((function({name:e="Popover"},t){return Object(o.createElement)(T,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var H=V,R=function({shortcut:e,className:t}){if(!e)return null;let n,r;return Object(s.isString)(e)&&(n=e),Object(s.isObject)(e)&&(n=e.display,r=e.ariaLabel),Object(o.createElement)("span",{className:t,"aria-label":r},n)};const N=Object(o.createElement)("div",{className:"event-catcher"}),I=({eventHandlers:e,child:t,childrenWithPopover:n})=>Object(o.cloneElement)(Object(o.createElement)("span",{className:"disabled-element-wrapper"},Object(o.cloneElement)(N,e),Object(o.cloneElement)(t,{children:n}),","),e),D=({child:e,eventHandlers:t,childrenWithPopover:n})=>Object(o.cloneElement)(e,{...t,children:n}),B=(e,t,n)=>{if(1!==o.Children.count(e))return;const r=o.Children.only(e);"function"==typeof r.props[t]&&r.props[t](n)};var $=function({children:e,position:t,text:n,shortcut:r}){const[i,a]=Object(o.useState)(!1),[c,l]=Object(o.useState)(!1),d=Object(u.useDebounce)(l,700),f=t=>{B(e,"onMouseDown",t),document.addEventListener("mouseup",m),a(!0)},h=t=>{B(e,"onMouseUp",t),document.removeEventListener("mouseup",m),a(!1)},p=e=>"mouseUp"===e?h:"mouseDown"===e?f:void 0,m=p("mouseUp"),g=(t,n)=>r=>{if(B(e,t,r),r.currentTarget.disabled)return;if("focus"===r.type&&i)return;d.cancel();const o=Object(s.includes)(["focus","mouseenter"],r.type);o!==c&&(n?d(o):l(o))},b=()=>{d.cancel(),document.removeEventListener("mouseup",m)};if(Object(o.useEffect)(()=>b,[]),1!==o.Children.count(e))return e;const v={onMouseEnter:g("onMouseEnter",!0),onMouseLeave:g("onMouseLeave"),onClick:g("onClick"),onFocus:g("onFocus"),onBlur:g("onBlur"),onMouseDown:p("mouseDown")},y=o.Children.only(e),{children:w,disabled:O}=y.props;return(O?I:D)({child:y,eventHandlers:v,childrenWithPopover:(({grandchildren:e,isOver:t,position:n,text:r,shortcut:i})=>Object(o.concatChildren)(e,t&&Object(o.createElement)(H,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(o.createElement)(R,{className:"components-tooltip__shortcut",shortcut:i}))))({grandchildren:w,isOver:c,position:t,text:n,shortcut:r})})},W=n(214),G=n(128);const U=["onMouseDown","onClick"];var q=t.a=Object(o.forwardRef)((function(e,t){const{href:n,target:i,isSmall:c,isPressed:u,isBusy:d,isDestructive:f,className:h,disabled:p,icon:m,iconPosition:g="left",iconSize:b,showTooltip:v,tooltipPosition:y,shortcut:w,label:O,children:x,text:j,variant:S,__experimentalIsFocusable:k,describedBy:E,...C}=function({isDefault:e,isPrimary:t,isSecondary:n,isTertiary:r,isLink:o,variant:i,...a}){let s=i;var c,u,d,f,h;return t&&(null!==(c=s)&&void 0!==c||(s="primary")),r&&(null!==(u=s)&&void 0!==u||(s="tertiary")),n&&(null!==(d=s)&&void 0!==d||(s="secondary")),e&&(l()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(f=s)&&void 0!==f||(s="secondary")),o&&(null!==(h=s)&&void 0!==h||(s="link")),{...a,variant:s}}(e),_=a()("components-button",h,{"is-secondary":"secondary"===S,"is-primary":"primary"===S,"is-small":c,"is-tertiary":"tertiary"===S,"is-pressed":u,"is-busy":d,"is-link":"link"===S,"is-destructive":f,"has-text":!!m&&!!x,"has-icon":!!m}),A=p&&!k,T=void 0===n||A?"button":"a",M="a"===T?{href:n,target:i}:{type:"button",disabled:A,"aria-pressed":u};if(p&&k){M["aria-disabled"]=!0;for(const e of U)C[e]=e=>{e.stopPropagation(),e.preventDefault()}}const z=!A&&(v&&O||w||!!O&&(!x||Object(s.isArray)(x)&&!x.length)&&!1!==v),P=E?Object(s.uniqueId)():null,F=C["aria-describedby"]||P,L=Object(o.createElement)(T,Object(r.a)({},M,C,{className:_,"aria-label":C["aria-label"]||O,"aria-describedby":F,ref:t}),m&&"left"===g&&Object(o.createElement)(W.a,{icon:m,size:b}),j&&Object(o.createElement)(o.Fragment,null,j),m&&"right"===g&&Object(o.createElement)(W.a,{icon:m,size:b}),x);return z?Object(o.createElement)(o.Fragment,null,Object(o.createElement)($,{text:E||O,shortcut:w,position:y},L),E&&Object(o.createElement)(G.a,null,Object(o.createElement)("span",{id:P},E))):Object(o.createElement)(o.Fragment,null,L,E&&Object(o.createElement)(G.a,null,Object(o.createElement)("span",{id:P},E)))}))},137:function(e,t,n){"use strict";function r(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return o}));var o=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},i=function(e,t,n){o(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+r:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}}},139:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(7),o=n(213),i=n.n(o);function a(e="",t=1){const{r:n,g:r,b:o}=i()(e).toRgb();return`rgba(${n}, ${r}, ${o}, ${t})`}const s={black:"#000",white:"#fff"},c={blue:{medium:{focus:"#007cba",focusDark:"#fff"}},gray:{900:"#1e1e1e",700:"#757575",600:"#949494",400:"#ccc",200:"#ddd",100:"#f0f0f0"},darkGray:{primary:"#1e1e1e",heading:"#050505"},mediumGray:{text:"#757575"},lightGray:{ui:"#949494",secondary:"#ccc",tertiary:"#e7e8e9"}},l={900:"#191e23",800:"#23282d",700:"#32373c",600:"#40464d",500:"#555d66",400:"#606a73",300:"#6c7781",200:"#7e8993",150:"#8d96a0",100:"#8f98a1",placeholder:a(c.gray[900],.62)},u={900:a("#000510",.9),800:a("#00000a",.85),700:a("#06060b",.8),600:a("#000913",.75),500:a("#0a1829",.7),400:a("#0a1829",.65),300:a("#0e1c2e",.62),200:a("#162435",.55),100:a("#223443",.5),backgroundFill:a(l[700],.7)},d={900:a("#304455",.45),800:a("#425863",.4),700:a("#667886",.35),600:a("#7b86a2",.3),500:a("#9197a2",.25),400:a("#95959c",.2),300:a("#829493",.15),200:a("#8b8b96",.1),100:a("#747474",.05)},f={900:"#a2aab2",800:"#b5bcc2",700:"#ccd0d4",600:"#d7dade",500:"#e2e4e7",400:"#e8eaeb",300:"#edeff0",200:"#f3f4f5",100:"#f8f9f9",placeholder:a(s.white,.65)},h={900:a(s.white,.5),800:a(s.white,.45),700:a(s.white,.4),600:a(s.white,.35),500:a(s.white,.3),400:a(s.white,.25),300:a(s.white,.2),200:a(s.white,.15),100:a(s.white,.1),backgroundFill:a(f[300],.8)},p={wordpress:{700:"#00669b"},dark:{900:"#0071a1"},medium:{900:"#006589",800:"#00739c",700:"#007fac",600:"#008dbe",500:"#00a0d2",400:"#33b3db",300:"#66c6e4",200:"#bfe7f3",100:"#e5f5fa",highlight:"#b3e7fe",focus:"#007cba"}},m={theme:`var( --wp-admin-theme-color, ${p.wordpress[700]})`,themeDark10:`var( --wp-admin-theme-color-darker-10, ${p.medium.focus})`},g={theme:m.theme,background:s.white,backgroundDisabled:f[200],border:c.gray[700],borderFocus:m.themeDark10,borderDisabled:c.gray[400],borderLight:c.gray[200],label:l[500],textDisabled:l[150],textDark:s.white,textLight:s.black},b={...s,darkGray:Object(r.merge)({},l,c.darkGray),darkOpacity:u,darkOpacityLight:d,mediumGray:c.mediumGray,gray:c.gray,lightGray:Object(r.merge)({},f,c.lightGray),lightGrayLight:h,blue:Object(r.merge)({},p,c.blue),alert:{yellow:"#f0b849",red:"#d94f4f",green:"#4ab866"},admin:m,ui:g}},163:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return i})),n.d(t,"e",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return c}));var r=n(47);const o=Object(r.a)({name:"zjik7",styles:"display:flex"}),i=Object(r.a)({name:"qgaee5",styles:"display:block;max-height:100%;max-width:100%;min-height:0;min-width:0"}),a=Object(r.a)({name:"82a6rk",styles:"flex:1"}),s=Object(r.a)({name:"13nosa1",styles:">*{min-height:0;}"}),c=Object(r.a)({name:"1pwxzk4",styles:">*{min-width:0;}"})},166:function(e,t,n){"use strict";var r=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?b(C,--k):0,j--,10===E&&(j=1,x--),E}function M(){return E=k2||L(E)>3?"":" "}function I(e,t){for(;--t&&M()&&!(E<48||E>102||E>57&&E<65||E>70&&E<97););return F(e,P()+(t<6&&32==z()&&32==M()))}function D(e,t){for(;M()&&e+E!==57&&(e+E!==84||47!==z()););return"/*"+F(t,k-1)+"*"+f(47===e?e:M())}function B(e){for(;!L(z());)M();return F(e,k)}function $(e,t,n,r,o,i,a,s,l,u,f){for(var h=o-1,g=0===o?i:[""],b=w(g),y=0,O=0,x=0;y0?g[j]+" "+S:m(S,/&\f/g,g[j])))&&(l[x++]=k);return _(e,t,n,0===o?c:s,l,u,f)}function W(e,t,n){return _(e,t,n,s,f(E),v(e,2,-2),0)}function G(e,t,n,r){return _(e,t,n,l,v(e,0,r),v(e,r+1,-1),r)}function U(e,t){for(var n="",r=w(e),o=0;o-1&&!e.return)switch(e.type){case l:e.return=function e(t,n){switch(function(e,t){return(((t<<2^b(e,0))<<2^b(e,1))<<2^b(e,2))<<2^b(e,3)}(t,n)){case 5103:return a+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return a+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return a+t+i+t+o+t+t;case 6828:case 4268:return a+t+o+t+t;case 6165:return a+t+o+"flex-"+t+t;case 5187:return a+t+m(t,/(\w+).+(:[^]+)/,a+"box-$1$2"+o+"flex-$1$2")+t;case 5443:return a+t+o+"flex-item-"+m(t,/flex-|-self/,"")+t;case 4675:return a+t+o+"flex-line-pack"+m(t,/align-content|flex-|-self/,"")+t;case 5548:return a+t+o+m(t,"shrink","negative")+t;case 5292:return a+t+o+m(t,"basis","preferred-size")+t;case 6060:return a+"box-"+m(t,"-grow","")+a+t+o+m(t,"grow","positive")+t;case 4554:return a+m(t,/([^-])(transform)/g,"$1"+a+"$2")+t;case 6187:return m(m(m(t,/(zoom-|grab)/,a+"$1"),/(image-set)/,a+"$1"),t,"")+t;case 5495:case 3959:return m(t,/(image-set\([^]*)/,a+"$1$`$1");case 4968:return m(m(t,/(.+:)(flex-)?(.*)/,a+"box-pack:$3"+o+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+a+t+t;case 4095:case 3583:case 4068:case 2532:return m(t,/(.+)-inline(.+)/,a+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(y(t)-1-n>6)switch(b(t,n+1)){case 109:if(45!==b(t,n+4))break;case 102:return m(t,/(.+:)(.+)-([^]+)/,"$1"+a+"$2-$3$1"+i+(108==b(t,n+3)?"$3":"$2-$3"))+t;case 115:return~g(t,"stretch")?e(m(t,"stretch","fill-available"),n)+t:t}break;case 4949:if(115!==b(t,n+1))break;case 6444:switch(b(t,y(t)-3-(~g(t,"!important")&&10))){case 107:return m(t,":",":"+a)+t;case 101:return m(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+a+(45===b(t,14)?"inline-":"")+"box$3$1"+a+"$2$3$1"+o+"$2box$3")+t}break;case 5936:switch(b(t,n+11)){case 114:return a+t+o+m(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return a+t+o+m(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return a+t+o+m(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return a+t+o+t+t}return t}(e.value,e.length);break;case u:return U([A(e,{value:m(e.value,"@","@"+a)})],r);case c:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return U([A(e,{props:[m(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return U([A(e,{props:[m(t,/:(plac\w+)/,":"+a+"input-$1")]}),A(e,{props:[m(t,/:(plac\w+)/,":-moz-$1")]}),A(e,{props:[m(t,/:(plac\w+)/,o+"input-$1")]})],r)}return""}))}}];t.a=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var o,i,a=e.stylisPlugins||Q,s={},c=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n0&&y(A)-h&&O(b>32?G(A+";",o,r,h-1):G(m(A," ","")+";",o,r,h-2),l);break;case 59:A+=";";default:if(O(_=$(A,n,r,u,d,i,c,k,E=[],C=[],h),a),123===S)if(0===d)e(A,n,_,_,E,a,h,c,C);else switch(p){case 100:case 109:case 115:e(t,_,_,o&&O($(t,_,_,0,0,i,c,k,i,E=[],h),C),i,C,h,c,o?E:C);break;default:e(A,_,_,_,[""],C,0,c,C)}}u=d=b=0,w=j=1,k=A="",h=s;break;case 58:h=1+y(A),b=v;default:if(w<1)if(123==S)--w;else if(125==S&&0==w++&&125==T())continue;switch(A+=f(S),S*w){case 38:j=d>0?1:(A+="\f",-1);break;case 44:c[u++]=(y(A)-1)*j,j=1;break;case 64:45===z()&&(A+=R(M())),p=z(),d=h=y(k=A+=B(P())),S++;break;case 45:45===v&&2==y(A)&&(w=0)}}return a}("",null,null,null,[""],e=V(e),0,[0],e))}(e?e+"{"+t.styles+"}":t.styles),h),r&&(p.inserted[t.name]=!0)};var p={key:t,sheet:new r({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:i};return p.sheet.hydrate(c),p}},167:function(e,t,n){function r(e){for(var t,n,r=[],o=0;o/g,">\n").replace(/\n\n/g,"\n").replace(/^\n/g,"").replace(/\n$/g,"").split("\n"),g=0,b=[],v=!1,y=0;y=c)n="";else if(g+w.length>=c){if(" "===w[(o=c-g)-1])for(;o&&" "===w[(o-=1)-1];);else i=w.slice(o).indexOf(" "),u||(-1!==i?o+=i:o=n.length);n=w.slice(0,o).join("")+d,f&&(n+=''+h+""),g=c,v=!0}else g+=w.length;else if(l){if(g>=c)if(s=(a=n.match(/[a-zA-Z]+/))?a[0]:"")if("{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,n(220))},169:function(e,t,n){e.exports=function(e,t){var n,r,o=0;function i(){var i,a,s=n,c=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(a=0;a1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=P(e,360),t=P(t,100),n=P(n,100),0===t)r=o=i=n;else{var s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=a(c,s,e+1/3),o=a(c,s,e),i=a(c,s,e-1/3)}return{r:255*r,g:255*o,b:255*i}}(e.h,d,h),p=!0,m="hsl"),e.hasOwnProperty("a")&&(c=e.a)),c=z(c),{ok:p,format:e.format||m,r:l(255,u(s.r,0)),g:l(255,u(s.g,0)),b:l(255,u(s.b,0)),a:c}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=c(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=c(this._r)),this._g<1&&(this._g=c(this._g)),this._b<1&&(this._b=c(this._b)),this._ok=n.ok,this._tc_id=s++}function h(e,t,n){e=P(e,255),t=P(t,255),n=P(n,255);var r,o,i=u(e,t,n),a=l(e,t,n),s=(i+a)/2;if(i==a)r=o=0;else{var c=i-a;switch(o=s>.5?c/(2-i-a):c/(i+a),i){case e:r=(t-n)/c+(t>1)+720)%360;--t;)r.h=(r.h+o)%360,i.push(f(r));return i}function A(e,t){t=t||6;for(var n=f(e).toHsv(),r=n.h,o=n.s,i=n.v,a=[],s=1/t;t--;)a.push(f({h:r,s:o,v:i})),i=(i+s)%1;return a}f.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:o.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:o.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:o.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=z(e),this._roundA=c(100*this._a)/100,this},toHsv:function(){var e=p(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=p(this._r,this._g,this._b),t=c(360*e.h),n=c(100*e.s),r=c(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=h(this._r,this._g,this._b),t=c(360*e.h),n=c(100*e.s),r=c(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return m(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,o){var i=[V(c(e).toString(16)),V(c(t).toString(16)),V(c(n).toString(16)),V(R(r))];return o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:c(this._r),g:c(this._g),b:c(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+c(this._r)+", "+c(this._g)+", "+c(this._b)+")":"rgba("+c(this._r)+", "+c(this._g)+", "+c(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:c(100*P(this._r,255))+"%",g:c(100*P(this._g,255))+"%",b:c(100*P(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+c(100*P(this._r,255))+"%, "+c(100*P(this._g,255))+"%, "+c(100*P(this._b,255))+"%)":"rgba("+c(100*P(this._r,255))+"%, "+c(100*P(this._g,255))+"%, "+c(100*P(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(M[m(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+g(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var o=f(e);n="#"+g(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return f(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(w,arguments)},brighten:function(){return this._applyModification(O,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(b,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(j,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(_,arguments)},complement:function(){return this._applyCombination(S,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(C,arguments)},triad:function(){return this._applyCombination(k,arguments)},tetrad:function(){return this._applyCombination(E,arguments)}},f.fromRatio=function(e,t){if("object"==typeof e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:H(e[r]));e=n}return f(e,t)},f.equals=function(e,t){return!(!e||!t)&&f(e).toRgbString()==f(t).toRgbString()},f.random=function(){return f.fromRatio({r:d(),g:d(),b:d()})},f.mix=function(e,t,n){n=0===n?0:n||50;var r=f(e).toRgb(),o=f(t).toRgb(),i=n/100;return f({r:(o.r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b,a:(o.a-r.a)*i+r.a})},f.readability=function(e,t){var n=f(e),r=f(t);return(o.max(n.getLuminance(),r.getLuminance())+.05)/(o.min(n.getLuminance(),r.getLuminance())+.05)},f.isReadable=function(e,t,n){var r,o,i,a,s,c=f.readability(e,t);switch(o=!1,(i=n,"AA"!==(a=((i=i||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==a&&(a="AA"),"small"!==(s=(i.size||"small").toLowerCase())&&"large"!==s&&(s="small"),r={level:a,size:s}).level+r.size){case"AAsmall":case"AAAlarge":o=c>=4.5;break;case"AAlarge":o=c>=3;break;case"AAAsmall":o=c>=7}return o},f.mostReadable=function(e,t,n){var r,o,i,a,s=null,c=0;o=(n=n||{}).includeFallbackColors,i=n.level,a=n.size;for(var l=0;lc&&(c=r,s=f(t[l]));return f.isReadable(e,s,{level:i,size:a})||!o?s:(n.includeFallbackColors=!1,f.mostReadable(e,["#fff","#000"],n))};var T=f.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},M=f.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(T);function z(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function P(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=l(t,u(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),o.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function F(e){return l(1,u(0,e))}function L(e){return parseInt(e,16)}function V(e){return 1==e.length?"0"+e:""+e}function H(e){return e<=1&&(e=100*e+"%"),e}function R(e){return o.round(255*parseFloat(e)).toString(16)}function N(e){return L(e)/255}var I,D,B,$=(D="[\\s|\\(]+("+(I="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+I+")[,|\\s]+("+I+")\\s*\\)?",B="[\\s|\\(]+("+I+")[,|\\s]+("+I+")[,|\\s]+("+I+")[,|\\s]+("+I+")\\s*\\)?",{CSS_UNIT:new RegExp(I),rgb:new RegExp("rgb"+D),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+D),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+D),hsva:new RegExp("hsva"+B),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function W(e){return!!$.CSS_UNIT.exec(e)}e.exports?e.exports=f:void 0===(r=function(){return f}.call(t,n,t,e))||(e.exports=r)}(Math)},214:function(e,t,n){"use strict";var r=n(40),o=n(0),i=n(11),a=function({icon:e,className:t,...n}){const i=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(o.createElement)("span",Object(r.a)({className:i},n))};t.a=function({icon:e=null,size:t=24,...n}){if("string"==typeof e)return Object(o.createElement)(a,Object(r.a)({icon:e},n));if(Object(o.isValidElement)(e)&&a===e.type)return Object(o.cloneElement)(e,{...n});if("function"==typeof e)return e.prototype instanceof o.Component?Object(o.createElement)(e,{size:t,...n}):e({size:t,...n});if(e&&("svg"===e.type||e.type===i.SVG)){const r={width:t,height:t,...e.props,...n};return Object(o.createElement)(i.SVG,r)}return Object(o.isValidElement)(e)?Object(o.cloneElement)(e,{size:t,...n}):e}},220:function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var c,l=[],u=!1,d=-1;function f(){u&&c&&(u=!1,c.length?l=c.concat(l):d=-1,l.length&&h())}function h(){if(!u){var e=s(f);u=!0;for(var t=l.length;t;){for(c=l,l=[];++d1)for(var n=1;nObject(r.useContext)(o)},229:function(e,t,n){"use strict";var r=n(40),o=n(0),i=n(4),a=n.n(i);class s extends o.Component{constructor(){super(...arguments),this.onChange=this.onChange.bind(this),this.bindInput=this.bindInput.bind(this)}focus(){this.input.focus()}hasFocus(){return this.input===this.input.ownerDocument.activeElement}bindInput(e){this.input=e}onChange(e){this.props.onChange({value:e.target.value})}render(){const{value:e,isExpanded:t,instanceId:n,selectedSuggestionIndex:i,className:s,...c}=this.props,l=e?e.length+1:0;return Object(o.createElement)("input",Object(r.a)({ref:this.bindInput,id:"components-form-token-input-"+n,type:"text"},c,{value:e||"",onChange:this.onChange,size:l,className:a()(s,"components-form-token-field__input"),autoComplete:"off",role:"combobox","aria-expanded":t,"aria-autocomplete":"list","aria-owns":t?"components-form-token-suggestions-"+n:void 0,"aria-activedescendant":-1!==i?`components-form-token-suggestions-${n}-${i}`:void 0,"aria-describedby":"components-form-token-suggestions-howto-"+n}))}}t.a=s},230:function(e,t,n){"use strict";var r=n(0),o=n(7),i=n(319),a=n.n(i),s=n(4),c=n.n(s),l=n(10);class u extends r.Component{constructor(){super(...arguments),this.handleMouseDown=this.handleMouseDown.bind(this),this.bindList=this.bindList.bind(this)}componentDidUpdate(){this.props.selectedIndex>-1&&this.props.scrollIntoView&&this.list.children[this.props.selectedIndex]&&(this.scrollingIntoView=!0,a()(this.list.children[this.props.selectedIndex],this.list,{onlyScrollIfNeeded:!0}),this.props.setTimeout(()=>{this.scrollingIntoView=!1},100))}bindList(e){this.list=e}handleHover(e){return()=>{this.scrollingIntoView||this.props.onHover(e)}}handleClick(e){return()=>{this.props.onSelect(e)}}handleMouseDown(e){e.preventDefault()}computeSuggestionMatch(e){const t=this.props.displayTransform(this.props.match||"").toLocaleLowerCase();if(0===t.length)return null;const n=(e=this.props.displayTransform(e)).toLocaleLowerCase().indexOf(t);return{suggestionBeforeMatch:e.substring(0,n),suggestionMatch:e.substring(n,n+t.length),suggestionAfterMatch:e.substring(n+t.length)}}render(){return Object(r.createElement)("ul",{ref:this.bindList,className:"components-form-token-field__suggestions-list",id:"components-form-token-suggestions-"+this.props.instanceId,role:"listbox"},Object(o.map)(this.props.suggestions,(e,t)=>{const n=this.computeSuggestionMatch(e),o=c()("components-form-token-field__suggestion",{"is-selected":t===this.props.selectedIndex});return Object(r.createElement)("li",{id:`components-form-token-suggestions-${this.props.instanceId}-${t}`,role:"option",className:o,key:null!=e&&e.value?e.value:this.props.displayTransform(e),onMouseDown:this.handleMouseDown,onClick:this.handleClick(e),onMouseEnter:this.handleHover(e),"aria-selected":t===this.props.selectedIndex},n?Object(r.createElement)("span",{"aria-label":this.props.displayTransform(e)},n.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch):this.props.displayTransform(e))}))}}u.defaultProps={match:"",onHover:()=>{},onSelect:()=>{},suggestions:Object.freeze([])},t.a=Object(l.withSafeTimeout)(u)},231:function(e,t,n){"use strict";var r=n(0),o=n(4),i=n.n(o),a=n(128),s=n(76),c=n(7),l={"default.fontFamily":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif","default.fontSize":"13px","helpText.fontSize":"12px",mobileTextMinFontSize:"16px"};function u(e){return Object(c.get)(l,e,"")}var d=n(139),f=n(64);const h=Object(s.a)("div",{target:"e1puf3u3"})("font-family:",u("default.fontFamily"),";font-size:",u("default.fontSize"),";"),p=Object(s.a)("div",{target:"e1puf3u2"})("margin-bottom:",Object(f.a)(2),";.components-panel__row &{margin-bottom:inherit;}"),m=Object(s.a)("label",{target:"e1puf3u1"})("display:inline-block;margin-bottom:",Object(f.a)(2),";"),g=Object(s.a)("p",{target:"e1puf3u0"})("font-size:",u("helpText.fontSize"),";font-style:normal;color:",d.a.mediumGray.text,";");function b({id:e,label:t,hideLabelFromVision:n,help:o,className:s,children:c}){return Object(r.createElement)(h,{className:i()("components-base-control",s)},Object(r.createElement)(p,{className:"components-base-control__field"},t&&e&&(n?Object(r.createElement)(a.a,{as:"label",htmlFor:e},t):Object(r.createElement)(m,{className:"components-base-control__label",htmlFor:e},t)),t&&!e&&(n?Object(r.createElement)(a.a,{as:"label"},t):Object(r.createElement)(b.VisualLabel,null,t)),c),!!o&&Object(r.createElement)(g,{id:e+"__help",className:"components-base-control__help"},o))}b.VisualLabel=({className:e,children:t})=>(e=i()("components-base-control__label",e),Object(r.createElement)("span",{className:e},t)),t.a=b},235:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"}));t.a=i},24:function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},268:function(e,t,n){"use strict";var r=n(269),o=n.n(r);t.a=function(e,t){return o()(e,t)}},269:function(e,t,n){"use strict";var r=n(379),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(p){var o=h(n);o&&o!==p&&e(t,o,r)}var a=u(n);d&&(a=a.concat(d(n)));for(var s=c(t),m=c(n),g=0;g{n&&Object(c.speak)(n,t)},[n,t])}(i,m);const v=a()(e,"components-notice","is-"+t,{"is-dismissible":h});return g&&(n=Object(r.createElement)(r.RawHTML,null,n)),Object(r.createElement)("div",{className:v},Object(r.createElement)("div",{className:"components-notice__content"},n,Object(r.createElement)("div",{className:"components-notice__actions"},p.map(({className:e,label:t,isPrimary:n,variant:o,noDefaultClasses:i=!1,onClick:s,url:c},l)=>{let d=o;return"primary"===o||i||(d=c?"link":"secondary"),void 0===d&&n&&(d="primary"),Object(r.createElement)(u.a,{key:l,href:c,variant:d,onClick:c?void 0:s,className:a()("components-notice__action",e)},t)}))),h&&Object(r.createElement)(u.a,{className:"components-notice__dismiss",icon:l.a,label:Object(s.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),b(),f()},showTooltip:!1}))}},284:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(12),o=n(112);function i(e,t){return e===t}function a(e){return"function"==typeof e?function(){return e}:e}function s(e,t,n){var s=n&&n.equalityFn||i,c=function(e){var t=Object(r.useState)(a(e)),n=t[0],o=t[1];return[n,Object(r.useCallback)((function(e){return o(a(e))}),[])]}(e),l=c[0],u=c[1],d=Object(o.a)(Object(r.useCallback)((function(e){return u(e)}),[u]),t,n),f=Object(r.useRef)(e);return s(f.current,e)||(d(e),f.current=e),[l,d]}},316:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var r=n(0),o=n(7);n(101);const i=Object(r.createContext)({}),a=()=>Object(r.useContext)(i);function s({value:t}){const n=a(),i=Object(r.useRef)(t);return function(n,a){const s=Object(r.useRef)(!1);Object(r.useEffect)(()=>{s.current?Object(o.isEqual)(i.current,t)&&i.current!==t&&void 0!==e&&e.env:s.current=!0},a)}(0,[t]),Object(r.useMemo)(()=>Object(o.merge)(Object(o.cloneDeep)(n),t),[n,t])}Object(r.memo)(({children:e,value:t})=>{const n=s({value:t});return Object(r.createElement)(i.Provider,{value:n},e)})}).call(this,n(220))},317:function(e,t){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);Object.defineProperty(t,"combineChunks",{enumerable:!0,get:function(){return r.combineChunks}}),Object.defineProperty(t,"fillInChunks",{enumerable:!0,get:function(){return r.fillInChunks}}),Object.defineProperty(t,"findAll",{enumerable:!0,get:function(){return r.findAll}}),Object.defineProperty(t,"findChunks",{enumerable:!0,get:function(){return r.findChunks}})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findAll=function(e){var t=e.autoEscape,i=e.caseSensitive,a=void 0!==i&&i,s=e.findChunks,c=void 0===s?r:s,l=e.sanitize,u=e.searchWords,d=e.textToHighlight;return o({chunksToHighlight:n({chunks:c({autoEscape:t,caseSensitive:a,sanitize:l,searchWords:u,textToHighlight:d})}),totalLength:d?d.length:0})};var n=t.combineChunks=function(e){var t=e.chunks;return t.sort((function(e,t){return e.start-t.start})).reduce((function(e,t){if(0===e.length)return[t];var n=e.pop();if(t.start<=n.end){var r=Math.max(n.end,t.end);e.push({highlight:!1,start:n.start,end:r})}else e.push(n,t);return e}),[])},r=function(e){var t=e.autoEscape,n=e.caseSensitive,r=e.sanitize,o=void 0===r?i:r,a=e.searchWords,s=e.textToHighlight;return s=o(s),a.filter((function(e){return e})).reduce((function(e,r){r=o(r),t&&(r=r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"));for(var i=new RegExp(r,n?"g":"gi"),a=void 0;a=i.exec(s);){var c=a.index,l=i.lastIndex;l>c&&e.push({highlight:!1,start:c,end:l}),a.index===i.lastIndex&&i.lastIndex++}return e}),[])};t.findChunks=r;var o=t.fillInChunks=function(e){var t=e.chunksToHighlight,n=e.totalLength,r=[],o=function(e,t,n){t-e>0&&r.push({start:e,end:t,highlight:n})};if(0===t.length)o(0,n,!1);else{var i=0;t.forEach((function(e){o(i,e.start,!1),o(e.start,e.end,!0),i=e.end})),o(i,n,!1)}return r};function i(e){return e}}])},318:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(47),o=n(485),i=n(227),a=n(163);function s(e){const{className:t,display:n,isBlock:s=!1,...c}=Object(o.a)(e,"FlexItem"),l={},u=Object(i.b)().flexItemDisplay;return l.Base=Object(r.a)({display:n||u},"",""),{...c,className:Object(r.b)(a.b,l.Base,s&&a.e,t)}}},319:function(e,t,n){"use strict";e.exports=n(396)},328:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M16.5 7.8v7H18v-7c0-1-.8-1.8-1.8-1.8h-7v1.5h7c.2 0 .3.1.3.3zm-8.7 8.7c-.1 0-.2-.1-.2-.2V2H6v4H2v1.5h4v8.8c0 1 .8 1.8 1.8 1.8h8.8v4H18v-4h4v-1.5H7.8z"}));t.a=i},329:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(o.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"}));t.a=i},379:function(e,t,n){"use strict";e.exports=n(380)},380:function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,c=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,d=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,g=r?Symbol.for("react.memo"):60115,b=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,O=r?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case d:case f:case a:case c:case s:case p:return e;default:switch(e=e&&e.$$typeof){case u:case h:case b:case g:case l:return e;default:return t}}case i:return t}}}function j(e){return x(e)===f}t.AsyncMode=d,t.ConcurrentMode=f,t.ContextConsumer=u,t.ContextProvider=l,t.Element=o,t.ForwardRef=h,t.Fragment=a,t.Lazy=b,t.Memo=g,t.Portal=i,t.Profiler=c,t.StrictMode=s,t.Suspense=p,t.isAsyncMode=function(e){return j(e)||x(e)===d},t.isConcurrentMode=j,t.isContextConsumer=function(e){return x(e)===u},t.isContextProvider=function(e){return x(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return x(e)===h},t.isFragment=function(e){return x(e)===a},t.isLazy=function(e){return x(e)===b},t.isMemo=function(e){return x(e)===g},t.isPortal=function(e){return x(e)===i},t.isProfiler=function(e){return x(e)===c},t.isStrictMode=function(e){return x(e)===s},t.isSuspense=function(e){return x(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===f||e===c||e===s||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===g||e.$$typeof===l||e.$$typeof===u||e.$$typeof===h||e.$$typeof===y||e.$$typeof===w||e.$$typeof===O||e.$$typeof===v)},t.typeOf=x},396:function(e,t,n){"use strict";var r=n(397);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=r.getWindow(t));var o=n.allowHorizontalScroll,i=n.onlyScrollIfNeeded,a=n.alignWithTop,s=n.alignWithLeft,c=n.offsetTop||0,l=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;o=void 0===o||o;var f=r.isWindow(t),h=r.offset(e),p=r.outerHeight(e),m=r.outerWidth(e),g=void 0,b=void 0,v=void 0,y=void 0,w=void 0,O=void 0,x=void 0,j=void 0,S=void 0,k=void 0;f?(x=t,k=r.height(x),S=r.width(x),j={left:r.scrollLeft(x),top:r.scrollTop(x)},w={left:h.left-j.left-l,top:h.top-j.top-c},O={left:h.left+m-(j.left+S)+d,top:h.top+p-(j.top+k)+u},y=j):(g=r.offset(t),b=t.clientHeight,v=t.clientWidth,y={left:t.scrollLeft,top:t.scrollTop},w={left:h.left-(g.left+(parseFloat(r.css(t,"borderLeftWidth"))||0))-l,top:h.top-(g.top+(parseFloat(r.css(t,"borderTopWidth"))||0))-c},O={left:h.left+m-(g.left+v+(parseFloat(r.css(t,"borderRightWidth"))||0))+d,top:h.top+p-(g.top+b+(parseFloat(r.css(t,"borderBottomWidth"))||0))+u}),w.top<0||O.top>0?!0===a?r.scrollTop(t,y.top+w.top):!1===a?r.scrollTop(t,y.top+O.top):w.top<0?r.scrollTop(t,y.top+w.top):r.scrollTop(t,y.top+O.top):i||((a=void 0===a||!!a)?r.scrollTop(t,y.top+w.top):r.scrollTop(t,y.top+O.top)),o&&(w.left<0||O.left>0?!0===s?r.scrollLeft(t,y.left+w.left):!1===s?r.scrollLeft(t,y.left+O.left):w.left<0?r.scrollLeft(t,y.left+w.left):r.scrollLeft(t,y.left+O.left):i||((s=void 0===s||!!s)?r.scrollLeft(t,y.left+w.left):r.scrollLeft(t,y.left+O.left)))}},397:function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;tc(e).includes(t)))}}).call(this,n(220))},488:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(40),o=n(0),i=n(487),a=n(486);const s=({as:e,name:t,useHook:n,memo:s=!1})=>{function c(t,i){const s=n(t);return Object(o.createElement)(a.a,Object(r.a)({as:e||"div"},s,{ref:i}))}return c.displayName=t,Object(i.a)(c,t,{memo:s})}},496:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"}));t.a=i},497:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(o.Path,{d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21ZM15.5303 8.46967C15.8232 8.76256 15.8232 9.23744 15.5303 9.53033L13.0607 12L15.5303 14.4697C15.8232 14.7626 15.8232 15.2374 15.5303 15.5303C15.2374 15.8232 14.7626 15.8232 14.4697 15.5303L12 13.0607L9.53033 15.5303C9.23744 15.8232 8.76256 15.8232 8.46967 15.5303C8.17678 15.2374 8.17678 14.7626 8.46967 14.4697L10.9393 12L8.46967 9.53033C8.17678 9.23744 8.17678 8.76256 8.46967 8.46967C8.76256 8.17678 9.23744 8.17678 9.53033 8.46967L12 10.9393L14.4697 8.46967C14.7626 8.17678 15.2374 8.17678 15.5303 8.46967Z"}));t.a=i},498:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));t.a=i},499:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M3.445 16.505a.75.75 0 001.06.05l5.005-4.55 4.024 3.521 4.716-4.715V14h1.5V8.25H14v1.5h3.19l-3.724 3.723L9.49 9.995l-5.995 5.45a.75.75 0 00-.05 1.06z"}));t.a=i},500:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(o.Path,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5z"}));t.a=i},501:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(o.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));t.a=i},502:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(o.Path,{d:"M10 11c-1.588-.479-4-.91-4-.91s2-.241 4-.454c1.8-.191 3.365-.502 4-3.181C14.635 3.775 15 1 15 1s.365 2.775 1 5.455c.635 2.679 2 2.969 4 3.181 2 .213 4 .455 4 .455s-2.412.43-4 .909c-1.588.479-3 1-4 4.546-.746 2.643-.893 4.948-1 5.454-.107-.506-.167-2.5-1-5.454C13 12 11.588 11.479 10 11zM7.333 3.5C6.803 3.333 6 3.182 6 3.182s.667-.085 1.333-.16c.6-.066 1.122-.175 1.334-1.113C8.878.971 9 0 9 0s.122.971.333 1.91c.212.937.667 1.038 1.334 1.113.666.074 1.333.159 1.333.159s-.804.15-1.333.318c-.53.167-1 .35-1.334 1.59C9.085 6.017 9.036 6.824 9 7c-.036-.177-.056-.875-.333-1.91-.334-1.24-.804-1.423-1.334-1.59zM2.444 18C1.474 17.713 0 17.454 0 17.454s1.222-.145 2.444-.272c1.1-.115 2.057-.302 2.445-1.91C5.277 13.666 5.5 12 5.5 12s.223 1.665.611 3.273c.388 1.607 1.222 1.781 2.445 1.909 1.222.127 2.444.273 2.444.273s-1.474.258-2.444.545c-.971.287-1.834.6-2.445 2.727-.456 1.586-.546 2.97-.611 3.273-.065-.304-.102-1.5-.611-3.273C4.278 18.6 3.415 18.287 2.444 18z",fill:"#F0C930"}));t.a=i},503:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{fillRule:"evenodd",d:"M6.5 8a1.5 1.5 0 103 0 1.5 1.5 0 00-3 0zM8 5a3 3 0 100 6 3 3 0 000-6zm6.5 11a1.5 1.5 0 103 0 1.5 1.5 0 00-3 0zm1.5-3a3 3 0 100 6 3 3 0 000-6zM5.47 17.41a.75.75 0 001.06 1.06L18.47 6.53a.75.75 0 10-1.06-1.06L5.47 17.41z",clipRule:"evenodd"}));t.a=i},504:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(o.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"}));t.a=i},505:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"}));t.a=i},506:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z"}));t.a=i},507:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));t.a=i},508:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"}));t.a=i},509:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"}));t.a=i},510:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M6.2 5.2v13.4l5.8-4.8 5.8 4.8V5.2z"}));t.a=i},511:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zm-1.338 4.877c-.314.22-.412.452-.412.623 0 .171.098.403.412.623.312.218.783.377 1.338.377.825 0 1.605.233 2.198.648.59.414 1.052 1.057 1.052 1.852 0 .795-.461 1.438-1.052 1.852-.41.286-.907.486-1.448.582v.316a.75.75 0 01-1.5 0v-.316a3.64 3.64 0 01-1.448-.582c-.59-.414-1.052-1.057-1.052-1.852a.75.75 0 011.5 0c0 .171.098.403.412.623.312.218.783.377 1.338.377s1.026-.159 1.338-.377c.314-.22.412-.452.412-.623 0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377-.825 0-1.605-.233-2.198-.648-.59-.414-1.052-1.057-1.052-1.852 0-.795.461-1.438 1.052-1.852a3.64 3.64 0 011.448-.582V7.5a.75.75 0 011.5 0v.316c.54.096 1.039.296 1.448.582.59.414 1.052 1.057 1.052 1.852a.75.75 0 01-1.5 0c0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377s-1.026.159-1.338.377z"}));t.a=i},512:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(o.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"}));t.a=i},513:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(o.Path,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 12.8h8v-1.5H8v1.5z"}));t.a=i},514:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"}));t.a=i},515:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(o.Path,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z"}));t.a=i},516:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{fillRule:"evenodd",d:"M5 5.5h14a.5.5 0 01.5.5v1.5a.5.5 0 01-.5.5H5a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 9.232A2 2 0 013 7.5V6a2 2 0 012-2h14a2 2 0 012 2v1.5a2 2 0 01-1 1.732V18a2 2 0 01-2 2H6a2 2 0 01-2-2V9.232zm1.5.268V18a.5.5 0 00.5.5h12a.5.5 0 00.5-.5V9.5h-13z",clipRule:"evenodd"}));t.a=i},517:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));t.a=i},518:function(e,t,n){"use strict";var r=n(488),o=n(318);const i=Object(r.a)({as:"div",useHook:o.a,name:"FlexItem"});t.a=i},519:function(e,t,n){"use strict";var r=n(40),o=n(0),i=n(4),a=n.n(i),s=n(10),c=n(214);t.a=function({icon:e,children:t,label:n,instructions:i,className:l,notices:u,preview:d,isColumnLayout:f,...h}){const[p,{width:m}]=Object(s.useResizeObserver)();let g;"number"==typeof m&&(g={"is-large":m>=480,"is-medium":m>=160&&m<480,"is-small":m<160});const b=a()("components-placeholder",l,g),v=a()("components-placeholder__fieldset",{"is-column-layout":f});return Object(o.createElement)("div",Object(r.a)({},h,{className:b}),p,u,d&&Object(o.createElement)("div",{className:"components-placeholder__preview"},d),Object(o.createElement)("div",{className:"components-placeholder__label"},Object(o.createElement)(c.a,{icon:e}),n),!!i&&Object(o.createElement)("div",{className:"components-placeholder__instructions"},i),Object(o.createElement)("div",{className:v},t))}},520:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=i},521:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=i},522:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z"}));t.a=i},523:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{fillRule:"evenodd",d:"M5.5 9.5v-2h13v2h-13zm0 3v4h13v-4h-13zM4 7a1 1 0 011-1h14a1 1 0 011 1v10a1 1 0 01-1 1H5a1 1 0 01-1-1V7z",clipRule:"evenodd"}));t.a=i},524:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{fillRule:"evenodd",d:"M18.646 9H20V8l-1-.5L12 4 5 7.5 4 8v1h14.646zm-3-1.5L12 5.677 8.354 7.5h7.292zm-7.897 9.44v-6.5h-1.5v6.5h1.5zm5-6.5v6.5h-1.5v-6.5h1.5zm5 0v6.5h-1.5v-6.5h1.5zm2.252 8.81c0 .414-.334.75-.748.75H4.752a.75.75 0 010-1.5h14.5a.75.75 0 01.749.75z",clipRule:"evenodd"}));t.a=i},525:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M12 9c-.8 0-1.5.7-1.5 1.5S11.2 12 12 12s1.5-.7 1.5-1.5S12.8 9 12 9zm0-5c-3.6 0-6.5 2.8-6.5 6.2 0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C18.5 6.8 15.6 4 12 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4z"}));t.a=i},526:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z"}));t.a=i},527:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(o.Path,{d:"M12.5939 21C14.1472 21 16.1269 20.5701 17.0711 20.1975L16.6447 18.879C16.0964 19.051 14.3299 19.6242 12.6548 19.6242C7.4467 19.6242 4.67513 16.8726 4.67513 12C4.67513 7.21338 7.50762 4.34713 12.2893 4.34713C17.132 4.34713 19.4162 7.55732 19.4162 10.7675C19.4162 14.035 19.0508 15.4968 17.4975 15.4968C16.5838 15.4968 16.0964 14.7803 16.0964 13.9777V7.5H14.4822V8.30255H14.3909C14.1777 7.67198 12.9898 7.12739 11.467 7.2707C9.18274 7.5 7.4467 9.27707 7.4467 11.8567C7.4467 14.5796 8.81726 16.672 11.467 16.758C13.203 16.8153 14.1168 16.0127 14.4822 15.1815H14.5736C14.7563 16.414 16.401 16.8439 17.467 16.8439C20.6954 16.8439 21 13.5764 21 10.7962C21 6.86943 18.0761 3 12.3807 3C6.50254 3 3 6.3535 3 11.9427C3 17.7325 6.38071 21 12.5939 21ZM11.7107 15.2962C9.73096 15.2962 9.03046 13.6051 9.03046 11.7707C9.03046 10.1083 10.0355 8.67516 11.7716 8.67516C13.599 8.67516 14.5736 9.36306 14.5736 11.7707C14.5736 14.1497 13.7513 15.2962 11.7107 15.2962Z"}));t.a=i},528:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));t.a=i},529:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M3 6.75C3 5.784 3.784 5 4.75 5H15V7.313l.05.027 5.056 2.73.394.212v3.468a1.75 1.75 0 01-1.75 1.75h-.012a2.5 2.5 0 11-4.975 0H9.737a2.5 2.5 0 11-4.975 0H3V6.75zM13.5 14V6.5H4.75a.25.25 0 00-.25.25V14h.965a2.493 2.493 0 011.785-.75c.7 0 1.332.287 1.785.75H13.5zm4.535 0h.715a.25.25 0 00.25-.25v-2.573l-4-2.16v4.568a2.487 2.487 0 011.25-.335c.7 0 1.332.287 1.785.75zM6.282 15.5a1.002 1.002 0 00.968 1.25 1 1 0 10-.968-1.25zm9 0a1 1 0 101.937.498 1 1 0 00-1.938-.498z"}));t.a=i},530:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(o.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"}));t.a=i},531:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M3 18h8V6H3v12zM14 7.5V9h7V7.5h-7zm0 5.3h7v-1.5h-7v1.5zm0 3.7h7V15h-7v1.5z"}));t.a=i},532:function(e,t,n){"use strict";var r=n(0),o=n(11);const i=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"}));t.a=i},533:function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"Text",(function(){return L})),n.d(r,"block",(function(){return V})),n.d(r,"positive",(function(){return H})),n.d(r,"destructive",(function(){return R})),n.d(r,"muted",(function(){return N})),n.d(r,"highlighterText",(function(){return I})),n.d(r,"upperCase",(function(){return D}));var o=n(40),i=n(0),a=n(7),s=n(4),c=n.n(s),l=n(10),u=function({icon:e,size:t=24,...n}){return Object(i.cloneElement)(e,{width:t,height:t,...n})},d=n(11),f=Object(i.createElement)(d.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)(d.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),h=n(231),p=n(76),m=n(66),g=n(536),b=n(518),v=n(488),y=n(47),w=n(485),O=n(487);const x=Object(y.a)({name:"hdknak",styles:"display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"}),j="…",S={auto:"auto",head:"head",middle:"middle",tail:"tail",none:"none"},k={ellipsis:j,ellipsizeMode:S.auto,limit:0,numberOfLines:0};var E=n(169),C=n.n(E),_=n(213),A=n.n(_);let T;const M=C()((function(e){var t,n;if("string"!=typeof e)return"";if("string"==typeof(n=e)&&A()(n).isValid())return e;if(!e.includes("var("))return"";if("undefined"==typeof document)return"";const r=function(){if("undefined"!=typeof document){if(!T){const e=document.createElement("div");e.setAttribute("data-g2-color-computation-node",""),document.body.appendChild(e),T=e}return T}}();if(!r)return"";r.style.background=e;const o=null===(t=window)||void 0===t?void 0:t.getComputedStyle(r).background;return r.style.background="",o||""}));var z=n(139),P=n(64),F={colorDivider:"rgba(0, 0, 0, 0.1)",colorScrollbarThumb:"rgba(0, 0, 0, 0.2)",colorScrollbarThumbHover:"rgba(0, 0, 0, 0.5)",colorScrollbarTrack:"rgba(0, 0, 0, 0.04)",elevationIntensity:1,radiusBlockUi:"2px",borderWidth:"1px",borderWidthFocus:"1.5px",borderWidthTab:"4px",spinnerSize:"18px",fontSize:"13px",fontSizeH1:"calc(2.44 * 13px)",fontSizeH2:"calc(1.95 * 13px)",fontSizeH3:"calc(1.56 * 13px)",fontSizeH4:"calc(1.25 * 13px)",fontSizeH5:"13px",fontSizeH6:"calc(0.8 * 13px)",fontSizeInputMobile:"16px",fontSizeMobile:"15px",fontSizeSmall:"calc(0.92 * 13px)",fontSizeXSmall:"calc(0.75 * 13px)",fontLineHeightBase:"1.2",fontWeight:"normal",fontWeightHeading:"600",gridBase:"4px",controlPaddingX:"12px",controlPaddingXLarge:"calc(12px * 1.3334)",controlPaddingXSmall:"calc(12px / 1.3334)",controlBackgroundColor:z.a.white,controlBorderRadius:"2px",controlBorderColor:z.a.gray[700],controlBoxShadow:"transparent",controlBorderColorHover:z.a.gray[700],controlBoxShadowFocus:"0 0 0, 0.5px, "+z.a.admin,controlDestructiveBorderColor:z.a.alert.red,controlHeight:"30px",controlHeightLarge:"calc( 30px * 1.2 )",controlHeightSmall:"calc( 30px * 0.8 )",controlHeightXSmall:"calc( 30px * 0.6 )",cardBorderRadius:"2px",cardPaddingXSmall:""+Object(P.a)(2),cardPaddingSmall:""+Object(P.a)(4),cardPaddingMedium:`${Object(P.a)(4)} ${Object(P.a)(6)}`,cardPaddingLarge:`${Object(P.a)(6)} ${Object(P.a)(8)}`,surfaceBackgroundColor:z.a.white,surfaceBackgroundSubtleColor:"#F3F3F3",surfaceBackgroundTintColor:"#F5F5F5",surfaceBorderColor:"rgba(0, 0, 0, 0.1)",surfaceBorderBoldColor:"rgba(0, 0, 0, 0.15)",surfaceBorderSubtleColor:"rgba(0, 0, 0, 0.05)",surfaceBackgroundTertiaryColor:z.a.white,surfaceColor:z.a.white,transitionDuration:"200ms",transitionDurationFast:"160ms",transitionDurationFaster:"120ms",transitionDurationFastest:"100ms",transitionTimingFunction:"cubic-bezier(0.08, 0.52, 0.52, 1)",transitionTimingFunctionControl:"cubic-bezier(0.12, 0.8, 0.32, 1)"};const L=Object(y.a)("color:",z.a.black,";line-height:",F.fontLineHeightBase,";margin:0;",""),V=Object(y.a)({name:"4zleql",styles:"display:block"}),H=Object(y.a)("color:",z.a.alert.green,";",""),R=Object(y.a)("color:",z.a.alert.red,";",""),N=Object(y.a)("color:",z.a.mediumGray.text,";",""),I=Object(y.a)("mark{background:",z.a.alert.yellow,";border-radius:2px;box-shadow:0 0 0 1px rgba( 0, 0, 0, 0.05 ) inset,0 -1px 0 rgba( 0, 0, 0, 0.1 ) inset;}",""),D=Object(y.a)({name:"50zrmy",styles:"text-transform:uppercase"});var B=n(317);const $=C()(e=>{const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}),W={body:13,caption:10,footnote:11,largeTitle:28,subheadline:12,title:20};function G(e=13){if(e in W)return G(W[e]);if("number"!=typeof e){const t=parseFloat(e);if(Number.isNaN(t))return e;e=t}return`calc((${e} / 13) * ${F.fontSize})`}[1,2,3,4,5,6].flatMap(e=>[e,e.toString()]);var U=Object(v.a)({as:"span",useHook:function(e){const{adjustLineHeightForInnerControls:t,align:n,children:o,className:s,color:c,ellipsizeMode:l,isDestructive:u=!1,display:d,highlightEscape:f=!1,highlightCaseSensitive:h=!1,highlightWords:p,highlightSanitize:m,isBlock:g=!1,letterSpacing:b,lineHeight:v,optimizeReadabilityFor:E,size:C,truncate:_=!1,upperCase:T=!1,variant:H,weight:D=F.fontWeight,...W}=Object(w.a)(e,"Text");let U=o;const q=Array.isArray(p),K="caption"===C;if(q){if("string"!=typeof o)throw new TypeError("`children` of `Text` must only be `string` types when `highlightWords` is defined");U=function({activeClassName:e="",activeIndex:t=-1,activeStyle:n,autoEscape:r,caseSensitive:o=!1,children:a,findChunks:s,highlightClassName:c="",highlightStyle:l={},highlightTag:u="mark",sanitize:d,searchWords:f=[],unhighlightClassName:h="",unhighlightStyle:p}){if(!a)return null;if("string"!=typeof a)return a;const m=a,g=Object(B.findAll)({autoEscape:r,caseSensitive:o,findChunks:s,sanitize:d,searchWords:f,textToHighlight:m}),b=u;let v,y=-1,w="";return g.map((r,a)=>{const s=m.substr(r.start,r.end-r.start);if(r.highlight){let r;y++,r="object"==typeof c?o?c[s]:(c=$(c))[s.toLowerCase()]:c;const u=y===+t;w=`${r} ${u?e:""}`,v=!0===u&&null!==n?Object.assign({},l,n):l;const d={children:s,className:w,key:a,style:v};return"string"!=typeof b&&(d.highlightIndex=y),Object(i.createElement)(b,d)}return Object(i.createElement)("span",{children:s,className:h,key:a,style:p})})}({autoEscape:f,children:o,caseSensitive:h,searchWords:p,sanitize:m})}let Z;!0===_&&(Z="auto"),!1===_&&(Z="none");const X=function(e){const{className:t,children:n,ellipsis:r=j,ellipsizeMode:o=S.auto,limit:s=0,numberOfLines:c=0,...l}=Object(w.a)(e,"Truncate"),u=function(e="",t){const n={...k,...t},{ellipsis:r,ellipsizeMode:o,limit:i}=n;if(o===S.none)return e;let s,c;switch(o){case S.head:s=0,c=i;break;case S.middle:s=Math.floor(i/2),c=Math.floor(i/2);break;default:s=i,c=0}return o!==S.auto?function(e,t,n,r){if("string"!=typeof e)return"";const o=e.length,i=~~t,s=~~n,c=Object(a.isNil)(r)?j:r;return 0===i&&0===s||i>=o||s>=o||i+s>=o?e:0===s?e.slice(0,i)+c:e.slice(0,i)+c+e.slice(o-s)}(e,s,c,r):e}("string"==typeof n?n:"",{ellipsis:r,ellipsizeMode:o,limit:s,numberOfLines:c}),d=o===S.auto;return{...l,className:Object(i.useMemo)(()=>{const e={};return e.numberOfLines=Object(y.a)("-webkit-box-orient:vertical;-webkit-line-clamp:",c,";display:-webkit-box;overflow:hidden;",""),Object(y.b)(d&&!c&&x,d&&!!c&&e.numberOfLines,t)},[t,c,d]),children:u}}({...W,className:Object(i.useMemo)(()=>{const e={},o=function(e,t){if(t)return t;if(!e)return;let n=`calc(${F.controlHeight} + ${Object(P.a)(2)})`;switch(e){case"large":n=`calc(${F.controlHeightLarge} + ${Object(P.a)(2)})`;break;case"small":n=`calc(${F.controlHeightSmall} + ${Object(P.a)(2)})`;break;case"xSmall":n=`calc(${F.controlHeightXSmall} + ${Object(P.a)(2)})`}return n}(t,v);if(e.Base=Object(y.a)({color:c,display:d,fontSize:G(C),fontWeight:D,lineHeight:o,letterSpacing:b,textAlign:n},"",""),e.upperCase=Object(y.a)({name:"50zrmy",styles:"text-transform:uppercase"}),e.optimalTextColor=null,E){const t="dark"==("#000000"===function(e){const t=M(e);return A.a.isReadable(t,"#000000")?"#000000":"#ffffff"}(E)?"dark":"light");e.optimalTextColor=t?Object(y.a)({color:z.a.black},"",""):Object(y.a)({color:z.a.white},"","")}return Object(y.b)(L,e.Base,e.optimalTextColor,u&&R,!!q&&I,g&&V,K&&N,H&&r[H],T&&e.upperCase,s)},[t,n,s,c,d,g,K,u,q,b,v,E,C,T,H,D]),children:o,ellipsizeMode:l||Z});return!_&&Array.isArray(o)&&(U=i.Children.map(o,e=>Object(a.isPlainObject)(e)&&"props"in e&&Object(O.b)(e,["Link"])?Object(i.cloneElement)(e,{size:e.props.size||"inherit"}):e)),{...X,children:_?X.children:U}},name:"Text"}),q=n(1);const K=new RegExp(/-left/g),Z=new RegExp(/-right/g),X=new RegExp(/Left/g),Y=new RegExp(/Right/g);function J(e={},t){return()=>t?Object(q.isRTL)()?Object(m.a)(t,""):Object(m.a)(e,""):Object(q.isRTL)()?Object(m.a)(((e={})=>Object(a.mapKeys)(e,(e,t)=>function(e){return"left"===e?"right":"right"===e?"left":K.test(e)?e.replace(K,"-right"):Z.test(e)?e.replace(Z,"-left"):X.test(e)?e.replace(X,"Right"):Y.test(e)?e.replace(Y,"Left"):e}(t)))(e),""):Object(m.a)(e,"")}var Q={name:"1n8met0",styles:"padding-top:0"};const ee=()=>Q;var te={name:"1739oy8",styles:"z-index:1"};const ne=({isFocused:e})=>e?te:"";var re={name:"2o6p8u",styles:"justify-content:space-between"},oe={name:"14qk3ip",styles:"align-items:flex-start;flex-direction:column-reverse"},ie={name:"hbng6e",styles:"align-items:flex-start;flex-direction:column"};const ae=({labelPosition:e})=>{switch(e){case"top":return ie;case"bottom":return oe;case"edge":return re;default:return""}},se=Object(p.a)(g.a,{target:"e1cr7zh17"})("position:relative;border-radius:2px;",ee," ",ne," ",ae,";");var ce={name:"wyxldh",styles:"margin:0 !important"},le={name:"1d3w5wq",styles:"width:100%"};const ue=Object(p.a)("div",{target:"e1cr7zh16"})("align-items:center;box-sizing:border-box;border-radius:inherit;display:flex;flex:1;position:relative;",({disabled:e})=>{const t=e?z.a.ui.backgroundDisabled:z.a.ui.background;return Object(m.a)({backgroundColor:t},"","")}," ",({hideLabel:e})=>e?ce:null," ",({__unstableInputWidth:e,labelPosition:t})=>e?"side"===t?"":"edge"===t?Object(m.a)({flex:"0 0 "+e},"",""):Object(m.a)({width:e},"",""):le,";");var de={name:"103r1kr",styles:"&::-webkit-input-placeholder{line-height:normal;}"};Object(p.a)("input",{target:"e1cr7zh15"})("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:",z.a.black,";display:block;margin:0;outline:none;padding-left:8px;padding-right:8px;width:100%;",({isDragging:e,dragCursor:t})=>{let n="",r="";return e&&(n=Object(m.a)("cursor:",t,";user-select:none;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}","")),e&&t&&(r=Object(m.a)("&:active{cursor:",t,";}","")),Object(m.a)(n," ",r,";","")}," ",({disabled:e})=>e?Object(m.a)({color:z.a.ui.textDisabled},"",""):""," ",({size:e})=>{const t={default:"13px",small:"11px"}[e];return t?Object(m.a)("font-size:","16px",";@media ( min-width: 600px ){font-size:",t,";}",""):""}," ",({size:e})=>{const t={default:{height:30,lineHeight:1,minHeight:30},small:{height:24,lineHeight:1,minHeight:24}},n=t[e]||t.default;return Object(m.a)(n,"","")}," ",()=>de,";}");var fe={name:"1h52dri",styles:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap"};const he=()=>fe,pe=({labelPosition:e})=>{let t=4;return"edge"!==e&&"side"!==e||(t=0),Object(m.a)({paddingTop:0,paddingBottom:t},"","")},me=Object(p.a)(U,{target:"e1cr7zh14"})("&&&{box-sizing:border-box;color:currentColor;display:block;margin:0;max-width:100%;z-index:1;",pe," ",he,";}"),ge=e=>Object(i.createElement)(me,Object(o.a)({},e,{as:"label"})),be=Object(p.a)(b.a,{target:"e1cr7zh13"})({name:"1b6uupn",styles:"max-width:calc( 100% - 10px )"}),ve=Object(p.a)("div",{target:"e1cr7zh12"})("&&&{box-sizing:border-box;border-radius:inherit;bottom:0;left:0;margin:0;padding:0;pointer-events:none;position:absolute;right:0;top:0;",({disabled:e,isFocused:t})=>{let n=t?z.a.ui.borderFocus:z.a.ui.border,r=null;return t&&(r=`0 0 0 1px ${z.a.ui.borderFocus} inset`),e&&(n=z.a.ui.borderDisabled),Object(m.a)({boxShadow:r,borderColor:n,borderStyle:"solid",borderWidth:1},"","")}," ",J({paddingLeft:2}),";}"),ye=Object(p.a)("span",{target:"e1cr7zh11"})({name:"pvvbxf",styles:"box-sizing:border-box;display:block"}),we=Object(p.a)("span",{target:"e1cr7zh10"})({name:"pvvbxf",styles:"box-sizing:border-box;display:block"});var Oe=Object(i.memo)((function({disabled:e=!1,isFocused:t=!1}){return Object(i.createElement)(ve,{"aria-hidden":"true",className:"components-input-control__backdrop",disabled:e,isFocused:t})})),xe=n(128);function je({children:e,hideLabelFromVision:t,htmlFor:n,...r}){return e?t?Object(i.createElement)(xe.a,{as:"label",htmlFor:n},e):Object(i.createElement)(ge,Object(o.a)({htmlFor:n},r),e):null}var Se=Object(i.forwardRef)((function e({__unstableInputWidth:t,children:n,className:r,disabled:a=!1,hideLabelFromVision:s=!1,labelPosition:c,id:u,isFocused:d=!1,label:f,prefix:h,size:p="default",suffix:m,...g},b){const v=function(t){const n=Object(l.useInstanceId)(e);return t||"input-base-control-"+n}(u),y=s||!f;return Object(i.createElement)(se,Object(o.a)({},g,function({labelPosition:e}){const t={};switch(e){case"top":t.direction="column",t.gap=0;break;case"bottom":t.direction="column-reverse",t.gap=0;break;case"edge":t.justify="space-between"}return t}({labelPosition:c}),{className:r,isFocused:d,labelPosition:c,ref:b,__unstableVersion:"next"}),Object(i.createElement)(be,null,Object(i.createElement)(je,{className:"components-input-control__label",hideLabelFromVision:s,labelPosition:c,htmlFor:v,size:p},f)),Object(i.createElement)(ue,{__unstableInputWidth:t,className:"components-input-control__container",disabled:a,hideLabel:y,isFocused:d,labelPosition:c},h&&Object(i.createElement)(ye,{className:"components-input-control__prefix"},h),n,m&&Object(i.createElement)(we,{className:"components-input-control__suffix"},m),Object(i.createElement)(Oe,{"aria-hidden":"true",disabled:a,isFocused:d,label:f,size:p})))}));const ke=Object(p.a)("select",{target:"e12x0a391"})("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:",z.a.black,";display:block;margin:0;width:100%;",({disabled:e})=>e?Object(m.a)({color:z.a.ui.textDisabled},"",""):"",";",({size:e})=>{const t={default:"13px",small:"11px"}[e];return t?Object(m.a)("font-size:","16px",";@media ( min-width: 600px ){font-size:",t,";}",""):""},";",({size:e})=>{const t={default:{height:30,lineHeight:1,minHeight:30},small:{height:24,lineHeight:1,minHeight:24}},n=t[e]||t.default;return Object(m.a)(n,"","")},";",J({paddingLeft:8,paddingRight:24})(),";}"),Ee=Object(p.a)("div",{target:"e12x0a390"})("align-items:center;bottom:0;box-sizing:border-box;display:flex;padding:0 4px;pointer-events:none;position:absolute;top:0;",J({right:0})()," svg{display:block;}");const Ce=Object(i.forwardRef)((function e({className:t,disabled:n=!1,help:r,hideLabelFromVision:s,id:d,label:p,multiple:m=!1,onBlur:g=a.noop,onChange:b=a.noop,onFocus:v=a.noop,options:y=[],size:w="default",value:O,labelPosition:x="top",...j},S){const[k,E]=Object(i.useState)(!1),C=function(t){const n=Object(l.useInstanceId)(e);return t||"inspector-select-control-"+n}(d),_=r?C+"__help":void 0;if(Object(a.isEmpty)(y))return null;const A=c()("components-select-control",t);return Object(i.createElement)(h.a,{help:r},Object(i.createElement)(Se,Object(o.a)({className:A,disabled:n,hideLabelFromVision:s,id:C,isFocused:k,label:p,size:w,suffix:Object(i.createElement)(Ee,null,Object(i.createElement)(u,{icon:f,size:18})),labelPosition:x},j),Object(i.createElement)(ke,Object(o.a)({},j,{"aria-describedby":_,className:"components-select-control__input",disabled:n,id:C,multiple:m,onBlur:e=>{g(e),E(!1)},onChange:e=>{if(m){const t=[...e.target.options].filter(({selected:e})=>e).map(({value:e})=>e);b(t)}else b(e.target.value,{event:e})},onFocus:e=>{v(e),E(!0)},ref:S,size:w,value:O}),y.map((e,t)=>{const n=e.id||`${e.label}-${e.value}-${t}`;return Object(i.createElement)("option",{key:n,value:e.value,disabled:e.disabled},e.label)}))))}));t.a=Ce},534:function(e,t,n){"use strict";var r=n(0),o=n(4),i=n.n(o),a=n(7),s=n(1),c=n(10),l=n(53),u=n(45),d=n(520),f=n(229),h=n(230),p=n(231),m=n(130),g=n(536),b=n(488),v=n(485),y=n(318),w=Object(b.a)({as:"div",useHook:function(e){const t=Object(v.a)(e,"FlexBlock");return Object(y.a)({isBlock:!0,...t})},name:"FlexBlock"}),O=n(518),x=n(40);const j=Object(c.createHigherOrderComponent)(e=>t=>{const[n,o]=Object(r.useState)(),i=Object(r.useCallback)(e=>o(()=>null!=e&&e.handleFocusOutside?e.handleFocusOutside.bind(e):void 0),[]);return Object(r.createElement)("div",Object(c.__experimentalUseFocusOutside)(n),Object(r.createElement)(e,Object(x.a)({ref:i},t)))},"withFocusOutside")(class extends r.Component{handleFocusOutside(e){this.props.onFocusOutside(e)}render(){return this.props.children}});t.a=function e({value:t,label:n,options:o,onChange:b,onFilterValueChange:v=a.noop,hideLabelFromVision:y,help:x,allowReset:S=!0,className:k,messages:E={selected:Object(s.__)("Item selected.")}}){var C;const _=Object(c.useInstanceId)(e),[A,T]=Object(r.useState)(null),[M,z]=Object(r.useState)(!1),[P,F]=Object(r.useState)(!1),[L,V]=Object(r.useState)(""),H=Object(r.useRef)(),R=o.find(e=>e.value===t),N=null!==(C=null==R?void 0:R.label)&&void 0!==C?C:"",I=Object(r.useMemo)(()=>{const e=[],t=[],n=Object(a.deburr)(L.toLocaleLowerCase());return o.forEach(r=>{const o=Object(a.deburr)(r.label).toLocaleLowerCase().indexOf(n);0===o?e.push(r):o>0&&t.push(r)}),e.concat(t)},[L,o,t]),D=e=>{b(e.value),Object(u.speak)(E.selected,"assertive"),T(e),V(""),z(!1)},B=(e=1)=>{let t=I.indexOf(A)+e;t<0?t=I.length-1:t>=I.length&&(t=0),T(I[t]),z(!0)};return Object(r.useEffect)(()=>{const e=I.length>0;if(M){const t=e?Object(s.sprintf)( +/* translators: %d: number of results. */ +Object(s._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",I.length),I.length):Object(s.__)("No results.");Object(u.speak)(t,"polite")}},[I,M]),Object(r.createElement)(j,{onFocusOutside:()=>{z(!1)}},Object(r.createElement)(p.a,{className:i()(k,"components-combobox-control"),tabIndex:"-1",label:n,id:"components-form-token-input-"+_,hideLabelFromVision:y,help:x},Object(r.createElement)("div",{className:"components-combobox-control__suggestions-container",tabIndex:"-1",onKeyDown:e=>{let t=!1;switch(e.keyCode){case l.ENTER:A&&(D(A),t=!0);break;case l.UP:B(-1),t=!0;break;case l.DOWN:B(1),t=!0;break;case l.ESCAPE:z(!1),T(null),t=!0,e.stopPropagation()}t&&e.preventDefault()}},Object(r.createElement)(g.a,null,Object(r.createElement)(w,null,Object(r.createElement)(f.a,{className:"components-combobox-control__input",instanceId:_,ref:H,value:M?L:N,"aria-label":N?`${N}, ${n}`:null,onFocus:()=>{F(!0),z(!0),v(""),V("")},onBlur:()=>{F(!1)},isExpanded:M,selectedSuggestionIndex:I.indexOf(A),onChange:e=>{const t=e.value;V(t),v(t),P&&z(!0)}})),S&&Object(r.createElement)(O.a,null,Object(r.createElement)(m.a,{className:"components-combobox-control__reset",icon:d.a,disabled:!t,onClick:()=>{b(null),H.current.input.focus()},label:Object(s.__)("Reset")}))),M&&Object(r.createElement)(h.a,{instanceId:_,match:{label:L},displayTransform:e=>e.label,suggestions:I,selectedIndex:I.indexOf(A),onHover:T,onSelect:D,scrollIntoView:!0}))))}},535:function(e,t,n){"use strict";var r=n(0),o=n(7),i=n(4),a=n.n(i),s=n(1),c=n(10),l=n(53),u=n(22),d=n.n(u),f=n(520),h=n(130),p=n(128);function m({value:e,status:t,title:n,displayTransform:i,isBorderless:l=!1,disabled:u=!1,onClickRemove:d=o.noop,onMouseEnter:g,onMouseLeave:b,messages:v,termPosition:y,termsCount:w}){const O=Object(c.useInstanceId)(m),x=a()("components-form-token-field__token",{"is-error":"error"===t,"is-success":"success"===t,"is-validating":"validating"===t,"is-borderless":l,"is-disabled":u}),j=i(e),S=Object(s.sprintf)( +/* translators: 1: term name, 2: term position in a set of terms, 3: total term set count. */ +Object(s.__)("%1$s (%2$s of %3$s)"),j,y,w);return Object(r.createElement)("span",{className:x,onMouseEnter:g,onMouseLeave:b,title:n},Object(r.createElement)("span",{className:"components-form-token-field__token-text",id:"components-form-token-field__token-text-"+O},Object(r.createElement)(p.a,{as:"span"},S),Object(r.createElement)("span",{"aria-hidden":"true"},j)),Object(r.createElement)(h.a,{className:"components-form-token-field__remove-token",icon:f.a,onClick:!u&&(()=>d({value:e})),label:v.remove,"aria-describedby":"components-form-token-field__token-text-"+O}))}var g=n(229),b=n(230),v=n(40),y=n(45),w=Object(c.createHigherOrderComponent)(e=>t=>Object(r.createElement)(e,Object(v.a)({},t,{speak:y.speak,debouncedSpeak:Object(c.useDebounce)(y.speak,500)})),"withSpokenMessages");const O={incompleteTokenValue:"",inputOffsetFromEnd:0,isActive:!1,isExpanded:!1,selectedSuggestionIndex:-1,selectedSuggestionScroll:!1};class x extends r.Component{constructor(){super(...arguments),this.state=O,this.onKeyDown=this.onKeyDown.bind(this),this.onKeyPress=this.onKeyPress.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.deleteTokenBeforeInput=this.deleteTokenBeforeInput.bind(this),this.deleteTokenAfterInput=this.deleteTokenAfterInput.bind(this),this.addCurrentToken=this.addCurrentToken.bind(this),this.onContainerTouched=this.onContainerTouched.bind(this),this.renderToken=this.renderToken.bind(this),this.onTokenClickRemove=this.onTokenClickRemove.bind(this),this.onSuggestionHovered=this.onSuggestionHovered.bind(this),this.onSuggestionSelected=this.onSuggestionSelected.bind(this),this.onInputChange=this.onInputChange.bind(this),this.bindInput=this.bindInput.bind(this),this.bindTokensAndInput=this.bindTokensAndInput.bind(this),this.updateSuggestions=this.updateSuggestions.bind(this)}componentDidUpdate(e){this.state.isActive&&!this.input.hasFocus()&&this.input.focus();const{suggestions:t,value:n}=this.props,r=!d()(t,e.suggestions);(r||n!==e.value)&&this.updateSuggestions(r)}static getDerivedStateFromProps(e,t){return e.disabled&&t.isActive?{isActive:!1,incompleteTokenValue:""}:null}bindInput(e){this.input=e}bindTokensAndInput(e){this.tokensAndInput=e}onFocus(e){const{__experimentalExpandOnFocus:t}=this.props;this.input.hasFocus()||e.target===this.tokensAndInput?this.setState({isActive:!0,isExpanded:!!t||this.state.isExpanded}):this.setState({isActive:!1}),"function"==typeof this.props.onFocus&&this.props.onFocus(e)}onBlur(){this.inputHasValidValue()?this.setState({isActive:!1}):this.setState(O)}onKeyDown(e){let t=!1;switch(e.keyCode){case l.BACKSPACE:t=this.handleDeleteKey(this.deleteTokenBeforeInput);break;case l.ENTER:t=this.addCurrentToken();break;case l.LEFT:t=this.handleLeftArrowKey();break;case l.UP:t=this.handleUpArrowKey();break;case l.RIGHT:t=this.handleRightArrowKey();break;case l.DOWN:t=this.handleDownArrowKey();break;case l.DELETE:t=this.handleDeleteKey(this.deleteTokenAfterInput);break;case l.SPACE:this.props.tokenizeOnSpace&&(t=this.addCurrentToken());break;case l.ESCAPE:t=this.handleEscapeKey(e),e.stopPropagation()}t&&e.preventDefault()}onKeyPress(e){let t=!1;switch(e.charCode){case 44:t=this.handleCommaKey()}t&&e.preventDefault()}onContainerTouched(e){e.target===this.tokensAndInput&&this.state.isActive&&e.preventDefault()}onTokenClickRemove(e){this.deleteToken(e.value),this.input.focus()}onSuggestionHovered(e){const t=this.getMatchingSuggestions().indexOf(e);t>=0&&this.setState({selectedSuggestionIndex:t,selectedSuggestionScroll:!1})}onSuggestionSelected(e){this.addNewToken(e)}onInputChange(e){const t=e.value,n=this.props.tokenizeOnSpace?/[ ,\t]+/:/[,\t]+/,r=t.split(n),i=Object(o.last)(r)||"";r.length>1&&this.addNewTokens(r.slice(0,-1)),this.setState({incompleteTokenValue:i},this.updateSuggestions),this.props.onInputChange(i)}handleDeleteKey(e){let t=!1;return this.input.hasFocus()&&this.isInputEmpty()&&(e(),t=!0),t}handleLeftArrowKey(){let e=!1;return this.isInputEmpty()&&(this.moveInputBeforePreviousToken(),e=!0),e}handleRightArrowKey(){let e=!1;return this.isInputEmpty()&&(this.moveInputAfterNextToken(),e=!0),e}handleUpArrowKey(){return this.setState((e,t)=>({selectedSuggestionIndex:(0===e.selectedSuggestionIndex?this.getMatchingSuggestions(e.incompleteTokenValue,t.suggestions,t.value,t.maxSuggestions,t.saveTransform).length:e.selectedSuggestionIndex)-1,selectedSuggestionScroll:!0})),!0}handleDownArrowKey(){return this.setState((e,t)=>({selectedSuggestionIndex:(e.selectedSuggestionIndex+1)%this.getMatchingSuggestions(e.incompleteTokenValue,t.suggestions,t.value,t.maxSuggestions,t.saveTransform).length,selectedSuggestionScroll:!0})),!0}handleEscapeKey(e){return this.setState({incompleteTokenValue:e.target.value,isExpanded:!1,selectedSuggestionIndex:-1,selectedSuggestionScroll:!1}),!0}handleCommaKey(){return this.inputHasValidValue()&&this.addNewToken(this.state.incompleteTokenValue),!0}moveInputToIndex(e){this.setState((t,n)=>({inputOffsetFromEnd:n.value.length-Math.max(e,-1)-1}))}moveInputBeforePreviousToken(){this.setState((e,t)=>({inputOffsetFromEnd:Math.min(e.inputOffsetFromEnd+1,t.value.length)}))}moveInputAfterNextToken(){this.setState(e=>({inputOffsetFromEnd:Math.max(e.inputOffsetFromEnd-1,0)}))}deleteTokenBeforeInput(){const e=this.getIndexOfInput()-1;e>-1&&this.deleteToken(this.props.value[e])}deleteTokenAfterInput(){const e=this.getIndexOfInput();e!this.valueContainsToken(e)));if(t.length>0){const e=Object(o.clone)(this.props.value);e.splice.apply(e,[this.getIndexOfInput(),0].concat(t)),this.props.onChange(e)}}addNewToken(e){const{__experimentalExpandOnFocus:t,__experimentalValidateInput:n}=this.props;n(e)?(this.addNewTokens([e]),this.props.speak(this.props.messages.added,"assertive"),this.setState({incompleteTokenValue:"",selectedSuggestionIndex:-1,selectedSuggestionScroll:!1,isExpanded:!t}),this.state.isActive&&this.input.focus()):this.props.speak(this.props.messages.__experimentalInvalid,"assertive")}deleteToken(e){const t=this.props.value.filter(t=>this.getTokenValue(t)!==this.getTokenValue(e));this.props.onChange(t),this.props.speak(this.props.messages.removed,"assertive")}getTokenValue(e){return"object"==typeof e?e.value:e}getMatchingSuggestions(e=this.state.incompleteTokenValue,t=this.props.suggestions,n=this.props.value,r=this.props.maxSuggestions,i=this.props.saveTransform){let a=i(e);const s=[],c=[];return 0===a.length?t=Object(o.difference)(t,n):(a=a.toLocaleLowerCase(),Object(o.each)(t,e=>{const t=e.toLocaleLowerCase().indexOf(a);-1===n.indexOf(e)&&(0===t?s.push(e):t>0&&c.push(e))}),t=s.concat(c)),Object(o.take)(t,r)}getSelectedSuggestion(){if(-1!==this.state.selectedSuggestionIndex)return this.getMatchingSuggestions()[this.state.selectedSuggestionIndex]}valueContainsToken(e){return Object(o.some)(this.props.value,t=>this.getTokenValue(e)===this.getTokenValue(t))}getIndexOfInput(){return this.props.value.length-this.state.inputOffsetFromEnd}isInputEmpty(){return 0===this.state.incompleteTokenValue.length}inputHasValidValue(){return this.props.saveTransform(this.state.incompleteTokenValue).length>0}updateSuggestions(e=!0){const{__experimentalExpandOnFocus:t}=this.props,{incompleteTokenValue:n}=this.state,r=n.trim().length>1,o=this.getMatchingSuggestions(n),i=o.length>0,a={isExpanded:t||r&&i};if(e&&(a.selectedSuggestionIndex=-1,a.selectedSuggestionScroll=!1),this.setState(a),r){const{debouncedSpeak:e}=this.props;e(i?Object(s.sprintf)( +/* translators: %d: number of results. */ +Object(s._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",o.length),o.length):Object(s.__)("No results."),"assertive")}}renderTokensAndInput(){const e=Object(o.map)(this.props.value,this.renderToken);return e.splice(this.getIndexOfInput(),0,this.renderInput()),e}renderToken(e,t,n){const o=this.getTokenValue(e),i=e.status?e.status:void 0,a=t+1,s=n.length;return Object(r.createElement)(m,{key:"token-"+o,value:o,status:i,title:e.title,displayTransform:this.props.displayTransform,onClickRemove:this.onTokenClickRemove,isBorderless:e.isBorderless||this.props.isBorderless,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,disabled:"error"!==i&&this.props.disabled,messages:this.props.messages,termsCount:s,termPosition:a})}renderInput(){const{autoCapitalize:e,autoComplete:t,maxLength:n,placeholder:o,value:i,instanceId:a}=this.props;let s={instanceId:a,autoCapitalize:e,autoComplete:t,placeholder:0===i.length?o:"",ref:this.bindInput,key:"input",disabled:this.props.disabled,value:this.state.incompleteTokenValue,onBlur:this.onBlur,isExpanded:this.state.isExpanded,selectedSuggestionIndex:this.state.selectedSuggestionIndex};return n&&i.length>=n||(s={...s,onChange:this.onInputChange}),Object(r.createElement)(g.a,s)}render(){const{disabled:e,label:t=Object(s.__)("Add item"),instanceId:n,className:o,__experimentalShowHowTo:i}=this.props,{isExpanded:c}=this.state,l=a()(o,"components-form-token-field__input-container",{"is-active":this.state.isActive,"is-disabled":e});let u={className:"components-form-token-field",tabIndex:"-1"};const d=this.getMatchingSuggestions();return e||(u=Object.assign({},u,{onKeyDown:this.onKeyDown,onKeyPress:this.onKeyPress,onFocus:this.onFocus})),Object(r.createElement)("div",u,Object(r.createElement)("label",{htmlFor:"components-form-token-input-"+n,className:"components-form-token-field__label"},t),Object(r.createElement)("div",{ref:this.bindTokensAndInput,className:l,tabIndex:"-1",onMouseDown:this.onContainerTouched,onTouchStart:this.onContainerTouched},this.renderTokensAndInput(),c&&Object(r.createElement)(b.a,{instanceId:n,match:this.props.saveTransform(this.state.incompleteTokenValue),displayTransform:this.props.displayTransform,suggestions:d,selectedIndex:this.state.selectedSuggestionIndex,scrollIntoView:this.state.selectedSuggestionScroll,onHover:this.onSuggestionHovered,onSelect:this.onSuggestionSelected})),i&&Object(r.createElement)("p",{id:"components-form-token-suggestions-howto-"+n,className:"components-form-token-field__help"},this.props.tokenizeOnSpace?Object(s.__)("Separate with commas, spaces, or the Enter key."):Object(s.__)("Separate with commas or the Enter key.")))}}x.defaultProps={suggestions:Object.freeze([]),maxSuggestions:100,value:Object.freeze([]),displayTransform:o.identity,saveTransform:e=>e.trim(),onChange:()=>{},onInputChange:()=>{},isBorderless:!1,disabled:!1,tokenizeOnSpace:!1,messages:{added:Object(s.__)("Item added."),removed:Object(s.__)("Item removed."),remove:Object(s.__)("Remove item"),__experimentalInvalid:Object(s.__)("Invalid item")},__experimentalExpandOnFocus:!1,__experimentalValidateInput:()=>!0,__experimentalShowHowTo:!0},t.a=w(Object(c.withInstanceId)(x))},536:function(e,t,n){"use strict";var r=n(40),o=n(0),i=n(487),a=n(47),s=n(51),c=n.n(s),l=n(485);const u=["40em","52em","64em"];var d=n(64),f=n(163);function h(e){const{align:t="center",className:n,direction:r="row",expanded:i=!0,gap:s=2,justify:h="space-between",wrap:p=!1,...m}=Object(l.a)(function({isReversed:e,...t}){return void 0!==e?(c()("Flex isReversed",{alternative:'Flex direction="row-reverse" or "column-reverse"',since:"5.9"}),{...t,direction:e?"row-reverse":"row"}):t}(e),"Flex"),g=function(e,t={}){const n=((e={})=>{const{defaultIndex:t=0}=e;if("number"!=typeof t)throw new TypeError(`Default breakpoint index should be a number. Got: ${t}, ${typeof t}`);if(t<0||t>u.length-1)throw new RangeError(`Default breakpoint index out of range. Theme has ${u.length} breakpoints, got index ${t}`);const[n,r]=Object(o.useState)(t);return Object(o.useEffect)(()=>{const e=()=>{const e=u.filter(e=>"undefined"!=typeof window&&window.matchMedia(`screen and (min-width: ${e})`).matches).length;n!==e&&r(e)};return e(),"undefined"!=typeof document&&document.addEventListener("resize",e),()=>{"undefined"!=typeof document&&document.removeEventListener("resize",e)}},[n]),n})(t);if(!Array.isArray(e)&&"function"!=typeof e)return e;const r=e||[];return r[n>=r.length?r.length-1:n]}(Array.isArray(r)?r:[r]),b="string"==typeof g&&!!g.includes("column"),v="string"==typeof g&&g.includes("reverse");return{...m,className:Object(o.useMemo)(()=>{const e={};return e.Base=Object(a.a)({alignItems:b?"normal":t,flexDirection:g,flexWrap:p?"wrap":void 0,justifyContent:h,height:b&&i?"100%":void 0,width:!b&&i?"100%":void 0,marginBottom:p?`calc(${Object(d.a)(s)} * -1)`:void 0},"",""),e.Items=Object(a.a)({"> * + *:not(marquee)":{marginTop:b?Object(d.a)(s):void 0,marginRight:!b&&v?Object(d.a)(s):void 0,marginLeft:b||v?void 0:Object(d.a)(s)}},"",""),e.WrapItems=Object(a.a)({"> *:not(marquee)":{marginBottom:Object(d.a)(s),marginLeft:!b&&v?Object(d.a)(s):void 0,marginRight:b||v?void 0:Object(d.a)(s)},"> *:last-child:not(marquee)":{marginLeft:!b&&v?0:void 0,marginRight:b||v?void 0:0}},"",""),Object(a.b)(f.a,e.Base,p?e.WrapItems:e.Items,b?f.c:f.d,n)},[t,n,g,i,s,b,v,h,p]),isColumn:b}}var p=n(227),m=n(486);const g=Object(i.a)((function(e,t){const{children:n,isColumn:i,...a}=h(e);return Object(o.createElement)(p.a.Provider,{value:{flexItemDisplay:i?"block":void 0}},Object(o.createElement)(m.a,Object(r.a)({},a,{ref:t}),n))}),"Flex");t.a=g},6:function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t96?f:h},m=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},g=o.useInsertionEffect?o.useInsertionEffect:function(e){e()},b=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return u(t,n,r),g((function(){return function(e,t,n){u(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}}(t,n,r)})),null};t.a=function e(t,n){var i,a,s=t.__emotion_real===t,u=s&&t.__emotion_base||t;void 0!==n&&(i=n.label,a=n.target);var f=m(t,n,s),h=f||p(u),g=!h("as");return function(){var v=arguments,y=s&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==i&&y.push("label:"+i+";"),null==v[0]||void 0===v[0].raw)y.push.apply(y,v);else{y.push(v[0][0]);for(var w=v.length,O=1;O array('wp-blocks', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'b87861e9b6a5f73cc203d7c447078ff3'); \ No newline at end of file diff --git a/build/wc-blocks.js b/build/wc-blocks.js new file mode 100644 index 00000000000..454c44d2a3c --- /dev/null +++ b/build/wc-blocks.js @@ -0,0 +1 @@ +this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["wc-blocks"]=function(t){function e(e){for(var c,s,i=e[0],l=e[1],a=e[2],p=0,b=[];p{let{className:e,height:o,width:r,...n}=t;return Object(c.createElement)(l.SVG,i()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 245 145",className:u()("woo-icon",e),width:r,height:o},n),Object(c.createElement)("path",{fill:"#7f54b3",d:"M22.76 0h199.1a22.77 22.77 0 0 1 22.8 22.76v75.92a22.77 22.77 0 0 1-22.78 22.78h-71.41l9.77 24-43.13-24H22.76C10.1946 121.449.011 111.2654 0 98.7V22.76C.011 10.1946 10.1946.011 22.76 0z"}),Object(c.createElement)("path",{fill:"#FFF",fillRule:"nonzero",d:"M12.32 20.63a8.16 8.16 0 0 1 6.25-3.09c5.0733-.36 7.9867 2.0333 8.74 7.18 3.14 20.86 6.4933 38.5633 10.06 53.11l21.92-41.69c2-3.76 4.49-5.76 7.52-6 4.3867-.3067 7.13 2.49 8.23 8.39a186 186 0 0 0 9.47 34.23c2.62-25.38 7.0133-43.7133 13.18-55a7.73 7.73 0 0 1 6.6-4.43 8.8 8.8 0 0 1 6.32 2 7.75 7.75 0 0 1 3.05 5.74 8.52 8.52 0 0 1-1 4.77c-3.9 7.24-7.12 19.28-9.66 36.12-2.48 16.2533-3.3967 28.9633-2.75 38.13a12.25 12.25 0 0 1-1.16 6.56 6.32 6.32 0 0 1-5.33 3.53c-2.6667.18-5.3033-1.0567-7.91-3.71-9.2933-9.54-16.6567-23.7267-22.09-42.56C57.3 76.7167 52.48 86.3333 49.3 92.76c-5.86 11.3333-10.89 17.13-15.09 17.39-2.7333.1933-5.0667-2.0933-7-6.86-5.1-13.0933-10.5833-38.4033-16.45-75.93a8.56 8.56 0 0 1 1.56-6.73zM227.23 36.34a23.17 23.17 0 0 0-16-11.59 26.25 26.25 0 0 0-5.42-.58c-9.5867 0-17.41 5-23.47 15a53 53 0 0 0-7.78 28.16c0 7.7333 1.6167 14.3333 4.85 19.8a23.15 23.15 0 0 0 16 11.59 26.28 26.28 0 0 0 5.42.59c9.68 0 17.5033-5 23.47-15A53.89 53.89 0 0 0 232.08 56c0-7.7333-1.6167-14.2867-4.85-19.66zm-12.61 27.72c-1.3733 6.56-3.9167 11.5-7.63 14.82-2.9267 2.6667-5.6133 3.7433-8.06 3.23-2.4467-.5133-4.4033-2.6667-5.87-6.46a25.68 25.68 0 0 1-1.76-9.09 35.9 35.9 0 0 1 .73-7.34 33 33 0 0 1 5.28-11.88c3.3333-4.8933 6.8067-6.9467 10.42-6.16 2.44.4867 4.3933 2.64 5.86 6.46a25.68 25.68 0 0 1 1.76 9.12 35.73 35.73 0 0 1-.73 7.33v-.03zM164.57 36.34a23.2 23.2 0 0 0-16-11.59 26.42 26.42 0 0 0-5.43-.58c-9.5933 0-17.4167 5-23.47 15a53 53 0 0 0-7.78 28.16c0 7.7333 1.6133 14.3333 4.84 19.8a23.19 23.19 0 0 0 16 11.59 26.44 26.44 0 0 0 5.43.59c9.68 0 17.5033-5 23.47-15A53.88 53.88 0 0 0 169.4 56c0-7.7333-1.6133-14.2867-4.84-19.66h.01zm-12.61 27.72c-1.3667 6.56-3.91 11.5-7.63 14.82-2.93 2.64-5.63 3.72-8.07 3.23-2.44-.49-4.4-2.64-5.86-6.46a25.7 25.7 0 0 1-1.77-9.09 35.9 35.9 0 0 1 .74-7.34 33 33 0 0 1 5.28-11.88c3.3333-4.8933 6.8067-6.9467 10.42-6.16 2.44.4867 4.3933 2.64 5.86 6.46a25.91 25.91 0 0 1 1.76 9.12 35.73 35.73 0 0 1-.73 7.33v-.03z"}))},null),b=o(113),m=(o(348),o(349),o(24)),d=o.n(m),f=o(10),w=o(48);const h=Object(f.createHigherOrderComponent)(t=>{class e extends c.Component{constructor(){super(...arguments),d()(this,"mounted",!1)}componentDidMount(){const{block:t,setAttributes:e}=this.props;t.name.startsWith("woocommerce/")&&e(this.getAttributesWithDefaults())}componentDidUpdate(){this.props.block.name.startsWith("woocommerce/")&&!this.mounted&&(this.mounted=!0)}getAttributesWithDefaults(){const t=Object(r.getBlockType)(this.props.block.name);let e=this.props.attributes;return!this.mounted&&this.props.block.name.startsWith("woocommerce/")&&void 0!==t.attributes&&void 0!==t.defaults&&(e=Object.assign({},this.props.attributes||{}),Object.keys(t.attributes).map(o=>(void 0===e[o]&&void 0!==t.defaults[o]&&(e[o]=t.defaults[o]),o))),e}render(){return Object(c.createElement)(t,i()({},this.props,{attributes:this.getAttributesWithDefaults()}))}}return e},"withDefaultAttributes");Object(w.addFilter)("editor.BlockListBlock","woocommerce-blocks/block-list-block",h),Object(w.addFilter)("blocks.getBlockAttributes","woocommerce-blocks/get-block-attributes",(t,e)=>(e.name.startsWith("woocommerce/")&&Object.keys(e.attributes).map(o=>(void 0===t[o]&&void 0!==e.defaults&&void 0!==e.defaults[o]&&(t[o]=e.defaults[o]),o)),t)),Object(r.setCategories)([...Object(r.getCategories)().filter(t=>{let{slug:e}=t;return"woocommerce"!==e&&"woocommerce-product-elements"!==e}),{slug:"woocommerce",title:Object(n.__)("WooCommerce","woo-gutenberg-products-block"),icon:Object(c.createElement)(b.a,{icon:p})},{slug:"woocommerce-product-elements",title:Object(n.__)("WooCommerce Product Elements","woo-gutenberg-products-block"),icon:Object(c.createElement)(b.a,{icon:p,className:"wc-block-editor-components-block-icon"})}])},48:function(t,e){t.exports=window.wp.hooks},8:function(t,e){t.exports=window.wp.blocks}}); \ No newline at end of file diff --git a/build/wc-payment-method-bacs.asset.php b/build/wc-payment-method-bacs.asset.php new file mode 100644 index 00000000000..dc979fee0f9 --- /dev/null +++ b/build/wc-payment-method-bacs.asset.php @@ -0,0 +1 @@ + array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill'), 'version' => '4e767d2c382b1fe10d3192e3c3212382'); \ No newline at end of file diff --git a/build/wc-payment-method-bacs.js b/build/wc-payment-method-bacs.js new file mode 100644 index 00000000000..7b4cc757f91 --- /dev/null +++ b/build/wc-payment-method-bacs.js @@ -0,0 +1 @@ +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wc.wcBlocksRegistry},,,function(e,t,n){"use strict";n.r(t);var r,o=n(0),c=n(4),i=n(2),u=n(3),l=n(1);const a=Object(u.getSetting)("bacs_data",{}),s=Object(i.__)("Direct bank transfer","woo-gutenberg-products-block"),d=Object(l.decodeEntities)(a.title)||s,f=()=>Object(l.decodeEntities)(a.description||""),p={name:"bacs",label:Object(o.createElement)(e=>{const{PaymentMethodLabel:t}=e.components;return Object(o.createElement)(t,{text:d})},null),content:Object(o.createElement)(f,null),edit:Object(o.createElement)(f,null),canMakePayment:()=>!0,ariaLabel:d,supports:{features:null!==(r=null==a?void 0:a.supports)&&void 0!==r?r:[]}};Object(c.registerPaymentMethod)(p)}]); \ No newline at end of file diff --git a/build/wc-payment-method-cheque.asset.php b/build/wc-payment-method-cheque.asset.php new file mode 100644 index 00000000000..404c48a3432 --- /dev/null +++ b/build/wc-payment-method-cheque.asset.php @@ -0,0 +1 @@ + array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill'), 'version' => 'd96ae5458ab0b234ca202d39dc543dd5'); \ No newline at end of file diff --git a/build/wc-payment-method-cheque.js b/build/wc-payment-method-cheque.js new file mode 100644 index 00000000000..c10d1725ae8 --- /dev/null +++ b/build/wc-payment-method-cheque.js @@ -0,0 +1 @@ +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t,n){"use strict";n.r(t);var r,o=n(0),c=n(4),i=n(2),u=n(3),l=n(1);const a=Object(u.getSetting)("cheque_data",{}),s=Object(i.__)("Check payment","woo-gutenberg-products-block"),d=Object(l.decodeEntities)(a.title)||s,f=()=>Object(l.decodeEntities)(a.description||""),p={name:"cheque",label:Object(o.createElement)(e=>{const{PaymentMethodLabel:t}=e.components;return Object(o.createElement)(t,{text:d})},null),content:Object(o.createElement)(f,null),edit:Object(o.createElement)(f,null),canMakePayment:()=>!0,ariaLabel:d,supports:{features:null!==(r=null==a?void 0:a.supports)&&void 0!==r?r:[]}};Object(c.registerPaymentMethod)(p)}]); \ No newline at end of file diff --git a/build/wc-payment-method-cod.asset.php b/build/wc-payment-method-cod.asset.php new file mode 100644 index 00000000000..acd8be98981 --- /dev/null +++ b/build/wc-payment-method-cod.asset.php @@ -0,0 +1 @@ + array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill'), 'version' => 'fa0478e6eab3ba4cbcfe6d1e338b0e05'); \ No newline at end of file diff --git a/build/wc-payment-method-cod.js b/build/wc-payment-method-cod.js new file mode 100644 index 00000000000..fc8a8efc3e0 --- /dev/null +++ b/build/wc-payment-method-cod.js @@ -0,0 +1 @@ +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wc.wcBlocksRegistry},,,,function(e,t,n){"use strict";n.r(t);var r,o=n(0),i=n(4),c=n(2),u=n(3),l=n(1);const s=Object(u.getSetting)("cod_data",{}),a=Object(c.__)("Cash on delivery","woo-gutenberg-products-block"),d=Object(l.decodeEntities)(s.title)||a,p=()=>Object(l.decodeEntities)(s.description||""),f={name:"cod",label:Object(o.createElement)(e=>{const{PaymentMethodLabel:t}=e.components;return Object(o.createElement)(t,{text:d})},null),content:Object(o.createElement)(p,null),edit:Object(o.createElement)(p,null),canMakePayment:e=>{let{cartNeedsShipping:t,selectedShippingMethods:n}=e;if(!s.enableForVirtual&&!t)return!1;if(!s.enableForShippingMethods.length)return!0;const r=Object.values(n);return s.enableForShippingMethods.some(e=>r.some(t=>t.includes(e)))},ariaLabel:d,supports:{features:null!==(r=null==s?void 0:s.supports)&&void 0!==r?r:[]}};Object(i.registerPaymentMethod)(f)}]); \ No newline at end of file diff --git a/build/wc-payment-method-paypal.asset.php b/build/wc-payment-method-paypal.asset.php new file mode 100644 index 00000000000..dbf3e1b52d8 --- /dev/null +++ b/build/wc-payment-method-paypal.asset.php @@ -0,0 +1 @@ + array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill'), 'version' => 'e38a03542ca70b4b3639cb658577ac4a'); \ No newline at end of file diff --git a/build/wc-payment-method-paypal.js b/build/wc-payment-method-paypal.js new file mode 100644 index 00000000000..7ae91c5d160 --- /dev/null +++ b/build/wc-payment-method-paypal.js @@ -0,0 +1 @@ +!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wc.wcBlocksRegistry},,function(e,t,n){"use strict";n.r(t);var o,r=n(0),c=n(4),i=n(2),u=n(3),a=n(1);const l=Object(u.getSetting)("paypal_data",{}),p=()=>Object(a.decodeEntities)(l.description||""),s={name:"paypal",label:Object(r.createElement)("img",{src:u.WC_ASSET_URL+"/images/paypal.png",alt:Object(a.decodeEntities)(l.title||Object(i.__)("PayPal","woo-gutenberg-products-block"))}),placeOrderButtonLabel:Object(i.__)("Proceed to PayPal","woo-gutenberg-products-block"),content:Object(r.createElement)(p,null),edit:Object(r.createElement)(p,null),canMakePayment:()=>!0,ariaLabel:Object(a.decodeEntities)(l.title||Object(i.__)("Payment via PayPal","woo-gutenberg-products-block")),supports:{features:null!==(o=l.supports)&&void 0!==o?o:[]}};Object(c.registerPaymentMethod)(s)}]); \ No newline at end of file diff --git a/build/wc-settings.asset.php b/build/wc-settings.asset.php new file mode 100644 index 00000000000..a9375acc8a9 --- /dev/null +++ b/build/wc-settings.asset.php @@ -0,0 +1 @@ + array('wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '5e3e35521088fc9bf8d81e64a5370b7a'); \ No newline at end of file diff --git a/build/wc-settings.js b/build/wc-settings.js new file mode 100644 index 00000000000..3d8c5a185b3 --- /dev/null +++ b/build/wc-settings.js @@ -0,0 +1 @@ +this.wc=this.wc||{},this.wc.wcSettings=function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=138)}({1:function(e,t){e.exports=window.wp.i18n},138:function(e,t,o){"use strict";o.r(t),o.d(t,"ADMIN_URL",(function(){return u})),o.d(t,"COUNTRIES",(function(){return a})),o.d(t,"CURRENCY",(function(){return s})),o.d(t,"CURRENT_USER_IS_ADMIN",(function(){return l})),o.d(t,"HOME_URL",(function(){return d})),o.d(t,"LOCALE",(function(){return p})),o.d(t,"ORDER_STATUSES",(function(){return b})),o.d(t,"PLACEHOLDER_IMG_SRC",(function(){return _})),o.d(t,"SITE_TITLE",(function(){return f})),o.d(t,"STORE_PAGES",(function(){return g})),o.d(t,"WC_ASSET_URL",(function(){return m})),o.d(t,"WC_VERSION",(function(){return w})),o.d(t,"WP_LOGIN_URL",(function(){return y})),o.d(t,"WP_VERSION",(function(){return S})),o.d(t,"defaultAddressFields",(function(){return O})),o.d(t,"getSetting",(function(){return T})),o.d(t,"getSettingWithCoercion",(function(){return z})),o.d(t,"isWpVersion",(function(){return M})),o.d(t,"isWcVersion",(function(){return N})),o.d(t,"getAdminLink",(function(){return V})),o.d(t,"allSettings",(function(){return i}));var n=o(29);Object(n.addFilter)("woocommerce_admin_analytics_settings","woocommerce-blocks/exclude-draft-status-from-analytics",e=>{const t=e=>"customStatuses"===e.key?{...e,options:e.options.filter(e=>"checkout-draft"!==e.value)}:e,o=e.woocommerce_actionable_order_statuses.options.map(t),n=e.woocommerce_excluded_report_order_statuses.options.map(t);return{...e,woocommerce_actionable_order_statuses:{...e.woocommerce_actionable_order_statuses,options:o},woocommerce_excluded_report_order_statuses:{...e.woocommerce_excluded_report_order_statuses,options:n}}});const r={adminUrl:"",countries:[],currency:{code:"USD",precision:2,symbol:"$",symbolPosition:"left",decimalSeparator:".",priceFormat:"%1$s%2$s",thousandSeparator:","},currentUserIsAdmin:!1,homeUrl:"",locale:{siteLocale:"en_US",userLocale:"en_US",weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},orderStatuses:[],placeholderImgSrc:"",siteTitle:"",storePages:[],wcAssetUrl:"",wcVersion:"",wpLoginUrl:"",wpVersion:""},c="object"==typeof window.wcSettings?window.wcSettings:{},i={...r,...c};i.currency={...r.currency,...i.currency},i.locale={...r.locale,...i.locale};const u=i.adminUrl,a=i.countries,s=i.currency,l=i.currentUserIsAdmin,d=i.homeUrl,p=i.locale,b=i.orderStatuses,_=i.placeholderImgSrc,f=i.siteTitle,g=i.storePages,m=i.wcAssetUrl,w=i.wcVersion,y=i.wpLoginUrl,S=i.wpVersion;var h=o(1);const O={first_name:{label:Object(h.__)("First name","woo-gutenberg-products-block"),optionalLabel:Object(h.__)("First name (optional)","woo-gutenberg-products-block"),autocomplete:"given-name",autocapitalize:"sentences",required:!0,hidden:!1,index:10},last_name:{label:Object(h.__)("Last name","woo-gutenberg-products-block"),optionalLabel:Object(h.__)("Last name (optional)","woo-gutenberg-products-block"),autocomplete:"family-name",autocapitalize:"sentences",required:!0,hidden:!1,index:20},company:{label:Object(h.__)("Company","woo-gutenberg-products-block"),optionalLabel:Object(h.__)("Company (optional)","woo-gutenberg-products-block"),autocomplete:"organization",autocapitalize:"sentences",required:!1,hidden:!1,index:30},address_1:{label:Object(h.__)("Address","woo-gutenberg-products-block"),optionalLabel:Object(h.__)("Address (optional)","woo-gutenberg-products-block"),autocomplete:"address-line1",autocapitalize:"sentences",required:!0,hidden:!1,index:40},address_2:{label:Object(h.__)("Apartment, suite, etc.","woo-gutenberg-products-block"),optionalLabel:Object(h.__)("Apartment, suite, etc. (optional)","woo-gutenberg-products-block"),autocomplete:"address-line2",autocapitalize:"sentences",required:!1,hidden:!1,index:50},country:{label:Object(h.__)("Country/Region","woo-gutenberg-products-block"),optionalLabel:Object(h.__)("Country/Region (optional)","woo-gutenberg-products-block"),autocomplete:"country",required:!0,hidden:!1,index:60},city:{label:Object(h.__)("City","woo-gutenberg-products-block"),optionalLabel:Object(h.__)("City (optional)","woo-gutenberg-products-block"),autocomplete:"address-level2",autocapitalize:"sentences",required:!0,hidden:!1,index:70},state:{label:Object(h.__)("State/County","woo-gutenberg-products-block"),optionalLabel:Object(h.__)("State/County (optional)","woo-gutenberg-products-block"),autocomplete:"address-level1",autocapitalize:"sentences",required:!0,hidden:!1,index:80},postcode:{label:Object(h.__)("Postal code","woo-gutenberg-products-block"),optionalLabel:Object(h.__)("Postal code (optional)","woo-gutenberg-products-block"),autocomplete:"postal-code",autocapitalize:"characters",required:!0,hidden:!1,index:90}};function j(e,t){const o=L(e),n=L(t),r=o.pop(),c=n.pop(),i=I(o,n);return 0!==i?i:r&&c?I(r.split("."),c.split(".")):r||c?r?-1:1:0}const v=(e,t,o)=>{C(o);const n=j(e,t);return R[o].includes(n)};j.validate=e=>"string"==typeof e&&/^[v\d]/.test(e)&&x.test(e),j.compare=v,j.sastisfies=(e,t)=>{const o=t.match(/^([<>=~^]+)/),n=o?o[1]:"=";if("^"!==n&&"~"!==n)return v(e,t,n);const[r,c,i]=L(e),[u,a,s]=L(t);return 0===E(r,u)&&("^"===n?I([c,i],[a,s])>=0:0===E(c,a)&&E(i,s)>=0)};const x=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,L=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(x);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},k=e=>"*"===e||"x"===e||"X"===e,U=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},E=(e,t)=>{if(k(e)||k(t))return 0;const[o,n]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(U(e),U(t));return o>n?1:o{for(let o=0;o":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]},A=Object.keys(R),C=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===A.indexOf(e))throw new Error("Invalid operator, expected one of "+A.join("|"))},T=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(e,t)=>void 0!==e?e:t;const n=e in i?i[e]:t;return o(n,t)},z=(e,t,o)=>{const n=e in i?i[e]:t;return o(n,t)?n:t},P=(e,t,o)=>{let n=T(e,"").replace(/-[a-zA-Z0-9]*[\-]*/,".0-rc.");return n=n.endsWith(".")?n.substring(0,n.length-1):n,j.compare(n,t,o)},M=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"=";return P("wpVersion",e,t)},N=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"=";return P("wcVersion",e,t)},V=e=>T("adminUrl")+e},29:function(e,t){e.exports=window.wp.hooks}}); \ No newline at end of file