PageSourceSearch

https://www.seabell.com/_nuxt/common.uFY9772s.js

js seabell.com collected 2026-09-24 14:19:29 UTC 2,348 bytes, 1 lines download raw bytes

1import{ak as t,an as e,aT as n,a7 as o,aj as s}from"./entry.BpcPXBfN.js";function r(t,e){const n=t.split("\n"),o=e?"":n.pop()||"";return{lines:n,nextBuffer:o}}function a(t){const e=t.trim();return e&&e.startsWith("data: ")?e.slice(6):null}function c(t){if("undefined"==typeof document)return null;const e=`; ${document.cookie}`.split(`; ${t}=`);if(2===e.length){const t=e.pop()?.split(";").shift();return t?decodeURIComponent(t):null}return null}function i(){const n=t(),o=c("token"),s={"Content-Type":"application/json","Accept-Language":c("SeabellLang")||"zh","X-App-Id":"com.seabell.web","X-Request-Id":e(),"X-Device-Id":n?.["X-Device-Id"]||""};return o&&(s.Token=o),s}function u(){if("function"==typeof globalThis.fetch)return globalThis.fetch.bind(globalThis);if("undefined"!=typeof window&&"function"==typeof window.fetch)return window.fetch.bind(window);throw new Error("Fetch is not available")}function d(t){if("[DONE]"===t)return"";try{const e=JSON.parse(t),n=e.data&&"object"==typeof e.data?e.data:{},o=e.delta&&"object"==typeof e.delta?e.delta:{},s=Array.isArray(e.choices)?e.choices[0]?.delta:void 0,r=[e.content,e.text,e.output,e.result,e.message,n.content,n.text,n.output,n.result,o.content,s?.content];return r.find(t=>"string"==typeof t&&t.length>0)||""}catch{return t}}async function f(t){const e=await u()(t.url,{method:"POST",headers:i(),body:JSON.stringify(t.body),signal:t.signal});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);await p(e);const n=e.body?.getReader();if(!n)throw new Error("Response body is null");const o=new TextDecoder;let s="",c=!0;for(;c;){const{done:e,value:i}=await n.read();i&&(s+=o.decode(i,{stream:!0}));const u=r(s,e);s=u.nextBuffer;for(const n of u.lines){const e=a(n);if(!e)continue;if("[DONE]"===e)return void t.onDone?.();const o=d(e);o&&t.onChunk(o)}e&&(c=!1)}t.onDone?.()}class l extends Error{code;constructor(t,e){super(t),this.name="BusinessError",this.code=e}}async function p(t){const e=t.headers.get("content-type")||"";if(e.includes("application/json")&&!e.includes("text/event-stream")){const e=await t.json(),r=e.status?.code??e.code,a=Number(r),c=e.status?.msg??e.msg;if(1e4!==a){const t=o(r)?n[s]:c||`Business error! code: ${r}`;throw new l(t,a)}throw new Error("Unexpected JSON response for stream request")}}export{l as B,r as a,i as b,p as c,a as d,u as g,f as r};

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.