PageSourceSearch

https://www.iprbookshop.ru/build/assets/AiAnswerMarkdown-CRQA8rQH.js

js iprbookshop.ru collected 2026-10-01 13:13:46 UTC 2,878 bytes, 1 lines download raw bytes

1import{r as l,j as e}from"./app-vjiAmbD7.js";import{p as f}from"./purify.es-CEVJ7K31.js";import{s as a}from"./aiAssistant.module-C8LuTZr5.js";import N from"./AnswerSources-DgDhr4cG.js";import g from"./CopyAnswerButton-CmsyTPBG.js";import{p as b,f as A}from"./answerFormat-D5bp3lCF.js";import{r as y,i as C,t as M,p as S}from"./bookReaderLink-BG4FF15l.js";import{reactNodeToPlainText as H}from"./curriculumPlanSources-CYXPkNrV.js";import P from"./StreamingInProgressNotice-fFkcxHU6.js";import{M as T,r as L}from"./index-DarM-PgB.js";import"./router-B3PhLOcU.js";function W({raw:n,onBookOpen:m,feedback:x,streaming:d=!1,streamingMessage:w}){const p=l.useMemo(()=>{if(typeof n=="string")return n;if(n==null)return"";try{return JSON.stringify(n)}catch{return String(n)}},[n]),o=l.useMemo(()=>b(p),[p]),j=l.useCallback(()=>A(o),[o]),i=l.useMemo(()=>/<\/?(p|ol|ul|li|a|br|strong|em|b|i|h[1-6]|table|thead|tbody|tr|td|th)(?:\s|\/?>)/i.test(o.markdown),[o.markdown]),h=l.useMemo(()=>{if(!i)return"";const s=f.sanitize(o.markdown,{USE_PROFILES:{html:!0},ADD_ATTR:["target","rel"]}).replace(/<a\b(?![^>]*\bclass=)/gi,`<a class="${a.answerLink}"`);return y(s,o.sources)},[i,o.markdown,o.sources]),k=l.useCallback((s,r)=>{const c=H(r),t=s&&C(s)?M(s,{label:c,page:S(s,o.sources)}):s,u=!!(t&&/\/books\/\d+\/read/i.test(t));return{href:t,...u||t!=null&&t.startsWith("http://")||t!=null&&t.startsWith("https://")?{target:"_blank",rel:"noopener noreferrer"}:{},...m&&t?{onClick:()=>m(t)}:{}}},[o.sources,m]);return e.jsxs("div",{className:a.answerContent,children:[i?e.jsx("div",{dangerouslySetInnerHTML:{__html:h}}):e.jsx(T,{remarkPlugins:[L],components:{a:({node:s,children:r,href:c,...t})=>{const u=k(c,r);return e.jsx("a",{className:a.answerLink,...t,...u,children:r})},h1:({children:s,...r})=>e.jsx("h1",{className:a.answerH1,...r,children:s}),h2:({children:s,...r})=>e.jsx("h2",{className:a.answerH2,...r,children:s}),h3:({children:s,...r})=>e.jsx("h3",{className:a.answerH3,...r,children:s}),h4:({children:s,...r})=>e.jsx("h4",{className:a.answerH4,...r,children:s}),blockquote:({children:s,...r})=>e.jsx("blockquote",{className:a.answerQuote,...r,children:s}),hr:s=>e.jsx("hr",{className:a.answerHr,...s}),ul:({children:s,...r})=>e.jsx("ul",{className:a.answerUl,...r,children:s}),ol:({children:s,...r})=>e.jsx("ol",{className:a.answerOl,...r,children:s}),li:({children:s,...r})=>e.jsx("li",{className:a.answerLi,...r,children:s}),p:({children:s,...r})=>e.jsx("p",{className:a.answerP,...r,children:s}),code:({children:s,...r})=>e.jsx("code",{className:a.answerCode,...r,children:s}),pre:({children:s,...r})=>e.jsx("pre",{className:a.answerPre,...r,children:s})},children:o.markdown}),d?e.jsx(P,{message:w}):e.jsxs(e.Fragment,{children:[e.jsx(N,{sources:o.sources,onBookOpen:m}),e.jsxs("div",{className:a.answerActions,children:[e.jsx(g,{getCopyText:j}),x]})]})]})}export{W as default};

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.