PageSourceSearch

https://www.strawman.com/web/dist/assets/ForumNewThread-DdCT5cY5.js

js strawman.com collected 2026-10-03 21:46:32 UTC 4,108 bytes, 2 lines download raw bytes

1import{r as m,j as e}from"./motion-s_jJ0Hey.js";import{k as L,m as N,f as P,A as q,a as w,d as k,S as D,s as C,E as R,C as v,w as H,ak as _,az as O}from"./index-DtoF3ya7.js";import{H as W}from"./HeaderCard-C6Mw0ZS5.js";import{T as z}from"./Textarea-BiywXU4u.js";import{u as E,R as B,i as G}from"./strawContent-DdbSkGSc.js";import{u as Q,U as K}from"./userContentImages-CbH_tis8.js";import{n as V}from"./LegacyRichText-Yq5P6hki.js";import{C as J}from"./CompanyCombobox-C6aPBWbS.js";import{F as S}from"./FormGroup-0GfEh3G9.js";import{f as X,c as Y,r as Z,a as $,d as ee}from"./forumComposer-cVxME4i-.js";import"./tiptap-C8axTDK9.js";import"./chevron-left-CHpz0j9e.js";import"./forumQuoteNode-D5w0LYKz.js";import"./IconButton-oaggNZIY.js";import"./Input-BOqfBOMq.js";import"./OverlayPopover-hN1VIk16.js";import"./useClickOutside-C-hk9IRw.js";import"./appShellScroll-CszY3esE.js";import"./link-2-CMMIMxhd.js";import"./chevron-down-DVcnfxbG.js";import"./CompanySearchResult-BuQB7ADb.js";import"./Badge-C3bO1-ec.js";import"./ticker-C5SXhZuh.js";import"./command-D3LtgZlo.js";import"./search-QD-OsPsd.js";import"./useCompanyQuickSearch-DQpBlqij.js";import"./useQuery-D8gzRlnl.js";import"./useBaseQuery-B8b1xHF1.js";import"./useRecentSearches-CkU-qYZT.js";import"./input-BjZsvBte.js";function te(){const o=L(),t=N({mutationFn:a=>P("/forum/topics/create",a),onSuccess:async()=>{await o.invalidateQueries({queryKey:["forum-topics"]})}});return{submit:t.mutateAsync,isPending:t.isPending,error:t.error,errorMessage:re(t.error),reset:t.reset}}function re(o){return o?o instanceof q||o instanceof Error?o.message:"Failed to create thread":null}function oe({defaultForumId:o="",initialCompany:t="",initialCompanySelection:a=null}){const l=w(),s=te(),d=m.useId(),u=m.useId(),[c,b]=m.useState(a),[h,I]=m.useState("");m.useEffect(()=>{const r=t==null?void 0:t.trim();if(!r||c||a)return;let n=!1;return k("/members/quick-search",{q:r}).then(y=>{if(n)return;const p=y.companies??[],x=r.toLowerCase(),F=p.find(A=>A.symbol.toLowerCase()===x)??p[0]??null;F&&b(F)}).catch(()=>{}),()=>{n=!0}},[t,c,a]);const[f,M]=m.useState(""),[i,T]=m.useState(null),j=E("inline"),g=E("attachment");async function U(r){r.preventDefault();const n=X(c,t,o),y=Y(c,t),p=G(f,(i==null?void 0:i.filename)??null)?"":V(f);try{const x=await s.submit({forumId:n,companySymbol:y,topicTitle:h.trim(),topicDescription:p,attachment:(i==null?void 0:i.filename)??null});l(x.topic.url)}catch{}}return e.jsx(D,{variant:"glass",style:H({padding:C[6]}),children:e.jsxs("form",{onSubmit:U,style:{display:"flex",flexDirection:"column",gap:C[4]},children:[e.jsx(S,{label:"Company (optional)",htmlFor:"forum-company",children:e.jsx(J,{value:c,onChange:b})}),e.jsx(S,{label:"Thread title",htmlFor:d,required:!0,children:e.jsx(z,{id:d,value:h,onChange:r=>I(r.target.value),placeholder:"What's this thread about?",rows:2,required:!0,maxLength:200})}),e.jsx(S,{label:"Opening update",htmlFor:u,children:e.jsx(B,{id:u,value:f,onChange:M,placeholder:"Write your opening update… Type @ to mention a member",disabled:s.isPending,editorShellClassName:K,editorShellStyle:Q,onImageUpload:async r=>(await j.upload(r)).url,imageUploadError:j.errorMessage,attachment:i,onAttachmentChange:r=>{T(r),r||g.reset()},onAttachmentUpload:async r=>{const n=await g.upload(r);return T(n),n},attachmentUploadError:g.errorMessage})}),s.errorMessage?e.jsx(R,{message:s.errorMessage}):null,e.jsxs("div",{style:{display:"flex",gap:C[2],justifyContent:"flex-end"},children:[e.jsx(v,{type:"button",variant:"ghostLight",onClick:()=>l(-1),children:"Cancel"}),e.jsx(v,{type:"submit",variant:"primary",disabled:s.isPending||h.trim()==="",children:s.isPending?"Creating…":"Create thread"})]})]})})}function Pe(){const o=_(),t=w(),[a]=O(),l=Z(a,o.state),s=$(o.state),u=ee(a,o.state)??"/forums";return e.jsxs("section",{className:"space-y-4",children:[e.jsx(W,{title:"Start a new Forum Thread",description:"Share an update or question with the community.",onBack:()=>t(u)}),e.jsx(oe,{initialCompany:l,initialCompanySelection:s})]})}export{Pe as default};
2//# sourceMappingURL=ForumNewThread-DdCT5cY5.js.map

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.