(()=>{"use strict";const e=window.wp.blocks,n=window.wp.i18n;(0,e.registerBlockVariation)("core/query",{name:"nemtly/events",title:(0,n.__)("Nemtly Events","nemtly-booking"),category:"nemtly-blocks",description:(0,n.__)("Display a list of upcoming events.","nemtly-booking"),icon:"calendar-alt",attributes:{namespace:"nemtly/events",query:{postType:"nemtly_event",perPage:6,offset:0,order:"asc",orderBy:"date",inherit:!1,nemtlyEventType:""}},allowedControls:["order","search"],innerBlocks:[["core/post-template",{style:{spacing:{blockGap:"var:preset|spacing|40"}}},[["core/post-featured-image",{isLink:!0,height:"200px"}],["core/group",{layout:{type:"flex",flexWrap:"nowrap"}},[["nemtly/event-date"],["nemtly/price"]]],["core/post-title",{isLink:!0,level:3}]]],["core/query-pagination"],["core/query-no-results"]],scope:["inserter"],isActive:["namespace"]});const t=window.wp.hooks,o=window.wp.blockEditor,l=window.wp.components,s=window.ReactJSXRuntime;(0,t.addFilter)("editor.BlockEdit","nemtly-booking/events-query-controls",(function(e){return t=>{if(!function(e){return"core/query"===e.name&&"nemtly/events"===e.attributes.namespace}(t))return(0,s.jsx)(e,{...t});const{attributes:i,setAttributes:r}=t,{query:a}=i,c=a.nemtlyEventType||"",y=a.nemtlyHidePastEvents||!1,p=e=>{r({query:{...a,...e}})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e,{...t}),(0,s.jsx)(o.InspectorControls,{children:(0,s.jsxs)(l.PanelBody,{title:(0,n.__)("Event Filters","nemtly-booking"),initialOpen:!0,children:[(0,s.jsx)(l.SelectControl,{label:(0,n.__)("Event Type","nemtly-booking"),value:c,options:[{label:(0,n.__)("All Types","nemtly-booking"),value:""},{label:(0,n.__)("Events (date-based)","nemtly-booking"),value:"event"},{label:(0,n.__)("One-on-One (slot-based)","nemtly-booking"),value:"one-on-one"},{label:(0,n.__)("Group (slot-based)","nemtly-booking"),value:"group"}],onChange:e=>p({nemtlyEventType:e}),help:(0,n.__)("Slot-based events (One-on-One, Group) do not have a fixed event date.","nemtly-booking")}),(0,s.jsx)(l.ToggleControl,{label:(0,n.__)("Hide Past Events","nemtly-booking"),checked:y,onChange:e=>p({nemtlyHidePastEvents:e}),help:y?(0,n.__)("Only showing upcoming events.","nemtly-booking"):(0,n.__)("Showing all events including past.","nemtly-booking")})]})})]})}}))})();