????JFIF??x?x????'
Server IP : 104.21.80.1 / Your IP : 216.73.216.145 Web Server : LiteSpeed System : Linux premium151.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 User : tempvsty ( 647) PHP Version : 8.0.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/tempvsty/buyeaa.com/wp-content/plugins/woocommerce/assets/client/blocks/ |
Upload File : |
(()=>{var e,t,o,r={5896:(e,t,o)=>{"use strict";const r=window.wp.blocks;var s=o(4530),c=o(8042);o(9312);const i=JSON.parse('{"name":"woocommerce/product-category","title":"Products by Category","category":"woocommerce","keywords":["WooCommerce"],"description":"Display a grid of products from your selected categories.","supports":{"interactivity":{"clientNavigation":false},"align":["wide","full"],"html":false,"inserter":false},"attributes":{"columns":{"type":"number","default":3},"rows":{"type":"number","default":3},"alignButtons":{"type":"boolean","default":false},"contentVisibility":{"type":"object","default":{"image":true,"title":true,"price":true,"rating":true,"button":true},"properties":{"image":{"type":"boolean","default":true},"title":{"type":"boolean","default":true},"price":{"type":"boolean","default":true},"rating":{"type":"boolean","default":true},"button":{"type":"boolean","default":true}}},"categories":{"type":"array","default":[]},"catOperator":{"type":"string","default":"any"},"isPreview":{"type":"boolean","default":false},"stockStatus":{"type":"array"},"editMode":{"type":"boolean","default":true},"orderby":{"type":"string","enum":["date","popularity","price_asc","price_desc","rating","title","menu_order"],"default":"date"}},"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}'),l=window.wc.wcSettings,n={columns:{type:"number",default:(0,l.getSetting)("defaultColumns",3)},rows:{type:"number",default:(0,l.getSetting)("defaultRows",3)},alignButtons:{type:"boolean",default:!1},categories:{type:"array",default:[]},catOperator:{type:"string",default:"any"},contentVisibility:{type:"object",default:{image:!0,title:!0,price:!0,rating:!0,button:!0}},isPreview:{type:"boolean",default:!1},stockStatus:{type:"array",default:Object.keys((0,l.getSetting)("stockStatusOptions",[]))}},a=window.wp.blockEditor;var d=o(6087);const m=window.wp.components;var h=o(7723);const u=window.wp.serverSideRender;var g=o.n(u),x=o(790);const p=(0,x.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"},children:[(0,x.jsx)("title",{children:"Grid Block Preview"}),(0,x.jsx)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),(0,x.jsx)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),(0,x.jsx)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),(0,x.jsx)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),(0,x.jsx)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),(0,x.jsx)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),(0,x.jsx)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),(0,x.jsx)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),(0,x.jsx)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),(0,x.jsx)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),(0,x.jsx)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),(0,x.jsx)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,x.jsx)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"})]}),w=()=>(0,x.jsx)(m.Placeholder,{icon:(0,x.jsx)(s.A,{icon:c.A}),label:(0,h.__)("Products by Category","woocommerce"),className:"wc-block-products-grid wc-block-products-category",children:(0,h.__)("No products were found that matched your selection.","woocommerce")}),b=e=>{const{name:t,attributes:o}=e,r=o.categories.length;return o.isPreview?p:r?(0,x.jsx)(g(),{block:t,attributes:o,EmptyResponsePlaceholder:w}):(0,x.jsx)(x.Fragment,{children:(0,h.__)("Select at least one category to display its products.","woocommerce")})};var _=o(4921);function f(e,t,o){const r=new Set(t.map((e=>e[o])));return e.filter((e=>!r.has(e[o])))}const j=window.wp.htmlEntities,y={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")},E=(e,t=e)=>{const o=e.reduce(((e,t)=>{const o=t.parent||0;return e[o]||(e[o]=[]),e[o].push(t),e}),{}),r=t.reduce(((e,t)=>(e[String(t.id)]=t,e)),{});const s=["0"],c=(e={})=>e.parent?[...c(r[e.parent]),e.name]:e.name?[e.name]:[],i=e=>e.map((e=>{const t=o[e.id];return s.push(""+e.id),{...e,breadcrumbs:c(r[e.parent]),children:t&&t.length?i(t):[]}})),l=i(o[0]||[]);return Object.entries(o).forEach((([e,t])=>{s.includes(e)||l.push(...i(t||[]))})),l},v=(e,t)=>{if(!t)return e;const o=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(o).map(((e,t)=>o.test(e)?(0,x.jsx)("strong",{children:e},t):(0,x.jsx)(d.Fragment,{children:e},t)))},C=({label:e})=>(0,x.jsx)("span",{className:"woocommerce-search-list__item-count",children:e}),k=e=>{const{item:t,search:o}=e,r=t.breadcrumbs&&t.breadcrumbs.length;return(0,x.jsxs)("span",{className:"woocommerce-search-list__item-label",children:[r?(0,x.jsx)("span",{className:"woocommerce-search-list__item-prefix",children:(s=t.breadcrumbs,1===s.length?s.slice(0,1).toString():2===s.length?s.slice(0,1).toString()+" › "+s.slice(-1).toString():s.slice(0,1).toString()+" … "+s.slice(-1).toString())}):null,(0,x.jsx)("span",{className:"woocommerce-search-list__item-name",children:v((0,j.decodeEntities)(t.name),o)})]});var s},S=({countLabel:e,className:t,depth:o=0,controlId:r="",item:s,isSelected:c,isSingle:i,onSelect:l,search:n="",selected:a,useExpandedPanelId:h,...u})=>{const[g,p]=h,w=null!=e&&void 0!==s.count&&null!==s.count,b=!!s.breadcrumbs?.length,y=!!s.children?.length,E=g===s.id,S=(0,_.A)(["woocommerce-search-list__item",`depth-${o}`,t],{"has-breadcrumbs":b,"has-children":y,"has-count":w,"is-expanded":E,"is-radio-button":i});(0,d.useEffect)((()=>{y&&c&&p(s.id)}),[s,y,c,p]);const N=u.name||`search-list-item-${r}`,O=`${N}-${s.id}`,P=(0,d.useCallback)((()=>{p(E?-1:Number(s.id))}),[E,s.id,p]);return y?(0,x.jsx)("div",{className:S,onClick:P,onKeyDown:e=>"Enter"===e.key||" "===e.key?P():null,role:"treeitem",tabIndex:0,children:i?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("input",{type:"radio",id:O,name:N,value:s.value,onChange:l(s),onClick:e=>e.stopPropagation(),checked:c,className:"woocommerce-search-list__item-input",...u}),(0,x.jsx)(k,{item:s,search:n}),w?(0,x.jsx)(C,{label:e||s.count}):null]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(m.CheckboxControl,{className:"woocommerce-search-list__item-input",checked:c,...!c&&s.children.some((e=>a.find((t=>t.id===e.id))))?{indeterminate:!0}:{},label:v((0,j.decodeEntities)(s.name),n),onChange:()=>{c?l(f(a,s.children,"id"))():l(function(e,t){const o=f(t,e,"id");return[...e,...o]}(a,s.children))()},onClick:e=>e.stopPropagation()}),w?(0,x.jsx)(C,{label:e||s.count}):null]})}):(0,x.jsxs)("label",{htmlFor:O,className:S,children:[i?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("input",{...u,type:"radio",id:O,name:N,value:s.value,onChange:l(s),checked:c,className:"woocommerce-search-list__item-input"}),(0,x.jsx)(k,{item:s,search:n})]}):(0,x.jsx)(m.CheckboxControl,{...u,id:O,name:N,className:"woocommerce-search-list__item-input",value:(0,j.decodeEntities)(s.value),label:v((0,j.decodeEntities)(s.name),n),onChange:l(s),checked:c}),w?(0,x.jsx)(C,{label:e||s.count}):null]})},N=S;var O=o(2624),P=o(9491),A=o(3028);o(5022);const I=({id:e,label:t,popoverContents:o,remove:r,screenReaderLabel:c,className:i=""})=>{const[l,n]=(0,d.useState)(!1),a=(0,P.useInstanceId)(I);if(c=c||t,!t)return null;t=(0,j.decodeEntities)(t);const u=(0,_.A)("woocommerce-tag",i,{"has-remove":!!r}),g=`woocommerce-tag__label-${a}`,p=(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("span",{className:"screen-reader-text",children:c}),(0,x.jsx)("span",{"aria-hidden":"true",children:t})]});return(0,x.jsxs)("span",{className:u,children:[o?(0,x.jsx)(m.Button,{className:"woocommerce-tag__text",id:g,onClick:()=>n(!0),children:p}):(0,x.jsx)("span",{className:"woocommerce-tag__text",id:g,children:p}),o&&l&&(0,x.jsx)(m.Popover,{onClose:()=>n(!1),children:o}),r&&(0,x.jsx)(m.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":g,children:(0,x.jsx)(s.A,{icon:A.A,size:20,className:"clear-icon",role:"img"})})]})},B=I;o(1939);const R=e=>(0,x.jsx)(N,{...e}),T=e=>{const{list:t,selected:o,renderItem:r,depth:s=0,onSelect:c,instanceId:i,isSingle:l,search:n,useExpandedPanelId:a}=e,[m]=a;return t?(0,x.jsx)(x.Fragment,{children:t.map((t=>{const h=t.children?.length&&!l?t.children.every((({id:e})=>o.find((t=>t.id===e)))):!!o.find((({id:e})=>e===t.id)),u=t.children?.length&&m===t.id;return(0,x.jsxs)(d.Fragment,{children:[(0,x.jsx)("li",{children:r({item:t,isSelected:h,onSelect:c,isSingle:l,selected:o,search:n,depth:s,useExpandedPanelId:a,controlId:i})}),u?(0,x.jsx)(T,{...e,list:t.children,depth:s+1}):null]},t.id)}))}):null},$=({isLoading:e,isSingle:t,selected:o,messages:r,onChange:s,onRemove:c})=>{if(e||t||!o)return null;const i=o.length;return(0,x.jsxs)("div",{className:"woocommerce-search-list__selected",children:[(0,x.jsxs)("div",{className:"woocommerce-search-list__selected-header",children:[(0,x.jsx)("strong",{children:r.selected(i)}),i>0?(0,x.jsx)(m.Button,{variant:"link",isDestructive:!0,onClick:()=>s([]),"aria-label":r.clear,children:(0,h.__)("Clear all","woocommerce")}):null]}),i>0?(0,x.jsx)("ul",{children:o.map(((e,t)=>(0,x.jsx)("li",{children:(0,x.jsx)(B,{label:e.name,id:e.id,remove:c})},t)))}):null]})},M=({filteredList:e,search:t,onSelect:o,instanceId:r,useExpandedPanelId:c,...i})=>{const{messages:l,renderItem:n,selected:a,isSingle:d}=i,m=n||R;return 0===e.length?(0,x.jsxs)("div",{className:"woocommerce-search-list__list is-not-found",children:[(0,x.jsx)("span",{className:"woocommerce-search-list__not-found-icon",children:(0,x.jsx)(s.A,{icon:O.A,role:"img"})}),(0,x.jsx)("span",{className:"woocommerce-search-list__not-found-text",children:t?(0,h.sprintf)(l.noResults,t):l.noItems})]}):(0,x.jsx)("ul",{className:"woocommerce-search-list__list",children:(0,x.jsx)(T,{useExpandedPanelId:c,list:e,selected:a,renderItem:m,onSelect:o,instanceId:r,isSingle:d,search:t})})},F=e=>{const{className:t="",isCompact:o,isHierarchical:r,isLoading:s,isSingle:c,list:i,messages:l=y,onChange:n,onSearch:a,selected:u,type:g="text",debouncedSpeak:p}=e,[w,b]=(0,d.useState)(""),f=(0,d.useState)(-1),j=(0,P.useInstanceId)(F),v=(0,d.useMemo)((()=>({...y,...l})),[l]),C=(0,d.useMemo)((()=>((e,t,o)=>{if(!t)return o?E(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),s=e.map((e=>!!r.test(e.name)&&e)).filter(Boolean);return o?E(s,e):s})(i,w,r)),[i,w,r]);(0,d.useEffect)((()=>{p&&p(v.updated)}),[p,v]),(0,d.useEffect)((()=>{"function"==typeof a&&a(w)}),[w,a]);const k=(0,d.useCallback)((e=>()=>{c&&n([]);const t=u.findIndex((({id:t})=>t===e));n([...u.slice(0,t),...u.slice(t+1)])}),[c,u,n]),S=(0,d.useCallback)((e=>()=>{Array.isArray(e)?n(e):-1===u.findIndex((({id:t})=>t===e.id))?n(c?[e]:[...u,e]):k(e.id)()}),[c,k,n,u]),N=(0,d.useCallback)((e=>{const[t]=u.filter((t=>!e.find((e=>t.id===e.id))));k(t.id)()}),[k,u]);return(0,x.jsxs)("div",{className:(0,_.A)("woocommerce-search-list",t,{"is-compact":o,"is-loading":s,"is-token":"token"===g}),children:["text"===g&&(0,x.jsx)($,{...e,onRemove:k,messages:v}),(0,x.jsx)("div",{className:"woocommerce-search-list__search",children:"text"===g?(0,x.jsx)(m.TextControl,{label:v.search,type:"search",value:w,onChange:e=>b(e)}):(0,x.jsx)(m.FormTokenField,{disabled:s,label:v.search,onChange:N,onInputChange:e=>b(e),suggestions:[],__experimentalValidateInput:()=>!1,value:s?[(0,h.__)("Loading…","woocommerce")]:u.map((e=>({...e,value:e.name}))),__experimentalShowHowTo:!1})}),s?(0,x.jsx)("div",{className:"woocommerce-search-list__list",children:(0,x.jsx)(m.Spinner,{})}):(0,x.jsx)(M,{...e,search:w,filteredList:C,messages:v,onSelect:S,instanceId:j,useExpandedPanelId:f})]})},L=((0,m.withSpokenMessages)(F),window.wp.url),D=window.wp.apiFetch;var H=o.n(D);const V=window.wp.escapeHtml,J=({message:e,type:t})=>e?"general"===t?(0,x.jsxs)("span",{children:[(0,h.__)("The following error was returned","woocommerce"),(0,x.jsx)("br",{}),(0,x.jsx)("code",{children:(0,V.escapeHTML)(e)})]}):"api"===t?(0,x.jsxs)("span",{children:[(0,h.__)("The following error was returned from the API","woocommerce"),(0,x.jsx)("br",{}),(0,x.jsx)("code",{children:(0,V.escapeHTML)(e)})]}):e:(0,h.__)("An error has prevented the block from being updated.","woocommerce"),W=({error:e})=>(0,x.jsx)("div",{className:"wc-block-error-message",children:J(e)}),G=e=>{const{id:t,name:o,parent:r,count:s}=e;return{id:t,name:o,parent:r,count:s,breadcrumbs:[],children:[],details:e,value:e.slug}};o(6982);const z=(re=({categories:e=[],error:t=null,isLoading:o=!1,onChange:r,onOperatorChange:s,operator:c="any",selected:i,isCompact:l=!1,isSingle:n=!1,showReviewCount:a})=>{const d={clear:(0,h.__)("Clear all product categories","woocommerce"),list:(0,h.__)("Product Categories","woocommerce"),noItems:(0,h.__)("Your store doesn't have any product categories.","woocommerce"),search:(0,h.__)("Search for product categories","woocommerce"),selected:e=>(0,h.sprintf)(/* translators: %d is the count of selected categories. */ /* translators: %d is the count of selected categories. */ (0,h._n)("%d category selected","%d categories selected",e,"woocommerce"),e),updated:(0,h.__)("Category search results updated.","woocommerce")};if(t)return(0,x.jsx)(W,{error:t});const u=e.map(G);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(F,{className:"woocommerce-product-categories",list:u,isLoading:o,selected:u.filter((({id:e})=>i.includes(Number(e)))),onChange:r,renderItem:e=>{const{item:t,search:o,depth:r=0}=e,s=t.breadcrumbs.length?`${t.breadcrumbs.join(", ")}, ${t.name}`:t.name,c=a?(0,h.sprintf)(/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */ /* translators: %1$s is the item name, %2$d is the count of reviews for the item. */ (0,h._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.details?.review_count||0,"woocommerce"),s,t.details?.review_count||0):(0,h.sprintf)(/* translators: %1$s is the item name, %2$d is the count of products for the item. */ /* translators: %1$s is the item name, %2$d is the count of products for the item. */ (0,h._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.details?.count||0,"woocommerce"),s,t.details?.count||0),i=a?(0,h.sprintf)(/* translators: %d is the count of reviews. */ /* translators: %d is the count of reviews. */ (0,h._n)("%d review","%d reviews",t.details?.review_count||0,"woocommerce"),t.details?.review_count||0):(0,h.sprintf)(/* translators: %d is the count of products. */ /* translators: %d is the count of products. */ (0,h._n)("%d product","%d products",t.details?.count||0,"woocommerce"),t.details?.count||0);return(0,x.jsx)(S,{className:(0,_.A)("woocommerce-product-categories__item","has-count",{"is-searching":o.length>0,"is-skip-level":0===r&&0!==t.parent}),...e,countLabel:i,"aria-label":c})},messages:d,isCompact:l,isHierarchical:!0,isSingle:n}),!!s&&(0,x.jsx)("div",{hidden:i.length<2,children:(0,x.jsx)(m.SelectControl,{className:"woocommerce-product-categories__operator",label:(0,h.__)("Display products matching","woocommerce"),help:(0,h.__)("Pick at least two categories to use this setting.","woocommerce"),value:c,onChange:s,options:[{label:(0,h.__)("Any selected categories","woocommerce"),value:"any"},{label:(0,h.__)("All selected categories","woocommerce"),value:"all"}]})})]})},({selected:e,...t})=>{const[o,r]=(0,d.useState)(!0),[s,c]=(0,d.useState)(null),[i,l]=(0,d.useState)([]),n=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);c(t),r(!1)},a=(0,d.useRef)(e);return(0,d.useEffect)((()=>{var e;(e={selected:a.current},H()({path:(0,L.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})})).then((e=>{l(e),r(!1)})).catch(n)}),[a]),(0,x.jsx)(re,{...t,selected:e,error:s,categories:i,isLoading:o})}),K=(e,t,o)=>o?Math.min(e,t)===e?t:Math.max(e,o)===e?o:e:Math.max(e,t)===t?e:t,Q=({columns:e,rows:t,setAttributes:o,alignButtons:r,minColumns:s=1,maxColumns:c=6,minRows:i=1,maxRows:l=6})=>(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(m.RangeControl,{label:(0,h.__)("Columns","woocommerce"),value:e,onChange:e=>{const t=K(e,s,c);o({columns:Number.isNaN(t)?"":t})},min:s,max:c}),(0,x.jsx)(m.RangeControl,{label:(0,h.__)("Rows","woocommerce"),value:t,onChange:e=>{const t=K(e,i,l);o({rows:Number.isNaN(t)?"":t})},min:i,max:l}),(0,x.jsx)(m.ToggleControl,{label:(0,h.__)("Align the last block to the bottom","woocommerce"),help:r?(0,h.__)("Align the last block to the bottom.","woocommerce"):(0,h.__)("The last inner block will follow other content.","woocommerce"),checked:r,onChange:()=>o({alignButtons:!r})})]}),X=({onChange:e,settings:t})=>{const{image:o,button:r,price:s,rating:c,title:i}=t,l=!1!==o;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(m.ToggleControl,{label:(0,h.__)("Product image","woocommerce"),checked:l,onChange:()=>e({...t,image:!l})}),(0,x.jsx)(m.ToggleControl,{label:(0,h.__)("Product title","woocommerce"),checked:i,onChange:()=>e({...t,title:!i})}),(0,x.jsx)(m.ToggleControl,{label:(0,h.__)("Product price","woocommerce"),checked:s,onChange:()=>e({...t,price:!s})}),(0,x.jsx)(m.ToggleControl,{label:(0,h.__)("Product rating","woocommerce"),checked:c,onChange:()=>e({...t,rating:!c})}),(0,x.jsx)(m.ToggleControl,{label:(0,h.__)("Add to Cart button","woocommerce"),checked:r,onChange:()=>e({...t,button:!r})})]})},Y=({value:e,setAttributes:t})=>(0,x.jsx)(m.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})}),q=(0,l.getSetting)("hideOutOfStockItems",!1),U=(0,l.getSetting)("stockStatusOptions",{}),Z=({value:e,setAttributes:t})=>{const{outofstock:o,...r}=U,s=q?r:U,c=Object.entries(s).map((([e,t])=>({value:e,label:t}))).filter((e=>!!e.label)),i=Object.keys(s).filter((e=>!!e)),[l,n]=(0,d.useState)(e||i);(0,d.useEffect)((()=>{t({stockStatus:["",...l]})}),[l,t]);const a=(0,d.useCallback)((e=>{const t=l.includes(e),o=l.filter((t=>t!==e));t||(o.push(e),o.sort()),n(o)}),[l]);return(0,x.jsx)(x.Fragment,{children:c.map((e=>{const t=l.includes(e.value)?/* translators: %s stock status. */ /* translators: %s stock status. */(0,h.__)('Stock status "%s" visible.',"woocommerce"):/* translators: %s stock status. */ /* translators: %s stock status. */(0,h.__)('Stock status "%s" hidden.',"woocommerce");return(0,x.jsx)(m.ToggleControl,{label:e.label,help:(0,h.sprintf)(t,e.label),checked:l.includes(e.value),onChange:()=>a(e.value)},e.value)}))})},ee=e=>{const{isEditing:t,attributes:o,setAttributes:r,setChangedAttributes:s}=e,{columns:c,catOperator:i,contentVisibility:n,orderby:d,rows:u,alignButtons:g,stockStatus:p}=o;return(0,x.jsxs)(a.InspectorControls,{children:[(0,x.jsx)(m.PanelBody,{title:(0,h.__)("Product Category","woocommerce"),initialOpen:!o.categories.length&&!t,children:(0,x.jsx)(z,{selected:o.categories,onChange:(e=[])=>{const t={categories:e.map((({id:e})=>e))};r(t),s(t)},operator:i,onOperatorChange:(e="any")=>{const t={catOperator:e};r(t),s(t)},isCompact:!0})}),(0,x.jsx)(m.PanelBody,{title:(0,h.__)("Layout","woocommerce"),initialOpen:!0,children:(0,x.jsx)(Q,{columns:c,rows:u,alignButtons:g,setAttributes:r,minColumns:(0,l.getSetting)("minColumns",1),maxColumns:(0,l.getSetting)("maxColumns",6),minRows:(0,l.getSetting)("minRows",1),maxRows:(0,l.getSetting)("maxRows",6)})}),(0,x.jsx)(m.PanelBody,{title:(0,h.__)("Content","woocommerce"),initialOpen:!0,children:(0,x.jsx)(X,{settings:n,onChange:e=>r({contentVisibility:e})})}),(0,x.jsx)(m.PanelBody,{title:(0,h.__)("Order By","woocommerce"),initialOpen:!1,children:(0,x.jsx)(Y,{setAttributes:r,value:d})}),(0,x.jsx)(m.PanelBody,{title:(0,h.__)("Filter by stock status","woocommerce"),initialOpen:!1,children:(0,x.jsx)(Z,{setAttributes:r,value:p})})]},"inspector")},te=e=>{const{debouncedSpeak:t,setIsEditing:o,changedAttributes:r,setChangedAttributes:i,attributes:l}=e,n={...l,...r},a=()=>{o(!1),i({})};return(0,x.jsxs)(m.Placeholder,{icon:(0,x.jsx)(s.A,{icon:c.A}),label:(0,h.__)("Products by Category","woocommerce"),className:"wc-block-products-grid wc-block-products-category",children:[(0,h.__)("Display a grid of products from your selected categories.","woocommerce"),(0,x.jsxs)("div",{className:"wc-block-products-category__selection",children:[(0,x.jsx)(z,{selected:n.categories,onChange:(e=[])=>{const t=e.map((({id:e})=>e));i({categories:t})},operator:n.catOperator,onOperatorChange:(e="any")=>i({catOperator:e})}),(0,x.jsx)(m.Button,{variant:"primary",onClick:()=>{(()=>{const{setAttributes:t}=e;t(r),a()})(),t((0,h.__)("Now displaying a preview of the reviews for the products in the selected categories.","woocommerce"))},children:(0,h.__)("Done","woocommerce")}),(0,x.jsx)(m.Button,{className:"wc-block-products-category__cancel-button",variant:"tertiary",onClick:()=>{a(),t((0,h.__)("Now displaying a preview of the reviews for the products in the selected categories.","woocommerce"))},children:(0,h.__)("Cancel","woocommerce")})]})]})},oe=(0,m.withSpokenMessages)((e=>{const t=(0,a.useBlockProps)(),{attributes:o}=e,[r,s]=(0,d.useState)(!o.categories.length),[c,i]=(0,d.useState)({});return(0,x.jsxs)("div",{...t,children:[(0,x.jsx)(a.BlockControls,{children:(0,x.jsx)(m.ToolbarGroup,{controls:[{icon:"edit",title:(0,h.__)("Edit selected categories","woocommerce"),onClick:()=>s(!r),isActive:r}]})}),(0,x.jsx)(ee,{isEditing:r,setChangedAttributes:i,...e}),r?(0,x.jsx)(te,{isEditing:r,setIsEditing:s,changedAttributes:c,setChangedAttributes:i,...e}):(0,x.jsx)(m.Disabled,{children:(0,x.jsx)(b,{...e})})]})}));var re;(0,r.registerBlockType)(i,{icon:{src:(0,x.jsx)(s.A,{icon:c.A,className:"wc-block-editor-components-block-icon"})},attributes:{...i.attributes,...n},transforms:{from:[{type:"block",blocks:["woocommerce/product-best-sellers","woocommerce/product-category","woocommerce/product-new","woocommerce/product-on-sale","woocommerce/product-top-rated"].filter((e=>"woocommerce/product-category"!==e)),transform:e=>(0,r.createBlock)("woocommerce/product-category",{...e,editMode:!1})}]},edit:oe,save:()=>null})},9312:()=>{},6982:()=>{},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}},s={};function c(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return r[e].call(o.exports,o,o.exports,c),o.exports}c.m=r,e=[],c.O=(t,o,r,s)=>{if(!o){var i=1/0;for(d=0;d<e.length;d++){for(var[o,r,s]=e[d],l=!0,n=0;n<o.length;n++)(!1&s||i>=s)&&Object.keys(c.O).every((e=>c.O[e](o[n])))?o.splice(n--,1):(l=!1,s<i&&(i=s));if(l){e.splice(d--,1);var a=r();void 0!==a&&(t=a)}}return t}s=s||0;for(var d=e.length;d>0&&e[d-1][2]>s;d--)e[d]=e[d-1];e[d]=[o,r,s]},c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},o=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.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 s=Object.create(null);c.r(s);var i={};t=t||[null,o({}),o([]),o(o)];for(var l=2&r&&e;"object"==typeof l&&!~t.indexOf(l);l=o(l))Object.getOwnPropertyNames(l).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,c.d(s,i),s},c.d=(e,t)=>{for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.j=4101,(()=>{var e={4101:0};c.O.j=t=>0===e[t];var t=(t,o)=>{var r,s,[i,l,n]=o,a=0;if(i.some((t=>0!==e[t]))){for(r in l)c.o(l,r)&&(c.m[r]=l[r]);if(n)var d=n(c)}for(t&&t(o);a<i.length;a++)s=i[a],c.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return c.O(d)},o=globalThis.webpackChunkwebpackWcBlocksMainJsonp=globalThis.webpackChunkwebpackWcBlocksMainJsonp||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var i=c.O(void 0,[94],(()=>c(5896)));i=c.O(i),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["product-category"]=i})();