PK
Current Path : /home/wallqcyy/www/wp-content/plugins/woocommerce/assets/client/blocks/ |
Current File : //home/wallqcyy/www/wp-content/plugins/woocommerce/assets/client/blocks/handpicked-products.js |
(()=>{var e,t,s,r={4073:(e,t,s)=>{"use strict";const r=window.wp.blocks,i=window.wc.wcSettings;var o=s(4530),c=s(3106);s(9202);const n=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":{"interactivity":{"clientNavigation":false},"align":["wide","full"],"html":false,"inserter":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":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}'),l=window.wp.blockEditor,a=window.wp.components;var d=s(6087),h=s(7723),m=s(790);const u=({onChange:e,settings:t})=>{const{image:s,button:r,price:i,rating:o,title:c}=t,n=!1!==s;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(a.ToggleControl,{label:(0,h.__)("Product image","woocommerce"),checked:n,onChange:()=>e({...t,image:!n})}),(0,m.jsx)(a.ToggleControl,{label:(0,h.__)("Product title","woocommerce"),checked:c,onChange:()=>e({...t,title:!c})}),(0,m.jsx)(a.ToggleControl,{label:(0,h.__)("Product price","woocommerce"),checked:i,onChange:()=>e({...t,price:!i})}),(0,m.jsx)(a.ToggleControl,{label:(0,h.__)("Product rating","woocommerce"),checked:o,onChange:()=>e({...t,rating:!o})}),(0,m.jsx)(a.ToggleControl,{label:(0,h.__)("Add to Cart button","woocommerce"),checked:r,onChange:()=>e({...t,button:!r})})]})},x=({value:e,setAttributes:t})=>(0,m.jsx)(a.SelectControl,{label:(0,h.__)("Order products by","woocommerce"),value:e,options:[{label:(0,h.__)("Newness - newest first","woocommerce"),value:"date"},{label:(0,h.__)("Price - low to high","woocommerce"),value:"price_asc"},{label:(0,h.__)("Price - high to low","woocommerce"),value:"price_desc"},{label:(0,h.__)("Rating - highest first","woocommerce"),value:"rating"},{label:(0,h.__)("Sales - most first","woocommerce"),value:"popularity"},{label:(0,h.__)("Title - alphabetical","woocommerce"),value:"title"},{label:(0,h.__)("Menu Order","woocommerce"),value:"menu_order"}],onChange:e=>t({orderby:e})});var p=s(2624),g=s(4921),w=s(9491);const E={clear:(0,h.__)("Clear all selected items","woocommerce"),noItems:(0,h.__)("No items found.","woocommerce"), /* Translators: %s search term */ noResults:(0,h.__)("No results for %s","woocommerce"),search:(0,h.__)("Search for items","woocommerce"),selected:e=>(0,h.sprintf)(/* translators: Number of items selected from list. */ /* translators: Number of items selected from list. */ (0,h._n)("%d item selected","%d items selected",e,"woocommerce"),e),updated:(0,h.__)("Search results updated.","woocommerce")},j=(e,t=e)=>{const s=e.reduce(((e,t)=>{const s=t.parent||0;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),r=t.reduce(((e,t)=>(e[String(t.id)]=t,e)),{});const i=["0"],o=(e={})=>e.parent?[...o(r[e.parent]),e.name]:e.name?[e.name]:[],c=e=>e.map((e=>{const t=s[e.id];return i.push(""+e.id),{...e,breadcrumbs:o(r[e.parent]),children:t&&t.length?c(t):[]}})),n=c(s[0]||[]);return Object.entries(s).forEach((([e,t])=>{i.includes(e)||n.push(...c(t||[]))})),n},_=(e,t)=>{if(!t)return e;const s=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(s).map(((e,t)=>s.test(e)?(0,m.jsx)("strong",{children:e},t):(0,m.jsx)(d.Fragment,{children:e},t)))};function f(e,t,s){const r=new Set(t.map((e=>e[s])));return e.filter((e=>!r.has(e[s])))}const b=window.wp.htmlEntities,y=({label:e})=>(0,m.jsx)("span",{className:"woocommerce-search-list__item-count",children:e}),v=e=>{const{item:t,search:s}=e,r=t.breadcrumbs&&t.breadcrumbs.length;return(0,m.jsxs)("span",{className:"woocommerce-search-list__item-label",children:[r?(0,m.jsx)("span",{className:"woocommerce-search-list__item-prefix",children:(i=t.breadcrumbs,1===i.length?i.slice(0,1).toString():2===i.length?i.slice(0,1).toString()+" › "+i.slice(-1).toString():i.slice(0,1).toString()+" … "+i.slice(-1).toString())}):null,(0,m.jsx)("span",{className:"woocommerce-search-list__item-name",children:_((0,b.decodeEntities)(t.name),s)})]});var i},S=({countLabel:e,className:t,depth:s=0,controlId:r="",item:i,isSelected:o,isSingle:c,onSelect:n,search:l="",selected:h,useExpandedPanelId:u,...x})=>{const[p,w]=u,E=null!=e&&void 0!==i.count&&null!==i.count,j=!!i.breadcrumbs?.length,S=!!i.children?.length,k=p===i.id,C=(0,g.A)(["woocommerce-search-list__item",`depth-${s}`,t],{"has-breadcrumbs":j,"has-children":S,"has-count":E,"is-expanded":k,"is-radio-button":c});(0,d.useEffect)((()=>{S&&o&&w(i.id)}),[i,S,o,w]);const P=x.name||`search-list-item-${r}`,O=`${P}-${i.id}`,A=(0,d.useCallback)((()=>{w(k?-1:Number(i.id))}),[k,i.id,w]);return S?(0,m.jsx)("div",{className:C,onClick:A,onKeyDown:e=>"Enter"===e.key||" "===e.key?A():null,role:"treeitem",tabIndex:0,children:c?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("input",{type:"radio",id:O,name:P,value:i.value,onChange:n(i),onClick:e=>e.stopPropagation(),checked:o,className:"woocommerce-search-list__item-input",...x}),(0,m.jsx)(v,{item:i,search:l}),E?(0,m.jsx)(y,{label:e||i.count}):null]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(a.CheckboxControl,{className:"woocommerce-search-list__item-input",checked:o,...!o&&i.children.some((e=>h.find((t=>t.id===e.id))))?{indeterminate:!0}:{},label:_((0,b.decodeEntities)(i.name),l),onChange:()=>{o?n(f(h,i.children,"id"))():n(function(e,t){const s=f(t,e,"id");return[...e,...s]}(h,i.children))()},onClick:e=>e.stopPropagation()}),E?(0,m.jsx)(y,{label:e||i.count}):null]})}):(0,m.jsxs)("label",{htmlFor:O,className:C,children:[c?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("input",{...x,type:"radio",id:O,name:P,value:i.value,onChange:n(i),checked:o,className:"woocommerce-search-list__item-input"}),(0,m.jsx)(v,{item:i,search:l})]}):(0,m.jsx)(a.CheckboxControl,{...x,id:O,name:P,className:"woocommerce-search-list__item-input",value:(0,b.decodeEntities)(i.value),label:_((0,b.decodeEntities)(i.name),l),onChange:n(i),checked:o}),E?(0,m.jsx)(y,{label:e||i.count}):null]})};var k=s(3028);s(5022);const C=({id:e,label:t,popoverContents:s,remove:r,screenReaderLabel:i,className:c=""})=>{const[n,l]=(0,d.useState)(!1),u=(0,w.useInstanceId)(C);if(i=i||t,!t)return null;t=(0,b.decodeEntities)(t);const x=(0,g.A)("woocommerce-tag",c,{"has-remove":!!r}),p=`woocommerce-tag__label-${u}`,E=(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("span",{className:"screen-reader-text",children:i}),(0,m.jsx)("span",{"aria-hidden":"true",children:t})]});return(0,m.jsxs)("span",{className:x,children:[s?(0,m.jsx)(a.Button,{className:"woocommerce-tag__text",id:p,onClick:()=>l(!0),children:E}):(0,m.jsx)("span",{className:"woocommerce-tag__text",id:p,children:E}),s&&n&&(0,m.jsx)(a.Popover,{onClose:()=>l(!1),children:s}),r&&(0,m.jsx)(a.Button,{className:"woocommerce-tag__remove",onClick:r(e),label:(0,h.sprintf)( // Translators: %s label. // Translators: %s label. (0,h.__)("Remove %s","woocommerce"),t),"aria-describedby":p,children:(0,m.jsx)(o.A,{icon:k.A,size:20,className:"clear-icon",role:"img"})})]})},P=C;s(1939);const O=e=>(0,m.jsx)(S,{...e}),A=e=>{const{list:t,selected:s,renderItem:r,depth:i=0,onSelect:o,instanceId:c,isSingle:n,search:l,useExpandedPanelId:a}=e,[h]=a;return t?(0,m.jsx)(m.Fragment,{children:t.map((t=>{const u=t.children?.length&&!n?t.children.every((({id:e})=>s.find((t=>t.id===e)))):!!s.find((({id:e})=>e===t.id)),x=t.children?.length&&h===t.id;return(0,m.jsxs)(d.Fragment,{children:[(0,m.jsx)("li",{children:r({item:t,isSelected:u,onSelect:o,isSingle:n,selected:s,search:l,depth:i,useExpandedPanelId:a,controlId:c})}),x?(0,m.jsx)(A,{...e,list:t.children,depth:i+1}):null]},t.id)}))}):null},N=({isLoading:e,isSingle:t,selected:s,messages:r,onChange:i,onRemove:o})=>{if(e||t||!s)return null;const c=s.length;return(0,m.jsxs)("div",{className:"woocommerce-search-list__selected",children:[(0,m.jsxs)("div",{className:"woocommerce-search-list__selected-header",children:[(0,m.jsx)("strong",{children:r.selected(c)}),c>0?(0,m.jsx)(a.Button,{variant:"link",isDestructive:!0,onClick:()=>i([]),"aria-label":r.clear,children:(0,h.__)("Clear all","woocommerce")}):null]}),c>0?(0,m.jsx)("ul",{children:s.map(((e,t)=>(0,m.jsx)("li",{children:(0,m.jsx)(P,{label:e.name,id:e.id,remove:o})},t)))}):null]})},T=({filteredList:e,search:t,onSelect:s,instanceId:r,useExpandedPanelId:i,...c})=>{const{messages:n,renderItem:l,selected:a,isSingle:d}=c,u=l||O;return 0===e.length?(0,m.jsxs)("div",{className:"woocommerce-search-list__list is-not-found",children:[(0,m.jsx)("span",{className:"woocommerce-search-list__not-found-icon",children:(0,m.jsx)(o.A,{icon:p.A,role:"img"})}),(0,m.jsx)("span",{className:"woocommerce-search-list__not-found-text",children:t?(0,h.sprintf)(n.noResults,t):n.noItems})]}):(0,m.jsx)("ul",{className:"woocommerce-search-list__list",children:(0,m.jsx)(A,{useExpandedPanelId:i,list:e,selected:a,renderItem:u,onSelect:s,instanceId:r,isSingle:d,search:t})})},I=e=>{const{className:t="",isCompact:s,isHierarchical:r,isLoading:i,isSingle:o,list:c,messages:n=E,onChange:l,onSearch:u,selected:x,type:p="text",debouncedSpeak:_}=e,[f,b]=(0,d.useState)(""),y=(0,d.useState)(-1),v=(0,w.useInstanceId)(I),S=(0,d.useMemo)((()=>({...E,...n})),[n]),k=(0,d.useMemo)((()=>((e,t,s)=>{if(!t)return s?j(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),i=e.map((e=>!!r.test(e.name)&&e)).filter(Boolean);return s?j(i,e):i})(c,f,r)),[c,f,r]);(0,d.useEffect)((()=>{_&&_(S.updated)}),[_,S]),(0,d.useEffect)((()=>{"function"==typeof u&&u(f)}),[f,u]);const C=(0,d.useCallback)((e=>()=>{o&&l([]);const t=x.findIndex((({id:t})=>t===e));l([...x.slice(0,t),...x.slice(t+1)])}),[o,x,l]),P=(0,d.useCallback)((e=>()=>{Array.isArray(e)?l(e):-1===x.findIndex((({id:t})=>t===e.id))?l(o?[e]:[...x,e]):C(e.id)()}),[o,C,l,x]),O=(0,d.useCallback)((e=>{const[t]=x.filter((t=>!e.find((e=>t.id===e.id))));C(t.id)()}),[C,x]);return(0,m.jsxs)("div",{className:(0,g.A)("woocommerce-search-list",t,{"is-compact":s,"is-loading":i,"is-token":"token"===p}),children:["text"===p&&(0,m.jsx)(N,{...e,onRemove:C,messages:S}),(0,m.jsx)("div",{className:"woocommerce-search-list__search",children:"text"===p?(0,m.jsx)(a.TextControl,{label:S.search,type:"search",value:f,onChange:e=>b(e)}):(0,m.jsx)(a.FormTokenField,{disabled:i,label:S.search,onChange:O,onInputChange:e=>b(e),suggestions:[],__experimentalValidateInput:()=>!1,value:i?[(0,h.__)("Loading…","woocommerce")]:x.map((e=>({...e,value:e.name}))),__experimentalShowHowTo:!1})}),i?(0,m.jsx)("div",{className:"woocommerce-search-list__list",children:(0,m.jsx)(a.Spinner,{})}):(0,m.jsx)(T,{...e,search:f,filteredList:k,messages:S,onSelect:P,instanceId:v,useExpandedPanelId:y})]})},R=((0,a.withSpokenMessages)(I),(0,i.getSetting)("wcBlocksConfig",{pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"})),B=(R.pluginUrl,R.pluginUrl,i.STORE_PAGES.shop,i.STORE_PAGES.checkout,i.STORE_PAGES.checkout,i.STORE_PAGES.privacy,i.STORE_PAGES.privacy,i.STORE_PAGES.terms,i.STORE_PAGES.terms,i.STORE_PAGES.cart,i.STORE_PAGES.cart,i.STORE_PAGES.myaccount?.permalink?i.STORE_PAGES.myaccount.permalink:(0,i.getSetting)("wpLoginUrl","/wp-login.php"),(0,i.getSetting)("localPickupEnabled",!1),(0,i.getSetting)("shippingMethodsExist",!1),(0,i.getSetting)("shippingEnabled",!0),(0,i.getSetting)("countries",{})),F=(0,i.getSetting)("countryData",{}),L={...Object.fromEntries(Object.keys(F).filter((e=>!0===F[e].allowBilling)).map((e=>[e,B[e]||""]))),...Object.fromEntries(Object.keys(F).filter((e=>!0===F[e].allowShipping)).map((e=>[e,B[e]||""])))},M=(Object.fromEntries(Object.keys(L).map((e=>[e,F[e].states||{}]))),Object.fromEntries(Object.keys(L).map((e=>[e,F[e].locale||{}]))),{address:["first_name","last_name","company","address_1","address_2","city","postcode","country","state","phone"],contact:["email"],order:[]}),G=((0,i.getSetting)("addressFieldsLocations",M).address,(0,i.getSetting)("addressFieldsLocations",M).contact,(0,i.getSetting)("addressFieldsLocations",M).order,(0,i.getSetting)("additionalOrderFields",{}),(0,i.getSetting)("additionalContactFields",{}),(0,i.getSetting)("additionalAddressFields",{}),window.wp.url),$=window.wp.apiFetch;var H=s.n($);const D=({selected:e=[],search:t="",queryArgs:s={}})=>{const r=(({selected:e=[],search:t="",queryArgs:s={}})=>{const r=R.productCount>100,i={per_page:r?100:0,catalog_visibility:"any",search:t,orderby:"title",order:"asc"},o=[(0,G.addQueryArgs)("/wc/store/v1/products",{...i,...s})];return r&&e.length&&o.push((0,G.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:e,per_page:0})),o})({selected:e,search:t,queryArgs:s});return Promise.all(r.map((e=>H()({path:e})))).then((e=>{const t=((e,t)=>{const s=new Map;return e.filter((e=>{const r=t(e);return!s.has(r)&&(s.set(r,e),!0)}))})(e.flat(),(e=>e.id));return t.map((e=>({...e,parent:0})))})).catch((e=>{throw e}))};var V=s(4347);const J=window.wp.escapeHtml,U=({message:e,type:t})=>e?"general"===t?(0,m.jsxs)("span",{children:[(0,h.__)("The following error was returned","woocommerce"),(0,m.jsx)("br",{}),(0,m.jsx)("code",{children:(0,J.escapeHTML)(e)})]}):"api"===t?(0,m.jsxs)("span",{children:[(0,h.__)("The following error was returned from the API","woocommerce"),(0,m.jsx)("br",{}),(0,m.jsx)("code",{children:(0,J.escapeHTML)(e)})]}):e:(0,h.__)("An error has prevented the block from being updated.","woocommerce"),q=({error:e})=>(0,m.jsx)("div",{className:"wc-block-error-message",children:U(e)}),Q=(K=({error:e,onChange:t,onSearch:s,selected:r=[],products:i=[],isLoading:o=!0,isCompact:c=!1})=>{const n={clear:(0,h.__)("Clear all products","woocommerce"),list:(0,h.__)("Products","woocommerce"),noItems:(0,h.__)("Your store doesn't have any products.","woocommerce"),search:(0,h.__)("Search for products to display","woocommerce"),selected:e=>(0,h.sprintf)(/* translators: %d is the number of selected products. */ /* translators: %d is the number of selected products. */ (0,h._n)("%d product selected","%d products selected",e,"woocommerce"),e),updated:(0,h.__)("Product search results updated.","woocommerce")};return e?(0,m.jsx)(q,{error:e}):(0,m.jsx)(I,{className:"woocommerce-products",list:i.map((e=>{const t=e.sku?" ("+e.sku+")":"";return{...e,name:`${(0,b.decodeEntities)(e.name)}${t}`}})),isCompact:c,isLoading:o,selected:i.filter((({id:e})=>r.includes(e))),onSearch:s,onChange:t,messages:n})},({selected:e,...t})=>{const[s,r]=(0,d.useState)(!0),[i,o]=(0,d.useState)(null),[c,n]=(0,d.useState)([]),l=R.productCount>100,a=async e=>{const t=await(async e=>{if(!("json"in e))return{code:e.code||"",message:e.message,type:e.type||"general"};try{const t=await e.json();return{code:t.code||"",message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}})(e);o(t),r(!1)},h=(0,d.useRef)(e);(0,d.useEffect)((()=>{D({selected:h.current}).then((e=>{n(e),r(!1)})).catch(a)}),[h]);const u=(0,V.YQ)((t=>{D({selected:e,search:t}).then((e=>{n(e),r(!1)})).catch(a)}),400),x=(0,d.useCallback)((e=>{r(!0),u(e)}),[r,u]);return(0,m.jsx)(K,{...t,selected:e,error:i,products:c,isLoading:s,onSearch:l?x:null})}),W=e=>{const{attributes:t,setAttributes:s}=e,{columns:r,contentVisibility:o,orderby:c,alignButtons:n}=t;return(0,m.jsxs)(l.InspectorControls,{children:[(0,m.jsxs)(a.PanelBody,{title:(0,h.__)("Layout","woocommerce"),initialOpen:!0,children:[(0,m.jsx)(a.RangeControl,{label:(0,h.__)("Columns","woocommerce"),value:r,onChange:e=>s({columns:e}),min:(0,i.getSetting)("minColumns",1),max:(0,i.getSetting)("maxColumns",6)}),(0,m.jsx)(a.ToggleControl,{label:(0,h.__)("Align Buttons","woocommerce"),help:n?(0,h.__)("Buttons are aligned vertically.","woocommerce"):(0,h.__)("Buttons follow content.","woocommerce"),checked:n,onChange:()=>s({alignButtons:!n})})]}),(0,m.jsx)(a.PanelBody,{title:(0,h.__)("Content","woocommerce"),initialOpen:!0,children:(0,m.jsx)(u,{settings:o,onChange:e=>s({contentVisibility:e})})}),(0,m.jsx)(a.PanelBody,{title:(0,h.__)("Order By","woocommerce"),initialOpen:!1,children:(0,m.jsx)(x,{setAttributes:s,value:c})}),(0,m.jsx)(a.PanelBody,{title:(0,h.__)("Products","woocommerce"),initialOpen:!1,children:(0,m.jsx)(Q,{selected:t.products,onChange:(e=[])=>{const t=e.map((({id:e})=>e));s({products:t})},isCompact:!0})})]},"inspector")},Y=e=>{const{attributes:t,setAttributes:s,debouncedSpeak:r,isEditing:i,setIsEditing:n}=e;return(0,m.jsxs)(a.Placeholder,{icon:(0,m.jsx)(o.A,{icon:c.A}),label:(0,h.__)("Hand-picked Products","woocommerce"),className:"wc-block-products-grid wc-block-handpicked-products",children:[(0,h.__)("Display a selection of hand-picked products in a grid.","woocommerce"),(0,m.jsxs)("div",{className:"wc-block-handpicked-products__selection",children:[(0,m.jsx)(Q,{selected:t.products,onChange:(e=[])=>{const t=e.map((({id:e})=>e));s({products:t})}}),(0,m.jsx)(a.Button,{variant:"primary",onClick:()=>{n(!i),r((0,h.__)("Now displaying a preview of the Hand-picked Products block.","woocommerce"))},children:(0,h.__)("Done","woocommerce")})]})]})},z=window.wp.serverSideRender;var K,X=s.n(z);const Z=(0,m.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"},children:[(0,m.jsx)("title",{children:"Grid Block Preview"}),(0,m.jsx)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),(0,m.jsx)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),(0,m.jsx)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),(0,m.jsx)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),(0,m.jsx)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),(0,m.jsx)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),(0,m.jsx)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),(0,m.jsx)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),(0,m.jsx)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),(0,m.jsx)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),(0,m.jsx)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),(0,m.jsx)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"})]}),ee=e=>{const{attributes:t,name:s}=e;return t.isPreview?Z:(0,m.jsx)(X(),{block:s,attributes:t})},te=(0,a.withSpokenMessages)((e=>{const t=(0,l.useBlockProps)(),{attributes:{products:s}}=e,[r,i]=(0,d.useState)(!s.length);return(0,m.jsxs)("div",{...t,children:[(0,m.jsx)(l.BlockControls,{children:(0,m.jsx)(a.ToolbarGroup,{controls:[{icon:"edit",title:(0,h.__)("Edit selected products","woocommerce"),onClick:()=>i(!r),isActive:r}]})}),(0,m.jsx)(W,{...e}),r?(0,m.jsx)(Y,{isEditing:r,setIsEditing:i,...e}):(0,m.jsx)(a.Disabled,{children:(0,m.jsx)(ee,{...e})})]})}));(0,r.registerBlockType)(n,{icon:{src:(0,m.jsx)(o.A,{icon:c.A,className:"wc-block-editor-components-block-icon"})},attributes:{...n.attributes,columns:{type:"number",default:(0,i.getSetting)("defaultColumns",3)}},edit:te,save:()=>null})},9202:()=>{},1939:()=>{},5022:()=>{},1609:e=>{"use strict";e.exports=window.React},790:e=>{"use strict";e.exports=window.ReactJSXRuntime},9491:e=>{"use strict";e.exports=window.wp.compose},6087:e=>{"use strict";e.exports=window.wp.element},7723:e=>{"use strict";e.exports=window.wp.i18n},5573:e=>{"use strict";e.exports=window.wp.primitives}},i={};function o(e){var t=i[e];if(void 0!==t)return t.exports;var s=i[e]={exports:{}};return r[e].call(s.exports,s,s.exports,o),s.exports}o.m=r,e=[],o.O=(t,s,r,i)=>{if(!s){var c=1/0;for(d=0;d<e.length;d++){for(var[s,r,i]=e[d],n=!0,l=0;l<s.length;l++)(!1&i||c>=i)&&Object.keys(o.O).every((e=>o.O[e](s[l])))?s.splice(l--,1):(n=!1,i<c&&(c=i));if(n){e.splice(d--,1);var a=r();void 0!==a&&(t=a)}}return t}i=i||0;for(var d=e.length;d>0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[s,r,i]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},s=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var i=Object.create(null);o.r(i);var c={};t=t||[null,s({}),s([]),s(s)];for(var n=2&r&&e;"object"==typeof n&&!~t.indexOf(n);n=s(n))Object.getOwnPropertyNames(n).forEach((t=>c[t]=()=>e[t]));return c.default=()=>e,o.d(i,c),i},o.d=(e,t)=>{for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.j=6461,(()=>{var e={6461:0};o.O.j=t=>0===e[t];var t=(t,s)=>{var r,i,[c,n,l]=s,a=0;if(c.some((t=>0!==e[t]))){for(r in n)o.o(n,r)&&(o.m[r]=n[r]);if(l)var d=l(o)}for(t&&t(s);a<c.length;a++)i=c[a],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return o.O(d)},s=globalThis.webpackChunkwebpackWcBlocksMainJsonp=globalThis.webpackChunkwebpackWcBlocksMainJsonp||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))})();var c=o.O(void 0,[94],(()=>o(4073)));c=o.O(c),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["handpicked-products"]=c})();