PageSourceSearch

https://www.coatino.com/chunk-M5LMZDPJ.js

js coatino.com collected 2026-10-07 00:14:52 UTC 50,900 bytes, 5 lines download raw bytes

1import{a as $t,c as Vt,d as qt,e as zt}from"./chunk-E5Q7B6XO.js";import{a as oe}from"./chunk-32R2JEEC.js";import{a as Ke,b as Lt,d as Ye,f as Nt}from"./chunk-S5ZO4SBX.js";import{b as Ge}from"./chunk-6Y7WVUQV.js";import{A as Mt}from"./chunk-YBTUI72W.js";import"./chunk-TLSEJD33.js";import"./chunk-7EGKGM4L.js";import{b as ye}from"./chunk-BJXGWK6V.js";import{a as ce,b as Ot,c as le,d as Pt,e as Te}from"./chunk-4B75SSBF.js";import{a as Dt}from"./chunk-5HOF3CTP.js";import"./chunk-SLIIBRRX.js";import"./chunk-VLJYSEA7.js";import{o as Ce}from"./chunk-ER76W3PZ.js";import"./chunk-NI7PYM3B.js";import{d as He,x as bt}from"./chunk-6GIP4TSL.js";import{a as Fe,b as Ae}from"./chunk-Z42PMTSP.js";import"./chunk-2VW7MWK5.js";import{b as Bt}from"./chunk-N323TXFM.js";import{D as Rt,n as wt,y as kt}from"./chunk-JOK7X772.js";import"./chunk-2YFXQLKO.js";import{b as Ct,c as xt}from"./chunk-WOYM2JYS.js";import{b as P,c as _e,d as U,q as te,t as j,u as Se,v as we,x as _,y as ke}from"./chunk-NXLTPI2R.js";import{a as ne}from"./chunk-LH6FQ72J.js";import"./chunk-73OXCWQR.js";import{a as xe}from"./chunk-4YXN7PD6.js";import{t as Ft,u as At}from"./chunk-Q7CAW4MX.js";import{a as ie,b as Ie,f as It,j as Tt}from"./chunk-CNDNZBIH.js";import{d as Et}from"./chunk-PVRDHAHB.js";import{m as Ee}from"./chunk-IQUVU3HL.js";import"./chunk-LSYSUMMH.js";import"./chunk-B4UK5MLV.js";import{ya as St}from"./chunk-KQLXGBV4.js";import{b as yt,c as _t}from"./chunk-VM7BO4QJ.js";import{a as $}from"./chunk-DXHD2AKU.js";import{E as q,aa as be,ca as z}from"./chunk-72ELTTVK.js";import{N as vt,h as gt,n as ee}from"./chunk-2L7GOVKI.js";import{Ac as X,Bd as Z,Ca as V,Cc as G,Dc as K,Eb as at,Ec as h,Ed as L,Fb as he,Fc as s,Fd as N,Gc as a,Ha as d,Hc as p,Ic as re,J as T,Jb as m,Jc as se,Kc as ae,M as nt,Nd as ve,Oc as B,Pa as F,Qa as A,Rb as ct,Rd as ft,Sd as Y,Tc as y,U as J,Ua as rt,Vb as R,Wc as g,Xa as st,_ as Ve,_b as C,ac as M,ba as qe,bb as je,ed as fe,g as Ze,h as et,ib as D,id as dt,ja as ze,jd as c,kd as O,la as Q,ld as ge,pa as Ue,r as tt,sc as lt,sd as mt,td as pt,ua as ue,ud as ut,vd as ht,wa as ot,x as I,xc as v,xd as We,y as it,zc as b}from"./chunk-YGB2H77J.js";import"./chunk-3AORW5YP.js";import{a as w,b as k}from"./chunk-M5RZSWGK.js";var Ut=(()=>{class t{constructor(){this.promptSlidesConfig={slidesPerView:4,loop:!0,autoplay:{delay:3500,disableOnInteraction:!1,pauseOnMouseEnter:!0},spaceBetween:12}}onVideoReady(e){e.muted=!0,e.play().catch(()=>{})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["brain-landing-page"]],hostAttrs:[1,"w-full","block"],decls:116,vars:4,consts:[["video",""],[1,"bg-bg-subtle"],[1,"coa-container","pt-8","pb-8","md:pt-10","md:pb-12"],[1,"grid","grid-cols-1","gap-8","lg:grid-cols-[3fr_2fr]","lg:items-center"],[1,"flex","flex-col","gap-6"],["src","/assets/svg/brain_logo.svg","alt","COATINO Brain logo",1,"h-14","w-auto","self-start","md:h-20"],[1,"prose","max-w-3xl"],[1,"text-fg-muted","text-lg"],[1,"text-lg","font-medium"],["routerLink","chat","trailingIcon","send",1,"self-start"],[1,"self-start"],[1,"bg-bg","shadow-sm",3,"noBorder"],[1,"flex","flex-col","gap-3","p-6","md:p-8"],[1,"typo--title-small","text-fg-muted","leading-none"],["navOrientation","vertical",1,"block","text-sm","md:text-base",3,"config","viewportHeightPx"],[1,"prompt-slide-card"],["icon","chat","size","small",1,"prompt-slide-icon"],[1,"coa-container","mt-8","mb-8"],[1,"shadow-md",3,"noBorder"],[1,"p-6","md:p-8"],["autoplay","","muted","","loop","","playsinline","","controls","","controlsList","nodownload","preload","auto",1,"mx-auto","w-full","max-w-5xl",3,"loadedmetadata","contextmenu"],["src","https://static.coatino.com/web/videos/brain_public.mp4","type","video/mp4"],[1,"mt-12","grid","gap-8","lg:grid-cols-2","lg:gap-16"],[1,"prose","max-w-none"],["href","https://www.evonik.com/en/company/businesslines/ca/services-coating-additives/downloads.html"],[1,"mt-8","flex","justify-center"],["trailingIcon","send","routerLink","chat"]],template:function(i,n){if(i&1){let r=B();s(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4),p(4,"img",5),s(5,"div",6)(6,"h1"),c(7,"Find coatings knowledge faster"),a(),s(8,"p",7),c(9," COATINO\xAE Brain is your conversational entry point to the coatings knowledge. Ask product, application, and formulation questions in natural language and get focused answers based on our COATINO\xAE content. "),a(),s(10,"p",7),c(11," No manual searching across product pages, guides, and documents: You can start with a single question and reach relevant information faster. "),a(),s(12,"p",8),c(13," COATINO\xAE Brain can be used free of charge. You only need a free account. "),a()(),s(14,"ui-button",9),c(15,"Open chat"),a()(),s(16,"div",10)(17,"ui-card",11)(18,"ui-card-body",12)(19,"span",13),c(20,"Ask questions such as"),a(),s(21,"ui-slides",14)(22,"ui-slide")(23,"div",15),p(24,"ui-icon",16),s(25,"span")(26,"strong"),c(27,"Recommend products"),a(),c(28," for matte solvent-borne automotive OEM clear coats."),a()()(),s(29,"ui-slide")(30,"div",15),p(31,"ui-icon",16),s(32,"span"),c(33,"Can you give me a "),s(34,"strong"),c(35,"starting point formulation"),a(),c(36," for architectural coatings?"),a()()(),s(37,"ui-slide")(38,"div",15),p(39,"ui-icon",16),s(40,"span"),c(41,"What are the "),s(42,"strong"),c(43,"benefits"),a(),c(44," of TEGO Dispers 755 W?"),a()()(),s(45,"ui-slide")(46,"div",15),p(47,"ui-icon",16),s(48,"span")(49,"strong"),c(50,"Compare"),a(),c(51," TEGO Airex 920, TEGO Airex 921 and TEGO Airex 971."),a()()(),s(52,"ui-slide")(
153,"div",15),p(54,"ui-icon",16),s(55,"span"),c(56,"Give me the "),s(57,"strong"),c(58,"TDS"),a(),c(59," of TEGO Foamex 812 in English."),a()()(),s(60,"ui-slide")(61,"div",15),p(62,"ui-icon",16),s(63,"span"),c(64,"What are the "),s(65,"strong"),c(66,"best products"),a(),c(67," to control foam in can coatings?"),a()()(),s(68,"ui-slide")(69,"div",15),p(70,"ui-icon",16),s(71,"span"),c(72,"What "),s(73,"strong"),c(74,"benefits"),a(),c(75," do ACEMATT matting agents provide in wood coatings?"),a()()(),s(76,"ui-slide")(77,"div",15),p(78,"ui-icon",16),s(79,"span"),c(80,"Recommend a "),s(81,"strong"),c(82,"formulation"),a(),c(83," that minimizes dirt absorption."),a()()()()()()()()()(),s(84,"div",17)(85,"ui-card",18)(86,"ui-card-body",19)(87,"video",20,0),y("loadedmetadata",function(){F(r);let u=fe(88);return A(n.onVideoReady(u))})("contextmenu",function(u){return F(r),A(u.preventDefault())}),p(89,"source",21),c(90," Your browser does not support HTML video. "),a(),s(91,"div",22)(92,"div",23)(93,"h2"),c(94,"What COATINO\xAE Brain can help you with"),a(),s(95,"p"),c(96," COATINO\xAE Brain supports a broad range of product and application questions. It includes many information from: "),a(),s(97,"ul")(98,"li"),c(99,'Product detail pages, including "Additional Information"'),a(),s(100,"li"),c(101,"Product Selector Guides"),a(),s(102,"li"),c(103,"Formulations"),a(),s(104,"li"),c(105," Publicly available documents from the "),s(106,"a",24),c(107," Coating Additives downloads page "),a()()()(),s(108,"div",23)(109,"h2"),c(110,"Good to know"),a(),s(111,"p"),c(112," The chatbot generates answers based on the public sources listed above. For critical decisions, technical validation is still recommended, especially when details need to be confirmed against original documents. "),a()()(),s(113,"div",25)(114,"ui-button",26),c(115,"Open chat"),a()()()()()}i&2&&(m(17),h("noBorder",!0),m(4),h("config",n.promptSlidesConfig)("viewportHeightPx",350),m(64),h("noBorder",!0))},dependencies:[$,Ee,xt,Ct,z,Ae,Fe],styles:[`@layer properties;.prompt-slide-card[_ngcontent-%COMP%]{display:flex;height:100%;align-items:center;gap:calc(var(--spacing, .25rem) * 3);border-radius:var(--radius-lg, .5rem);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-slate-200, oklch(92.9% .013 255.508));background-color:var(--color-white, #ffffff);padding-inline:calc(var(--spacing, .25rem) * 4);padding-block:calc(var(--spacing, .25rem) * 3);
1--tw-shadow: 0 2px 6px var(--tw-shadow-color, rgba(0, 0, 0, .04)), 0 1px 2px var(--tw-shadow-color, rgba(0, 0, 0, .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.prompt-slide-icon[_ngcontent-%COMP%]{flex-shrink:0;color:var(--color-fg-muted, #757b83)}@property --tw-border-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: "*"; inherits: false;}@property --tw-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: "*"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: "*"; inherits: false;}@property --tw-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: "*"; inherits: false;}@property --tw-inset-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: "*"; inherits: false;}@property --tw-ring-offset-width{syntax: "<length>"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: "*"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*[_ngcontent-%COMP%], [_ngcontent-%COMP%]:before, [_ngcontent-%COMP%]:after, [_ngcontent-%COMP%]::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}
2
3`],changeDetection:0})}}return t})();var De=(()=>{class t{constructor(){this.environment=d(It),this.authentication=d(ne),this.isCadEmployee=_t(this.authentication.isCadEmployee(),{initialValue:!1})}isInternal(){return this.isCadEmployee()}properEnvironment(e,i){return this.environment.returnProper(this.isInternal()?e:i)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var f=_e({source:"Brain Chat",events:{Connect:U(),"Connection Established":U(),"Connection Closed":P(),"Connection Error":P(),"Send Message":P(),"Message Received":P(),"First Token Received":U(),Reset:U()}});var Re="brainChat",de=Te({selectId:t=>t.id,sortComparer:(t,o)=>t.id-o.id}),Je=de.getInitialState({status:"disconnected",sequence:0,lastError:void 0,lastDisconnect:void 0,isLoading:!1,isReady:!1,hasFirstToken:!1});function vi(t,o){return t.isLoading?o.message_type==="response"?!(o.response_type==="status"&&o.status_type==="finished"||o.response_type==="error"):t.isLoading:o.message_type==="request"}function me(t,o){return t==="connected"&&!o}function jt(t,o){let e=t.sequence+1,i=vi(t,o),n=de.addOne({id:e,message:o},t);return k(w({},n),{sequence:e,isLoading:i,isReady:me(t.status,i)})}var Wt=ke(Je,_(f.connect,t=>k(w({},t),{status:"connecting",lastError:void 0,isReady:me("connecting",t.isLoading)})),_(f.connectionEstablished,t=>k(w({},t),{status:"connected",lastError:void 0,isReady:me("connected",t.isLoading)})),_(f.connectionClosed,(t,o)=>{let e="disconnected",i=o.reason==="io client disconnect";return k(w({},t),{status:e,lastDisconnect:{reason:o.reason},lastError:i?t.lastError:t.lastError??o.reason,isReady:me(e,t.isLoading)})}),_(f.connectionError,(t,{error:o})=>{let e="error";return k(w({},t),{status:e,lastError:o,isReady:me(e,t.isLoading)})}),_(f.sendMessage,(t,o)=>k(w({},jt(t,o)),{hasFirstToken:!1})),_(f.messageReceived,(t,o)=>jt(t,o)),_(f.firstTokenReceived,t=>k(w({},t),{hasFirstToken:!0})),_(f.reset,()=>Je));var Me=Se(Re),{selectAll:Ht}=de.getSelectors(),Gt=j(Me,t=>Ht(t).map(o=>o.message).filter(o=>o.message_type==="request")),Kt=t=>j(Me,o=>Ht(o).map(e=>e.message).filter(e=>e.index===t)),Yt=j(Me,t=>t.lastError),Jt=j(Me,t=>t.isReady);var Qt=[we(Re,Wt)];var Oe=(()=>{class t extends Tt{constructor(){super(),this.setBaseFormat((e,i,n)=>{let r="";n&&n.sessionId&&(r=` ${n.sessionId.toString().slice(0,8)}`,delete n.sessionId,Object.keys(n).length===0&&(n=void 0));let l=`[TS_TIME]${r} ${e[0].toUpperCase()} ${i}`;return n?`${l} ${JSON.stringify(n)}`:l})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var x=_e({source:"Brain Feedback",events:{"Run Id Received":P(),"Submit Feedback":P(),"Feedback Id Received":P(),"Submit Feedback Failed":P(),Reset:U(),noop:U()}});var Pe="brainFeedback",W=Te({selectId:t=>t.index}),Be=W.getInitialState();var bi=Se(Pe),{selectEntities:Ci}=W.getSelectors(),Qe=j(bi,Ci),Xt=t=>j(Qe,o=>o[t]);var Zt=(()=>{class t{constructor(){this.actions$=d(Ot),this.store=d(te),this.websockets=d(H),this.logger=
3d(Oe),this.alertService=d(ie),this.captureRunId$=ce(()=>this.actions$.pipe(le(f.messageReceived),T(e=>e.message_type==="response"&&e.response_type==="data"&&e.data_type==="run_id"),I(e=>x.runIdReceived({index:e.index,runId:e.value})))),this.captureFeedbackId$=ce(()=>this.actions$.pipe(le(f.messageReceived),T(e=>e.message_type==="response"&&e.response_type==="data"&&e.data_type==="feedback_id"),I(e=>x.feedbackIdReceived({index:e.index,feedbackId:e.value})))),this.submitFeedback$=ce(()=>this.actions$.pipe(le(x.submitFeedback),ot(this.store.select(Qe)),I(([e,i])=>{let n=i[e.index];if(!n?.runId){let r="Feedback cannot be sent without an associated run id.";return this.logger.warn(r,{index:e.index})(),x.submitFeedbackFailed({index:e.index,error:r,runId:e.runId})}try{return this.websockets.sendFeedback(e.index,n.runId,n.feedbackId,{reaction:e.reaction,comment:e.comment})?x.noop():x.submitFeedbackFailed({index:e.index,error:"WebSocket is not connected.",runId:e.runId})}catch(r){let l=r instanceof Error?r.message:"Unknown error sending feedback.";return this.logger.error("Feedback send failed",{index:e.index,error:l})(),x.submitFeedbackFailed({index:e.index,error:l,runId:e.runId})}}))),this.logFeedbackErrors$=ce(()=>this.actions$.pipe(le(x.submitFeedbackFailed),ue(e=>{this.logger.error(e.error,{runId:e.runId})(),this.alertService.alertError(e.error)})),{dispatch:!1})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac})}}return t})();var ei=ke(Be,_(x.runIdReceived,(t,{index:o,runId:e})=>{let i=t.entities[o];return W.upsertOne(k(w({},i),{index:o,runId:e}),t)}),_(x.submitFeedback,(t,{index:o,reaction:e,comment:i})=>{let n=t.entities[o];return W.upsertOne(k(w({},n),{index:o,reaction:e,comment:i}),t)}),_(x.feedbackIdReceived,(t,{index:o,feedbackId:e})=>{let i=t.entities[o];return W.upsertOne(k(w({},i),{index:o,feedbackId:e}),t)}),_(x.submitFeedbackFailed,(t,{index:o,error:e})=>{let i=t.entities[o];return W.upsertOne(k(w({},i),{index:o,error:e}),t)}),_(x.reset,()=>Be),_(f.reset,()=>Be));var ti=[we(Pe,ei),Pt(Zt)];function Xe(){return[...Qt,...ti]}var H=(()=>{class t{constructor(){this.requestIndex=0,this.access=d(De),this.store=d(te),this.logger=d(Oe),this.alertService=d(ie),this.authService=d(ne),this.userCountryService=d(At),this.userLanguageService=d(Ft),this.trackingService=d(Dt),this.websocketPath=Lt,this.messageRequest$=this.store.select(Gt),this.lastError$=this.store.select(Yt),this.isReady$=this.store.select(Jt),this.takeUntilDestroyed=xe(),this.lastOffset="",this.hasReceivedFirstToken=!1,this.logger.setLevel("info"),this.lastError$.pipe(T(e=>e!==void 0),this.takeUntilDestroyed()).subscribe(e=>{let i=this.lastOffset.length>0?` (last offset: ${this.lastOffset})`:"";this.logger.error(`Brain: wss error${i}: ${e}`)()})}getWebsocketBaseUrl(){return this.access.properEnvironment(Ye.internal,Ye.public)}reset(){this.lastOffset="",this.store.dispatch(f.reset()),this.disconnect()}connect(e,i,n){this.socket?.disconnect(),this.sessionId=e,i===void 0&&(i=this.getWebsocketBaseUrl()),this.logger.debug("Connecting (waiting for identity)",{sessionId:e,baseUrl:i})(),this.authService.observeIdentity().pipe(T(r=>r!==null),J(1)).subscribe(()=>this.openSocket(e,i,n))}openSocket(e,i,n){this.logger.debug("Connecting",{sessionId:e})(),this.socket=Nt(i,{reconnectionAttempts:100,reconnectionDelay:1e3,path:this.websocketPath,transports:["websocket"],upgrade:!1,auth:r=>r({sessionId:e,offset:void 0,country:this.userCountryService.persistedUserCountry(),language:this.userLanguageService.getPreferredUserLanguage(),token:n??this.authService.getAccessToken()}),withCredentials:!0}),this.store.dispatch(f.connect()),this.attachSocketEventListeners()}attachSocketEventListeners(){this.socket&&(this.socket.on("connect",this.onConnect.bind(this)),this.socket.on("connect_error",this.onConnectError.bind(this)),this.socket.on("disconnect",this.onDisconnect.bind(this)),this.socket.on("message",this.onSocketMessage.bind(this)))}onConnect(){if(!this.socket||!this.socket.active){this.logger.warn("Socket is not active",{sessionId:this.sessionId})();return}this.logger.debug("Connected \u2705",{sessionId:this.sessionId,socketId:this.socket.id})(),this.store.dispatch(f.connectionEstablished())}onSocketMessage(e){this.lastOffset=e.offset,e.response_type==="token"&&!this.hasReceivedFirstToken&&
3(this.hasReceivedFirstToken=!0,this.store.dispatch(f.firstTokenReceived())),this.store.dispatch(f.messageReceived(e))}onDisconnect(e,i){this.logger.debug("Disconnect",{reason:e,details:i,sessionId:this.sessionId})(),this.store.dispatch(f.connectionClosed({reason:e}))}onConnectError(e){if(e.message==="UNAUTHENTICATED"){this.logger.error("Connect error: unauthenticated",{sessionId:this.sessionId})(),this.store.dispatch(f.connectionError({error:"Not authenticated"})),this.alertService.alertError("Your session has expired. Please log in again."),this.disconnect();return}this.logger.error("Connect error",{sessionId:this.sessionId,message:e.message})(),this.store.dispatch(f.connectionError({error:"WebSocket connect error"})),this.alertService.alertError("Sorry, connection error. Please reload the page.")}ngOnDestroy(){this.disconnect()}disconnect(){try{this.socket?.disconnect()}finally{this.socket=void 0}}checkReady(e){return this.socket?.active?!0:(this.logger.warn(`Socket not active (event: ${e})`,{socketExists:!!this.socket})(),this.store.dispatch(f.connectionError({error:`WebSocket is not connected (${e}).`})),this.alertService.alertError("Sorry, please reconnect or reload the page."),!1)}sendPrompt(e){let i=e.trim();if(!i)return;this.trackingService.pushEvent({event:"userInteraction",service:"brain",intent:i,interactionID:`${this.sessionId}`});let n={message_type:"request",index:this.requestIndex++,content:i};this.logger.debug("sendPrompt",{index:n.index,content:i,sessionId:this.sessionId})(),this.store.dispatch(f.sendMessage(n)),this.hasReceivedFirstToken=!1,this.send("prompt",n)}sendFeedback(e,i,n,r){let l={message_type:"feedback",run_id:i,index:e,feedback_id:n,score:r.reaction==="like"?1:-1,comment:r.comment};return this.logger.debug("sendFeedback",l)(),this.send("feedback",l)}send(e,i){return this.checkReady(e)?(this.socket.send(e,i),!0):!1}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac})}}return t})();var ii=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["ui-loader-dot"]],decls:5,vars:0,consts:[[1,"loader-dot"],[1,"circle","circle-1"],[1,"circle","circle-2"],[1,"circle","circle-3"],[1,"core"]],template:function(i,n){i&1&&(re(0,"div",0),ae(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),se())},styles:["[_nghost-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem}.loader-dot[_ngcontent-%COMP%]{position:relative;width:1.25rem;height:1.25rem;display:flex;align-items:center;justify-content:center}.core[_ngcontent-%COMP%]{position:absolute;width:40%;height:40%;background-color:currentColor;border-radius:50%;z-index:10;animation:_ngcontent-%COMP%_bionic-core 2s cubic-bezier(.4,0,.2,1) infinite}.circle[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;border-radius:50%;background-color:currentColor;opacity:0;filter:blur(1px);animation:_ngcontent-%COMP%_bionic-ring 3s cubic-bezier(.1,.8,.3,1) infinite}.circle-1[_ngcontent-%COMP%]{animation-delay:0s}.circle-2[_ngcontent-%COMP%]{animation-delay:1s}.circle-3[_ngcontent-%COMP%]{animation-delay:2s}@keyframes _ngcontent-%COMP%_bionic-ring{0%{transform:scale(.2);opacity:.4;filter:blur(0px)}40%{opacity:.15;filter:blur(2px)}to{transform:scale(1.3);opacity:0;filter:blur(4px)}}@keyframes _ngcontent-%COMP%_bionic-core{0%{transform:scale(.7);opacity:.7}15%{transform:scale(1.2);opacity:1;box-shadow:0 0 6px currentColor}30%{transform:scale(.9);opacity:.8}45%{transform:scale(1.05);opacity:1;box-shadow:0 0 3px currentColor}to{transform:scale(.7);opacity:.7}}"]})}}return t})();function xi(t,o){t&1&&ae(0,"span",3)}function yi(t,o){t&1&&ae(0,"span",4)}function _i(t,o){if(t&1&&v(0,xi,1,0,"span",3)(1,yi,1,0,"span",4),t&2){let e=o.$implicit;b(e?0:1)}}function Si(t,o){if(t&1&&(re(0,"span",0)(1,"span",2),G(2,_i,2,1,null,null,X),se()()),t&2){let e=g();lt("aria-label",e.ariaLabel())("title",e.ariaLabel()),m(2),K(e.segments())}}function wi(t,o){t&1&&(re(0,"span",1),c(1,"-"),se())}var ki=(()=>{class t{hasValue(){return this.payload.value!==null&&this.payload.value!==void 0}segments(){let e=this.max(),i=this.value();return Array.from({length:e},(n,r)=>r<i)}ariaLabel(){return this.payload.ariaLabel??`${this.value()} out of ${this.max()}`}max(){let e=Number(this.payload.max??5);return!Number.isFinite(e)||e<=0?5:Math.round(e)}value(){let e=Number(this.payload.value??0);return Number.isFinite(e)?Math.max(0,Math.min(this.max(),Math.round(e))):0}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["brain-chat-inline-bar-scale-widget"]],hostAttrs:[1,"inline-flex","items-center","align-middle"],inputs:{payload:"payload"},decls:2,vars:1,consts:[["role","img",1,"inline-flex","items-center","align-middle"],[1,"text-fg-muted"],[1,"inline-flex","gap-1","*:block","*:h-1.5","*:w-4","*:rounded-sm"],[1,"bg-fg-accent"],[1,"bg-fg-accent-weakest"]],template:function(i,n){i&1&&v(0,Si,4,2,"span",0)(1,wi,2,0,"span",1),i&2&&b(n.hasValue()?0:1)},encapsulation:2})}}return t})(),ni=(()=>{class t{constructor(){this.host=d(D),this.vcr=d(R),this.rendered=new Map}ngOnInit(){this.scan(),this.observer=new MutationObserver(()=>{this.scan()}),this.observer.observe(this.host.nativeElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-widget","data-widget-payload"]})}scan(){let e=this.host.nativeElement,i=Array.from(e.querySelectorAll("[data-widget]"));for(let n of i){if(n.getAttribute("data-widget")==="product-bar-comparison"){n.remove();continue}let l=this.parseInlineBarScalePayload(n);if(!l)continue;n.closest("td")?.classList.add("llm-cell-inline-bar-scale");let u=this.vcr.createComponent(ki);u.instance.payload=l,u.changeDetectorRef.detectChanges(),n.replaceWith(u.location.nativeElement),this.rendered.set(u.location.nativeElement,u)}for(let[n,r]of Array.from(this.rendered.entries()))(!document.contains(n)||!e.contains(n))&&(r.destroy(),this.rendered.delete(n))}parseInlineBarScalePayload(e){let i=e.getAttribute("data-widget"),n=e.getAttribute("data-widget-payload");if(i!=="inline-bar-scale"||!n)return null;try{let r=JSON.parse(n),l=this.normalizeValue(r.value);if(l===void 0)return null;let u=this.normalizeMax(r.max);return{type:"inline-bar-scale",value:l,max:u,ariaLabel:typeof r.ariaLabel=="string"&&r.ariaLabel.length>0?r.ariaLabel:void 0}}catch(r){return null}}normalizeValue(e){if(e===null)return null;let i=Number(e);if(Number.isFinite(i))return Math.max(0,Math.min(5,Math.round(i)))}normalizeMax(e){let i=Number(e??5);return!Number.isFinite(i)||i<=0?5:Math.round(i)}ngOnDestroy(){this.observer?.disconnect();for(let e of this.rendered.values())e.destroy();this.rendered.clear()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=M({type:t,selectors:[["","brainChatWidgets",""]]})}}return t})();var Ei={"campus-content":`${q}/campus/courses`};function oi(t,o,e,i){let n=Array.from(o.childNodes),r=t.createComponent(oe,{projectableNodes:[n]});r.instance.href=`${Ei[e]}/${i}`,r.instance.target="_blank",r.changeDetectorRef.detectChanges(),o.replaceWith(r.location.nativeElement)}var Ii=["campus-content"],ri=(()=>{class t{constructor(){this.host=d(D),this.vcr=d(R)}ngOnInit(){this.scan(),this.observer=new MutationObserver(()=>{this.scan()}),this.observer.observe(this.host.nativeElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["content-id","content-type"]})}scan(){let e=this.host.nativeElement,i=[];e.hasAttribute("content-id")&&e.hasAttribute("content-type")&&i.push(e),e.querySelectorAll("[content-id][content-type]").forEach(n=>i.push(n));for(let n of i){let r=n.getAttribute("content-id")?.trim(),l=n.getAttribute("content-type")?.trim();!r||!l||!Ii.includes(l)||oi(this.vcr,n,l,r)}}ngOnDestroy(){this.observer?.disconnect()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=M({type:t,selectors:[["","brainContentIds",""]]})}}return t})();var Ti=t=>["/products",t],Fi=t=>["/formulations",t],Ai=t=>["/campus","courses",t];function Di(t,o){if(t&1&&(s(0,"a",2),c(1),a()),t&2){let e=g().$implicit;h("routerLink",Z(2,Ti,e.id)),m(),O(e.name)}
3}function Ri(t,o){if(t&1&&(s(0,"a",2),c(1),a()),t&2){let e=g().$implicit;h("routerLink",Z(2,Fi,e.id)),m(),O(e.name)}}function Mi(t,o){if(t&1&&(s(0,"a",2),c(1),a()),t&2){let e=g().$implicit;h("routerLink",Z(2,Ai,e.id)),m(),O(e.name)}}function Oi(t,o){if(t&1&&(s(0,"a",3),c(1),a()),t&2){let e=g().$implicit;h("href",We("",e.url,"#page=",e.page),he),m(),O(e.title)}}function Pi(t,o){if(t&1&&(s(0,"a",3),c(1),a()),t&2){let e=g().$implicit,i=g();h("href",We("",i.coatinoProdUrl,"/markets/",e.id,"/psg"),he),m(),O(e.title)}}function Bi(t,o){if(t&1&&(s(0,"a",3),c(1),a()),t&2){let e=g().$implicit;h("href",ht(e.url),he),m(),O(e.title)}}function Li(t,o){if(t&1&&v(0,Di,2,4,"a",2)(1,Ri,2,4,"a",2)(2,Mi,2,4,"a",2)(3,Oi,2,4,"a",3)(4,Pi,2,4,"a",3)(5,Bi,2,3,"a",3),t&2){let e,i=o.$implicit;b((e=i.type)==="Product"?0:e==="Formulation"?1:e==="campus-content"?2:e==="Document"?3:e==="PSG"?4:e==="competitive-scout"?5:-1)}}function Ni(t){if(typeof t!="string")return null;switch(t.trim().toLowerCase()){case"product":return"Product";case"formulation":return"Formulation";case"document":return"Document";case"psg":return"PSG";case"campus-content":case"campus_content":case"campus content":return"campus-content";case"competitive-scout":case"competitive_scout":case"competitive scout":return"competitive-scout";default:return null}}function E(t){if(typeof t!="string")return null;let o=t.trim();return o.length?o:null}function si(t){if(t==null)return null;if(typeof t=="string"){let o=t.trim();return o.length?o:null}return typeof t=="number"?String(t):null}function $i(t){try{return decodeURIComponent(t)}catch(o){return t}}function Vi(t){let o=E(t.title),e=E(t.url);if(!e)return null;if(o)return{type:"competitive-scout",url:e,title:o};let i=$i(e),n=i.indexOf('","title":"');if(n<0)return null;let r=i.slice(0,n).trim(),l=i.slice(n+11).trim();return r&&l?{type:"competitive-scout",url:r,title:l}:null}function qi(t){if(!t||typeof t!="object")return null;let o=t,e=Ni(o.type);if(!e)return null;switch(e){case"Product":{let i=E(o.id),n=E(o.name);return i&&n?{type:e,id:i,name:n}:null}case"Formulation":{let i=E(o.id),n=E(o.name);return i&&n?{type:e,id:i,name:n}:null}case"Document":{let i=E(o.id),n=E(o.url),r=si(o.page)??"1",l=E(o.title),u=si(o.chapter)??"";return i&&n&&r&&l?{type:e,id:i,url:n,page:r,title:l,chapter:u}:null}case"PSG":{let i=E(o.id),n=E(o.title);return i&&n?{type:e,id:i,title:n}:null}case"campus-content":{let i=E(o.id),n=E(o.name);return i&&n?{type:e,id:i,name:n}:null}case"competitive-scout":return Vi(o)}}var zi=(()=>{class t{constructor(){this.sources=null,this.coatinoProdUrl=q}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["brain-data-sources-menu"]],inputs:{sources:"sources"},decls:5,vars:1,consts:[["menu","matMenu"],["leadingIcon","link","aria-label","Open product","variant","secondary","size","small","iconClass","mr-0",1,"ml-2","h-4","w-7",3,"matMenuTriggerFor"],["mat-menu-item","","target","_blank",3,"routerLink"],["mat-menu-item","","target","_blank",3,"href"]],template:function(i,n){if(i&1&&(p(0,"ui-button",1),s(1,"mat-menu",null,0),G(3,Li,6,1,null,null,X),a()),i&2){let r=fe(2);h("matMenuTriggerFor",r),m(3),K(n.sources)}},dependencies:[zt,Vt,$t,qt,St,Ee,$],styles:["[_nghost-%COMP%]{vertical-align:sub}"]})}}return t})(),ai=(()=>{class t{constructor(){this.host=d(D),this.vcr=d(R),this.rendered=new Map}destroyRendered(e){let i=this.rendered.get(e);i&&(i.ref.destroy(),i.ref.location.nativeElement.remove(),this.rendered.delete(e))}ngOnInit(){this.scan(),this.observer=new MutationObserver(()=>{this.scan()}),this.observer.observe(this.host.nativeElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-sources"]})}scan(){let e=this.host.nativeElement,i=[];e.hasAttribute("data-sources")&&i.push(e),e.querySelectorAll("[data-sources]").forEach(r=>i.push(r));let n=new Set;for(let r of i){n.add(r);let l=r.getAttribute("data-sources"),u;if(l!=null){try{let $e=JSON.parse(l);u=Array.isArray($e)?$e.map(qi).filter(gi=>!!gi):[]}catch($e){u=[]}let Ne=this.rendered.get(r);if(!u.length){this.destroyRendered(r);continue}if(Ne){Ne.ref.instance.sources=u,Ne.ref.changeDetectorRef.detectChanges();continue}let pe=this.vcr.createComponent(zi);pe.instance.sources=u,pe.changeDetectorRef.detectChanges(),r.insertAdjacentElement("beforeend",pe.location.nativeElement),this.rendered.set(r,{ref:pe})}}for(let[r,{ref:l}]of Array.from(this.rendered.entries()))(!n.has(r)||r.getAttribute("data-sources")==null||!document.contains(r))&&(l.destroy(),l.location.nativeElement.remove(),this.rendered.delete(r))}ngOnDestroy(){this.observer?.disconnect();for(let{ref:e}of this.rendered.values())e.destroy(),e.location.nativeElement.remove();this.rendered.clear()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=M({type:t,selectors:[["","brainDataSources",""]]})}}return t})();var Ui=`${q}/formulations`;function ci(t,o,e){let i=Array.from(o.childNodes),n=t.createComponent(oe,{projectableNodes:[i]});n.instance.href=`${Ui}/${e}`,n.instance.target="_blank",n.changeDetectorRef.detectChanges(),o.replaceWith(n.location.nativeElement)}var li=(()=>{class t{constructor(){this.host=d(D),this.vcr=d(R)}ngOnInit(){this.scan(),this.observer=new MutationObserver(()=>{this.scan()}),this.observer.observe(this.host.nativeElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["formulation-id"]})}scan(){let e=this.host.nativeElement,i=[];e.hasAttribute("formulation-id")&&i.push(e),e.querySelectorAll("[formulation-id]").forEach(n=>i.push(n));for(let n of i){let r=n.getAttribute("formulation-id");if(!r)continue;let l=r.trim();l.length&&ci(this.vcr,n,l)}}ngOnDestroy(){this.observer?.disconnect()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=M({type:t,selectors:[["","brainFormulationIds",""]]})}}return t})();var ji=`${q}/products`;function Le(t,o,e){let i=Array.from(o.childNodes),n=t.createComponent(oe,{projectableNodes:[i]});n.instance.href=`${ji}/${e}`,n.instance.target="_blank",n.changeDetectorRef.detectChanges(),o.replaceWith(n.location.nativeElement)}var di=(()=>{class t{constructor(){this.host=d(D),this.vcr=d(R)}ngOnInit(){this.scan(),this.observer=new MutationObserver(()=>{this.scan()}),this.observer.observe(this.host.nativeElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["product-id"]})}scan(){let e=this.host.nativeElement,i=[];e.hasAttribute("product-id")&&i.push(e),e.querySelectorAll("[product-id]").forEach(n=>i.push(n));for(let n of i){let r=n.getAttribute("product-id");if(r==null)continue;let l=r.trim();l.length!==0&&Le(this.vcr,n,l)}}ngOnDestroy(){this.observer?.disconnect()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=M({type:t,selectors:[["","brainProductIds",""]]})}}return t})();var mi=(()=>{class t{constructor(){this.host=d(D),this.productApiService=d(Mt),this.vcr=d(R),this.takeUntilDestroyed=xe(),this.productIdByNameCache=new Map,this.pendingProductIdLookups=new Map,this.lookupByElementInProgress=new WeakSet}ngOnInit(){this.observer=new MutationObserver(()=>{this.scheduleScan()}),this.observer.observe(this.host.nativeElement,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["class"]}),this.scheduleScan()}scheduleScan(){this.scanTimer&&clearTimeout(this.scanTimer),this.scanTimer=setTimeout(()=>{this.scanTimer=void 0,this.scan()},120)}scan(){this.host.nativeElement.querySelectorAll("span.product-name").forEach(i=>
3{(i.textContent?.trim()??"").length===0||this.lookupByElementInProgress.has(i)||i.hasAttribute("product-id")||i.hasAttribute("competitor-product-id")||this.processProductName(i)})}processProductName(e){let i=e.textContent?.trim();i&&(this.lookupByElementInProgress.add(e),this.getProductIdByName(i).pipe(this.takeUntilDestroyed(),qe(()=>this.lookupByElementInProgress.delete(e))).subscribe(n=>{!n||!e.isConnected||Le(this.vcr,e,n)}))}getProductIdByName(e){if(this.productIdByNameCache.has(e))return tt(this.productIdByNameCache.get(e)??null);let i=this.pendingProductIdLookups.get(e);if(i)return i;let n=this.productApiService.getIdByName(e).pipe(ue(r=>this.productIdByNameCache.set(e,r)),qe(()=>this.pendingProductIdLookups.delete(e)),Q({bufferSize:1,refCount:!1}));return this.pendingProductIdLookups.set(e,n),n}ngOnDestroy(){this.observer?.disconnect(),this.scanTimer&&clearTimeout(this.scanTimer)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=M({type:t,selectors:[["","brainProductName",""]]})}}return t})();function Wi(t,o){if(t&1&&c(0),t&2){let e=g();ge(" ",e.comment()," ")}}function Hi(t,o){t&1&&(s(0,"span",1),p(1,"ui-icon",9),c(2," Did this answer your question? Help us improve COATINO\xAE Brain. "),a())}function Gi(t,o){t&1&&p(0,"ui-icon",4)}function Ki(t,o){t&1&&p(0,"ui-icon",5)}function Yi(t,o){t&1&&p(0,"ui-icon",7)}function Ji(t,o){t&1&&p(0,"ui-icon",8)}var Qi=t=>({minLength:t});function Xi(t,o){t&1&&(s(0,"p",3),c(1,"Sorry!"),a(),s(2,"p"),c(3,"The system is under development and we are working on improving it."),a(),s(4,"p"),c(5,"Please leave a comment describing what you did not like."),a(),s(6,"p"),c(7," You can also share your contact details or name if you would like us to follow up with further questions, recommendations, or technical expertise. "),a())}function Zi(t,o){t&1&&(s(0,"p",3),c(1,"Thank you!"),a(),s(2,"p"),c(3,"Please leave a comment if you like it."),a())}var pi=(()=>{class t{constructor(){this.overlayService=kt(),this.feedbackEvent=ft(),this.comment=Y()}onReaction(e){this.overlayService.open(en,{data:{reaction:e,comment:this.comment?.()},headline:"Feedback"}).afterClosed().subscribe(i=>{i&&(this.reaction=e,this.feedbackEvent.emit({reaction:e,comment:i?.comment}))})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["brain-feedback"]],inputs:{comment:[1,"comment"]},outputs:{feedbackEvent:"feedbackEvent"},decls:10,vars:3,consts:[[1,"text-fg-muted","mt-3","text-sm","whitespace-pre-line"],[1,"text-deep-purple","flex","items-start"],[1,"mt-3","flex","flex-wrap","items-center","gap-2","self-start"],["variant","secondary","size","small","aria-label","Like response",1,"h-8","w-8","min-w-10","p-0",3,"click"],["icon","thumb_up","size","small","mainColor","var(--color-flatgreen-600)"],["icon","thumb_up","outlined","","size","small"],["variant","secondary","size","small","aria-label","Dislike response",1,"h-8","w-8","min-w-10","p-0",3,"click"],["icon","thumb_down","size","small","mainColor","var(--color-red-500)"],["icon","thumb_down","outlined","","size","small"],["icon","contact_support","size","small",1,"mr-1"]],template:function(i,n){i&1&&(s(0,"div",0),v(1,Wi,1,1)(2,Hi,3,0,"span",1),a(),s(3,"div",2)(4,"ui-button",3),y("click",function(){return n.onReaction("like")}),v(5,Gi,1,0,"ui-icon",4)(6,Ki,1,0,"ui-icon",5),a(),s(7,"ui-button",6),y("click",function(){return n.onReaction("dislike")}),v(8,Yi,1,0,"ui-icon",7)(9,Ji,1,0,"ui-icon",8),a()()),i&2&&(m(),b(n.comment()?1:2),m(4),b(n.reaction==="like"?5:6),m(3),b(n.reaction==="dislike"?8:9))},dependencies:[$,z],encapsulation:2,changeDetection:0})}}return t})(),en=(()=>{class t{constructor(){this.minCommentLength=30,this.requiredCommentValidators=[He.required,He.minLength(this.minCommentLength)],this.requiresComment=ve(()=>this.reaction()==="dislike"),this.dialogRef=d(wt),this.reaction=Y.required(),this.comment=Y(),this.complaintFc=new Ce(null),this.initialized=!1,je(()=>{this.requiresComment()?this.complaintFc.addValidators(this.requiredCommentValidators):this.complaintFc.removeValidators(this.requiredCommentValidators),this.complaintFc.updateV
3alueAndValidity({emitEvent:!1})}),je(()=>{let e=this.comment?.();this.initialized||(this.complaintFc.setValue(e??null,{emitEvent:!1}),this.initialized=!0)})}onSend(){this.dialogRef.close({reaction:this.reaction(),comment:this.complaintFc.value})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["brain-feedback-dialog"]],inputs:{reaction:[1,"reaction"],comment:[1,"comment"]},decls:5,vars:6,consts:[[1,"prose"],["element","textarea","label","Comment",1,"mt-5","min-h-64","w-full!",3,"keydown.control.enter","coaFormControl","extraTranslationParams"],["trailingIcon","send",1,"h-10","w-20",3,"click","disabled"],[1,"font-semibold"]],template:function(i,n){i&1&&(s(0,"div",0),v(1,Xi,8,0)(2,Zi,4,0),a(),s(3,"ui-text-field",1),y("keydown.control.enter",function(){return n.onSend()}),a(),s(4,"ui-button",2),y("click",function(){return n.onSend()}),a()),i&2&&(m(),b(n.requiresComment()?1:2),m(2),h("coaFormControl",n.complaintFc)("extraTranslationParams",Z(4,Qi,n.minCommentLength)),m(),h("disabled",n.requiresComment()&&!n.complaintFc.valid))},dependencies:[bt,ye,$],encapsulation:2})}}return t})();function tn(t,o){t&1&&(s(0,"div",2),p(1,"ui-loader-dot",4),s(2,"span"),c(3),a()()),t&2&&(m(3),O(o))}function nn(t,o){if(t&1){let e=B();s(0,"brain-feedback",6),y("feedbackEvent",function(n){F(e);let r=g(),l=g();return A(l.onFeedback(n,r.runId,r.feedbackId))}),a()}if(t&2){let e=g();h("comment",e.comment)}}function on(t,o){if(t&1&&v(0,nn,1,1,"brain-feedback",5),t&2){let e=g();b(e.showFeedback(o)?0:-1)}}var ui=(()=>{class t{constructor(){this.sanitizer=d(vt),this.store=d(te),this.access=d(De),this.isFirstTokenRendered=!1,this.firstTokenRendered$=new et(!1),this.requestContent=Y.required(),this.index=Y.required(),this.index$=yt(this.index).pipe(Ve()),this.messages$=this.index$.pipe(Ue(e=>this.store.select(Kt(e))),Q({bufferSize:1,refCount:!0})),this.feedback$=this.index$.pipe(Ue(e=>this.store.select(Xt(e))),Q({bufferSize:1,refCount:!0})),this.system$=it([this.messages$,this.firstTokenRendered$]).pipe(I(([e,i])=>{let n=e.filter(r=>r.message_type==="response");if(n.length===0)return null;for(let r=n.length-1;r>=0;r--){let l=n[r];if(l.response_type==="error")return`\u26A0\uFE0F ${l.content}`;if(i)return null;if(l.response_type==="system")return l.content}return null}),Ve(),Q({bufferSize:1,refCount:!0})),this.responseHtml$=this.messages$.pipe(I(e=>e.filter(i=>i.message_type==="response"&&i.response_type==="token")),ze((e,i)=>{let n=e.processedTokenCount,r=i.length;if(r<n)return{html:i.map(u=>u.content).join(""),processedTokenCount:r};if(r===n)return e;let l=i.slice(n).map(u=>u.content).join("");return{html:e.html+l,processedTokenCount:r}},{html:"",processedTokenCount:0}),I(e=>e.html),T(e=>e.length>0),nt(t.STREAM_RENDER_BATCH_MS),ze((e,i)=>{try{let n=this.sanitizer.bypassSecurityTrustHtml(i);return this.isFirstTokenRendered||i.indexOf(">")>0&&(this.isFirstTokenRendered=!0,this.firstTokenRendered$.next(!0)),n}catch(n){return e}},this.sanitizer.bypassSecurityTrustHtml("")))}static{this.STREAM_RENDER_BATCH_MS=40}showFeedback(e){return!!e?.runId&&!this.access.isInternal()}onFeedback(e,i,n){this.store.dispatch(x.submitFeedback({index:this.index(),runId:i,feedbackId:n,reaction:e.reaction,comment:e.comment}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["brain-interaction"]],inputs:{requestContent:[1,"requestContent"],index:[1,"index"]},decls:9,vars:10,consts:[[1,"interaction","flex","flex-col"],[1,"request","relative","my-2","max-w-[80%]","self-end","rounded-lg","rounded-br-none","bg-[#dcf8c6]","px-3","py-2","text-sm","leading-snug","wrap-break-word","text-[#303030]","shadow-sm"],[1,"status","text-fg-muted","flex","items-center","gap-2","self-start","px-2","text-sm"],["brainChatWidgets","","brainDataSources","","brainContentIds","","brainProductIds","","brainFormulationIds","","brainProductName","",1,"response",3,"innerHTML"],[1,"text-deep-purple","shrink-0"],[1,"mt-4",3,"comment"],[1,"mt-4",3,"feedbackEvent","comment"]],template:function(i,n){if(i&1&&(s(0,"div",0)(1,"div",1),c(2),a(),v(3,tn,4,1,"div",2),L(4,"async"),p(5,"div",3),L(6,"async"),v(7,on,1,1),L(8,"async"),a()),i&2){let r,l;m(2),ge(" ",n.requestContent()," "),m(),b((r=N(4,4,n.system$))?3:-1,r),m(2),h("innerHTML",N(6,6,n.responseHtml$),at),m(2),b((l=N(8,8,n.feedback$))?7:-1,l)}},dependencies:[ri,ni,ai,li,di,mi,pi,ii,ee],styles:[`[_nghost-%COMP%]   .interaction[_ngcontent-%COMP%] > .response[_ngcontent-%COMP%]    >:first-child{margin-top:calc(var(--spacing, .25rem) * 4)}[_nghost-%COMP%]   .interaction[_ngcontent-%COMP%] > .response[_ngcontent-%COMP%]     td ul.llm-cell-list, [_nghost-%COMP%]   .interaction[_ngcontent-%COMP%] > .response[_ngcontent-%COMP%]     td ol.llm-cell-list{margin:calc(var(--spacing, .25rem) * 0);list-style-type:none;padding:calc(var(--spacing, .25rem) * 0);color:inherit}[_nghost-%COMP%]   .interaction[_ngcontent-%COMP%] > .response[_ngcontent-%COMP%]     td .llm-cell-list>li{margin:calc(var(--spacing, .25rem) * 0);padding:calc(var(--spacing, .25rem) * 0);color:inherit;font-size:inherit;line-height:inherit}[_nghost-%COMP%]   .interaction[_ngcontent-%COMP%] > .response[_ngcontent-%COMP%]     td .llm-cell-list>li+li{margin-top:calc(var(--spacing, .25rem) * 1)}[_nghost-%COMP%]   .interaction[_ngcontent-%COMP%] > .response[_ngcontent-%COMP%]     td.llm-cell-inline-bar-scale{vertical-align:middle}
4
5`],changeDetection:0})}}return t})();var rn=(t,o)=>o.index;function sn(t,o){if(t&1&&p(0,"brain-interaction",3),t&2){let e=o.$implicit;h("index",e.index)("requestContent",e.requestContent)}}function an(t,o){if(t&1&&(s(0,"div",1),G(1,sn,1,2,"brain-interaction",3,rn),a()),t&2){g();let e=ut(1);m(),K(e)}}function cn(t,o){t&1&&p(0,"ui-tag",13)}function ln(t,o){if(t&1){let e=B();s(0,"ui-slide")(1,"div",8)(2,"button",9),y("click",function(){let n=F(e).$implicit,r=g(2);return A(r.promptSelect.emit(n.text))}),s(3,"span",10),p(4,"ui-icon",11),s(5,"span",12),c(6),a(),v(7,cn,1,0,"ui-tag",13),a()()()()}if(t&2){let e=o.$implicit;m(6),O(e.text),m(),b(e.visibility==="cad"?7:-1)}}function dn(t,o){if(t&1&&(s(0,"div",2)(1,"div",4)(2,"p",5),c(3,"How can I help you today?"),a(),s(4,"h3",6),c(5,"Try one of these examples:"),a()(),s(6,"ui-slides",7),G(7,ln,8,2,"ui-slide",null,X),a()()),t&2){let e=g();
5m(6),h("config",e.promptSlidesConfig)("viewportHeightPx",170),m(),K(e.visibleExamplePrompts())}}var hi=(()=>{class t{constructor(){this.authService=d(ne),this.websocketsService=d(H),this.isCadEmployee=this.authService.isCadEmployeeSignal(),this.promptSelect=new st,this.examplePrompts=[{text:"What are the benefits of TEGO Dispers 755 W?",visibility:"public"},{text:"Compare TEGO Airex 920, TEGO Airex 921 and TEGO Airex 971.",visibility:"public"},{text:"Recommend me an alternative for BYK 094",visibility:"cad"},{text:"What are the best products to control foam in can coatings?",visibility:"public"},{text:"Can you give me a starting point formulation for architectural coatings?",visibility:"public"},{text:"Give me the TDS of TEGO Foamex 812 in English.",visibility:"public"}],this.visibleExamplePrompts=ve(()=>this.examplePrompts.filter(e=>e.visibility==="public"||this.isCadEmployee())),this.promptSlidesConfig={slidesPerView:3,loop:!0,autoplay:{delay:3500,disableOnInteraction:!1,pauseOnMouseEnter:!0}},this.interactions$=this.websocketsService.messageRequest$.pipe(I(e=>{let i=new Set;return e.filter(n=>!i.has(n.index)&&i.add(n.index)).map(n=>({index:n.index,requestContent:n.content})).sort((n,r)=>n.index-r.index)}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["brain-chat"]],outputs:{promptSelect:"promptSelect"},decls:5,vars:4,consts:[[1,"space-y-2"],[1,"prose","max-w-none"],[1,"flex","h-full","flex-col","items-center","justify-center","space-y-8","p-8"],[3,"index","requestContent"],[1,"prose","text-center"],[1,"text-gray-600"],[1,"text-gray-800"],["navOrientation","vertical",1,"block","w-full","max-w-xl",3,"config","viewportHeightPx"],[1,"px-8"],[1,"group","relative","flex","w-full","flex-col","items-start","justify-center","gap-1","rounded-xl","border","border-gray-200","bg-white","px-4","py-3","text-left","shadow-sm","transition-all","hover:border-purple-200","hover:bg-purple-50","hover:shadow-md",3,"click"],[1,"flex","w-full","items-center","gap-2","text-sm","font-medium","text-gray-800","group-hover:text-gray-900"],["icon","chat_paste_go","outlined","","size","small"],[1,"line-clamp-1","pr-6"],["text","Internal","size","sm",1,"absolute","-top-1","right-2","z-10","h-4"]],template:function(i,n){if(i&1&&(s(0,"div",0),mt(1),L(2,"async"),v(3,an,3,0,"div",1)(4,dn,9,2,"div",2),a()),i&2){m();let r=pt(N(2,1,n.interactions$));m(2),b(r!=null&&r.length?3:4)}},dependencies:[ui,z,Ae,Fe,Bt,ee],encapsulation:2,changeDetection:0})}}return t})();function mn(t,o){if(t&1){let e=B();s(0,"div",7)(1,"button",11),y("click",function(){F(e);let n=g();return A(n.reset())}),p(2,"ui-icon",12),s(3,"span",13),c(4,"Reset chat"),a()()()}}var fi=(()=>{class t{constructor(){this.websocketsService=d(H),this.alertService=d(ie),this.document=d(rt),this.isBrowser=Et(),this.autoscrollService=d(Ie),this.window=this.document.defaultView,this.renderer=d(ct),this.initial=!0,this.complaintFc=new Ce(null),this.isReady$=this.websocketsService.isReady$,this.destroy$=new Ze,this.indexes$=this.websocketsService.messageRequest$.pipe(I(e=>Array.from(new Set(e.map(i=>i.index))).sort((i,n)=>i-n)))}ngAfterViewInit(){this.isBrowser&&(this.initDebug(),this.autoscrollService.start())}ngOnInit(){this.isBrowser&&(this.websocketsService.connect(Ke()),this.handleInitialQueryPrompt())}ngOnDestroy(){this.isBrowser&&(this.autoscrollService.stop(),this.destroy$.next(),this.destroy$.complete(),this.websocketsService.disconnect(),this.renderer.removeClass(this.document.body,"brain-chat-active"))}handleInitialQueryPrompt(){let e=new URL(this.window.location.href);if(!e.searchParams.has("q"))return;let i=e.searchParams.get("q");e.searchParams.delete("q"),this.window.history.replaceState(this.window.history.state,this.document.title,`${e.pathname}${e.search}${e.hash}`),i&&(this.alertService.alertSuccess("Disclaimer: This ChatBot service \u201ECOATINO\xAE Brain\u201C is intended for internal use only within the organization. It is currently a test version designed to evaluate and improve automated support features related to publicly available website content and documentation.",{duration:15e3}),this.complaintFc.setValue(i),this.isReady$.pipe(T(Boolean),J(1)).subscribe(()=>{this.submit()}))}reset(){this.initial=!0,this.websocketsService.reset(),this.websocketsService.connect(Ke()),this.autoscrollService.reset()}submit(){let e=this.complaintFc.value;e&&(this.initial=!1,this.websocketsService.sendPrompt(e),this.complaintFc.reset())}onEnter(){this.isReady$.pipe(T(Boolean),J(1)).subscribe(()=>{this.submit()})}onPromptSelect(e){this.complaintFc.setValue(e),this.submit()}initDebug(){let e="debug-test";new URL(this.window.location.href).hash.search(e)>-1&&(this.complaintFc.setValue(e),this.isReady$.pipe(T(Boolean),J(1)).subscribe(()=>{this.submit()}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=C({type:t,selectors:[["brain-chat-page"]],hostAttrs:[1,"flex!","flex-col","items-center","flex-1"],decls:14,vars:10,consts:[["chatInput",""],["src","/assets/svg/brain_logo.svg","alt","brain-logo",1,"mt-6"],[1,"flex","w-full","max-w-[700px]","flex-1","flex-col","px-2",3,"ngClass"],[3,"promptSelect"],[1,"mt-6","mb-6","flex","flex-col","items-center","gap-2"],[1,"flex","w-full"],[1,"relative","flex","w-full","flex-col","items-end","gap-1"],[1,"absolute","right-1","bottom-9","ml-auto"],["label","Ask Coatino","autofocus","","hideSubscript","",1,"w-full!","scroll-mb-10",3,"keydown.enter","coaFormControl"],["trailingIcon","send",1,"ml-1","h-10","w-20",3,"click","disabled"],[1,"text-fg-muted","text-center","text-sm"],[1,"text-fg-muted","hover:text-fg-danger","inline-flex","w-full","cursor-pointer","items-center","gap-0.5","hover:underline",3,"click"],["icon","restart_alt","size","small"],[1,"typo--body-small"]],template:function(i,n){if(i&1){let r=B();p(0,"img",1),s(1,"div",2)(2,"brain-chat",3),y("promptSelect",function(u){return F(r),A(n.onPromptSelect(u))}),a(),s(3,"div",4)(4,"div",5)(5,"div",6),v(6,mn,5,0,"div",7),L(7,"async"),s(8,"ui-text-field",8,0),y("keydown.enter",function(){return F(r),A(n.onEnter())}),a()(),s(10,"ui-button",9),L(11,"async"),y("click",function(){return F(r),A(n.submit())}),a()(),s(12,"p",10),c(13,"Answers are generated by AI. Check important information."),a()()()}if(i&2){let r;m(),h("ngClass",n.initial?"mt-[10vh]":"mt-6"),m(),dt(n.initial?"":"flex-1"),m(4),b((r=N(7,6,n.indexes$))!=null&&r.length?6:-1),m(2),h("coaFormControl",n.complaintFc),m(2),h("disabled",N(11,8,n.isReady$)===!1)}},dependencies:[hi,$,ye,z,gt,ee],encapsulation:2,changeDetection:0})}}return t})();var pn=[{path:"",data:Ge({title:"Brain",description:"Use COATINO\xAE Brain to find coatings knowledge faster. Ask product, application, and formulation questions in natural language and get focused answers based on COATINO\xAE content."}),children:[{path:"diagnostics",loadComponent:()=>import("./chunk-SPCFUWN2.js").then(t=>t.DiagnosticsPage),data:Ge({title:"Brain connection diagnostics",description:"Check your browser connection to COATINO Brain."})},{path:"chat",canActivate:[Rt],component:fi,providers:[Xe(),H,Ie]},{path:"",pathMatch:"full",component:Ut}]}];export{pn as ROUTES,Xe as provideBrainState};

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.