!function(){"use strict";var e,t={7652:function(e,t,n){var r=window.wp.blocks,a=window.wp.i18n,o=window.wp.blockEditor,c=window.wp.components,s=window.React,i=n.n(s);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(null,arguments)}function u(e){let{name:t,...n}=e;const[r,a]=(0,s.useState)(null),o=window?.scData?.plugin_url+"/dist/icon-assets",c=/^[a-zA-Z0-9_-]+$/.test(t);if((0,s.useEffect)((()=>{c&&fetch(`${o}/${t}.svg`).then((e=>e.text())).then((e=>{const t=(new DOMParser).parseFromString(e,"image/svg+xml"),n=t?.documentElement;"svg"===n?.tagName?.toLowerCase()&&a(n)})).catch(console.error)}),[t,c]),!r)return null;const u={class:"className","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation-filters":"colorInterpolationFilters","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-opacity":"floodOpacity","font-size":"fontSize","stop-color":"stopColor","stop-opacity":"stopOpacity","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth"},p={};for(const e of r.attributes)p[u[e.name]||e.name]=e.value;return i().createElement("svg",l({},p,n,{dangerouslySetInnerHTML:{__html:r.innerHTML}}))}var p=JSON.parse('{"UU":"surecart/cart-menu-icon-button"}');(0,r.registerBlockType)(p.UU,{icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"16",height:"16",viewBox:"0 0 28 28",stroke:"currentColor",style:{fill:"none"},strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},React.createElement("path",{d:"M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z"}),React.createElement("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),React.createElement("path",{d:"M16 10a4 4 0 0 1-8 0"})),edit:e=>{let{attributes:t,setAttributes:n}=e;const{cart_icon:r,cart_menu_always_shown:s}=t,i=(0,o.useBlockProps)({style:{fontSize:"16px",fontFamily:"var(--sc-font-sans)"}});return React.createElement("div",null,React.createElement(o.InspectorControls,null,React.createElement(c.PanelBody,{title:(0,a.__)("Settings","surecart")},React.createElement(c.PanelRow,null,React.createElement("div",{style:{marginBottom:20,width:"100%",flex:"flex-1"}},React.createElement("h2",{className:"components-truncate components-text components-heading"},(0,a.__)("Icon","surecart")),React.createElement("div",{className:"sc-choices"},React.createElement("div",{className:"sc-choice "+("shopping-bag"===r?"sc-choice--checked":""),onClick:()=>n({cart_icon:"shopping-bag"})},React.createElement(u,{name:"shopping-bag",class:"shopping-bag"===r?"active":""})),React.createElement("div",{className:"sc-choice "+("shopping-cart"===r?"sc-choice--checked":""),onClick:()=>n({cart_icon:"shopping-cart"})},React.createElement(u,{name:"shopping-cart",class:"shopping-cart"===r?"active":""}))))),React.createElement(c.PanelRow,null,React.createElement(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Always show cart","surecart"),help:(0,a.__)("Enable to always show the cart button, even when your cart is empty.","surecart"),checked:s,onChange:()=>n({cart_menu_always_shown:!s})})))),React.createElement("a",i,React.createElement("div",{class:"sc-cart-icon"},React.createElement(u,{name:r})),React.createElement("span",{class:"sc-cart-count"},"2")))}})}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.m=t,e=[],r.O=function(t,n,a,o){if(!n){var c=1/0;for(u=0;u<e.length;u++){n=e[u][0],a=e[u][1],o=e[u][2];for(var s=!0,i=0;i<n.length;i++)(!1&o||c>=o)&&Object.keys(r.O).every((function(e){return r.O[e](n[i])}))?n.splice(i--,1):(s=!1,o<c&&(c=o));if(s){e.splice(u--,1);var l=a();void 0!==l&&(t=l)}}return t}o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,a,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.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={5722:0,750:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var a,o,c=n[0],s=n[1],i=n[2],l=0;if(c.some((function(t){return 0!==e[t]}))){for(a in s)r.o(s,a)&&(r.m[a]=s[a]);if(i)var u=i(r)}for(t&&t(n);l<c.length;l++)o=c[l],r.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return r.O(u)},n=self.webpackChunk_surecart_blocks_next=self.webpackChunk_surecart_blocks_next||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var a=r.O(void 0,[750],(function(){return r(7652)}));a=r.O(a)}();