OwlCyberSecurity - MANAGER
Edit File: blocks-checkout.js
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=141)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},11: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.",'woocommerce'),data:{status:500}}},12:function(e,t){e.exports=window.wp.compose},13:function(e,t){e.exports=window.React},133:function(e,t){},134:function(e,t){},135:function(e,t){},136:function(e,t){},137:function(e,t){},138:function(e,t){},139:function(e,t){},14: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.default=e.exports,e.exports.__esModule=!0},140:function(e,t){},141:function(e,t,n){"use strict";n.r(t),n.d(t,"TotalsItem",(function(){return D})),n.d(t,"Subtotal",(function(){return M})),n.d(t,"TotalsTaxes",(function(){return B})),n.d(t,"TotalsFees",(function(){return L})),n.d(t,"TotalsWrapper",(function(){return V})),n.d(t,"ExperimentalOrderMeta",(function(){return He})),n.d(t,"ExperimentalDiscountsMeta",(function(){return Ke})),n.d(t,"ExperimentalOrderShippingPackages",(function(){return Ye})),n.d(t,"Panel",(function(){return Xe})),n.d(t,"Button",(function(){return Vt})),n.d(t,"Label",(function(){return Ut})),n.d(t,"CheckboxControl",(function(){return Wt})),n.d(t,"mustContain",(function(){return Ht})),n.d(t,"extensionCartUpdate",(function(){return Kt})),n.d(t,"hasValidFills",(function(){return Be})),n.d(t,"useSlot",(function(){return Le})),n.d(t,"createSlotFill",(function(){return Ve})),n.d(t,"__experimentalRegisterCheckoutFilters",(function(){return Yt})),n.d(t,"__experimentalApplyCheckoutFilter",(function(){return Zt})),n.d(t,"hasInnerBlocks",(function(){return Xt})),n.d(t,"getRegisteredBlocks",(function(){return en})),n.d(t,"registerCheckoutBlock",(function(){return rn})),n.d(t,"innerBlockAreas",(function(){return Jt})),n.d(t,"SlotFillProvider",(function(){return Se}));var r=n(0),o=n(3),i=n.n(o),c=n(9),a=n.n(c),u=n(13),s=n.n(u);function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(){return(f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(){}function b(){}b.resetWarningCache=h;var v=function(e,t){return function(e){e.exports=function(){function e(e,t,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var c=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 c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array: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:b,resetWarningCache:h};return n.PropTypes=n,n}()}(t={exports:{}}),t.exports}();function g(){}function y(e){return!!(e||"").match(/\d/)}function O(e){return null==e}function w(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function j(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="-"===e[0],r=n&&t,o=(e=e.replace("-","")).split("."),i=o[0],c=o[1]||"";return{beforeDecimal:i,afterDecimal:c,hasNagation:n,addNegation:r}}function S(e,t,n){for(var r="",o=n?"0":"",i=0;i<=t-1;i++)r+=e[i]||o;return r}function E(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function k(e,t,n){return Math.min(Math.max(e,t),n)}function x(e){return Math.max(e.selectionStart,e.selectionEnd)}var P={thousandSeparator:v.oneOfType([v.string,v.oneOf([!0])]),decimalSeparator:v.string,allowedDecimalSeparators:v.arrayOf(v.string),thousandsGroupStyle:v.oneOf(["thousand","lakh","wan"]),decimalScale:v.number,fixedDecimalScale:v.bool,displayType:v.oneOf(["input","text"]),prefix:v.string,suffix:v.string,format:v.oneOfType([v.string,v.func]),removeFormatting:v.func,mask:v.oneOfType([v.string,v.arrayOf(v.string)]),value:v.oneOfType([v.number,v.string]),defaultValue:v.oneOfType([v.number,v.string]),isNumericString:v.bool,customInput:v.elementType,allowNegative:v.bool,allowEmptyFormatting:v.bool,allowLeadingZeros:v.bool,onValueChange:v.func,onKeyDown:v.func,onMouseUp:v.func,onChange:v.func,onFocus:v.func,onBlur:v.func,type:v.oneOf(["text","tel","password"]),isAllowed:v.func,renderText:v.func,getInputRef:v.oneOfType([v.func,v.shape({current:v.any})])},F={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:g,onChange:g,onKeyDown:g,onMouseUp:g,onFocus:g,onBlur:g,isAllowed:function(){return!0}},C=function(e){function t(e){var n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=!(r=p(t).call(this,e))||"object"!=typeof r&&"function"!=typeof r?m(this):r;var o=e.defaultValue;n.validateProps();var i=n.formatValueProp(o);return n.state={value:i,numAsString:n.removeFormatting(i)},n.selectionBeforeInput={selectionStart:0,selectionEnd:0},n.onChange=n.onChange.bind(m(n)),n.onKeyDown=n.onKeyDown.bind(m(n)),n.onMouseUp=n.onMouseUp.bind(m(n)),n.onFocus=n.onFocus.bind(m(n)),n.onBlur=n.onBlur.bind(m(n)),n}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(t,e),n=t,(r=[{key:"componentDidUpdate",value:function(e){this.updateValueIfRequired(e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.focusTimeout)}},{key:"updateValueIfRequired",value:function(e){var t=this.props,n=this.state,r=this.focusedElm,o=n.value,i=n.numAsString,c=void 0===i?"":i;if(e!==t){this.validateProps();var a=this.formatNumString(c),u=O(t.value)?a:this.formatValueProp(),s=this.removeFormatting(u),l=parseFloat(s),f=parseFloat(c);(isNaN(l)&&isNaN(f)||l===f)&&a===o&&(null!==r||u===o)||this.updateValue({formattedValue:u,numAsString:s,input:r})}}},{key:"getFloatString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.decimalScale,n=this.getSeparators(),r=n.decimalSeparator,o=this.getNumberRegex(!0),i="-"===e[0];i&&(e=e.replace("-","")),r&&0===t&&(e=e.split(r)[0]);var c=(e=(e.match(o)||[]).join("").replace(r,".")).indexOf(".");return-1!==c&&(e="".concat(e.substring(0,c),".").concat(e.substring(c+1,e.length).replace(new RegExp(w(r),"g"),""))),i&&(e="-"+e),e}},{key:"getNumberRegex",value:function(e,t){var n=this.props,r=n.format,o=n.decimalScale,i=this.getSeparators().decimalSeparator;return new RegExp("\\d"+(!i||0===o||t||r?"":"|"+w(i)),e?"g":void 0)}},{key:"getSeparators",value:function(){var e=this.props.decimalSeparator,t=this.props,n=t.thousandSeparator,r=t.allowedDecimalSeparators;return!0===n&&(n=","),r||(r=[e,"."]),{decimalSeparator:e,thousandSeparator:n,allowedDecimalSeparators:r}}},{key:"getMaskAtIndex",value:function(e){var t=this.props.mask,n=void 0===t?" ":t;return"string"==typeof n?n:n[e]||" "}},{key:"getValueObject",value:function(e,t){var n=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(n)?void 0:n}}},{key:"validateProps",value:function(){var e=this.props.mask,t=this.getSeparators(),n=t.decimalSeparator,r=t.thousandSeparator;if(n===r)throw new Error("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: ".concat(r,' (thousandSeparator = {true} is same as thousandSeparator = ",")\n decimalSeparator: ').concat(n," (default value for decimalSeparator is .)\n "));if(e&&("string"===e?e:e.toString()).match(/\d/g))throw new Error("\n Mask ".concat(e," should not contain numeric character;\n "))}},{key:"setPatchedCaretPosition",value:function(e,t,n){E(e,t),setTimeout((function(){e.value===n&&E(e,t)}),0)}},{key:"correctCaretPosition",value:function(e,t,n){var r=this.props,o=r.prefix,i=r.suffix,c=r.format;if(""===e)return 0;if(t=k(t,0,e.length),!c){var a="-"===e[0];return k(t,o.length+(a?1:0),e.length-i.length)}if("function"==typeof c)return t;if("#"===c[t]&&y(e[t]))return t;if("#"===c[t-1]&&y(e[t-1]))return t;var u=c.indexOf("#");t=k(t,u,c.lastIndexOf("#")+1);for(var s=c.substring(t,c.length).indexOf("#"),l=t,f=t+(-1===s?0:s);l>u&&("#"!==c[l]||!y(e[l]));)l-=1;return!y(e[f])||"left"===n&&t!==u||t-l<f-t?y(e[l])?l+1:l:f}},{key:"getCaretPosition",value:function(e,t,n){var r,o,i=this.props.format,c=this.state.value,a=this.getNumberRegex(!0),u=(e.match(a)||[]).join(""),s=(t.match(a)||[]).join("");for(r=0,o=0;o<n;o++){var l=e[o]||"",f=t[r]||"";if((l.match(a)||l===f)&&("0"!==l||!f.match(a)||"0"===f||u.length===s.length)){for(;l!==t[r]&&r<t.length;)r++;r++}}return"string"!=typeof i||c||(r=t.length),this.correctCaretPosition(t,r)}},{key:"removePrefixAndSuffix",value:function(e){var t=this.props,n=t.format,r=t.prefix,o=t.suffix;if(!n&&e){var i="-"===e[0];i&&(e=e.substring(1,e.length));var c=(e=r&&0===e.indexOf(r)?e.substring(r.length,e.length):e).lastIndexOf(o);e=o&&-1!==c&&c===e.length-o.length?e.substring(0,c):e,i&&(e="-"+e)}return e}},{key:"removePatternFormatting",value:function(e){for(var t=this.props.format.split("#").filter((function(e){return""!==e})),n=0,r="",o=0,i=t.length;o<=i;o++){var c=t[o]||"",a=o===i?e.length:e.indexOf(c,n);if(-1===a){r=e;break}r+=e.substring(n,a),n=a+c.length}return(r.match(/\d/g)||[]).join("")}},{key:"removeFormatting",value:function(e){var t=this.props,n=t.format,r=t.removeFormatting;return e?(n?e="string"==typeof n?this.removePatternFormatting(e):"function"==typeof r?r(e):(e.match(/\d/g)||[]).join(""):(e=this.removePrefixAndSuffix(e),e=this.getFloatString(e)),e):e}},{key:"formatWithPattern",value:function(e){for(var t=this.props.format,n=0,r=t.split(""),o=0,i=t.length;o<i;o++)"#"===t[o]&&(r[o]=e[n]||this.getMaskAtIndex(n),n+=1);return r.join("")}},{key:"formatAsNumber",value:function(e){var t=this.props,n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix,i=t.suffix,c=t.allowNegative,a=t.thousandsGroupStyle,u=this.getSeparators(),s=u.thousandSeparator,l=u.decimalSeparator,f=-1!==e.indexOf(".")||n&&r,p=j(e,c),d=p.beforeDecimal,m=p.afterDecimal,h=p.addNegation;return void 0!==n&&(m=S(m,n,r)),s&&(d=function(e,t,n){var r=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}(n),o=e.search(/[1-9]/);return o=-1===o?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}(d,s,a)),o&&(d=o+d),i&&(m+=i),h&&(d="-"+d),d+(f&&l||"")+m}},{key:"formatNumString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props,n=t.format,r=t.allowEmptyFormatting,o=e;return""!==e||r?"-"!==e||n?"string"==typeof n?this.formatWithPattern(o):"function"==typeof n?n(o):this.formatAsNumber(o):"-":""}},{key:"formatValueProp",value:function(e){var t=this.props,n=t.format,r=t.decimalScale,o=t.fixedDecimalScale,i=t.allowEmptyFormatting,c=this.props,a=c.value,u=c.isNumericString,s=!(a=O(a)?e:a)&&0!==a;return s&&i&&(a=""),s&&!i?"":("number"==typeof a&&(a=a.toString(),u=!0),"Infinity"===a&&u&&(a=""),u&&!n&&"number"==typeof r&&(a=function(e,t,n){if(-1!==["","-"].indexOf(e))return e;var r=-1!==e.indexOf(".")&&t,o=j(e),i=o.beforeDecimal,c=o.afterDecimal,a=o.hasNagation,u=parseFloat("0.".concat(c||"0")).toFixed(t).split("."),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}),u[0]),l=S(u[1]||"",Math.min(t,c.length),n),f=r?".":"";return"".concat(a?"-":"").concat(s).concat(f).concat(l)}(a,r,o)),u?this.formatNumString(a):this.formatInput(a))}},{key:"formatNegation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",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}},{key:"formatInput",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.format;return t||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)}},{key:"isCharacterAFormat",value:function(e,t){var n=this.props,r=n.format,o=n.prefix,i=n.suffix,c=n.decimalScale,a=n.fixedDecimalScale,u=this.getSeparators().decimalSeparator;return"string"==typeof r&&"#"!==r[e]||!(r||!(e<o.length||e>=t.length-i.length||c&&a&&t[e]===u))}},{key:"checkIfFormatGotDeleted",value:function(e,t,n){for(var r=e;r<t;r++)if(this.isCharacterAFormat(r,n))return!0;return!1}},{key:"correctInputValue",value:function(e,t,n){var r=this.props,o=r.format,i=r.allowNegative,c=r.prefix,a=r.suffix,u=r.decimalScale,s=this.getSeparators(),l=s.allowedDecimalSeparators,f=s.decimalSeparator,p=this.state.numAsString||"",d=this.selectionBeforeInput,m=d.selectionStart,h=d.selectionEnd,b=function(e,t){for(var n=0,r=0,o=e.length,i=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[i-1-r]&&i-r>n&&o-r>n;)r++;return{start:n,end:o-r}}(t,n),v=b.start,g=b.end;if(!o&&v===g&&-1!==l.indexOf(n[m])){var y=0===u?"":f;return n.substr(0,m)+y+n.substr(m+1,n.length)}var O=o?0:c.length,w=t.length-(o?0:a.length);if(n.length>t.length||!n.length||v===g||0===m&&h===t.length||m===O&&h===w)return n;if(this.checkIfFormatGotDeleted(v,g,t)&&(n=t),!o){var S=this.removeFormatting(n),E=j(S,i),k=E.beforeDecimal,x=E.afterDecimal,P=E.addNegation,F=e<n.indexOf(f)+1;if(S.length<p.length&&F&&""===k&&!parseFloat(x))return P?"-":""}return n}},{key:"updateValue",value:function(e){var t=e.formattedValue,n=e.input,r=e.setCaretPosition,o=void 0===r||r,i=e.numAsString,c=e.caretPos,a=this.props.onValueChange,u=this.state.value;if(n)if(o){if(!c){var s=e.inputValue||n.value,l=x(n);n.value=t,c=this.getCaretPosition(s,t,l)}this.setPatchedCaretPosition(n,c,t)}else n.value=t;void 0===i&&(i=this.removeFormatting(t)),t!==u&&(this.setState({value:t,numAsString:i}),a(this.getValueObject(t,i)))}},{key:"onChange",value:function(e){var t=e.target,n=t.value,r=this.state,o=this.props,i=o.isAllowed,c=r.value||"",a=x(t);n=this.correctInputValue(a,c,n);var u=this.formatInput(n)||"",s=this.removeFormatting(u);i(this.getValueObject(u,s))||(u=c),this.updateValue({formattedValue:u,numAsString:s,inputValue:n,input:t}),o.onChange(e)}},{key:"onBlur",value:function(e){var t=this.props,n=this.state,r=t.format,o=t.onBlur,i=t.allowLeadingZeros,c=n.numAsString,a=n.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),!r){isNaN(parseFloat(c))&&(c=""),i||(c=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return"".concat(t?"-":"").concat(r).concat(o?".".concat(o):"")}(c));var u=this.formatNumString(c);if(u!==a)return this.updateValue({formattedValue:u,numAsString:c,input:e.target,setCaretPosition:!1}),void o(e)}o(e)}},{key:"onKeyDown",value:function(e){var t,n=e.target,r=e.key,o=n.selectionStart,i=n.selectionEnd,c=n.value,a=void 0===c?"":c,u=this.props,s=u.decimalScale,l=u.fixedDecimalScale,f=u.prefix,p=u.suffix,d=u.format,m=u.onKeyDown,h=void 0!==s&&l,b=this.getNumberRegex(!1,h),v=new RegExp("-"),g="string"==typeof d;if(this.selectionBeforeInput={selectionStart:o,selectionEnd:i},"ArrowLeft"===r||"Backspace"===r?t=o-1:"ArrowRight"===r?t=o+1:"Delete"===r&&(t=o),void 0!==t&&o===i){var y=t,O=g?d.indexOf("#"):f.length,w=g?d.lastIndexOf("#")+1:a.length-p.length;if("ArrowLeft"===r||"ArrowRight"===r){var j="ArrowLeft"===r?"left":"right";y=this.correctCaretPosition(a,t,j)}else if("Delete"!==r||b.test(a[t])||v.test(a[t])){if("Backspace"===r&&!b.test(a[t]))if(o<=O+1&&"-"===a[0]&&void 0===d){var S=a.substring(1);this.updateValue({formattedValue:S,caretPos:y,input:n})}else if(!v.test(a[t])){for(;!b.test(a[y-1])&&y>O;)y--;y=this.correctCaretPosition(a,y,"left")}}else for(;!b.test(a[y])&&y<w;)y++;(y!==t||t<O||t>w)&&(e.preventDefault(),this.setPatchedCaretPosition(n,y,a)),e.isUnitTestRun&&this.setPatchedCaretPosition(n,y,a),m(e)}else m(e)}},{key:"onMouseUp",value:function(e){var t=e.target,n=t.selectionStart,r=t.selectionEnd,o=t.value,i=void 0===o?"":o;if(n===r){var c=this.correctCaretPosition(i,n);c!==n&&this.setPatchedCaretPosition(t,c,i)}this.props.onMouseUp(e)}},{key:"onFocus",value: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,c=void 0===i?"":i,a=t.correctCaretPosition(c,r);a===r||0===r&&o===c.length||t.setPatchedCaretPosition(n,a,c),t.props.onFocus(e)}),0)}},{key:"render",value:function(){var e,t,n,r=this.props,o=r.type,i=r.displayType,c=r.customInput,a=r.renderText,u=r.getInputRef,l=r.format,p=this.state.value,d=(e=this.props,t=P,n={},Object.keys(e).forEach((function(r){t[r]||(n[r]=e[r])})),n),m=f({inputMode:function(e){return e||!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}(l)?"numeric":void 0},d,{type:o,value:p,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===i)return a?a(p)||null:s.a.createElement("span",f({},d,{ref:u}),p);if(c){var h=c;return s.a.createElement(h,f({},m,{ref:u}))}return s.a.createElement("input",f({},m,{ref:u}))}}])&&l(n.prototype,r),t}(s.a.Component);C.propTypes=P,C.defaultProps=F;var _=C;n(134);const T=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});var N=e=>{let{className:t,value:n,currency:o,onValueChange:c,displayType:u="text",...s}=e;const l="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(l))return null;const f=l/10**o.minorUnit;if(!Number.isFinite(f))return null;const p=i()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),d={...s,...T(o),value:void 0,currency:void 0,onValueChange:void 0},m=c?e=>{const t=e.value*10**o.minorUnit;c(t)}:()=>{};return Object(r.createElement)(_,a()({className:p,displayType:u},d,{value:f,onValueChange:m}))};n(133);const R=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)(N,{className:"wc-block-components-totals-item__value",currency:n||{},value:t}):null};var D=e=>{let{className:t,currency:n,label:o,value:c,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)(R,{value:c,currency:n}),Object(r.createElement)("div",{className:"wc-block-components-totals-item__description"},a))},I=n(1),A=n(4),M=e=>{let{currency:t,values:n,className:o}=e;const{total_items:i,total_items_tax:c}=n,a=parseInt(i,10),u=parseInt(c,10);return Object(r.createElement)(D,{className:o,currency:t,label:Object(I.__)("Subtotal",'woocommerce'),value:Object(A.getSetting)("displayCartPricesIncludingTax",!1)?a+u:a})};n(135);var B=e=>{let{currency:t,values:n,className:o,showRateAfterTaxName:c}=e;const{total_tax:a,tax_lines:u}=n;if(!Object(A.getSetting)("taxesEnabled",!0)&&parseInt(a,10)<=0)return null;const s=Object(A.getSetting)("displayItemizedTaxes",!1),l=s&&u.length>0?Object(r.createElement)("div",{className:i()("wc-block-components-totals-taxes",o)},u.map((e,n)=>{let{name:o,rate:i,price:a}=e;const u=`${o}${c?" "+i:""}`;return Object(r.createElement)(D,{key:"tax-line-"+n,className:"wc-block-components-totals-taxes__grouped-rate",currency:t,label:u,value:parseInt(a,10)})})," "):null;return s?l:Object(r.createElement)(r.Fragment,null,Object(r.createElement)(D,{className:i()("wc-block-components-totals-taxes",o),currency:t,label:Object(I.__)("Taxes",'woocommerce'),value:parseInt(a,10),description:null}))},L=e=>{let{currency:t,cartFees:n,className:o}=e;return Object(r.createElement)(r.Fragment,null,n.map((e,n)=>{let{id:c,name:a,totals:u}=e;const s=parseInt(u.total,10);if(!s)return null;const l=parseInt(u.total_tax,10);return Object(r.createElement)(D,{key:c||`${n}-${a}`,className:i()("wc-block-components-totals-fees",o),currency:t,label:a||Object(I.__)("Fee",'woocommerce'),value:Object(A.getSetting)("displayCartPricesIncludingTax",!1)?s+l:s})}))};n(136);var V=e=>{let{children:t,slotWrapper:n=!1}=e;return u.Children.count(t)?Object(r.createElement)("div",{className:"wc-block-components-totals-wrapper"+(n?" slot-wrapper":"")},t):null},U=n(6),W=n.n(U),H=n(8);function z(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var $=n(17);function K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function G(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?K(Object(n),!0).forEach((function(t){z(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function q(e){var t=Object(r.useContext)($.a),n=t.slots[e]||{},o=t.fills[e],i=Object(r.useMemo)((function(){return o||[]}),[o]),c=Object(r.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),a=Object(r.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),u=Object(r.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),s=Object(r.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return G(G({},n),{},{updateSlot:c,unregisterSlot:a,fills:i,registerFill:u,unregisterFill:s})}function Y(){return(Y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Z(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function J(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function X(e,t,n){return t&&Q(e.prototype,t),n&&Q(e,n),e}function ee(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function te(e){return(te=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ne(e,t,n){return(ne="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=te(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}var re=n(29);function oe(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(re.a)(e,t)}var ie=n(30),ce=n.n(ie);function ae(e,t){return!t||"object"!==ce()(t)&&"function"!=typeof t?ee(e):t}var ue=n(2);function se(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function le(e,t){if(e){if("string"==typeof e)return se(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?se(e,t):void 0}}function fe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,c=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){c=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,t)||le(e,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 pe(e){return function(e){if(Array.isArray(e))return se(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||le(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function de(e){return(de="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})(e)}var me=n(31),he=n.n(me);function be(e){var t=function(e,t){if("object"!==de(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==de(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===de(t)?t:String(t)}function ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(n),!0).forEach((function(t){z(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ye(e){var t,n,o,i,c,a,u,s,l,f,p,d=e.children,m=(t=fe(Object(r.useState)({}),2),n=t[0],o=t[1],i=fe(Object(r.useState)({}),2),c=i[0],a=i[1],u=Object(r.useCallback)((function(e,t,n){o((function(r){var o=r[e]||{};return ge(ge({},r),{},z({},e,ge(ge({},o),{},{ref:t||o.ref,fillProps:n||o.fillProps||{}})))}))}),[]),s=Object(r.useCallback)((function(e,t){o((function(n){var r=n[e],o=Z(n,[e].map(be));return(null==r?void 0:r.ref)===t?o:n}))}),[]),l=Object(r.useCallback)((function(e,t){var r=n[e];if(r&&!he()(r.fillProps,t)){r.fillProps=t;var o=c[e];o&&o.map((function(e){return e.current.rerender()}))}}),[n,c]),f=Object(r.useCallback)((function(e,t){a((function(n){return ge(ge({},n),{},z({},e,[].concat(pe(n[e]||[]),[t])))}))}),[]),p=Object(r.useCallback)((function(e,t){a((function(n){return n[e]?ge(ge({},n),{},z({},e,n[e].filter((function(e){return e!==t})))):n}))}),[]),Object(r.useMemo)((function(){return{slots:n,fills:c,registerSlot:u,updateSlot:l,unregisterSlot:s,registerFill:f,unregisterFill:p}}),[n,c,u,l,s,f,p]));return Object(r.createElement)($.a.Provider,{value:m},d)}var Oe=Object(r.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),we=Oe.Provider,je=Oe.Consumer,Se=function(e){oe(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=te(t);if(n){var o=te(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ae(this,e)});function i(){var e;return J(this,i),(e=o.apply(this,arguments)).registerSlot=e.registerSlot.bind(ee(e)),e.registerFill=e.registerFill.bind(ee(e)),e.unregisterSlot=e.unregisterSlot.bind(ee(e)),e.unregisterFill=e.unregisterFill.bind(ee(e)),e.getSlot=e.getSlot.bind(ee(e)),e.getFills=e.getFills.bind(ee(e)),e.hasFills=e.hasFills.bind(ee(e)),e.subscribe=e.subscribe.bind(ee(e)),e.slots={},e.fills={},e.listeners=[],e.contextValue={registerSlot:e.registerSlot,unregisterSlot:e.unregisterSlot,registerFill:e.registerFill,unregisterFill:e.unregisterFill,getSlot:e.getSlot,getFills:e.getFills,hasFills:e.hasFills,subscribe:e.subscribe},e}return X(i,[{key:"registerSlot",value:function(e,t){var n=this.slots[e];this.slots[e]=t,this.triggerListeners(),this.forceUpdateSlot(e),n&&n.forceUpdate()}},{key:"registerFill",value:function(e,t){this.fills[e]=[].concat(pe(this.fills[e]||[]),[t]),this.forceUpdateSlot(e)}},{key:"unregisterSlot",value:function(e,t){this.slots[e]===t&&(delete this.slots[e],this.triggerListeners())}},{key:"unregisterFill",value:function(e,t){this.fills[e]=Object(ue.without)(this.fills[e],t),this.resetFillOccurrence(e),this.forceUpdateSlot(e)}},{key:"getSlot",value:function(e){return this.slots[e]}},{key:"getFills",value:function(e,t){return this.slots[e]!==t?[]:Object(ue.sortBy)(this.fills[e],"occurrence")}},{key:"hasFills",value:function(e){return this.fills[e]&&!!this.fills[e].length}},{key:"resetFillOccurrence",value:function(e){Object(ue.forEach)(this.fills[e],(function(e){e.occurrence=void 0}))}},{key:"forceUpdateSlot",value:function(e){var t=this.getSlot(e);t&&t.forceUpdate()}},{key:"triggerListeners",value:function(){this.listeners.forEach((function(e){return e()}))}},{key:"subscribe",value:function(e){var t=this;return this.listeners.push(e),function(){t.listeners=Object(ue.without)(t.listeners,e)}}},{key:"render",value:function(){return Object(r.createElement)(we,{value:this.contextValue},Object(r.createElement)(ye,null,this.props.children))}}]),i}(r.Component);var Ee=function(e){oe(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=te(t);if(n){var o=te(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ae(this,e)});function i(){var e;return J(this,i),(e=o.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(ee(e)),e}return X(i,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,o=t.registerSlot;e.name!==n&&(r(e.name),o(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||ne(te(i.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,o=e.fillProps,i=void 0===o?{}:o,c=e.getFills,a=Object(ue.map)(c(n,this),(function(e){var t=e.occurrence,n=Object(ue.isFunction)(e.children)?e.children(i):e.children;return r.Children.map(n,(function(e,n){if(!e||Object(ue.isString)(e))return e;var o="".concat(t,"---").concat(e.key||n);return Object(r.cloneElement)(e,{key:o})}))})).filter(Object(ue.negate)(r.isEmptyElement));return Object(r.createElement)(r.Fragment,null,Object(ue.isFunction)(t)?t(a):a)}}]),i}(r.Component),ke=function(e){return Object(r.createElement)(je,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,i=t.getFills;return Object(r.createElement)(Ee,Y({},e,{registerSlot:n,unregisterSlot:o,getFills:i}))}))},xe=0;function Pe(e){var t=e.name,n=e.children,o=e.registerFill,i=e.unregisterFill,c=function(e){var t=Object(r.useContext)(Oe),n=t.getSlot,o=t.subscribe,i=fe(Object(r.useState)(n(e)),2),c=i[0],a=i[1];return Object(r.useEffect)((function(){return a(n(e)),o((function(){a(n(e))}))}),[e]),c}(t),a=Object(r.useRef)({name:t,children:n});return a.current.occurrence||(a.current.occurrence=++xe),Object(r.useLayoutEffect)((function(){return o(t,a.current),function(){return i(t,a.current)}}),[]),Object(r.useLayoutEffect)((function(){a.current.children=n,c&&c.forceUpdate()}),[n]),Object(r.useLayoutEffect)((function(){t!==a.current.name&&(i(a.current.name,a.current),a.current.name=t,o(t,a.current))}),[t]),c&&c.node?(Object(ue.isFunction)(n)&&(n=n(c.props.fillProps)),Object(r.createPortal)(n,c.node)):null}var Fe=function(e){return Object(r.createElement)(je,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(r.createElement)(Pe,Y({},e,{registerFill:n,unregisterFill:o}))}))};function Ce(e){var t=e.name,n=e.fillProps,o=void 0===n?{}:n,i=e.as,c=void 0===i?"div":i,a=Z(e,["name","fillProps","as"]),u=Object(r.useContext)($.a),s=Object(r.useRef)();return Object(r.useLayoutEffect)((function(){return u.registerSlot(t,s,o),function(){u.unregisterSlot(t,s)}}),[u.registerSlot,u.unregisterSlot,t]),Object(r.useLayoutEffect)((function(){u.updateSlot(t,o)})),Object(r.createElement)(c,Y({ref:s},a))}function _e(e){var t,n=e.name,o=e.children,i=q(n),c=Object(r.useRef)({rerender:(t=fe(Object(r.useState)({}),2)[1],function(){return t({})})});return Object(r.useEffect)((function(){return i.registerFill(c),function(){i.unregisterFill(c)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),Object(r.createPortal)(o,i.ref.current)):null}function Te(e){var t=e.bubblesVirtually,n=Z(e,["bubblesVirtually"]);return t?Object(r.createElement)(Ce,n):Object(r.createElement)(ke,n)}function Ne(e){return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Fe,e),Object(r.createElement)(_e,e))}function Re(e){var t=function(t){return Object(r.createElement)(Ne,Y({name:e},t))};t.displayName=e+"Fill";var n=function(t){return Object(r.createElement)(Te,Y({name:e},t))};return n.displayName=e+"Slot",{Fill:t,Slot:n}}var De=n(14),Ie=n.n(De);class Ae extends u.Component{constructor(){super(...arguments),Ie()(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 Me=Ae;const Be=e=>Array.isArray(e)&&e.filter(Boolean).length>0;let Le;Le=q;const Ve=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const{Fill:n,Slot:o}=Re(e),i=e=>{let{children:o}=e;return Object(r.createElement)(n,null,e=>r.Children.map(o,n=>Object(r.createElement)(Me,{renderError:A.CURRENT_USER_IS_ADMIN?t:()=>null},Object(r.cloneElement)(n,e))))},c=e=>Object(r.createElement)(o,a()({},e,{bubblesVirtually:!0}));return{Fill:i,Slot:c}},{Fill:Ue,Slot:We}=Ve("__experimentalOrderMeta");Ue.Slot=e=>{let{className:t,extensions:n,cart:o}=e;const{fills:c}=Le("__experimentalOrderMeta");return Be(c)&&Object(r.createElement)(V,{slotWrapper:!0},Object(r.createElement)(We,{className:i()(t,"wc-block-components-order-meta"),fillProps:{extensions:n,cart:o}}))};var He=Ue;const{Fill:ze,Slot:$e}=Ve("__experimentalDiscountsMeta");ze.Slot=e=>{let{className:t,extensions:n,cart:o}=e;const{fills:c}=Le("__experimentalDiscountsMeta");return Be(c)&&Object(r.createElement)(V,{slotWrapper:!0},Object(r.createElement)($e,{className:i()(t,"wc-block-components-discounts-meta"),fillProps:{extensions:n,cart:o}}))};var Ke=ze;const{Fill:Ge,Slot:qe}=Ve("__experimentalOrderShippingPackages");Ge.Slot=e=>{let{className:t,collapsible:n,noResultsMessage:o,renderOption:c,extensions:a,cart:u,components:s}=e;const{fills:l}=Le("__experimentalOrderShippingPackages"),f=l.length>1;return Object(r.createElement)(qe,{className:i()("wc-block-components-shipping-rates-control",t),fillProps:{collapsible:n,collapse:f,showItems:f,noResultsMessage:o,renderOption:c,extensions:a,cart:u,components:s}})};var Ye=Ge,Ze=function(e){let{srcElement:t,size:n=24,...o}=e;return Object(r.isValidElement)(t)?Object(r.cloneElement)(t,{width:n,height:n,...o}):null},Je=Object(r.createElement)(H.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)("path",{d:"M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z"})),Qe=Object(r.createElement)(H.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)("path",{d:"M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"}));n(137);var Xe=e=>{let{children:t,className:n,initialOpen:o=!1,hasBorder:c=!1,title:a,titleTag:u="div"}=e;const[s,l]=Object(r.useState)(o);return Object(r.createElement)("div",{className:i()(n,"wc-block-components-panel",{"has-border":c})},Object(r.createElement)(u,null,Object(r.createElement)("button",{"aria-expanded":s,className:"wc-block-components-panel__button",onClick:()=>l(!s)},Object(r.createElement)(Ze,{"aria-hidden":"true",className:"wc-block-components-panel__button-icon",srcElement:s?Je:Qe}),a)),s&&Object(r.createElement)("div",{className:"wc-block-components-panel__content"},t))},et=n(15),tt=n(20),nt=n(12),rt=Object(r.createElement)(H.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(H.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 ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function it(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(n),!0).forEach((function(t){z(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ct(e,t,n,r,o,i,c){var a=t.width,u="rtl"===document.documentElement.dir;"left"===n&&u?n="right":"right"===n&&u&&(n="left"),"left"===r&&u?r="right":"right"===r&&u&&(r="left");var s=Math.round(e.left+e.width/2),l={popoverLeft:s,contentWidth:(s-a/2>0?a/2:s)+(s+a/2>window.innerWidth?window.innerWidth-s:a/2)},f=e.left;"right"===r?f=e.right:"middle"!==i&&(f=s);var p=e.right;"left"===r?p=e.left:"middle"!==i&&(p=s);var d,m={popoverLeft:f,contentWidth:f-a>0?a:f},h={popoverLeft:p,contentWidth:p+a>window.innerWidth?window.innerWidth-p:a},b=n,v=null;if(!o)if("center"===n&&l.contentWidth===a)b="center";else if("left"===n&&m.contentWidth===a)b="left";else if("right"===n&&h.contentWidth===a)b="right";else{var g="left"==(b=m.contentWidth>h.contentWidth?"left":"right")?m.contentWidth:h.contentWidth;v=g!==a?g:null}if(d="center"===b?l.popoverLeft:"left"===b?m.popoverLeft:h.popoverLeft,c){var y=c.getBoundingClientRect();d=Math.min(d,y.right-a)}return{xAxis:b,popoverLeft:d,contentWidth:v}}function at(e,t,n,r,o,i,c){var a=t.height;if(o){var u=(Object(et.getScrollContainer)(i)||document.body).getBoundingClientRect().top+a-c;if(e.top<=u)return{yAxis:n,popoverTop:Math.min(e.bottom,u)}}var s=e.top+e.height/2;"bottom"===r?s=e.bottom:"top"===r&&(s=e.top);var l={popoverTop:s,contentHeight:(s-a/2>0?a/2:s)+(s+a/2>window.innerHeight?window.innerHeight-s:a/2)},f={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},d=n,m=null;if(!o)if("middle"===n&&l.contentHeight===a)d="middle";else if("top"===n&&f.contentHeight===a)d="top";else if("bottom"===n&&p.contentHeight===a)d="bottom";else{var h="top"==(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;m=h!==a?h:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:m}}var ut=Object(r.createContext)({focusHistory:[]}),st=ut.Provider,lt=ut.Consumer;st.displayName="FocusReturnProvider",lt.displayName="FocusReturnConsumer",r.Component;var ft=Object(nt.createHigherOrderComponent)((function e(t){if((o=t)instanceof r.Component||"function"==typeof o){var n=t;return e({})(n)}var o,i=t.onFocusReturn,c=void 0===i?ue.stubTrue:i;return function(e){var t=function(t){oe(a,t);var n,o,i=(n=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=te(n);if(o){var r=te(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return ae(this,e)});function a(){var e;return J(this,a),(e=i.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return X(a,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==c())for(var r,o=[].concat(pe(ue.without.apply(void 0,[this.props.focus.focusHistory].concat(pe(n)))),[e]);r=o.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(r.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(r.createElement)(e,this.props.childProps))}}]),a}(r.Component);return function(e){return Object(r.createElement)(lt,null,(function(n){return Object(r.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");var pt=Object(nt.createHigherOrderComponent)((function(e){return function(t){oe(c,t);var n,o,i=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=te(n);if(o){var r=te(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return ae(this,e)});function c(){var e;return J(this,c),(e=i.apply(this,arguments)).focusContainRef=Object(r.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(ee(e)),e}return X(c,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===tt.TAB){var t=et.focus.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return Object(r.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(r.createElement)(e,this.props))}}]),c}(r.Component)}),"withConstrainedTabbing");var dt=["button","submit"];var mt=Object(nt.createHigherOrderComponent)((function(e){return function(t){oe(c,t);var n,o,i=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=te(n);if(o){var r=te(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return ae(this,e)});function c(){var e;return J(this,c),(e=i.apply(this,arguments)).bindNode=e.bindNode.bind(ee(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(ee(e)),e.queueBlurCheck=e.queueBlurCheck.bind(ee(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(ee(e)),e}return X(c,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(ue.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(ue.includes)(dt,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(r.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(r.createElement)(e,Y({ref:this.bindNode},this.props)))}}]),c}(r.Component)}),"withFocusOutside")(function(e){oe(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=te(t);if(n){var o=te(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ae(this,e)});function o(){return J(this,o),r.apply(this,arguments)}return X(o,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),o}(r.Component));function ht(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=te(e);if(t){var o=te(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ae(this,n)}}var bt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,o=e.className,i=void 0===o?"lockscroll":o,c=0,a=0;function u(e){var t=n.scrollingElement||n.body;e&&(a=t.scrollTop);var r=e?"add":"remove";t.classList[r](i),n.documentElement.classList[r](i),e||(t.scrollTop=a)}function s(){0===c&&u(!0),++c}function l(){1===c&&u(!1),--c}return function(e){oe(n,e);var t=ht(n);function n(){return J(this,n),t.apply(this,arguments)}return X(n,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),n}(r.Component)}();function vt(e){e.stopPropagation()}var gt=Object(r.forwardRef)((function(e,t){var n=e.children,o=Z(e,["children"]);return Object(r.createElement)("div",Y({},o,{ref:t,onMouseDown:vt}),n)}));function yt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ot(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yt(Object(n),!0).forEach((function(t){z(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wt(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var o,c=fe(r.split(" "),2),a=c[0],u=c[1],s=void 0===u?"center":u;return i()("components-animate__appear",(z(o={},"is-from-"+s,"center"!==s),z(o,"is-from-"+a,"middle"!==a),o))}return"slide-in"===t?i()("components-animate__slide-in","is-from-"+r):"loading"===t?i()("components-animate__loading"):void 0}function jt(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:wt(Ot({type:t},r))})}var St=pt(ft((function(e){return e.children})));function Et(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),o=r.paddingTop,i=r.paddingBottom,c=r.paddingLeft,a=r.paddingRight,u=o?parseInt(o,10):0,s=i?parseInt(i,10):0,l=c?parseInt(c,10):0,f=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+u,width:e.width-l-f,height:e.height-u-s,left:e.left+l,right:e.right-f,top:e.top+u,bottom:e.bottom-s}}function kt(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function xt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function Pt(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var Ft=function(e){var t=e.headerTitle,n=e.onClose,o=e.onKeyDown,c=e.children,a=e.className,u=e.noArrow,s=void 0===u||u,l=e.isAlternate,f=e.position,p=void 0===f?"bottom right":f,d=(e.range,e.focusOnMount),m=void 0===d?"firstElement":d,h=e.anchorRef,b=e.shouldAnchorIncludePadding,v=e.anchorRect,g=e.getAnchorRect,y=e.expandOnMobile,O=e.animate,w=void 0===O||O,j=e.onClickOutside,S=e.onFocusOutside,E=e.__unstableSticky,k=e.__unstableSlotName,x=void 0===k?"Popover":k,P=e.__unstableObserveElement,F=e.__unstableBoundaryParent,C=Z(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),_=Object(r.useRef)(null),T=Object(r.useRef)(null),N=Object(r.useRef)(),R=Object(nt.useViewportMatch)("medium","<"),D=fe(Object(r.useState)(),2),I=D[0],A=D[1],M=q(x),B=y&&R,L=fe(Object(nt.useResizeObserver)(),2),V=L[0],U=L[1];s=B||s,Object(r.useLayoutEffect)((function(){if(B)return Pt(N.current,"is-without-arrow",s),Pt(N.current,"is-alternate",l),kt(N.current,"data-x-axis"),kt(N.current,"data-y-axis"),xt(N.current,"top"),xt(N.current,"left"),xt(T.current,"maxHeight"),void xt(T.current,"maxWidth");var e=function(){if(N.current&&T.current){var e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return Object(et.getRectangleFromRange)(r);if(r instanceof window.Element){var i=r.getBoundingClientRect();return o?i:Et(i,r)}var c=r.top,a=r.bottom,u=c.getBoundingClientRect(),s=a.getBoundingClientRect(),l=new window.DOMRect(u.left,u.top,u.width,s.bottom-u.top);return o?l:Et(l,r)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return o?p:Et(p,f)}}(_,v,g,h,b);if(e){var t,n,r=N.current,o=r.offsetParent,i=r.ownerDocument,c=0;if(o&&o!==i.body){var a=o.getBoundingClientRect();c=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}F&&(t=null===(n=N.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode);var u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,c=arguments.length>6?arguments[6]:void 0,a=n.split(" "),u=fe(a,3),s=u[0],l=u[1],f=void 0===l?"center":l,p=u[2],d=at(e,t,s,p,r,o,i),m=ct(e,t,f,p,r,d.yAxis,c);return it(it({},m),d)}(e,U.height?U:T.current.getBoundingClientRect(),p,E,N.current,c,t),f=u.popoverTop,d=u.popoverLeft,m=u.xAxis,y=u.yAxis,O=u.contentHeight,w=u.contentWidth;"number"==typeof f&&"number"==typeof d&&(xt(N.current,"top",f+"px"),xt(N.current,"left",d+"px")),Pt(N.current,"is-without-arrow",s||"center"===m&&"middle"===y),Pt(N.current,"is-alternate",l),kt(N.current,"data-x-axis",m),kt(N.current,"data-y-axis",y),xt(T.current,"maxHeight","number"==typeof O?O+"px":""),xt(T.current,"maxWidth","number"==typeof w?w+"px":""),A(({left:"right",right:"left"}[m]||"center")+" "+({top:"bottom",bottom:"top"}[y]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),P&&(n=new window.MutationObserver(e)).observe(P,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[B,v,g,h,b,p,U,E,P,F]),function(e,t){Object(r.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=et.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(m,T);var H=function(e){e.keyCode===tt.ESCAPE&&n&&(e.stopPropagation(),n()),o&&o(e)},z=Object(r.createElement)(mt,{onFocusOutside:function(e){if(S)S(e);else if(j){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),W()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),j(t)}else n&&n()}},Object(r.createElement)(jt,{type:w&&I?"appear":null,options:{origin:I}},(function(e){var o=e.className;return Object(r.createElement)(gt,Y({className:i()("components-popover",a,o,{"is-expanded":B,"is-without-arrow":s,"is-alternate":l})},C,{onKeyDown:H,ref:N}),B&&Object(r.createElement)(bt,null),B&&Object(r.createElement)("div",{className:"components-popover__header"},Object(r.createElement)("span",{className:"components-popover__header-title"},t),Object(r.createElement)(Bt,{className:"components-popover__close",icon:rt,onClick:n})),Object(r.createElement)("div",{ref:T,className:"components-popover__content",tabIndex:"-1"},Object(r.createElement)("div",{style:{position:"relative"}},V,c)))})));return m&&(z=Object(r.createElement)(St,null,z)),M.ref&&(z=Object(r.createElement)(Ne,{name:x},z)),h||v?z:Object(r.createElement)("span",{ref:_},z)};Ft.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(r.createElement)(Te,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var Ct=Ft,_t=function(e){var t,n,o=e.shortcut,i=e.className;return o?(Object(ue.isString)(o)&&(t=o),Object(ue.isObject)(o)&&(t=o.display,n=o.ariaLabel),Object(r.createElement)("span",{className:i,"aria-label":n},t)):null};var Tt=function(e){oe(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=te(t);if(n){var o=te(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ae(this,e)});function i(){var e;return J(this,i),(e=o.apply(this,arguments)).delayedSetIsOver=Object(ue.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return X(i,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===r.Children.count(n)){var o=r.Children.only(n);"function"==typeof o.props[e]&&o.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var o=Object(ue.includes)(["focus","mouseenter"],r.type);o!==n.state.isOver&&(t?n.delayedSetIsOver(o):n.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,o=e.text,i=e.shortcut;if(1!==r.Children.count(t))return t;var c=r.Children.only(t),a=this.state.isOver;return Object(r.cloneElement)(c,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(r.concatChildren)(c.props.children,a&&Object(r.createElement)(Ct,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},o,Object(r.createElement)(_t,{className:"components-tooltip__shortcut",shortcut:i})))})}}]),i}(r.Component),Nt=function(e){var t=e.icon,n=e.className,o=Z(e,["icon","className"]),i=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" ");return Object(r.createElement)("span",Y({className:i},o))};function Rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Dt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rt(Object(n),!0).forEach((function(t){z(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var It=function(e){var t=e.icon,n=void 0===t?null:t,o=e.size,i=Z(e,["icon","size"]);if("string"==typeof n)return Object(r.createElement)(Nt,Y({icon:n},i));if(n&&Nt===n.type)return Object(r.cloneElement)(n,Dt({},i));var c=o||24;if("function"==typeof n)return n.prototype instanceof r.Component?Object(r.createElement)(n,Dt({size:c},i)):n(Dt({size:c},i));if(n&&("svg"===n.type||n.type===H.SVG)){var a=Dt(Dt({width:c,height:c},n.props),i);return Object(r.createElement)(H.SVG,a)}return Object(r.isValidElement)(n)?Object(r.cloneElement)(n,Dt({size:c},i)):n};function At(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Mt=["onMouseDown","onClick"],Bt=Object(r.forwardRef)((function(e,t){var n=e.href,o=e.target,c=e.isPrimary,a=e.isSmall,u=e.isTertiary,s=e.isPressed,l=e.isBusy,f=e.isDefault,p=e.isSecondary,d=e.isLink,m=e.isDestructive,h=e.className,b=e.disabled,v=e.icon,g=e.iconSize,y=e.showTooltip,O=e.tooltipPosition,w=e.shortcut,j=e.label,S=e.children,E=e.__experimentalIsFocusable,k=Z(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);f&&W()("Button isDefault prop",{alternative:"isSecondary"});var x=i()("components-button",h,{"is-secondary":f||p,"is-primary":c,"is-small":a,"is-tertiary":u,"is-pressed":s,"is-busy":l,"is-link":d,"is-destructive":m,"has-text":!!v&&!!S,"has-icon":!!v}),P=b&&!E,F=void 0===n||P?"button":"a",C="a"===F?{href:n,target:o}:{type:"button",disabled:P,"aria-pressed":s};if(b&&E){C["aria-disabled"]=!0;var _,T=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return At(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?At(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return c=e.done,e},e:function(e){a=!0,i=e},f:function(){try{c||null==n.return||n.return()}finally{if(a)throw i}}}}(Mt);try{for(T.s();!(_=T.n()).done;)k[_.value]=function(e){e.stopPropagation(),e.preventDefault()}}catch(e){T.e(e)}finally{T.f()}}var N=!P&&(y&&j||w||!!j&&(!S||Object(ue.isArray)(S)&&!S.length)&&!1!==y),R=Object(r.createElement)(F,Y({},C,k,{className:x,"aria-label":k["aria-label"]||j,ref:t}),v&&Object(r.createElement)(It,{icon:v,size:g}),S);return N?Object(r.createElement)(Tt,{text:j,shortcut:w,position:O},R):R}));n(139);var Lt=()=>Object(r.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"});n(138);var Vt=e=>{let{className:t,showSpinner:n=!1,children:o,...c}=e;const u=i()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return Object(r.createElement)(Bt,a()({className:u},c),n&&Object(r.createElement)(Lt,null),Object(r.createElement)("span",{className:"wc-block-components-button__text"},o))},Ut=e=>{let t,{label:n,screenReaderLabel:o,wrapperElement:c,wrapperProps:a={}}=e;const u=null!=n,s=null!=o;return!u&&s?(t=c||"span",a={...a,className:i()(a.className,"screen-reader-text")},Object(r.createElement)(t,a,o)):(t=c||r.Fragment,u&&s&&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(140);var Wt=Object(nt.withInstanceId)(e=>{let{className:t,label:n,id:o,instanceId:c,onChange:u,children:s,hasError:l=!1,...f}=e;const p=o||"checkbox-control-"+c;return Object(r.createElement)("div",{className:i()("wc-block-components-checkbox",{"has-error":l},t)},Object(r.createElement)("label",{htmlFor:p},Object(r.createElement)("input",a()({id:p,className:"wc-block-components-checkbox__input",type:"checkbox",onChange:e=>u(e.target.checked),"aria-invalid":!0===l},f)),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),s))});const Ht=(e,t)=>{if(!e.includes(t))throw Error(Object(I.sprintf)( /* translators: %1$s value passed to filter, %2$s : value that must be included. */ Object(I.__)('Returned value must include %1$s, you passed "%2$s"','woocommerce'),t,e));return!0};var zt=n(7),$t=n(11);const Kt=e=>{const{applyExtensionCartUpdate:t}=Object(zt.dispatch)($t.b);return t(e)},Gt=()=>!0;let qt={};const Yt=(e,t)=>{Object.keys(t).includes("couponName")&&W()("snackbarNotices",{alternative:"snackbarNoticeVisibility",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4417"}),Object.keys(t).includes("couponName")&&W()("couponName",{alternative:"coupons",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/bb921d21f42e21f38df2b1c87b48e07aa4cb0538/docs/extensibility/available-filters.md#coupons"}),qt={...qt,[e]:t}},Zt=e=>{let{filterName:t,defaultValue:n,extensions:o=null,arg:i=null,validation:c=Gt}=e;return Object(r.useMemo)(()=>{const e=(e=>Object.keys(qt).map(t=>qt[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(I.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(I.__)("The type returned by checkout filters must be the same as the type they receive. The function received %1$s but returned %2$s.",'woocommerce'),typeof r,typeof t));r=c(t)?t:r}catch(e){if(A.CURRENT_USER_IS_ADMIN)throw e;console.error(e)}}),r},[t,n,o,i,c])};let Jt;!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"}(Jt||(Jt={}));const Qt={},Xt=e=>Object.values(Jt).includes(e),en=e=>Xt(e)?Object.values(Qt).filter(t=>{let{metadata:n}=t;return((null==n?void 0:n.parent)||[]).includes(e)}):[];var tn=n(32);const nn=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object,rn=e=>{var t,n,r,o;((e,t,n)=>{if(!nn(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&&!Xt(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=>Xt(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(nn(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(tn.registerBlockComponent)({blockName:e.metadata.name,component:e.component}),Qt[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)}}},15:function(e,t){e.exports=window.wp.dom},17:function(e,t,n){"use strict";(function(e){var r=n(0),o=(n(28),Object(r.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,n(18))},18: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 u,s=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?s=u.concat(s):f=-1,s.length&&d())}function d(){if(!l){var e=a(p);l=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===c||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function h(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new m(e,t)),1!==s.length||l||a(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},2:function(e,t){e.exports=window.lodash},20:function(e,t){e.exports=window.wp.keycodes},28:function(e,t){e.exports=window.wp.warning},29:function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},3:function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var c=o.apply(null,r);c&&e.push(c)}}else if("object"===i)if(r.toString===Object.prototype.toString)for(var a in r)n.call(r,a)&&r[a]&&e.push(a);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},30:function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},31:function(e,t){e.exports=window.wp.isShallowEqual},32:function(e,t){e.exports=window.wc.wcBlocksRegistry},4:function(e,t){e.exports=window.wc.wcSettings},6:function(e,t){e.exports=window.wp.deprecated},7:function(e,t){e.exports=window.wp.data},8:function(e,t){e.exports=window.wp.primitives},9:function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0}});