"use strict";(globalThis.webpackChunkstec=globalThis.webpackChunkstec||[]).push([[7527],{93699:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var l=a(58168),c=a(73772),s=a(26878),n=a(52779),r=a(57798);const __=c.__,o=e=>{const[t,a]=(0,s.useState)(!1),c=e.onClick,o={...e};return delete o.onClick,React.createElement(React.Fragment,null,React.createElement(r.default,{isOpen:t,onClose:e=>{e.stopPropagation(),a(!1)},headerIcon:"fa-solid fa-triangle-exclamation",title:e.promptText||__("Are you sure you want to delete this item?","stachethemes_event_calendar_lite"),buttons:[React.createElement(n.default,{key:"proceed",className:"red",label:e.yesLabel||__("Delete","stachethemes_event_calendar_lite"),onClick:()=>{a(!1),c()}}),React.createElement(n.default,{key:"cancel",className:"yellow",label:e.noLabel||__("Cancel","stachethemes_event_calendar_lite"),onClick:()=>{a(!1)}})]}),React.createElement(n.default,(0,l.default)({},o,{onClick:()=>{a(!0)}})))}},7930:(e,t,a)=>{a.r(t),a.d(t,{default:()=>h});var l=a(52779),c=a(93699),s=a(48596),n=a(98196),r=a(91927),o=a(8403),i=a(73772),m=a(26878),d=a(60799),u=a(43824);const __=i.__;const h=function(){const[e,t]=(0,m.useState)(0),a=(0,m.useRef)(!1),i=(0,m.useRef)([]),{setActiveMenu:h}=(0,r.useDashboardMenu)();return React.createElement(React.Fragment,null,React.createElement(o.StecDiv,{className:"stec-dashboard-top-nav"},React.createElement(l.default,{className:"stcolor stec-dashboard-home-button",label:[React.createElement("i",{key:"icon",className:"fa-solid fa-house"}),__("Home","stachethemes_event_calendar_lite")],onClick:()=>{h({page:"home",params:{}})}}),React.createElement(l.default,{className:"blue",label:[React.createElement("i",{key:"icon",className:"fa-solid fa-list"}),__("Manage events","stachethemes_event_calendar_lite")],onClick:()=>{h({page:"events-list",params:{}})}}),React.createElement(c.default,{promptText:__("Are you sure you want to delete all archived events?","stachethemes_event_calendar_lite"),yesLabel:__("Delete","stachethemes_event_calendar_lite"),className:"red",label:[React.createElement("i",{key:"icon",className:"fa-solid fa-list"}),__("Empty archive","stachethemes_event_calendar_lite")],onClick:()=>{!0!==a.current?d.toast.promise(new Promise(((e,l)=>{a.current=!0,async function(){try{await(0,n.newApiDelete)({route:"EVENTS/EMPTY-ARCHIVE",errorMessage:"auto"});return t((e=>e+1)),e(__("Archive deleted","stachethemes_event_calendar_lite"))}catch(e){return l(e.message)}}()})),{loading:__("Deleting","stachethemes_event_calendar_lite"),success:e=>(a.current=!1,e),error:e=>(a.current=!1,e)}):(0,d.toast)(__("Another action is in progress","stachethemes_event_calendar_lite"))}})),React.createElement(s.default,{key:e,title:[React.createElement("i",{key:"icon",className:"fa-solid fa-list"}),__("Archived events","stachethemes_event_calendar_lite")]},React.createElement(u.default,{hasItemsRef:i,status:"stec_archived"})))}}}]);