(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1165],{76386:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/share/[[...shareParams]]",function(){return r(66556)}])},66556:function(e,n,r){"use strict";r.r(n),r.d(n,{__N_SSP:function(){return j},config:function(){return N},default:function(){return D}});var t=r(39324),i=r(71209),s=r(22830),a=r(35250),o=r(59119),u=r(50744),l=r(32542),d=r(6780);function c(e){var n=e.sharedConversationId,r=e.initiallyHighlightedMessageId,t=e.continueConversationUrl;return(0,a.jsx)(l.gB.Provider,{value:{serverSharedThreadId:n},children:(0,a.jsx)(d.Z,{clientThreadId:n,setClientThreadId:function(){},initiallyHighlightedMessageId:r,continueConversationUrl:t})})}var h=r(37469),v=r(13995),_=r(9181),m=r.n(_),f=r(70079),g=r(1454),x=r(94968),p=r(32004),j=!0,N={runtime:"nodejs"},C=(0,x.vU)({home:{id:"sharedConversation.home",defaultMessage:"Home",description:"Home link text in error message"}});function D(e){if("error"===e.serverResponse.type)return(0,a.jsx)(w,{error:e.serverResponse.error});var n=(0,i._)((0,t._)({},e),{conversationData:e.serverResponse.data});return e.continueMode?(0,a.jsx)(I,(0,t._)({},n)):e.moderationMode?(0,a.jsx)(u.Z,{children:(0,a.jsx)(P,(0,t._)({},n))}):(0,a.jsx)(P,(0,t._)({},n))}function I(e){var n=(0,s._)((0,f.useState)(function(){return(0,h.OX)()}),1)[0];h.tQ.initThreadFromServerData(n,e.conversationData,!0,e.sharedConversationId);var r=(0,v.NL)();return(null!=e.plugins&&r.setQueryData(e.plugins.map(function(e){return e.id}),e.plugins),null!=e.chatPageProps)?(0,a.jsx)(o.ZP,(0,i._)((0,t._)({},e.chatPageProps),{clientThreadId:n})):null}function P(e){h.tQ.initThreadFromServerData(e.sharedConversationId,e.conversationData,!0);var n=(0,v.NL)();return null!=e.plugins&&n.setQueryData(e.plugins.map(function(e){return e.id}),e.plugins),(0,a.jsx)(c,(0,i._)((0,t._)({},e),{initiallyHighlightedMessageId:e.conversationData.highlighted_message_id,continueConversationUrl:e.conversationData.continue_conversation_url}))}function w(e){var n=e.error;return(0,a.jsx)("div",{className:"mx-8 mt-8 flex flex-col items-center sm:mt-16",children:(0,a.jsxs)("div",{className:"max-w-xl rounded-lg bg-red-500 px-8 py-4 text-white",role:"alert",children:[(0,a.jsx)("div",{children:n}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsxs)(m(),{href:"/",className:"flex items-center gap-2",children:[(0,a.jsx)(g.m6D,{className:"icon-sm"}),(0,a.jsx)(p.Z,(0,t._)({},C.home))]})})]})})}}},function(e){e.O(0,[6786,3656,5960,2104,1438,7985,4137,9441,8937,2357,4099,722,2766,9119,9774,2888,179],function(){return e(e.s=76386)}),_N_E=e.O()}]);