1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7299],{33488:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/forum/[repoId]/[repoOwner]/[repoName]/post/edit",function(){return r(62895)}])},20683:function(e,t,r){"use strict";var o,i,a,s;r.d(t,{H:function(){return o},f:function(){return i}}),(a=o||(o={})).Explain="explain",a.VisualEdit="visualEdit",(s=i||(i={})).DiagramSvg="svg",s.Rectangles="svg > rect",s.Nodes="svg g.node",s.NodeRectangles="svg g.node rect",s.NodePolygons="svg g.node polygon",s.NodeCircles="svg g.node circle",s.NodePaths="svg g.node path",s.EdgeLabels="svg g.edgeLabel",s.Markers="svg marker path",s.ClusterRectangles="svg g.cluster rect",s.ActorRectangles="svg g rect.actor",s.ActorTopRectangles="svg g rect.actor-top",s.ActorTopPeople="svg g.actor-man.actor-top",s.DraggingSources="svg .draggingSource",s.DraggingDestinations="svg .draggingDestination",s.ParticipantLines="svg g:not(.actor-man) line:not(.messageLine0)",s.ActorLines="svg > line:not(.messageLine0)",s.MessageText="svg text.messageText",s.ConnectionDraggingSources="svg .connectionDraggingSource",s.ConnectionDraggingDestinations="svg .connectionDraggingSource",s.EdgeLabelText="svg g.edgeLabel span.edgeLabel",s.EdgePaths="svg g.edgePaths path",s.NodeLabelText="svg g.label span.nodeLabel"},58718:function(e,t,r){"use strict";var o=r(24246),i=r(35928),a=r(39202),s=r(96917),n=r(24134),d=r.n(n);t.Z=e=>{let{href:t}=e,r=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.x_l,{})," Back"]});return"string"==typeof t?(0,o.jsx)(s.Z,{href:t,unstyled:!0,className:d().goBack,children:r}):(0,o.jsx)(a.Z,{variant:"plain",onClick:t,className:d().goBackButton,children:r})}},62895:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return K}});var o,i,a=r(24246),s=r(60234),n=r(25310),d=r(38944),l=r(86677),c=r(94108),u=r(76825),m=r(49423),g=r(90892),x=r(42099),_=r(58718),p=r(99929),h=r(93634),E=r(79333),v=r.n(E),f=r(33565),j=r(18690),b=r(88082),Z=r(7417),y=r(27378),F=r(39202),B=r(78108),T=r(75724),N=r(95227),S=r(49645),P=r(98505),I=r(53515),D=r(74907),A=r(2990),C=r(68301),k=r(57088),L=r(18798);r(20683);var R=r(73206),H=r.n(R);(o=i||(i={})).EDIT="EDIT",o.PREVIEW="PREVIEW";var w=r(69322),J=e=>{let{value:t,setValue:r}=e,o=(0,k.Ik)(),[s,l]=(0,y.useState)(i.EDIT);(0,y.useEffect)(()=>{o&&o.editor.defineTheme("myCustomTheme",{base:"vs-dark",inherit:!0,rules:[{token:"comment",foreground:"ffa500",fontStyle:"italic underline"},{token:"keyword",foreground:"569CD6"}],colors:{"editor.foreground":"#FFFFFF","editor.background":"#171A24","editorCursor.foreground":"#D0D0D0"}})},[o]);let c=()=>
1{l(s===i.EDIT?i.PREVIEW:i.EDIT)};return(0,a.jsxs)(n.Z,{className:H().diagramEditorWrapper,children:[(0,a.jsxs)(n.Z,{className:H().diagramEditorHeader,children:[(0,a.jsx)(n.Z,{className:(0,d.Z)(H().diagramEditorHeaderButton,s===i.EDIT&&H().diagramEditorHeaderButtonActive),onClick:c,children:"Edit"}),(0,a.jsx)(n.Z,{className:(0,d.Z)(H().diagramEditorHeaderButton,s===i.PREVIEW&&H().diagramEditorHeaderButtonActive),onClick:c,children:"Preview"})]}),(0,a.jsxs)(n.Z,{className:H().diagramEditor,children:[(0,a.jsx)(u.Z,{condition:s===i.EDIT,children:(0,a.jsx)(k.ZP,{height:"100%",defaultLanguage:"mermaid",value:t||"",onChange:e=>r(e||""),options:{minimap:{enabled:!1},fontWeight:"600",fontSize:14,fontFamily:"'Courier New', monospace !important",overviewRulerLanes:0,quickSuggestions:!1},onMount:(e,t)=>{t.editor.setTheme("myCustomTheme"),(0,L.Z)(t)}})}),(0,a.jsx)(u.Z,{condition:s===i.PREVIEW,children:(0,a.jsx)(w.Z,{mermaidDefinition:t})})]})]})},V=r(84694),M=r.n(V);let O={[I.J.QUESTION]:"Ask a question",[I.J.ARTICLE]:"Post an article",[I.J.DIAGRAM]:"Post a diagram"},W={[I.J.QUESTION]:"Submit a question to your team. Adrenaline AI will suggest an answer, and your team members can also suggest and discuss answers.",[I.J.ARTICLE]:"An article is like a page of documentation. Use these to share your knowledge with the team.",[I.J.DIAGRAM]:"Use diagrams to visualize your ideas and share them with your team."};var q=()=>{let{selectedRepo:e,teamId:t}=(0,D.o)(e=>{var t;return{selectedRepo:e.repository.selectedRepo,teamId:null===(t=e.teamsMetadata.team)||void 0===t?void 0:t.id}}),r=(0,l.useRouter)(),{repoId:o,repoOwner:i,repoName:s}=r.query,[c,m]=(0,y.useState)(I.J.QUESTION),g=(0,Z.TA)({initialValues:{title:"",body:""},validationSchema:C.Ry({title:C.Z_().trim().required("Title is required"),body:C.Z_().trim().test("syntax-valid","Mermaid syntax is invali
1d",async e=>c!==I.J.DIAGRAM||!e||(await (0,B.L)(e)).canRender).required("Body is required")}).required(),onSubmit:async(a,n)=>{if(!(null==e?void 0:e.id)||!t)return;let{title:d,body:l}=a,{post_id:u}=await (0,P.qb)({title:d,content:l,repository_id:e.id,post_type:c,team_id:t});localStorage.removeItem("post"),n.resetForm(),o&&i&&s&&r.push(N.Z6.FORUM_POST(+o,i,s,u))}});(0,y.useEffect)(()=>{let e=JSON.parse(localStorage.getItem("post")||"{}");c===e.post_type&&(e.title&&g.setValues(t=>({...t,title:e.title})),e.content&&g.setValues(t=>({...t,body:e.content})))},[c]),(0,y.useEffect)(()=>{let e=JSON.parse(localStorage.getItem("post")||"{}");e.post_type&&m(e.post_type)},[]);let x=c===I.J.QUESTION&&(null==e?void 0:e.job_status)===S.v.FAILED,_=g.isValid&&g.dirty&&!g.isSubmitting&&!x;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(n.Z,{className:M().headlineBox,children:[(0,a.jsxs)(n.Z,{children:[(0,a.jsx)("span",{className:M().headlineText,children:O[c]}),(0,a.jsx)(n.Z,{className:M().descriptionBox,children:(0,a.jsx)("span",{children:W[c]})})]}),(0,a.jsx)(A.Z,{activeFilter:c,setFilter:e=>{let t=e===I.J.DIAGRAM?"%% Write your MermaidJS code here":"";g.setValues(e=>({...e,body:t})),m(e)},filters:Array.from(Object.values(I.J))})]}),(0,a.jsxs)(n.Z,{className:(0,d.Z)(M().postForm,g.isSubmitting&&M().disabled),children:[(0,a.jsxs)(n.Z,{className:M().inputBox,children:[(0,a.jsx)("span",{className:M().inputLabel,children:"Add a title"}),(0,a.jsx)(f.Z,{placeholder:"Title",minRows:1,className:(0,d.Z)(M().inputBoxTextarea,M().inputBoxTextareaTitle),value:g.values.title,onChange:e=>g.setFieldValue("title",e.target.value),autoFocus:!0})]}),(0,a.jsx)(u.Z,{condition:c===I.J.QUESTION,children:(0,a.jsxs)(n.Z,{className:M().inputBox,children:[(0,a.jsx)("span",{className:M().inputLabel,children:"Add a body"}),(0,a.jsx)(T.Z,{value:g.values.body,setValue:e=>g.setFieldValue("body",e),placeholder:"Add your body here..."})]})}),(0,a.jsx)(u.Z,{condition:c===I.J.ARTICLE,children:(0,a.jsxs)(n.Z,{className:M().inputBox,children:[(0,a.jsx)("span",{className:M().inputLabel,children:"Add a body"}),(0,a.jsx)(T.Z,{value:g.values.body,setValue:e=>g.setFieldValue("body",e),placeholder:"Add your body here..."})]})}),(0,a.jsx)(u.Z,{condition:c===I.J.DIAGRAM,children:(0,a.jsxs)(n.Z,{className:M().inputBox,children:[(0,a.jsx)("span",{className:M().inputLabel,children:"Edit your diagram"}),(0,a.jsx)(J,{value:g.values.body,setValue:e=>{g.setValues(t=>({...t,body:e}))}})]})}),g.dirty&&g.errors.body&&(0,a.jsx)("span",{children:g.errors.body}),(0,a.jsx)(n.Z,{className:M().submitBox,children:(0,a.jsx)(j.Z,{arrow:!0,title:x?"Failed to index the repository. Try to reindex it before creating a post.":"",children:(0,a.jsx)(n.Z,{children:(0,a.jsxs)(F.Z,{type:"submit",disabled:!_,onClick:g.submitForm,children:[g.isSubmitting&&(0,a.jsx)(b.Z,{size:16,sx:{color:"#DBE2F0"}})," ","Submit post"]})})})})]})]})},U=()=>{let e=(0,l.useRouter)(),{isMobile:t}=(0,m.Z)();return(0,h.Z)()?(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(n.Z,{className:(0,d.Z)(v().container,t&&v().containerMobile),children:(0,a.jsx)(n.Z,{className:v().forum,children:(0,a.jsxs)(c.Z,{container:!0,spacing:2,children:[(0,a.jsx)(c.Z,{xs:12,md:8,lg:8.65,item:!0,children:(0,a.jsxs)(n.Z,{className:v().forumContent,children:[(0,a.jsx)(_.Z,{href:()=>e.back()}),(0,a.jsx)(x.Z,{}),(0,a.jsx)(q,{})]})}),(0,a.jsx)(u.Z,{condition:!t,children:(0,a.jsx)(c.Z,{md:4,lg:3.35,item:!0,children:(0,a.jsxs)(n.Z,{className:v().forumSidebar,children:[(0,a.jsx)(g.Z,{}),(0,a.jsx)(p.Z,{})]})})})]})})})}):null},Q=r(22542),G=r(49554),z=r(50891),K=()=>(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:(0,a.jsx)(z.ZP,{children:(0,a.jsx)(Q.Z,{children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.Z,{}),(0,a.jsx)(U,{}),(0,a.jsx)(G.Z,{})]})})})})},24134:function(e){e.exports={goBack:"GoBack_goBack__02oIq",goBackButton:"GoBack_goBackButton__zZLUc"}},79333:function(e){e.exports={container:"EditForumPostScreen_container__JIZQd",forum:"EditForumPostScreen_forum__BsRMd",forumContent:"EditForumPostScreen_forumContent__awK09",forumContentHeader:"EditForumPostScreen_forumContentHeader__H2WC_",forumContentHeaderTitle:"EditForumPostScreen_forumContentHeaderTitle___6sLm",forumContentHeaderFilters:"EditForumPostScreen_forumContentHeaderFilters__tmKFd",forumContentHeaderFiltersItem:"EditForumPostScreen_forumContentHeaderFiltersItem__FnRX8",forumContentHeaderFiltersItemActive:"EditForumPostScreen_forumContentHeaderFiltersItemActive__ZFE8e",forumSidebar:"EditForumPostScreen_forumSidebar__Q_Dt1",sidebarCardLabel:"EditForumPostScreen_sidebarCardLabel__oej00"}},73206:function(e){e.exports={diagramEditor:"DiagramEditor_diagramEditor__LjJj0",diagramEditorWrapper:"DiagramEditor_diagramEditorWrapper__9u0kM",diagramEditorHeader:"DiagramEditor_diagramEditorHeader__nWusB",diagramEditorHeaderButton:"DiagramEditor_diagramEditorHeaderButton__ok6Tl",diagramEditorHeaderButtonActive:"DiagramEditor_diagramEditorHeaderButtonActive__2xSus"}},84694:function(e){e.exports={headlineText:"PostForm_headlineText__ZptQu",headlineBo
1x:"PostForm_headlineBox__aI92p",postForm:"PostForm_postForm__YyMyU",inputBox:"PostForm_inputBox__zq68V",inputBoxTextarea:"PostForm_inputBoxTextarea__tXvQi",inputBoxTextareaTitle:"PostForm_inputBoxTextareaTitle__bDJsM",inputBoxTextareaBody:"PostForm_inputBoxTextareaBody__0g_eK",inputBoxWrapper:"PostForm_inputBoxWrapper__QEd0U",inputLabel:"PostForm_inputLabel__YcO_U",inputLabelRequired:"PostForm_inputLabelRequired__e2y7W",submitBox:"PostForm_submitBox__fOSBZ",descriptionBox:"PostForm_descriptionBox__K5svg",disabled:"PostForm_disabled__txigv"}}},function(e){e.O(0,[3485,6860,5800,7206,8342,1374,2812,73,805,8648,7643,4384,1344,7119,5555,4328,6217,8094,2888,9774,179],function(){return e(e.s=33488)}),_N_E=e.O()}]);
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.