(()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{__experimentalDeRegisterExpressPaymentMethod:()=>S,__experimentalDeRegisterPaymentMethod:()=>I,__experimentalRegisterProductCollection:()=>G,getExpressPaymentMethods:()=>C,getPaymentMethods:()=>E,getRegisteredBlockComponents:()=>A,getRegisteredInnerBlocks:()=>x,registerBlockComponent:()=>O,registerExpressPaymentMethod:()=>k,registerInnerBlock:()=>R,registerPaymentMethod:()=>g,registerPaymentMethodExtensionCallbacks:()=>P});const o=window.wp.deprecated;var r=e.n(o);const n=window.wp.data;function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var r=o.call(e,"string");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===i(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const s=window.React,l={},c=l,d=(e,t,o)=>{const r=((e,t)=>o=>((null==o?void 0:o.paymentRequirements)||[]).every((e=>t.includes(e)))&&e(o))(e,t);return Object.values(c).some((e=>o in e))?((e,t,o)=>r=>{let n=e(r);if(n){const e={};Object.entries(t).forEach((([t,r])=>{o in r&&"function"==typeof r[o]&&(e[t]=r[o])})),n=Object.keys(e).every((t=>{try{return e[t](r)}catch(e){return console.error(`Error when executing callback for ${o} in ${t}`,e),!0}}))}return n})(r,c,o):r},u=window.wp.element,m=(e,t)=>{if(null!==e&&!(0,u.isValidElement)(e))throw new TypeError(`The ${t} property for the payment method must be a React element or null.`)},p=(e,t=[])=>{const o=t.reduce(((t,o)=>(e.hasOwnProperty(o)||t.push(o),t)),[]);if(o.length>0)throw new TypeError("The payment method configuration object is missing the following properties:"+o.join(", "))},y=()=>null;class v{constructor(e){var t,o,r,n;a(this,"name",void 0),a(this,"content",void 0),a(this,"edit",void 0),a(this,"paymentMethodId",void 0),a(this,"supports",void 0),a(this,"icons",void 0),a(this,"label",void 0),a(this,"ariaLabel",void 0),a(this,"placeOrderButtonLabel",void 0),a(this,"savedTokenComponent",void 0),a(this,"canMakePaymentFromConfig",void 0),v.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===(o=e.supports)||void 0===o?void 0:o.savePaymentInfo)||!1,showSaveOption:(null==e||null===(r=e.supports)||void 0===r?void 0:r.showSaveOption)||!1,features:(null==e||null===(n=e.supports)||void 0===n?void 0:n.features)||["products"]},this.canMakePaymentFromConfig=e.canMakePayment}get canMakePayment(){return d(this.canMakePaymentFromConfig,this.supports.features,this.name)}}a(v,"assertValidConfig",(e=>{var t,o,n,i,a,l,c;if(e.savedTokenComponent=e.savedTokenComponent||(0,s.createElement)(y,null),p(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&&!(0,u.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),m(e.content,"content"),m(e.edit,"edit"),m(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===(o=e.supports)||void 0===o?void 0:o.showSavedCards))throw new TypeError("If the payment method includes the `supports.showSavedCards` property, it must be a boolean");if(void 0!==(null===(n=e.supports)||void 0===n?void 0:n.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===(i=e.supports)||void 0===i?void 0:i.features)&&!Array.isArray(null===(a=e.supports)||void 0===a?void 0:a.features))throw new Error("The features property for the payment method must be an array or undefined.");if(void 0!==(null===(l=e.supports)||void 0===l?void 0:l.showSaveOption)&&"boolean"!=typeof(null===(c=e.supports)||void 0===c?void 0:c.showSaveOption))throw new TypeError("If the payment method includes the `supports.showSaveOption` property, it must be a boolean")}));class b{constructor(e){var t,o;a(this,"name",void 0),a(this,"title",void 0),a(this,"description",void 0),a(this,"gatewayId",void 0),a(this,"content",void 0),a(this,"edit",void 0),a(this,"paymentMethodId",void 0),a(this,"supports",void 0),a(this,"canMakePaymentFromConfig",void 0);const r="string"==typeof e.name?e.name.replace(/[_-]/g," "):e.name,n="string"==typeof(null==e?void 0:e.description)&&e.description.length>130?e.description.slice(0,130)+"...":e.description;b.assertValidConfig(e),this.name=e.name,this.title=e.title||r,this.description=n||"",this.gatewayId=e.gatewayId||"",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"],style:(null==e||null===(o=e.supports)||void 0===o?void 0:o.style)||[]},this.canMakePaymentFromConfig=e.canMakePayment}get canMakePayment(){return d(this.canMakePaymentFromConfig,this.supports.features,this.name)}}a(b,"assertValidConfig",(e=>{var t,o;if(p(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===(o=e.supports)||void 0===o?void 0:o.features))throw new Error("The features property for the payment method must be an array or undefined.");if(m(e.content,"content"),m(e.edit,"edit"),"function"!=typeof e.canMakePayment)throw new TypeError("The canMakePayment property for the express payment method must be a function.")}));const f="wc/store/payment",h={},w={},g=e=>{let t;"function"==typeof e?(t=e(v),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 v(e),t instanceof v&&(h[t.name]=t)},k=e=>{let t;"function"==typeof e?(t=e(b),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 b(e),t instanceof b&&(w[t.name]=t)},P=(e,t)=>{l[e]?console.error(`The namespace provided to registerPaymentMethodExtensionCallbacks must be unique. Callbacks have already been registered for the ${e} namespace.`):(l[e]={},Object.entries(t).forEach((([t,o])=>{"function"==typeof o?l[e][t]=o:console.error(`All callbacks provided to registerPaymentMethodExtensionCallbacks must be functions. The callback for the ${t} payment method in the ${e} namespace was not a function.`)})))},I=e=>{delete h[e];const{__internalRemoveAvailablePaymentMethod:t}=(0,n.dispatch)(f);t(e)},S=e=>{delete w[e];const{__internalRemoveAvailableExpressPaymentMethod:t}=(0,n.dispatch)(f);t(e)},E=()=>h,C=()=>w,T={};function A(e){return{..."object"==typeof T[e]&&Object.keys(T[e]).length>0?T[e]:{},...T.any}}function x(e){return r()("getRegisteredInnerBlocks",{version:"2.8.0",alternative:"getRegisteredBlockComponents",plugin:"WooCommerce Blocks"}),A(e)}const M=(e,t,o)=>{const r=typeof e[t];if(r!==o)throw new Error(`Incorrect value for the ${t} argument when registering a block component. It was a ${r}, but must be a ${o}.`)},q=(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.`)};function O(e){e.context||(e.context="any"),M(e,"context","string"),M(e,"blockName","string"),q(e,"component");const{context:t,blockName:o,component:r}=e;T[t]||(T[t]={}),T[t][o]=r}function R(e){r()("registerInnerBlock",{version:"2.8.0",alternative:"registerBlockComponent",plugin:"WooCommerce Blocks",hint:'"main" has been replaced with "context" and is now optional.'}),M(e,"main","string"),O({...e,context:e.main})}const j=window.wp.hooks;let B=function(e){return e.GRID="flex",e.STACK="list",e}({}),L=function(e){return e.FILL="fill",e.FIXED="fixed",e}({}),_=function(e){return e.ATTRIBUTES="attributes",e.CREATED="created",e.FEATURED="featured",e.HAND_PICKED="hand-picked",e.INHERIT="inherit",e.KEYWORD="keyword",e.ON_SALE="on-sale",e.ORDER="order",e.STOCK_STATUS="stock-status",e.TAXONOMY="taxonomy",e.PRICE_RANGE="price-range",e.FILTERABLE="filterable",e.PRODUCTS_PER_PAGE="products-per-page",e.MAX_PAGES_TO_SHOW="max-pages-to-show",e.OFFSET="offset",e.RELATED_BY="related-by",e}({});const F=window.wc.wcSettings,$=JSON.parse('{"UU":"woocommerce/product-collection"}');let D=function(e){return e.SINGLE="single",e.THUMBNAIL="thumbnail",e}({});const H=$.UU,N=`${H}/product-title`,U=(0,F.getSetting)("stockStatusOptions",[]),V={perPage:9,pages:0,offset:0,postType:"product",order:"asc",orderBy:"title",search:"",exclude:[],inherit:!1,taxQuery:{},isProductCollectionBlock:!0,featured:!1,woocommerceOnSale:!1,woocommerceStockStatus:(0,F.getSetting)("hideOutOfStockItems",!1)?Object.keys(function(e,t){const{[t]:o,...r}=e;return r}(U,"outofstock")):Object.keys(U),woocommerceAttributes:[],woocommerceHandPickedProducts:[],timeFrame:void 0,priceRange:void 0,filterable:!1,relatedBy:{categories:!0,tags:!0}},z={query:V,tagName:"div",displayLayout:{type:B.GRID,columns:3,shrinkColumns:!0},dimensions:{widthType:L.FILL},queryContextIncludes:["collection"],forcePageReload:!1},Q=[["woocommerce/product-template",{},[["woocommerce/product-image",{imageSizing:D.THUMBNAIL}],["core/post-title",{textAlign:"center",level:3,fontSize:"medium",style:{spacing:{margin:{bottom:"0.75rem",top:"0"}}},isLink:!0,__woocommerceNamespace:N}],["woocommerce/product-price",{textAlign:"center",fontSize:"small"}],["woocommerce/product-button",{textAlign:"center",fontSize:"small"}]]],["core/query-pagination",{layout:{type:"flex",justifyContent:"center"}}],["woocommerce/product-collection-no-results"]],G=e=>{var t,o,r,n,i,a;if(!(e=>{var t,o,r,n,i,a,s,l,c,d,u,m,p,y,v,b,f,h,w,g,k,P,I,S,E,C,T,A,x,M,q,O,R;return"object"!=typeof e||null===e?(console.error("Invalid arguments: You must pass an object to __experimentalRegisterProductCollection."),!1):"string"!=typeof e.name||0===e.name.length?(console.error("Invalid name: name must be a non-empty string."),!1):(e.name.match(/^[a-zA-Z0-9-]+\/product-collection\/[a-zA-Z0-9-]+$/)||console.warn('To prevent conflicts with other collections, please use a unique name following the pattern: "