(()=>{"use strict";const e=window.wp.blocks,a=window.wp.blockEditor,l=window.wp.components,t=window.wp.i18n,s=JSON.parse('{"UU":"gateway/facet-select"}'),i=window.ReactJSXRuntime,c=[{label:(0,t.__)("All","gateway"),value:""},{label:(0,t.__)("Active","gateway"),value:"active"},{label:(0,t.__)("Inactive","gateway"),value:"inactive"},{label:(0,t.__)("Pending","gateway"),value:"pending"},{label:(0,t.__)("Draft","gateway"),value:"draft"},{label:(0,t.__)("Published","gateway"),value:"published"}];(0,e.registerBlockType)(s.UU,{edit:({attributes:e,setAttributes:s})=>{const{label:n,fieldKey:o}=e,r=(0,a.useBlockProps)({className:"gateway-facet gateway-facet--select"});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.InspectorControls,{children:(0,i.jsxs)(l.PanelBody,{title:(0,t.__)("Facet Select Settings","gateway"),children:[(0,i.jsx)(l.TextControl,{label:(0,t.__)("Label","gateway"),value:n,onChange:e=>s({label:e})}),(0,i.jsx)(l.TextControl,{label:(0,t.__)("Field Key","gateway"),value:o,onChange:e=>s({fieldKey:e}),help:(0,t.__)('The record property to filter on (e.g. "status", "category").',"gateway")})]})}),(0,i.jsxs)("div",{...r,children:[(0,i.jsx)("label",{className:"gateway-facet__label",children:n}),(0,i.jsx)("select",{className:"gateway-facet__select",children:c.map(e=>(0,i.jsx)("option",{value:e.value,children:e.label},e.value))})]})]})},save:({attributes:e})=>{const{label:l,fieldKey:s}=e;return(0,i.jsxs)("div",{...a.useBlockProps.save({className:"gateway-facet gateway-facet--select"}),children:[(0,i.jsx)("label",{className:"gateway-facet__label",children:l}),(0,i.jsxs)("select",{className:"gateway-facet__select","data-field-key":s,"data-wp-on--change":"actions.filterBySelect",children:[(0,i.jsx)("option",{value:"",children:(0,t.__)("All","gateway")}),(0,i.jsx)("option",{value:"active",children:(0,t.__)("Active","gateway")}),(0,i.jsx)("option",{value:"inactive",children:(0,t.__)("Inactive","gateway")}),(0,i.jsx)("option",{value:"pending",children:(0,t.__)("Pending","gateway")}),(0,i.jsx)("option",{value:"draft",children:(0,t.__)("Draft","gateway")}),(0,i.jsx)("option",{value:"published",children:(0,t.__)("Published","gateway")})]})]})}})})();