PageSourceSearch

https://smartguys.ai/_next/static/chunks/8733-03d1fe1f70028c26.js

js smartguys.ai collected 2026-10-05 15:08:23 UTC 7,789 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8733],{21165:(e,t,n)=>{n.d(t,{A:()=>w});var o=n(12267),i=n(41073),s=n(63177),c=n(55628),a=n(52614),r=n(99026),l=n(1031),d=n(97941),h=n(91684),u=n.n(h),g=n(67057),m=function(e){return e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED",e}(m||{}),v=function(e){return e.SUCCESS="SUCCESS",e.WARNING="WARNING",e.ERROR="ERROR",e}(v||{});let C=u()((e,t)=>{if(!t.includes("/notifications/ws-notification"))switch(e){case"SUCCESS":l.o.success(t);break;case"WARNING":l.o.warning(t);break;case"ERROR":l.o.error(t)}},0),f=e=>{let t="".concat("/api/v1").concat(e),n=d.S.get(),o=(0,r.UK)(),i=new URL(t,"localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname?g.env.PUBLIC_API_URL:window.location.origin);return n&&i.searchParams.set("token","Bearer ".concat(encodeURIComponent(n))),o&&i.searchParams.set("language",o),i.toString()},p=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;await new Promise(t=>setTimeout(t,1e3*e))};class y{static getInstance(){return y.instance||(y.instance=new y),y.instance}async createConnection(e){let{key:t=(0,s.Oq)(),endpoint:n,handleMessage:c,restoreData:a,initialReconnectCount:r=0,intialIsReconnecting:d=!1}=e,h=this.connections.get(t);if("".concat(n,"-").concat(t),h&&h.socket.readyState!==WebSocket.CLOSED)return h.socket;let u=new WebSocket(f(n)),g=t;i.zv.includes(t)&&(g="".concat(t,"-").concat(Math.random().toString(36).substring(2,15))),this.connections.set(t,{socket:u,endpoint:n,handleMessage:c,isReconnecting:d,reconnectCount:r}),this.newChatSessionItems.push({key:g,sessionId:""});let m=()=>{u.removeEventListener("message",v),u.removeEventListener("open",C),u.removeEventListener("close",y),u.removeEventListener("error",w)},v=e=>{var n,i;let a=(0,s.Gl)(e.data,{}),r=this.getUsedKey(t,g);if((null==a?void 0:a.type)==="pong"){this.handlePong({key:t,onlyKey:g});return}if("session_conflict"===a.type){let e=(null===(n=a.content)||void 0===n?void 0:n.message)||"此对话正在其他标签页中使用,请选择其他操作";l.o.warning(e);return}if("max_connections_exceeded"===a.type){let e=(null===(i=a.content)||void 0===i?void 0:i.message)||"当前账户已达到最大连接数限制,请关闭其他标签页后重试";l.o.warning(e);return}if("task_status_changed"===a.type)try{{let e=a.content||{};window.dispatchEvent(new CustomEvent("goagent-task-status-changed",{detail:e}))}}catch(e){}c(a,r);let{agentState:d,updateAgentState:h}=o.Lo.getState();a.content.connection_id&&a.content.connection_id!==d.connectionId&&h({connectionId:a.content.connection_id})},C=()=>{this.startHeartbeat({key:t,onlyKey:g,callback:m,restoreData:a})},y=()=>{this.reconnect({key:t,onlyKey:g,callback:m,restoreData:a})},w=e=>{};return u.addEventListener("message",v),u.addEventListener("open",C),u.addEventListener("close",y),u.addEventListener("error",w),new Promise((e,o)=>{let i=()=>{u.removeEventListener("open",s),u.removeEventListener("error",c)},s=async()=>{i(),await p(1),e(u)},c=e=>{i(),o(Error("WebSocket connection error for ".concat(n,"-").concat(t)))};u.addEventListener("open",s),u.addEventListener("error",c)})}getConnection(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.Oq)();return null===(e=this.connections.get(t))||void 0===e?void 0:e.socket}isConnected(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.Oq)();return(null===(e=this.connections.get(t))||void 0===e?void 0:e.socket.readyState)===1}getConnections(){return this.connections}getUsedKey(e,t){var n;return(null===(n=this.newChatSessionItems.find(e=>e.key===t))||void 0===n?void 0:n.sessionId)||e}async sendMessage(e){let{key:t=(0,s.Oq)(),message:n}=e,o=this.connections.get(t),i=null==o?void 0:o.socket.readyState;if(!o||3===i)return C("WARNING",(0,c.t)(a.g["网络连接异常,请尝试刷新页面"])),!1;if(0===i&&await p(2),1===i)try{o.socket.send(JSON.stringify(n)),await p(1)}catch(e){}}changeCollectionKey(e){let{oldKey:t,newKey:n}=e;if(this.connections.has(t)){let e=this.connections.get(t);this.connections.set(n,e),this.connections.delete(t);let o=this.newChatSessionItems.findLastIndex(e=>e.key.includes(t));-1!==o&&(this.newChatSessionItems[o].sessionId=n)}}closeConnection(e){let{key:t,onlyKey:n}=e,o=this.getUsedKey(t,n);if(this.connections.get(o)){var i;null===(i=this.connections.get(o))||void 0===i||i.socket.close(),this.stopHeartbeat({key:t,onlyKey:n}),this.connections.delete(o)}}getConnectionCount(){return this.connections.size}startHeartbeat(e){let{key:t,onlyKey:n,callback:o,restoreData:i}=e,s=this.getUsedKey(t,n),c=this.connections.get(s);c&&(this.stopHeartbeat({key:t,onlyKey:n}),"".concat(c.endpoint,"-").concat(t),c.heartbeatTimer=setInterval(()=>{if(1===(null==c?void 0:c.socket.readyState))try{c.socket.send(JSON.stringify({type:"ping"})),c.pongTimeoutTimer=setTimeout(()=>{this.reconnect({key:t,onlyKey:n,callback:o,restoreData:i})},12e4)}catch(e){}},5e3))}stopHeartbeat(e){let{key:t,onlyKey:n}=e,o=this.getUsedKey(t,n),i=this.connections.get(o);i&&(i.heartbeatTimer&&(clearInterval(i.heartbeatTimer),i.heartbeatTimer=void 0),i.pongTimeoutTimer&&(clearTimeout(i.pongTimeoutTimer),i.pongTimeoutTimer=void 0))}handlePong(e){let{key:t,onlyKey:n}=e,o=this.getUsedKey(t,n),i=this.connections.get(o);i&&i.pongTimeoutTimer&&(clearTimeout(i.pongTimeoutTimer),i.pongTimeoutTimer=void 0)}async reconnect(e){let{key:t,onlyKey:n,callback:o,restoreData:i}=e,s=this.getUsedKey(t,n),r=this.connections.get(s);if(!r)return;let{endpoint:l,handleMessage:d}=r;if(r.isReconnecting)return;let h=(r.reconnectCount||0)+1;if(h>10){"".concat(r.endpoint,"-").concat(s),C("ERROR",(0,c.t)(a.g["WebSocket连接失败,已重试{{count}}次,请刷新页面重试"],{count:10})),this.closeConnection({key:t,onlyKey:n}),"function"==typeof o&&o();return}let u="".concat(r.endpoint,"-").concat(s);r.isReconnecting=!0;let g=Math.min(Math.max(2e3*2**(h-1),5e3),3e4),m=.2*g*(2*Math.random()-1),v=Math.max(2e3,Math.min(3e4,Math.round(g+m)));await p(v/1e3),C("WARNING",(0,c.t)(a.g["端点 {{socketName}} 开始第 {{currentCount}}/{{maxCount}} 次重连,等待 {{seconds}} 秒..."],{socketName:u,currentCount:h,maxCount:10,seconds:Math.ceil(v/1e3)})),this.closeConnection({key:t,onlyKey:n}),"function"==typeof o&&o();try{await this.createConnection({key:s,endpoint:l,handleMessage:d,restoreData:i,initialReconnectCount:h,intialIsReconnecting:!0});let e=this.connections.get(s);if(e){let t=(0,c.t)(a.g["端点 {{socketName}} 已恢复连接"],{socketName:u});C("SUCCESS",t),e.reconnectCount=0,e.isReconnecting=!1,"function"==typeof i&&i(s,!0)}}catch(e){}finally{let e=this.connections.get(s);e&&(e.isReconnecting=!1)}}constructor(){this.connections=new Map,this.newChatSessionItems=[]}}let w=y},81585:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(98887),i=n(2819),s=n(12267),c=n(25012),a=n(1031),r=n(49711),l=n(52614),d=n(8080);function h(){let e=(0,r.useRef)(null),{t}=(0,d.o)(),{weChatAuthUrl:n,isWeChatModalOpen:h,setIsWeChatModalOpen:u}=(0,s.Y_)([s.pB.weChatAuthUrl,s.pB.isWeChatModalOpen,s.pB.setIsWeChatModalOpen]),g=()=>{e.current&&clearInterval(e.current)};(0,r.useEffect)(()=>(h&&(e.current=setInterval(()=>{m()},2e3)),()=>{e.current&&g()}),[h]);let m=async()=>{(await (0,c.P1)()).auth_status===c.FJ.SUCCESS&&(a.o.success(t(l.g["微信公众号已授权成功!"])),u(!1))};return(0,o.jsx)(i.A,{open:h,onCancel:()=>{u(!1),e.current&&g()},maskClosable:!1,destroyOnHidden:!0,footer:null,centered:!0,width:"90vw",style:{height:"90vh",maxWidth:"90vw"},styles:{container:{height:"100%",padding:0},body:{height:"100%",padding:0}},classNames:{container:"h-full w-full",body:"h-full w-full"},children:(0,o.jsx)("iframe",{src:n,className:"block h-full w-full border-0"})})}}}]);

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.