PageSourceSearch

https://long-chat-gpt-next-web.vercel.app/_next/static/chunks/6303.d1ee3db8f15c442e.js

js long-chat-gpt-next-web.vercel.app collected 2026-10-03 07:16:34 UTC 8,450 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6303],{2901:function(e,t,r){"use strict";r.r(t),r.d(t,{Artifacts:function(){return S},ArtifactsShareButton:function(){return b},HTMLPreview:function(){return C}});var n=r(57437),o=r(2265),s=r(59208),a=r(35499),i=r(84065),c=r(12637),l=r(84193),u=r(72495),d=r(59566),f=r(49111),h=r(98829),x=r(13894),m=r(65878),g=r(92944),v=r(75591),p=r(77120),j=r(99164),w=r.n(j);let C=(0,o.forwardRef)(function(e,t){let r=(0,o.useRef)(null),[s,a]=(0,o.useState)((0,i.x0)()),[c,l]=(0,o.useState)(600),[u,d]=(0,o.useState)("");(0,o.useEffect)(()=>{let e=e=>{let{id:t,height:r,title:n}=e.data;d(n),t==s&&l(r)};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[s]),(0,o.useImperativeHandle)(t,()=>({reload:()=>{a((0,i.x0)())}}));let f=(0,o.useMemo)(()=>{if(!e.autoHeight)return e.height||600;if("string"==typeof e.height)return e.height;let t=e.height||600;return c+40>t?t:c+40},[e.autoHeight,e.height,c]),h=(0,o.useMemo)(()=>{let t='<script>window.addEventListener("DOMContentLoaded", () => new ResizeObserver((entries) => parent.postMessage({id: \''.concat(s,"', height: entries[0].target.clientHeight}, '*')).observe(document.body))</script>");return e.code.includes("<!DOCTYPE html>")&&e.code.replace("<!DOCTYPE html>","<!DOCTYPE html>"+t),t+e.code},[e.code,s]);return(0,n.jsx)("iframe",{className:w()["artifacts-iframe"],ref:r,sandbox:"allow-forms allow-modals allow-scripts",style:{height:f},srcDoc:h,onLoad:()=>{(null==e?void 0:e.onLoad)&&e.onLoad(u)}},s)});function b(e){let{getCode:t,id:r,style:s,fileName:i}=e,[d,h]=(0,o.useState)(!1),[p,j]=(0,o.useState)(r),[w,C]=(0,o.useState)(!1),b=(0,o.useMemo)(()=>[location.origin,"#",v.y$.Artifacts,"/",p].join(""),[p]),S=e=>r?Promise.resolve({id:r}):fetch(v.L.Artifacts,{method:"POST",body:e}).then(e=>e.json()).then(e=>{let{id:t}=e;if(t)return{id:t};throw Error()}).catch(e=>{(0,m.CF)(x.ZP.Export.Artifacts.Error)});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"window-action-button",style:s,children:(0,n.jsx)(a.h,{icon:d?(0,n.jsx)(f.Z,{}):(0,n.jsx)(c.Z,{}),bordered:!0,title:x.ZP.Export.Artifacts.Title,onClick:()=>{d||(h(!0),S(t()).then(e=>{(null==e?void 0:e.id)&&(C(!0),j(null==e?void 0:e.id))}).finally(()=>h(!1)))}})}),w&&(0,n.jsx)("div",{className:"modal-mask",children:(0,n.jsx)(m.u_,{title:x.ZP.Export.Artifacts.Title,onClose:()=>C(!1),actions:[(0,n.jsx)(a.h,{icon:(0,n.jsx)(u.Z,{}),bordered:!0,text:x.ZP.Export.Download,onClick:()=>{(0,g.CP)(t(),"".concat(i||p,".html")).then(()=>C(!1))}},"download"),(0,n.jsx)(a.h,{icon:(0,n.jsx)(l.Z,{}),bordered:!0,text:x.ZP.Chat.Actions.Copy,onClick:()=>{(0,g.vQ)(b).then(()=>C(!1))}},"copy")],children:(0,n.jsx)("div",{children:(0,n.jsx)("a",{target:"_blank",href:b,children:b})})})})]})}function S(){let{id:e}=(0,s.UO)(),[t,r]=(0,o.useState)(""),[i,c]=(0,o.useState)(!0),[l,u]=(0,o.useState)(""),f=(0,o.useRef)(null);return(0,o.useEffect)(()=>{e&&fetch("".concat(v.L.Artifacts,"?id=").concat(e)).then(e=>{if(e.status>300)throw Error("can not get content");return e}).then(e=>e.text()).then(r).catch(e=>{(0,m.CF)(x.ZP.Export.Artifacts.Error)})},[e]),(0,n.jsxs)("div",{className:w().artifacts,children:[(0,n.jsxs)("div",{className:w()["artifacts-header"],children:[(0,n.jsx)("a",{href:v.Bv,target:"_blank",rel:"noopener noreferrer",children:(0,n.jsx)(a.h,{bordered:!0,icon:(0,n.jsx)(d.Z,{}),shadow:!0})}),(0,n.jsx)(a.h,{bordered:!0,style:{marginLeft:20},icon:(0,n.jsx)(h.Z,{}),shadow:!0,onClick:()=>{var e;return null===(e=f.current)||void 0===e?void 0:e.reload()}}),(0,n.jsx)("div",{className:w()["artifacts-title"],children:"NextChat Artifacts"}),(0,n.jsx)(b,{id:e,getCode:()=>t,fileName:l})]}),(0,n.jsxs)("div",{className:w()["artifacts-content"],children:[i&&(0,n.jsx)(p.Loading,{}),t&&(0,n.jsx)(C,{code:t,ref:f,autoHeight:!1,height:"100%",onLoad:e=>{u(e),c(!1)}})]})]})}},42896:function(e,t,r){"use strict";r.r(t),r.d(t,{Markdown:function(){return E},MarkdownContent:function(){return y},Mermaid:function(){return C},PreCode:function(){return b}});var n=r(57437),o=r(28993);r(68128);var s=r(28105),a=r(32794),i=r(69418),c=r(11303),l=r(49264),u=r(2265),d=r(92944),f=r(51893),h=r(13894),x=r(24053),m=r(98829),g=r(38648),v=r(65878),p=r(2901),j=r(44922),w=r(35499);function C(e){let t=(0,u.useRef)(null),[r,o]=(0,u.useState)(!1);return((0,u.useEffect)(()=>{e.code&&t.current&&f.L.run({nodes:[t.current],suppressErrors:!0}).catch(e=>{o(!0),console.error("[Mermaid] ",e.message)})},[e.code]),r)?null:(0,n.jsx)("div",{className:"no-dark mermaid",style:{cursor:"pointer",overflow:"auto"},ref:t,onClick:()=>(function(){var e;let r=null===(e=t.current)||void 0===e?void 0:e.querySelector("svg");if(!r)return;let n=new XMLSerializer().serializeToString(r),o=new Blob([n],{type:"image/svg+xml"});(0,v.vi)(URL.createObjectURL(o))})(),children:e.code})}function b(e){var t;let r=(0,u.useRef)(null),o=(0,u.useRef)(null),[s,a]=(0,u.useState)(""),[i,c]=(0,u.useState)(""),{height:l}=(0,d.iP)(),f=(0,j.aK)().currentSession(),h=(0,g.y1)(()=>{var e;if(!r.current)return;let t=r.current.querySelector("code.language-mermaid");t&&a(t.innerText);let n=r.current.querySelector("code.language-html"),o=null===(e=r.current.querySelector("code"))||void 0===e?void 0:e.innerText;n?c(n.innerText):(null==o?void 0:o.startsWith("<!DOCTYPE"))&&c(o)},600),x=(null===(t=f.mask)||void 0===t?void 0:t.enableArtifacts)!==!1;return(0,u.useEffect)(()=>
1{if(r.current){let e=r.current.querySelectorAll("code"),t=["","md","markdown","text","txt","plaintext","tex","latex"];e.forEach(e=>{let r=e.className.match(/language-(\w+)/),n=r?r[1]:"";t.includes(n)&&(e.style.whiteSpace="pre-wrap")}),setTimeout(h,1)}},[]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("pre",{ref:r,children:[(0,n.jsx)("span",{className:"copy-code-button",onClick:()=>{if(r.current){let e=r.current.innerText;(0,d.vQ)(e)}}}),e.children]}),s.length>0&&(0,n.jsx)(C,{code:s},s),i.length>0&&x&&(0,n.jsxs)(v.IT,{className:"no-dark html",right:70,children:[(0,n.jsx)(p.ArtifactsShareButton,{style:{position:"absolute",right:20,top:10},getCode:()=>i}),(0,n.jsx)(w.h,{style:{position:"absolute",right:120,top:10},bordered:!0,icon:(0,n.jsx)(m.Z,{}),shadow:!0,onClick:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.reload()}}),(0,n.jsx)(p.HTMLPreview,{ref:o,code:i,autoHeight:!document.fullscreenElement,height:document.fullscreenElement?l:600})]})]})}function S(e){let t=(0,u.useRef)(null),[r,o]=(0,u.useState)(!0),[s,a]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{t.current&&(a(t.current.scrollHeight>400),t.current.scrollTop=t.current.scrollHeight)},[e.children]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("code",{className:null==e?void 0:e.className,ref:t,style:{maxHeight:r?"400px":"none",overflowY:"hidden"},children:e.children}),s&&r&&(0,n.jsx)("div",{className:"show-hide-button ".concat(r?"collapsed":"expanded"),children:(0,n.jsx)("button",{onClick:()=>{o(e=>!e)},children:h.ZP.NewChat.More})})]})}let y=u.memo(function(e){let t=(0,u.useMemo)(()=>(function(e){let t="";for(let r=0;r<e.length;r+=1){let n=e[r],o=e[r+1]||" ";"$"===n&&o>="0"&&o<="9"&&(n="\\$"),t+=n}return t})(e.content).replace(/(```[\s\S]*?```|`.*?`)|\\\[([\s\S]*?[^\\])\\\]|\\\((.*?)\\\)/g,(e,t,r,n)=>t||(r?"$$".concat(r,"$$"):n?"$".concat(n,"$"):e)).replace(/([`]*?)(\w*?)([\n\r]*?)(<!DOCTYPE html>)/g,(e,t,r,n,o)=>t?e:"\n```html\n"+o).replace(/(<\/body>)([\r\n\s]*?)(<\/html>)([\n\r]*?)([`]*?)([\n\r]*?)/g,(e,t,r,n,o,s)=>s?e:t+r+n+"\n```\n"),[e.content]);return(0,n.jsx)(o.D,{remarkPlugins:[s.Z,c.Z,a.Z],rehypePlugins:[i.Z,[l.Z,{detect:!1,ignoreMissing:!0}]],components:{pre:b,code:S,p:e=>(0,n.jsx)("p",{...e,dir:"auto"}),a:e=>{var t;let r=e.href||"",o=/^\/#/i.test(r)?"_self":null!==(t=e.target)&&void 0!==t?t:"_blank";return(0,n.jsx)("a",{...e,target:o})}},children:t})});function E(e){var t;let r=(0,u.useRef)(null);return(0,n.jsx)("div",{className:"markdown-body",style:{fontSize:"".concat(null!==(t=e.fontSize)&&void 0!==t?t:14,"px"),fontFamily:e.fontFamily||"inherit"},ref:r,onContextMenu:e.onContextMenu,onDoubleClickCapture:e.onDoubleClickCapture,dir:"auto",children:e.loading?(0,n.jsx)(x.Z,{}):(0,n.jsx)(y,{content:e.content})})}},99164:function(e){e.exports={artifacts:"artifacts_artifacts__J06vB","artifacts-header":"artifacts_artifacts-header__s7Cdi","artifacts-title":"artifacts_artifacts-title__UXZs9","artifacts-content":"artifacts_artifacts-content__3pFba","artifacts-iframe":"artifacts_artifacts-iframe__mjsdx"}}}]);

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.