(()=>{"use strict";var e={n:n=>{var t=n&&n.__esModule?()=>n.default:()=>n;return e.d(t,{a:t}),t},d:(n,t)=>{for(var s in t)e.o(t,s)&&!e.o(n,s)&&Object.defineProperty(n,s,{enumerable:!0,get:t[s]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n)};const n=window.wp.domReady;var t=e.n(n);const s=window.wp.element,o=window.wp.apiFetch;var a=e.n(o);const r=window.wp.components,i=window.ReactJSXRuntime,d=()=>{const[e,n]=(0,s.useState)(parseInt(invoicejapan_resending_data.order_id)),[t,o]=(0,s.useState)(parseInt(invoicejapan_resending_data.refund_id)),[d,c]=(0,s.useState)(!1),[u,p]=(0,s.useState)(!1);(0,s.useEffect)(()=>{a()({path:"rf/invoicejapan-resending_api/token",method:"POST",data:{order_id:e,refund_id:t,order_button:d,refund_button:u}}).then(e=>{})},[d,u]);const l=[];"resending_invoice"===invoicejapan_resending_data.status&&(d?l.push((0,i.jsx)(r.Notice,{status:"success",onRemove:()=>{c(!1)},children:"請求書を再送信しました。"})):l.push((0,i.jsx)(r.Button,{className:"button resending_button",onClick:()=>{c(!0)},children:"請求書の再送信"})));const h=[];return 0<t&&(u?h.push((0,i.jsx)(r.Notice,{status:"success",onRemove:()=>{p(!1)},children:"払戻明細書を再送信しました。"})):h.push((0,i.jsx)(r.Button,{className:"button resending_button",onClick:()=>{p(!0)},children:"払戻明細書の再送信"}))),(0,i.jsxs)("div",{className:"wrap",children:[(0,i.jsx)("h2",{children:"請求書あるいは払戻明細書の再送信"}),(0,i.jsx)("p",{children:l}),(0,i.jsx)("p",{children:h})]})};t()(()=>{(0,s.createRoot)(document.getElementById("invoicejapanresending")).render((0,i.jsx)(d,{}))})})();