(()=>{"use strict";var e,t={485(e,t,l){const n=window.wp.blocks,o=window.wp.blockEditor,r=window.wp.components,s=window.wp.element,a=window.wp.i18n,i=window.wp.serverSideRender;var c=l.n(i);const d=window.ReactJSXRuntime,{SelectControl:u}=wp.components;(0,n.registerBlockType)("the-events-calendar/shortcode-block",{edit:function(e){const{attributes:t,setAttributes:l}=e,{shortcode:n,preview:i}=t,[v,h]=(0,s.useState)(null),p=ta_eventful?.shortCodeList||[],f=ta_eventful?.loadScript,m=(0,o.useBlockProps)();return i?(0,d.jsx)("div",{...m,children:(0,d.jsx)("img",{src:ta_eventful.dir_url+"src/Admin/GutenbergBlock/assets/carousel_normal.svg",alt:"Eventful Preview",style:{width:"100%",height:"auto"}})}):((0,s.useEffect)(()=>{let e;if(f&&n&&"0"!==n){const t=setTimeout(()=>{const t=document.querySelector(`script[src="${f}"]`);t&&document.body.removeChild(t),e=document.createElement("script"),e.src=f,e.async=!0,document.body.appendChild(e)},1e3);return()=>{clearTimeout(t),e&&document.body.removeChild(e)}}},[f,n]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o.InspectorControls,{children:(0,d.jsx)(r.PanelBody,{title:(0,a.__)("Eventful Settings","eventful"),children:v?(0,d.jsx)(r.Notice,{status:"error",isDismissible:!1,children:v}):(0,d.jsx)(u,{label:(0,a.__)("Select Template","eventful"),value:n||"0",options:[{label:(0,a.__)("-- Select a view (shortcode) --","eventful"),value:"0"},...p.map(e=>({label:e.title,value:e.id.toString()}))],onChange:e=>{l({shortcode:e}),h(null)}})})}),(0,d.jsx)("div",{...m,children:(0,d.jsx)("div",{className:"eventful_editor_template",children:n&&"0"!==n?(0,d.jsx)(c(),{block:"the-events-calendar/shortcode-block",attributes:t}):p&&p.length>0?(0,d.jsx)(u,{label:(0,a.__)("Select Template","eventful"),value:n||"0",options:[{label:(0,a.__)("-- Select a template (shortcode) --","eventful"),value:"0"},...p.map(e=>({label:e.title,value:e.id.toString()}))],onChange:e=>{l({shortcode:e}),h(null)}}):(0,d.jsxs)("div",{className:"eventful_placeholder",children:[(0,d.jsxs)("div",{className:"eventful_placeholder_label",children:[(0,d.jsx)("div",{className:"dashicons dashicons-admin-site"}),(0,d.jsx)("h4",{children:(0,a.__)("Eventful","eventful")})]}),(0,a.__)("No template shortcode found.","eventful")," ",(0,d.jsx)("a",{href:"post-new.php?post_type=eventful",target:"_blank",rel:"noopener noreferrer",children:(0,a.__)("Create a template now!","eventful")})]})})})]}))},save:()=>null})}},l={};function n(e){var o=l[e];if(void 0!==o)return o.exports;var r=l[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,e=[],n.O=(t,l,o,r)=>{if(!l){var s=1/0;for(d=0;d<e.length;d++){for(var[l,o,r]=e[d],a=!0,i=0;i<l.length;i++)(!1&r||s>=r)&&Object.keys(n.O).every(e=>n.O[e](l[i]))?l.splice(i--,1):(a=!1,r<s&&(s=r));if(a){e.splice(d--,1);var c=o();void 0!==c&&(t=c)}}return t}r=r||0;for(var d=e.length;d>0&&e[d-1][2]>r;d--)e[d]=e[d-1];e[d]=[l,o,r]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var l in t)n.o(t,l)&&!n.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};n.O.j=t=>0===e[t];var t=(t,l)=>{var o,r,[s,a,i]=l,c=0;if(s.some(t=>0!==e[t])){for(o in a)n.o(a,o)&&(n.m[o]=a[o]);if(i)var d=i(n)}for(t&&t(l);c<s.length;c++)r=s[c],n.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return n.O(d)},l=globalThis.webpackChunkeventful_layout=globalThis.webpackChunkeventful_layout||[];l.forEach(t.bind(null,0)),l.push=t.bind(null,l.push.bind(l))})();var o=n.O(void 0,[350],()=>n(485));o=n.O(o)})();