(()=>{"use strict";var e,n={3154(e,n,t){const r=window.wp.blocks,o=window.wp.i18n,a=window.wp.blockEditor,l=window.wp.apiFetch;var s=t.n(l);const i=window.wp.url,c=window.React,d=window.ReactJSXRuntime,{Component:p,Fragment:u}=wp.element,{Panel:v,PanelBody:h,TextControl:m,RadioControl:b,ColorPicker:g,SelectControl:f}=wp.components,w=JSON.parse('{"UU":"rsvpmaker/calendar"}');(0,r.registerBlockType)(w.UU,{edit:function(e){const{attributes:n,setAttributes:t,isSelected:r}=e,[l,v]=(0,c.useState)(null),[m,w]=(0,c.useState)([]);(0,c.useEffect)(()=>{s()({path:(0,i.addQueryArgs)("/rsvpmaker/v1/calendar",n)}).then(e=>{v(e.calendar)}),m.push({value:"",label:"Any"}),s()({path:"rsvpmaker/v1/types"}).then(e=>{Array.isArray(e)?e.map(function(e){e.slug&&e.name&&m.push({value:e.slug,label:e.name})}):Object.values(e).map(function(e){e.slug&&e.name&&m.push({value:e.slug,label:e.name})}),w(m)}).catch(e=>{console.log(e)})},[n]);class x extends p{render(){const{attributes:{itembg:e,itemcolor:n,itemfontsize:t,nav:r,date_format:l,type:s},setAttributes:i,isSelected:c}=this.props;return(0,d.jsx)("div",{children:(0,d.jsx)(a.InspectorControls,{children:(0,d.jsxs)(h,{title:(0,o.__)("RSVPMaker Calendar","rsvpmaker"),children:[(0,d.jsx)(b,{label:"Position of Navigation Links",selected:r,options:[{label:"bottom",value:"bottom"},{label:"top",value:"top"},{label:"both",value:"both"}],onChange:function(e){i({nav:e})}}),(0,d.jsx)(f,{label:(0,o.__)("Event Type","rsvpmaker"),value:s,options:m,onChange:e=>{i({type:e})}}),(0,d.jsx)("p",{children:"Calendar Item Text Color"}),(0,d.jsx)(g,{color:n,onChange:e=>i({itemcolor:e})}),(0,d.jsx)("p",{children:"Calendar Item Background Color"}),(0,d.jsx)(g,{color:e,onChange:e=>i({itembg:e})})]})},"calendarinspector")})}}return(0,d.jsx)(u,{children:(0,d.jsxs)("div",{...(0,a.useBlockProps)(),children:[(0,d.jsx)(x,{...e}),l&&(0,d.jsx)(d.Fragment,{children:(0,d.jsx)("div",{dangerouslySetInnerHTML:{__html:l}})}),!l&&(0,d.jsx)(d.Fragment,{children:(0,d.jsx)("p",{children:"Loading ..."})})]})})},save:function(){return null}})}},t={};function r(e){var o=t[e];if(void 0!==o)return o.exports;var a=t[e]={exports:{}};return n[e](a,a.exports,r),a.exports}r.m=n,e=[],r.O=(n,t,o,a)=>{if(!t){var l=1/0;for(d=0;d<e.length;d++){for(var[t,o,a]=e[d],s=!0,i=0;i<t.length;i++)(!1&a||l>=a)&&Object.keys(r.O).every(e=>r.O[e](t[i]))?t.splice(i--,1):(s=!1,a<l&&(l=a));if(s){e.splice(d--,1);var c=o();void 0!==c&&(n=c)}}return n}a=a||0;for(var d=e.length;d>0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[t,o,a]},r.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return r.d(n,{a:n}),n},r.d=(e,n)=>{for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={9076:0,4108:0};r.O.j=n=>0===e[n];var n=(n,t)=>{var o,a,[l,s,i]=t,c=0;if(l.some(n=>0!==e[n])){for(o in s)r.o(s,o)&&(r.m[o]=s[o]);if(i)var d=i(r)}for(n&&n(t);c<l.length;c++)a=l[c],r.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return r.O(d)},t=globalThis.webpackChunkadmin=globalThis.webpackChunkadmin||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))})();var o=r.O(void 0,[4108],()=>r(3154));o=r.O(o)})();