PageSourceSearch

https://facilitatethefuture.com/assets/Direct-DXFH2kOs.js

js facilitatethefuture.com collected 2026-10-01 01:42:18 UTC 14,334 bytes, 4 lines download raw bytes

1import{O as Ue,b9 as Oe,az as he,d6 as ze,ba as U,be as _e,bb as We,bd as Ve,W as qe,d7 as Je,a0 as Ke}from"./ResourceNode-OBIHQGrc.js";import{o as Ye,r,j as d,I as we,z as Qe,K as Xe,B as be,G as Ze,T as Te}from"./react-CiToEmDU.js";import{f as ne,a as et,b as tt,v as nt,w as rt,bi as I}from"./index-BYjFgc3L.js";import{F as st}from"./index-VeBbZI0v.js";import{u as ot}from"./useChannel-DYxj2c-Y.js";import{L as ct}from"./Loading-Dy7Gg5kl.js";import{t as lt}from"./TrackMixpanel-C5L6PEAt.js";import{u as it}from"./faPencil-i7LcEqDF.js";import"./tiptap-nRqHaR__.js";import"./ui-RDrFZQ6P.js";import"./utils-D0PJbLwx.js";import"./faListCheck-DLKcNtcQ.js";import"./faScaleBalanced-D5aakmWf.js";import"./faClipboardCheck-S11E7M81.js";import"./faHouse-U1l3zx8N.js";import"./faArrowRight-4u0hryvz.js";import"./faXmark-B7G55HuF.js";import"./default-COrDvlHP.js";import"./media-CVQTa9EZ.js";import"./analytics-BXHdaAVG.js";import"./App-Brufidul.js";import"./headerLayout-oz_V-s5H.js";import"./Helmet-Dnl5bqjF.js";import"./Summary-DYvDEkHw.js";import"./charts-llrkN2aQ.js";import"./UserMenu-B_jYy3Li.js";import"./faCloudArrowUp-C66WGIf9.js";import"./faHouse-CoXf9sah.js";import"./SutraLogo-Bi9M0uSf.js";import"./faBoxArchive-tpsCW6hI.js";import"./faFileLines-D3zdxiD5.js";import"./faArrowUpRightFromSquare-DxPh7tzK.js";import"./PresetCard-DwaDohyt.js";import"./faEllipsis-HcBaDDIO.js";import"./FontDropdown-CVwK6Nll.js";import"./UploadedFilesList-sj2xJC_U.js";import"./CoboltLauncher-CbQFsgoE.js";import"./AuthUser-CvWiDbrb.js";import"./module-xE8hoDfr.js";(function(){try{var m=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{};m.SENTRY_RELEASE={id:"e15ff996bbe7105fef2b7e48186cc5ea2cf1c022"};var a=new m.Error().stack;a&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[a]="51fd2aa1-fba1-47ed-9ff8-1e5db41d6d1f",m._sentryDebugIdIdentifier="sentry-dbid-51fd2aa1-fba1-47ed-9ff8-1e5db41d6d1f")}catch{}})();const at="_reflectionsTitleGroup_7a72d_1",ut="_reflectionsTitleGroupBack_7a72d_5",dt="_closeButton_7a72d_9",re={reflectionsTitleGroup:at,reflectionsTitleGroupBack:ut,closeButton:dt},g={page:1},f={pod_message_id:null,reflection_id:null},se="sutra-direct-drawer-content",Se="sutra-direct-space-content",ft=(m,{colors:a})=>({drawerWrap:{backgroundColor:a.background_color,color:a.default_text_color,display:"flex",flexDirection:"column"},drawerBody:{flex:1,display:"flex",flexDirection:"column",minHeight:0,paddingBottom:"var(--mantine-spacing-md)"},drawerHeader:{backgroundColor:a.background_color,color:a.default_text_color,fontWeight:700,paddingBottom:10},themeTextColor:{color:a.default_text_color},spaceContainer:{height:"100%",backgroundColor:a.background_color,color:a.default_text_color},closeButton:{backgroundColor:a.background_color,color:a.default_text_color},dividerStyle:{marginTop:10,marginBottom:10,borderTop:`1px solid ${Ke(a)?a.header_color:Ue(a.sidebar_background_color).darken(5).toString()}`}});function Zt(m){var me;const a=ne(e=>e.colors),oe=Ye(),b=ft(oe,{colors:a}),{t:B}=it(),p=r.useRef(),k=et(),O=tt(),z=ne(e=>e.user),[C,H]=r.useState(!1),[ye,M]=r.useState(!1),[o,w]=r.useState([]),[ke,xe]=r.useState(null),[v,N]=r.useState(null),[E,ce]=r.useState(null),[Be,le]=r.useState(0),[W,Re]=r.useState(null),[Me,ve]=r.useState(null),[j,V]=r.useState(null),P=r.useRef(null),i=r.useRef([]),u=r.useRef([]),De=r.useRef(),R=r.useRef(),T=r.useRef(!1),$=r.useRef([]),A=r.useRef([]),h=r.useRef({slug:null,state:null}),q=r.useRef(!1),F=r.useRef(0),S=r.useRef(0),J=r.useRef(!1),l=r.useRef({slug:null});r.useEffect(()=>{var e;o.length>0&&((e=l.current)!=null&&e.slug)&&Oe.onFetchUnread(null,l.current.slug,t=>{t&&t.reflections&&xe(t.reflections)},t=>{})},[o.length>0,(me=l.current)==null?void 0:me.slug]);const K=r.useRef(),_=ne(e=>e.tiptapSidemenu),[Ie,ie]=r.useState(!1),[pt,Y]=r.useState(window.$showBackButtonModal?B("spaces.presentations.discussion.backToPost"):B("spaces.presentations.discussion.reflectionHeader"));ot(l.current.slug?{channel:"PodsChannel",pod_slug:l.current.slug}:null,{connected:()=>
1{if(h.current.state=="connecting"){h.current.state="connected",ae(),setTimeout(()=>{Ee()},5e3),D(!0);return}(o.length==0||o.length>0&&o[0].pod_slug!=h.current.slug)&&D(!0)},disconnected:()=>{},received:e=>{e.slug==h.current.slug&&(g.newMessage=!0,ce(e))}},[l.current.slug]),r.useEffect(()=>(P.current&&clearInterval(P.current),P.current=setInterval(()=>{if(i.current.length>0&&i.current[0].state=="pending"){i.current[0].state="in_progress",i.current[0].action(i.current[0].change||i.current[0].id);return}if(i.current.length>0&&i.current[0].state=="done"){i.current.splice(0,1);return}i.current.length>0&&i.current[0].state=="in_progress"},1e3),()=>{w([]),u.current=[],h.current.slug=null,h.current.state=null,clearInterval(P.current),clearTimeout(A.current),R.current=!1,S.current=!1}),[]),r.useEffect(()=>{_&&_.opened=="direct"?(l.current={slug:_.option},h.current.slug=_.option,h.current.state="connecting",F.current=0,J.current=!!_.skip_cache,ae(_.pod_message_id),Ce(),H(!0),A.current=setTimeout(()=>{h.current.state=="connecting"&&D(!0)},1e3)):H(!1)},[_]),r.useEffect(()=>{C?(window.$showBackButtonModal=!0,K.current=O.pathname):(_&&_.opened=="direct"&&k(nt({opened:null})),Le(),window.$showBackButtonModal=!1)},[C]),r.useEffect(()=>{K.current!=O.pathname&&H(!1)},[O]),r.useEffect(()=>{if(E){let t=E.changes;E.state!="multi"&&(t=[E]);for(var e=0;e<t.length;e++)t[e].state=="new"?i.current.push({id:t[e].pod_message_id,change:t[e],action:$e,state:"pending"}):t[e].state=="update"?i.current.push({id:t[e].pod_message_id,change:t[e],action:G,state:"pending"}):t[e].state=="destroy"?i.current.push({id:t[e].pod_message_id,change:t[e],action:Z,state:"pending"}):t[e].state=="pin"?i.current.push({id:t[e].pod_message_id,change:t[e],action:pe,state:"pending"}):t[e].state=="unpin"&&i.current.push({id:null,change:t[e],action:pe,state:"pending"})}},[E]),r.useEffect(()=>{if(!(i.current&&i.current.length>0)&&o.length!==0){if(R.current==!0){R.current=!1,ee();return}!S.current&&o.length>0&&(S.current=!0,!f.pod_message_id)||f.pod_message_id&&o.length>0&&Q(f.pod_message_id)}},[o]),r.useEffect(()=>{C&&(g.page=1,D())},[Me,C]);const Ce=()=>{rt.onFetchSimple(l.current.slug,"payment",e=>{V(e)},e=>{})},ae=e=>{e&&(f.pod_message_id=e),o.length>0&&o[0].pod_slug==l.current.slug&&f.pod_message_id&&Q(f.pod_message_id)},Ee=()=>{he.onMarkAsSeen("pod_message",l.current.slug,e=>{})},ue=e=>{he.onMarkAsSeen("reflection",e,t=>{})},D=(e=!1)=>{if(i.current&&i.current.length>0||e&&o.length>0&&o[0].pod_slug==l.current.slug)return;const t=window.location.search,n=new URLSearchParams(t).get("tag"),s=new URLSearchParams(t).get("pod_message_id");e&&(g.page=1,u.current=[],w([]),S.current=!1),n&&q.current!=n&&(q.current=n,g.page=1,u.current=[],w([]),S.current=!1),!n&&!s&&g.page==1?(f.pod_message_id||(R.current=!0),J.current?L(n):ze("spaces",`messages-${l.current.slug}`,c=>{c&&c.data.length>0?(w([...c.data]),u.current=[...c.data],L(n,c.stored_at,c.data)):L(n)})):L(n)},L=(e,t=null,n=null)=>{l.current.slug&&(e&&lt(window.$currentUsername,"Tag Clicked",{space_slug:l.current.slug}),U.onFetch(l.current.slug,{tag:e},g.page,s=>{let c=!0;s.data.length>0&&g.page>1?(w(s.data.concat(o)),u.current=[...s.data.concat(o)],c=!1):s.data.length>0&&g.page==1&&(_e("spaces",`messages-${l.current.slug}`,{...s}),(!t||t&&je(s.data,n))&&(console.log("SILENT UPDATE DONE MESSAGES"),w([...s.data]),u.current=[...s.data],c=!1)),s.data.length==0&&g.page>1&&g.page--,c&&f.pod_message_id&&o.length>0&&Q(f.pod_message_id),s.last_message_read_id&&Re(s.last_message_read_id)},s=>{}))},je=(e,t,n)=>{for(let s=0;s<e.length;s++){const c=e[s],y=t.find(te=>te.id===c.id);if(!y)return T.current||k(I({show:!0,viewport:p.current})),!0;if(y&&(new Date(c.updated_at)>new Date(y.updated_at)||c.reflections.length>y.reflections.length))return T.current||k(I({show:!0,viewport:p.current})),!0}for(let s=0;s<t.length;s++){const c=t[s],y=e.find(te=>te.id===c.id);if(!y)return T.current||k(I({show:!0,viewport:p.current})),!0;if(y&&(new Date(y.updated_at)>new Date(c.updated_at)||y.reflections.length>c.reflections.length))return T.current||k(I({show:!0,viewport:p.current})),!0}return!1},Q=e=>{if(!(F.current>10)){F.current++;for(let t=0;t<o.length;t++)if(o[t].id==e){if(f.pod_message_id=null,F.current=99,Ne(e),f.reflection_id){const n={...o[t]};n.reflectionId=f.reflection_id,f.reflection_id=null,N(n),M(!0),ue(e),Y(B("space
1s.presentations.discussion.reflectionHeader"))}return}g.page++,D()}},de=e=>typeof e=="object"&&e!==null&&e.id&&e.pod_slug&&e.pod_message_id===void 0,X=e=>{if(!e||!e.id||(u.current.length>0?u.current:o).find(c=>c.id==e.id))return;e.user&&e.user.id!=z.id?T.current?(S.current=!1,R.current=!0,setTimeout(()=>{ee()},500)):k(I({show:!0,viewport:p.current})):(S.current=!1,R.current=!0,setTimeout(()=>{ee()},500));let s=[...u.current];u.current.length==0&&(u.current=[...o],s=[...u.current]),s.push(e),u.current.push(e),w(s)},fe=e=>{if(!e||!e.id)return;S.current=!0;const n=[...u.current.length>0?u.current:o];let s=!1;for(let c=0;c<n.length;c++)if(n[c].id==e.id){n[c]=e,s=!0,v&&e.id==v.id&&N({...n[c]});break}s&&(w(n),u.current=[...n])},$e=e=>{if(de(e)){X(e),x();return}const t=typeof e=="object"&&e!==null?e.pod_message_id:e;U.onFetchById(t,l.current.slug,n=>{X(n),x()},n=>{x()})},G=e=>{if(de(e)){fe(e),x();return}const t=typeof e=="object"&&e!==null?e.pod_message_id||e.id:e;U.onFetchById(t,l.current.slug,n=>{fe(n),x()},n=>{x()})},Z=e=>{const t=typeof e=="object"&&e!==null?e.pod_message_id||e.id:e,s=[...u.current.length>0?u.current:o];for(let c=0;c<s.length;c++)if(s[c].id==t){s.splice(c,1);break}w(s),u.current=[...s],x()},pe=e=>{const t=typeof e=="object"&&e!==null?e.pod_message_id||e.id:e,n={...j};n.pin_message=t,k(V(n)),x()},x=()=>{i.current.length>0&&(i.current[0].state="done")},Ae=()=>{g.page++,D()},Fe=(e,t)=>{e.attrs={uid:`message-${new Date().getTime()}`},e.type="paragraph",U.onCreate(l.current.slug,{json:e,html:t},n=>{_e("spaces",`discussion-input-${l.current.slug}`,{json:"",html:""}),n&&n.data&&X(n.data),m.onSave&&m.onSave()},n=>{})},He=e=>
1{M(!0),Y(B("spaces.presentations.discussion.reflectionHeader"));for(let t=0;t<o.length;t++)if(o[t].id==e){ue(e),N(o[t]);break}},ee=()=>{p.current,setTimeout(()=>{if(p.current){const e=p.current.scrollHeight+2e3;p.current.scrollTo({top:e,behavior:"instant"})}},500)},Ne=e=>{setTimeout(()=>{try{const n=document.getElementById(`msg_${e}`).offsetTop-p.current.offsetTop+p.current.scrollTop+80;p.current.scrollTo({top:n,behavior:"instant"})}catch{}},500)},Pe=e=>{const t=p.current;if(ge(),e.y+t.clientHeight>=t.scrollHeight){const n=setTimeout(()=>{k(I({show:!1})),T.current=!0},1e3);$.current.push(n)}else if(e.y==0){T.current=!1;const n=setTimeout(()=>{Ae()},300);$.current.push(n)}else T.current=!1},ge=()=>{for(let e=0;e<$.current.length;e++){const t=$.current[e];clearTimeout(t)}$.current=[]},Le=()=>{g.page=1,f.pod_message_id=null,f.reflection_id=null,F.current=0,q.current=!1,S.current=!1,R.current=!1,T.current=!1,J.current=!1,u.current=[],i.current=[],l.current={slug:null},De.current=null,K.current=null,ge(),A.current&&(clearTimeout(A.current),A.current=null),h.current.slug=null,h.current.state=null,w([]),N(null),ce(null),le(0),ve(null),V(null),M(!1),ie(!1),Y(B("space
1s.presentations.discussion.reflectionHeader"))},Ge=()=>`Conversation with ${j.name.replace(`${z.name}`,"").replace("and","").trim()}`;return m.loading?d.jsx(ct,{type:"discussion"}):d.jsxs(we,{styles:{content:b.drawerWrap,header:b.drawerHeader,body:b.drawerBody,closeButton:b.closeButton},classNames:{content:se,closeButton:re.closeButton},style:{"--direct-bg":a.background_color,"--direct-text":a.default_text_color,"--direct-primary-btn-bg":a.primary_button_background_color},opened:C,onClose:()=>H(!1),title:d.jsx(Te,{style:b.themeTextColor,fw:"bold",children:j&&j.name&&Ge()}),padding:"xl",size:700,zIndex:1e5,children:[d.jsx("style",{children:`
2        .${se} .ProseMirror a,
3        .${Se} .ProseMirror a { color: ${a.default_link_color} !important; }
4      `}),d.jsxs(Qe,{className:Se,style:b.spaceContainer,gap:0,children:[d.jsx(Xe,{id:"main-scroll-area",onScrollPositionChange:Pe,className:"content-scrollview",viewportRef:p,style:{height:"100%"},children:o&&o.length>0&&o[0].pod_slug==l.current.slug&&d.jsx(be,{style:{height:"100%",paddingBottom:"15px"},children:o.map((e,t)=>{var n;return d.jsx(We,{spaceId:l.current.slug,spaceVersion:"discussion",messageId:e.id,htmlId:`${e.type}_${e.id}`,messageCreatedAt:e.created_at,messageTitle:e.post?e.post.subject:null,messageContent:e.version=="new"?e.content:e.message_body,messageUnseenCount:e.unseen_count,shouldShowDivider:W!=null&&e.id>W&&(t===0||o[t-1].id<=W)&&((n=e.user)==null?void 0:n.id)!==z.id,tags:e.tags,reflections:e.reflections,user:e.user?e.user:{},onOpenReflections:He,version:e.version,canPin:!1,canTag:!1,canLike:e.user?e.user.can_like:!1,canReflect:_.allow_reflections,canEdit:e.user?e.user.can_edit:!1,canDelete:e.user?e.user.can_delete:!1,onUpdated:G,onDeleted:Z,type:"pod_message",tagging:Be,setTagging:le,isPinned:!1,text:e.text,isLiked:e.is_liked,likesCount:e.likes_count,flagged:e.flagged,reflectionsBatchData:ke,enableFileHandler:!0},`message_${e.id}`)})})}),_.allow_reflections&&d.jsx(we,{opened:ye,onClose:()=>{const e=v==null?void 0:v.id;M(!1),e&&G(e)},title:d.jsxs(Ze,{className:window.$showBackButtonModal?re.reflectionsTitleGroupBack:re.reflectionsTitleGroup,onClick:e=>window.$showBackButtonModal?M(!1):null,children:[window.$showBackButtonModal&&d.jsx(st,{size:"md",icon:qe.faArrowLeft}),d.jsx(Te,{children:window.$showBackButtonModal?B("spaces.presentations.discussion.backToPost"):B("spaces.presentations.discussion.reflectionHeader")})]}),padding:"xl",size:600,classNames:{content:se},styles:{content:b.drawerWrap,header:b.drawerHeader,body:b.drawerBody},children:d.jsx(Ve,{spaceId:l.current.slug,spaceVersion:"discussion",canReflect:!0,message:v,onUpdatedMessage:G,onDestroyedMessage:e=>{M(!1),Z(e)},useReflectCallback:!0,tagging:Ie,setTagging:ie,canTag:!1,enableFileHandler:!0})}),d.jsx(be,{children:d.jsx(Je,{editable:!0,canMention:!0,onSave:Fe,modals:!0,contextDb:`discussion-input-${l.current.slug}`,enableFileHandler:!0,uploadSpace:j||{slug:l.current.slug},uploadSpaceSlug:l.current.slug})})]})]})}export{Zt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.