(()=>{"use strict";var e,t={7306(e,t,r){const o=window.wp.blocks,a=window.wp.i18n,n=window.React,s=window.wp.blockEditor,l=window.wp.apiFetch;var c=r.n(l);const i=window.ReactJSXRuntime,{Panel:p,PanelBody:u,SelectControl:d,RadioControl:v,TextControl:m,ColorPalette:h,FontSizePicker:f}=wp.components,b=JSON.parse('{"UU":"rsvpmaker/embedform"}');(0,o.registerBlockType)(b.UU,{edit:function(e){const{attributes:{post_id:t,type:r,one_hideauthor:o,one_format:l,hide_past:v},setAttributes:m,isSelected:h}=e,[f,b]=(0,n.useState)([{label:(0,a.__)("Choose event"),value:""},{label:(0,a.__)("Next event"),value:"next"},{label:(0,a.__)("Next event - RSVP on"),value:"nextrsvp"}]);return(0,n.useEffect)(()=>{c()({path:"rsvpmaker/v1/future"}).then(e=>{let t=[{label:(0,a.__)("Choose event, please"),value:""},{label:(0,a.__)("Next event"),value:"next"},{label:(0,a.__)("Next event - RSVP on"),value:"nextrsvp"}];Array.isArray(e)?e.map(function(e){if(e.ID){var r=e.neatdate?e.post_title+" - "+e.neatdate:e.post_title;t.push({value:e.ID,label:r})}}):Object.values(e).map(function(e){if(e.ID){var r=e.neatdate?e.post_title+" - "+e.neatdate:e.post_title;t.push({value:e.ID,label:r})}}),b(t)}).catch(e=>{console.log(e)})},[]),""==t&&m({post_id:"next"}),(0,i.jsxs)("div",{...(0,s.useBlockProps)({className:e.className}),children:[(0,i.jsxs)("p",{class:"dashicons-before dashicons-clock",children:[(0,i.jsx)("strong",{children:"RSVPMaker"}),": Embed just the form for a single event."]}),(0,i.jsx)(s.InspectorControls,{children:(0,i.jsx)(p,{children:(0,i.jsx)(u,{children:(0,i.jsx)(d,{label:(0,a.__)("Select Post","rsvpmaker"),value:t,options:f,onChange:e=>{m({post_id:e})}})})})},"eventlistinginspector")]})},save:function(){return null},transforms:{to:[{type:"block",blocks:["core/query"],transform:e=>{const t=e.calendar&&parseInt(e.calendar)?[["rsvpmaker/calendar",e],["core/post-template",{layout:{type:"grid",columnCount:2}},[["core/post-title",{isLink:!0}],["core/post-featured-image"],["rsvpmaker/loop-blocks"],["core/read-more",{content:"Read More >>"}]]],["core/query-pagination"],["core/query-no-results",{},[["core/paragraph",{content:"No events found."}]]]]:[["core/post-template",{layout:{type:"grid",columnCount:2}},[["core/post-title",{isLink:!0}],["core/post-featured-image"],["rsvpmaker/loop-blocks"],["core/read-more",{content:"Read More >>"}]]],["core/query-pagination"],["core/query-no-results",{},[["core/paragraph",{content:"No events found."}]]]],r=(0,o.createBlocksFromInnerBlocksTemplate)(t);return(0,o.createBlock)("core/query",{queryId:0,query:{perPage:20,pages:0,offset:0,postType:"rsvpmaker",order:"asc",author:"",search:"",exclude:[],sticky:"",inherit:!1},namespace:"rsvpmaker/rsvpmaker-loop"},r)}}]}})}},r={};function o(e){var a=r[e];if(void 0!==a)return a.exports;var n=r[e]={exports:{}};return t[e](n,n.exports,o),n.exports}o.m=t,e=[],o.O=(t,r,a,n)=>{if(!r){var s=1/0;for(p=0;p<e.length;p++){for(var[r,a,n]=e[p],l=!0,c=0;c<r.length;c++)(!1&n||s>=n)&&Object.keys(o.O).every(e=>o.O[e](r[c]))?r.splice(c--,1):(l=!1,n<s&&(s=n));if(l){e.splice(p--,1);var i=a();void 0!==i&&(t=i)}}return t}n=n||0;for(var p=e.length;p>0&&e[p-1][2]>n;p--)e[p]=e[p-1];e[p]=[r,a,n]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={9233:0,5445:0};o.O.j=t=>0===e[t];var t=(t,r)=>{var a,n,[s,l,c]=r,i=0;if(s.some(t=>0!==e[t])){for(a in l)o.o(l,a)&&(o.m[a]=l[a]);if(c)var p=c(o)}for(t&&t(r);i<s.length;i++)n=s[i],o.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return o.O(p)},r=globalThis.webpackChunkadmin=globalThis.webpackChunkadmin||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a=o.O(void 0,[5445],()=>o(7306));a=o.O(a)})();