(()=>{"use strict";const e=window.wp.plugins,s=window.wp.element,t=window.wp.editor,l=window.wp.components,i=window.wp.coreData,r=window.wp.data,n=window.wp.i18n,o=window.wp.blockEditor,a=window.ReactJSXRuntime,d="rs_blank_template",c="rs_page_bg_color",m="slide_template_v7";(0,e.registerPlugin)("revslider-meta-box",{render:()=>{const e=(0,r.useSelect)(e=>e("core/editor").getCurrentPostType(),[]),[_,p]=(0,i.useEntityProp)("postType",e,"meta"),[u,x]=(0,s.useState)([]),[w,v]=(0,s.useState)(!1),b=SR7?.E?.revision||"",g=SR7?.E?.latest_revision||"",j=()=>{if(!_tpt||!_tpt.ajax||!_tpt.fixResponse)return requestAnimationFrame(j);SR7.E.block_editor=!0,v(!0),_tpt.ajax({action:"slider.get.post_templates",backend:!0,data:{module:["modules"]},callBack:e=>{v(!1);const s=[],t=_tpt.fixResponse(e)?.templates||{};for(let e in t)s.push({label:t[e],value:e});x(s)}})};if((0,s.useEffect)(()=>{j()},[]),!e||!_)return null;const h=[{label:w?(0,n.__)("Loading...","revslider"):(0,n.__)("Default","revslider"),value:""},...u];return(0,a.jsxs)(t.PluginDocumentSettingPanel,{name:"slider_revolution_metabox",title:(0,n.__)("Slider Revolution","revslider"),className:"sr--revslider--metabox",children:[(0,a.jsx)(l.ToggleControl,{label:(0,n.__)("Blank Template","revslider"),checked:"on"===_[d],onChange:e=>p({..._,[d]:e?"on":""}),className:"sr--revslider--metabox--blank"}),"on"===_[d]&&(0,a.jsx)(o.PanelColorSettings,{title:"Colors",colorSettings:[{value:_[c]||"",onChange:e=>p({..._,[c]:e}),label:(0,n.__)("Background Color","revslider")}],className:"sr--revslider--metabox--color"}),(0,a.jsx)(l.SelectControl,{label:(0,n.__)("Slide Template","revslider"),value:_[m]||"",options:h,onChange:e=>p({..._,[m]:e}),className:"sr--revslider--metabox--template"}),(0,a.jsx)(l.Notice,{status:"info",isDismissible:!1,className:"sr--revslider--metabox--notice",children:(0,a.jsxs)(l.__experimentalVStack,{spacing:2,children:[(0,a.jsxs)(l.Flex,{justify:"space-between",children:[(0,a.jsxs)(l.FlexItem,{children:[(0,n.__)("Installed Version","revslider"),":"]}),(0,a.jsx)(l.FlexItem,{children:b})]}),(0,a.jsxs)(l.Flex,{justify:"space-between",children:[(0,a.jsxs)(l.FlexItem,{children:[(0,n.__)("Available Version","revslider"),":"]}),(0,a.jsx)(l.FlexItem,{children:g})]})]})}),!SR7.E.registered&&(0,a.jsx)(l.Notice,{status:"warning",isDismissible:!1,className:"sr--revslider--metabox--notice",children:(0,n.__)("Register Plugin","revslider")})]})},icon:"admin-generic"})})();