(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var a in n)e.o(n,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:n[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,n=window.wp.plugins,a=window.wp.editSite,s={logo:(0,t.createElement)("svg",{className:"swt-page-settings-button",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 70 70",fill:"none"}," ",(0,t.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M35 70C54.33 70 70 54.33 70 35C70 15.67 54.33 0 35 0C15.67 0 0 15.67 0 35C0 54.33 15.67 70 35 70ZM24.4471 23.5112C18.9722 26.7403 20.2852 35.3759 26.5032 37.0351L36.8875 39.806C37.7533 40.037 37.91 41.224 37.135 41.6811L27.0972 47.5799L26.036 58L45.5529 46.4888C51.0278 43.2597 49.7148 34.6241 43.4968 32.9649L33.1125 30.1941C32.2467 29.963 32.09 28.776 32.865 28.3189L42.9028 22.4202L43.964 12L24.4471 23.5112Z"})," ")},o=window.wp.i18n,l=window.wp.components,r=window.wp.data,i=({setting:e,setSetting:n,id:a,setData:s,notice:o,label:i})=>{const c=(0,t.useCallback)(()=>{n({...e,[a]:!e[a]}),s({...e,[a]:!e[a]}),(0,r.dispatch)("core/notices").createNotice("success",o,{type:"snackbar",isDismissible:!0})},[e]);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(l.PanelRow,null,(0,t.createElement)(l.ToggleControl,{label:i,checked:e[a],onChange:c})))},c=window.wp.apiFetch;var p=e.n(c);const d=()=>{const[e,n]=(0,t.useState)({scroll_top:!1}),a="swt/v1/global_settings";return(0,t.useEffect)(()=>{(async()=>{try{const e=await p()({path:a,method:"GET",headers:{"content-type":"application/json","X-WP-NONCE":spectraOne.nonce}});e&&n(e)}catch(e){}})()},[]),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(l.PanelBody,{title:(0,o.__)("Spectra One Settings","spectra-one"),initialOpen:!0,className:"swt-global-features-panel"},(0,t.createElement)(i,{setting:e,setSetting:n,id:"scroll_top",setData:async e=>{const t={setting:e};try{await p()({path:a,method:"POST",headers:{"content-type":"application/json","X-WP-NONCE":spectraOne.nonce},body:JSON.stringify(t)})}catch(e){}},notice:(0,o.__)("Scroll to top updated","spectra-one"),label:(0,o.__)("Scroll To Top","spectra-one")})))},w=window.wp.hooks;spectraOne.is_spectra_plugin||(0,n.registerPlugin)("swt-editor-sidebar",{render:()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(a.PluginSidebar,{name:"swt-editor-sidebar",icon:s.logo,isPinnable:!0,title:(0,o.__)("Spectra One Editor Settings","spectra-one")},(0,t.createElement)(d,null)))}),spectraOne.is_spectra_plugin&&(0,w.addFilter)("spectra.page-sidebar.before","swt/editor-settings-list",function(e,n){return(0,t.createElement)(t.Fragment,null,e,(0,t.createElement)(d,{...n}))},10)})();