(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React;var s=e.n(t);const n=window.ReactDOM,a=({title:e,message:n,nonce:a,slug:r})=>{const o=s().useRef(null),{data:c,error:l,refetch:d}=((e,s={},n=!1)=>{const[a,r]=(0,t.useState)(!n),[o,c]=(0,t.useState)(!1),[l,d]=(0,t.useState)(null),[i,u]=(0,t.useState)(null);if(!wp.ajax)return void console.error("Please use wp-util as a dependency");const f=(t={})=>{r(!0),c(!1),d(null),wp.ajax.post(e,{...s,...t}).done(e=>{u(e),r(!1)}).fail(e=>{c(!0),d(e),r(!1)})},m=async(e={})=>{f(e)};return(0,t.useEffect)(()=>{n||f(s)},[]),{data:i,saveData:m,refetch:m,isLoading:a,isError:o,error:l}})(`fs_notice_dismiss_${r}`,{nonce:a},!0);return s().useEffect(()=>{setTimeout(()=>{const e=o.current?.nextElementSibling;e?.addEventListener("click",()=>{d(n)})},2e3)},[]),(0,t.createElement)("p",{ref:o,style:{color:"green",fontSize:"15px"}},e?(0,t.createElement)("b",null,e," "):"",n)};document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".fs_notice_board").forEach(e=>{const s={...e.dataset}||{};Object.keys(e.dataset).map(t=>delete e.dataset[t]);const r=(e=>{let t=null;try{t=JSON.parse(e)}catch(e){console.warn(e.message)}return t})(s.notice);r.message&&(e.classList.add("notice"),e.classList.add("notice-success"),e.classList.add("is-dismissible"),e.setAttribute("id","message")),(0,n.render)((0,t.createElement)(a,{...r,nonce:s.nonce,slug:s.slug}),e)})})})();