@aquera/data-visualizer-sdk 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ask-aquera/src/ask-aquera-config.d.ts +10 -0
- package/chunk-3ANFJNEW.js +18 -0
- package/{chunk-KRLLBWXX.js → chunk-AFTJULGE.js} +688 -688
- package/chunk-I4PGOKUA.js +2 -0
- package/{chunk-5OHN7YS2.js → chunk-J4NO6UPD.js} +1 -1
- package/{chunk-FYNF5FCN.js → chunk-V77IQCJY.js} +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/chunk-BJIGX7YA.js +0 -2
- package/chunk-T2W7AVC3.js +0 -18
package/chunk-T2W7AVC3.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import{A as ae,Aa as ot,B as jt,Ba as vn,C as he,Ca as wn,Da as re,E as Qt,Ea as kn,F as Yt,G as Kt,Ha as at,I as Oe,Ia as Pn,K as Jt,L as Xt,M as Zt,Ma as An,N as en,Na as rt,O as tn,Oa as Mn,P as nn,Q as on,R as an,S as rn,T as De,U as ln,V as sn,W as dn,X as cn,Y as pn,_ as Ee,a as yt,aa as Ie,b as vt,d as Ot,da as Ve,e as Dt,ea as Re,fa as ze,g as oe,ga as Ne,h as me,ha as $e,i as Et,ia as Le,j as It,ja as We,ka as Be,l as Vt,la as _n,m as et,ma as tt,n as Rt,na as un,o as zt,oa as gn,pa as mn,q as Nt,qa as hn,ra as fn,s as ee,t as $t,ta as Cn,u as Lt,ua as xn,v as Wt,va as bn,w as Bt,wa as nt,x as Ut,xa as yn,y as Gt,ya as fe,z as Ht,za as it}from"./chunk-KRLLBWXX.js";import{$b as St,Ab as w,Eb as g,Gb as r,Ja as Ke,Jb as Mt,Ka as Fe,Kb as se,La as s,Lb as de,N as ue,Ob as ce,Pb as Z,Qb as B,Rb as Xe,S as $,Sb as p,Tb as P,Ub as T,Vb as J,X as _,Y as u,ab as ge,ac as ve,cc as Tt,ea as wt,ec as Ft,fb as Je,fc as Ze,ha as kt,ia as x,kb as At,kc as q,la as Te,lb as F,mb as f,nb as C,nc as qe,ob as Q,oc as qt,p as V,pa as Pt,qb as O,rb as D,sb as v,tb as l,ub as d,vb as m,zb as ye}from"./chunk-Z5FDX7CX.js";import{a as b,b as S,d as Se}from"./chunk-ZW5NV4UO.js";function Sn(){return{baseUrl:ee.baseUrl??"",mcpUrl:ee.MCP_URL??"",adminApiUrl:ee.ADMIN_API_URL??"",utilitiesUrl:ee.UTILITIES_ENGINE_URL??"",proxyUrl:ee.PROXY_BASEAPI_URL??"",tokenizedOrigins:[ee.baseUrl,ee.ADMIN_API_URL,ee.MCP_URL,ee.UTILITIES_ENGINE_URL,ee.PROXY_BASEAPI_URL].filter(i=>!!i),headers:{},customerId:null,productId:null,productName:null,authMode:"inherit",authToken:null,getToken:null,onUnauthorized:null,ssoEnabled:ee.SSO_ENABLED??!1,features:{mcpGateway:ee.MCP_GATEWAY_ENABLED??!1,forecast:!0,connections:!0,attachments:!0,stories:!1,promptGallery:!0,dashboardsMenu:!0,executiveSummary:!0,alerts:!0,library:!0},ui:{theme:"light",density:"comfortable",header:!0,locale:"en"},copy:li(),routing:"none",initial:{dashboardId:null,conversationId:null}}}function li(){return{composerPlaceholder:"Ask anything about your workforce data\u2026",welcomeTitle:"What would you like to ask?",welcomeSubtitle:"Ask anything about your workforce data.",dropFilesOverlay:"Drop images or Excel files to attach",replyButton:"Reply",defineItButton:"Define it",submitAnswersButton:"Submit answers",givePlanButton:"Give me the plan \u2192",somethingElseButton:"Something else? Tell me what to do \u2192",chatDraftPlaceholderWidget:"Tell me what to check instead\u2026",chatDraftPlaceholderClarification:"Tell me more\u2026",chatDraftPlaceholderPlan:"Tell me what to change about this widget\u2026",chatDraftPlaceholderIntake:"Type your own answer\u2026",filterValuePlaceholder:"Value\u2026",promptGallerySearchPlaceholder:"Search prompts\u2026",promptGalleryLabel:"Prompt gallery",noPromptsMatch:"No prompts match",noPromptsYet:"No prompts yet.",noChoiceOptions:"No options available to choose from.",noChartTypesFit:"No other chart types fit this widget's data.",noFilterableFields:"No filterable fields found for this chart's data.",dashboardNamePlaceholder:"Enter a name\u2026",saveDashboardDialogLabel:"Save as dashboard",saveDashboardButton:"Save dashboard",cancelButton:"Cancel",applyButton:"Apply",forecastSettingsLabel:"Forecast settings",forecastButton:"Forecast",removeForecastButton:"Remove forecast",newConversationLabel:"New conversation",newDashboardLabel:"New dashboard",noConversationsYet:"No conversations yet",noDashboardsYet:"No dashboards yet",noDatasetsFound:"No datasets found",noPipelinesFound:"No pipelines found",createAlertButton:"Create alert",addToLibraryButton:"Add to library",addToDashboardButton:"Add to dashboard",addToCurrentDashboardButton:"Add to current dashboard",addToStoryButton:"Add to Story",publishAsDashboardButton:"Publish as a new dashboard",viewButton:"View",recomputeButton:"Recompute",chatTabLabel:"Conversation",libraryTabLabel:"Library",detailCanvasCrumbLabel:"Canvas",detailCrumbLabel:"Detail",libraryIntroTitle:"Start from a pre-canned widget or dashboard",libraryIntro:"\u2014 pick what you need, then refine it on the canvas.",libraryWidgetsTabLabel:"Widgets",libraryDashboardsTabLabel:"Dashboards",librarySearchWidgetsPlaceholder:"Search widgets\u2026",librarySearchDashboardsPlaceholder:"Search dashboards\u2026",libraryAllCategoryLabel:"All",librarySelectAllButton:"Select all",libraryClearSelectionButton:"Clear",librarySelectedCount:"{n} selected",libraryAddToCanvasButton:"Add {n} to canvas",libraryWidgetCountChip:"{n} widgets",noWidgetsMatch:"No widgets match your search.",noWidgetsInCategory:"No widgets in this category yet.",noDashboardsMatch:"No dashboards match your search.",noDashboardsInCategory:"No dashboards in this category yet.",emptyCanvasTitle:"Your canvas is empty",emptyCanvasSubtitle:"Add widgets or a whole dashboard from the Library \u2014 or ask a question in Chat.",connectionsTitle:"Connections",connectionsBreadcrumbHome:"Ask Aquera",registerConnectionTitle:"Register connection",registerConnectionButton:"Register connection",registerAndTestButton:"Register & test",registeringButton:"Registering\u2026",testConnectionButton:"Test",loadingConnections:"Loading connections\u2026",noConnectionsTitle:"No connections yet",noConnectionsSub:"Register a connection to start using Ask Aquera with your data source.",connectionNamePlaceholder:"Primary",displayNamePlaceholder:"My workforce data",errors:{assistantErrorFallback:"Failed to generate a response. Please try again.",connectionTestFailedFallback:"Connection failed",couldntForecastWidget:"Couldn't forecast this widget.",couldntLoadDatasetsOrPipelines:"Failed to load datasets / pipelines",couldntOpenConversation:"Couldn't open that conversation. Please try again.",couldntDeleteConversation:"Couldn't delete that conversation. Please try again.",couldntCreateDashboard:"Couldn't create the dashboard. Please try again.",couldntRenameConversation:"Couldn't rename that conversation. Please try again.",tooManyExcelAttachments:"You can attach up to 10 Excel files.",tooManyNonExcelAttachments:"You can attach only one non-Excel file.",unsupportedFileType:"isn't a supported file type.",fileTooLarge:"is larger than 10 MB.",couldntUpdateForecast:"Couldn't update that forecast. Please try again.",couldntSaveToLibrary:"Couldn't save that to your widget library. Please try again.",couldntApplyFilter:"Couldn't apply that filter. Please try again.",couldntAddToDashboard:"Couldn't add this to the dashboard. Please try again.",couldntPublishDashboard:"Couldn't publish the dashboard. Please try again.",couldntRenameDashboard:"Couldn't rename the dashboard. Please try again.",couldntGenerateSummary:"Failed to generate summary.",couldntSaveDashboard:"Couldn't save the dashboard. Please try again.",chartTypeChangeFailed:"Chart type change failed"}}}var Tn=zt("dvz-ask",Sn);function R(){return Tn.read()}function lt(i){let t=Sn(),e=S(b(b({},t),Ce(i)),{features:b(b({},t.features),Ce(i.features??{})),ui:b(b({},t.ui),Ce(i.ui??{})),copy:S(b(b({},t.copy),Ce(i.copy??{})),{errors:b(b({},t.copy.errors),Ce(i.copy?.errors??{}))}),initial:b(b({},t.initial),Ce(i.initial??{})),headers:b(b({},t.headers),i.headers??{})});return i.tokenizedOrigins||(e.tokenizedOrigins=[e.baseUrl,e.adminApiUrl,e.mcpUrl,e.utilitiesUrl,e.proxyUrl].filter(n=>!!n)),Tn.write(e)}async function Ue(){return Nt(R())}function Fn(i,t){return i.replace("{n}",String(t))}function Ce(i){let t={};for(let[e,n]of Object.entries(i))n!==void 0&&(t[e]=n);return t}var pe=class i{http=$(me);tokenStore=$(ae);get customerId(){return this.tokenStore.tenantId()??""}async fetchGridPage(t,e,n,o,a,c,h,y){let A=`${R().baseUrl}/api/customers/${this.customerId}/products/${he()}/workforce/data-grid/${t}?pageIndex=${e}&pageSize=${n}`,M=(o??[]).filter(k=>k&&k.value!=null&&String(k.value).trim()!=="");return M.length&&(A+=`&filters=${encodeURIComponent(JSON.stringify(M))}`),a&&Object.keys(a).length&&(A+=`&dashboardFilters=${encodeURIComponent(JSON.stringify(a))}`),h&&h.length&&(A+=`&resolvedFilters=${encodeURIComponent(JSON.stringify(h))}`),c&&(A+=`&dashboardId=${encodeURIComponent(c)}`),y&&(A+=`&conversationId=${encodeURIComponent(y)}`),V(this.http.get(A))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ue({token:i,factory:i.\u0275fac,providedIn:"root"})};var st=["image/png","image/jpeg","image/webp","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"],qn=10*1024*1024,dt=1,ct=10,si=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"];function pt(i,t){return si.includes(t)||/\.(xls|xlsx)$/i.test(i)}var xe=class i{http=$(me);tokenStore=$(ae);lastSentCustomerId=null;lastSentProductId=null;get customerId(){return R().customerId??this.tokenStore.tenantId()??""}get productId(){return R().productId??he()}get baseUrl(){return`${R().baseUrl}/api/customers/${this.customerId}/products/${this.productId}/workforce`}mcpGatewayUrl(){return`${R().baseUrl}/dviz-mcp`}async callMcpTool(t,e={},n){let o=this.customerId,a=this.productId,c=b({},n);o!==this.lastSentCustomerId&&(c.customerId=o),a!==this.lastSentProductId&&(c.productId=a);let h;try{h=await V(this.http.post(this.mcpGatewayUrl(),{jsonrpc:"2.0",id:Date.now(),method:"tools/call",params:{name:t,arguments:e}},{headers:{Accept:"application/json, text/event-stream"},params:c})),this.lastSentCustomerId=o,this.lastSentProductId=a}catch(A){throw A instanceof oe?new Error(A.error?.error?.message||A.error?.message||A.message):A}if(h.error)throw new Error(h.error.message);let y=h.result;if(y?.isError)throw new Error(y.structuredContent?.error?.message??y.content?.[0]?.text??`${t} failed`);return y?.structuredContent??{}}async listConversations(t=30){return!this.customerId||!this.productId?[]:R().features.mcpGateway?(await this.callMcpTool("listConversations",{limit:t,status:"active"}))?.conversations??[]:(await V(this.http.get(`${this.baseUrl}/conversations?limit=${t}&status=active`)))?.data??[]}async getConversation(t){if(!t)return null;if(!R().features.mcpGateway){let h=await V(this.http.get(`${this.baseUrl}/conversations/${t}`));if(!h?.data)return null;let a=h.data,{messages:y}=a;return{conversation:Se(a,["messages"]),messages:y??[]}}let e=await this.callMcpTool("getConversation",{conversationId:t});if(!e?.conversation)return null;let c=e.conversation,{messages:n}=c;return{conversation:Se(c,["messages"]),messages:n??[]}}async updateConversation(t,e){await V(this.http.patch(`${this.baseUrl}/conversations/${t}`,e))}async deleteConversation(t){if(!R().features.mcpGateway){await V(this.http.delete(`${this.baseUrl}/conversations/${t}`));return}await this.callMcpTool("deleteConversation",{conversationId:t})}async streamChat(t,e,n,o,a,c,h,y){return c?.length||!R().features.mcpGateway?this.streamChatViaSse(t,e,n,o,a,c,h,y):this.sendChatViaGateway(t,e,n,o,a)}async sendChatViaGateway(t,e,n,o,a){let c={message:e};t&&(c.conversationId=t),o&&(c.connectionId=o);let h=Date.now(),y=new URL(this.mcpGatewayUrl());y.searchParams.set("customerId",this.customerId),y.searchParams.set("productId",this.productId);let A=this.tokenStore.accessToken()??"",M=!1,k=!1,z=I=>{switch(M=!0,I?.kind){case"text":n.onText(I.text??"");break;case"toolCall":n.onToolStart(I.toolId,I.uiLabel??"");break;case"toolResult":n.onToolResult(I.toolId,I.uiDetail??"",!!I.error);break;case"data":{let E=I.payload;E?.data_type==="adhoc_viz"?n.onDataPart(E):E?.data_type==="dashboard_title"?n.onDashboardTitle?.(E.data?.title??""):E?.data_type==="choice"?n.onChoice?.(E.data):E?.data_type==="layout_patch"&&n.onLayoutPatch?.(E.data);break}case"error":n.onError(I.message??"Unknown error");break}},X=I=>{if(I?.isError){let L=I.structuredContent?.error?.message??I.content?.[0]?.text??"askAquera failed";n.onError(L),n.onFinish("error",t??""),k=!0;return}let E=I?.structuredContent??{};if(!M){n.onText(E.responseText??E.text??""),E.dashboardTitle&&n.onDashboardTitle?.(E.dashboardTitle);let L=E.widget?[E.widget]:E.widgets??[];for(let G of L)n.onDataPart({type:"data",data_type:"adhoc_viz",version:1,data:G})}n.onFinish("stop",E.conversationId??t??""),k=!0},Y=I=>{if(I.method==="notifications/gateway/stream"){z(I.params??{});return}if(I.id===h){if(I.error){n.onError(I.error.message??"askAquera failed"),n.onFinish("error",t??""),k=!0;return}X(I.result)}},U;try{U=await fetch(y.toString(),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream",Authorization:`Bearer ${A}`},body:JSON.stringify({jsonrpc:"2.0",id:h,method:"tools/call",params:{name:"askAquera",arguments:c}}),signal:a})}catch(I){if(I instanceof DOMException&&I.name==="AbortError")throw I;n.onError(I instanceof Error?I.message:String(I)),n.onFinish("error",t??"");return}if(!U.ok){let I=await U.text().catch(()=>U.statusText);n.onError(`Request failed (${U.status}): ${I}`),n.onFinish("error",t??"");return}if(!(U.headers.get("content-type")??"").includes("text/event-stream")||!U.body){let I=await U.json().catch(()=>null);if(!I){n.onError("Invalid response from server"),n.onFinish("error",t??"");return}Y(I);return}let le=U.body.getReader(),N=new TextDecoder,K="";for(;;){let{done:I,value:E}=await le.read();if(I)break;K+=N.decode(E,{stream:!0});let L=K.split(`
|
|
2
|
-
|
|
3
|
-
`);K=L.pop()??"";for(let G of L){let H=G.split(`
|
|
4
|
-
`).find(W=>W.startsWith("data:"));if(H){try{Y(JSON.parse(H.slice(5).trim()))}catch{}if(k)return}}}k||(n.onError("Stream ended unexpectedly"),n.onFinish("error",t??""))}async streamChatViaSse(t,e,n,o,a,c,h,y){let A=this.tokenStore.accessToken()??"",M=`${this.baseUrl}/v1/conversations/chat`,k={message:e};t&&(k.conversationId=t),o&&(k.connectionId=o),c?.length&&(k.attachments=c),h&&(k.isPipeline=!0),y&&(k.dashboardId=y);let z=await fetch(M,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${A}`},body:JSON.stringify(k),signal:a});if(!z.ok){let j=await z.text().catch(()=>z.statusText);n.onError(`Request failed (${z.status}): ${j}`);return}if(!z.body){n.onError("No response body received");return}let X=z.body.getReader(),Y=new TextDecoder,U="";for(;;){let{done:j,value:le}=await X.read();if(j)break;U+=Y.decode(le,{stream:!0});let N=U.split(`
|
|
5
|
-
`);U=N.pop()??"";for(let K of N){let I=K.trim();I&&this.parseLine(I,n)}}U.trim()&&this.parseLine(U.trim(),n)}async getSuggestedPrompts(t,e){if(!this.customerId||!this.productId)return{widgetSuggestions:[],conversationStarters:[]};let n={};return t&&(n.connectionId=t),e&&(n.isPipeline="true"),R().features.mcpGateway?await this.callMcpTool("getSuggestedPrompts",{},n)??{widgetSuggestions:[],conversationStarters:[]}:(await V(this.http.get(`${this.baseUrl}/conversations/suggested-prompts`,{params:n})))?.data??{widgetSuggestions:[],conversationStarters:[]}}async listDashboards(t=20){return!this.customerId||!this.productId?[]:R().features.mcpGateway?(await this.callMcpTool("listDashboards",{limit:t,published:"all"}))?.dashboards??[]:(await V(this.http.get(`${this.baseUrl}/dashboards?limit=${t}`)))?.data??[]}async getDashboard(t){if(!t)return null;if(!R().features.mcpGateway){let n=await V(this.http.get(`${this.baseUrl}/dashboards/${t}`));return n?.data??n??null}return(await this.callMcpTool("getDashboard",{dashboardId:t}))?.dashboard??null}async listDashboardsForConversation(t){if(!t||!this.customerId||!this.productId)return[];if(!R().features.mcpGateway){let n=await V(this.http.get(`${this.baseUrl}/dashboards?conversationId=${encodeURIComponent(t)}`)),o=n?.data??n;return Array.isArray(o)?o:[]}return(await this.callMcpTool("listDashboards",{conversationId:t,published:"all"}))?.dashboards??[]}async changeAdhocChartType(t,e){let n;try{n=await V(this.http.post(`${this.baseUrl}/conversations/change-type`,{widgetConfig:t,newChartType:e}))}catch(o){throw o instanceof oe?new Error(o.error?.error||o.message):o}if(n?.success===!1||!n?.chart)throw new Error(n?.error||"Chart type change failed");return n.chart}async listAdhocFilterFields(t){let e;try{e=await V(this.http.post(`${this.baseUrl}/conversations/filter-fields`,{widgets:t}))}catch(n){throw n instanceof oe?new Error(n.error?.error||n.message):n}if(e?.success===!1)throw new Error(e?.error||"Could not load filter fields");return e?.fields??[]}async fetchAdhocFilterValues(t,e,n=""){let o;try{o=await V(this.http.post(`${this.baseUrl}/conversations/filter-values`,{widgets:t,field:e,prefix:n}))}catch(a){throw a instanceof oe?new Error(a.error?.error||a.message):a}if(o?.success===!1)throw new Error(o?.error||"Could not load filter values");return{field:e,values:o?.values??[],complete:o?.complete??!0}}async applyAdhocFilter(t,e){let n;try{n=await V(this.http.post(`${this.baseUrl}/conversations/filter-apply`,{widgetConfig:t,filters:e}))}catch(o){throw o instanceof oe?new Error(o.error?.error||o.message):o}if(n?.success===!1||!n?.chart)throw new Error(n?.error||"Filter could not be applied");return n.chart}async filterSuggest(t,e,n,o="draft"){let a=n.filter(y=>!!y.id).map(y=>({widgetId:y.id})),c;try{c=await V(this.http.post(`${this.baseUrl}/dashboards/${t}/filter/suggest?status=${o}`,{query:e,refreshCache:!1,widgets:a}))}catch(y){throw y instanceof oe?new Error(y.error?.error||y.message):y}if(c?.success===!1)throw new Error(c.error||"Request failed");let h=c?.data??{completions:[],suggestions:[]};return{nextToken:h.nextToken,completions:Array.isArray(h.completions)?h.completions:[],suggestions:Array.isArray(h.suggestions)?h.suggestions:[]}}async applyFilters(t,e,n,o="draft",a,c){let h=await new Promise((X,Y)=>{let U=this.http.post(`${this.baseUrl}/dashboards/${n}/filter/apply?status=${o}`,xn(t,e,c)).subscribe({next:j=>X(j),error:j=>{Y(j instanceof oe?new Error(j.error?.error||j.message):j)}});if(a){if(a.aborted){U.unsubscribe();let j=new Error("Aborted");j.name="AbortError",Y(j);return}a.addEventListener("abort",()=>{U.unsubscribe();let j=new Error("Aborted");j.name="AbortError",Y(j)},{once:!0})}});if(h?.success===!1)throw new Error(h.error||"Request failed");let y=h?.data??h,A=Array.isArray(y)?y:y?.widgets;if(!Array.isArray(A))throw new Error("Invalid response from apply-filters API");let M=!Array.isArray(y)&&Array.isArray(y?.resolvedFilters)?y.resolvedFilters:[],k=!Array.isArray(y)&&typeof y?.filterExplanation=="string"?y.filterExplanation:typeof h?.filterExplanation=="string"?h.filterExplanation:null,z=k&&k.trim()?k.trim():null;return{widgets:A,resolvedFilters:M,filterExplanation:z}}async uploadAttachment(t,e){let n=this.tokenStore.accessToken()??"",o=new FormData;o.append("file",t,t.name);let a=await fetch(`${this.baseUrl}/uploads`,{method:"POST",headers:{Authorization:`Bearer ${n}`},body:o,signal:e?.signal});if(!a.ok){let y=await a.text().catch(()=>a.statusText);throw new Error(`Upload failed (${a.status}): ${y}`)}let c=await a.json().catch(()=>null),h=c?.data?.key??c?.key;if(!h)throw new Error("Upload failed: malformed response");return{key:h}}async listDashboardCategories(){return(await V(this.http.get(`${this.baseUrl}/category-templates/categories`))).data}async listAllCategoryTemplates(){return(await V(this.http.get(`${this.baseUrl}/category-templates/templates`))).data}async previewCategoryTemplateStream(t,e){let n=this.tokenStore.accessToken()??"",o=`${this.baseUrl}/category-templates/${t}/preview`,a;try{a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({})})}catch(M){e.onError(M instanceof Error?M.message:"Network error");return}if(!a.ok){let M=await a.json().catch(()=>null);e.onError(M?.error??`Request failed (${a.status})`);return}if(!a.body){e.onError("No response body received");return}let c=a.body.getReader(),h=new TextDecoder,y="",A=M=>{let k=M.trim();if(!k)return;let z;try{z=JSON.parse(k)}catch{return}switch(z.type){case"template":e.onTemplate?.(z.template);break;case"widget":e.onWidget(z.widget);break;case"skipped":e.onSkipped?.(z.title,z.reason);break;case"error":e.onError(z.message);break;case"done":e.onDone?.();break;default:break}};for(;;){let{done:M,value:k}=await c.read();if(M)break;y+=h.decode(k,{stream:!0});let z=y.split(`
|
|
6
|
-
`);y=z.pop()??"";for(let X of z)A(X)}y.trim()&&A(y)}async createDashboardFromTemplate(t){return(await V(this.http.post(`${this.baseUrl}/category-templates/${t}/dashboard`,{}))).data}async listWidgetTemplates(){return(await V(this.http.get(`${this.baseUrl}/widget-templates`))).data}async previewWidgetTemplate(t){return(await V(this.http.post(`${this.baseUrl}/widget-templates/${t}/preview`,{}))).data}async loadAllWidgetTemplatePreviews(){return(await V(this.http.post(`${this.baseUrl}/widget-templates/preview-all`,{}))).data}async previewWidgetTemplateDetailPanel(t){return(await V(this.http.post(`${this.baseUrl}/widget-templates/${t}/detail-panel`,{}))).data}async previewWidgetDetailPanelDefinition(t){return(await V(this.http.post(`${this.baseUrl}/widget-templates/preview-detail-panel`,{detailPanel:t}))).data}async createDashboard(t){let a=t,{published:e}=a,n=Se(a,["published"]);return R().features.mcpGateway?(await this.callMcpTool("createDashboard",b(b({},n),e?{published:!0}:{}))).dashboard:(await V(this.http.post(`${this.baseUrl}/dashboards${e?"?published=true":""}`,n))).data}async publishDashboard(t){return R().features.mcpGateway?(await this.callMcpTool("publishDashboard",{dashboardId:t}))?.publishedDashboardId??t:(await V(this.http.post(`${this.baseUrl}/dashboards/${t}/publish`,{})))?.data?.publishedDashboardId??t}async deleteDashboard(t){if(!R().features.mcpGateway){await V(this.http.delete(`${this.baseUrl}/dashboards/${t}`));return}await this.callMcpTool("deleteDashboard",{dashboardId:t})}async register(t){return(await V(this.http.post(`${R().baseUrl}/api/customers/${this.customerId}/workforce/register`,t))).data}async listConnections(){return!this.customerId||!this.productId?[]:(await V(this.http.get(`${this.baseUrl}/connections`)))?.data??[]}async listDatasets(){return!this.customerId||!this.productId?[]:((await V(this.http.get(`${this.baseUrl}/connections/datasets`)))?.data??[]).map(e=>({id:e.id,name:e.name}))}async listPipelines(){if(!this.customerId||!this.productId)return[];let t=`${R().baseUrl}/api/customers/${this.customerId}/products/${this.productId}/applications/orchestrations/v2?startIndex=0&limit=100`;return((await V(this.http.get(t)))?.data??[]).map(n=>({id:n.publicOrchestrationGuid??n.guid??n.id??"",name:n.name})).filter(n=>n.id)}async createConnection(t,e){return(await V(this.http.post(`${this.baseUrl}/connections`,{name:t,config:e}))).data}async updateConnection(t,e){return(await V(this.http.put(`${this.baseUrl}/connections/${t}`,e))).data}async testConnection(t){return(await V(this.http.post(`${this.baseUrl}/connections/${t}/test`,{}))).data}async deleteConnection(t){await V(this.http.delete(`${this.baseUrl}/connections/${t}`))}parseLine(t,e){let n=t.indexOf(":");if(n===-1)return;let o=t.slice(0,n),a;try{a=JSON.parse(t.slice(n+1))}catch{return}switch(o){case"f":break;case"0":e.onText(a.text??"");break;case"9":{let c=a;e.onToolStart(c.toolCallId,c.uiLabel??c.toolName??"");break}case"a":{let c=a;e.onToolResult(c.toolCallId,c.result?.uiDetail??"",c.result?.error??!1);break}case"2":{let c=a;c.data_type==="adhoc_viz"?e.onDataPart(c):c.data_type==="dashboard_title"?e.onDashboardTitle?.(c.data?.title??""):c.data_type==="choice"?e.onChoice?.(c.data):c.data_type==="layout_patch"&&e.onLayoutPatch?.(c.data);break}case"3":e.onError(a.error??"Unknown error");break;case"d":{let c=a;e.onFinish(c.finishReason??"stop",c.conversationId??"");break}}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ue({token:i,factory:i.\u0275fac,providedIn:"root"})};function On({hasMessages:i,artifactOpen:t,builderOpen:e}){return t?"split":e?"builder":i?"conversation":"idle"}function Dn(i,t,e){let n=e||"Working",o=i.map(c=>c.id==="thinking"&&c.status==="running"?S(b({},c),{status:"done"}):c),a=o.findIndex(c=>c.status==="running"&&c.baseLabel===n);if(a>=0){let c=o[a],h=[...o];return h[a]=S(b({},c),{callIds:[...c.callIds,t],pending:c.pending+1}),h}return[...o,{id:t,callIds:[t],pending:1,baseLabel:n,label:n,status:"running"}]}function En(i,t,e,n){return i.map(o=>{if(!o.callIds.includes(t))return o;let a=Math.max(0,o.pending-1);return S(b({},o),{pending:a,detail:n?o.detail:e||o.detail,status:a===0?"done":o.status})})}function _t(i){let{finishReason:t,sawError:e,producedContent:n}=i;return t==="error"?!0:t==null?e:e&&!n}var In=i=>S(b({},i),{isStreaming:!1,thinking:void 0,hasError:!0});function Vn(i,t,e){return i.some(n=>n.id===t)?i.map(n=>n.id===t?In(n):n):[...i,In(e(t))]}var Ge=class i{http=$(me);tokenStore=$(ae);get customerId(){return R().customerId??this.tokenStore.tenantId()??""}get productId(){return R().productId??he()}get apiUrl(){return`${R().baseUrl}/api/customers/${this.customerId}/products/${this.productId}/workforcebot/forecast`}cachedContext=null;context(){return this.cachedContext?this.cachedContext:(this.cachedContext=V(this.http.get(`${this.apiUrl}/context`)).catch(t=>(console.info('[ask-aquera] forecast context unavailable \u2014 "forecast this" will not be claimed.',t),null)),this.cachedContext)}async compute(t){try{return await V(this.http.post(`${this.apiUrl}/compute`,t))}catch(e){let n=e,o=n?.error?.error;throw Object.assign(new Error(o||`Forecast failed (HTTP ${n?.status??"?"})`),{status:n?.status,code:n?.error?.code,isRefusal:n?.status===422})}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ue({token:i,factory:i.\u0275fac,providedIn:"root"})};var di=[/\bforecast(?:ing|s|ed)?\b/i,/\bpredict(?:ion|ions|ive|s|ed)?\b/i,/\bproject(?:ion|ions|ed)\b/i,/\bproject\s+(?:our|the|this|that|my|its|their|his|her|forward)\b/i,/\bproject\s+\w+(?:\s+\w+)?\s+forward\b/i,/\bextrapolat\w*/i,/\bnext\s+(?:week|month|quarter|year|\d+\s+(?:weeks?|months?|quarters?|years?))\b/i,/\bby\s+(?:year[-\s]?end|end\s+of\s+(?:the\s+)?year|EOY)\b/i,/\bby\s+Q[1-4]\b/i,/\bthrough\s+(?:year[-\s]?end|end\s+of\s+(?:the\s+)?year)\b/i,/\bhow\s+many\s+\w+\s+will\s+we\b/i,/\bwhat\s+will\s+\w+\s+(?:be|look\s+like)\b/i,/\btrend\s+(?:this\s+)?forward\b/i,/\brun[-\s]?rate\s+to\b/i],ci=[/\bforecast\s+(?:this|that|it)\b/i,/\bextend\s+(?:this|that|it)\b/i,/\bproject\s+(?:this|that|it)\s+forward\b/i,/\btrend\s+(?:this|that|it)\s+forward\b/i,/\b(?:this|that)\s+chart\b/i,/\bsame\s+chart\b/i],pi={Weekly:{week:1,month:4,quarter:13,year:52},Monthly:{week:1,month:1,quarter:3,year:12},Quarterly:{week:1,month:1,quarter:1,year:4},Yearly:{week:1,month:1,quarter:1,year:1}},_i=[[/\b(?:weekly|by\s+week|per\s+week|week\s+over\s+week)\b/i,"Weekly"],[/\b(?:monthly|by\s+month|per\s+month|month\s+over\s+month)\b/i,"Monthly"],[/\b(?:quarterly|by\s+quarter|per\s+quarter)\b/i,"Quarterly"],[/\b(?:yearly|annually|annual|per\s+year)\b|\bby\s+year\b(?!\s*-?\s*end)/i,"Yearly"]];function ut(i,t,e=new Date){let n=(i??"").trim();if(!n)return null;let o=ci.some(h=>h.test(n)),a=ui(n,di);if(!a&&!o)return null;let c=gi(n);return{extendsExisting:o,metric:mi(n,t),horizon:hi(n,c??t.defaults.granularity,e),granularity:c,trigger:a||"refers to an existing chart"}}function ui(i,t){for(let e of t){let n=e.exec(i);if(n)return n[0]}return""}function gi(i){for(let[t,e]of _i)if(t.test(i))return e}function mi(i,t){let e=i.toLowerCase();return t.metrics.flatMap(o=>[o.label,...o.aliases].map(a=>({id:o.id,alias:a.toLowerCase()}))).sort((o,a)=>a.alias.length-o.alias.length).find(o=>e.includes(o.alias))?.id}function hi(i,t,e){let n=pi[t],o=/\bnext\s+(\d+)\s+(weeks?|months?|quarters?|years?)\b/i.exec(i);if(o){let h=Number(o[1]),y=o[2].toLowerCase().replace(/s$/,"");return Math.max(1,Math.round(h*n[y]))}let a=/\bnext\s+(week|month|quarter|year)\b/i.exec(i);if(a){let h=a[1].toLowerCase();return Math.max(1,n[h])}if(/\b(?:by|through)\s+(?:year[-\s]?end|end\s+of\s+(?:the\s+)?year|EOY)\b/i.test(i))return fi(t,e);let c=/\bby\s+Q([1-4])\b/i.exec(i);if(c)return Ci(t,Number(c[1]),e)}function fi(i,t){let e=12-(t.getMonth()+1);return Math.max(1,Rn(e,i))}function Ci(i,t,e){let n=Math.floor(e.getMonth()/3)+1,o=t>=n?t-n:4-n+t,a=Math.max(1,o*3);return Math.max(1,Rn(a,i))}function Rn(i,t){switch(t){case"Weekly":return Math.round(i*4.345);case"Quarterly":return Math.max(1,Math.round(i/3));case"Yearly":return Math.max(1,Math.round(i/12));default:return i}}var xi=new Set(["line","area","spline","areaspline"]),gt="(?:jan|feb|mar|apr|may|jun|jul|aug|sep|sept|oct|nov|dec)[a-z]*",ne="(?:19|20)\\d{2}",zn="(?:0?[1-9]|[12]\\d|3[01])",mt="(?:0?[1-9]|1[0-2])",bi=[new RegExp(`^${ne}[-/.]${mt}(?:[-/.]${zn})?$`,"i"),new RegExp(`^${zn}[-/.]${mt}[-/.]${ne}$`,"i"),new RegExp(`^${mt}[-/.]${ne}$`,"i"),new RegExp(`^${ne}-?w\\d{1,2}$`,"i"),new RegExp(`^w(?:ee)?k\\s*\\d{1,2}[,\\s]+${ne}$`,"i"),new RegExp(`^${gt}[\\s-]*'?\\d{2}$`,"i"),new RegExp(`^${gt}[\\s-]*${ne}$`,"i"),new RegExp(`^${ne}[\\s-]*${gt}$`,"i"),new RegExp(`^q[1-4][\\s-]*${ne}$`,"i"),new RegExp(`^${ne}[\\s-]*q[1-4]$`,"i"),new RegExp("^fy\\s*'?\\d{2,4}$","i"),new RegExp(`^${ne}$`)];function yi(i){let t=(i??[]).map(n=>String(n??"").trim()).filter(Boolean);return t.length<3?!1:t.filter(n=>bi.some(o=>o.test(n))).length/t.length>=.8}var vi=[/forecast/i,/confidence/i,/project/i,/upper|lower/i,/band/i,/target/i],$n=3;function He(i){return i?.config?.chart??i?.chart??{}}function Ln(i){let t=He(i);return t?.enableForecasting===!0?!0:(Array.isArray(t?.data)?t.data:[]).some(n=>Array.isArray(n?.projected)&&n.projected.length>0)}function je(i){let t=He(i),e=String(t?.type??"").toLowerCase();if(!xi.has(e))return!1;let n=wi(i);if(!n||n.values.length<$n)return!1;let o=Gn(t);return o.length?yi(o):!!n.times?.length}function wi(i){let t=He(i),e=Un(t);if(!e.length)return null;let n=e.find(o=>!Hn(o.name))??e[0];return Bn(t,n)}function Wn(i){let t=He(i),e=Un(t).filter(o=>!Hn(o.name)),n=[];return e.forEach((o,a)=>{let c=Bn(t,o);c&&n.push(S(b({},c),{name:o.name||(e.length>1?`Series ${a+1}`:"")}))}),n}function Bn(i,t){let e=Pi(t.data),n=e.map(c=>c.value);if(n.length<$n)return null;let o=e.every(c=>c.time!==void 0)?e.map(c=>c.time):void 0,a=Gn(i).slice(0,n.length);return b({labels:a.length===n.length?a:o?o.map(c=>ki(c)):n.map((c,h)=>String(h+1)),values:n},o?{times:o}:{})}function ki(i){return new Date(i).toLocaleDateString("en-US",{month:"short",year:"numeric"})}function Un(i){let t=i?.options?.series;if(Array.isArray(t)&&t.length)return t.filter(n=>Array.isArray(n?.data)).map(n=>({name:String(n.name??""),data:n.data}));let e=i?.data;return Array.isArray(e)&&e.length?e.every(n=>typeof n=="number"||n===null)?[{name:"",data:e}]:e.filter(n=>Array.isArray(n?.data)||Array.isArray(n?.actual)).map(n=>({name:String(n.name??""),data:Array.isArray(n.actual)?n.actual:n.data})):[]}function Gn(i){let t=i?.categories;if(Array.isArray(t)&&t.length)return t.map(String);let e=i?.options?.xAxis?.categories;return Array.isArray(e)&&e.length?e.map(String):[]}function Hn(i){return vi.some(t=>t.test(i))}function Pi(i){let t=[];for(let e of i){let n=Ai(e);if(n===null)break;t.push(n)}return t}function Ai(i){if(typeof i=="number"&&Number.isFinite(i))return{value:i};if(Array.isArray(i)&&i.length===2&&typeof i[1]=="number")return b({value:i[1]},typeof i[0]=="number"?{time:i[0]}:{});if(i&&typeof i=="object"&&typeof i.y=="number"){let t=i;return b({value:t.y},typeof t.x=="number"?{time:t.x}:{})}return null}var ft={Weekly:{Weekly:1,Monthly:4,Quarterly:13,Yearly:52},Monthly:{Monthly:1,Quarterly:3,Yearly:12},Quarterly:{Quarterly:1,Yearly:4},Yearly:{Yearly:1}},ht={Weekly:{plural:"weeks",singular:"week",adjective:"weekly"},Monthly:{plural:"months",singular:"month",adjective:"monthly"},Quarterly:{plural:"quarters",singular:"quarter",adjective:"quarterly"},Yearly:{plural:"years",singular:"year",adjective:"yearly"}},Nn=4;function Mi(i,t,e){let n=ft[t]?.[e];return n?Math.max(1,Math.floor(i/n)):null}function jn(i,t,e){return e.map(n=>{let o=ht[n]??ht.Monthly,a=Mi(t,i,n);return a===null?{value:n,enabled:!1,fittedPeriods:0,maxHorizon:0,label:o,reason:`needs ${o.adjective} data, but this series is ${ht[i]?.adjective??i.toLowerCase()}`}:a<Nn?{value:n,enabled:!1,fittedPeriods:a,maxHorizon:0,label:o,reason:`only ${a} ${a===1?o.singular:o.plural} of history, needs at least ${Nn}`}:{value:n,enabled:!0,fittedPeriods:a,maxHorizon:Math.max(1,Math.floor(a/2)),label:o}})}function Qn(i,t,e,n){if(t===e)return Math.max(1,Math.min(i,n));let o=ft[t]?.[e],a=ft[e]?.[t],c=o?i/o:a?i*a:i;return Math.max(1,Math.min(Math.round(c),n))}var Si="#2970FF",Yn="#7A5AF8";var Kn={Weekly:6048e5,Monthly:26298e5,Quarterly:78894e5,Yearly:315576e5},Jn={Weekly:"Week",Monthly:"Month",Quarterly:"Quarter",Yearly:"Year"};function Ti(i,t){if(i.times?.length===i.values.length)return i.times;let e=Date.now(),n=i.values.length;return i.values.map((o,a)=>Math.round(e-(n-1-a)*t))}function Xn(i,t){let e=new Date(i);switch(t){case"Weekly":return e.toLocaleDateString("en-US",{day:"numeric",month:"short",year:"numeric"});case"Quarterly":return`Q${Math.floor(e.getMonth()/3)+1} ${e.getFullYear()}`;case"Yearly":return String(e.getFullYear());default:return e.toLocaleDateString("en-US",{month:"short",year:"numeric"})}}function Zn(i,t){let e=Kn[i.granularity]??Kn.Monthly,n=Ti(i.history,e),o=n[n.length-1]??Date.now(),a=i.forecastTimes?.length===t.length?i.forecastTimes:t.map((k,z)=>Math.round(o+(z+1)*e)),c=t.length>0,h=[...n.map(k=>Xn(k,i.granularity)),...c?a.map(k=>Xn(k,i.granularity)):[]],y=(i.series?.length??0)>1,A=y?i.series.map(k=>b({name:k.note?`${k.name} \xB7 ${k.note}`:k.name,actual:k.values},k.points?.length?{projected:k.points.map(z=>z.value),interval:k.points.map(z=>[z.low,z.high])}:{})):[b({name:"Actuals",color:Si,actual:i.history.values},c?{projected:t.map(k=>k.value),interval:t.map(k=>[k.low,k.high])}:{})],M={type:"line",enableForecasting:!0,categories:h,data:A,lineWidth:2,showMarkers:!1,valueSuffix:i.valueSuffix??"",xAxisTitle:Jn[i.granularity]??Jn.Monthly,projection:S(b({start:null},y?{}:{color:Yn}),{dashStyle:"Dash",showNowLine:!0,nowLabel:"",bandLabel:"Projected",interval:S(b({name:`${i.confidence}% confidence`},y?{}:{color:Yn}),{opacity:.16,level:i.confidence})}),legend:{show:!0},height:"400px",loading:!1,options:{}};return{title:i.chartTitle,componentName:"nile-line-chart",widgetType:"chart",config:{aq:{chartTitle:i.chartTitle,chartSubtitle:i.chartSubtitle},chart:M},queryMeta:{sql:`-- forecast:${i.metric}`}}}function Ct(i,t=[]){let e=i.guardrails?.passed?i.points??[]:[],n=e[e.length-1],o=b({horizon:i.horizon,confidence:i.confidence,granularity:i.granularity},n?{value:n.value,low:n.low,high:n.high}:{}),a=e.length?ke(i.narrative,o):i.guardrails?.body?`I can't forecast this reliably. ${i.guardrails.body}`:"I can't forecast this series.",c=Fi(i,t),h=i.skipped??[],y=(i.meta??[]).map(A=>({label:A.label,value:ke(A.value,o)}));return h.length&&c.length>1&&y.push({label:"Series",value:`${c.length-h.length} of ${c.length} forecast \u2014 ${h.map(A=>A.name).join(", ")} left as history`}),{chart:qi(i,e,c),answer:a,meta:y,points:e,horizon:i.horizon,granularity:i.granularity,confidence:i.confidence,maxHorizon:i.maxHorizon}}function Fi(i,t){let e=i.forecasts??[];if(e.length<2&&!(i.skipped?.length&&e.length))return[];let n=c=>String(c??"").toLowerCase().replace(/[^a-z0-9]/g,""),o=new Map(t.map(c=>[n(c.name??""),c])),a=e.map(c=>({name:c.name,values:c.history?.values??o.get(n(c.name))?.values??[],points:i.guardrails?.passed?c.points??[]:[]}));for(let c of i.skipped??[]){let h=o.get(n(c.name));h?.values?.length&&a.push({name:c.name,values:h.values,note:"not forecast"})}return a}function qi(i,t,e=[]){return Zn(e.length?S(b({},i),{series:e}):i,t)}function ke(i,t){return String(i??"").replace(/\{\{(\w+)\}\}/g,(e,n)=>n in t?String(t[n]):e)}function xt(i){if(i.forecast||i.isStreaming||i.charts?.length!==1)return!1;let t=i.charts[0]?.config;return Ln(t)?!1:je(t)}var Di=["aqChat"],Ei=["artifactGrid"],Ii=["composerEl"],Vi=["aiExecutiveSummary"],Ri=()=>[1,2,3,4],bt=()=>[],te=(i,t)=>t.id,be=(i,t)=>t.key,zi=(i,t)=>t.templateId,ni=(i,t)=>t.label,ii=(i,t)=>t.component,Ni=(i,t)=>t.name,Qe=(i,t)=>t.value,$i=(i,t)=>t.action;function Li(i,t){if(i&1){let e=w();l(0,"button",29),g("click",function(){_(e);let o=r();return u(o.addReplyQuote())}),m(1,"nile-glyph",30),p(2),d()}if(i&2){let e=t,n=r();Z("top",e.top,"px")("left",e.left,"px"),B("reply-badge--below",!e.above),s(2),T(" ",n.copy().replyButton," ")}}function Wi(i,t){if(i&1){let e=w();l(0,"nile-nav-tab-group",54),g("nile-tab-change",function(o){_(e);let a=r(2);return u(a.setChatPaneTab(o.detail.value))}),l(1,"nile-nav-tab",55),p(2),d(),l(3,"nile-nav-tab",56),p(4),d()()}if(i&2){let e=r(2);F("value",e.chatPaneTab()),s(2),P(e.copy().chatTabLabel),s(2),P(e.copy().libraryTabLabel)}}function Bi(i,t){if(i&1){let e=w();l(0,"span",34),m(1,"nile-glyph",57),l(2,"span",58),p(3),d(),l(4,"button",59),g("click",function(){_(e);let o=r(2);return u(o.clearScope())}),m(5,"nile-glyph",60),d()()}if(i&2){let e=t;s(),v("name",e.kind==="dataset"?"ng-database":"ng-dataflow-04"),s(2),J("",e.kind==="dataset"?"Dataset":"Pipeline",": ",e.name)}}function Ui(i,t){i&1&&(l(0,"div",44),m(1,"nile-skeleton-loader",61)(2,"nile-skeleton-loader",62),d())}function Gi(i,t){i&1&&m(0,"nile-glyph",65)}function Hi(i,t){if(i&1){let e=w();l(0,"nile-menu-item",50),g("click",function(){let o=_(e).$implicit,a=r(3);return u(a.selectScope("dataset",o))}),l(1,"span",64),p(2),d(),f(3,Gi,1,0,"nile-glyph",65),d()}if(i&2){let e,n=t.$implicit,o=r(3);s(2),P(n.name),s(),C(((e=o.selectedScope())==null?null:e.id)===n.id?3:-1)}}function ji(i,t){if(i&1&&(l(0,"div",63),p(1),d()),i&2){let e=r(3);s(),P(e.copy().noDatasetsFound)}}function Qi(i,t){if(i&1&&O(0,Hi,4,2,"nile-menu-item",null,te,!1,ji,2,1,"div",63),i&2){let e=r(2);D(e.datasets())}}function Yi(i,t){i&1&&(l(0,"div",44),m(1,"nile-skeleton-loader",61)(2,"nile-skeleton-loader",62),d())}function Ki(i,t){i&1&&m(0,"nile-glyph",65)}function Ji(i,t){if(i&1){let e=w();l(0,"nile-menu-item",50),g("click",function(){let o=_(e).$implicit,a=r(3);return u(a.selectScope("pipeline",o))}),l(1,"span",64),p(2),d(),f(3,Ki,1,0,"nile-glyph",65),d()}if(i&2){let e,n=t.$implicit,o=r(3);s(2),P(n.name),s(),C(((e=o.selectedScope())==null?null:e.id)===n.id?3:-1)}}function Xi(i,t){if(i&1&&(l(0,"div",63),p(1),d()),i&2){let e=r(3);s(),P(e.copy().noPipelinesFound)}}function Zi(i,t){if(i&1&&O(0,Ji,4,2,"nile-menu-item",null,te,!1,Xi,2,1,"div",63),i&2){let e=r(2);D(e.pipelines())}}function eo(i,t){if(i&1&&(l(0,"nile-menu-item",66)(1,"div",67),m(2,"nile-skeleton-loader",68),l(3,"div",69),m(4,"nile-skeleton-loader",70),d()()()),i&2){let e=t.$implicit;s(3),Z("max-width",e,"px")}}function to(i,t){if(i&1&&O(0,eo,5,2,"nile-menu-item",66,Q),i&2){let e=r(2);D(e.menuSkeletonRows)}}function no(i,t){i&1&&m(0,"nile-glyph",73)}function io(i,t){if(i&1){let e=w();l(0,"nile-glyph",75),g("click",function(o){_(e);let a=r().$implicit,c=r(3);return u(c.deleteConversation(o,a.id))}),d()}}function oo(i,t){if(i&1){let e=w();l(0,"nile-menu-item",50),g("click",function(){let o=_(e).$implicit,a=r(3);return u(a.selectConversation(o.id))}),l(1,"div",67),m(2,"nile-glyph",72),l(3,"span",69),p(4),d(),f(5,no,1,0,"nile-glyph",73)(6,io,1,0,"nile-glyph",74),d()()}if(i&2){let e=t.$implicit,n=r(3);s(4),P(e.title||"Untitled"),s(),C(e.id===n.activeConversationId()?5:6)}}function ao(i,t){if(i&1&&(l(0,"div",71),p(1),d()),i&2){let e=r(3);s(),P(e.copy().noConversationsYet)}}function ro(i,t){if(i&1&&O(0,oo,7,2,"nile-menu-item",null,te,!1,ao,2,1,"div",71),i&2){let e=r(2);D(e.conversations())}}function lo(i,t){if(i&1&&(l(0,"nile-menu-item",66)(1,"div",80),m(2,"nile-skeleton-loader",68),l(3,"div",81),m(4,"nile-skeleton-loader",70),d(),l(5,"div",82),m(6,"nile-skeleton-loader",83),d()()()),i&2){let e=t.$implicit;s(3),Z("max-width",e,"px")}}function so(i,t){if(i&1&&O(0,lo,7,2,"nile-menu-item",66,Q),i&2){let e=r(3);D(e.menuSkeletonRows)}}function co(i,t){if(i&1){let e=w();l(0,"nile-menu-item",50),g("click",function(){let o=_(e).$implicit,a=r(4);return u(a.openRelatedDashboard(o.id))}),l(1,"div",80),m(2,"nile-glyph",84),l(3,"span",81),p(4),d(),l(5,"span",82),p(6),d()()()}if(i&2){let e=t.$implicit;s(4),P(e.name||"Untitled"),s(2),J("",e.widgetCount," widget",e.widgetCount===1?"":"s")}}function po(i,t){if(i&1&&(l(0,"div",71),p(1),d()),i&2){let e=r(4);s(),P(e.copy().noDashboardsYet)}}function _o(i,t){if(i&1&&O(0,co,7,3,"nile-menu-item",null,te,!1,po,2,1,"div",71),i&2){let e=r(3);D(e.nonAutoDashboards())}}function uo(i,t){if(i&1){let e=w();l(0,"nile-dropdown",76),g("nile-hide",function(){_(e);let o=r(2);return u(o.showRelatedDashboards.set(!1))}),l(1,"nile-lite-tooltip",77)(2,"button",78),g("click",function(){_(e);let o=r(2);return u(o.showRelatedDashboards.set(!o.showRelatedDashboards()))}),m(3,"nile-glyph",79),d()(),l(4,"nile-menu")(5,"nile-menu-item",50),g("click",function(){_(e);let o=r(2);return u(o.openNewDashboard())}),m(6,"nile-glyph",51),p(7),d(),f(8,so,2,0)(9,_o,3,1),d()()}if(i&2){let e=r(2);v("open",e.showRelatedDashboards()),s(7),T(" ",e.copy().newDashboardLabel," "),s(),C(e.dashboardsLoading()?8:9)}}function go(i,t){if(i&1){let e=w();l(0,"nile-lite-tooltip",53)(1,"button",85),g("click",function(){_(e);let o=r(2);return u(o.openGallery())}),m(2,"nile-glyph",86),d()()}}function mo(i,t){if(i&1){let e=w();l(0,"header",11)(1,"div",31),f(2,Wi,5,3,"nile-nav-tab-group",32),d(),l(3,"div",33),f(4,Bi,6,3,"span",34),l(5,"nile-dropdown",35),g("nile-hide",function(){_(e);let o=r();return u(o.closeScopeMenu())}),l(6,"nile-lite-tooltip",36)(7,"button",37),g("click",function(){_(e);let o=r();return u(o.openScopeMenu())}),m(8,"nile-glyph",38),d()(),l(9,"nile-menu")(10,"nile-menu-item")(11,"nile-dropdown",39)(12,"span",40),m(13,"nile-glyph",41),l(14,"span",42),p(15,"Dataset"),d(),m(16,"nile-glyph",43),d(),l(17,"nile-menu"),f(18,Ui,3,0,"div",44)(19,Qi,3,1),d()()(),l(20,"nile-menu-item")(21,"nile-dropdown",39)(22,"span",40),m(23,"nile-glyph",45),l(24,"span",42),p(25,"Pipeline"),d(),m(26,"nile-glyph",43),d(),l(27,"nile-menu"),f(28,Yi,3,0,"div",44)(29,Zi,3,1),d()()()()(),l(30,"nile-dropdown",46),g("nile-hide",function(){_(e);let o=r();return u(o.showConversationPicker.set(!1))}),l(31,"nile-lite-tooltip",47)(32,"button",48),g("click",function(){_(e);let o=r();return u(o.showConversationPicker.set(!o.showConversationPicker()))}),m(33,"nile-glyph",49),d()(),l(34,"nile-menu")(35,"nile-menu-item",50),g("click",function(){_(e);let o=r();return u(o.newConversation())}),m(36,"nile-glyph",51),p(37),d(),f(38,to,2,0)(39,ro,3,1),d()(),f(40,uo,10,3,"nile-dropdown",52),f(41,go,3,0,"nile-lite-tooltip",53),d()()}if(i&2){let e,n=r();s(2),C(n.features().library?2:-1),s(2),C((e=n.features().connections&&n.selectedScope())?4:-1,e),s(),v("open",n.showScopePicker()),s(13),C(n.scopeLoading()?18:19),s(10),C(n.scopeLoading()?28:29),s(2),v("open",n.showConversationPicker()),s(2),v("disabled",n.isStreaming()),s(5),T(" ",n.copy().newConversationLabel," "),s(),C(n.conversationsLoading()?38:39),s(2),C(n.features().dashboardsMenu?40:-1),s(),C(n.features().promptGallery?41:-1)}}function ho(i,t){if(i&1){let e=w();l(0,"button",100),g("click",function(){let o=_(e).$implicit,a=r(4);return u(a.selectWidgetTemplateCategory(o.key))}),p(1),l(2,"span",101),p(3),d()()}if(i&2){let e=t.$implicit,n=r(4);B("aq-picker-chip--active",n.widgetTemplateActiveCategory()===e.key),s(),T("",e.label," "),s(2),P(n.widgetTemplateCountForCategory(e.key))}}function fo(i,t){if(i&1){let e=w();l(0,"div",98)(1,"button",100),g("click",function(){_(e);let o=r(3);return u(o.selectWidgetTemplateCategory("all"))}),p(2),l(3,"span",101),p(4),d()(),O(5,ho,4,4,"button",102,be),d()}if(i&2){let e=r(3);s(),B("aq-picker-chip--active",e.widgetTemplateActiveCategory()==="all"),s(),T("",e.copy().libraryAllCategoryLabel," "),s(2),P(e.widgetTemplateAllTemplates().length),s(),D(e.templateCategories())}}function Co(i,t){if(i&1&&m(0,"nile-skeleton-loader",104),i&2){let e=t.$implicit;Z("width",e,"px")}}function xo(i,t){if(i&1&&(l(0,"div",99),O(1,Co,1,2,"nile-skeleton-loader",103,Q),d()),i&2){let e=r(3);s(),D(e.libraryChipSkeletonWidths)}}function bo(i,t){if(i&1){let e=w();l(0,"nile-input",96),g("nile-input",function(o){_(e);let a=r(2);return u(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r(2);return u(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))}),m(1,"nile-glyph",97),d(),f(2,fo,7,4,"div",98)(3,xo,3,0,"div",99)}if(i&2){let e=r(2);v("placeholder",e.copy().librarySearchWidgetsPlaceholder)("value",e.librarySearch()),s(2),C(!e.templateCategoriesLoading()&&!e.widgetTemplateTemplatesLoading()?2:3)}}function yo(i,t){if(i&1){let e=w();l(0,"button",100),g("click",function(){let o=_(e).$implicit,a=r(4);return u(a.selectTemplateCategory(o.key))}),p(1),l(2,"span",101),p(3),d()()}if(i&2){let e=t.$implicit,n=r(4);B("aq-picker-chip--active",n.templateActiveCategory()===e.key),s(),T("",e.label," "),s(2),P(n.templateCountForCategory(e.key))}}function vo(i,t){if(i&1){let e=w();l(0,"div",98)(1,"button",100),g("click",function(){_(e);let o=r(3);return u(o.selectTemplateCategory("all"))}),p(2),l(3,"span",101),p(4),d()(),O(5,yo,4,4,"button",102,be),d()}if(i&2){let e=r(3);s(),B("aq-picker-chip--active",e.templateActiveCategory()==="all"),s(),T("",e.copy().libraryAllCategoryLabel," "),s(2),P(e.templateAllTemplates().length),s(),D(e.templateCategories())}}function wo(i,t){if(i&1&&m(0,"nile-skeleton-loader",104),i&2){let e=t.$implicit;Z("width",e,"px")}}function ko(i,t){if(i&1&&(l(0,"div",99),O(1,wo,1,2,"nile-skeleton-loader",103,Q),d()),i&2){let e=r(3);s(),D(e.libraryChipSkeletonWidths)}}function Po(i,t){if(i&1){let e=w();l(0,"nile-input",96),g("nile-input",function(o){_(e);let a=r(2);return u(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r(2);return u(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))}),m(1,"nile-glyph",97),d(),f(2,vo,7,4,"div",98)(3,ko,3,0,"div",99)}if(i&2){let e=r(2);v("placeholder",e.copy().librarySearchDashboardsPlaceholder)("value",e.librarySearch()),s(2),C(e.templateCategoriesLoading()?3:2)}}function Ao(i,t){if(i&1&&(l(0,"div",111),m(1,"nile-skeleton-loader",112)(2,"nile-skeleton-loader",113)(3,"nile-skeleton-loader",114)(4,"nile-skeleton-loader",115),d()),i&2){let e=t.$implicit;s(),F("width",e)}}function Mo(i,t){if(i&1&&(l(0,"div",106)(1,"div",107),m(2,"nile-skeleton-loader",108)(3,"nile-skeleton-loader",109),d(),l(4,"div",110),O(5,Ao,5,1,"div",111,Q),d()()),i&2){let e=t.$implicit;s(5),D(e)}}function So(i,t){if(i&1&&(l(0,"div",105),O(1,Mo,7,0,"div",106,Q),d()),i&2){let e=r(3);s(),D(e.librarySkeletonGroups)}}function To(i,t){if(i&1){let e=w();l(0,"div",120),g("click",function(){let o=_(e).$implicit,a=r(6);return u(a.openWidgetDetailFromCard(o.templateId))}),m(1,"nile-kpi-chart",121),l(2,"button",122),g("click",function(o){let a=_(e).$implicit,c=r(6);return o.stopPropagation(),u(c.toggleWidgetTemplateSelection(a.templateId))}),m(3,"nile-glyph",123),d()()}if(i&2){let e=t.$implicit,n=r(6);B("aq-lib-card-wrap--selected",n.widgetTemplatePickerSelectedIds().includes(e.templateId)),s(),v("label",e.title)("description",e.desc??"")("value",e.value)("loading",e.loading)("sparkline",e.sparkline)("options",n.libraryKpiChartOptions),s(),B("aq-lib-card__check--on",n.widgetTemplatePickerSelectedIds().includes(e.templateId))}}function Fo(i,t){if(i&1){let e=w();l(0,"div",106)(1,"div",107)(2,"span",117),p(3),d(),l(4,"button",118),g("click",function(){let o=_(e).$implicit,a=r(5);return u(a.toggleLibraryGroupSelection(o.cards))}),p(5),d()(),l(6,"div",110),O(7,To,4,10,"div",119,zi),d()()}if(i&2){let e=t.$implicit,n=r(5);s(3),J("",e.label," \xB7 ",e.cards.length),s(2),T(" ",n.isGroupFullySelected(e.cards)?n.copy().libraryClearSelectionButton:n.copy().librarySelectAllButton," "),s(2),D(e.cards)}}function qo(i,t){if(i&1&&O(0,Fo,9,3,"div",106,be),i&2){let e=r(4);D(e.libraryWidgetGroups())}}function Oo(i,t){if(i&1&&(l(0,"div",116),p(1),d()),i&2){let e=r(4);s(),P(e.librarySearch()?e.copy().noWidgetsMatch:e.copy().noWidgetsInCategory)}}function Do(i,t){if(i&1&&f(0,qo,2,0)(1,Oo,2,1,"div",116),i&2){let e=r(3);C(e.libraryWidgetGroups().length?0:1)}}function Eo(i,t){if(i&1&&f(0,So,3,0,"div",105)(1,Do,2,1),i&2){let e=r(2);C(e.templateCategoriesLoading()||e.widgetTemplateTemplatesLoading()?0:1)}}function Io(i,t){if(i&1&&(l(0,"div",125),m(1,"nile-skeleton-loader",126),l(2,"div",127),m(3,"nile-skeleton-loader",112)(4,"nile-skeleton-loader",114)(5,"nile-skeleton-loader",128),d()()),i&2){let e=t.$implicit;s(3),F("width",e)}}function Vo(i,t){if(i&1&&(l(0,"div",106)(1,"div",107),m(2,"nile-skeleton-loader",108),d(),l(3,"div",124),O(4,Io,6,1,"div",125,Q),d()()),i&2){let e=t.$implicit;s(4),D(e)}}function Ro(i,t){if(i&1&&(l(0,"div",105),O(1,Vo,6,0,"div",106,Q),d()),i&2){let e=r(3);s(),D(e.librarySkeletonGroups)}}function zo(i,t){if(i&1&&(l(0,"div",132),m(1,"db-dash-card-chart",140),d()),i&2){let e=r().$implicit;s(),v("config",e.preview)}}function No(i,t){i&1&&(l(0,"div",133),m(1,"span",141)(2,"span",142)(3,"span",143)(4,"span",144)(5,"span",145),d())}function $o(i,t){if(i&1&&(l(0,"span",134),m(1,"nile-glyph",146),p(2),d()),i&2){let e=r().$implicit,n=r(5);s(2),T(" ",n.withCount(n.copy().libraryWidgetCountChip,(e.widgets==null?null:e.widgets.length)??0)," ")}}function Lo(i,t){if(i&1&&(l(0,"div",138),p(1),d()),i&2){let e=r().$implicit;s(),P(e.description)}}function Wo(i,t){if(i&1){let e=w();l(0,"button",130),g("click",function(){let o=_(e).$implicit,a=r(5);return u(a.openWidgetDetailPanelForTemplate(o))}),l(1,"div",131),f(2,zo,2,1,"div",132)(3,No,6,0,"div",133),f(4,$o,3,1,"span",134),d(),l(5,"div",135)(6,"div",136)(7,"span",137),p(8),d(),f(9,Lo,2,1,"div",138),d(),m(10,"nile-glyph",139),d()()}if(i&2){let e=t.$implicit;s(2),C(e.preview!=null&&e.preview.chart?2:3),s(2),C(e.widgets!=null&&e.widgets.length?4:-1),s(4),P(e.name),s(),C(e.description?9:-1)}}function Bo(i,t){if(i&1&&(l(0,"div",106)(1,"div",107)(2,"span",117),p(3),d()(),l(4,"div",124),O(5,Wo,11,4,"button",129,te),d()()),i&2){let e=t.$implicit;s(3),J("",e.label," \xB7 ",e.templates.length),s(2),D(e.templates)}}function Uo(i,t){if(i&1&&O(0,Bo,7,2,"div",106,be),i&2){let e=r(3);D(e.libraryDashboardGroups())}}function Go(i,t){if(i&1&&(l(0,"div",116),p(1),d()),i&2){let e=r(3);s(),P(e.librarySearch()?e.copy().noDashboardsMatch:e.copy().noDashboardsInCategory)}}function Ho(i,t){if(i&1&&f(0,Ro,3,0,"div",105)(1,Uo,2,0)(2,Go,2,1,"div",116),i&2){let e=r(2);C(e.templateTemplatesLoading()?0:e.libraryDashboardGroups().length?1:2)}}function jo(i,t){if(i&1){let e=w();l(0,"div",95)(1,"span",147),p(2),d(),l(3,"nile-button",20),g("click",function(){_(e);let o=r(2);return u(o.addSelectedWidgetTemplates())}),m(4,"nile-glyph",148),p(5),d()()}if(i&2){let e=r(2);s(2),T(" ",e.withCount(e.copy().librarySelectedCount,e.widgetTemplatePickerSelectedIds().length)," "),s(3),T(" ",e.withCount(e.copy().libraryAddToCanvasButton,e.widgetTemplatePickerSelectedIds().length)," ")}}function Qo(i,t){if(i&1){let e=w();l(0,"div",12)(1,"div",87)(2,"p",88)(3,"strong",89),p(4),d(),p(5),d(),l(6,"nile-nav-tab-group",90),g("nile-tab-change",function(o){_(e);let a=r();return a.artifactPickerTab.set(o.detail.value),a.widgetTemplatePickerSelectedIds.set([]),u(a.librarySearch.set(""))}),l(7,"nile-nav-tab",91),p(8),l(9,"span",92),p(10),d()(),l(11,"nile-nav-tab",93),p(12),l(13,"span",92),p(14),d()()(),f(15,bo,4,3)(16,Po,4,3),d(),l(17,"div",94),f(18,Eo,2,1)(19,Ho,3,1),d(),f(20,jo,6,2,"div",95),d()}if(i&2){let e=r();s(4),P(e.copy().libraryIntroTitle),s(),T(" ",e.copy().libraryIntro," "),s(),F("value",e.artifactPickerTab()),s(2),P(e.copy().libraryWidgetsTabLabel),s(2),P(e.widgetTemplateAllTemplates().length),s(2),P(e.copy().libraryDashboardsTabLabel),s(2),P(e.templateAllTemplates().length),s(),C(e.artifactPickerTab()==="kpis"?15:16),s(3),C(e.artifactPickerTab()==="kpis"?18:19),s(2),C(e.artifactPickerTab()==="kpis"&&e.widgetTemplatePickerSelectedIds().length?20:-1)}}function Yo(i,t){i&1&&(l(0,"div",159),m(1,"nile-skeleton-loader",160),l(2,"div",161),m(3,"nile-skeleton-loader",70),d()())}function Ko(i,t){i&1&&(l(0,"div",158),O(1,Yo,4,0,"div",159,Q),d()),i&2&&(s(),D(ve(0,Ri)))}function Jo(i,t){if(i&1&&(l(0,"span",168),p(1),d()),i&2){let e=r().$implicit;s(),P(e.badge)}}function Xo(i,t){if(i&1){let e=w();l(0,"button",165),g("click",function(){let o=_(e).$implicit,a=r(4);return u(a.onWelcomePromptPick(o))}),m(1,"nile-glyph",166),l(2,"span",167),p(3),d(),f(4,Jo,2,1,"span",168),d()}if(i&2){let e=t.$implicit;B("prompt-card--ai",e.tone==="ai"),s(),F("name",e.icon)("color",e.tone==="ai"?"#7a5af8":"#717680"),s(2),P(e.label),s(),C(e.badge?4:-1)}}function Zo(i,t){if(i&1){let e=w();l(0,"div",164)(1,"button",169),g("click",function(){_(e);let o=r(4);return u(o.openGallery())}),m(2,"nile-glyph",170),l(3,"span"),p(4),d()()()}if(i&2){let e=r(4);s(4),P(e.copy().promptGalleryLabel)}}function ea(i,t){if(i&1&&(l(0,"div",162),O(1,Xo,5,6,"button",163,ni),d(),f(3,Zo,5,1,"div",164)),i&2){let e=r(3);s(),D(e.welcomePromptCards()),s(2),C(e.features().promptGallery?3:-1)}}function ta(i,t){if(i&1&&(l(0,"div",149)(1,"div",151)(2,"div",152),m(3,"nile-glyph",153),d(),l(4,"h2",154),p(5),d(),l(6,"p",155),p(7),d(),l(8,"div",156),ye(9,157),d(),f(10,Ko,3,1,"div",158)(11,ea,4,1),d()()),i&2){let e=r(2),n=ce(7);s(5),P(e.copy().welcomeTitle),s(2),P(e.copy().welcomeSubtitle),s(2),v("ngTemplateOutlet",n),s(),C(e.welcomePromptCards().length?11:10)}}function na(i,t){i&1&&(l(0,"div",173),m(1,"nile-skeleton-loader",174),d(),l(2,"div",175),m(3,"nile-skeleton-loader",176)(4,"nile-skeleton-loader",177)(5,"nile-skeleton-loader",178),d(),l(6,"div",173),m(7,"nile-skeleton-loader",179),d(),l(8,"div",175),m(9,"nile-skeleton-loader",180)(10,"nile-skeleton-loader",181),d())}function ia(i,t){if(i&1&&(l(0,"div",183),m(1,"nile-glyph",186),l(2,"span",187),p(3),d()()),i&2){let e=r(2).$implicit;s(3),P(e.quotedText)}}function oa(i,t){if(i&1&&(l(0,"span",192),p(1),d()),i&2){let e=r().$implicit;s(),P(e.answer)}}function aa(i,t){if(i&1&&(l(0,"div",188),m(1,"nile-glyph",189),l(2,"div",190)(3,"span",191),p(4),d(),f(5,oa,2,1,"span",192),d()()),i&2){let e=t.$implicit;s(4),P(e.title),s(),C(e.answer&&e.answer!=="Use this"?5:-1)}}function ra(i,t){if(i&1&&(l(0,"div",184),O(1,aa,6,2,"div",188,Q),d()),i&2){let e=r(2).$implicit,n=r(4);s(),D(n.answerSummaryRows(e))}}function la(i,t){if(i&1&&p(0),i&2){let e=r(2).$implicit;T(" ",e.text," ")}}function sa(i,t){if(i&1&&(l(0,"div",193),m(1,"nile-glyph",194),l(2,"span",195),p(3),d()()),i&2){let e=t.$implicit;s(),F("name",e.contentType.startsWith("image/")?"ng-image-03":"ng-file-06"),s(),F("title",e.name),s(),P(e.name)}}function da(i,t){if(i&1&&(l(0,"div",185),O(1,sa,4,3,"div",193,be),d()),i&2){let e=r(2).$implicit;s(),D(e.attachments??ve(0,bt))}}function ca(i,t){if(i&1&&(l(0,"nile-ai-chat-bubble",182),f(1,ia,4,1,"div",183),f(2,ra,3,0,"div",184)(3,la,1,1),f(4,da,3,1,"div",185),d()),i&2){let e=r().$implicit;v("role","user"),s(),C(e.quotedText?1:-1),s(),C(e.answerSummary?2:3),s(2),C(e.attachments!=null&&e.attachments.length?4:-1)}}function pa(i,t){if(i&1&&m(0,"nile-ai-steps",196),i&2){let e=r(2).$implicit;v("steps",e.tools)}}function _a(i,t){if(i&1&&m(0,"nile-ai-token-stream",205),i&2){let e=r(4).$implicit,n=r(4);v("text",n.cleanText(e.text))("speedMs",n.streamSpeed)}}function ua(i,t){if(i&1&&m(0,"nile-markdown",206),i&2){let e=r(4).$implicit,n=r(4);v("value",n.cleanText(e.text))}}function ga(i,t){if(i&1&&f(0,_a,1,2,"nile-ai-token-stream",205)(1,ua,1,1,"nile-markdown",206),i&2){let e=r(3).$implicit;C(e.isStreaming?0:1)}}function ma(i,t){if(i&1&&(l(0,"span",207),p(1),d()),i&2){let e=r().$implicit;s(),J("Setup ",e.step.current," of ",e.step.total)}}function ha(i,t){if(i&1&&(l(0,"span",217),p(1),d()),i&2){let e=r().$implicit;s(),P(e.hint)}}function fa(i,t){if(i&1&&(l(0,"span"),p(1),d()),i&2){let e=r().$implicit;Xe("choice-card__chip"+(e.tone?" choice-card__chip--"+e.tone:"")),s(),P(e.text)}}function Ca(i,t){if(i&1&&f(0,fa,2,3,"span",219),i&2){let e=t.$implicit;C(e.tone!=="green"&&e.tone!=="yellow"&&e.tone!=="red"?0:-1)}}function xa(i,t){if(i&1&&(l(0,"span",218),O(1,Ca,1,1,null,null,Q),d()),i&2){let e=r().$implicit;s(),D(e.meta)}}function ba(i,t){if(i&1&&(l(0,"nile-radio",212)(1,"span",213)(2,"span",214),p(3),d(),l(4,"span",215)(5,"span",216),p(6),d(),f(7,ha,2,1,"span",217),f(8,xa,3,0,"span",218),d()()()),i&2){let e=t.$implicit,n=t.$index,o=t.$index,a=r(2).$implicit,c=r(3).$implicit,h=r(4);B("choice-card--chosen",(a.selected||a.draftSelection)===e.id)("choice-card--locked",!!a.selected||h.isStreaming()),F("name","choice-"+c.id+"-"+n)("value",e.id)("checked",(a.selected||a.draftSelection)===e.id?"":null)("disabled",a.selected||h.isStreaming()?"":null),s(3),P(o+1),s(3),P(e.label),s(),C(e.hint?7:-1),s(),C(e.meta!=null&&e.meta.length?8:-1)}}function ya(i,t){if(i&1){let e=w();l(0,"nile-radio-group",210),g("nile-change",function(o){_(e);let a=r().$implicit,c=r(3).$implicit,h=r(4);return u(h.onChoiceChange(c,a,o.detail.value))}),O(1,ba,9,12,"nile-radio",211,te),d()}if(i&2){let e=r(),n=e.$implicit,o=e.$index,a=r(3).$implicit,c=r(4);F("label",n.prompt||"Choose an index")("name","choice-"+a.id+"-"+o)("value",n.selected||n.draftSelection||null)("disabled",n.selected||c.isStreaming()?"":null),s(),D(n.options)}}function va(i,t){if(i&1&&(l(0,"p",209),p(1),d()),i&2){let e=r(8);s(),P(e.copy().noChoiceOptions)}}function wa(i,t){if(i&1&&p(0),i&2){let e=r(3).$implicit;T(" \u2713 Something else: ",e.chatDraftText," (edit) ")}}function ka(i,t){if(i&1&&(m(0,"nile-glyph",225),p(1)),i&2){let e=r(10);s(),T(" ",e.copy().somethingElseButton," ")}}function Pa(i,t){if(i&1){let e=w();l(0,"button",222),g("click",function(){_(e);let o=r(3).$implicit,a=r(3).$implicit,c=r(4);return u(c.requestPlan(a,o))}),p(1),d()}if(i&2){let e=r(10);v("disabled",e.isStreaming()),s(),T(" ",e.copy().givePlanButton," ")}}function Aa(i,t){if(i&1){let e=w();l(0,"button",226),g("click",function(){_(e);let o=r(3).$implicit,a=r(3).$implicit,c=r(4);return u(c.previewWidget(a,o))}),m(1,"nile-glyph",227),p(2),d()}if(i&2){let e=r(3).$implicit,n=r(7);v("disabled",n.isStreaming()),s(2),T(' Preview "',n.choiceTitle(e),'" ')}}function Ma(i,t){if(i&1){let e=w();l(0,"div",220)(1,"button",222),g("click",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,c=r(4);return u(c.openChatDraft(a,o))}),f(2,wa,1,1)(3,ka,2,1),d(),f(4,Pa,2,2,"button",223),f(5,Aa,3,2,"button",224),d()}if(i&2){let e=r(2).$implicit,n=r(7);s(),v("disabled",n.isStreaming()),s(),C(e.chatDraftText!=null&&e.chatDraftText.trim()?2:3),s(2),C(e.kind==="clarification"?4:-1),s(),C(e.kind==="widget_plan"?5:-1)}}function Sa(i,t){if(i&1){let e=w();l(0,"div",221)(1,"span",228),p(2,"Something else"),d(),l(3,"div",229)(4,"nile-input",230),g("nile-input",function(o){_(e);let a=r(2).$implicit,c=r(3).$implicit,h=r(4);return u(h.onChatDraftTextChange(c,a,o.detail.value))})("keydown.enter",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,c=r(4);return u(c.defineChatDraft(a,o))}),d(),l(5,"nile-button",20),g("click",function(){_(e);let o=r(2).$implicit,a=r(3).$implicit,c=r(4);return u(c.defineChatDraft(a,o))}),p(6),d()()()}if(i&2){let e=r(2).$implicit,n=r(7);s(4),v("value",e.chatDraftText??""),F("placeholder",e.kind==="widget_clarification"?n.copy().chatDraftPlaceholderWidget:e.kind==="widget_plan"?n.copy().chatDraftPlaceholderPlan:e.kind==="plan_intake"?n.copy().chatDraftPlaceholderIntake:n.copy().chatDraftPlaceholderClarification)("disabled",n.isStreaming()?"":null),s(),F("disabled",!(e.chatDraftText!=null&&e.chatDraftText.trim())||n.isStreaming()?"":null),s(),T(" ",n.copy().defineItButton," ")}}function Ta(i,t){if(i&1&&f(0,Ma,6,4,"div",220)(1,Sa,7,5,"div",221),i&2){let e=r().$implicit;C(e.chatOpen?1:0)}}function Fa(i,t){if(i&1&&(l(0,"div",199),f(1,ma,2,2,"span",207),f(2,ya,3,4,"nile-radio-group",208)(3,va,2,1,"p",209),f(4,Ta,2,1),d()),i&2){let e=t.$implicit;s(),C(e.step?1:-1),s(),C(e.options.length?2:3),s(2),C((e.kind==="widget_clarification"||e.kind==="clarification"||e.kind==="widget_plan"||e.kind==="plan_intake")&&!e.selected&&e.options.length?4:-1)}}function qa(i,t){if(i&1){let e=w();l(0,"div",200)(1,"nile-button",20),g("click",function(){_(e);let o=r(3).$implicit,a=r(4);return u(a.submitChoices(o))}),p(2),d()()}if(i&2){let e=r(3).$implicit,n=r(4);s(),F("disabled",!n.hasPendingDraft(e)||n.isStreaming()?"":null),s(),T(" ",n.copy().submitAnswersButton," ")}}function Oa(i,t){i&1&&(l(0,"span",232),m(1,"span",238),p(2,"Live "),d())}function Da(i,t){i&1&&(l(0,"span",233),p(1,"Preview"),d())}function Ea(i,t){i&1&&m(0,"div",241)}function Ia(i,t){if(i&1&&m(0,"nile-glyph",245),i&2){let e=r().$implicit;Z("color",e.color),v("name",e.glyph)("method",e.method||"stroke")}}function Va(i,t){if(i&1){let e=w();f(0,Ea,1,0,"div",241),l(1,"nile-menu-item",242),g("click",function(){let o=_(e).$implicit;r();let a=ce(1),c=r(4).$implicit;return r(4).onInlineWidgetMenuItem(c,o),u(a.hide())}),l(2,"span",243),f(3,Ia,1,4,"nile-glyph",244),p(4),d()()}if(i&2){let e=t.$implicit;C(e.divider?0:-1),s(3),C(e.glyph?3:-1),s(),T(" ",e.label," ")}}function Ra(i,t){if(i&1&&(l(0,"nile-dropdown",234,3)(2,"button",239),m(3,"nile-glyph",240),d(),l(4,"nile-menu"),O(5,Va,5,3,null,null,be),d()()),i&2){let e=r(4).$implicit,n=r(4);s(5),D(n.inlineWidgetMenuItems(e))}}function za(i,t){i&1&&(l(0,"div",249),m(1,"nile-spinner",252),l(2,"span"),p(3,"Loading chart types\u2026"),d()())}function Na(i,t){if(i&1&&(l(0,"p",250),p(1),d()),i&2){let e=r(9);s(),P(e.copy().noChartTypesFit)}}function $a(i,t){i&1&&m(0,"nile-spinner",252)}function La(i,t){if(i&1&&m(0,"nile-glyph",257),i&2){let e=r().$implicit,n=r(11);v("name",n.chartTypeIcon(e.type))}}function Wa(i,t){if(i&1){let e=w();l(0,"button",256),g("click",function(){let o=_(e).$implicit,a=r(11);return u(a.selectInlineChartType(o.component))}),f(1,$a,1,0,"nile-spinner",252)(2,La,1,1,"nile-glyph",257),l(3,"span"),p(4),d()()}if(i&2){let e=t.$implicit,n=r(11);F("disabled",n.inlineChartTypeApplying()?"":null),s(),C(n.inlineChartTypeApplyingComponent()===e.component?1:2),s(3),P(e.label)}}function Ba(i,t){if(i&1&&(l(0,"p",253),p(1,"Recommended"),d(),l(2,"div",254),O(3,Wa,5,3,"button",255,ii),d()),i&2){let e=r(10);s(3),D(e.inlineSensibleChartTypes())}}function Ua(i,t){i&1&&m(0,"nile-spinner",252)}function Ga(i,t){if(i&1&&m(0,"nile-glyph",257),i&2){let e=r().$implicit,n=r(11);v("name",n.chartTypeIcon(e.type))}}function Ha(i,t){if(i&1){let e=w();l(0,"button",259),g("click",function(){let o=_(e).$implicit,a=r(11);return u(a.selectInlineChartType(o.component))}),f(1,Ua,1,0,"nile-spinner",252)(2,Ga,1,1,"nile-glyph",257),l(3,"span"),p(4),d()()}if(i&2){let e=t.$implicit,n=r(11);F("disabled",n.inlineChartTypeApplying()?"":null),s(),C(n.inlineChartTypeApplyingComponent()===e.component?1:2),s(3),P(e.label)}}function ja(i,t){if(i&1&&(l(0,"p",253),p(1,"Other types"),d(),l(2,"div",254),O(3,Ha,5,3,"button",258,ii),d()),i&2){let e=r(10);s(3),D(e.inlineOtherChartTypes())}}function Qa(i,t){if(i&1&&(f(0,Ba,5,0),f(1,ja,5,0)),i&2){let e=r(9);C(e.inlineSensibleChartTypes().length>0?0:-1),s(),C(e.inlineOtherChartTypes().length>0?1:-1)}}function Ya(i,t){if(i&1&&(l(0,"p",251),p(1),d()),i&2){let e=r(9);s(),P(e.inlineChartTypeError())}}function Ka(i,t){if(i&1){let e=w();l(0,"nile-dropdown",246),g("nile-hide",function(){_(e);let o=r(8);return u(o.closeInlineChartTypePicker())}),m(1,"span",247),l(2,"div",248),f(3,za,4,0,"div",249)(4,Na,2,1,"p",250)(5,Qa,2,2),f(6,Ya,2,1,"p",251),d()()}if(i&2){let e=r(4).$implicit,n=r(4);v("open",n.inlineChartTypePickerFor()===e.charts[0]),s(3),C(n.inlineChartTypeLoading()?3:n.inlineChartTypeOptions().length===0?4:5),s(3),C(n.inlineChartTypeError()?6:-1)}}function Ja(i,t){if(i&1){let e=w();l(0,"span",262),p(1),l(2,"button",263),g("click",function(){let o=_(e).$implicit,a=r(6).$implicit,c=r(4);return u(c.removeInlineFilter(a.charts[0],o.id))}),m(3,"nile-glyph",264),d()()}if(i&2){let e=t.$implicit,n=r(6).$implicit,o=r(4);s(),T(" ",o.inlineFilterChipLabel(n.charts[0],e)," "),s(),F("disabled",o.inlineFilterApplying()?"":null)}}function Xa(i,t){if(i&1&&(l(0,"div",261),O(1,Ja,4,2,"span",262,te),d()),i&2){let e=r(5).$implicit,n=r(4);s(),D(n.inlineActiveFilters(e.charts[0]))}}function Za(i,t){i&1&&(l(0,"div",249),m(1,"nile-spinner",252),l(2,"span"),p(3,"Loading filterable fields\u2026"),d()())}function er(i,t){if(i&1&&(l(0,"p",251),p(1),d()),i&2){let e=r(9);s(),P(e.inlineFilterFieldsError())}}function tr(i,t){if(i&1&&(l(0,"p",250),p(1),d()),i&2){let e=r(9);s(),P(e.copy().noFilterableFields)}}function nr(i,t){if(i&1&&(l(0,"option",267),p(1),d()),i&2){let e=t.$implicit;v("value",e.name),s(),P(e.label)}}function ir(i,t){if(i&1&&(l(0,"option",267),p(1),d()),i&2){let e=t.$implicit;v("value",e.value),s(),P(e.label)}}function or(i,t){i&1&&(l(0,"div",249),m(1,"nile-spinner",268),l(2,"span"),p(3,"Loading values\u2026"),d()())}function ar(i,t){if(i&1){let e=w();l(0,"input",272),g("ngModelChange",function(o){_(e);let a=r(11);return u(a.inlineFilterBuilderValue.set(o))})("keydown.enter",function(){_(e);let o=r(7).$implicit,a=r(4);return u(a.addInlineFilter(o.charts[0]))}),d()}if(i&2){let e=r(11);v("placeholder",e.copy().filterValuePlaceholder)("ngModel",e.inlineFilterBuilderValue())}}function rr(i,t){if(i&1){let e=w();l(0,"span",274),p(1,"and"),d(),l(2,"input",273),g("ngModelChange",function(o){_(e);let a=r(12);return u(a.inlineFilterBuilderValue2.set(o))}),d()}if(i&2){let e=r(12);s(2),v("ngModel",e.inlineFilterBuilderValue2())}}function lr(i,t){if(i&1){let e=w();l(0,"input",273),g("ngModelChange",function(o){_(e);let a=r(11);return u(a.inlineFilterBuilderValue.set(o))}),d(),f(1,rr,3,1)}if(i&2){let e,n=r(7).$implicit,o=r(4);v("ngModel",o.inlineFilterBuilderValue()),s(),C((e=o.inlineFilterSelectedOperator(n.charts[0]))!=null&&e.needsSecondValue?1:-1)}}function sr(i,t){if(i&1){let e=w();l(0,"span",274),p(1,"and"),d(),l(2,"input",276),g("ngModelChange",function(o){_(e);let a=r(12);return u(a.inlineFilterBuilderValue2.set(o))}),d()}if(i&2){let e=r(12);s(2),v("placeholder",e.copy().filterValuePlaceholder)("ngModel",e.inlineFilterBuilderValue2())}}function dr(i,t){if(i&1){let e=w();l(0,"input",275),g("ngModelChange",function(o){_(e);let a=r(11);return u(a.inlineFilterBuilderValue.set(o))})("keydown.enter",function(){_(e);let o=r(7).$implicit,a=r(4);return u(a.addInlineFilter(o.charts[0]))}),d(),f(1,sr,3,2)}if(i&2){let e,n=r(7).$implicit,o=r(4);v("placeholder",o.copy().filterValuePlaceholder)("ngModel",o.inlineFilterBuilderValue()),s(),C((e=o.inlineFilterSelectedOperator(n.charts[0]))!=null&&e.needsSecondValue?1:-1)}}function cr(i,t){if(i&1){let e=w();l(0,"label",277)(1,"input",278),g("change",function(){let o=_(e).$implicit,a=r(12);return u(a.toggleInlineFilterMultiValue(o.value))}),d(),l(2,"span"),p(3),d()()}if(i&2){let e=t.$implicit,n=r(12);s(),v("checked",n.inlineFilterBuilderValues().includes(e.value)),s(2),J("",e.label,"",e.count!=null?" ("+e.count+")":"")}}function pr(i,t){if(i&1&&(l(0,"div",270),O(1,cr,4,3,"label",277,Qe),d()),i&2){let e=r(11);s(),D(e.inlineFilterValuesFor(e.inlineFilterBuilderFieldId()))}}function _r(i,t){if(i&1&&(l(0,"option",267),p(1),d()),i&2){let e=t.$implicit;v("value",e.value),s(),J("",e.label,"",e.count!=null?" ("+e.count+")":"")}}function ur(i,t){if(i&1){let e=w();l(0,"select",266),g("ngModelChange",function(o){_(e);let a=r(11);return u(a.inlineFilterBuilderValue.set(o))}),l(1,"option",279),p(2,"Select\u2026"),d(),O(3,_r,2,3,"option",267,Qe),d()}if(i&2){let e=r(11);v("ngModel",e.inlineFilterBuilderValue()),s(3),D(e.inlineFilterValuesFor(e.inlineFilterBuilderFieldId()))}}function gr(i,t){if(i&1&&f(0,ar,1,2,"input",269)(1,lr,2,2)(2,dr,2,3)(3,pr,3,0,"div",270)(4,ur,5,1,"select",271),i&2){let e,n=r(6).$implicit,o=r(4);C((e=(e=o.inlineFilterSelectedOperator(n.charts[0]))==null?null:e.valueKind)==="text"?0:e==="date"?1:e==="number"?2:e==="multi-select"?3:e==="select"?4:-1)}}function mr(i,t){if(i&1&&(l(0,"p",251),p(1),d()),i&2){let e=r(10);s(),P(e.inlineFilterApplyError())}}function hr(i,t){if(i&1){let e=w();l(0,"div",265)(1,"select",266),g("ngModelChange",function(o){_(e);let a=r(5).$implicit,c=r(4);return u(c.onInlineFilterFieldChange(a.charts[0],o))}),O(2,nr,2,2,"option",267,Ni),d(),l(4,"select",266),g("ngModelChange",function(o){_(e);let a=r(9);return u(a.onInlineFilterOperatorChange(o))}),O(5,ir,2,2,"option",267,Qe),d(),f(7,or,4,0,"div",249)(8,gr,5,1),l(9,"nile-button",19),g("click",function(){_(e);let o=r(5).$implicit,a=r(4);return u(a.addInlineFilter(o.charts[0]))}),p(10," Add filter "),d()(),f(11,mr,2,1,"p",251)}if(i&2){let e=r(5).$implicit,n=r(4);s(),v("ngModel",n.inlineFilterBuilderFieldId()),s(),D(n.inlineFilterFields(e.charts[0])),s(2),v("ngModel",n.inlineFilterBuilderOperator()),s(),D(n.inlineFilterOperators(e.charts[0])),s(2),C(n.inlineFilterValuesLoading()?7:8),s(2),F("loading",n.inlineFilterApplying()?"":null)("disabled",n.inlineFilterApplying()?"":null),s(2),C(n.inlineFilterApplyError()?11:-1)}}function fr(i,t){if(i&1){let e=w();l(0,"nile-dropdown",246),g("nile-hide",function(){_(e);let o=r(8);return u(o.closeInlineFilterBuilder())}),m(1,"span",247),l(2,"div",260)(3,"p",250),p(4,"Filters this preview only \u2014 nothing is saved."),d(),f(5,Xa,3,0,"div",261),f(6,Za,4,0,"div",249)(7,er,2,1,"p",251)(8,tr,2,1,"p",250)(9,hr,12,6),d()()}if(i&2){let e=r(4).$implicit,n=r(4);v("open",n.inlineFilterPickerFor()===e.charts[0]),s(5),C(n.inlineActiveFilters(e.charts[0]).length>0?5:-1),s(),C(n.inlineFilterFieldsLoading()?6:n.inlineFilterFieldsError()?7:n.inlineFilterFields(e.charts[0]).length===0?8:9)}}function Cr(i,t){if(i&1&&(l(0,"span",280)(1,"span",281),p(2),d(),l(3,"span",282),p(4),d()()),i&2){let e=t.$implicit;s(2),T("",e.label,":"),s(2),P(e.value)}}function xr(i,t){if(i&1&&(l(0,"div",236),O(1,Cr,5,2,"span",280,ni),d()),i&2){let e=r(4).$implicit;s(),D(e.forecastMeta??ve(0,bt))}}function br(i,t){if(i&1){let e=w();l(0,"nile-button",283),g("click",function(){_(e);let o=r(5).$implicit,a=r(4);return u(a.tryAlternatePreview(o.charts[0]))}),p(1),d()}if(i&2){let e=r(5).$implicit,n=r(4);v("disabled",n.isStreaming()),s(),T(' Try "',n.previewAltLabel(e.charts[0]),'" instead ')}}function yr(i,t){if(i&1){let e=w();l(0,"nile-button",283),g("click",function(){_(e);let o=r(4).$implicit,a=r(4);return u(a.skipPreview(o.charts[0]))}),p(1," Skip this widget "),d(),f(2,br,2,2,"nile-button",284),l(3,"nile-button",285),g("click",function(){_(e);let o=r(4).$implicit,a=r(4);return u(a.acceptPreview(o.charts[0]))}),m(4,"nile-glyph",148),p(5," Add to dashboard "),d()}if(i&2){let e=r(4).$implicit,n=r(4);v("disabled",n.isStreaming()),s(2),C(n.previewAltLabel(e.charts[0])?2:-1),s(),v("disabled",n.isStreaming())}}function vr(i,t){if(i&1){let e=w();l(0,"nile-menu-item",50),g("click",function(){let o=_(e).$implicit,a=r(6).$implicit,c=r(4);return u(c.addInlineToExisting(a.charts,o.id))}),m(1,"nile-glyph",291),p(2),d()}if(i&2){let e=t.$implicit;s(2),T(" ",e.name||"Untitled"," ")}}function wr(i,t){if(i&1){let e=w();l(0,"nile-dropdown",289),g("nile-hide",function(){_(e);let o=r(9);return u(o.inlinePickerFor.set(null))}),l(1,"nile-button",290),g("click",function(){_(e);let o=r(5).$implicit,a=r(4);return u(a.inlinePickerFor.set(a.inlinePickerFor()===o.id?null:o.id))}),m(2,"nile-glyph",148),p(3),d(),l(4,"nile-menu"),O(5,vr,3,1,"nile-menu-item",null,te),m(7,"nile-divider"),l(8,"nile-menu-item",50),g("click",function(){_(e);let o=r(5).$implicit,a=r(4);return u(a.addInlineWidget(o.charts))}),m(9,"nile-glyph",51),p(10),d()()()}if(i&2){let e=r(5).$implicit,n=r(4);v("open",n.inlinePickerFor()===e.id),s(),F("loading",n.committingAction()==="add"?"":null)("disabled",n.committingAction()?"":null),s(2),T(" ",n.copy().addToDashboardButton," "),s(2),D(n.nonAutoDashboards()),s(5),T(" ",n.copy().newDashboardLabel," ")}}function kr(i,t){if(i&1){let e=w();l(0,"nile-button",20),g("click",function(){_(e);let o=r(5).$implicit,a=r(4);return u(a.addInlineDefault(o.charts))}),m(1,"nile-glyph",148),p(2),d()}if(i&2){let e=r(9);F("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()?"":null),s(2),T(" ",e.builderOpen()?e.copy().addToCurrentDashboardButton:e.copy().addToDashboardButton," ")}}function Pr(i,t){if(i&1){let e=w();l(0,"nile-button",19),g("click",function(){_(e);let o=r(4).$implicit,a=r(4);return u(a.addToLibrary(o.charts[0]))}),m(1,"nile-glyph",286),p(2),d(),f(3,wr,11,5,"nile-dropdown",287)(4,kr,3,3,"nile-button",288)}if(i&2){let e=r(8);s(2),T(" ",e.copy().addToLibraryButton," "),s(),C(!e.builderOpen()&&e.nonAutoDashboards().length>1?3:4)}}function Ar(i,t){if(i&1&&(l(0,"div",201)(1,"div")(2,"shared-nile-chart-widget",231),f(3,Oa,3,0,"span",232),f(4,Da,2,0,"span",233),f(5,Ra,7,0,"nile-dropdown",234),f(6,Ka,7,3,"nile-dropdown",235),f(7,fr,10,3,"nile-dropdown",235),d()(),f(8,xr,3,1,"div",236),l(9,"div",237),f(10,yr,6,3)(11,Pr,5,2),d()()),i&2){let e=r(3).$implicit,n=r(4);s(),Xe(n.inlineChartClass(e.charts[0])),s(),v("config",n.inlineDisplayConfig(e.charts[0]))("loading",!!e.forecastRecomputing||n.isInlineRecordsLoading(e.charts[0]))("widgetId",e.id)("conversationId",n.activeConversationId()),s(),C(e.forecast?3:-1),s(),C(n.isPreviewChart(e.charts[0])?4:-1),s(),C(n.inlineWidgetMenuItems(e).length?5:-1),s(),C(n.isFilterChart(e.charts[0])?-1:6),s(),C(n.isFilterChart(e.charts[0])?-1:7),s(),C(e.forecastMeta!=null&&e.forecastMeta.length?8:-1),s(2),C(n.isPreviewChart(e.charts[0])?10:11)}}function Mr(i,t){i&1&&(l(0,"span",233),p(1,"Preview"),d(),p(2," \xB7 "))}function Sr(i,t){if(i&1){let e=w();l(0,"nile-button",283),g("click",function(){_(e);let o=r(5).$implicit,a=r(4);return u(a.tryAlternatePreview(o.charts[0]))}),p(1),d()}if(i&2){let e=r(5).$implicit,n=r(4);v("disabled",n.isStreaming()),s(),T(' Try "',n.previewAltLabel(e.charts[0]),'" instead ')}}function Tr(i,t){if(i&1){let e=w();l(0,"div",237)(1,"nile-button",283),g("click",function(){_(e);let o=r(4).$implicit,a=r(4);return u(a.skipPreview(o.charts[0]))}),p(2," Skip this widget "),d(),f(3,Sr,2,2,"nile-button",284),l(4,"nile-button",285),g("click",function(){_(e);let o=r(4).$implicit,a=r(4);return u(a.acceptPreview(o.charts[0]))}),m(5,"nile-glyph",148),p(6," Add to dashboard "),d()()}if(i&2){let e=r(4).$implicit,n=r(4);s(),v("disabled",n.isStreaming()),s(2),C(n.previewAltLabel(e.charts[0])?3:-1),s(),v("disabled",n.isStreaming())}}function Fr(i,t){if(i&1){let e=w();l(0,"div",292),g("click",function(){_(e);let o=r(3).$implicit,a=r(4);return u(a.openArtifact(o.charts,o.id))}),l(1,"div",293),m(2,"nile-glyph",294),d(),l(3,"div",295)(4,"span",296),p(5),d(),l(6,"span",297),f(7,Mr,3,0),p(8),d()(),l(9,"nile-button",20),g("click",function(o){_(e);let a=r(3).$implicit,c=r(4);return o.stopPropagation(),u(c.openArtifact(a.charts,a.id))}),p(10),m(11,"nile-glyph",298),d()(),f(12,Tr,7,3,"div",237)}if(i&2){let e=r(3).$implicit,n=r(4);s(5),P(e.dashboardTitle||e.charts[0].title),s(2),C(n.isPreviewChart(e.charts[0])?7:-1),s(),J(" Dashboard \xB7 ",e.charts.length," widget",e.charts.length!==1?"s":""," "),s(2),T(" ",n.copy().viewButton," "),s(2),C(e.charts.length===1&&n.isPreviewChart(e.charts[0])?12:-1)}}function qr(i,t){if(i&1){let e=w();l(0,"div",202),m(1,"nile-glyph",299),l(2,"span",300),p(3),d(),l(4,"button",301),g("click",function(){_(e);let o=r(3).$implicit,a=r(4);return u(a.recomputeStoredForecast(o))}),p(5),d()()}if(i&2){let e=r(3).$implicit,n=r(4);s(3),P(n.restoredForecastLabel(e)),s(),v("disabled",n.isStreaming()),s(),T(" ",n.copy().recomputeButton," ")}}function Or(i,t){if(i&1&&m(0,"nile-glyph",304),i&2){let e=r().$implicit;F("name",e.icon)("color",e.tone==="ai"?"#7a5af8":"#717680")}}function Dr(i,t){if(i&1&&(l(0,"span",306),p(1),d()),i&2){let e=r().$implicit;s(),P(e.badge)}}function Er(i,t){if(i&1){let e=w();l(0,"button",303),g("click",function(){let o=_(e).$implicit,a=r(4).$implicit,c=r(4);return u(c.onFollowUp(o,a))}),f(1,Or,1,2,"nile-glyph",304),l(2,"span",305),p(3),d(),f(4,Dr,2,1,"span",306),d()}if(i&2){let e=t.$implicit,n=r(8);B("follow-up--ai",e.tone==="ai"),v("disabled",n.isStreaming()),s(),C(e.icon?1:-1),s(2),P(e.label),s(),C(e.badge?4:-1)}}function Ir(i,t){if(i&1&&(l(0,"div",203),O(1,Er,5,6,"button",302,$i),d()),i&2){let e=r(3).$implicit;s(),D(e.followUps??ve(0,bt))}}function Vr(i,t){if(i&1&&(l(0,"div",204),m(1,"nile-glyph",307),l(2,"span",308),p(3),d()()),i&2){let e=r(7);s(3),P(e.copy().errors.assistantErrorFallback)}}function Rr(i,t){if(i&1&&(l(0,"nile-ai-chat-bubble",197)(1,"div",198),f(2,ga,2,1),O(3,Fa,5,3,"div",199,Q),f(5,qa,3,2,"div",200),f(6,Ar,12,13,"div",201)(7,Fr,13,6),f(8,qr,6,3,"div",202),f(9,Ir,3,1,"div",203),f(10,Vr,4,1,"div",204),d()()),i&2){let e=r(2).$implicit,n=r(4);v("role","ai")("hideIcon",!0),s(2),C(e.text&&!n.suppressTextFor(e)?2:-1),s(),D(e.choices),s(2),C(n.isMultiChoice(e)?5:-1),s(),C(e.charts.length===1&&!n.isDataGrid(e.charts[0])?6:e.charts.length?7:-1),s(2),C(n.isRestoredForecast(e)?8:-1),s(),C(e.followUps!=null&&e.followUps.length?9:-1),s(),C(e.hasError?10:-1)}}function zr(i,t){if(i&1&&(f(0,pa,1,1,"nile-ai-steps",196),f(1,Rr,11,8,"nile-ai-chat-bubble",197)),i&2){let e=r().$implicit;C(e.isStreaming&&(e.tools!=null&&e.tools.length)?0:-1),s(),C(e.text||e.charts.length||e.choices!=null&&e.choices.length||e.hasError?1:-1)}}function Nr(i,t){if(i&1&&(f(0,ca,5,4,"nile-ai-chat-bubble",182),f(1,zr,2,2)),i&2){let e=t.$implicit;C(e.role==="user"?0:-1),s(),C(e.role==="assistant"?1:-1)}}function $r(i,t){if(i&1&&O(0,Nr,2,2,null,null,te),i&2){let e=r(3);D(e.messages())}}function Lr(i,t){if(i&1&&(l(0,"div",172),ye(1,157),d()),i&2){r(3);let e=ce(7);s(),v("ngTemplateOutlet",e)}}function Wr(i,t){if(i&1){let e=w();l(0,"nile-ai-chat",171,2),g("mouseup",function(o){_(e);let a=r(2);return u(a.onThreadMouseUp(o))}),f(2,na,11,0)(3,$r,2,0),f(4,Lr,2,1,"div",172),d()}if(i&2){let e=r(2);s(2),C(e.loadingConversation()?2:3),s(2),C(e.messages().length?4:-1)}}function Br(i,t){if(i&1&&f(0,ta,12,4,"div",149)(1,Wr,5,2,"nile-ai-chat",150),i&2){let e=r();C(!e.loadingConversation()&&!e.messages().length?0:1)}}function Ur(i,t){if(i&1&&(l(0,"div",310),m(1,"nile-glyph",317),l(2,"span"),p(3),d()()),i&2){let e=r(2);s(3),P(e.copy().dropFilesOverlay)}}function Gr(i,t){if(i&1){let e=w();l(0,"div",311),m(1,"nile-glyph",30),l(2,"span",318),p(3),d(),l(4,"button",319),g("click",function(){_(e);let o=r(2);return u(o.clearReplyQuote())}),m(5,"nile-glyph",320),d()()}i&2&&(s(3),P(t))}function Hr(i,t){i&1&&m(0,"nile-spinner",323)}function jr(i,t){if(i&1){let e=w();l(0,"button",326),g("click",function(){_(e);let o=r().$implicit,a=r(3);return u(a.retryAttachment(o.id))}),p(1,"Retry"),d()}}function Qr(i,t){if(i&1){let e=w();l(0,"div",322),m(1,"nile-glyph",194),l(2,"span",195),p(3),d(),f(4,Hr,1,0,"nile-spinner",323)(5,jr,2,0,"button",324),l(6,"button",325),g("click",function(){let o=_(e).$implicit,a=r(3);return u(a.removeAttachment(o.id))}),m(7,"nile-glyph",320),d()()}if(i&2){let e=t.$implicit;B("aq-chip--error",e.status==="error"),s(),F("name",e.contentType.startsWith("image/")?"ng-image-03":"ng-file-06"),s(),F("title",e.name),s(),P(e.name),s(),C(e.status==="uploading"?4:e.status==="error"?5:-1)}}function Yr(i,t){if(i&1&&(l(0,"div",312),O(1,Qr,8,6,"div",321,te),d()),i&2){let e=r(2);s(),D(e.attachments())}}function Kr(i,t){if(i&1){let e=w();l(0,"nile-button",327),g("click",function(){_(e),r();let o=ce(5);return u(o.click())}),m(1,"nile-glyph",328),d()}if(i&2){let e=r(2);F("disabled",e.isStreaming()||e.attachAtCapacity()?"":null)}}function Jr(i,t){if(i&1){let e=w();l(0,"div",309),g("dragenter",function(o){_(e);let a=r();return u(a.onComposerDragEnter(o))})("dragover",function(o){_(e);let a=r();return u(a.onComposerDragOver(o))})("dragleave",function(o){_(e);let a=r();return u(a.onComposerDragLeave(o))})("drop",function(o){_(e);let a=r();return u(a.onComposerDrop(o))}),f(1,Ur,4,1,"div",310),f(2,Gr,6,1,"div",311),f(3,Yr,3,0,"div",312),l(4,"input",313,4),g("change",function(o){_(e);let a=r();return u(a.onFilesPicked(o))}),d(),l(6,"nile-ai-prompt",314,5),g("keydown",function(o){_(e);let a=r();return u(a.onComposerKeydown(o))})("nile-change",function(o){_(e);let a=r();return u(a.inputText.set((o.detail==null?null:o.detail.value)??""))})("nile-submit",function(o){_(e);let a=r();return u(a.onComposerSubmit(o.detail==null?null:o.detail.value))})("nile-stop",function(){_(e);let o=r();return u(o.stopStream())}),l(8,"div",315),g("click",function(o){return o.stopPropagation()}),f(9,Kr,2,1,"nile-button",316),d()()()}if(i&2){let e,n=r();B("aq-composer-wrap--dragover",n.isDraggingFile()),s(),C(n.features().attachments&&n.isDraggingFile()?1:-1),s(),C((e=n.replyQuote())?2:-1,e),s(),C(n.features().attachments&&n.attachments().length?3:-1),s(),F("accept",n.acceptUploadTypes),s(2),B("aq-attach-full",n.attachAtCapacity()),v("placeholder",n.copy().composerPlaceholder)("hideModel",!0)("hideAddContext",!0)("rows",1)("speechLang","en-US")("value",n.inputText())("loading",n.isStreaming()),s(3),C(n.features().attachments?9:-1)}}function Xr(i,t){if(i&1){let e=w();l(0,"div",329),g("pointerdown",function(o){_(e);let a=r();return u(a.startChatResize(o))}),d()}if(i&2){let e=r();B("is-active",e.isResizing())}}function Zr(i,t){if(i&1){let e=w();l(0,"div",331)(1,"div",336)(2,"span",337),p(3,"Preview"),d(),l(4,"span",338),p(5),d()(),l(6,"div",339)(7,"div",340),m(8,"nile-glyph",341),l(9,"nile-slide-toggle",342),g("nile-change",function(o){_(e);let a=r(2);return u(a.onFiltersToggle(o.detail.checked))}),d()(),l(10,"div",343)(11,"nile-button",344),g("click",function(){_(e);let o=r(2);return u(o.undoCanvas())}),m(12,"nile-glyph",345),p(13," Undo "),d(),l(14,"nile-button",346),g("click",function(){_(e);let o=r(2);return u(o.redoCanvas())}),m(15,"nile-glyph",347),d()(),m(16,"span",348),l(17,"nile-button",349),g("click",function(){_(e);let o=r(2);return u(o.closeArtifact())}),m(18,"nile-glyph",350),d()()()}if(i&2){let e=r(2);s(5),P(e.artifactSubtitle()),s(2),B("aq-filters-pill--active",e.artifactHasFilter()),s(2),v("isChecked",e.artifactHasFilter()),s(2),F("disabled",e.canUndoCanvas()?null:""),s(3),F("disabled",e.canRedoCanvas()?null:""),s(),F("color",e.canRedoCanvas()?"#344054":"#d0d5dd")}}function el(i,t){if(i&1&&(l(0,"div",333),m(1,"nile-glyph",351),l(2,"p",352),p(3),d(),l(4,"p",353),p(5),d()()),i&2){let e=r(2);s(3),P(e.copy().emptyCanvasTitle),s(2),P(e.copy().emptyCanvasSubtitle)}}function tl(i,t){if(i&1){let e=w();l(0,"shared-dashboard-grid",354,6),g("selectionChange",function(o){_(e);let a=r(2);return u(a.onSelectionChange(o))})("forecast",function(o){_(e);let a=r(2);return u(a.onArtifactForecast(o))})("setAlert",function(o){_(e);let a=r(2);return u(a.onSetAlert(o))})("filterSubmit",function(o){_(e);let a=r(2);return u(a.onArtifactFilterSubmit(o))})("filterChange",function(o){_(e);let a=r(2);return u(a.onArtifactFilterChange(o))})("dslWidgetUpdated",function(o){_(e);let a=r(2);return u(a.onDslWidgetUpdated(o))})("dslEditorClosed",function(){_(e);let o=r(2);return u(o.onArtifactDslEditorClosed())})("widgetClick",function(o){_(e);let a=r(2);return u(a.onKpiWidgetClicked(o))}),d()}if(i&2){let e=r(2);v("widgets",e.artifactWidgets())("conversationId",e.activeConversationId())("editMode",!1)("selectable",!0)("canSetAlert",!0)("canAddToStory",!1)("canForecast",!0)("forecastable",e.artifactForecastable())("forecastingWidgetId",e.artifactForecastingId())("showEditDslInViewMode",!0)("widgetsLoading",e.applyingFilters())("dashboardFilters",e.activeDashboardFilters())("resolvedFilters",e.activeResolvedFilters())("applySummary",e.applySummary())("filterExplanation",e.filterExplanation())}}function nl(i,t){if(i&1){let e=w();l(0,"nile-button",19),g("click",function(){let o=_(e),a=r(3);return u(a.forecastFromChart(o))}),m(1,"nile-glyph",357),p(2),d()}if(i&2){let e=r(3);s(2),T(" ",e.copy().forecastButton," ")}}function il(i,t){if(i&1){let e=w();l(0,"nile-button",19),g("click",function(){_(e);let o=r(3);return u(o.openStoryPicker())}),m(1,"nile-glyph",358),p(2),d()}if(i&2){let e=r(3);F("disabled",e.committingAction()||!e.hasSelection()?"":null),s(2),T(" ",e.copy().addToStoryButton," ")}}function ol(i,t){if(i&1){let e=w();l(0,"nile-menu-item",50),g("click",function(){let o=_(e).$implicit,a=r(4);return a.showAddPicker.set(!1),u(a.addToExistingDashboard(o.id))}),m(1,"nile-glyph",291),p(2),d()}if(i&2){let e=t.$implicit;s(2),T(" ",e.name||"Untitled"," ")}}function al(i,t){if(i&1){let e=w();l(0,"nile-dropdown",359),g("nile-hide",function(){_(e);let o=r(3);return u(o.showAddPicker.set(!1))}),l(1,"nile-button",290),g("click",function(){_(e);let o=r(3);return u(o.showAddPicker.set(!o.showAddPicker()))}),m(2,"nile-glyph",148),p(3),d(),l(4,"nile-menu"),O(5,ol,3,1,"nile-menu-item",null,te),m(7,"nile-divider"),l(8,"nile-menu-item",50),g("click",function(){_(e);let o=r(3);return o.showAddPicker.set(!1),u(o.addArtifactToDashboard())}),m(9,"nile-glyph",51),p(10),d()()()}if(i&2){let e=r(3);v("open",e.showAddPicker()),s(),F("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),s(2),T(" ",e.copy().addToDashboardButton," "),s(2),D(e.nonAutoDashboards()),s(5),T(" ",e.copy().newDashboardLabel," ")}}function rl(i,t){if(i&1){let e=w();l(0,"nile-button",20),g("click",function(){_(e);let o=r(3);return u(o.addArtifactToDashboard())}),m(1,"nile-glyph",148),p(2),d()}if(i&2){let e=r(3);F("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),s(2),T(" ",e.builderOpen()?e.copy().addToCurrentDashboardButton:e.copy().addToDashboardButton," ")}}function ll(i,t){if(i&1){let e=w();l(0,"div",335),f(1,nl,3,1,"nile-button",355),f(2,il,3,2,"nile-button",355),l(3,"nile-button",19),g("click",function(){_(e);let o=r(2);return u(o.publishAsNewDashboard())}),p(4),d(),f(5,al,11,5,"nile-dropdown",356)(6,rl,3,3,"nile-button",288),d()}if(i&2){let e,n=r(2);s(),C((e=n.artifactForecastMsg())?1:-1,e),s(),C(-1),s(),F("loading",n.committingAction()==="publish"?"":null)("disabled",n.committingAction()||!n.hasSelection()?"":null),s(),T(" ",n.copy().publishAsDashboardButton," "),s(),C(!n.builderOpen()&&n.nonAutoDashboards().length>1?5:6)}}function sl(i,t){if(i&1&&(l(0,"aside",330),f(1,Zr,19,7,"div",331),l(2,"div",332),f(3,el,6,2,"div",333)(4,tl,2,15,"shared-dashboard-grid",334),d(),f(5,ll,7,6,"div",335),ye(6,157),d()),i&2){let e=r(),n=ce(32);B("aq-artifact-pane--dsl-only",e.dslOnlyArtifact()),s(),C(e.dslOnlyArtifact()?-1:1),s(2),C(e.artifactWidgets().length===0?3:4),s(2),C(e.dslOnlyArtifact()?-1:5),s(),v("ngTemplateOutlet",n)}}function dl(i,t){i&1&&m(0,"nile-spinner",371)}function cl(i,t){i&1&&m(0,"nile-glyph",372)}function pl(i,t){if(i&1){let e=w();l(0,"input",368),g("input",function(o){_(e);let a=r(2);return u(a.dashboardTitleDraft.set(o.target.value))})("keydown.enter",function(){_(e);let o=r(2);return u(o.commitDashboardTitle())})("keydown.escape",function(){_(e);let o=r(2);return u(o.cancelEditDashboardTitle())}),d(),l(1,"nile-lite-tooltip",369)(2,"button",370),g("click",function(){_(e);let o=r(2);return u(o.commitDashboardTitle())}),f(3,dl,1,0,"nile-spinner",371)(4,cl,1,0,"nile-glyph",372),d()()}if(i&2){let e=r(2);v("value",e.dashboardTitleDraft()),s(2),v("disabled",e.renamingDashboard()),s(),C(e.renamingDashboard()?3:4)}}function _l(i,t){i&1&&m(0,"nile-skeleton-loader",362)}function ul(i,t){if(i&1){let e=w();l(0,"nile-lite-tooltip",374)(1,"button",375),g("click",function(){_(e);let o=r(3);return u(o.startEditDashboardTitle())}),m(2,"nile-glyph",376),d()()}}function gl(i,t){if(i&1&&(l(0,"span",373),p(1),d(),f(2,ul,3,0,"nile-lite-tooltip",374)),i&2){let e=r(2);s(),P((e.builderRef==null?null:e.builderRef.dashboardName())||"Dashboard"),s(),C(e.builderDashboardId()?2:-1)}}function ml(i,t){if(i&1){let e=w();l(0,"section",15)(1,"header",360)(2,"div",31)(3,"nile-button",349),g("click",function(){_(e);let o=r();return u(o.closeBuilder())}),m(4,"nile-glyph",361),d(),f(5,pl,5,3)(6,_l,1,0,"nile-skeleton-loader",362)(7,gl,3,2),d(),l(8,"div",33)(9,"nile-lite-tooltip",363)(10,"button",364),g("click",function(){_(e);let o=r();return u(o.toggleBuilderFullscreen())}),m(11,"nile-glyph",365),d()(),l(12,"shared-builder-toolbar",366),g("action",function(o){_(e);let a=r();return u(a.onBuilderMenuAction(o))}),d()()(),l(13,"shared-builder-host",367),g("exitBuilder",function(){_(e);let o=r();return u(o.closeBuilder())})("executiveSummary",function(o){_(e);let a=r();return u(a.onExecutiveSummary(o))})("galleryPrompt",function(o){_(e);let a=r();return u(a.inputText.set(o))})("published",function(o){_(e);let a=r();return u(a.onBuilderPublished(o))})("widgetClick",function(o){_(e);let a=r();return u(a.onKpiWidgetClicked(o))}),d(),ye(14,157),d()}if(i&2){let e=r(),n=ce(32);s(5),C(e.editingDashboardTitle()?5:e.builderRef!=null&&e.builderRef.loading()?6:7),s(4),v("content",e.builderFullscreen()?"Exit full screen":"Full screen"),s(),F("aria-label",e.builderFullscreen()?"Exit full screen":"Full screen"),s(),F("name",e.builderFullscreen()?"ng-minimize":"ng-maximize"),s(),v("canForecast",!0)("anyForecastOn",(e.builderRef==null?null:e.builderRef.anyForecastOn())??!1)("editMode",(e.builderRef==null?null:e.builderRef.editMode())??!0)("showFullscreen",!1)("fullscreen",e.builderFullscreen())("busy",(e.builderRef==null?null:e.builderRef.isPublishing())??!1)("showPromptGallery",!1),s(),v("dashboardId",e.builderDashboardId())("preseeded",e.builderPreseeded())("galleryPrompts",e.suggestions())("canAddToStory",!1),s(),v("ngTemplateOutlet",n)}}function hl(i,t){if(i&1){let e=w();l(0,"label",387)(1,"input",388),g("change",function(){let o=_(e).$implicit,a=r(3);return u(a.onGranularityPick(o))}),d(),l(2,"span"),p(3),d()()}if(i&2){let e=t.$implicit,n=r(2);B("fs-segment--on",n.granularity===e.value)("fs-segment--off",!e.enabled),F("title",e.reason||null),s(),v("value",e.value)("checked",n.granularity===e.value)("disabled",!e.enabled),s(2),P(e.value)}}function fl(i,t){i&1&&(l(0,"p",381),p(1),d()),i&2&&(s(),P(t))}function Cl(i,t){if(i&1&&(l(0,"p",381),p(1),d()),i&2){let e=r();s(),P(e.granularityNote)}}function xl(i,t){if(i&1&&(l(0,"div",377)(1,"span",389),p(2,"Model"),d(),l(3,"div",390)(4,"p",391),p(5),d(),l(6,"p",392),p(7),d()()()),i&2){let e=t;s(5),P(e.title),s(2),P(e.body)}}function bl(i,t){if(i&1&&(l(0,"div",377)(1,"span",389),p(2,"Guardrails"),d(),l(3,"div",393)(4,"p",391),m(5,"nile-glyph",394),p(6),d(),l(7,"p",392),p(8),d()()()),i&2){let e=t;s(3),B("fs-card--pass",e.passed)("fs-card--warn",!e.passed),s(2),F("name",e.passed?"ng-check":"ng-alert-circle")("color",e.passed?"#079455":"#dc6803"),s(),T(" ",e.title," "),s(2),P(e.body)}}function yl(i,t){if(i&1){let e=w();l(0,"div",377)(1,"label",378),p(2," Horizon \u2014 "),l(3,"span",379),p(4),d()(),l(5,"input",380),g("input",function(o){_(e);let a=r(2);return u(a.onHorizonInput(o.target.value))}),d(),l(6,"p",381),p(7),d()(),l(8,"div",377)(9,"span",382),p(10,"Granularity"),d(),l(11,"div",383),O(12,hl,4,9,"label",384,Qe),d(),f(14,fl,2,1,"p",381)(15,Cl,2,1,"p",381),d(),l(16,"div",377)(17,"label",385),p(18," Confidence interval \u2014 "),l(19,"span",379),p(20),d()(),l(21,"input",386),g("input",function(o){_(e);let a=r(2);return u(a.onConfidenceIndexInput(o.target.value))}),d(),l(22,"p",381),p(23),d()(),f(24,xl,8,2,"div",377),f(25,bl,9,8,"div",377)}if(i&2){let e,n,o,a=t,c=r(),h=r();s(4),J("",c.horizon," ",h.horizonUnit()),s(),Z("--fs-fill",h.horizonFill()),v("value",c.horizon),F("max",h.horizonMax())("aria-valuetext",c.horizon+" "+h.horizonUnit()),s(2),P(h.horizonNote()),s(5),D(h.granularityChoices()),s(2),C((e=h.unavailableGranularityNote())?14:15,e),s(6),T("",c.confidence,"%"),s(),Z("--fs-fill",h.confidenceFill()),v("value",h.confidenceIndex()),F("max",a.confidenceLevels.length-1)("aria-valuetext",c.confidence+"%"),s(2),P(a.confidenceNote),s(),C((n=a.modelCard)?24:-1,n),s(),C((o=a.guardrails)?25:-1,o)}}function vl(i,t){if(i&1&&f(0,yl,26,18),i&2){let e,n=r();C((e=n.forecastCopy())?0:-1,e)}}function wl(i,t){if(i&1&&(l(0,"div",398),m(1,"nile-skeleton-loader",399),l(2,"div",400),m(3,"nile-skeleton-loader",70),d()()),i&2){let e=t.$implicit;s(2),Z("width",e,"px")}}function kl(i,t){if(i&1&&(l(0,"div",396),O(1,wl,4,2,"div",398,Q),d()),i&2){let e=r(2);s(),D(e.gallerySkeletonRows)}}function Pl(i,t){if(i&1){let e=w();l(0,"nile-ai-prompts",401),g("nile-item-click",function(o){_(e);let a=r(2);return u(a.onGalleryPromptPick(o.detail==null?null:o.detail.data))}),d()}if(i&2){let e=r(2);v("items",e.galleryPromptItems())("vertical",!0)("wrap",!0)}}function Al(i,t){if(i&1&&(l(0,"div",116),p(1),d()),i&2){let e=r(2);s(),J("",e.copy().noPromptsMatch,' "',e.gallerySearch(),'".')}}function Ml(i,t){if(i&1&&(l(0,"div",116),p(1),d()),i&2){let e=r(2);s(),P(e.copy().noPromptsYet)}}function Sl(i,t){if(i&1){let e=w();l(0,"nile-input",395),g("nile-input",function(o){_(e);let a=r();return u(a.gallerySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){_(e);let a=r();return u(a.gallerySearch.set((o.detail==null?null:o.detail.value)??""))}),m(1,"nile-glyph",97),d(),f(2,kl,3,0,"div",396)(3,Pl,1,3,"nile-ai-prompts",397)(4,Al,2,2,"div",116)(5,Ml,2,1,"div",116)}if(i&2){let e=r();v("placeholder",e.copy().promptGallerySearchPlaceholder)("value",e.gallerySearch()),s(2),C(e.suggestionsLoading()?2:e.filteredGalleryPrompts().length?3:e.gallerySearch().trim()?4:5)}}function Tl(i,t){i&1&&(l(0,"nile-breadcrumb-item"),p(1),d()),i&2&&(s(),T(" ",t," "))}function Fl(i,t){i&1&&p(0),i&2&&T(" ",t," ")}function ql(i,t){i&1&&m(0,"nile-skeleton-loader",405)}function Ol(i,t){if(i&1&&m(0,"nile-skeleton-loader",413),i&2){let e=t.$implicit;Z("left",e.x/12*100,"%")("top",e.y*72,"px")("width","calc("+e.w/12*100+"% - 12px)")("height",e.h*72-12,"px")}}function Dl(i,t){if(i&1&&(l(0,"div",411),O(1,Ol,1,8,"nile-skeleton-loader",412,Q),d()),i&2){let e=r(4);Z("height",e.widgetDetailPanelSkeletonHeight(),"px"),s(),D(e.widgetDetailPanelSkeletonSlots())}}function El(i,t){i&1&&(l(0,"div",410)(1,"div",414),m(2,"nile-skeleton-loader",415)(3,"nile-skeleton-loader",415)(4,"nile-skeleton-loader",415),d(),m(5,"nile-skeleton-loader",416),d())}function Il(i,t){if(i&1&&f(0,Dl,3,2,"div",409)(1,El,6,0,"div",410),i&2){let e=r(3);C(e.widgetDetailPanelSkeletonSlots().length?0:1)}}function Vl(i,t){if(i&1){let e=w();l(0,"shared-dashboard-grid",417),g("selectionChange",function(o){_(e);let a=r(3);return u(a.widgetDetailPanelSelectedIds.set(o))}),d()}if(i&2){let e=r(3);v("widgets",e.widgetDetailPanelWidgets())("editMode",!1)("selectable",e.widgetDetailPanelKind()==="dashboard")("selectedWidgetIds",e.widgetDetailPanelSelectedIds())("canSetAlert",!1)("canAddToStory",!1)("canForecast",!1)}}function Rl(i,t){if(i&1){let e=w();l(0,"div",408)(1,"span",418),p(2),d(),l(3,"nile-button",19),g("click",function(){_(e);let o=r(3);return u(o.toggleSelectAllDetailPanelWidgets())}),p(4),d(),l(5,"nile-button",19),g("click",function(){_(e);let o=r(3);return u(o.addSelectedDetailPanelWidgetsToCanvas())}),m(6,"nile-glyph",419),p(7),d(),l(8,"nile-button",20),g("click",function(){_(e);let o=r(3);return u(o.replaceCanvasWithDetailPanel())}),m(9,"nile-glyph",420),p(10," Replace canvas "),d()()}if(i&2){let e=r(3);s(2),J(" ",e.widgetDetailPanelSelectedIds().length," of ",e.widgetDetailPanelWidgets().length," selected "),s(2),T(" ",e.isDetailPanelFullySelected()?"Deselect all":"Select all"," "),s(),F("disabled",e.widgetDetailPanelSelectedIds().length?null:""),s(2),T(" Add ",e.widgetDetailPanelSelectedIds().length," to canvas "),s(),F("disabled",e.widgetDetailPanelWidgets().length?null:"")}}function zl(i,t){if(i&1){let e=w();l(0,"div",408)(1,"nile-button",20),g("click",function(){_(e);let o=r(3);return u(o.addWidgetTemplateFromDetailPanel())}),m(2,"nile-glyph",148),p(3," Add to dashboard "),d()()}}function Nl(i,t){if(i&1){let e=w();l(0,"div",402)(1,"div",403)(2,"nile-breadcrumb",404),g("nile-click",function(){_(e);let o=r(2);return u(o.closeWidgetDetailPanel())}),l(3,"nile-breadcrumb-item"),p(4),d(),f(5,Tl,2,1,"nile-breadcrumb-item"),l(6,"nile-breadcrumb-item"),f(7,Fl,1,1)(8,ql,1,0,"nile-skeleton-loader",405),d()()(),l(9,"div",406),f(10,Il,2,1)(11,Vl,1,7,"shared-dashboard-grid",407),d(),f(12,Rl,11,6,"div",408)(13,zl,4,0,"div",408),d()}if(i&2){let e,n,o=r(2);s(4),T(" ",o.copy().detailCanvasCrumbLabel," "),s(),C((e=o.detailPanelWidgetCrumb())?5:-1,e),s(2),C((n=o.detailPanelLastCrumb())?7:8,n),s(3),C(o.widgetDetailPanelLoading()?10:11),s(2),C(o.widgetDetailPanelKind()==="dashboard"?12:o.widgetDetailPanelCanAdd()?13:-1)}}function $l(i,t){if(i&1&&f(0,Nl,14,5,"div",402),i&2){let e=r();C(e.widgetDetailPanelOpen()?0:-1)}}function Ll(i,t){if(i&1){let e=w();l(0,"app-alert-drawer",421),g("closed",function(){_(e);let o=r();return u(o.onAlertClosed())})("saved",function(){_(e);let o=r();return u(o.onAlertClosed())}),d()}if(i&2){let e,n=r();v("open",n.alertDrawerOpen())("widget",n.alertWidget())("dashboardId",null)("source",n.alertSource())("sourceName",((e=n.selectedScope())==null?null:e.name)??"")("authoringMode","chat")}}function Wl(i,t){i&1&&m(0,"nile-executive-summary",27,7)}function Bl(i,t){if(i&1){let e=w();l(0,"app-story-picker-drawer",422),g("closed",function(){_(e);let o=r();return u(o.closeStoryPicker())})("added",function(){_(e);let o=r();return u(o.onAddedToStory())}),d()}if(i&2){let e=r();v("open",e.storyPickerOpen())("widget",e.storyPickerWidget())}}function _e(){return Math.random().toString(36).slice(2)}function Ul(i){if(!i.length)return i;let t=new Map;for(let a of i){let c=t.get(a.y)??[];c.push(a),t.set(a.y,c)}let e=[...t.keys()].sort((a,c)=>a-c),n=[],o=0;for(let a of e){let c=t.get(a);for(let h of c)n.push(S(b({},h),{y:o}));o+=Math.max(...c.map(h=>h.h))}return n}var Gl=4,Hl="forecast-settings",jl="forecast-this";function oi(i){return i.split(`
|
|
7
|
-
`).map(t=>{let e=/^For "[^"]+":\s*(.*)$/.exec(t);return e?e[1]:t}).join(`
|
|
8
|
-
`)}function ei(i){return{id:i.id,role:i.role,text:i.role==="user"?oi(i.content):i.content,charts:(i.charts??[]).map(t=>{let e=t;return{title:e.title??"Chart",componentName:e.componentName??"",config:t}}),dashboardTitle:i.dashboardTitle??void 0,forecastSpec:i.forecastSpec??void 0,choices:i.choices??void 0,isStreaming:!1,hasError:!1}}var Pe=class i{alertDrawerOpen=x(!1);alertWidget=x(null);onSetAlert(t){this.alertWidget.set(t),this.alertDrawerOpen.set(!0)}onAlertClosed(){this.alertDrawerOpen.set(!1)}alertSource=q(()=>{let t=rt(this.selectedScope());if(t)return t;let e=this.conversationConnectionId();return e?{connectionId:e}:null});chartDataSourceId(t){return(t?.config??{}).dataSourceId??null}canCreateAlert(t){return!!this.alertSource()||!!this.chartDataSourceId(t)}createAlertFromChart(t){this.canCreateAlert(t)&&(this.isFilterChart(t)||this.onSetAlert(S(b({},this.artifactToWidget(t)),{id:"chat-alert"})))}aqChatEl;builderRef;artifactGridRef;composerRef;aiExecutiveSummaryEl;svc=$(xe);tokenStore=$(ae);features(){return R().features}copy(){return R().copy}showHeader(){return R().ui.header}withCount(t,e){return Fn(t,e)}zone=$(wt);appRef=$(At);route=$(Lt);router=$(Wt);dashboardState=$(vn);publishRepo=$(re);globalWidget=$(kn);forecastApi=$(Ge);forecastService=$(Zt);loading=x(!0);conversations=x([]);activeConversationId=x(null);conversationConnectionId=x(null);messages=x([]);inputText=x("");isStreaming=x(!1);streamAbort=null;suggestions=x([]);suggestionsLoading=x(!0);suggestionsSeq=0;showConversationPicker=x(!1);showRelatedDashboards=x(!1);loadingConversation=x(!1);editingTitle=x(!1);titleDraft=x("");editingDashboardTitle=x(!1);dashboardTitleDraft=x("");renamingDashboard=x(!1);conversationsLoading=x(!0);dashboardsLoading=x(!0);menuSkeletonRows=[188,142,205];gallerySkeletonRows=[420,300,480,360,260,400];librarySkeletonGroups=[["62%","48%"],["55%","70%"]];libraryChipSkeletonWidths=[58,96,84,78,86,88,100,104,76,88];savingDashboard=x(!1);committingAction=x(null);conversationDashboards=x([]);nonAutoDashboards=q(()=>this.conversationDashboards().filter(t=>!t.isAutoGenerated));showAddPicker=x(!1);inlinePickerFor=x(null);inlineChartTypePickerFor=x(null);inlineChartTypeOptions=x([]);inlineChartTypeLoading=x(!1);inlineChartTypePickerSeq=0;inlineChartTypeApplying=x(!1);inlineChartTypeError=x(null);inlineFilterPickerFor=x(null);showScopePicker=x(!1);datasets=x([]);pipelines=x([]);scopeLoading=x(!1);selectedScope=x(null);scopeListsLoaded=!1;saveDialogOpen=x(!1);saveDashboardName=x("");chatPaneTab=x("chat");setChatPaneTab(t){t==="library"&&!this.features().library||(this.chatPaneTab.set(t),t==="library"&&(this.ensureArtifactPaneOpen(),this.prefetchWidgetTemplateCatalog()))}galleryOpen=x(!1);gallerySearch=x("");templateCategories=x([]);templateAllTemplates=x([]);templateCategoriesLoading=x(!1);templateTemplatesLoading=x(!1);templateActiveCategory=x("all");widgetTemplateAllTemplates=x([]);widgetTemplateTemplatesLoading=x(!1);widgetTemplateActiveCategory=x("all");selectWidgetTemplateCategory(t){this.widgetTemplateActiveCategory.set(t)}widgetTemplatePickerSelectedIds=x([]);toggleWidgetTemplateSelection(t){this.widgetTemplatePickerSelectedIds.update(e=>e.includes(t)?e.filter(n=>n!==t):[...e,t])}addSelectedWidgetTemplates(){let t=this.widgetTemplatePickerSelectedIds();t.length&&(this.asOneCanvasStep(()=>{for(let e of t)this.selectWidgetTemplate(e)}),this.widgetTemplatePickerSelectedIds.set([]))}widgetTemplateCountForCategory(t){return this.widgetTemplateAllTemplates().filter(e=>e.category===t).length}librarySearch=x("");libraryKpiChartOptions={exporting:{enabled:!1},credits:{enabled:!1}};widgetTemplateCard(t){let e=this.widgetTemplatePreviews(),a=e.get(t.id)?.config?.config?.chart;return{templateId:t.id,title:t.widgetName,desc:t.description,value:a?.value??"\u2014",loading:!e.has(t.id),sparkline:a?.sparkline??[]}}libraryWidgetGroups=q(()=>{let t=this.widgetTemplateActiveCategory(),e=this.librarySearch().trim().toLowerCase();return(t==="all"?this.templateCategories():this.templateCategories().filter(o=>o.key===t)).map(o=>({key:o.key,label:o.label,cards:this.widgetTemplateAllTemplates().filter(a=>a.category===o.key).filter(a=>!e||a.widgetName.toLowerCase().includes(e)||(a.description??"").toLowerCase().includes(e)).map(a=>this.widgetTemplateCard(a))})).filter(o=>o.cards.length>0)});isGroupFullySelected(t){let e=this.widgetTemplatePickerSelectedIds();return t.length>0&&t.every(n=>e.includes(n.templateId))}toggleLibraryGroupSelection(t){let e=t.map(o=>o.templateId),n=this.isGroupFullySelected(t);this.widgetTemplatePickerSelectedIds.update(o=>{let a=new Set(o);return n?e.forEach(c=>a.delete(c)):e.forEach(c=>a.add(c)),[...a]})}openWidgetDetailFromCard(t){let e=this.widgetTemplatePreviews().get(t);if(!e)return;let n=S(b({},this.artifactToWidget(e)),{id:`kpi-gallery-${t}`});this.openWidgetDetailPanelForWidget(n,!0)}runViewTransition(t,e="forward"){let n=document,o=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;if(typeof n.startViewTransition!="function"||o){t();return}let a=document.documentElement;e==="back"&&(a.dataset.vtDirection="back");let c=()=>delete a.dataset.vtDirection;n.startViewTransition(()=>{t(),this.appRef.tick()})?.finished?.then(c,c)??c()}artifactPickerTab=x("kpis");templateCountForCategory(t){return this.templateAllTemplates().filter(e=>e.category===t).length}libraryDashboardGroups=q(()=>{let t=this.templateActiveCategory(),e=this.librarySearch().trim().toLowerCase();return(t==="all"?this.templateCategories():this.templateCategories().filter(o=>o.key===t)).map(o=>({key:o.key,label:o.label,templates:this.templateAllTemplates().filter(a=>a.category===o.key).filter(a=>!e||a.name.toLowerCase().includes(e)||(a.description??"").toLowerCase().includes(e))})).filter(o=>o.templates.length>0)});widgetTemplatePreviews=x(new Map);widgetTemplateSourceId=x(null);widgetDetailPanelOpen=x(!1);widgetDetailPanelLoading=x(!1);widgetDetailPanelTitle=x(null);widgetDetailPanelRaw=x([]);widgetDetailPanelTemplateId=x(null);widgetDetailPanelCanAdd=x(!1);widgetDetailPanelKind=x("widget");widgetDetailPanelSourceWidgetTitle=x(null);detailPanelWidgetCrumb=q(()=>this.widgetDetailPanelKind()==="widget"?this.widgetDetailPanelSourceWidgetTitle():null);detailPanelLastCrumb=q(()=>{let t=this.widgetDetailPanelTitle();return t?t===this.detailPanelWidgetCrumb()?this.copy().detailCrumbLabel:t:null});widgetDetailPanelSelectedIds=x([]);widgetDetailPanelSourceTemplateId=x(null);widgetDetailPanelSkeletonSlots=x([]);widgetDetailPanelSkeletonHeight=q(()=>{let t=this.widgetDetailPanelSkeletonSlots();return t.length?Math.max(...t.map(e=>(e.y+e.h)*72)):0});widgetDetailPanelWidgets=q(()=>{let t=this.widgetDetailPanelRaw().map((e,n)=>S(b({},this.artifactToWidget(e)),{id:`detail-panel-${n}`}));return it(t)});filteredGalleryPrompts=q(()=>{let t=this.gallerySearch().trim().toLowerCase(),e=this.suggestions();return t?e.filter(n=>n.toLowerCase().includes(t)):e});welcomePromptCards=q(()=>{let t=this.forecastContext();return this.suggestions().slice(0,Gl).map(e=>(R().features.forecast&&t?!!ut(e,t):!1)?{label:e,icon:"ng-stars-02",badge:"FORECAST",tone:"ai"}:{label:e,icon:"ng-lightbulb-05",tone:"plain"})});galleryPromptItems=q(()=>this.filteredGalleryPrompts().map(t=>({key:t,label:t,icon:"ng-lightbulb-05"})));artifactSourceMsgId=x(null);activeArtifactRaw=x([]);artifactForcedOpen=x(!1);templateSourceId=x(null);bucketExtraCharts=x([]);activeArtifact=q(()=>{let t=this.artifactSourceMsgId(),e=t?this.messages().find(o=>o.id===t)?.charts??this.activeArtifactRaw():this.activeArtifactRaw(),n=this.bucketExtraCharts();return n.length?[...e,...n]:e});artifactOpen=q(()=>this.artifactForcedOpen()||this.activeArtifact().length>0);dslOnlyArtifact=x(!1);CANVAS_HISTORY_LIMIT=25;canvasUndoStack=x([]);canvasRedoStack=x([]);canUndoCanvas=q(()=>this.canvasUndoStack().length>0);canRedoCanvas=q(()=>this.canvasRedoStack().length>0);canvasHistorySuspended=!1;snapshotCanvas(){return{base:[...this.activeArtifactRaw()],extras:[...this.bucketExtraCharts()],sourceMsgId:this.artifactSourceMsgId(),templateSourceId:this.templateSourceId(),widgetTemplateSourceId:this.widgetTemplateSourceId(),saveName:this.saveDashboardName()}}restoreCanvas(t){this.artifactSourceMsgId.set(t.sourceMsgId),this.activeArtifactRaw.set(t.base),this.bucketExtraCharts.set(t.extras),this.templateSourceId.set(t.templateSourceId),this.widgetTemplateSourceId.set(t.widgetTemplateSourceId),this.saveDashboardName.set(t.saveName),this.selectedWidgetIds.set([]),this.ensureArtifactPaneOpen()}pushCanvasHistory(){this.canvasHistorySuspended||(this.canvasUndoStack.update(t=>[...t,this.snapshotCanvas()].slice(-this.CANVAS_HISTORY_LIMIT)),this.canvasRedoStack.set([]))}asOneCanvasStep(t){this.pushCanvasHistory(),this.canvasHistorySuspended=!0;try{t()}finally{this.canvasHistorySuspended=!1}}undoCanvas(){let t=this.canvasUndoStack();t.length&&(this.canvasRedoStack.update(e=>[...e,this.snapshotCanvas()].slice(-this.CANVAS_HISTORY_LIMIT)),this.canvasUndoStack.set(t.slice(0,-1)),this.restoreCanvas(t[t.length-1]))}redoCanvas(){let t=this.canvasRedoStack();t.length&&(this.canvasUndoStack.update(e=>[...e,this.snapshotCanvas()].slice(-this.CANVAS_HISTORY_LIMIT)),this.canvasRedoStack.set(t.slice(0,-1)),this.restoreCanvas(t[t.length-1]))}ensureArtifactPaneOpen(){this.artifactForcedOpen()||this.artifactForcedOpen.set(!0)}artifactTitle=q(()=>{let t=this.mostRecentDashboardTitle();return t||(this.activeArtifact().find(n=>!this.isFilterChart(n))?.title??this.activeArtifact()[0]?.title??"Untitled canvas")});artifactSubtitle=q(()=>{let t=this.activeArtifact().filter(e=>!this.isFilterChart(e)).length;return`${this.artifactTitle()} \xB7 ${t} widget${t===1?"":"s"}`});isFilterChart(t){if(!t)return!1;let e=t.config??{};return nt({componentName:(e.componentName??t.componentName??"").toLowerCase(),config:e.config??e})}mostRecentDashboardTitle(){let t=this.artifactSourceMsgId();if(!t)return;let e=this.messages(),n=e.findIndex(o=>o.id===t);for(let o=n;o>=0;o--)if(e[o]?.dashboardTitle)return e[o].dashboardTitle}baseArtifactWidgets=q(()=>{let t=this.artifactSourceMsgId()??"artifact",e=this.activeArtifact().map((o,a)=>S(b({},this.artifactToWidget(o)),{id:`${t}-${a}`})),n=it(e);return yn(n)});filterOverlay=x(new Map);forecastOverlay=x(new Map);artifactForecastable=x({});artifactForecastingId=x(null);artifactWidgets=q(()=>{let t=this.baseArtifactWidgets(),e=this.filterOverlay(),n=this.forecastOverlay();return!e.size&&!n.size?t:t.map(o=>{let a=e.get(o.id),c=a?S(b({},o),{config:a.config,edited:a.edited}):o,h=n.get(o.id);return h?S(b({},c),{config:h}):c})});async onArtifactForecast(t){let e=String(t.widget.id);if(!this.artifactForecastingId()){if(!t.enable){this.forecastOverlay.update(n=>{let o=new Map(n);return o.delete(e),o});return}this.artifactForecastingId.set(e);try{let n=await this.forecastService.forecastWidget(t.widget);if(n?.guardrails&&n.guardrails.passed===!1)return;n?.widget?.config&&this.forecastOverlay.update(o=>new Map(o).set(e,n.widget.config))}catch{}finally{this.artifactForecastingId.set(null)}}}async loadArtifactForecastable(){let t=this.baseArtifactWidgets();if(!t.length){this.artifactForecastable.set({});return}this.artifactForecastable.set(await this.forecastService.probeWidgets(t))}applyingFilters=x(!1);activeDashboardFilters=x(null);activeResolvedFilters=x(null);applySummary=x(null);filterExplanation=x(null);applyFiltersSeq=0;applyFiltersAbort=null;filterSuggestCache=new Map;filterSuggestInflight=new Set;selectedWidgetIds=x([]);hasSelection=q(()=>this.selectedWidgetIds().length>0);selectedArtifactCharts=q(()=>{let t=new Set(this.selectedWidgetIds()),e=this.artifactWidgets();return this.activeArtifact().filter((n,o)=>t.has(e[o]?.id))});builderOpen=x(!1);builderDashboardId=x(null);builderPreseeded=x(!1);builderFullscreen=x(!1);chatPaneWidth=x(null);isResizing=x(!1);layoutMode=q(()=>On({hasMessages:this.messages().length>0,artifactOpen:this.artifactOpen()&&!this.dslOnlyArtifact(),builderOpen:this.builderOpen()}));chatPaneStyleWidth=q(()=>{if(this.builderFullscreen())return null;let t=this.layoutMode();return t==="split"||t==="builder"?this.chatPaneWidth():null});customerId=q(()=>this.tokenStore.tenantId()??"");attachments=x([]);uploadsInFlight=q(()=>this.attachments().some(t=>t.status==="uploading"));excelCount=q(()=>this.attachments().filter(t=>pt(t.name,t.contentType)).length);nonExcelCount=q(()=>this.attachments().length-this.excelCount());attachAtCapacity=q(()=>this.nonExcelCount()>=dt&&this.excelCount()>=ct);acceptUploadTypes=[...st,".xls",".xlsx"].join(",");dragDepth=0;isDraggingFile=x(!1);canSend=q(()=>{let t=this.inputText().trim().length>0,e=this.attachments().some(n=>n.status==="ready");return(t||e)&&!this.isStreaming()&&!this.uploadsInFlight()});quoteBadge=x(null);replyQuote=x(null);activeConversation=q(()=>this.conversations().find(t=>t.id===this.activeConversationId())??null);forecastTitle=x(null);activeConversationTitle=q(()=>this.activeConversation()?.title??this.forecastTitle()??"New conversation");static FALLBACK_PROMPTS=["Give me a dashboard overview of my workforce","Show headcount breakdown by department","What are the top metrics I should be tracking?","Analyze trends over the last quarter","Show me employee distribution by location"];constructor(){Te(()=>{let t=this.customerId(),e=this.selectedScope();if(!t)return;let n=e?e.id:null,o=e?.kind==="pipeline",a=++this.suggestionsSeq;this.suggestionsLoading.set(!0),this.svc.getSuggestedPrompts(n,o).then(c=>{if(a!==this.suggestionsSeq)return;let h=[...c.widgetSuggestions??[],...c.conversationStarters??[]];this.suggestions.set(h.length?h:i.FALLBACK_PROMPTS)}).catch(()=>{a===this.suggestionsSeq&&this.suggestions.set(i.FALLBACK_PROMPTS)}).finally(()=>{a===this.suggestionsSeq&&this.suggestionsLoading.set(!1)})}),this.forecastApi.context().then(t=>this.forecastContext.set(t))}async ngOnInit(){try{this.conversationsLoading.set(!0);let e=await this.svc.listConversations().catch(()=>[]);this.conversations.set(e)}finally{this.conversationsLoading.set(!1),this.loading.set(!1)}this.loadConversationDashboards(),this.prefetchTemplateCatalog();let t=this.route.snapshot.paramMap.get("id");t&&(this.builderPreseeded.set(!1),this.builderDashboardId.set(t),this.builderOpen.set(!0),this.route.snapshot.queryParamMap.get("summary")==="1"?this.onExecutiveSummary(t).then(()=>{this.router.navigate([],{relativeTo:this.route,queryParams:{},replaceUrl:!0})}):this.restoreThreadForDashboard(t))}async restoreThreadForDashboard(t){try{let e=null;if(e=(await this.svc.getDashboard(t).catch(()=>null))?.conversationId??null,e||(e=(await this.svc.listDashboards(100).catch(()=>[])).find(c=>c.id===t)?.conversationId??null),!e)return;let o=await this.svc.getConversation(e);if(!o)return;this.activeConversationId.set(e),this.conversationConnectionId.set(o.conversation.connectionId??null),this.messages.set(o.messages.map(ei)),this.loadConversationDashboards(),this.scrollToBottom()}catch{}}streamSpeed=[6,18];openScopeMenu(){let t=!this.showScopePicker();this.showScopePicker.set(t),t&&this.loadScopeLists()}async loadScopeLists(){if(!this.scopeListsLoaded){this.scopeListsLoaded=!0,this.scopeLoading.set(!0);try{let[t,e]=await Promise.allSettled([this.svc.listDatasets(),this.svc.listPipelines()]);t.status==="fulfilled"&&this.datasets.set(t.value),e.status==="fulfilled"&&this.pipelines.set(e.value),[t,e].filter(o=>o.status==="rejected").length>0&&(this.scopeListsLoaded=!1)}finally{this.scopeLoading.set(!1)}}}selectScope(t,e){this.selectedScope.set({kind:t,id:e.id,name:e.name}),this.showScopePicker.set(!1)}clearScope(){this.selectedScope.set(null)}dashboardSource(){return rt(this.selectedScope())??{}}closeScopeMenu(){this.showScopePicker.set(!1)}async selectConversation(t){if(this.showConversationPicker.set(!1),t!==this.activeConversationId()){this.loading.set(!0),this.loadingConversation.set(!0);try{let e=await this.svc.getConversation(t);if(!e)return;this.activeConversationId.set(t),this.conversationConnectionId.set(e.conversation.connectionId??null),this.messages.set(e.messages.map(ei)),this.loadConversationDashboards(),this.scrollToBottom()}catch{}finally{this.loading.set(!1),this.loadingConversation.set(!1)}}}async deleteConversation(t,e){t.stopPropagation();try{await this.svc.deleteConversation(e),this.conversations.update(n=>n.filter(o=>o.id!==e)),this.activeConversationId()===e&&(this.activeConversationId.set(null),this.conversationConnectionId.set(null),this.messages.set([]))}catch{}}newConversation(){this.forecastTitle.set(null),this.closeForecastSettings(),this.appliedForecastSettings.set(null),this.activeConversationId.set(null),this.conversationConnectionId.set(null),this.messages.set([]),this.showConversationPicker.set(!1)}openRelatedDashboard(t){this.showRelatedDashboards.set(!1),this.closeArtifact(),this.builderPreseeded.set(!1),this.builderDashboardId.set(t),this.builderOpen.set(!0)}async openNewDashboard(){if(!this.savingDashboard()){this.showRelatedDashboards.set(!1),this.savingDashboard.set(!0);try{let t="Untitled Dashboard";this.closeArtifact(),this.dashboardState.resetDashboard(),this.dashboardState.setDashboardName(t);let e=await this.svc.createDashboard(S(b({name:t,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:[]}));this.dashboardState.setDashboardId(e.id),this.builderPreseeded.set(!0),this.builderDashboardId.set(e.id),this.builderOpen.set(!0)}catch{}finally{this.savingDashboard.set(!1)}}}startEditTitle(){this.activeConversationId()&&(this.titleDraft.set(this.activeConversationTitle()),this.editingTitle.set(!0))}cancelEditTitle(){this.editingTitle.set(!1)}async commitTitle(){if(!this.editingTitle())return;this.editingTitle.set(!1);let t=this.activeConversationId(),e=this.titleDraft().trim();if(!(!t||!e||e===this.activeConversationTitle()))try{await this.svc.updateConversation(t,{title:e}),this.conversations.update(n=>n.map(o=>o.id===t?S(b({},o),{title:e}):o))}catch{}}onFilesPicked(t){let e=t.target,n=Array.from(e.files??[]);e.value="";for(let o of n)this.startUpload(o)}onComposerDragOver(t){this.attachAtCapacity()||this.isStreaming()||(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy"))}onComposerDragEnter(t){this.attachAtCapacity()||this.isStreaming()||t.dataTransfer?.types.includes("Files")&&(t.preventDefault(),this.dragDepth++,this.isDraggingFile.set(!0))}onComposerDragLeave(t){t.preventDefault(),this.dragDepth=Math.max(0,this.dragDepth-1),this.dragDepth===0&&this.isDraggingFile.set(!1)}onComposerDrop(t){if(t.preventDefault(),this.dragDepth=0,this.isDraggingFile.set(!1),this.attachAtCapacity()||this.isStreaming())return;let e=Array.from(t.dataTransfer?.files??[]);for(let n of e)this.startUpload(n)}startUpload(t){let e=pt(t.name,t.type);if(e&&this.excelCount()>=ct||!e&&this.nonExcelCount()>=dt||!e&&!st.includes(t.type)||t.size>qn||this.attachments().some(h=>h.name===t.name&&h.size===t.size&&h.file?.lastModified===t.lastModified))return;let o=_e(),a=new AbortController,c={id:o,name:t.name,contentType:t.type,size:t.size,status:"uploading",progress:0,file:t,abort:a};this.attachments.update(h=>[...h,c]),this.runUpload(o,t,a)}async runUpload(t,e,n){try{let{key:o}=await this.svc.uploadAttachment(e,{signal:n.signal});this.patchAttachment(t,{status:"ready",key:o,progress:100})}catch(o){if(n.signal.aborted)return;console.error("[ask-aquera] attachment upload failed",o),this.patchAttachment(t,{status:"error"})}}patchAttachment(t,e){this.attachments.update(n=>n.map(o=>o.id===t?b(b({},o),e):o))}removeAttachment(t){this.attachments().find(e=>e.id===t)?.abort?.abort(),this.attachments.update(e=>e.filter(n=>n.id!==t))}retryAttachment(t){let e=this.attachments().find(o=>o.id===t);if(!e?.file)return;let n=new AbortController;this.patchAttachment(t,{status:"uploading",progress:0,abort:n}),this.runUpload(t,e.file,n)}isMultiChoice(t){return(t.choices?.length??0)>1}onChoiceChange(t,e,n){if(!n||e.selected||this.isStreaming())return;let o=e.options.find(a=>a.id===n);o&&(this.isMultiChoice(t)?this.updateAssistantMsg(t.id,a=>({choices:(a.choices??[]).map(c=>c===e?S(b({},c),{draftSelection:o.id,chatOpen:!1,chatDraftText:void 0}):c)})):this.selectChoice(t,e,o))}selectChoice(t,e,n){e.selected||this.isStreaming()||(this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?S(b({},a),{selected:n.id,draftSelection:void 0,chatOpen:!1,chatDraftText:void 0}):a)})),this.pendingDisplayOverride=`${this.choiceTitle(e)}: ${n.label}`,this.inputText.set(n.reply??n.label),this.sendMessage())}hasPendingDraft(t){return!!t.choices?.some(e=>!e.selected&&(e.draftSelection||e.chatDraftText?.trim()))}submitChoices(t){if(this.isStreaming())return;let e=[],n=[];this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>{if(a.selected)return a;let c=a.chatDraftText?.trim();if(c)return e.push(this.chatDraftReply(a,c)),n.push(`${this.choiceTitle(a)}: ${c}`),S(b({},a),{selected:"__chat__",draftSelection:void 0,chatOpen:!1});if(!a.draftSelection)return a;let h=a.options.find(y=>y.id===a.draftSelection);return h&&(e.push(h.reply??h.label),n.push(`${this.choiceTitle(a)}: ${h.label}`)),S(b({},a),{selected:a.draftSelection,draftSelection:void 0})})})),e.length&&(this.inputText.set(e.join(`
|
|
9
|
-
`)),this.pendingDisplayOverride=n.join(`
|
|
10
|
-
`),this.sendMessage())}answerSummaryRows(t){return(t.text??"").split(`
|
|
11
|
-
`).map(e=>{let n=e.indexOf(": ");return n===-1?{title:e,answer:""}:{title:e.slice(0,n),answer:e.slice(n+2)}})}choiceTitle(t){let e=t.prompt??"",n=/—\s*(.+)$/.exec(e);return(n?n[1].trim():e)||"Answer"}subjectIdOf(t){let e=t.options[0]?.id??"";return e.includes("::")?e.slice(0,e.lastIndexOf("::")):e}chatDraftReply(t,e){return t.kind==="widget_clarification"||t.kind==="widget_plan"||t.kind==="plan_intake"?`For "${this.subjectIdOf(t)}": ${e}`:e}requestPlan(t,e){e.selected||this.isStreaming()||(this.updateAssistantMsg(t.id,n=>({choices:(n.choices??[]).map(o=>o===e?S(b({},o),{selected:"__plan__"}):o)})),this.inputText.set("Give me the plan"),this.sendMessage())}previewWidget(t,e){e.selected||this.isStreaming()||(this.pendingDisplayOverride=`Preview "${this.choiceTitle(e)}"`,this.inputText.set(`For "${this.subjectIdOf(e)}": Preview this widget`),this.sendMessage())}isPreviewChart(t){return!!t?.config?.preview&&!!t?.config?.previewOf}previewAltLabel(t){return t?.config?.previewAltLabel??null}replyForPreview(t,e){if(this.isStreaming())return;let n=t?.config?.previewOf;n&&(this.inputText.set(`For "${n}": ${e}`),this.sendMessage())}acceptPreview(t){this.replyForPreview(t,"Use this")}tryAlternatePreview(t){let e=this.previewAltLabel(t);e&&this.replyForPreview(t,e)}skipPreview(t){this.replyForPreview(t,"Skip this widget")}openChatDraft(t,e){this.isStreaming()||e.selected||this.updateAssistantMsg(t.id,n=>({choices:(n.choices??[]).map(o=>o===e?S(b({},o),{chatOpen:!0,draftSelection:void 0}):o)}))}onChatDraftTextChange(t,e,n){this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?S(b({},a),{chatDraftText:n}):a)}))}defineChatDraft(t,e){let n=e.chatDraftText?.trim();if(!(!n||this.isStreaming())){if(this.isMultiChoice(t)){this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?S(b({},a),{chatOpen:!1}):a)}));return}this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?S(b({},a),{selected:"__chat__",chatOpen:!1}):a)})),this.inputText.set(this.chatDraftReply(e,n)),this.sendMessage()}}static TEXT_REDUNDANT_CHOICE_KINDS=new Set(["index","clarification","widget_clarification"]);suppressTextFor(t){let e=t.choices;return!!e?.length&&e.every(n=>!!n.kind&&i.TEXT_REDUNDANT_CHOICE_KINDS.has(n.kind))}onThreadMouseUp(t){let e=t.composedPath();if(e.some(M=>M instanceof HTMLElement&&M.classList.contains("reply-badge")))return;let n=document.getSelection(),o=n?.toString().trim()??"",a=e.some(M=>M instanceof HTMLElement&&M.classList.contains("assistant-text"));if(!n||!o||!a){this.quoteBadge.set(null);return}let c=46,h=Math.min(Math.max(t.clientX,c+8),window.innerWidth-c-8),A=t.clientY>=34;this.quoteBadge.set({text:o,top:t.clientY,left:h,above:A})}onTextSelectionChange(){if(!this.quoteBadge())return;let t=document.getSelection();(!t||!t.toString().trim())&&this.quoteBadge.set(null)}hideQuoteBadge(){this.quoteBadge.set(null)}addReplyQuote(){let t=this.quoteBadge();t&&(this.replyQuote.set(t.text),this.quoteBadge.set(null),document.getSelection()?.removeAllRanges(),this.composerRef?.nativeElement?.focus?.())}clearReplyQuote(){this.replyQuote.set(null)}forecastContext=x(null);lastForecastRequest=null;forecastChartMsgId=null;forecastTurnMsgId=null;routeForecastIntent(t){let e=this.forecastContext();if(!e)return!1;let n=R().features.forecast?ut(t,e):null;if(!n)return!1;let o=n.extendsExisting?this.findForecastTarget():null;return n.extendsExisting&&!o||!o?!1:this.forecastChartMessage(o,t,{metric:n.metric,horizon:n.horizon,granularity:n.granularity})}forecastChartMessage(t,e,n={}){let o=this.forecastContext();if(!o)return!1;let a=Wn(t.charts[0]?.config);if(!a.length)return!1;let c={metric:n.metric??o.metrics[0]?.id??"headcount",horizon:n.horizon??o.defaults.horizon,granularity:n.granularity??o.defaults.granularity,confidence:o.defaults.confidence,series:a,sourceGranularity:o.defaults.granularity},h=t.charts[0]?.config??{};return this.runForecast(e,c,{queryMeta:h.queryMeta,dataSourceId:h.dataSourceId},{chartMsgId:t.id}),!0}forecastableMsgs=new Map;canForecastChart(t){if(!this.forecastContext())return!1;let e=this.forecastableMsgs.get(t.id);if(e!==void 0)return e;let n=xt(t);return t.isStreaming||this.forecastableMsgs.set(t.id,n),n}artifactForecastMsg=q(()=>{let t=this.artifactSourceMsgId();if(!t||!this.forecastContext())return null;let e=this.messages().find(n=>n.id===t);return e&&xt(e)?e:null});isRestoredForecast(t){return!!t.forecastSpec&&!t.charts.length&&!t.forecastRecomputing}restoredForecastLabel(t){let e=t.forecastSpec;if(!e)return"";let o={Weekly:"weeks",Monthly:"months",Quarterly:"quarters",Yearly:"years"}[e.granularity]??"periods",a=e.computedAt?new Date(e.computedAt).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"}):null;return`${e.horizon} ${o} ahead at ${e.confidence}% confidence`+(a?` \xB7 computed ${a}`:"")}recomputeStoredForecast(t){let e=t.forecastSpec;if(!e||this.isStreaming())return;let n=this.findForecastTarget();n&&this.forecastChartMessage(n,`Forecast ${e.horizon} ${e.granularity.toLowerCase()} periods ahead`,{metric:e.metric,horizon:e.horizon,granularity:e.granularity})}canRemoveForecast(t){return!!t.forecast&&!!t.preForecastCharts?.length&&!t.forecastRecomputing}removeForecastFromChart(t){this.canRemoveForecast(t)&&(this.updateAssistantMsg(t.id,{charts:t.preForecastCharts??[],preForecastCharts:void 0,forecast:!1,forecastMeta:void 0}),this.forecastChartMsgId===t.id&&(this.forecastTurnMsgId&&this.updateAssistantMsg(this.forecastTurnMsgId,{followUps:[]}),this.forecastChartMsgId=null,this.forecastTurnMsgId=null,this.lastForecastRequest=null,this.forecastSettingsOpen.set(!1),this.appliedForecastSettings.set(null)))}forecastFromChart(t){this.isStreaming()||this.forecastChartMessage(t,"Forecast this chart")}findForecastTarget(){let t=this.messages();for(let e=t.length-1;e>=0;e--){let n=t[e];if(!(n.role!=="assistant"||n.charts.length!==1)&&je(n.charts[0].config))return n}return null}async recomputeForecastInPlace(t,e,n){this.isStreaming.set(!0),this.updateAssistantMsg(t,{forecastRecomputing:!0,hasError:!1});try{let o=await this.forecastApi.compute(e),a=Ct(o,e.series??[]);this.lastForecastRequest=S(b({},e),{horizon:a.horizon,granularity:a.granularity,confidence:a.confidence}),this.appliedForecastSettings.set({horizon:a.horizon,granularity:a.granularity,confidence:a.confidence}),this.forecastMaxHorizon.set(a.maxHorizon),this.forecastFitted.set({periods:o.fittedPeriods,granularity:o.sourceGranularity}),this.forecastGuardrails.set(o.guardrails),this.forecastModelCard.set(o.modelCard),n.queryMeta&&(a.chart.queryMeta=n.queryMeta),n.dataSourceId&&(a.chart.dataSourceId=n.dataSourceId),a.chart.config&&(a.chart.config.forecast={enabled:!0,horizon:a.horizon,granularity:a.granularity,confidence:a.confidence}),this.updateAssistantMsg(t,{forecastRecomputing:!1,charts:[{title:a.chart.title,componentName:a.chart.componentName,config:a.chart}],forecastMeta:a.meta}),this.forecastTurnMsgId&&this.forecastTurnMsgId!==t?this.updateAssistantMsg(this.forecastTurnMsgId,{text:a.answer,followUps:o.followUps}):this.updateAssistantMsg(t,{text:a.answer,followUps:o.followUps})}catch(o){let a=o;a?.isRefusal&&a.message?(this.updateAssistantMsg(t,{forecastRecomputing:!1}),this.updateAssistantMsg(this.forecastTurnMsgId??t,{text:a.message})):(console.error("[ask-aquera] forecast recompute failed",o),this.updateAssistantMsg(t,{forecastRecomputing:!1}))}finally{this.isStreaming.set(!1)}}async runForecast(t,e,n={},o={}){if(this.isStreaming())return;let a=M=>!!M&&this.messages().some(k=>k.id===M);if(o.inPlace&&a(this.forecastChartMsgId)){let M=this.messages().find(k=>k.id===this.forecastChartMsgId)?.charts[0]?.config??{};return this.recomputeForecastInPlace(this.forecastChartMsgId,e,{queryMeta:n.queryMeta??M.queryMeta,dataSourceId:n.dataSourceId??M.dataSourceId})}let c=a(o.chartMsgId??null)?o.chartMsgId:null;this.inputText.set("");let h={id:_e(),role:"user",text:t,charts:[],isStreaming:!1,hasError:!1},y=_e(),A={id:"forecast",callIds:["forecast"],pending:1,baseLabel:"Forecasting",label:"Forecasting",status:"running"};this.messages.update(M=>[...M,h,{id:y,role:"assistant",text:"",thinking:"Forecasting",charts:[],isStreaming:!0,hasError:!1,animate:!0,forecast:!0,tools:[A]}]),this.isStreaming.set(!0),this.scrollToBottom();try{let M=await this.forecastApi.compute(b(b({},e),this.activeConversationId()?{conversationId:this.activeConversationId(),prompt:t}:{})),k=Ct(M,e.series??[]);this.lastForecastRequest=b(b(S(b({},e),{horizon:k.horizon,granularity:k.granularity,confidence:k.confidence}),M.historyQuery?.sql?{historySql:M.historyQuery.sql}:{}),M.cohortQuery?.sql?{cohortSql:M.cohortQuery.sql}:{}),this.appliedForecastSettings.set({horizon:k.horizon,granularity:k.granularity,confidence:k.confidence}),this.forecastMaxHorizon.set(k.maxHorizon),this.forecastFitted.set({periods:M.fittedPeriods,granularity:M.sourceGranularity}),this.forecastGuardrails.set(M.guardrails),this.forecastModelCard.set(M.modelCard),M.conversationTitle&&this.forecastTitle.set(M.conversationTitle),n.queryMeta&&(k.chart.queryMeta=n.queryMeta),n.dataSourceId&&(k.chart.dataSourceId=n.dataSourceId),k.chart.config&&(k.chart.config.forecast={enabled:!0,horizon:k.horizon,granularity:k.granularity,confidence:k.confidence});let z={title:k.chart.title,componentName:k.chart.componentName,config:k.chart},X=c??y;if(this.forecastChartMsgId=X,this.forecastTurnMsgId=y,c){let Y=this.messages().find(U=>U.id===c);this.updateAssistantMsg(c,b({charts:[z],forecastMeta:k.meta,forecast:!0},Y?.preForecastCharts?.length?{}:{preForecastCharts:Y?.charts??[]})),this.updateAssistantMsg(y,{isStreaming:!1,thinking:void 0,tools:[],text:k.answer,followUps:M.followUps})}else this.updateAssistantMsg(y,{isStreaming:!1,thinking:void 0,tools:[],text:k.answer,charts:[z],forecastMeta:k.meta,followUps:M.followUps});this.isStreaming.set(!1),this.scrollToBottom()}catch(M){let k=M;k?.isRefusal&&k.message?this.updateAssistantMsg(y,{isStreaming:!1,thinking:void 0,tools:[],text:k.message}):(console.error("[ask-aquera] forecast failed",M),this.updateAssistantMsg(y,{isStreaming:!1,thinking:void 0,tools:[],hasError:!0})),this.isStreaming.set(!1)}}refineForecast(t,e){let n=this.lastForecastRequest;if(!n)return;let o=S(b(b({},n),t),{filters:b(b({},n.filters),t.filters)});(t.metric!==void 0&&t.metric!==n.metric||t.granularity!==void 0&&t.granularity!==n.granularity||t.filters!==void 0&&JSON.stringify(o.filters??{})!==JSON.stringify(n.filters??{}))&&(o.historySql=void 0),t.filters!==void 0&&JSON.stringify(o.filters??{})!==JSON.stringify(n.filters??{})&&(o.cohortSql=void 0),this.runForecast(e,o,{},{inPlace:!0})}onFollowUp(t,e){if(!t.action||this.isStreaming())return;if(t.action===jl){let a=e?.charts?.length?e:this.findForecastTarget();a&&this.forecastChartMessage(a,t.label);return}let[n,o]=t.action.split(":");if(o&&this.lastForecastRequest){if(n==="horizon"){this.refineForecast({horizon:Number(o)},t.label);return}if(n==="granularity"){this.refineForecast({granularity:o},t.label);return}if(n==="metric"){this.refineForecast({metric:o,series:void 0},t.label);return}if(n==="org"||n==="location"||n==="jobFamily"){this.refineForecast({filters:{[n]:o},series:void 0},t.label);return}}if(t.action===Hl){this.openForecastSettings();return}}forecastSettingsOpen=x(!1);forecastDraft=x(null);appliedForecastSettings=x(null);forecastMaxHorizon=x(null);forecastGuardrails=x(null);forecastModelCard=x(null);forecastFitted=x(null);granularityChoices=q(()=>{let t=this.forecastCopy(),e=this.forecastContext();if(!e)return[];let n=this.forecastFitted(),o=n?.granularity??e.defaults.granularity,a=n?.periods??0;return jn(o,a,e.granularityOptions)});draftGranularity=q(()=>{let t=this.forecastDraft()?.granularity,e=this.granularityChoices();return e.find(n=>n.value===t)??e.find(n=>n.enabled)??null});horizonUnit=q(()=>{let t=this.draftGranularity(),e=this.forecastDraft()?.horizon??1;return t?e===1?t.label.singular:t.label.plural:"periods"});horizonMax=q(()=>this.draftGranularity()?.maxHorizon||1);unavailableGranularityNote=q(()=>{let t=this.granularityChoices().filter(n=>!n.enabled&&n.reason);return t.length?`Unavailable: ${t.map(n=>`${n.value} (${n.reason})`).join("; ")}.`:""});horizonNote=q(()=>{let t=this.draftGranularity();if(!t)return"";let e=t.maxHorizon===1?t.label.singular:t.label.plural;return`Capped at ${t.maxHorizon} ${e} for this series (\xBD of ${t.fittedPeriods} ${t.label.plural} of history).`});forecastCopy=q(()=>{let t=this.forecastContext();if(!t)return null;let e=this.forecastFitted(),n={maxHorizon:this.forecastMaxHorizon()??"",sourceGranularity:(e?.granularity??t.defaults.granularity).toLowerCase(),historyPeriods:e?.periods??""};return{granularityNote:ke(t.copy?.granularityNote??"",n),confidenceNote:ke(t.copy?.confidenceNote??"",n),guardrails:this.forecastGuardrails(),modelCard:this.forecastModelCard(),confidenceLevels:t.confidenceLevels,granularityOptions:t.granularityOptions,maxHorizon:this.forecastMaxHorizon()??0}});openForecastSettings(){let t=this.appliedForecastSettings(),e=this.forecastContext(),n=t??(e?{horizon:e.defaults.horizon,granularity:e.defaults.granularity,confidence:e.defaults.confidence}:null);n&&(this.forecastDraft.set(n),this.forecastSettingsOpen.set(!0))}closeForecastSettings(){this.forecastSettingsOpen.set(!1),this.forecastDraft.set(null)}patchForecastDraft(t){this.forecastDraft.update(e=>e&&b(b({},e),t))}onHorizonInput(t){let e=Number(t);Number.isFinite(e)&&this.patchForecastDraft({horizon:Math.max(1,Math.min(e,this.horizonMax()))})}onGranularityPick(t){let e=this.forecastDraft();!e||!t.enabled||e.granularity===t.value||this.patchForecastDraft({granularity:t.value,horizon:Qn(e.horizon,e.granularity,t.value,t.maxHorizon)})}onConfidenceIndexInput(t){let e=this.forecastCopy()?.confidenceLevels??[],n=Number(t);!e.length||!Number.isFinite(n)||this.patchForecastDraft({confidence:e[Math.max(0,Math.min(n,e.length-1))]})}confidenceIndex=q(()=>{let t=this.forecastCopy()?.confidenceLevels??[],e=this.forecastDraft()?.confidence,n=t.indexOf(e??-1);return n>=0?n:0});horizonFill=q(()=>{let t=this.forecastCopy()?.maxHorizon??1,e=this.forecastDraft()?.horizon??1;return`${t>1?(e-1)/(t-1)*100:100}%`});confidenceFill=q(()=>{let t=this.forecastCopy()?.confidenceLevels.length??1;return`${t>1?this.confidenceIndex()/(t-1)*100:100}%`});applyForecastSettings(){let t=this.forecastDraft();if(!t||(this.appliedForecastSettings.set(t),this.forecastSettingsOpen.set(!1),this.forecastDraft.set(null),!this.lastForecastRequest))return;let e=t.granularity!==this.lastForecastRequest.granularity;this.refineForecast(b({horizon:t.horizon,granularity:t.granularity,confidence:t.confidence},e?{series:void 0}:{}),`Recompute at ${t.horizon} ${t.granularity.toLowerCase()} periods, ${t.confidence}% confidence`)}pendingDisplayOverride=null;async sendMessage(){if(!this.canSend())return;let t=this.replyQuote()??void 0;this.replyQuote.set(null);let e=this.inputText().trim();if(!this.attachments().length&&!t&&this.routeForecastIntent(e))return;this.inputText.set("");let n=t?`> ${t.replace(/\n/g,`
|
|
12
|
-
> `)}
|
|
13
|
-
|
|
14
|
-
${e}`:e,a=this.attachments().filter(N=>N.status==="ready").map(N=>({key:N.key,name:N.name,contentType:N.contentType,size:N.size}));this.attachments.set([]);let c={id:_e(),role:"user",text:this.pendingDisplayOverride??oi(e),answerSummary:!!this.pendingDisplayOverride,quotedText:t,charts:[],attachments:a,isStreaming:!1,hasError:!1};this.pendingDisplayOverride=null,this.messages.update(N=>[...N,c]);let h=_e();this.messages.update(N=>[...N,{id:h,role:"assistant",text:"",thinking:"Thinking",charts:[],isStreaming:!0,hasError:!1,animate:!0,tools:[{id:"thinking",callIds:["thinking"],pending:1,baseLabel:"Thinking",label:"Thinking",status:"running"}]}]),this.isStreaming.set(!0);let y=new AbortController;this.streamAbort=y,this.scrollToBottom();let A="",M="Thinking",k=[],z=!1,X=!1,Y=!1,U=new Set,j=N=>{let K=N?.queryMeta,I=K?.sql??(K?.dsl?JSON.stringify(K.dsl):N?.title??"");return`${N?.componentName??""}|${I}`},le=()=>{if(z||k.length===0)return;z=!0;let N=k.splice(0);this.updateAssistantMsg(h,K=>({charts:[...K.charts,...N]})),this.scrollToBottom()};try{let N=this.selectedScope(),K=N?N.id:null,I=N?.kind==="pipeline";await this.svc.streamChat(this.activeConversationId(),n,{onText:E=>{A+=E,!z&&k.length>=1&&this.zone.run(()=>le())},onToolStart:(E,L)=>{A="",M=L||"Working",this.zone.run(()=>{this.updateAssistantMsg(h,G=>({thinking:M,tools:Dn(G.tools??[],E,M)}))})},onToolResult:(E,L,G)=>{this.zone.run(()=>{this.updateAssistantMsg(h,H=>({tools:En(H.tools??[],E,L,G)}))})},onDataPart:async E=>{if(E.data_type==="adhoc_viz"&&E.data){await fn(E.data.config);let L={title:E.data.title??"Chart",componentName:E.data.componentName??"",config:E.data},G=E.data?.id,H=W=>G&&W.config?.id===G;this.zone.run(()=>{if(z){this.updateAssistantMsg(h,ie=>{let Me=G?ie.charts.findIndex(H):-1;return{charts:Me===-1?[...ie.charts,L]:ie.charts.map((ai,ri)=>ri===Me?L:ai)}}),this.scrollToBottom();return}let W=G?k.findIndex(H):-1;W===-1?k.push(L):k[W]=L,k.length>=2&&le()})}},onDashboardTitle:E=>{E&&this.zone.run(()=>this.updateAssistantMsg(h,{dashboardTitle:E}))},onChoice:E=>{E?.options?.length&&this.zone.run(()=>this.updateAssistantMsg(h,L=>({choices:[...L.choices??[],E]})))},onLayoutPatch:E=>{let L=new Map((E?.layouts??[]).map(H=>[H.id,H.layout]));if(!L.size)return;let G=H=>{let W=H?.id;return W?L.get(W):void 0};for(let H of k){let W=G(H.config);W&&(H.config=S(b({},H.config),{layout:W}))}this.zone.run(()=>this.updateAssistantMsg(h,H=>({charts:H.charts.map(W=>{let ie=G(W.config);return ie?S(b({},W),{config:S(b({},W.config),{layout:ie})}):W})})))},onError:()=>{X=!0},onFinish:(E,L)=>{Y=!0,this.zone.run(()=>{le(),this.updateAssistantMsg(h,{isStreaming:!1,thinking:void 0,text:A}),this.isStreaming.set(!1);let G=this.messages().find(W=>W.id===h);_t({finishReason:E,sawError:X,producedContent:!!(G?.text||G?.charts.length||G?.choices?.length)})&&this.showStreamError(h),L&&!this.activeConversationId()&&(this.activeConversationId.set(L),this.conversationsLoading.set(!0),this.svc.listConversations().then(W=>{this.conversations.set(W);let ie=W.find(Me=>Me.id===L);this.conversationConnectionId.set(ie?.connectionId??null)}).finally(()=>this.conversationsLoading.set(!1))),this.loadConversationDashboards(),this.messages().find(W=>W.id===h)?.charts.length||this.scrollToBottom()})}},K,y.signal,a,I,this.builderDashboardId())}catch(N){y.signal.aborted||N instanceof DOMException&&N.name==="AbortError"||this.zone.run(()=>this.showStreamError(h))}finally{this.zone.run(()=>{!Y&&_t({sawError:X,producedContent:!1})&&this.showStreamError(h),this.updateAssistantMsg(h,{isStreaming:!1,thinking:void 0}),this.streamAbort===y&&(this.isStreaming.set(!1),this.streamAbort=null)})}}showStreamError(t){this.messages.update(e=>Vn(e,t,n=>({id:n,role:"assistant",text:"",charts:[],isStreaming:!1,hasError:!1}))),this.isStreaming.set(!1)}stopStream(){this.messages.update(t=>t.map(e=>e.isStreaming?S(b({},e),{isStreaming:!1,thinking:void 0,tools:[]}):e)),this.streamAbort?.abort(),this.isStreaming.set(!1)}openArtifact(t,e){this.artifactSourceMsgId.set(e??null),this.activeArtifactRaw.set(e?[]:t),this.bucketExtraCharts.set([]),this.forecastOverlay.set(new Map),this.loadArtifactForecastable(),this.prefetchWidgetTemplateCatalog();let n=this.mostRecentDashboardTitle(),o=t.find(a=>!this.isFilterChart(a));this.saveDashboardName.set(n||o?.title||t[0]?.title||"My Dashboard"),this.resetArtifactFilterState()}addInlineWidget(t){this.inlinePickerFor.set(null),this.addArtifactToDashboard(t)}addInlineToExisting(t,e){this.inlinePickerFor.set(null),this.addToExistingDashboard(e,t)}addInlineDefault(t){let e=this.nonAutoDashboards();if(!this.builderOpen()&&e.length===1){this.addInlineToExisting(t,e[0].id);return}this.addInlineWidget(t)}async addToLibrary(t){try{await this.globalWidget.add(this.artifactToWidget(t)),this.showToast("success","Saved to your widget library.")}catch{}}onSelectionChange(t){this.selectedWidgetIds.set(t)}pickGalleryPrompt(t){this.inputText.set(t),this.closeGallery()}onWelcomePromptPick(t){this.isStreaming()||(this.inputText.set(t.label),this.sendMessage())}onGalleryPromptPick(t){t?.key&&this.pickGalleryPrompt(t.key)}openGallery(){this.gallerySearch.set(""),this.galleryOpen.set(!0)}closeGallery(){this.galleryOpen.set(!1),this.gallerySearch.set("")}templateCatalogPrefetch=null;prefetchTemplateCatalog(){return this.templateCatalogPrefetch?this.templateCatalogPrefetch:(this.templateCatalogPrefetch=(async()=>{if(!this.templateCategories().length){this.templateCategoriesLoading.set(!0);try{this.templateCategories.set(await this.svc.listDashboardCategories())}catch{}finally{this.templateCategoriesLoading.set(!1)}}if(!this.templateAllTemplates().length){this.templateTemplatesLoading.set(!0);try{this.templateAllTemplates.set(await this.svc.listAllCategoryTemplates())}catch{}finally{this.templateTemplatesLoading.set(!1)}}})(),this.templateCatalogPrefetch)}selectTemplateCategory(t){this.templateActiveCategory.set(t)}widgetTemplateCatalogPrefetch=null;prefetchWidgetTemplateCatalog(){return this.widgetTemplateCatalogPrefetch?this.widgetTemplateCatalogPrefetch:(this.widgetTemplateCatalogPrefetch=(async()=>{if(!this.templateCategories().length){this.templateCategoriesLoading.set(!0);try{this.templateCategories.set(await this.svc.listDashboardCategories())}catch{}finally{this.templateCategoriesLoading.set(!1)}}if(!this.widgetTemplateAllTemplates().length){this.widgetTemplateTemplatesLoading.set(!0);try{let t=await this.svc.loadAllWidgetTemplatePreviews();this.widgetTemplateAllTemplates.set(t.map(n=>n.template));let e=new Map;for(let n of t)e.set(n.template.id,n.widget?{title:n.widget.title,componentName:n.widget.componentName,config:n.widget}:null);this.widgetTemplatePreviews.set(e)}catch{}finally{this.widgetTemplateTemplatesLoading.set(!1)}}})(),this.widgetTemplateCatalogPrefetch)}selectWidgetTemplate(t){let e=this.widgetTemplatePreviews().get(t);if(e){this.addKpiToBucket(e,t);return}this.pickWidgetTemplate(t)}addKpiToBucket(t,e){this.activeArtifact().some(o=>o.config?._meta?.templateId===e)||(this.pushCanvasHistory(),this.bucketExtraCharts.update(o=>[...o,t]),this.ensureArtifactPaneOpen(),this.closeWidgetDetailPanel())}artifactHasFilter=q(()=>this.activeArtifact().some(t=>this.isFilterChart(t)));onFiltersToggle(t){t?this.addFilterToBucket():this.removeFilterFromArtifact()}addFilterToBucket(){this.artifactHasFilter()||(this.pushCanvasHistory(),this.bucketExtraCharts.update(t=>[...t,this.buildEmptyFilterChart()]),this.ensureArtifactPaneOpen())}removeFilterFromArtifact(){let t=this.activeArtifact().find(n=>this.isFilterChart(n));if(!t)return;if(this.pushCanvasHistory(),this.bucketExtraCharts().includes(t)){this.bucketExtraCharts.update(n=>n.filter(o=>o!==t));return}let e=this.artifactSourceMsgId();e?this.updateAssistantMsg(e,n=>({charts:n.charts.filter(o=>o!==t)})):this.activeArtifactRaw.update(n=>n.filter(o=>o!==t))}buildEmptyFilterChart(){let t={id:"dashboard-filter",title:"Filters",widgetType:"chart",componentName:"nile-filter-widget",layout:{x:0,y:0,w:12,h:2},summary:"Filter every widget on this dashboard.",config:{aq:{autocomplete:[]},chart:{type:"filter",controls:[{id:"dashboard-filter",label:"",description:"",value:"",defaultValue:"",autoApply:!1,selection:"single",variant:"prompt",showClearIcon:!0,suggestions:[],suggestionInsert:"replace",typeSpeedMs:60,pauseBeforeDeleteMs:1400,pauseBetweenMs:400,promptPlaceholders:["Filter by any field\u2026"],expressionPlaceholders:['field == "value"'],queryLanguage:{enabled:!1}}]}}};return{title:t.title,componentName:t.componentName,config:t}}onGalleryWidgetClicked(t){this.openWidgetDetailPanelForWidget(t,!0)}async pickWidgetTemplate(t){try{let e=await this.svc.previewWidgetTemplate(t);if(e.error||!e.widget)return;let n={title:e.widget.title,componentName:e.widget.componentName,config:e.widget};this.addKpiToBucket(n,t)}catch{}}async openWidgetDetailPanelForWidget(t,e=!1){if(this.widgetDetailPanelLoading())return;let n=t.config?._meta,o=n?.templateId??null,a=n?.detailPanel??null;if(!(!o&&!a)){if(a&&!a.widgets?.length){e&&o&&this.selectWidgetTemplate(o);return}this.ensureArtifactPaneOpen(),this.runViewTransition(()=>{this.widgetDetailPanelTemplateId.set(o),this.widgetDetailPanelCanAdd.set(e),this.widgetDetailPanelSourceWidgetTitle.set(t.title??null),this.widgetDetailPanelTitle.set(a?.title??null),this.widgetDetailPanelSkeletonSlots.set(Ul((a?.widgets??[]).map(c=>c.layout).filter(c=>!!c))),this.widgetDetailPanelLoading.set(!0),this.widgetDetailPanelOpen.set(!0)});try{let c=a?await this.svc.previewWidgetDetailPanelDefinition(a):await this.svc.previewWidgetTemplateDetailPanel(o);if(!c.widgets.length){this.widgetDetailPanelOpen.set(!1);return}this.widgetDetailPanelTitle.set(c.title),this.widgetDetailPanelRaw.set(c.widgets.map(h=>({title:h.title,componentName:h.componentName,config:h})))}catch{this.widgetDetailPanelOpen.set(!1)}finally{this.widgetDetailPanelLoading.set(!1)}}}addWidgetTemplateFromDetailPanel(){let t=this.widgetDetailPanelTemplateId();t&&(this.selectWidgetTemplate(t),this.closeWidgetDetailPanel())}replaceCanvasWithDetailPanel(){let t=this.widgetDetailPanelRaw();if(!t.length)return;let e=this.widgetDetailPanelSourceTemplateId(),n=this.widgetDetailPanelTitle();this.asOneCanvasStep(()=>{this.artifactSourceMsgId.set(null),this.activeArtifactRaw.set([...t]),this.bucketExtraCharts.set([]),this.selectedWidgetIds.set([]),e&&this.templateSourceId.set(e),n&&this.saveDashboardName.set(n),this.ensureArtifactPaneOpen()}),this.closeWidgetDetailPanel()}async openWidgetDetailPanelForTemplate(t){if(this.widgetDetailPanelLoading())return;this.ensureArtifactPaneOpen(),this.widgetDetailPanelKind.set("dashboard"),this.widgetDetailPanelTemplateId.set(null),this.widgetDetailPanelSourceWidgetTitle.set(null),this.widgetDetailPanelSourceTemplateId.set(t.id),this.widgetDetailPanelCanAdd.set(!1),this.widgetDetailPanelSelectedIds.set([]),this.widgetDetailPanelTitle.set(t.name),this.widgetDetailPanelSkeletonSlots.set([]),this.widgetDetailPanelLoading.set(!0),this.widgetDetailPanelOpen.set(!0);let e=[];try{if(await this.svc.previewCategoryTemplateStream(t.id,{onWidget:n=>{e.push({title:n.title,componentName:n.componentName,config:n})},onSkipped:()=>{},onDone:()=>{},onError:()=>{}}),!e.length){this.widgetDetailPanelOpen.set(!1);return}this.widgetDetailPanelRaw.set(e)}catch{this.widgetDetailPanelOpen.set(!1)}finally{this.widgetDetailPanelLoading.set(!1)}}isDetailPanelFullySelected(){let t=this.widgetDetailPanelWidgets(),e=this.widgetDetailPanelSelectedIds();return t.length>0&&t.every(n=>e.includes(n.id))}toggleSelectAllDetailPanelWidgets(){this.widgetDetailPanelSelectedIds.set(this.isDetailPanelFullySelected()?[]:this.widgetDetailPanelWidgets().map(t=>t.id))}addSelectedDetailPanelWidgetsToCanvas(){let t=new Set(this.widgetDetailPanelSelectedIds()),e=this.widgetDetailPanelRaw().filter((o,a)=>t.has(`detail-panel-${a}`));if(!e.length)return;let n=this.activeArtifact().length===0;this.asOneCanvasStep(()=>{if(this.ensureArtifactPaneOpen(),n){this.activeArtifactRaw.update(a=>[...a,...e]);let o=this.widgetDetailPanelSourceTemplateId();o&&this.templateSourceId.set(o)}else this.bucketExtraCharts.update(o=>[...o,...e])}),this.closeWidgetDetailPanel()}onKpiWidgetClicked(t){this.openWidgetDetailPanelForWidget(t)}closeWidgetDetailPanel(){this.widgetDetailPanelOpen()&&this.runViewTransition(()=>{this.widgetDetailPanelOpen.set(!1),this.widgetDetailPanelRaw.set([]),this.widgetDetailPanelTitle.set(null),this.widgetDetailPanelTemplateId.set(null),this.widgetDetailPanelCanAdd.set(!1),this.widgetDetailPanelSkeletonSlots.set([]),this.widgetDetailPanelKind.set("widget"),this.widgetDetailPanelSourceWidgetTitle.set(null),this.widgetDetailPanelSelectedIds.set([]),this.widgetDetailPanelSourceTemplateId.set(null)},"back")}closeArtifact(){this.artifactSourceMsgId.set(null),this.activeArtifactRaw.set([]),this.dslOnlyArtifact.set(!1),this.bucketExtraCharts.set([]),this.artifactForcedOpen.set(!1),this.templateSourceId.set(null),this.widgetTemplateSourceId.set(null),this.closeWidgetDetailPanel(),this.saveDialogOpen.set(!1),this.showAddPicker.set(!1),this.selectedWidgetIds.set([]),this.resetArtifactFilterState()}resetArtifactFilterState(){this.applyFiltersAbort?.abort(),this.applyFiltersAbort=null,this.applyFiltersSeq++,this.applyingFilters.set(!1),this.activeDashboardFilters.set(null),this.activeResolvedFilters.set(null),this.applySummary.set(null),this.filterExplanation.set(null),this.filterOverlay.set(new Map),this.filterSuggestCache.clear(),this.filterSuggestInflight.clear()}buildActiveFilters(t){return _n(t,e=>this.filterFieldLabel(e))}filterFieldLabel(t){for(let e of this.filterSuggestCache.values()){let n=e.find(o=>o.type==="attribute"&&o.id===t);if(n)return n.label}return t}isEmptyFilters(t){if(!t)return!0;for(let e of Object.values(t))if(e!=null&&!(typeof e=="string"&&e.trim()==="")&&!(typeof e=="object"&&Object.keys(e).length===0))return!1;return!0}onArtifactFilterChange(t){let e=this.builderDashboardId();!e||!t.widgetId||!t.controlId||this.fetchFilterSuggestionsOnce(e,t.widgetId,t.controlId)}fetchFilterSuggestionsOnce(t,e,n){let o=this.filterSuggestCache.get(e);if(o){this.artifactGridRef?.patchFilterSuggestions(e,n,o);return}this.filterSuggestInflight.has(e)||(this.filterSuggestInflight.add(e),(async()=>{try{let a=await this.svc.filterSuggest(t,"",this.artifactWidgets(),"draft"),c=this.normalizeFilterSuggestions(a);if(!c.length)return;this.filterSuggestCache.set(e,c),this.artifactGridRef?.patchFilterSuggestions(e,n,c)}catch(a){console.warn("[ask-aquera] filter suggest failed",a)}finally{this.filterSuggestInflight.delete(e)}})())}normalizeFilterSuggestions(t){let e=Array.isArray(t.suggestions)?[...t.suggestions]:[];if(!e.length){t.nextToken&&e.push({id:t.nextToken.value,label:t.nextToken.label,type:"attribute"});for(let n of t.completions??[])e.push({label:n,type:"suggestion"})}return e}async onArtifactFilterSubmit(t){let e=this.builderDashboardId();if(!e)return;if(this.isEmptyFilters(t.filters)){this.applyFiltersAbort?.abort(),this.applyFiltersAbort=null,this.applyFiltersSeq++,this.applyingFilters.set(!1),this.activeDashboardFilters.set(null),this.activeResolvedFilters.set(null),this.applySummary.set(null),this.filterExplanation.set(null),this.filterOverlay.set(new Map);return}let n=this.artifactWidgets().filter(c=>!nt(c));if(!n.length)return;this.applyFiltersAbort?.abort();let o=new AbortController;this.applyFiltersAbort=o;let a=++this.applyFiltersSeq;this.applyingFilters.set(!0);try{let{widgets:c,resolvedFilters:h,filterExplanation:y}=await this.svc.applyFilters(n,t.filters,e,"draft",o.signal,{mode:t.mode,prompt:t.prompt});if(a!==this.applyFiltersSeq)return;this.applyFilterResultsToOverlay(c),this.activeDashboardFilters.set(t.filters),this.activeResolvedFilters.set(h),this.applySummary.set(Cn(c,this.buildActiveFilters(t.filters))),this.filterExplanation.set(y)}catch(c){if(c?.name==="AbortError"||a!==this.applyFiltersSeq)return;console.error("[ask-aquera] apply filters failed",c)}finally{a===this.applyFiltersSeq&&this.applyingFilters.set(!1)}}onDslWidgetUpdated(t){t?.id&&this.filterOverlay.update(e=>{let n=new Map(e);return n.set(t.id,{config:t.config,edited:n.get(t.id)?.edited}),n})}applyFilterResultsToOverlay(t){let e=this.baseArtifactWidgets(),n=new Set,o=new Map;t.forEach((a,c)=>{let h;if(a.title&&(h=e.find(y=>y.title===a.title&&!n.has(y.id))),!h){let y=e[c];h=y&&!n.has(y.id)?y:void 0}h&&(n.add(h.id),o.set(h.id,{config:a.config,edited:a.edited}))}),this.filterOverlay.set(o)}artifactToWidget(t){let e=t.config??{};return{title:e.title??t.title,componentName:e.componentName??t.componentName,widgetType:e.widgetType??"chart",config:e.config??e,summary:e.summary,queryMeta:e.queryMeta,dataSourceId:e.dataSourceId??void 0,drilldownBy:Array.isArray(e.drilldownBy)?e.drilldownBy:[],category:e.category??null,layout:e.layout}}loadConversationDashboards(){this.dashboardsLoading.set(!0),this.svc.listDashboards(100).then(t=>this.conversationDashboards.set(t)).catch(()=>this.conversationDashboards.set([])).finally(()=>this.dashboardsLoading.set(!1))}storyPickerOpen=x(!1);storyPickerWidget=x(null);openStoryPicker(t=this.selectedArtifactCharts()){let e=t.find(n=>!this.isFilterChart(n))??t[0];e&&(this.storyPickerWidget.set(b({id:"artifact"},this.artifactToWidget(e))),this.storyPickerOpen.set(!0))}closeStoryPicker(){this.storyPickerOpen.set(!1),this.storyPickerWidget.set(null)}onAddedToStory(){this.closeStoryPicker()}async addToExistingDashboard(t,e=this.selectedArtifactCharts()){if(!(!e.length||this.committingAction())){this.savingDashboard.set(!0),this.committingAction.set("add");try{let n=await this.publishRepo.fetchDashboard(t);this.dashboardState.replaceDashboard(n);let o=fe(e.map(a=>this.artifactToWidget(a)));this.dashboardState.addWidgets(o),this.publishRepo.saveDraft(t,this.dashboardState.snapshot).catch(()=>{}),this.builderPreseeded.set(!0),this.builderDashboardId.set(t),this.builderOpen.set(!0),this.closeArtifact()}catch{}finally{this.savingDashboard.set(!1),this.committingAction.set(null)}}}openSaveDialog(){this.saveDialogOpen.set(!0)}newDashboardName(t){let e=this.artifactSourceMsgId(),n=e?this.messages().find(a=>a.id===e)?.dashboardTitle:void 0,o=t.find(a=>!this.isFilterChart(a));return n?.trim()||o?.title?.trim()||"Untitled Dashboard"}async addArtifactToDashboard(t=this.selectedArtifactCharts()){if(!(!t.length||this.savingDashboard())){if(this.builderOpen()&&this.builderDashboardId()){let e=fe(t.map(n=>this.artifactToWidget(n)));this.dashboardState.addWidgets(e),this.closeArtifact(),this.showToast("success","Added to your dashboard.");return}this.savingDashboard.set(!0),this.committingAction.set("add");try{let e=this.newDashboardName(t);this.dashboardState.resetDashboard(),this.dashboardState.setDashboardName(e);let n=fe(t.map(a=>this.artifactToWidget(a)));this.dashboardState.addWidgets(n);let o=await this.svc.createDashboard(S(b({name:e,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:this.dashboardState.snapshot.widgets}));this.dashboardState.setDashboardId(o.id),this.builderPreseeded.set(!0),this.builderDashboardId.set(o.id),this.builderOpen.set(!0),this.closeArtifact()}catch{}finally{this.savingDashboard.set(!1),this.committingAction.set(null)}}}async publishAsNewDashboard(t=this.selectedArtifactCharts()){if(!(!t.length||this.savingDashboard())){this.savingDashboard.set(!0),this.committingAction.set("publish");try{let e=this.newDashboardName(t),n=fe(t.map(o=>{let a=_e();return b({id:a},ot(this.artifactToWidget(o),a))}));await this.svc.createDashboard(S(b({name:e,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:n,published:!0})),this.showToast("success",`Published "${e}" as a new dashboard`),this.closeArtifact()}catch{}finally{this.savingDashboard.set(!1),this.committingAction.set(null)}}}closeBuilder(){this.builderOpen.set(!1),this.builderDashboardId.set(null),this.builderFullscreen.set(!1),this.dashboardState.resetDashboard()}toggleBuilderFullscreen(){this.builderFullscreen.update(t=>!t)}static MIN_CHAT_WIDTH=320;static MIN_BUILDER_WIDTH=360;resizeShell=null;startChatResize(t){t.preventDefault();let e=t.target.closest(".aq-shell");if(!e)return;let n=e.getBoundingClientRect();this.resizeShell={left:n.left,width:n.width},this.isResizing.set(!0),window.addEventListener("pointermove",this.onChatResizeMove),window.addEventListener("pointerup",this.onChatResizeEnd,{once:!0})}onChatResizeMove=t=>{let e=this.resizeShell;if(!e)return;let n=Math.max(i.MIN_CHAT_WIDTH,e.width-i.MIN_BUILDER_WIDTH),o=Math.min(i.MIN_CHAT_WIDTH,n),a=Math.max(o,Math.min(t.clientX-e.left,n));this.chatPaneWidth.set(a)};onChatResizeEnd=()=>{this.resizeShell=null,this.isResizing.set(!1),window.removeEventListener("pointermove",this.onChatResizeMove),window.removeEventListener("pointerup",this.onChatResizeEnd)};startEditDashboardTitle(){this.builderDashboardId()&&(this.dashboardTitleDraft.set(this.builderRef?.dashboardName()??""),this.editingDashboardTitle.set(!0))}cancelEditDashboardTitle(){this.editingDashboardTitle.set(!1)}async commitDashboardTitle(){if(!this.editingDashboardTitle()||this.renamingDashboard())return;let t=this.dashboardTitleDraft().trim();if(!t){this.editingDashboardTitle.set(!1);return}this.renamingDashboard.set(!0);try{await this.builderRef?.renameTo(t),this.editingDashboardTitle.set(!1)}catch{}finally{this.renamingDashboard.set(!1)}}onBuilderMenuAction(t){if(t==="fullscreen"){this.toggleBuilderFullscreen();return}if(t==="promptGallery"){this.openGallery();return}this.builderRef?.onMenuAction(t)}onBuilderPublished(t){this.showToast("success",`Dashboard "${t}" published`)}async onExecutiveSummary(t){if(this.isStreaming()||(t&&await this.restoreThreadForDashboard(t),!this.activeConversationId()))return;let e=this.builderRef?.dashboardName?.(),n=this.aiExecutiveSummaryEl?.nativeElement;n&&(n.config={summary:"",buttonLabel:"Executive Summary",buttonVariant:"secondary",drawerLabel:e?`${e} Summary`:"Dashboard Summary",typingSpeed:5,closeOnEscape:!0},n.loading=!0,n.show?.()),this.isStreaming.set(!0);let o="";try{await this.svc.streamChat(this.activeConversationId(),"Give me an executive summary of this dashboard.",{onText:a=>{o+=a},onToolStart:()=>{},onToolResult:()=>{},onDataPart:()=>{},onError:()=>{},onFinish:()=>{let a=this.aiExecutiveSummaryEl?.nativeElement;a&&(a.config=S(b({},a.config??{}),{summary:o}),a.loading=!1,a.open&&a.startTyping?.())}},void 0,void 0,void 0,void 0,t)}catch{let a=this.aiExecutiveSummaryEl?.nativeElement;a&&(a.loading=!1)}finally{this.isStreaming.set(!1)}}async confirmSaveDashboard(){let t=this.saveDashboardName().trim();if(!t||this.savingDashboard())return;let e=fe(this.activeArtifact().map(n=>{let o=_e();return b({id:o},ot(this.artifactToWidget(n),o))}));this.savingDashboard.set(!0);try{let n=await this.svc.createDashboard(S(b({name:t,conversationId:this.activeConversationId()??void 0},this.dashboardSource()),{widgets:e,sourceTemplateId:this.templateSourceId()??void 0}));await this.svc.publishDashboard(n.id),this.showToast("success",`Dashboard "${n.name}" published`),this.closeArtifact()}catch{}finally{this.savingDashboard.set(!1)}}ngOnDestroy(){this.streamAbort?.abort(),this.onChatResizeEnd()}onComposerSubmit(t){typeof t=="string"&&this.inputText.set(t),this.sendMessage()}onComposerKeydown(t){t.key!=="Enter"||t.shiftKey||t.metaKey||t.ctrlKey||t.isComposing||(t.preventDefault(),t.stopPropagation(),this.onComposerSubmit(this.inputText()))}isDataGrid(t){let e=(t.componentName??"").toLowerCase();return e.includes("data-grid")||e.includes("datagrid")}isKpiChart(t){return(t.componentName??"").toLowerCase().includes("kpi")||t.config?.config?.chart?.type==="kpi"}inlineChartClass(t){if(this.inlineViewModeFor(t)!=="chart")return"inline-widget__chart inline-widget__chart--grid";if(!this.isKpiChart(t))return"inline-widget__chart";let e=t.config?.config?.chart?.sparkline;return`inline-widget__chart inline-widget__chart--kpi${Array.isArray(e)&&e.length>=2?" inline-widget__chart--kpi-spark":""}`}inlineFilters=new Map;inlineFilterSeq=0;inlineChartFallbackIds=new WeakMap;inlineChartFallbackIdSeq=0;inlineChartKey(t){let e=t.config?.id;if(e!=null)return String(e);let n=this.inlineChartFallbackIds.get(t);return n||(n=`chart-${++this.inlineChartFallbackIdSeq}`,this.inlineChartFallbackIds.set(t,n)),n}inlineChartRawConfig(t){return t.config?.config?.chart}inlineWidgetMenuItems(t){let e=t.charts[0];if(!e||this.isFilterChart(e))return[];let n={canChangeChartType:!0,canManageFilters:!0,canCustomizeColors:!1,canForecast:this.canForecastChart(t),hasForecast:this.canRemoveForecast(t),canSetAlert:this.canCreateAlert(e),isKpi:this.isKpiChart(e)},o=this.inlineActiveFilters(e).length,a=un(n).map(y=>{if(y.type==="custom"){let M=y.id==="manageFilters"&&o>0?`${y.label} (${o})`:y.label;return{key:y.id,label:M,glyph:y.glyph,divider:y.divider,method:y.method,color:y.color,kind:"custom"}}let A=y.downloadPng?"exportPng":y.downloadCsv?"exportCsv":"print";return{key:A,label:y.label??A,glyph:y.glyph,divider:y.divider,kind:A}});this.isDslEditableChart(e)&&a.push({key:"editDsl",label:"Edit query",glyph:"ng-code",divider:!0,kind:"custom"});let c=this.inlineViewModeFor(e),h=this.inlineHasQueryableData(e);return c==="chart"?(a.push({key:"viewData",label:"Chart Data",glyph:"ng-table",divider:!this.isDslEditableChart(e),kind:"custom"}),h&&a.push({key:"viewRecords",label:"View Records",glyph:"ng-database",kind:"custom"})):(a.push({key:"viewChart",label:"View Chart",glyph:"ng-chart-bar",divider:!this.isDslEditableChart(e),kind:"custom"}),h&&c!=="records"&&a.push({key:"viewRecords",label:"View Records",glyph:"ng-database",kind:"custom"})),c!=="chart"?gn(a,y=>y.key==="viewChart"||y.key==="viewRecords",y=>y.key==="setAlert"||y.kind==="exportCsv"):a}onInlineWidgetMenuItem(t,e){let n=t.charts[0];if(e.kind!=="custom"){this.runInlineChartAction(t,e.kind);return}switch(e.key){case"changeChartType":n&&this.toggleInlineChartTypePicker(n);break;case"manageFilters":n&&this.toggleInlineFilterPicker(n);break;case"setAlert":n&&this.createAlertFromChart(n);break;case"forecast":this.canRemoveForecast(t)?this.removeForecastFromChart(t):this.forecastFromChart(t);break;case"editDsl":n&&this.openArtifactForInlineDsl(t,n);break;case"viewData":n&&this.setInlineViewMode(n,"data");break;case"viewChart":n&&this.setInlineViewMode(n,"chart");break;case"viewRecords":n&&this.viewInlineRecords(t,n);break}}inlineChartWidgets;async runInlineChartAction(t,e){let n=this.inlineChartWidgets?.find(o=>o.widgetId===t.id)?.chartRef?.nativeElement;try{e==="exportPng"?await n?.exportChart?.("image/png"):e==="exportCsv"?await n?.downloadCsv?.():await n?.printChart?.()}catch{}}toggleInlineChartTypePicker(t){if(this.inlineChartTypePickerFor()===t){this.closeInlineChartTypePicker();return}this.openInlineChartTypePicker(t)}toggleInlineFilterPicker(t){if(this.inlineFilterPickerFor()===t){this.closeInlineFilterBuilder();return}this.openInlineFilterBuilder(t)}inlineDataViewCache=new WeakMap;inlineDisplayConfig(t){let e=this.inlineViewModeFor(t);if(e==="data"){let o=this.inlineDataViewCache.get(t);if(o)return o;let a=S(b({},t.config?.config),{chart:this.buildInlineDataViewChart(t)});return this.inlineDataViewCache.set(t,a),a}if(e==="records"){let o=this.inlineRecordsChartFor(t);if(o)return o.config}let n=this.inlineFilterResult.get(this.inlineChartKey(t));return n?n?.config:t.config?.config}inlineViewMode=new Map;inlineRecords=new Map;inlineRecordsLoading=x(new Set);recordsFetcher=$(nn,{optional:!0});inlineViewModeFor(t){return this.inlineViewMode.get(t)??"chart"}setInlineViewMode(t,e){e==="chart"?this.inlineViewMode.delete(t):this.inlineViewMode.set(t,e)}inlineHasQueryableData(t){if(!this.recordsFetcher)return!1;let e=t.config?.config,n=!!this.chartQueryMeta(t)?.sql,o=e?.chart?.type==="grid";return n&&!o}isDslEditableChart(t){let e=this.chartQueryMeta(t);return!e?.adapterType||!["opensearch","postgres","mssql"].includes(e.adapterType)?!1:!!(e.sql||e.dsl)}openArtifactForInlineDsl(t,e){this.isDslEditableChart(e)&&(this.dslOnlyArtifact.set(!0),this.openArtifact(t.charts,t.id),setTimeout(()=>{this.artifactGridRef?.openDslEditor(`${t.id}-0`)}))}onArtifactDslEditorClosed(){this.dslOnlyArtifact()&&this.closeArtifact()}buildInlineDataViewChart(t){let e=t.config?.config?.chart??{},{columns:n,rows:o}=rn(e);if(!this.isKpiChart(t))return{type:"grid",data:o,columns:n.map(A=>({id:A,header:A,accessorKey:A,enableSorting:!0}))};let c=o[0]?.[n[0]]??null,h=an({config:t.config?.config,queryMeta:this.chartQueryMeta(t)});return{type:"grid",data:[{field:"Value",text:c,emphasize:!0},...h.map(A=>({field:A.label,text:A.text}))],columns:[{id:"field",header:"Field",accessorKey:"field",enableSorting:!1,width:"140px",cell:A=>et`<strong>${A.value}</strong>`},{id:"text",header:"Value",accessorKey:"text",enableSorting:!1,cell:A=>{let k=A.row.emphasize?"display:block;overflow-x:auto;white-space:nowrap;font-size:22px;font-weight:700;":"display:block;overflow-x:auto;white-space:nowrap;";return et`<span style=${k}>${A.value}</span>`}}]}}chartQueryMeta(t){let e=t.config??{};return e.queryMeta??e.config?.aq?.queryMeta}inlineRecordsChartFor(t){return this.inlineRecords.get(t)??null}isInlineRecordsLoading(t){return this.inlineRecordsLoading().has(t)}async viewInlineRecords(t,e){if(this.setInlineViewMode(e,"records"),!this.recordsFetcher||this.inlineRecords.has(e))return;let n=new Set(this.inlineRecordsLoading());n.add(e),this.inlineRecordsLoading.set(n);try{let o=S(b({},this.artifactToWidget(e)),{id:t.id}),a=await this.recordsFetcher.fetch(o,void 0);this.inlineRecords.set(e,a.empty?null:a.chart)}catch{this.inlineRecords.set(e,null)}finally{let o=new Set(this.inlineRecordsLoading());o.delete(e),this.inlineRecordsLoading.set(o)}}inlineChartTypeApplyingComponent=x(null);chartTypeIcon(t){return cn(t)}inlineSensibleChartTypes(){return this.inlineChartTypeOptions().filter(t=>t.sensible)}inlineOtherChartTypes(){return this.inlineChartTypeOptions().filter(t=>!t.sensible)}async openInlineChartTypePicker(t){let e=++this.inlineChartTypePickerSeq;this.inlineChartTypePickerFor.set(t),this.inlineChartTypeError.set(null),this.inlineChartTypeOptions.set([]),this.inlineChartTypeLoading.set(!0);try{let n=t.config,o=await this.publishRepo.listChartTypes({id:n?.id??t.title,componentName:t.componentName,queryMeta:n?.queryMeta,config:n?.config});if(e!==this.inlineChartTypePickerSeq)return;this.inlineChartTypeOptions.set(o.filter(a=>a.component!==t.componentName))}catch(n){if(e!==this.inlineChartTypePickerSeq)return;this.inlineChartTypeError.set(n instanceof Error?n.message:"Could not load chart types")}finally{e===this.inlineChartTypePickerSeq&&this.inlineChartTypeLoading.set(!1)}}closeInlineChartTypePicker(){this.inlineChartTypePickerFor.set(null),this.inlineChartTypeOptions.set([]),this.inlineChartTypeError.set(null)}async selectInlineChartType(t){let e=this.inlineChartTypePickerFor();if(!(!e||this.inlineChartTypeApplying())){this.inlineChartTypeApplying.set(!0),this.inlineChartTypeApplyingComponent.set(t),this.inlineChartTypeError.set(null);try{let n=await this.svc.changeAdhocChartType(e.config,t);this.replaceInlineChart(e,n),this.closeInlineChartTypePicker()}catch(n){this.inlineChartTypeError.set(n instanceof Error?n.message:this.copy().errors.chartTypeChangeFailed)}finally{this.inlineChartTypeApplying.set(!1),this.inlineChartTypeApplyingComponent.set(null)}}}replaceInlineChart(t,e){let n=this.inlineChartKey(t);this.inlineFilters.delete(n),this.inlineFilterFieldsCache.delete(n),this.inlineFilterBaseConfig.delete(n),this.inlineFilterResult.delete(n);let o={title:e.title??t.title,componentName:e.componentName??"",config:e};this.messages.update(a=>a.map(c=>S(b({},c),{charts:c.charts.map(h=>h===t?o:h)})))}inlineFilterBuilderFieldId=x(null);inlineFilterBuilderOperator=x(null);inlineFilterBuilderValue=x("");inlineFilterBuilderValue2=x("");inlineFilterBuilderValues=x([]);inlineFilterFieldsLoading=x(!1);inlineFilterFieldsError=x(null);inlineFilterValuesLoading=x(!1);inlineFilterApplying=x(!1);inlineFilterApplyError=x(null);inlineFilterFieldsCache=new Map;inlineFilterValuesCache=new Map;inlineFilterBaseConfig=new Map;inlineFilterResult=new Map;toggleInlineFilterMultiValue(t){this.inlineFilterBuilderValues.update(e=>e.includes(t)?e.filter(n=>n!==t):[...e,t])}resetInlineFilterBuilderValues(){this.inlineFilterBuilderValue.set(""),this.inlineFilterBuilderValue2.set(""),this.inlineFilterBuilderValues.set([])}async openInlineFilterBuilder(t){this.inlineFilterPickerFor.set(t),this.inlineFilterApplyError.set(null);let e=this.inlineChartKey(t);if(!this.inlineFilterFieldsCache.has(e)){this.inlineFilterFieldsLoading.set(!0),this.inlineFilterFieldsError.set(null);try{let o=await this.svc.listAdhocFilterFields([t.config]);this.inlineFilterFieldsCache.set(e,o)}catch(o){this.inlineFilterFieldsError.set(o instanceof Error?o.message:"Could not load filter fields")}finally{this.inlineFilterFieldsLoading.set(!1)}}let n=this.inlineFilterFields(t)[0];this.inlineFilterBuilderFieldId.set(n?.name??null),this.inlineFilterBuilderOperator.set(n?De(n.type)[0].value:null),this.resetInlineFilterBuilderValues(),n&&this.ensureInlineFilterValuesLoaded(t,n)}closeInlineFilterBuilder(){this.inlineFilterPickerFor.set(null)}inlineFilterFields(t){return this.inlineFilterFieldsCache.get(this.inlineChartKey(t))??[]}inlineFilterSelectedField(t){return this.inlineFilterFields(t).find(e=>e.name===this.inlineFilterBuilderFieldId())}async ensureInlineFilterValuesLoaded(t,e){let n=`${this.inlineChartKey(t)}::${e.name}`;if(!(!ln(e.type)||this.inlineFilterValuesCache.has(n))){this.inlineFilterValuesLoading.set(!0);try{let o=await this.svc.fetchAdhocFilterValues([t.config],e.name);this.inlineFilterValuesCache.set(n,o.values)}catch{this.inlineFilterValuesCache.set(n,[])}finally{this.inlineFilterValuesLoading.set(!1)}}}inlineFilterValuesFor(t){let e=this.inlineFilterPickerFor();return!t||!e?[]:this.inlineFilterValuesCache.get(`${this.inlineChartKey(e)}::${t}`)??[]}onInlineFilterFieldChange(t,e){this.inlineFilterBuilderFieldId.set(e);let n=this.inlineFilterFields(t).find(o=>o.name===e);this.inlineFilterBuilderOperator.set(n?De(n.type)[0].value:null),this.resetInlineFilterBuilderValues(),n&&this.ensureInlineFilterValuesLoaded(t,n)}onInlineFilterOperatorChange(t){this.inlineFilterBuilderOperator.set(t),this.resetInlineFilterBuilderValues()}inlineFilterOperators(t){let e=this.inlineFilterSelectedField(t);return e?De(e.type):[]}inlineFilterSelectedOperator(t){return this.inlineFilterOperators(t).find(e=>e.value===this.inlineFilterBuilderOperator())}inlineActiveFilters(t){return this.inlineFilters.get(this.inlineChartKey(t))??[]}inlineFilterChipLabel(t,e){let n=this.inlineFilterFields(t).find(o=>o.name===e.fieldId);return dn(e,n?.label??e.fieldId,n?.type??"string")}async reapplyInlineFilters(t,e,n){if(!n.length)return this.inlineFilterResult.delete(e),this.inlineFilterBaseConfig.delete(e),!0;let o=this.inlineFilterBaseConfig.get(e)??t.config;this.inlineFilterApplying.set(!0),this.inlineFilterApplyError.set(null);try{let a=n.map(sn),c=await this.svc.applyAdhocFilter(o,a);return this.inlineFilterBaseConfig.set(e,o),this.inlineFilterResult.set(e,c),!0}catch(a){return this.inlineFilterApplyError.set(a instanceof Error?a.message:"Filter could not be applied"),!1}finally{this.inlineFilterApplying.set(!1)}}async addInlineFilter(t){let e=this.inlineFilterBuilderFieldId(),n=this.inlineFilterBuilderOperator();if(!e||!n||this.inlineFilterApplying())return;let o=this.inlineFilterOperators(t).find(A=>A.value===n);if(!o)return;let a;if(o.valueKind==="none")a={id:`f${++this.inlineFilterSeq}`,fieldId:e,operator:n};else if(o.valueKind==="multi-select"){let A=this.inlineFilterBuilderValues();if(A.length===0)return;a={id:`f${++this.inlineFilterSeq}`,fieldId:e,operator:n,values:[...A]}}else{let A=this.inlineFilterBuilderValue().trim();if(!A)return;let M=o.needsSecondValue?this.inlineFilterBuilderValue2().trim():void 0;if(o.needsSecondValue&&!M)return;a={id:`f${++this.inlineFilterSeq}`,fieldId:e,operator:n,value:A,value2:M}}let c=this.inlineChartKey(t),h=[...this.inlineFilters.get(c)??[],a];await this.reapplyInlineFilters(t,c,h)&&(this.inlineFilters.set(c,h),this.resetInlineFilterBuilderValues())}async removeInlineFilter(t,e){if(this.inlineFilterApplying())return;let n=this.inlineChartKey(t),o=(this.inlineFilters.get(n)??[]).filter(c=>c.id!==e);await this.reapplyInlineFilters(t,n,o)&&(o.length?this.inlineFilters.set(n,o):this.inlineFilters.delete(n))}async clearInlineFilters(t){if(this.inlineFilterApplying())return;let e=this.inlineChartKey(t);await this.reapplyInlineFilters(t,e,[]),this.inlineFilters.delete(e)}cleanText(t){return t.replace(/^#{1,6}\s+/gm,"").replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/^\s*[-*]\s+/gm,"\u2022 ").replace(/\n{3,}/g,`
|
|
15
|
-
|
|
16
|
-
`).replace(/\[[\w\s]+\]\.\[[\w\s]+\]/g,"").replace(/\b(gold|dbo|public|silver|bronze)\.\w+/gi,"").replace(/\b(the\s+)?(gold|dbo|public|silver|bronze)\s+(schema|database)\b/gi,"the database").replace(/\b(found|analyzed|using|from|in)\s+\d+\s+tables?\b/gi,"").replace(/\b\d+\s+tables?\s+(found|available|returned|in the schema)\b/gi,"").replace(/\b(the\s+)?[\w]+\s+table\b/gi,e=>/[A-Z_]/.test(e)?"":e).replace(/\b(table|view)\s+(named|called)\s+[\w[\]."'`]+/gi,"").replace(/\(\s*\)/g,"").replace(/,\s*,/g,",").replace(/ {2,}/g," ").replace(/\n /g,`
|
|
17
|
-
`).trim()}updateAssistantMsg(t,e){this.messages.update(n=>n.map(o=>{if(o.id!==t)return o;let a=typeof e=="function"?e(o):e;return"charts"in a&&this.forecastableMsgs.delete(t),b(b({},o),a)}))}scrollToBottom(){setTimeout(()=>this.aqChatEl?.nativeElement?.scrollToBottom?.("auto"),100)}showToast(t,e){let n=document.createElement("nile-toast");n.variant=t,n.title=e,n.duration=5e3,n.closable=!0,n.toast(),Ee()}extractMessage(t,e){return Ie(t,e)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ge({type:i,selectors:[["app-ask-aquera-page"]],viewQuery:function(e,n){if(e&1&&Mt(Di,5)(at,5)(Ei,5)(Ii,5)(Vi,5)(tt,5),e&2){let o;se(o=de())&&(n.aqChatEl=o.first),se(o=de())&&(n.builderRef=o.first),se(o=de())&&(n.artifactGridRef=o.first),se(o=de())&&(n.composerRef=o.first),se(o=de())&&(n.aiExecutiveSummaryEl=o.first),se(o=de())&&(n.inlineChartWidgets=o)}},hostBindings:function(e,n){e&1&&g("dragover",function(a){return a.preventDefault()},Ke)("drop",function(a){return a.preventDefault()},Ke)("selectionchange",function(){return n.onTextSelectionChange()},Fe)("wheel",function(){return n.hideQuoteBadge()},Fe)("keydown.escape",function(){return n.hideQuoteBadge()},Fe)},features:[St([Oe(pe),Jt(re),Xt(re),on(re),en(re),tn(re),pn(re),mn(()=>null)])],decls:36,vars:36,consts:[["composerTpl",""],["widgetDetailPanelTpl",""],["aqChat",""],["inlineWidgetMenu",""],["fileInput",""],["composerEl",""],["artifactGrid",""],["aiExecutiveSummary",""],[1,"aq-shell"],["type","button",1,"reply-badge",3,"reply-badge--below","top","left"],[1,"aq-chat-pane"],[1,"wfb-header"],[1,"aq-library-pane"],["role","separator","aria-orientation","vertical","aria-label","Resize chat panel","title","Drag to resize",1,"aq-resizer",3,"is-active"],[1,"aq-artifact-pane",3,"aq-artifact-pane--dsl-only"],[1,"aq-builder-pane"],[3,"nile-request-close","nile-hide","label"],["label","Dashboard name",3,"nile-input","keydown.enter","placeholder","value"],["slot","footer",1,"wfb-save-dialog__actions"],["variant","secondary","size","small",3,"click"],["variant","primary","size","small",3,"click"],["placement","end",1,"forecast-drawer",3,"nile-request-close","nile-hide","label","open"],["slot","label",1,"forecast-drawer__label"],["name","ng-stars-02","method","stroke","size","16","color","#7a5af8",1,"forecast-drawer__mark"],["slot","footer",1,"fs-actions"],["placement","end",1,"prompt-gallery-drawer",3,"nile-request-close","nile-hide","label","open"],[3,"open","widget","dashboardId","source","sourceName","authoringMode"],[1,"ai-executive-summary"],[3,"open","widget"],["type","button",1,"reply-badge",3,"click"],["name","ng-reply","method","stroke","size","14"],[1,"wfb-header__left"],["variant","toggle-button",1,"aq-chat-pane__tabs",2,"--nile-nav-tab-padding","6px 14px"],[1,"wfb-header__right"],[1,"aq-scope-chip"],["placement","bottom-end","distance","6","stay-open-on-select","",1,"scope-dropdown",3,"nile-hide","open"],["slot","trigger","content","Add dataset or pipeline"],["type","button","aria-label","Add dataset or pipeline",1,"aq-header-action",3,"click"],["name","ng-plus","method","stroke","size","18"],["hoist","","placement","right-start","stay-open-on-select",""],["slot","trigger",1,"scope-branch"],["name","ng-database","method","stroke","size","14",1,"scope-branch__icon"],[1,"scope-branch__label"],["name","ng-chevron-right","method","stroke","size","14",1,"scope-branch__arrow"],[1,"scope-menu__loading"],["name","ng-dataflow-04","method","stroke","size","14",1,"scope-branch__icon"],["placement","bottom-end","distance","6",1,"conv-dropdown",3,"nile-hide","open"],["slot","trigger","content","Conversations"],["type","button","aria-label","Conversations",1,"aq-header-action",3,"click","disabled"],["name","ng-messages-square","method","stroke","size","18"],[3,"click"],["slot","prefix","name","ng-plus","method","stroke","size","14","color","#2970ff"],["placement","bottom-end","distance","6",1,"related-dropdown",3,"open"],["content","Prompt gallery"],["variant","toggle-button",1,"aq-chat-pane__tabs",2,"--nile-nav-tab-padding","6px 14px",3,"nile-tab-change"],["slot","nav","panel","chat"],["slot","nav","panel","library"],["method","stroke","size","12",1,"aq-scope-chip__icon",3,"name"],[1,"aq-scope-chip__text"],["type","button","aria-label","Clear scope",1,"aq-scope-chip__clear",3,"click"],["name","ng-x-close","method","stroke","size","12"],["variant","text","width","160","height","14"],["variant","text","width","120","height","14"],[1,"scope-menu__empty"],[1,"scope-item__name"],["slot","suffix","name","ng-check","method","stroke","size","14","color","#2970ff"],["aria-hidden","true",1,"menu-skeleton-item"],[1,"conv-item"],["variant","rounded","width","14","height","14","border-radius","4px"],[1,"conv-item__title"],["variant","text","width","100%","height","14"],[1,"menu-empty"],["name","ng-message-square","method","stroke","size","14",1,"conv-item__icon"],["name","ng-check","method","stroke","size","14","color","#2970ff",1,"conv-item__check"],["name","ng-trash-01","method","stroke","size","14","color","currentColor",1,"conv-item__delete"],["name","ng-trash-01","method","stroke","size","14","color","currentColor",1,"conv-item__delete",3,"click"],["placement","bottom-end","distance","6",1,"related-dropdown",3,"nile-hide","open"],["slot","trigger","content","Dashboards"],["type","button","aria-label","Dashboards",1,"aq-header-action",3,"click"],["name","ng-grid-01","method","stroke","size","18"],[1,"related-item"],[1,"related-item__name"],[1,"related-item__meta"],["variant","text","width","58","height","12"],["name","ng-bar-chart-square-02","method","stroke","size","14","color","#667085",1,"related-item__icon"],["type","button","aria-label","Prompt gallery",1,"aq-header-action",3,"click"],["name","ng-lightbulb-05","method","stroke","size","18"],[1,"aq-library-pane__head"],[1,"aq-library-pane__intro"],[1,"aq-library-pane__intro-title"],["variant","toggle-button","fullWidth","",2,"--nile-nav-tab-padding","6px 14px",3,"nile-tab-change"],["slot","nav","panel","kpis"],[1,"aq-library-pane__tab-count"],["slot","nav","panel","templates"],[1,"aq-library-pane__body"],[1,"aq-artifact-pane__picker-overlay-footer"],["type","search","clearable","",3,"nile-input","nile-change","placeholder","value"],["slot","prefix","name","ng-search","method","stroke","size","16"],[1,"aq-picker-chips"],["aria-hidden","true",1,"aq-picker-chips"],["type","button",1,"aq-picker-chip",3,"click"],[1,"aq-picker-chip__count"],["type","button",1,"aq-picker-chip",3,"aq-picker-chip--active"],["variant","rounded","width","100%","height","28","border-radius","999px",3,"width"],["variant","rounded","width","100%","height","28","border-radius","999px"],["aria-hidden","true",1,"aq-lib-skeleton"],[1,"aq-library-group"],[1,"aq-library-group__head"],["variant","text","width","88","height","11"],["variant","text","width","52","height","12"],[1,"aq-lib-cards"],[1,"aq-lib-skeleton__kpi"],["variant","text","height","15"],["variant","text","width","64","height","30"],["variant","text","width","100%","height","12"],["variant","rectangular","width","100%","height","34","border-radius","6px"],[1,"prompt-gallery-empty"],[1,"aq-library-group__label"],["type","button",1,"aq-library-group__toggle",3,"click"],[1,"aq-lib-card-wrap",3,"aq-lib-card-wrap--selected"],[1,"aq-lib-card-wrap",3,"click"],["variant","card","sparklineType","line","sparklineColor","#3b82f6",3,"label","description","value","loading","sparkline","options"],["type","button",1,"aq-lib-card__check",3,"click"],["name","ng-check","method","stroke","size","11","color","#fff"],[1,"aq-lib-cards","aq-lib-cards--dashboards"],[1,"aq-lib-skeleton__dash"],["variant","rectangular","width","100%","height","108"],[1,"aq-lib-skeleton__dash-text"],["variant","text","width","72%","height","12"],["type","button",1,"aq-lib-card","aq-lib-card--dashboard"],["type","button",1,"aq-lib-card","aq-lib-card--dashboard",3,"click"],[1,"aq-lib-card__preview"],["aria-hidden","true",1,"aq-lib-card__viz"],["aria-hidden","true",1,"aq-lib-card__viz-empty"],[1,"aq-lib-card__chip"],[1,"aq-lib-card__row"],[1,"aq-lib-card__text"],[1,"aq-lib-card__title"],[1,"aq-lib-card__desc"],["name","ng-chevron-right","method","stroke","size","14","color","#98a2b3"],[3,"config"],[2,"height","34%"],[2,"height","62%"],[2,"height","48%"],[2,"height","78%"],[2,"height","40%"],["name","ng-grid-01","size","10","method","stroke"],[1,"aq-artifact-pane__picker-overlay-footer-count"],["slot","prefix","name","ng-plus","method","stroke","size","14","color","#fff"],[1,"welcome-wrap"],[1,"aq-chat"],[1,"welcome-section"],[1,"ai-badge","ai-badge--lg"],["name","ng-stars-02","method","stroke","size","24","color","#2970ff"],[1,"welcome-title"],[1,"welcome-sub"],[1,"welcome-composer"],[3,"ngTemplateOutlet"],["aria-hidden","true",1,"welcome-prompts-skeleton"],[1,"welcome-prompts-skeleton__item"],["variant","rounded","width","18","height","18","border-radius","4px",1,"welcome-prompts-skeleton__icon"],[1,"welcome-prompts-skeleton__label"],[1,"welcome-prompts"],["type","button",1,"prompt-card",3,"prompt-card--ai"],[1,"prompt-gallery-row"],["type","button",1,"prompt-card",3,"click"],["method","stroke","size","18",1,"prompt-card__icon"],[1,"prompt-card__label"],[1,"prompt-card__badge"],["type","button",1,"prompt-gallery-link",3,"click"],["name","ng-lightbulb-05","method","stroke","size","14"],[1,"aq-chat",3,"mouseup"],["slot","footer",1,"input-area"],[1,"msg-skeleton","msg-skeleton--user"],["variant","rounded","width","260","height","44","border-radius","16px"],[1,"msg-skeleton","msg-skeleton--ai"],["variant","text","width","88%","height","18"],["variant","text","width","72%","height","18"],["variant","rectangular","width","100%","height","300","border-radius","12px"],["variant","rounded","width","190","height","44","border-radius","16px"],["variant","text","width","80%","height","18"],["variant","text","width","55%","height","18"],[1,"ai-bubble","ai-bubble--user",3,"role"],[1,"sent-quote"],[1,"answer-summary"],[1,"aq-attachments","aq-attachments--sent"],["name","ng-text-quote","method","stroke","size","12"],[1,"sent-quote__text"],[1,"answer-summary__row"],["name","ng-check","method","stroke","size","14","color","#2970ff",1,"answer-summary__check"],[1,"answer-summary__content"],[1,"answer-summary__title"],[1,"answer-summary__answer"],[1,"aq-chip","aq-chip--static"],["method","stroke","size","14",1,"aq-chip__icon"],[1,"aq-chip__name"],["max-visible","3",1,"ai-bubble__steps",3,"steps"],[1,"ai-bubble",3,"role","hideIcon"],[1,"ai-bubble__content"],[1,"choice-picker"],[1,"choice-picker__submit-row"],[1,"inline-widget"],[1,"forecast-record"],[1,"follow-ups"],["role","alert",1,"assistant-error"],[1,"assistant-text",3,"text","speedMs"],[1,"assistant-text","assistant-text--md",3,"value"],[1,"choice-picker__step"],[1,"choice-picker__group"],[1,"choice-picker__empty"],[1,"choice-picker__group",3,"nile-change"],[1,"choice-card",3,"choice-card--chosen","choice-card--locked"],[1,"choice-card"],[1,"choice-card__label"],[1,"choice-card__num"],[1,"choice-card__text"],[1,"choice-card__name"],[1,"choice-card__hint"],[1,"choice-card__meta"],[3,"class"],[1,"choice-picker__footer-actions"],[1,"choice-picker__chat-draft"],["type","button",1,"choice-picker__chat-link",3,"click","disabled"],["type","button",1,"choice-picker__chat-link",3,"disabled"],["type","button",1,"choice-picker__chat-link","choice-picker__chat-link--preview",3,"disabled"],["name","ng-edit-02","method","stroke","size","12"],["type","button",1,"choice-picker__chat-link","choice-picker__chat-link--preview",3,"click","disabled"],["name","ng-eye","method","stroke","size","12"],[1,"choice-picker__chat-draft-label"],[1,"choice-picker__chat-draft-row"],[1,"choice-picker__chat-draft-input",3,"nile-input","keydown.enter","value"],[3,"config","loading","widgetId","conversationId"],[1,"chart-live"],[1,"chart-live","chart-live--preview"],["hoist","","placement","bottom-end","distance","6",1,"widget-header-dropdown"],["hoist","","placement","bottom-end","distance","6",1,"widget-header-dropdown",3,"open"],[1,"forecast-meta"],[1,"inline-widget__actions"],[1,"chart-live__dot"],["slot","trigger","type","button","aria-label","Chart actions",1,"widget-header-btn"],["name","ng-dots-vertical","method","stroke","size","16"],["role","separator",1,"widget-menu__sep"],[1,"widget-menu__item",3,"click"],[1,"widget-menu__label"],["size","15",3,"name","method","color"],["size","15",3,"name","method"],["hoist","","placement","bottom-end","distance","6",1,"widget-header-dropdown",3,"nile-hide","open"],["slot","trigger","aria-hidden","true",1,"widget-header-anchor"],[1,"type-picker__panel"],[1,"inline-action__loading"],[1,"inline-action__hint"],[1,"inline-action__error"],["size","16"],[1,"type-picker__section"],[1,"type-picker__grid"],["type","button",1,"type-picker__tile","type-picker__tile--sensible"],["type","button",1,"type-picker__tile","type-picker__tile--sensible",3,"click"],["method","stroke","size","16",3,"name"],["type","button",1,"type-picker__tile"],["type","button",1,"type-picker__tile",3,"click"],[1,"filter-builder__panel"],[1,"filter-builder__active"],[1,"filter-builder__chip"],["type","button",1,"filter-builder__chip-remove",3,"click"],["name","ng-x-close","method","stroke","size","10"],[1,"filter-builder__form"],[1,"filter-builder__select",3,"ngModelChange","ngModel"],[3,"value"],["size","14"],["type","text",1,"filter-builder__input",3,"placeholder","ngModel"],[1,"filter-builder__multi"],[1,"filter-builder__select",3,"ngModel"],["type","text",1,"filter-builder__input",3,"ngModelChange","keydown.enter","placeholder","ngModel"],["type","date",1,"filter-builder__input",3,"ngModelChange","ngModel"],[1,"filter-builder__and"],["type","number",1,"filter-builder__input",3,"ngModelChange","keydown.enter","placeholder","ngModel"],["type","number",1,"filter-builder__input",3,"ngModelChange","placeholder","ngModel"],[1,"filter-builder__multi-item"],["type","checkbox",3,"change","checked"],["value","","disabled",""],[1,"forecast-meta__item"],[1,"forecast-meta__label"],[1,"forecast-meta__value"],["variant","secondary","size","small",3,"click","disabled"],["variant","secondary","size","small",3,"disabled"],["variant","primary","size","small",3,"click","disabled"],["slot","prefix","name","ng-library","method","stroke","size","14"],["placement","top-end","distance","6",3,"open"],["variant","primary","size","small"],["placement","top-end","distance","6",3,"nile-hide","open"],["slot","trigger","variant","primary","size","small","caret","",3,"click"],["slot","prefix","name","ng-bar-chart-square-02","method","stroke","size","14"],[1,"chart-card",3,"click"],[1,"chart-card__icon"],["name","ng-bar-chart-square-02","method","stroke","size","18","color","#2970ff"],[1,"chart-card__body"],[1,"chart-card__title"],[1,"chart-card__meta"],["slot","suffix","name","ng-chevron-right","method","stroke","size","14","color","#fff"],["name","clock-rewind","method","stroke","size","13","color","#717680",1,"forecast-record__icon"],[1,"forecast-record__text"],["type","button",1,"forecast-record__action",3,"click","disabled"],["type","button",1,"follow-up",3,"follow-up--ai","disabled"],["type","button",1,"follow-up",3,"click","disabled"],["method","stroke","size","14",1,"follow-up__icon"],[1,"follow-up__label"],[1,"follow-up__badge"],["name","ng-alert-circle","method","stroke","size","16",1,"assistant-error__icon"],[1,"assistant-error__text"],[1,"aq-composer-wrap",3,"dragenter","dragover","dragleave","drop"],[1,"aq-drop-overlay"],[1,"reply-quote"],[1,"aq-attachments"],["type","file","multiple","","hidden","",3,"change"],[1,"aq-composer",3,"keydown","nile-change","nile-submit","nile-stop","placeholder","hideModel","hideAddContext","rows","speechLang","value","loading"],["slot","toolbar-extras",3,"click"],["variant","ghost","size","small","title","Attach a file","aria-label","Attach a file",1,"aq-attach-btn"],["name","ng-upload-cloud-02","method","stroke","size","20"],[1,"reply-quote__text"],["type","button","aria-label","Remove quote",1,"reply-quote__dismiss",3,"click"],["name","ng-x","method","stroke","size","12"],[1,"aq-chip",3,"aq-chip--error"],[1,"aq-chip"],["size","12",1,"aq-chip__spin"],["type","button",1,"aq-chip__retry"],["type","button","aria-label","Remove attachment",1,"aq-chip__remove",3,"click"],["type","button",1,"aq-chip__retry",3,"click"],["variant","ghost","size","small","title","Attach a file","aria-label","Attach a file",1,"aq-attach-btn",3,"click"],["name","ng-paperclip","method","stroke","size","16"],["role","separator","aria-orientation","vertical","aria-label","Resize chat panel","title","Drag to resize",1,"aq-resizer",3,"pointerdown"],[1,"aq-artifact-pane"],[1,"aq-artifact-pane__header"],[1,"aq-artifact-pane__body"],[1,"aq-artifact-pane__empty"],[3,"widgets","conversationId","editMode","selectable","canSetAlert","canAddToStory","canForecast","forecastable","forecastingWidgetId","showEditDslInViewMode","widgetsLoading","dashboardFilters","resolvedFilters","applySummary","filterExplanation"],[1,"aq-artifact-pane__footer"],[1,"aq-artifact-pane__titles"],[1,"aq-artifact-pane__title"],[1,"aq-artifact-pane__subtitle"],[1,"aq-artifact-pane__header-actions"],[1,"aq-filters-pill"],["name","ng-filter-lines","method","stroke","size","14",1,"aq-filters-pill__icon"],["label","Filters","textPosition","left",3,"nile-change","isChecked"],[1,"aq-undo-redo-group"],["variant","ghost","hide-border","","size","small","aria-label","Undo",3,"click"],["slot","prefix","name","ng-undo","method","stroke","size","16","color","#344054"],["circle","","variant","ghost","hide-border","","size","small","aria-label","Redo","title","Redo",3,"click"],["name","ng-redo","method","stroke","size","16"],["aria-hidden","true",1,"aq-artifact-pane__header-divider"],["circle","","variant","ghost","size","small",3,"click"],["name","ng-x","method","stroke","size","16"],["name","ng-layout-grid","method","stroke","size","28","color","#98a2b3"],[1,"aq-artifact-pane__empty-title"],[1,"aq-artifact-pane__empty-sub"],[3,"selectionChange","forecast","setAlert","filterSubmit","filterChange","dslWidgetUpdated","dslEditorClosed","widgetClick","widgets","conversationId","editMode","selectable","canSetAlert","canAddToStory","canForecast","forecastable","forecastingWidgetId","showEditDslInViewMode","widgetsLoading","dashboardFilters","resolvedFilters","applySummary","filterExplanation"],["variant","secondary","size","small"],["hoist","","placement","top-end","distance","6",3,"open"],["slot","prefix","name","ng-trend-up-01","method","stroke","size","14","color","#7a5af8"],["slot","prefix","name","ng-book-open-text","method","stroke","size","14"],["hoist","","placement","top-end","distance","6",3,"nile-hide","open"],[1,"wfb-header","aq-builder-pane__header"],["name","ng-arrow-left","method","stroke","size","16"],["variant","text","width","180","height","16"],[3,"content"],["type","button",1,"aq-header-action",3,"click"],["method","stroke","size","18"],[3,"action","canForecast","anyForecastOn","editMode","showFullscreen","fullscreen","busy","showPromptGallery"],[3,"exitBuilder","executiveSummary","galleryPrompt","published","widgetClick","dashboardId","preseeded","galleryPrompts","canAddToStory"],["autofocus","",1,"conv-title-input",3,"input","keydown.enter","keydown.escape","value"],["content","Save name"],["type","button","aria-label","Save dashboard name",1,"aq-header-action",3,"click","disabled"],["size","14",1,"aq-header-action__spinner"],["name","ng-check","method","stroke","size","18","color","#2970ff"],[1,"wfb-header__title"],["content","Rename dashboard"],["type","button","aria-label","Rename dashboard",1,"aq-header-action",3,"click"],["name","ng-edit-02","method","stroke","size","16"],[1,"fs-section"],["for","fs-horizon",1,"fs-label"],[1,"fs-label__value"],["id","fs-horizon","type","range","min","1","step","1",1,"fs-slider",3,"input","value"],[1,"fs-hint"],["id","fs-gran-label",1,"fs-label"],["role","radiogroup","aria-labelledby","fs-gran-label",1,"fs-segmented"],[1,"fs-segment",3,"fs-segment--on","fs-segment--off"],["for","fs-confidence",1,"fs-label"],["id","fs-confidence","type","range","min","0","step","1",1,"fs-slider","fs-slider--ai",3,"input","value"],[1,"fs-segment"],["type","radio","name","fs-granularity",1,"fs-segment__input",3,"change","value","checked","disabled"],[1,"fs-label"],[1,"fs-card","fs-card--ai"],[1,"fs-card__title"],[1,"fs-card__body"],[1,"fs-card"],["method","stroke","size","14"],["type","search","clearable","",1,"prompt-gallery-search",3,"nile-input","nile-change","placeholder","value"],["aria-hidden","true",1,"prompt-gallery-skeleton"],[1,"prompt-gallery-prompts",3,"items","vertical","wrap"],[1,"prompt-gallery-skeleton__item"],["variant","rounded","width","16","height","16","border-radius","4px"],[1,"prompt-gallery-skeleton__label"],[1,"prompt-gallery-prompts",3,"nile-item-click","items","vertical","wrap"],[1,"aq-detail-overlay"],[1,"aq-detail-overlay__crumbs"],[3,"nile-click"],["variant","text","width","160","height","16"],[1,"aq-detail-overlay__body"],[3,"widgets","editMode","selectable","selectedWidgetIds","canSetAlert","canAddToStory","canForecast"],[1,"aq-detail-overlay__footer"],[1,"aq-detail-skeleton-grid",3,"height"],[1,"aq-detail-skeleton"],[1,"aq-detail-skeleton-grid"],["variant","rectangular","border-radius","12px","width","100%","height","100%",1,"aq-detail-skeleton-slot",3,"left","top","width","height"],["variant","rectangular","border-radius","12px","width","100%","height","100%",1,"aq-detail-skeleton-slot"],[1,"aq-detail-skeleton__row"],["variant","rectangular","width","100%","height","96","border-radius","12px"],["variant","rectangular","width","100%","height","280","border-radius","12px"],[3,"selectionChange","widgets","editMode","selectable","selectedWidgetIds","canSetAlert","canAddToStory","canForecast"],[1,"aq-detail-overlay__select-count"],["slot","prefix","name","ng-plus","method","stroke","size","14","color","#98a2b3"],["slot","prefix","name","ng-layout-grid","method","stroke","size","14","color","#fff"],[3,"closed","saved","open","widget","dashboardId","source","sourceName","authoringMode"],[3,"closed","added","open","widget"]],template:function(e,n){if(e&1&&(l(0,"section",8),f(1,Li,3,7,"button",9),l(2,"div",10),f(3,mo,42,11,"header",11),f(4,Qo,21,10,"div",12),f(5,Br,2,1),Je(6,Jr,10,16,"ng-template",null,0,Ze),d(),f(8,Xr,1,2,"div",13),f(9,sl,7,6,"aside",14),f(10,ml,15,16,"section",15),l(11,"nile-dialog",16),g("nile-request-close",function(){return n.saveDialogOpen.set(!1)})("nile-hide",function(){return n.saveDialogOpen.set(!1)}),l(12,"nile-input",17),g("nile-input",function(a){return n.saveDashboardName.set(a.detail.value)})("keydown.enter",function(){return n.confirmSaveDashboard()}),d(),l(13,"div",18)(14,"nile-button",19),g("click",function(){return n.saveDialogOpen.set(!1)}),p(15),d(),l(16,"nile-button",20),g("click",function(){return n.confirmSaveDashboard()}),p(17),d()()(),l(18,"nile-drawer",21),g("nile-request-close",function(){return n.closeForecastSettings()})("nile-hide",function(){return n.closeForecastSettings()}),l(19,"span",22),m(20,"nile-glyph",23),l(21,"span"),p(22),d()(),f(23,vl,1,1),l(24,"div",24)(25,"nile-button",19),g("click",function(){return n.closeForecastSettings()}),p(26),d(),l(27,"nile-button",20),g("click",function(){return n.applyForecastSettings()}),p(28),d()()(),l(29,"nile-drawer",25),g("nile-request-close",function(){return n.closeGallery()})("nile-hide",function(){return n.closeGallery()}),f(30,Sl,6,3),d(),Je(31,$l,1,1,"ng-template",null,1,Ze),f(33,Ll,1,6,"app-alert-drawer",26),f(34,Wl,2,0,"nile-executive-summary",27),d(),f(35,Bl,1,2,"app-story-picker-drawer",28)),e&2){let o,a;B("aq-shell--fullscreen",n.builderFullscreen())("aq-shell--resizing",n.isResizing()),F("data-mode",n.layoutMode()),s(),C((o=n.quoteBadge())?1:-1,o),s(),Z("flex-basis",n.chatPaneStyleWidth(),"px")("max-width",n.chatPaneStyleWidth(),"px"),s(),C(n.showHeader()?3:-1),s(),C(n.features().library&&n.chatPaneTab()==="library"?4:-1),s(),C(n.chatPaneTab()==="chat"?5:-1),s(3),C((n.layoutMode()==="split"||n.layoutMode()==="builder")&&!n.builderFullscreen()?8:-1),s(),C(n.artifactOpen()?9:-1),s(),C(n.builderOpen()?10:-1),s(),v("label",n.copy().saveDashboardDialogLabel),F("open",n.saveDialogOpen()?"":null),s(),v("placeholder",n.copy().dashboardNamePlaceholder)("value",n.saveDashboardName()),s(3),P(n.copy().cancelButton),s(),F("loading",n.savingDashboard()?"":null)("disabled",!n.saveDashboardName().trim()||n.savingDashboard()?"":null),s(),T(" ",n.copy().saveDashboardButton," "),s(),v("label",n.copy().forecastSettingsLabel)("open",n.forecastSettingsOpen()),s(4),P(n.copy().forecastSettingsLabel),s(),C((a=n.forecastDraft())?23:-1,a),s(3),P(n.copy().cancelButton),s(2),P(n.copy().applyButton),s(),v("label",n.copy().promptGalleryLabel)("open",n.galleryOpen()),s(),C(n.galleryOpen()?30:-1),s(3),C(n.features().alerts?33:-1),s(),C(n.features().executiveSummary?34:-1),s(),C(-1)}},dependencies:[Ot,Be,Le,We,Ve,Ne,$e,Re,ze,An,Pn,tt,hn,at,bn,Mn],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;font-family:var(--ng-font-family-body, "Inter", system-ui, sans-serif);background:var(--ng-colors-bg-active, #f9fafb);color:#101828}.wfb-page[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}.aq-header-action[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;outline:0;background:transparent;color:var(--ng-colors-text-tertiary-600, #535862);cursor:pointer;border-radius:6px;flex-shrink:0}.aq-header-action[_ngcontent-%COMP%]:hover, .aq-header-action[_ngcontent-%COMP%]:focus, .aq-header-action[_ngcontent-%COMP%]:focus-visible{outline:0;background:var(--ng-colors-bg-active, #e9eaeb);color:var(--ng-colors-text-primary-900, #181d27)}.aq-header-action[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}.wfb-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;height:var(--aq-header-h, 56px);padding:0 20px;border-bottom:1px solid #eaecf0;background:#fff;flex-shrink:0;gap:12px}.wfb-header__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 auto}.wfb-header__title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:#101828;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.wfb-header__right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-shrink:0}.aq-scope-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;max-width:220px;height:24px;padding:0 4px 0 8px;border-radius:999px;border:1px solid var(--ng-colors-border-secondary);background:var(--ng-colors-bg-secondary-50);color:var(--ng-colors-text-tertiary-600);font-size:12px;font-weight:500;flex-shrink:0}.aq-scope-chip__icon[_ngcontent-%COMP%]{flex-shrink:0}.aq-scope-chip__text[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-scope-chip__clear[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;flex-shrink:0}.aq-scope-chip__clear[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-active);color:var(--ng-colors-text-primary-900)}.scope-branch[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%}.scope-branch__label[_ngcontent-%COMP%]{flex:1}.scope-branch__icon[_ngcontent-%COMP%], .scope-branch__arrow[_ngcontent-%COMP%]{flex-shrink:0}.scope-menu__loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;padding:8px 12px;max-width:max-content}.scope-menu__empty[_ngcontent-%COMP%]{padding:8px 12px;color:var(--ng-colors-text-tertiary-600);font-size:13px}.scope-item__name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:240px}.conv-trigger__label[_ngcontent-%COMP%]{display:inline-block;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.conv-title-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;border:none;background:transparent;padding:4px 2px 4px 6px;border-radius:6px;cursor:pointer;max-width:360px}.conv-title-btn[_ngcontent-%COMP%] .wfb-header__title[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;font-weight:400;color:#344054}.conv-title-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:#f2f4f7}.conv-title-btn[_ngcontent-%COMP%]:disabled{cursor:default}.conv-title-btn__edit[_ngcontent-%COMP%]{flex-shrink:0;opacity:0;transition:opacity .12s}.conv-title-btn[_ngcontent-%COMP%]:hover:not(:disabled) .conv-title-btn__edit[_ngcontent-%COMP%]{opacity:1}.conv-title-input[_ngcontent-%COMP%]{font-family:inherit;font-size:14px;font-weight:400;color:#344054;border:1px solid #2970ff;border-radius:6px;padding:4px 8px;outline:none;min-width:220px;box-shadow:0 0 0 3px #2970ff14}.header-conn-wrap[_ngcontent-%COMP%]{position:relative}.header-conn-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;background:#fff;border:1px solid #d0d5dd;border-radius:8px;font-size:12px;font-weight:500;color:#344054;cursor:pointer;transition:border-color .15s,box-shadow .15s;white-space:nowrap;max-width:200px}.header-conn-chip[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#98a2b3;box-shadow:0 1px 3px #10182814}.header-conn-chip--open[_ngcontent-%COMP%]{border-color:#2970ff;box-shadow:0 0 0 3px #2970ff14}.header-conn-chip[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.header-conn-chip__label[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;max-width:150px}.header-conn-chip__chevron[_ngcontent-%COMP%]{flex-shrink:0;transition:transform .15s}.header-conn-chip__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.header-conn-chip__spinner[_ngcontent-%COMP%]{width:12px;height:12px;border:1.5px solid #e0e5ef;border-top-color:#2970ff;border-radius:50%;animation:_ngcontent-%COMP%_spin .7s linear infinite;flex-shrink:0}.header-conn-dropdown[_ngcontent-%COMP%]{position:absolute;top:calc(100% + 6px);right:0;min-width:200px;background:#fff;border:1px solid #eaecf0;border-radius:10px;box-shadow:0 8px 24px #1018281f;z-index:20;overflow:hidden}.header-conn-dropdown__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px 12px;font-size:12px;color:#344054;cursor:pointer;transition:background .1s}.header-conn-dropdown__item[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}.header-conn-dropdown__item[_ngcontent-%COMP%]:hover{background:#f9fafb}.header-conn-dropdown__item--active[_ngcontent-%COMP%]{background:#eff4ff;color:#2970ff;font-weight:500}.header-conn-dropdown__check[_ngcontent-%COMP%]{color:#2970ff;flex-shrink:0}.header-conn-dropdown__delete[_ngcontent-%COMP%]{flex-shrink:0;opacity:0;color:#667085;transition:opacity .1s,color .1s}.header-conn-dropdown__item-title[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-conn-dropdown__item[_ngcontent-%COMP%]:hover .header-conn-dropdown__delete[_ngcontent-%COMP%]{opacity:1}.header-conn-dropdown__item[_ngcontent-%COMP%]:hover .header-conn-dropdown__delete[_ngcontent-%COMP%]:hover{color:#d92d20}.header-conn-dropdown__item--new[_ngcontent-%COMP%]{color:#2970ff;font-weight:500;border-bottom:1px solid #f2f4f7;padding-bottom:10px;margin-bottom:2px}.header-new-chat[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:5px 10px;background:transparent;border:1px solid #d0d5dd;border-radius:8px;font-size:12px;font-weight:500;color:#344054;cursor:pointer;font-family:inherit;white-space:nowrap;transition:border-color .15s,background .15s}.header-new-chat[_ngcontent-%COMP%]:hover:not(:disabled){background:#f9fafb;border-color:#98a2b3}.header-new-chat[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}.ai-badge[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:#eff4ff;flex-shrink:0}.ai-badge--sm[_ngcontent-%COMP%]{width:22px;height:22px}.ai-badge--lg[_ngcontent-%COMP%]{width:48px;height:48px}.conv-dropdown[_ngcontent-%COMP%]{margin-left:-8px}.conv-dropdown[_ngcontent-%COMP%] nile-button[_ngcontent-%COMP%]::part(base){padding-left:2px;padding-right:2px}.conv-dropdown[_ngcontent-%COMP%]::part(panel){width:380px;max-width:90vw;overflow:hidden}.conv-dropdown[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%]::part(menu__items-wrapper), .related-dropdown[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%]::part(menu__items-wrapper){max-height:340px;overflow-x:hidden}.related-trigger__label[_ngcontent-%COMP%]{display:inline-block;max-width:0;overflow:hidden;white-space:nowrap;opacity:0;transition:max-width .2s ease,opacity .15s ease}.related-trigger[_ngcontent-%COMP%]:hover .related-trigger__label[_ngcontent-%COMP%], .related-trigger[_ngcontent-%COMP%]:focus-visible .related-trigger__label[_ngcontent-%COMP%]{max-width:120px;opacity:1}.related-dropdown[_ngcontent-%COMP%]::part(panel){width:420px;max-width:90vw;overflow:hidden}.conv-dropdown[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu[_ngcontent-%COMP%]{display:block;width:100%}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]{display:block;width:100%;box-sizing:border-box}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(base), .related-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(base){width:100%;min-width:0}.scope-menu__loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;padding:8px 12px}.menu-empty[_ngcontent-%COMP%]{padding:10px 16px;font-size:12.5px;color:var(--ng-colors-text-tertiary-600, #535862)}.menu-skeleton-item[_ngcontent-%COMP%]{pointer-events:none}.prompt-gallery-skeleton[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;width:100%}.prompt-gallery-skeleton__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:16px;border:1px solid #e9eaeb;border-radius:10px;background:#fff}.prompt-gallery-skeleton__label[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0}.aq-header-action__spinner[_ngcontent-%COMP%]{display:inline-flex;color:#2970ff}.related-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;min-width:0}.related-item__icon[_ngcontent-%COMP%]{flex-shrink:0;color:#667085}.related-item__name[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.related-item__meta[_ngcontent-%COMP%]{flex-shrink:0;color:#98a2b3;font-size:12px;margin-left:4px}.conv-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;min-width:0}.conv-item__icon[_ngcontent-%COMP%]{flex-shrink:0;color:#667085}.conv-item__title[_ngcontent-%COMP%]{flex:1;min-width:0;max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conv-item__check[_ngcontent-%COMP%]{flex-shrink:0}.conv-item__delete[_ngcontent-%COMP%]{flex-shrink:0;color:#98a2b3;opacity:0;transition:opacity .12s,color .12s;cursor:pointer}.conv-item__delete[_ngcontent-%COMP%]:hover{color:#d92d20}nile-menu-item[_ngcontent-%COMP%]:hover .conv-item__delete[_ngcontent-%COMP%]{opacity:1}.aq-chat[_ngcontent-%COMP%]{flex:1;min-height:0;display:block}.aq-chat[_ngcontent-%COMP%]::part(viewport){scrollbar-width:none;-ms-overflow-style:none}.aq-chat[_ngcontent-%COMP%]::part(scroll-button){display:none}.aq-chat[_ngcontent-%COMP%]::part(messages){padding:16px;display:flex;flex-direction:column;gap:16px}.aq-chat[_ngcontent-%COMP%]::part(empty){position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:auto;padding:24px 16px;box-sizing:border-box}.msg-skeleton[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;align-self:flex-start}.msg-skeleton--ai[_ngcontent-%COMP%]{width:100%;max-width:100%}.msg-skeleton--user[_ngcontent-%COMP%]{align-self:flex-end;max-width:60%}nile-skeleton-loader[_ngcontent-%COMP%]::part(skeleton){background-color:#e4e7ec;opacity:1}.welcome-wrap[_ngcontent-%COMP%]{flex:1;min-height:0;display:flex;overflow:auto}.welcome-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px;margin:auto;width:100%;max-width:820px;padding:48px 16px}.welcome-title[_ngcontent-%COMP%]{margin:0;font-size:22px;font-weight:700;color:#181d27;letter-spacing:-.02em}.welcome-sub[_ngcontent-%COMP%]{margin:0 0 4px;font-size:14px;color:#535862;max-width:440px;line-height:1.6}.welcome-composer[_ngcontent-%COMP%]{width:100%;margin:8px auto 4px}.aq-composer[_ngcontent-%COMP%]{display:block;width:100%}.welcome-prompts[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:100%}.prompt-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;min-width:0;padding:12px 14px;border:1px solid #e9eaeb;border-radius:12px;background:#fff;cursor:pointer;text-align:left;font:inherit;transition:border-color .15s ease,background .15s ease,box-shadow .15s ease}.prompt-card[_ngcontent-%COMP%]:hover{border-color:#b2ccff;box-shadow:0 1px 2px #1018280f}.prompt-card__icon[_ngcontent-%COMP%]{flex:0 0 auto}.prompt-card__label[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;font-size:13px;font-weight:500;line-height:1.45;color:#414651;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.prompt-card__badge[_ngcontent-%COMP%]{flex:0 0 auto;align-self:center;padding:2px 6px;border-radius:4px;background:#7a5af8;color:#fff;font-size:9px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap}.prompt-card--ai[_ngcontent-%COMP%]{border-color:#d9d0fd;background:#fbfaff}.prompt-card--ai[_ngcontent-%COMP%]:hover{border-color:#b9a6fb}.forecast-drawer[_ngcontent-%COMP%]{--size: 420px}.forecast-drawer[_ngcontent-%COMP%]::part(header){align-items:center;padding:0 12px 0 16px;border-bottom:1px solid #eaecf0}.forecast-drawer[_ngcontent-%COMP%]::part(title){display:flex;align-items:center;gap:8px;font-size:15px;font-weight:600;color:#101828}.forecast-drawer[_ngcontent-%COMP%]::part(body){display:flex;flex-direction:column;gap:22px;padding:20px 16px}.forecast-drawer[_ngcontent-%COMP%]::part(footer){border-top:1px solid #eaecf0;padding:12px 16px}.forecast-drawer__label[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;font-size:15px;font-weight:600;color:#101828}.forecast-drawer__mark[_ngcontent-%COMP%]{flex:0 0 auto}.fs-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.fs-label[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:#414651}.fs-label__value[_ngcontent-%COMP%]{color:#5925dc}.fs-hint[_ngcontent-%COMP%]{margin:0;font-size:11px;line-height:1.5;color:#717680}.fs-slider[_ngcontent-%COMP%]{appearance:none;width:100%;height:6px;margin:2px 0;border-radius:3px;background:#eaecf0;cursor:pointer;background-image:linear-gradient(#2970ff,#2970ff);background-repeat:no-repeat;background-size:var(--fs-fill, 50%) 100%}.fs-slider--ai[_ngcontent-%COMP%]{background-image:linear-gradient(#7a5af8,#7a5af8)}.fs-slider[_ngcontent-%COMP%]::-webkit-slider-thumb{appearance:none;width:16px;height:16px;border:2px solid #fff;border-radius:50%;background:#2970ff;box-shadow:0 1px 3px #10182833}.fs-slider--ai[_ngcontent-%COMP%]::-webkit-slider-thumb{background:#7a5af8}.fs-slider[_ngcontent-%COMP%]::-moz-range-thumb{width:14px;height:14px;border:2px solid #fff;border-radius:50%;background:#2970ff;box-shadow:0 1px 3px #10182833}.fs-slider--ai[_ngcontent-%COMP%]::-moz-range-thumb{background:#7a5af8}.fs-slider[_ngcontent-%COMP%]:focus-visible{outline:2px solid #84adff;outline-offset:3px}.fs-segmented[_ngcontent-%COMP%]{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:2px;padding:3px;border:1px solid #e9eaeb;border-radius:8px;background:#f9fafb}.fs-segment[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:6px 4px;border-radius:6px;cursor:pointer;font-size:12px;font-weight:500;color:#535862;white-space:nowrap;transition:background .15s ease,color .15s ease}.fs-segment__input[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.fs-segment[_ngcontent-%COMP%]:hover{color:#181d27}.fs-segment--on[_ngcontent-%COMP%]{background:#2970ff;color:#fff;font-weight:600}.fs-segment--on[_ngcontent-%COMP%]:hover{color:#fff}.fs-segment--off[_ngcontent-%COMP%]{color:#a4a7ae;cursor:not-allowed}.fs-segment--off[_ngcontent-%COMP%]:hover{color:#a4a7ae}.fs-segment[_ngcontent-%COMP%]:has(.fs-segment__input:focus-visible){outline:2px solid #84adff;outline-offset:1px}.fs-card[_ngcontent-%COMP%]{padding:12px 14px;border:1px solid #e9eaeb;border-radius:10px;background:#fcfcfd}.fs-card__title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin:0 0 4px;font-size:12px;font-weight:600;color:#414651}.fs-card__body[_ngcontent-%COMP%]{margin:0;font-size:11px;line-height:1.6;color:#535862}.fs-card--ai[_ngcontent-%COMP%]{border-color:#d9d0fd;background:#fbfaff}.fs-card--ai[_ngcontent-%COMP%] .fs-card__title[_ngcontent-%COMP%]{color:#5925dc}.fs-card--pass[_ngcontent-%COMP%]{border-color:#abefc6;background:#f6fef9}.fs-card--pass[_ngcontent-%COMP%] .fs-card__title[_ngcontent-%COMP%]{color:#067647}.fs-card--warn[_ngcontent-%COMP%]{border-color:#fedf89;background:#fffcf5}.fs-card--warn[_ngcontent-%COMP%] .fs-card__title[_ngcontent-%COMP%]{color:#b54708}.fs-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:8px}.aq-detail-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:50;display:flex;flex-direction:column;background:#fff;animation:_ngcontent-%COMP%_aq-slide-in .16s ease}.aq-detail-overlay__crumbs[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;box-sizing:border-box;height:var(--aq-header-h, 56px);padding:0 20px;border-bottom:1px solid #eaecf0;flex-shrink:0}.aq-detail-overlay__crumbs[_ngcontent-%COMP%] nile-breadcrumb[_ngcontent-%COMP%]{display:inline-flex;align-items:center}.aq-detail-overlay__body[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow:auto;scrollbar-width:none;-ms-overflow-style:none;padding:20px;background:var(--nile-color-bg-subtle, #fbfbfd)}.aq-detail-overlay__body[_ngcontent-%COMP%]::-webkit-scrollbar{width:0;height:0}.aq-detail-overlay__footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:12px 20px;border-top:1px solid #eaecf0;background:#fff;flex-shrink:0}.aq-detail-overlay__select-count[_ngcontent-%COMP%]{margin-right:auto;font-size:13px;font-weight:500;color:#414651}.aq-detail-skeleton[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.aq-detail-skeleton__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.aq-detail-skeleton-grid[_ngcontent-%COMP%]{position:relative;width:100%}.aq-detail-skeleton-slot[_ngcontent-%COMP%]{position:absolute}.aq-detail-skeleton-slot[_ngcontent-%COMP%]::part(base){height:100%}.prompt-gallery-prompts[_ngcontent-%COMP%]{width:100%}.prompt-gallery-prompts[_ngcontent-%COMP%]::part(item-label){font-weight:500}.ai-bubble__steps[_ngcontent-%COMP%]{display:block;width:100%;box-sizing:border-box;margin-bottom:12px;padding:12px 16px}.wfb-suggestions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:8px}.wfb-suggestions-loading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;margin-top:12px}.suggestions-spinner[_ngcontent-%COMP%]{width:16px;height:16px;border:2px solid #e0e5ef;border-top-color:#2970ff;border-radius:50%;animation:_ngcontent-%COMP%_spin .7s linear infinite;flex-shrink:0}.suggestions-loading-content[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:2px}.suggestions-loading-text[_ngcontent-%COMP%]{color:#667085;font-size:13px;font-style:italic}.suggestions-loading-dots[_ngcontent-%COMP%]{display:inline-flex;gap:1px}.suggestions-loading-dots[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#667085;font-size:13px;animation:_ngcontent-%COMP%_dot-fade 1.4s ease-in-out infinite}.suggestions-loading-dots[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){animation-delay:.2s}.suggestions-loading-dots[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){animation-delay:.4s}@keyframes _ngcontent-%COMP%_dot-fade{0%,80%,to{opacity:.2}40%{opacity:1}}.welcome-prompts-skeleton[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:100%}.welcome-prompts-skeleton__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:12px 14px;border:1px solid #e9eaeb;border-radius:12px;background:#fff}.welcome-prompts-skeleton__icon[_ngcontent-%COMP%]{flex:0 0 auto}.welcome-prompts-skeleton__label[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;max-width:70%}.prompt-gallery-row[_ngcontent-%COMP%]{width:100%;margin:2px auto 0;display:flex;justify-content:flex-end;gap:16px}.prompt-gallery-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;padding:2px 0;cursor:pointer;font:inherit;font-size:13px;font-weight:400;color:#2970ff}.prompt-gallery-link[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:#2970ff}.prompt-gallery-link[_ngcontent-%COMP%]:hover span[_ngcontent-%COMP%]{text-decoration:underline}.prompt-gallery-drawer[_ngcontent-%COMP%]{--size: calc(100vw - 248px) }.prompt-gallery-drawer[_ngcontent-%COMP%]::part(header){height:var(--aq-header-h, 56px);align-items:center;padding:0 16px;border-bottom:1px solid #eaecf0}.prompt-gallery-drawer[_ngcontent-%COMP%]::part(title){font-size:16px;font-weight:600;color:#101828}.prompt-gallery-drawer[_ngcontent-%COMP%]::part(body){display:flex;flex-direction:column;gap:14px}.prompt-gallery-search[_ngcontent-%COMP%]{width:100%;flex-shrink:0}.prompt-gallery-empty[_ngcontent-%COMP%]{color:#717680;font-size:13px;padding:24px 4px}.prompt-gallery-list[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px;align-content:start}.prompt-gallery-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;border:1px solid #e9eaeb;border-radius:12px;padding:12px 16px;background:#fff;cursor:pointer;text-align:left;font:inherit;font-size:13px;font-weight:500;color:#414651;line-height:1.4;transition:border-color .18s,box-shadow .18s}.prompt-gallery-item[_ngcontent-%COMP%]:hover{border-color:#2970ff;box-shadow:0 6px 24px #2970ff1a}.aq-library-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.aq-library-group__head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}.aq-library-group__label[_ngcontent-%COMP%]{font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#71798d}.aq-library-group__toggle[_ngcontent-%COMP%]{border:none;background:none;padding:0;font:inherit;font-size:12px;font-weight:600;color:#2563eb;cursor:pointer}.aq-library-group__toggle[_ngcontent-%COMP%]:hover{text-decoration:underline}.aq-lib-cards[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.aq-lib-cards--dashboards[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(232px,1fr));gap:10px}.aq-lib-card-wrap[_ngcontent-%COMP%]{position:relative;cursor:pointer;border-radius:10px;transition:box-shadow .15s}.aq-lib-card-wrap[_ngcontent-%COMP%] nile-kpi-chart[_ngcontent-%COMP%]{display:block;height:172px;box-sizing:border-box}.aq-lib-card-wrap--selected[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #1d4ed826;border-radius:10px}.aq-lib-card[_ngcontent-%COMP%]{cursor:pointer;padding:13px 14px;border-radius:10px;background:#fff;border:1.5px solid #e6eaf1;box-shadow:0 1px 2px #0f172a08;transition:border-color .15s,box-shadow .15s}.aq-lib-card[_ngcontent-%COMP%]:hover{border-color:#c7d5f5}.aq-lib-card--dashboard[_ngcontent-%COMP%]{display:block;width:100%;padding:0;overflow:hidden;text-align:left;font:inherit;color:inherit}.aq-lib-card--dashboard[_ngcontent-%COMP%] .aq-lib-card__row[_ngcontent-%COMP%]{align-items:center;padding:11px 13px 12px}.aq-lib-skeleton[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.aq-lib-skeleton__kpi[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;height:172px;box-sizing:border-box;padding:16px;border-radius:10px;background:#fff;border:1px solid #e6eaf1;box-shadow:0 1px 2px #0f172a08}.aq-lib-skeleton__kpi[_ngcontent-%COMP%] nile-skeleton-loader[_ngcontent-%COMP%]:last-child{margin-top:auto}.aq-lib-skeleton__dash[_ngcontent-%COMP%]{border-radius:10px;overflow:hidden;background:#fff;border:1px solid #e6eaf1;box-shadow:0 1px 2px #0f172a08}.aq-lib-skeleton__dash-text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;padding:13px 14px}.aq-lib-card__preview[_ngcontent-%COMP%]{position:relative;height:108px;background:linear-gradient(180deg,#fbfcfe,#f4f7fb);border-bottom:1px solid #eef1f6}.aq-lib-card__viz[_ngcontent-%COMP%]{position:absolute;inset:6px 8px 4px;pointer-events:none}.aq-lib-card__viz-empty[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:flex-end;justify-content:center;gap:7px;padding:18px}.aq-lib-card__viz-empty[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:0 0 14px;border-radius:3px 3px 0 0;background:#e3e9f2}.aq-lib-card__chip[_ngcontent-%COMP%]{position:absolute;top:8px;right:8px;display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border-radius:5px;background:#ffffffeb;border:1px solid #e6eaf1;font-size:10.5px;font-weight:600;color:#56607a}.aq-lib-card__row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:10px}.aq-lib-card__text[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0}.aq-lib-card__title[_ngcontent-%COMP%]{font-size:13px;font-weight:500;letter-spacing:-.01em;line-height:1.35;color:#101828}.aq-lib-card__title-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:7px}.aq-lib-card__badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:10.5px;font-weight:600;color:#56607a;background:#eef1f6;border-radius:5px;padding:2px 6px}.aq-lib-card__desc[_ngcontent-%COMP%]{font-size:11.5px;color:#71798d;line-height:1.45;margin-top:3px}.aq-lib-card__check[_ngcontent-%COMP%]{position:absolute;top:12px;right:12px;z-index:1;flex:0 0 18px;width:18px;height:18px;border-radius:5px;border:1.5px solid #cbd5e1;background:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0}.aq-lib-card__check[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{opacity:0}.aq-lib-card__check--on[_ngcontent-%COMP%]{border-color:#1d4ed8;background:#1d4ed8}.aq-lib-card__check--on[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{opacity:1}.ai-bubble[_ngcontent-%COMP%]{display:block;width:100%;max-width:100%;margin-inline:auto}.ai-bubble__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.ai-bubble--user[_ngcontent-%COMP%]{white-space:pre-line}.sent-quote[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:6px;margin-bottom:6px;padding:6px 8px;border-radius:8px;border-left:3px solid #155eef;background:#155eef0f;color:var(--ng-colors-text-tertiary-600, #535862);font-size:12px;line-height:1.4}.sent-quote[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{flex:0 0 auto;margin-top:2px;color:#155eef}.answer-summary[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.answer-summary__row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px}.answer-summary__check[_ngcontent-%COMP%]{flex:0 0 auto;margin-top:2px}.answer-summary__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;min-width:0}.answer-summary__title[_ngcontent-%COMP%]{font-size:13.5px;font-weight:400;color:var(--ng-colors-text-primary-900, #181d27)}.answer-summary__answer[_ngcontent-%COMP%]{font-size:12.5px;font-weight:500;color:var(--ng-colors-text-tertiary-600, #535862)}.answer-summary__answer[_ngcontent-%COMP%]:before{content:"\\2014 "}.sent-quote__text[_ngcontent-%COMP%]{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.ai-bubble[_ngcontent-%COMP%]::part(thinking){border:none;padding-left:2px;font-size:12px}.ai-bubble[_ngcontent-%COMP%]::part(base), .ai-bubble[_ngcontent-%COMP%]::part(bubble){transition:max-width .22s ease,width .22s ease}.assistant-text[_ngcontent-%COMP%]{display:block;max-width:680px}.user-row[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:flex-start;gap:8px;width:100%;max-width:860px;margin-inline:auto}.user-icon[_ngcontent-%COMP%]{order:2;display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;background:#f2f4f7;flex-shrink:0;margin-top:2px}.user-bubble[_ngcontent-%COMP%]{order:1;background:#2970ff;border-radius:12px 2px 12px 12px;padding:10px 14px;font-size:14px;color:#fff;max-width:70%;white-space:pre-wrap;word-break:break-word}.assistant-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:10px;width:100%;max-width:860px;margin-inline:auto}.assistant-icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;background:#eff4ff;flex-shrink:0;margin-top:2px}.assistant-body[_ngcontent-%COMP%]{flex:1;min-width:0;max-width:760px;display:flex;flex-direction:column;gap:12px}.assistant-text[_ngcontent-%COMP%]{font-size:14px;color:#344054;line-height:1.6;margin:0;white-space:pre-wrap;word-break:break-word}.assistant-text--error[_ngcontent-%COMP%]{color:#d92d20}.assistant-text--md[_ngcontent-%COMP%]{white-space:normal;display:block}.assistant-error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px;padding:10px 12px;border:1px solid #fda29b;border-radius:8px;background:#fffbfa;font-size:13px;line-height:1.5;color:#b42318}.assistant-error__icon[_ngcontent-%COMP%]{flex-shrink:0;color:#d92d20;margin-top:1px}.assistant-error__text[_ngcontent-%COMP%]{word-break:break-word}.wfb-tools[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px}.wfb-tool[_ngcontent-%COMP%]{font-size:11px}.wfb-tool[_ngcontent-%COMP%]::part(content){display:inline-flex;align-items:center;gap:5px}.wfb-tool__spinner[_ngcontent-%COMP%]{width:10px;height:10px;border:1.5px solid currentColor;border-top-color:transparent;border-radius:50%;animation:_ngcontent-%COMP%_spin .7s linear infinite;display:inline-block}.wfb-tool__detail[_ngcontent-%COMP%]{opacity:.75;font-weight:400}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.agent-trace[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:14px;margin:2px 0;padding-left:18px}.agent-trace[_ngcontent-%COMP%]:before{content:"";position:absolute;top:4px;bottom:4px;left:3px;width:2px;border-radius:1px;background:#eaecf0}.agent-trace__row[_ngcontent-%COMP%]{min-width:0}.agent-trace__text[_ngcontent-%COMP%]{margin:0;font-size:13px;line-height:1.6;color:#717680;white-space:pre-wrap;word-break:break-word}.agent-trace__chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px}.wfb-status-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:4px 0}.wfb-status-text[_ngcontent-%COMP%]{font-size:13px;color:#667085;font-style:italic}.wfb-typing[_ngcontent-%COMP%]{display:flex;gap:4px;align-items:center;padding:6px 0}.wfb-typing[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%;background:#98a2b3;animation:_ngcontent-%COMP%_bounce 1.2s ease-in-out infinite}.wfb-typing[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){animation-delay:.2s}.wfb-typing[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){animation-delay:.4s}@keyframes _ngcontent-%COMP%_bounce{0%,60%,to{transform:translateY(0);opacity:.4}30%{transform:translateY(-5px);opacity:1}}.chart-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid #eaecf0;border-radius:12px;background:#fff;box-shadow:0 1px 3px #1018280f;cursor:pointer;transition:border-color .15s,box-shadow .15s;width:100%;max-width:100%}.chart-card[_ngcontent-%COMP%]:hover{border-color:#2970ff;box-shadow:0 0 0 3px #2970ff14}.chart-card__icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:8px;background:#eff4ff;flex-shrink:0}.chart-card__body[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.chart-card__title[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:#101828;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chart-card__meta[_ngcontent-%COMP%]{font-size:12px;color:#667085}.aq-composer-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;position:relative;width:100%;box-sizing:border-box;border:1px solid #d0d5dd;border-radius:20px;background:#fff;transition:border-color .12s ease,box-shadow .12s ease}.aq-composer-wrap[_ngcontent-%COMP%]:focus-within{border-color:#155eef;box-shadow:0 0 0 3px #155eef1f}.aq-composer-wrap--dragover[_ngcontent-%COMP%]{border-color:#155eef;border-style:dashed;box-shadow:0 0 0 3px #155eef1f}.aq-composer-wrap[_ngcontent-%COMP%] > .aq-attachments[_ngcontent-%COMP%]{padding:10px 14px 0}.reply-badge[_ngcontent-%COMP%]{position:fixed;z-index:1000;transform:translate(-50%,calc(-100% - 8px));display:inline-flex;align-items:center;gap:4px;padding:6px 12px;border:none;border-radius:999px;background:var(--ng-colors-bg-primary-solid, #181d27);color:#fff;font-size:12px;font-weight:500;line-height:1;box-shadow:var(--ng-shadow-lg, 0 8px 16px rgba(16, 24, 40, .16));cursor:pointer}.reply-badge[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-primary-solid-hover, #0c0e12)}.reply-badge--below[_ngcontent-%COMP%]{transform:translate(-50%,8px)}.reply-quote[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px;margin:10px 14px 0;padding:8px 10px;border-radius:10px;border-left:3px solid #155eef;background:var(--ng-colors-bg-secondary, #f5f5f6);color:var(--ng-colors-text-tertiary-600, #535862);font-size:12px;line-height:1.4}.reply-quote[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{flex:0 0 auto;margin-top:2px;color:#155eef;transform:rotate(180deg)}.reply-quote__text[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.reply-quote__dismiss[_ngcontent-%COMP%]{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;padding:2px;border:none;background:transparent;color:inherit;cursor:pointer;border-radius:4px}.reply-quote__dismiss[_ngcontent-%COMP%]:hover{background:#0000000f}.aq-drop-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;gap:8px;border-radius:20px;background:#eff6ffeb;color:#155eef;font-size:13px;font-weight:500;pointer-events:none}.aq-composer[_ngcontent-%COMP%]::part(base){border:0;border-radius:0;background:transparent;box-shadow:none}.aq-composer[_ngcontent-%COMP%]::part(toolbar-end){gap:6px;align-items:center}.aq-composer[loading][_ngcontent-%COMP%]::part(send-button){background:var(--ng-colors-bg-active, #e9eaeb);color:var(--ng-colors-text-tertiary-600, #535862)}.aq-composer[loading][_ngcontent-%COMP%]::part(send-button):hover{background:var(--ng-colors-bg-active, #e9eaeb);color:var(--ng-colors-text-primary-900, #181d27)}.aq-attachments[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px}.aq-attachments--sent[_ngcontent-%COMP%]{margin-top:6px}.aq-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;max-width:220px;padding:4px 8px;border:1px solid #eaecf0;border-radius:8px;background:#f9fafb;font-size:12px;color:#344054}.aq-chip--error[_ngcontent-%COMP%]{border-color:#fda29b;background:#fffbfa;color:#b42318}.aq-chip--static[_ngcontent-%COMP%]{background:#fff}.aq-chip__icon[_ngcontent-%COMP%]{color:#667085;flex-shrink:0}.aq-chip__name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-chip__spin[_ngcontent-%COMP%]{flex-shrink:0}.aq-chip__retry[_ngcontent-%COMP%]{border:none;background:none;padding:0;color:#b42318;font-size:12px;font-weight:600;cursor:pointer}.aq-chip__remove[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;border:none;background:none;padding:0;cursor:pointer;color:#98a2b3;flex-shrink:0}.aq-chip__remove[_ngcontent-%COMP%]:hover{color:#475467}.wfb-breadcrumb[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;font-size:13px}.wfb-breadcrumb__current[_ngcontent-%COMP%]{color:#101828;font-weight:500}.wfb-preview-close[_ngcontent-%COMP%]{cursor:pointer;color:#667085}.wfb-preview-close[_ngcontent-%COMP%]:hover{color:#101828}.wfb-preview-link[_ngcontent-%COMP%]{background:none;border:none;padding:0;font-size:13px;font-weight:500;color:#2970ff;cursor:pointer;font-family:inherit}.wfb-preview-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.input-area[_ngcontent-%COMP%]{flex-shrink:0;padding:4px 16px 18px;display:flex;flex-direction:column;justify-content:center}.chat-input-pill[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;width:100%;max-width:100%;padding:14px 16px 12px;background:#fff;border:1px solid #e9eaeb;border-radius:24px;box-shadow:0 1px 2px #1018280a,0 8px 24px #1018280f;cursor:text;transition:border-color .15s,box-shadow .15s}.chat-input-pill[_ngcontent-%COMP%]:focus-within{border-color:#2970ff;box-shadow:0 0 0 3px #2970ff1f}.voice-wave[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;height:22px;margin:0 8px;display:block}.input-query[_ngcontent-%COMP%]{display:block;width:100%;min-width:0;border:none;outline:none;resize:none;font:inherit;font-size:15px;line-height:1.4;color:#181d27;background:transparent;padding:6px 2px;max-height:160px;overflow-y:auto;white-space:pre-wrap;word-break:break-word}.input-query[_ngcontent-%COMP%]::placeholder{color:#717680}.input-query[_ngcontent-%COMP%]:disabled{cursor:not-allowed;opacity:.6}.input-query--live[_ngcontent-%COMP%]{min-height:21px;cursor:default;text-align:left}.input-query__interim[_ngcontent-%COMP%]{font-style:italic;opacity:.55}.pill-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px}.pill-toolbar__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px}.pill-toolbar__right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-left:auto}.conn-chip-wrap[_ngcontent-%COMP%]{position:relative}.datasource-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;background:#eff4ff;border-radius:20px;font-size:12px;font-weight:500;color:#2970ff;cursor:pointer;-webkit-user-select:none;user-select:none;max-width:200px;border:1px solid transparent}.datasource-chip[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.datasource-chip__chevron[_ngcontent-%COMP%]{transition:transform .15s;flex-shrink:0}.datasource-chip__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.datasource-chip[_ngcontent-%COMP%]:hover:not(:disabled){background:#e0eaff}.datasource-chip[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.datasource-chip--open[_ngcontent-%COMP%]{background:#e0eaff;border-color:#b2ccff}.conn-chip-dropdown[_ngcontent-%COMP%]{position:absolute;bottom:calc(100% + 6px);left:0;min-width:200px;background:#fff;border:1px solid #e4e7ec;border-radius:10px;box-shadow:0 4px 16px #0000001a;z-index:100;overflow:hidden}.conn-chip-dropdown__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:9px 12px;font-size:13px;color:#344054;cursor:pointer}.conn-chip-dropdown__item[_ngcontent-%COMP%]:hover{background:#f9fafb}.conn-chip-dropdown__item--active[_ngcontent-%COMP%]{background:#f5f8ff;color:#2970ff}.conn-chip-dropdown__name[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conn-chip-dropdown__hint[_ngcontent-%COMP%]{font-size:11px;color:#98a2b3;flex-shrink:0}.conn-chip-dropdown__check[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0;color:#2970ff}.mic-icon[_ngcontent-%COMP%]{cursor:pointer;color:#667085;transition:color .15s}.mic-icon[_ngcontent-%COMP%]:hover{color:#344054}.mic-icon--recording[_ngcontent-%COMP%]{color:#d92d20;animation:_ngcontent-%COMP%_mic-pulse 1s ease-in-out infinite}@keyframes _ngcontent-%COMP%_mic-pulse{0%,to{opacity:1}50%{opacity:.5}}.send-icon[_ngcontent-%COMP%]{cursor:pointer;color:#2970ff;transition:opacity .15s}.send-icon--disabled[_ngcontent-%COMP%]{opacity:.35;cursor:not-allowed;pointer-events:none}.wfb-save-dialog[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#10182866;z-index:20}.wfb-save-dialog__body[_ngcontent-%COMP%]{background:#fff;border:1px solid #eaecf0;border-radius:12px;padding:20px;width:360px;display:flex;flex-direction:column;gap:12px;box-shadow:0 8px 24px #1018281f}.wfb-save-dialog__label[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:#344054}.wfb-save-dialog__input[_ngcontent-%COMP%]{width:100%;padding:8px 12px;border:1px solid #d0d5dd;border-radius:8px;font-size:14px;font-family:inherit;color:#101828;outline:none;box-sizing:border-box}.wfb-save-dialog__input[_ngcontent-%COMP%]:focus{border-color:#2970ff;box-shadow:0 0 0 3px #2970ff1a}.wfb-save-dialog__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:8px}.aq-shell[_ngcontent-%COMP%]{--aq-header-h: 56px;display:flex;flex:1 1 auto;min-height:0;width:100%;overflow:hidden;container-type:inline-size}.aq-chat-pane[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0;flex:1 1 auto;transition:flex-basis .22s ease,max-width .22s ease;--aq-conversation-w: 900px}.aq-chat-pane__tabs[_ngcontent-%COMP%]{flex-shrink:0}.aq-library-pane__head[_ngcontent-%COMP%] nile-nav-tab-group[_ngcontent-%COMP%]{width:100%}.aq-chat-pane__tabs[_ngcontent-%COMP%] nile-nav-tab[_ngcontent-%COMP%]::part(name), .aq-library-pane__head[_ngcontent-%COMP%] nile-nav-tab-group[_ngcontent-%COMP%] nile-nav-tab[_ngcontent-%COMP%]::part(name){font-size:13px;line-height:14px}.aq-library-pane__head[_ngcontent-%COMP%] nile-nav-tab-group[_ngcontent-%COMP%] .aq-library-pane__tab-count[_ngcontent-%COMP%]{display:inline-block;min-width:18px;margin-left:6px;padding:1px 6px;border-radius:999px;background:#1d4ed8;color:#fff;font-size:10px;font-weight:700;line-height:14px;text-align:center;vertical-align:1px}.aq-chat-pane__tabs[_ngcontent-%COMP%]::part(nav), .aq-library-pane__head[_ngcontent-%COMP%] nile-nav-tab-group[_ngcontent-%COMP%]::part(nav){background:#eef1f6}.aq-library-pane[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}.aq-shell[data-mode=idle][_ngcontent-%COMP%] .aq-chat[_ngcontent-%COMP%]::part(messages), .aq-shell[data-mode=conversation][_ngcontent-%COMP%] .aq-chat[_ngcontent-%COMP%]::part(messages), .aq-shell[data-mode=conversation][_ngcontent-%COMP%] .input-area[_ngcontent-%COMP%]{width:100%;max-width:var(--aq-conversation-w);margin-left:auto;margin-right:auto}.aq-shell[data-mode=conversation][_ngcontent-%COMP%] .wfb-messages[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child{margin-top:auto}.aq-shell[data-mode=split][_ngcontent-%COMP%] .aq-chat-pane[_ngcontent-%COMP%]{flex:0 0 auto;flex-basis:clamp(320px,41%,485px);max-width:50%;margin:0}.aq-resizer[_ngcontent-%COMP%]{align-self:stretch;position:relative;cursor:col-resize;background:transparent;z-index:6;touch-action:none}.aq-resizer[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;bottom:0;left:50%;width:1px;transform:translate(-50%);background:var(--nile-color-border, #e4e7ec)}.aq-resizer[_ngcontent-%COMP%]:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:4px;height:36px;border-radius:3px;background:var(--nile-color-border, #cfd4dc);transition:background .15s,height .15s}.aq-resizer[_ngcontent-%COMP%]:hover:after, .aq-resizer.is-active[_ngcontent-%COMP%]:after{background:#2970ff;height:44px}.aq-shell--resizing[_ngcontent-%COMP%]{cursor:col-resize;-webkit-user-select:none;user-select:none}.aq-shell--resizing[_ngcontent-%COMP%] .aq-chat-pane[_ngcontent-%COMP%], .aq-shell--resizing[_ngcontent-%COMP%] .aq-builder-pane[_ngcontent-%COMP%], .aq-shell--resizing[_ngcontent-%COMP%] .aq-artifact-pane[_ngcontent-%COMP%]{transition:none}.aq-shell[data-mode=split][_ngcontent-%COMP%] .aq-builder-pane[_ngcontent-%COMP%]{display:none}.aq-artifact-pane[_ngcontent-%COMP%]{position:relative;overflow:hidden;flex:1 1 60%;display:flex;flex-direction:column;min-width:0;background:#fff;animation:_ngcontent-%COMP%_aq-slide-in .22s ease}@keyframes _ngcontent-%COMP%_aq-slide-in{0%{transform:translate(16px);opacity:0}to{transform:translate(0);opacity:1}}.aq-artifact-pane--dsl-only[_ngcontent-%COMP%]{position:absolute;top:0;left:-9999px;width:1px;height:1px;overflow:hidden;pointer-events:none;animation:none}.aq-artifact-pane[_ngcontent-%COMP%]{view-transition-name:aq-artifact-pane}.aq-artifact-pane[_ngcontent-%COMP%]:has(nile-drawer.dsl-editor-drawer[open]){view-transition-name:none}@supports (view-transition-name: none){.aq-detail-overlay[_ngcontent-%COMP%]{animation:none}}.aq-artifact-pane__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;height:var(--aq-header-h, 56px);padding:0 20px;border-bottom:1px solid #eaecf0;background:#fff;flex-shrink:0;gap:12px}.aq-artifact-pane__header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;flex-shrink:0}.aq-artifact-pane__footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;padding:12px 16px;border-top:1px solid #eaecf0;background:#fff;flex-shrink:0}.aq-library-pane__head[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;box-sizing:border-box;padding:12px 20px 16px;border-bottom:1px solid #eaecf0;flex-shrink:0;background:var(--nile-color-bg-subtle, #fbfbfd)}.aq-library-pane__intro[_ngcontent-%COMP%]{margin:0;font-size:13px;line-height:20px;color:var(--ng-colors-text-tertiary-600, #535862)}.aq-library-pane__intro-title[_ngcontent-%COMP%]{font-weight:600;color:var(--ng-colors-text-secondary-700, #414651)}.aq-library-pane__body[_ngcontent-%COMP%]{flex:1 1 auto;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none;padding:20px;display:flex;flex-direction:column;gap:16px;background:var(--nile-color-bg-subtle, #fbfbfd)}.aq-library-pane__body[_ngcontent-%COMP%]::-webkit-scrollbar{width:0;height:0}.aq-artifact-pane__picker-overlay-footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:12px;box-sizing:border-box;padding:10px 16px;border-top:1px solid #eaecf0;background:#fff;flex-shrink:0}.aq-artifact-pane__picker-overlay-footer-count[_ngcontent-%COMP%]{margin-right:auto;font-size:13px;font-weight:500;color:#414651}.aq-artifact-pane__titles[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;display:flex;align-items:baseline;gap:8px}.aq-artifact-pane__title[_ngcontent-%COMP%]{flex-shrink:0;font-weight:600;font-size:14px;color:#101828}.aq-artifact-pane__subtitle[_ngcontent-%COMP%]{min-width:0;font-weight:400;font-size:13px;color:#667085;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-filters-pill[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;height:32px;padding:0 10px;border:1px solid #d0d5dd;border-radius:8px}.aq-filters-pill__icon[_ngcontent-%COMP%]{color:#667085;flex-shrink:0}.aq-filters-pill[_ngcontent-%COMP%] nile-slide-toggle[_ngcontent-%COMP%]{--slide-toggle-width: auto;font-size:13px;font-weight:500;color:#344054}.aq-filters-pill.aq-filters-pill--active[_ngcontent-%COMP%]{border-color:var(--nile-color-primary-300, #84adff);background:var(--nile-color-primary-50, #eff4ff)}.aq-filters-pill.aq-filters-pill--active[_ngcontent-%COMP%] .aq-filters-pill__icon[_ngcontent-%COMP%]{color:var(--nile-color-primary-700, #2970ff)}.aq-filters-pill.aq-filters-pill--active[_ngcontent-%COMP%] nile-slide-toggle[_ngcontent-%COMP%]{color:var(--nile-color-primary-700, #2970ff)}.aq-undo-redo-group[_ngcontent-%COMP%]{display:flex;align-items:stretch;height:32px;border:1px solid #d0d5dd;border-radius:8px;overflow:hidden;background:#fff}.aq-undo-redo-group[_ngcontent-%COMP%] nile-button[_ngcontent-%COMP%]::part(base){height:100%!important;border:none!important;border-radius:0!important;padding:0 12px!important;font-size:13px!important;font-weight:500!important;color:#101828!important}.aq-undo-redo-group[_ngcontent-%COMP%] nile-button[_ngcontent-%COMP%]:first-child::part(base){border-right:1px solid #eaecf0!important}.aq-undo-redo-group[_ngcontent-%COMP%] nile-button[_ngcontent-%COMP%]:last-child::part(base){padding:0 10px!important}.aq-artifact-pane__header-divider[_ngcontent-%COMP%]{width:1px;height:20px;background:#eaecf0;flex-shrink:0}.aq-artifact-pane__body[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto;scrollbar-width:none;-ms-overflow-style:none;display:flex;flex-direction:column;gap:16px;background:var(--nile-color-bg-subtle, #fbfbfd)}.aq-artifact-pane__body[_ngcontent-%COMP%]::-webkit-scrollbar{width:0;height:0}.aq-artifact-pane__suggestions[_ngcontent-%COMP%]{flex-shrink:0;padding:10px 16px;border-bottom:1px solid #eaecf0;background:#fafafa}.aq-artifact-pane__suggestions-list[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;overflow-x:auto}.aq-suggestion-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border:1px solid #d5d7da;border-radius:999px;background:#fff;font-size:12px;font-weight:500;color:#414651;cursor:pointer;white-space:nowrap;transition:border-color .15s,color .15s}.aq-suggestion-chip[_ngcontent-%COMP%]:hover{border-color:#2970ff;color:#2970ff}.aq-artifact-pane__empty[_ngcontent-%COMP%]{flex:1 1 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:32px 16px;text-align:center;color:#717680}.aq-artifact-pane__empty-title[_ngcontent-%COMP%]{margin:4px 0 0;font-size:14px;font-weight:600;color:#414651}.aq-artifact-pane__empty-sub[_ngcontent-%COMP%]{margin:0;font-size:13px;max-width:320px}.aq-artifact-pane__kpi-picker[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.aq-picker-chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;align-content:start}.aq-picker-chips[_ngcontent-%COMP%] nile-skeleton-loader[_ngcontent-%COMP%]{flex:0 0 auto}.aq-picker-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;border:1px solid #e9eaeb;border-radius:999px;padding:5px 10px;background:#fff;cursor:pointer;font:inherit;font-size:12px;font-weight:600;color:#71798d;white-space:nowrap;transition:border-color .15s,box-shadow .15s}.aq-picker-chip[_ngcontent-%COMP%]:hover{border-color:#1d4ed8;box-shadow:0 4px 14px #1d4ed81a}.aq-picker-chip--active[_ngcontent-%COMP%]{background:#1d4ed8;border-color:#1d4ed8;color:#fff}.aq-picker-chip--active[_ngcontent-%COMP%]:hover{box-shadow:none}.aq-picker-chip--active[_ngcontent-%COMP%] .aq-picker-chip__count[_ngcontent-%COMP%]{background:#ffffff40;color:#fff}.aq-picker-chip__count[_ngcontent-%COMP%]{min-width:16px;padding:0 5px;border-radius:999px;background:#f2f4f7;color:#667085;font-size:10px;font-weight:700;text-align:center}.inline-widget[_ngcontent-%COMP%]{margin-top:10px;border:1px solid #e9eaeb;border-radius:14px;background:#fff;overflow:hidden;box-shadow:0 1px 2px #1018280a,0 4px 14px #1018280f}.inline-widget__chart[_ngcontent-%COMP%]{height:380px;padding:14px 16px 6px}.inline-widget__chart--kpi[_ngcontent-%COMP%]{height:150px}.inline-widget__chart--kpi-spark[_ngcontent-%COMP%]{height:220px}.inline-widget__chart--grid[_ngcontent-%COMP%]{height:auto;max-height:520px;overflow:auto}.inline-widget__chart[_ngcontent-%COMP%] shared-nile-chart-widget[_ngcontent-%COMP%]{display:block;height:100%;width:100%}.inline-widget__chart--grid[_ngcontent-%COMP%] shared-nile-chart-widget[_ngcontent-%COMP%]{height:auto}.inline-widget__actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:10px;padding:10px 16px 14px;border-top:1px solid #f2f2f4}.chart-live[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:500;color:#414651;white-space:nowrap}.chart-live__dot[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%;background:#17b26a}.chart-live--preview[_ngcontent-%COMP%]{padding:2px 8px;border-radius:4px;background:#fff6ed;color:#b93815}.forecast-meta[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:4px 18px;padding:10px 14px;border-top:1px solid #f2f2f4;background:#fcfcfd;font-size:11px;line-height:1.5}.forecast-meta__item[_ngcontent-%COMP%]{display:inline-flex;gap:4px;white-space:nowrap}.forecast-meta__label[_ngcontent-%COMP%]{color:#717680}.forecast-meta__value[_ngcontent-%COMP%]{color:#414651;font-weight:600}.forecast-record[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:12px;padding-top:10px;border-top:1px solid #f2f2f4}.forecast-record__icon[_ngcontent-%COMP%]{flex:0 0 auto}.forecast-record__text[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;font-size:12px;line-height:1.5;color:#717680}.forecast-record__action[_ngcontent-%COMP%]{flex:0 0 auto;padding:4px 10px;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;font:inherit;font-size:12px;font-weight:600;color:#5925dc;transition:background .15s ease,border-color .15s ease}.forecast-record__action[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#d9d0fd;background:#f7f5ff}.forecast-record__action[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.follow-ups[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.follow-up[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border:1px solid #e9eaeb;border-radius:8px;background:#fff;cursor:pointer;font:inherit;font-size:13px;font-weight:500;color:#414651;transition:border-color .15s ease,background .15s ease}.follow-up[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#b2ccff;background:#f9fafb}.follow-up[_ngcontent-%COMP%]:disabled{opacity:.55;cursor:default}.follow-up__icon[_ngcontent-%COMP%]{flex:0 0 auto}.follow-up__label[_ngcontent-%COMP%]{white-space:nowrap}.follow-up__badge[_ngcontent-%COMP%]{padding:2px 6px;border-radius:4px;background:#7a5af8;color:#fff;font-size:9px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.follow-up--ai[_ngcontent-%COMP%]{border-color:#d9d0fd;background:#f7f5ff;color:#5925dc}.follow-up--ai[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#b9a6fb;background:#f0ecff}.widget-header-btn[_ngcontent-%COMP%]{position:relative;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;margin:0 2px;box-sizing:border-box;border:none;border-radius:6px;background:transparent;color:#717680;cursor:pointer}.widget-header-btn[_ngcontent-%COMP%]:hover{background:#f5f5f6;color:#181d27}.widget-header-dropdown[_ngcontent-%COMP%]::part(panel){width:320px;max-width:92vw}.widget-header-dropdown[_ngcontent-%COMP%]::part(base){display:block}.widget-header-anchor[_ngcontent-%COMP%]{display:inline-block;width:0;height:0}.widget-menu__trigger[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;margin:0 2px;box-sizing:border-box;border:none;border-radius:var(--ng-radius-md, 6px);background:transparent;color:var(--ng-colors-text-tertiary-600, #717680);cursor:pointer}.widget-menu__trigger[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-secondary, #f5f5f6);color:var(--ng-colors-text-primary-900, #181d27)}.widget-menu__label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%}.widget-menu__label[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{flex:none;color:var(--ng-colors-text-tertiary-600, #717680)}.widget-menu__sep[_ngcontent-%COMP%]{height:var(--ng-stroke-width-1, 1px);background:var(--ng-colors-border-secondary, #e5e7eb);margin:var(--ng-spacing-md, 8px)}.type-picker__panel[_ngcontent-%COMP%], .filter-builder__panel[_ngcontent-%COMP%]{background:#fff;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 8px 24px #10182824;padding:10px;box-sizing:border-box}.inline-action__loading[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:8px;min-height:56px;font-size:13px;color:#535862}.inline-action__hint[_ngcontent-%COMP%]{margin:0 0 6px;font-size:12px;color:#535862}.inline-action__error[_ngcontent-%COMP%]{margin:6px 0 0;font-size:12px;color:#d92d20}.type-picker__section[_ngcontent-%COMP%]{margin:6px 0 4px;font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:#717680}.type-picker__section[_ngcontent-%COMP%]:first-child{margin-top:0}.type-picker__grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.type-picker__tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px 4px;box-sizing:border-box;height:60px;border:1px solid #e9eaeb;border-radius:8px;background:#fff;color:#414651;font-size:11px;font-weight:500;cursor:pointer}.type-picker__tile[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:#717680}.type-picker__tile[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#2970ff;color:#2970ff}.type-picker__tile[_ngcontent-%COMP%]:hover:not(:disabled) nile-glyph[_ngcontent-%COMP%]{color:#2970ff}.type-picker__tile[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.type-picker__tile--sensible[_ngcontent-%COMP%]{border-color:#2970ff47;background:#2970ff0a}.type-picker__tile--sensible[_ngcontent-%COMP%] nile-glyph[_ngcontent-%COMP%]{color:#2970ff}.filter-builder__active[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}.filter-builder__chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:999px;background:#2970ff14;color:#414651;font-size:12px}.filter-builder__chip-remove[_ngcontent-%COMP%]{display:inline-flex;border:none;background:none;padding:0;cursor:pointer;color:inherit}.filter-builder__form[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.filter-builder__field-label[_ngcontent-%COMP%]{padding:6px 2px;font-size:12px;font-weight:600;color:#181d27}.filter-builder__and[_ngcontent-%COMP%]{font-size:12px;color:#535862}.filter-builder__select[_ngcontent-%COMP%], .filter-builder__input[_ngcontent-%COMP%]{flex:1 1 100%;min-width:0;padding:7px 8px;box-sizing:border-box;border:1px solid #e9eaeb;border-radius:7px;background:#fff;font:inherit;font-size:12px;color:#181d27}.filter-builder__multi[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;max-height:160px;overflow-y:auto;width:100%}.filter-builder__multi-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:4px 2px;font-size:12px;color:#414651;cursor:pointer}.filter-builder__multi-item[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aq-shell[data-mode=builder][_ngcontent-%COMP%] .aq-chat-pane[_ngcontent-%COMP%]{flex:0 0 auto;flex-basis:clamp(320px,41%,485px);max-width:50%;margin:0}.aq-builder-pane[_ngcontent-%COMP%]{position:relative;overflow:hidden;flex:1 1 60%;display:flex;flex-direction:column;min-width:0}.aq-builder-pane[_ngcontent-%COMP%] shared-builder-host[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0}.aq-builder-pane[_ngcontent-%COMP%] shared-dashboard-grid{display:block;min-width:calc(100cqw - 24px)}.aq-shell--fullscreen[data-mode=builder][_ngcontent-%COMP%] .aq-chat-pane[_ngcontent-%COMP%]{flex-basis:0;max-width:0;overflow:hidden;border-right:none}.aq-shell--fullscreen[data-mode=builder][_ngcontent-%COMP%] .aq-builder-pane[_ngcontent-%COMP%]{flex-basis:100%}.aq-shell--fullscreen[data-mode=builder][_ngcontent-%COMP%] .aq-builder-pane[_ngcontent-%COMP%] shared-dashboard-grid{min-width:100%}.choice-picker[_ngcontent-%COMP%]{margin-top:16px;width:100%}.choice-picker[_ngcontent-%COMP%] + .choice-picker[_ngcontent-%COMP%]{margin-top:22px}.choice-picker__group[_ngcontent-%COMP%]{display:block;width:100%}.choice-picker__step[_ngcontent-%COMP%]{display:block;margin-bottom:4px;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--ng-colors-text-tertiary-600, #98a2b3)}.choice-picker__submit-row[_ngcontent-%COMP%]{margin-top:12px;display:flex;justify-content:flex-start}.choice-card[_ngcontent-%COMP%]{display:block}.choice-card[_ngcontent-%COMP%]::part(base){width:100%;box-sizing:border-box;margin:0;padding:12px 14px;gap:0;align-items:center;border:none;border-bottom:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:8px;background:transparent;cursor:pointer;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease}.choice-card[_ngcontent-%COMP%]:last-of-type::part(base){border-bottom:none}.choice-card[_ngcontent-%COMP%]::part(control){display:none}.choice-card[_ngcontent-%COMP%]::part(label){flex:1 1 auto;min-width:0;margin:0}.choice-card[_ngcontent-%COMP%]:not(.choice-card--locked):hover::part(base){border-color:var(--ng-colors-border-brand, #7f56d9);background:var(--ng-colors-bg-brand-primary, #f9f5ff)}.choice-card--chosen[_ngcontent-%COMP%]::part(base){border-color:var(--ng-colors-border-brand, #7f56d9);background:var(--ng-colors-bg-brand-primary, #f9f5ff);box-shadow:inset 0 0 0 1px var(--ng-colors-border-brand, #7f56d9)}.choice-card--locked[_ngcontent-%COMP%]:not(.choice-card--chosen)::part(base){opacity:.6;cursor:default}.choice-card__label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;min-width:0}.choice-card__num[_ngcontent-%COMP%]{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:6px;font-size:11.5px;font-weight:700;color:var(--ng-colors-text-tertiary-600, #667085);background:var(--ng-colors-bg-secondary, #f5f5f6);transition:color .15s ease,background-color .15s ease}.choice-card--chosen[_ngcontent-%COMP%] .choice-card__num[_ngcontent-%COMP%]{color:#fff;background:var(--ng-colors-bg-brand-solid, #7f56d9)}.choice-card__text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;min-width:0}.choice-card__name[_ngcontent-%COMP%]{font-size:13.5px;font-weight:600;color:var(--ng-colors-text-primary-900, #181d27);line-height:1.4;overflow-wrap:anywhere}.choice-card__hint[_ngcontent-%COMP%]{font-size:12.5px;font-weight:400;line-height:1.4;color:var(--ng-colors-text-tertiary-600, #535862)}.choice-card__meta[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:10px;margin-top:1px;font-size:11.5px;color:var(--ng-colors-text-tertiary-600, #535862)}.choice-card__chip--green[_ngcontent-%COMP%]{color:#22c55e;font-weight:700}.choice-card__chip--yellow[_ngcontent-%COMP%]{color:#f59e0b;font-weight:700}.choice-card__chip--red[_ngcontent-%COMP%]{color:#ef4444;font-weight:700}.choice-card__chip--muted[_ngcontent-%COMP%]{color:var(--ng-colors-text-tertiary-600, #98a2b3)}.choice-picker__empty[_ngcontent-%COMP%]{margin:0;font-size:12.5px;color:var(--ng-colors-text-tertiary-600, #535862)}.choice-picker__chat-link[_ngcontent-%COMP%]{appearance:none;display:inline-flex;align-items:center;gap:4px;margin:6px 0 0;padding:0;border:none;border-radius:0;background:none;font-size:12.5px;color:var(--ng-colors-brand-600, #4f46e5);cursor:pointer;text-align:left}.choice-picker__chat-link[_ngcontent-%COMP%]:hover:not(:disabled){text-decoration:underline}.choice-picker__chat-link[_ngcontent-%COMP%]:disabled{color:var(--ng-colors-text-tertiary-600, #98a2b3);cursor:default}.choice-picker__chat-link--preview[_ngcontent-%COMP%]{gap:6px;padding:5px 10px;border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:999px;color:var(--ng-colors-text-secondary-700, #414651)}.choice-picker__chat-link--preview[_ngcontent-%COMP%]:hover:not(:disabled){text-decoration:none;border-color:var(--ng-colors-border-brand, #7f56d9);color:var(--ng-colors-brand-600, #4f46e5);background:var(--ng-colors-bg-brand-primary, #f9f5ff)}.choice-picker__chat-link--preview[_ngcontent-%COMP%]:disabled{border-color:var(--ng-colors-border-secondary, #e9eaeb)}.choice-picker__footer-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;margin-top:6px}.choice-picker__footer-actions[_ngcontent-%COMP%] .choice-picker__chat-link[_ngcontent-%COMP%]{margin-top:0}.choice-picker__chat-draft[_ngcontent-%COMP%]{margin-top:8px;padding:10px;border:1px dashed var(--ng-colors-border-secondary-600, #d0d5dd);border-radius:8px;background:var(--ng-colors-bg-secondary-600, #f9fafb)}.choice-picker__chat-draft-label[_ngcontent-%COMP%]{display:block;margin-bottom:6px;font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--ng-colors-text-tertiary-600, #98a2b3)}.choice-picker__chat-draft-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px}.choice-picker__chat-draft-input[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0}.ai-executive-summary[_ngcontent-%COMP%]::part(trigger){display:none}']})};var Ql=(i,t)=>t.id;function Yl(i,t){if(i&1&&(l(0,"div",9),m(1,"div",12),l(2,"span"),p(3),d()()),i&2){let e=r();s(3),P(e.copy().loadingConnections)}}function Kl(i,t){if(i&1){let e=w();l(0,"div",10)(1,"div",13),m(2,"nile-glyph",14),d(),l(3,"h3",15),p(4),d(),l(5,"p",16),p(6),d(),l(7,"button",7),g("click",function(){_(e);let o=r();return u(o.openForm())}),m(8,"nile-glyph",8),p(9),d()()}if(i&2){let e=r();s(4),P(e.copy().noConnectionsTitle),s(2),P(e.copy().noConnectionsSub),s(3),T(" ",e.copy().registerConnectionButton," ")}}function Jl(i,t){i&1&&(l(0,"span",23),p(1,"Active"),d())}function Xl(i,t){i&1&&(l(0,"span",24),p(1,"Inactive"),d())}function Zl(i,t){i&1&&(l(0,"span",25),m(1,"nile-glyph",34),p(2," Schema "),d())}function es(i,t){i&1&&m(0,"span",28)}function ts(i,t){i&1&&m(0,"nile-glyph",29)}function ns(i,t){i&1&&m(0,"span",28)}function is(i,t){i&1&&m(0,"nile-glyph",31)}function os(i,t){if(i&1&&(l(0,"span",37),p(1),d()),i&2){let e=r(3).$implicit;s(),J("",e.testResult.sampleTables.slice(0,4).join(", "),"",e.testResult.sampleTables.length>4?"\u2026":"")}}function as(i,t){if(i&1&&(m(0,"nile-glyph",36),l(1,"span"),p(2),d(),f(3,os,2,2,"span",37)),i&2){let e=r(2).$implicit;s(2),T("Reachable \xB7 ",e.testResult.tableCount," tables"),s(),C(e.testResult.sampleTables.length?3:-1)}}function rs(i,t){if(i&1&&(m(0,"nile-glyph",38),l(1,"span"),p(2),d()),i&2){let e=r(2).$implicit,n=r(2);s(2),T("Unreachable \xB7 ",e.testResult.error??n.copy().errors.connectionTestFailedFallback)}}function ls(i,t){if(i&1&&(l(0,"div",35),f(1,as,4,2)(2,rs,3,1),d()),i&2){let e=r().$implicit;B("wfconn-test-result--ok",e.testResult.reachable)("wfconn-test-result--fail",!e.testResult.reachable),s(),C(e.testResult.reachable?1:2)}}function ss(i,t){if(i&1){let e=w();l(0,"div",18)(1,"div",19)(2,"div",20)(3,"span",21),p(4),d(),l(5,"span",22),p(6),d(),f(7,Jl,2,0,"span",23)(8,Xl,2,0,"span",24),f(9,Zl,3,0,"span",25),d(),l(10,"div",26)(11,"button",27),g("click",function(){let o=_(e).$implicit,a=r(2);return u(a.testConnection(o.id))}),f(12,es,1,0,"span",28)(13,ts,1,0,"nile-glyph",29),p(14),d(),l(15,"button",30),g("click",function(){let o=_(e).$implicit,a=r(2);return u(a.deleteConnection(o.id,o.name))}),f(16,ns,1,0,"span",28)(17,is,1,0,"nile-glyph",31),d()()(),l(18,"div",32),p(19),Tt(20,"date"),d(),f(21,ls,3,5,"div",33),d()}if(i&2){let e=t.$implicit,n=r(2);B("wfconn-card--deleting",e.deleting),s(4),P(e.name),s(2),P(n.adapterLabel(e.adapterType)),s(),C(e.isActive?7:8),s(2),C(e.hasSchemaSnapshot?9:-1),s(2),B("wfconn-icon-btn--loading",e.testing),v("disabled",e.testing||e.deleting),s(),C(e.testing?12:13),s(2),T(" ",n.copy().testConnectionButton," "),s(),v("disabled",e.testing||e.deleting),s(),C(e.deleting?16:17),s(3),T(" Created ",Ft(20,15,e.createdAt,"mediumDate")," "),s(2),C(e.testResult?21:-1)}}function ds(i,t){if(i&1&&(l(0,"div",11),O(1,ss,22,18,"div",17,Ql),d()),i&2){let e=r();s(),D(e.connections())}}function cs(i,t){if(i&1){let e=w();l(0,"div",46)(1,"label",47),p(2,"Server"),d(),l(3,"input",60),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchMssql("server",o))}),d()(),l(4,"div",46)(5,"label",47),p(6,"Database"),d(),l(7,"input",61),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchMssql("database",o))}),d()(),l(8,"div",62)(9,"div",46)(10,"label",47),p(11,"Username"),d(),l(12,"input",63),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchMssql("user",o))}),d()(),l(13,"div",46)(14,"label",47),p(15,"Password"),d(),l(16,"div",64)(17,"input",65),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchMssql("password",o))}),d(),l(18,"button",66),g("click",function(){_(e);let o=r(2);return u(o.showPassword.update(a=>!a))}),m(19,"nile-glyph",67),d()()()(),l(20,"div",62)(21,"div",46)(22,"label",47),p(23,"Schema"),d(),l(24,"input",68),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchMssql("schema",o))}),d()(),l(25,"div",69)(26,"label",47),p(27,"Port"),d(),l(28,"input",70),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchMssql("port",+o))}),d()()()}if(i&2){let e=r(2);s(3),v("ngModel",e.mssql().server),s(4),v("ngModel",e.mssql().database),s(5),v("ngModel",e.mssql().user),s(5),v("type",e.showPassword()?"text":"password")("ngModel",e.mssql().password),s(2),F("name",e.showPassword()?"ng-eye-off":"ng-eye"),s(5),v("ngModel",e.mssql().schema),s(4),v("ngModel",e.mssql().port)}}function ps(i,t){if(i&1){let e=w();l(0,"div",46)(1,"label",47),p(2,"URL"),d(),l(3,"input",71),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchOpensearch("url",o))}),d()(),l(4,"div",62)(5,"div",46)(6,"label",47),p(7,"Username"),d(),l(8,"input",72),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchOpensearch("username",o))}),d()(),l(9,"div",46)(10,"label",47),p(11,"Password"),d(),l(12,"div",64)(13,"input",65),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchOpensearch("password",o))}),d(),l(14,"button",66),g("click",function(){_(e);let o=r(2);return u(o.showPassword.update(a=>!a))}),m(15,"nile-glyph",67),d()()()()}if(i&2){let e=r(2);s(3),v("ngModel",e.opensearch().url),s(5),v("ngModel",e.opensearch().username),s(5),v("type",e.showPassword()?"text":"password")("ngModel",e.opensearch().password),s(2),F("name",e.showPassword()?"ng-eye-off":"ng-eye")}}function _s(i,t){if(i&1){let e=w();l(0,"div",62)(1,"div",46)(2,"label",47),p(3,"Host"),d(),l(4,"input",73),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchPostgres("host",o))}),d()(),l(5,"div",69)(6,"label",47),p(7,"Port"),d(),l(8,"input",74),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchPostgres("port",+o))}),d()()(),l(9,"div",46)(10,"label",47),p(11,"Database"),d(),l(12,"input",61),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchPostgres("database",o))}),d()(),l(13,"div",62)(14,"div",46)(15,"label",47),p(16,"Username"),d(),l(17,"input",75),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchPostgres("user",o))}),d()(),l(18,"div",46)(19,"label",47),p(20,"Password"),d(),l(21,"div",64)(22,"input",65),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchPostgres("password",o))}),d(),l(23,"button",66),g("click",function(){_(e);let o=r(2);return u(o.showPassword.update(a=>!a))}),m(24,"nile-glyph",67),d()()()(),l(25,"div",46)(26,"label",47),p(27,"Schema"),d(),l(28,"input",76),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchPostgres("schema",o))}),d()()}if(i&2){let e=r(2);s(4),v("ngModel",e.postgres().host),s(4),v("ngModel",e.postgres().port),s(4),v("ngModel",e.postgres().database),s(5),v("ngModel",e.postgres().user),s(5),v("type",e.showPassword()?"text":"password")("ngModel",e.postgres().password),s(2),F("name",e.showPassword()?"ng-eye-off":"ng-eye"),s(4),v("ngModel",e.postgres().schema)}}function us(i,t){if(i&1){let e=w();l(0,"div",46)(1,"label",47),p(2,"Account"),d(),l(3,"input",77),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchSnowflake("account",o))}),d()(),l(4,"div",62)(5,"div",46)(6,"label",47),p(7,"Database"),d(),l(8,"input",78),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchSnowflake("database",o))}),d()(),l(9,"div",46)(10,"label",47),p(11,"Schema"),d(),l(12,"input",79),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchSnowflake("schema",o))}),d()()(),l(13,"div",46)(14,"label",47),p(15,"Warehouse"),d(),l(16,"input",80),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchSnowflake("warehouse",o))}),d()(),l(17,"div",62)(18,"div",46)(19,"label",47),p(20,"Username"),d(),l(21,"input",81),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchSnowflake("user",o))}),d()(),l(22,"div",46)(23,"label",47),p(24,"Password"),d(),l(25,"div",64)(26,"input",65),g("ngModelChange",function(o){_(e);let a=r(2);return u(a.patchSnowflake("password",o))}),d(),l(27,"button",66),g("click",function(){_(e);let o=r(2);return u(o.showPassword.update(a=>!a))}),m(28,"nile-glyph",67),d()()()()}if(i&2){let e=r(2);s(3),v("ngModel",e.snowflake().account),s(5),v("ngModel",e.snowflake().database),s(4),v("ngModel",e.snowflake().schema),s(4),v("ngModel",e.snowflake().warehouse),s(5),v("ngModel",e.snowflake().user),s(5),v("type",e.showPassword()?"text":"password")("ngModel",e.snowflake().password),s(2),F("name",e.showPassword()?"ng-eye-off":"ng-eye")}}function gs(i,t){if(i&1&&(l(0,"div",56),m(1,"nile-glyph",38),p(2),d()),i&2){let e=r(2);s(2),T(" ",e.formError()," ")}}function ms(i,t){if(i&1&&(m(0,"span",82),p(1)),i&2){let e=r(2);s(),T(" ",e.copy().registeringButton," ")}}function hs(i,t){if(i&1&&(m(0,"nile-glyph",83),p(1)),i&2){let e=r(2);s(),T(" ",e.copy().registerAndTestButton," ")}}function fs(i,t){if(i&1){let e=w();l(0,"div",39),g("click",function(){_(e);let o=r();return u(o.closeForm())}),d(),l(1,"aside",40)(2,"div",41)(3,"span",42),p(4),d(),l(5,"button",43),g("click",function(){_(e);let o=r();return u(o.closeForm())}),m(6,"nile-glyph",44),d()(),l(7,"div",45)(8,"div",46)(9,"label",47),p(10,"Connection name"),d(),l(11,"input",48),g("ngModelChange",function(o){_(e);let a=r();return u(a.formConnectionName.set(o))}),d()(),l(12,"div",46)(13,"label",47),p(14,"Display name "),l(15,"span",49),p(16,"(optional)"),d()(),l(17,"input",48),g("ngModelChange",function(o){_(e);let a=r();return u(a.formDisplayName.set(o))}),d()(),l(18,"div",46)(19,"label",47),p(20,"Adapter type"),d(),l(21,"select",50),g("ngModelChange",function(o){_(e);let a=r();return u(a.formAdapter.set(o))}),l(22,"option",51),p(23,"MSSQL (SQL Server)"),d(),l(24,"option",52),p(25,"OpenSearch"),d(),l(26,"option",53),p(27,"PostgreSQL"),d(),l(28,"option",54),p(29,"Snowflake"),d()()(),l(30,"div",55),p(31,"Connection config"),d(),f(32,cs,29,8),f(33,ps,16,5),f(34,_s,29,8),f(35,us,29,8),f(36,gs,3,1,"div",56),d(),l(37,"div",57)(38,"button",58),g("click",function(){_(e);let o=r();return u(o.closeForm())}),p(39),d(),l(40,"button",59),g("click",function(){_(e);let o=r();return u(o.submitRegister())}),f(41,ms,2,1)(42,hs,2,1),d()()()}if(i&2){let e=r();s(4),P(e.copy().registerConnectionTitle),s(7),v("ngModel",e.formConnectionName())("placeholder",e.copy().connectionNamePlaceholder),s(6),v("ngModel",e.formDisplayName())("placeholder",e.copy().displayNamePlaceholder),s(4),v("ngModel",e.formAdapter()),s(11),C(e.formAdapter()==="mssql"?32:-1),s(),C(e.formAdapter()==="opensearch"?33:-1),s(),C(e.formAdapter()==="postgres"?34:-1),s(),C(e.formAdapter()==="snowflake"?35:-1),s(),C(e.formError()?36:-1),s(2),v("disabled",e.saving()),s(),P(e.copy().cancelButton),s(),v("disabled",e.saving()),s(),C(e.saving()?41:42)}}var Ae=class i{svc=$(xe);copy(){return R().copy}loading=x(!0);connections=x([]);showForm=x(!1);saving=x(!1);formConnectionName=x("Primary");formDisplayName=x("");formAdapter=x("mssql");mssql=x({server:"",database:"",user:"",password:"",schema:"gold",port:1433});opensearch=x({url:"",username:"",password:""});postgres=x({host:"",port:5432,database:"",user:"",password:"",schema:"public"});snowflake=x({account:"",database:"",schema:"",user:"",password:"",warehouse:""});showPassword=x(!1);formError=x("");hasConnections=q(()=>this.connections().length>0);async ngOnInit(){await this.loadConnections()}async loadConnections(){this.loading.set(!0);try{let t=await this.svc.listConnections();this.connections.set(t)}catch{}finally{this.loading.set(!1)}}openForm(){this.showForm.set(!0),this.formError.set("")}closeForm(){this.showForm.set(!1),this.formError.set("")}patchMssql(t,e){this.mssql.update(n=>S(b({},n),{[t]:e}))}patchOpensearch(t,e){this.opensearch.update(n=>S(b({},n),{[t]:e}))}patchPostgres(t,e){this.postgres.update(n=>S(b({},n),{[t]:e}))}patchSnowflake(t,e){this.snowflake.update(n=>S(b({},n),{[t]:e}))}buildConfig(){switch(this.formAdapter()){case"mssql":return b({},this.mssql());case"opensearch":return b({},this.opensearch());case"postgres":return b({},this.postgres());case"snowflake":return b({},this.snowflake())}}async submitRegister(){let t=this.formConnectionName().trim();if(!t){this.formError.set("Connection name is required");return}let e={productId:this.svc.productId,displayName:this.formDisplayName().trim()||void 0,connectionName:t,config:this.buildConfig()};this.saving.set(!0),this.formError.set("");try{let n=await this.svc.register(e),o={id:n.connection.id,name:n.connection.name,adapterType:n.connection.adapterType,isActive:!0,hasSchemaSnapshot:n.test.reachable,hasSemanticDoc:!1,createdAt:n.connection.createdAt,updatedAt:n.connection.createdAt,testResult:n.test};this.connections.update(a=>[o,...a]),this.closeForm(),this.showToast("success",n.test.reachable?`Connection "${t}" registered and tested successfully`:`Connection "${t}" registered (connectivity test failed: ${n.test.error??"unreachable"})`)}catch(n){this.formError.set(this.extractMessage(n,"Registration failed"))}finally{this.saving.set(!1)}}async testConnection(t){this.connections.update(e=>e.map(n=>n.id===t?S(b({},n),{testing:!0,testResult:void 0}):n));try{let e=await this.svc.testConnection(t);this.connections.update(n=>n.map(o=>o.id===t?S(b({},o),{testing:!1,testResult:e}):o))}catch{this.connections.update(e=>e.map(n=>n.id===t?S(b({},n),{testing:!1}):n))}}async deleteConnection(t,e){if(confirm(`Delete connection "${e}"? This cannot be undone.`)){this.connections.update(n=>n.map(o=>o.id===t?S(b({},o),{deleting:!0}):o));try{await this.svc.deleteConnection(t),this.connections.update(n=>n.filter(o=>o.id!==t)),this.showToast("success",`Connection "${e}" deleted`)}catch{this.connections.update(n=>n.map(o=>o.id===t?S(b({},o),{deleting:!1}):o))}}}adapterLabel(t){return{mssql:"MSSQL",opensearch:"OpenSearch",postgres:"PostgreSQL",snowflake:"Snowflake"}[t]??t}showToast(t,e){let n=document.createElement("nile-toast");n.variant=t,n.title=e,n.duration=5e3,n.closable=!0,n.toast(),Ee()}extractMessage(t,e){return Ie(t,e)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ge({type:i,selectors:[["app-ask-aquera-connections-page"]],decls:18,vars:5,consts:[[1,"wfconn-page"],[1,"wfconn-header"],[1,"wfconn-header__left"],["routerLink","/ask-aquera",1,"wfconn-back"],["name","ng-arrow-left","method","stroke","size","14","color","#344054"],[1,"wfconn-header__sep"],[1,"wfconn-header__title"],[1,"wfconn-btn","wfconn-btn--primary",3,"click"],["name","ng-plus","method","stroke","size","13","color","#fff"],[1,"wfconn-loading"],[1,"wfconn-empty"],[1,"wfconn-list"],[1,"wfconn-spinner"],[1,"wfconn-empty__icon"],["name","ng-dataflow-03","method","stroke","size","32","color","#98a2b3"],[1,"wfconn-empty__title"],[1,"wfconn-empty__sub"],[1,"wfconn-card",3,"wfconn-card--deleting"],[1,"wfconn-card"],[1,"wfconn-card__header"],[1,"wfconn-card__info"],[1,"wfconn-card__name"],[1,"wfconn-badge","wfconn-badge--adapter"],[1,"wfconn-badge","wfconn-badge--active"],[1,"wfconn-badge","wfconn-badge--inactive"],[1,"wfconn-badge","wfconn-badge--schema"],[1,"wfconn-card__actions"],["title","Test connectivity",1,"wfconn-icon-btn",3,"click","disabled"],[1,"wfconn-spinner","wfconn-spinner--sm"],["name","ng-activity","method","stroke","size","14"],["title","Delete connection",1,"wfconn-icon-btn","wfconn-icon-btn--danger",3,"click","disabled"],["name","ng-trash-01","method","stroke","size","14"],[1,"wfconn-card__meta"],[1,"wfconn-test-result",3,"wfconn-test-result--ok","wfconn-test-result--fail"],["name","ng-check","method","stroke","size","10"],[1,"wfconn-test-result"],["name","ng-check-circle","method","stroke","size","13"],[1,"wfconn-test-result__tables"],["name","ng-alert-circle","method","stroke","size","13"],[1,"wfconn-form-overlay",3,"click"],[1,"wfconn-form-panel"],[1,"wfconn-form-panel__header"],[1,"wfconn-form-panel__title"],[1,"wfconn-form-close",3,"click"],["name","ng-x","method","stroke","size","16"],[1,"wfconn-form-panel__body"],[1,"wfconn-field"],[1,"wfconn-label"],["type","text",1,"wfconn-input",3,"ngModelChange","ngModel","placeholder"],[1,"wfconn-label--opt"],[1,"wfconn-select",3,"ngModelChange","ngModel"],["value","mssql"],["value","opensearch"],["value","postgres"],["value","snowflake"],[1,"wfconn-divider"],[1,"wfconn-form-error"],[1,"wfconn-form-panel__footer"],[1,"wfconn-btn","wfconn-btn--secondary",3,"click","disabled"],[1,"wfconn-btn","wfconn-btn--primary",3,"click","disabled"],["type","text","placeholder","server.database.windows.net",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","my_database",1,"wfconn-input",3,"ngModelChange","ngModel"],[1,"wfconn-field-row"],["type","text","placeholder","sa",1,"wfconn-input",3,"ngModelChange","ngModel"],[1,"wfconn-input-wrap"],["placeholder","\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",1,"wfconn-input",3,"ngModelChange","type","ngModel"],["type","button",1,"wfconn-input-toggle",3,"click"],["method","stroke","size","14"],["type","text","placeholder","gold",1,"wfconn-input",3,"ngModelChange","ngModel"],[1,"wfconn-field","wfconn-field--sm"],["type","number","placeholder","1433",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","https://my-cluster.us-east-1.es.amazonaws.com",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","admin",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","localhost",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","number","placeholder","5432",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","postgres",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","public",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","myorg-myaccount",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","MY_DB",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","PUBLIC",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","COMPUTE_WH",1,"wfconn-input",3,"ngModelChange","ngModel"],["type","text","placeholder","myuser",1,"wfconn-input",3,"ngModelChange","ngModel"],[1,"wfconn-spinner","wfconn-spinner--sm","wfconn-spinner--white"],["name","ng-activity","method","stroke","size","13","color","#fff"]],template:function(e,n){e&1&&(l(0,"section",0)(1,"header",1)(2,"div",2)(3,"a",3),m(4,"nile-glyph",4),l(5,"span"),p(6),d()(),l(7,"span",5),p(8,"/"),d(),l(9,"span",6),p(10),d()(),l(11,"button",7),g("click",function(){return n.openForm()}),m(12,"nile-glyph",8),p(13),d()(),f(14,Yl,4,1,"div",9)(15,Kl,10,3,"div",10)(16,ds,3,0,"div",11),f(17,fs,43,15),d()),e&2&&(s(6),P(n.copy().connectionsBreadcrumbHome),s(4),P(n.copy().connectionsTitle),s(3),T(" ",n.copy().registerConnectionButton," "),s(),C(n.loading()?14:!n.hasConnections()&&!n.showForm()?15:16),s(3),C(n.showForm()?17:-1))},dependencies:[Be,Le,We,Ve,Ne,$e,Re,ze,Bt,Dt],styles:[".wfconn-page[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:#f9fafb}.wfconn-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:14px 24px;background:#fff;border-bottom:1px solid #e4e7ec;flex-shrink:0}.wfconn-header__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.wfconn-back[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;color:#344054;font-size:13px;text-decoration:none;font-weight:500}.wfconn-back[_ngcontent-%COMP%]:hover{color:#101828}.wfconn-header__sep[_ngcontent-%COMP%]{color:#d0d5dd;font-size:16px}.wfconn-header__title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:#101828}.wfconn-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:8px;font-size:13px;font-weight:500;border:none;cursor:pointer;transition:opacity .15s}.wfconn-btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.wfconn-btn--primary[_ngcontent-%COMP%]{background:#2970ff;color:#fff}.wfconn-btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:#1d5fd9}.wfconn-btn--secondary[_ngcontent-%COMP%]{background:#fff;color:#344054;border:1px solid #d0d5dd}.wfconn-btn--secondary[_ngcontent-%COMP%]:hover:not(:disabled){background:#f9fafb}.wfconn-icon-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:6px 10px;border-radius:6px;font-size:12px;font-weight:500;border:1px solid #d0d5dd;background:#fff;color:#344054;cursor:pointer;transition:background .15s}.wfconn-icon-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:#f2f4f7}.wfconn-icon-btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.wfconn-icon-btn--danger[_ngcontent-%COMP%]{color:#b42318}.wfconn-icon-btn--danger[_ngcontent-%COMP%]:hover:not(:disabled){background:#fff1f0;border-color:#f97066}.wfconn-loading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:40px 24px;color:#667085;font-size:14px}.wfconn-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;gap:12px;padding:64px 24px;text-align:center}.wfconn-empty__icon[_ngcontent-%COMP%]{width:56px;height:56px;border-radius:12px;background:#f2f4f7;display:flex;align-items:center;justify-content:center}.wfconn-empty__title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#101828;margin:0}.wfconn-empty__sub[_ngcontent-%COMP%]{font-size:14px;color:#667085;margin:0;max-width:380px}.wfconn-list[_ngcontent-%COMP%]{padding:20px 24px;display:flex;flex-direction:column;gap:12px;overflow-y:auto;flex:1}.wfconn-card[_ngcontent-%COMP%]{background:#fff;border:1px solid #e4e7ec;border-radius:10px;padding:16px 18px;transition:opacity .15s}.wfconn-card--deleting[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}.wfconn-card__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:12px}.wfconn-card__info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.wfconn-card__name[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:#101828}.wfconn-card__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-shrink:0}.wfconn-card__meta[_ngcontent-%COMP%]{margin-top:8px;font-size:12px;color:#98a2b3}.wfconn-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:4px;font-size:11px;font-weight:500}.wfconn-badge--adapter[_ngcontent-%COMP%]{background:#f2f4f7;color:#344054}.wfconn-badge--active[_ngcontent-%COMP%]{background:#ecfdf3;color:#027a48}.wfconn-badge--inactive[_ngcontent-%COMP%]{background:#fff1f0;color:#b42318}.wfconn-badge--schema[_ngcontent-%COMP%]{background:#eff8ff;color:#175cd3}.wfconn-test-result[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin-top:10px;padding:8px 10px;border-radius:6px;font-size:12px;font-weight:500}.wfconn-test-result--ok[_ngcontent-%COMP%]{background:#ecfdf3;color:#027a48}.wfconn-test-result--fail[_ngcontent-%COMP%]{background:#fff1f0;color:#b42318}.wfconn-test-result__tables[_ngcontent-%COMP%]{color:inherit;opacity:.7;font-weight:400;margin-left:4px}.wfconn-spinner[_ngcontent-%COMP%]{width:18px;height:18px;border:2px solid #e4e7ec;border-top-color:#2970ff;border-radius:50%;animation:_ngcontent-%COMP%_wfconn-spin .7s linear infinite}.wfconn-spinner--sm[_ngcontent-%COMP%]{width:12px;height:12px;border-width:1.5px}.wfconn-spinner--white[_ngcontent-%COMP%]{border-color:#ffffff4d;border-top-color:#fff}@keyframes _ngcontent-%COMP%_wfconn-spin{to{transform:rotate(360deg)}}.wfconn-form-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;background:#00000040;z-index:200}.wfconn-form-panel[_ngcontent-%COMP%]{position:fixed;top:0;right:0;bottom:0;width:440px;max-width:95vw;background:#fff;border-left:1px solid #e4e7ec;display:flex;flex-direction:column;z-index:201;box-shadow:-4px 0 24px #00000014}.wfconn-form-panel__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #e4e7ec;flex-shrink:0}.wfconn-form-panel__title[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:#101828}.wfconn-form-close[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;color:#667085;padding:4px;border-radius:4px;display:flex}.wfconn-form-close[_ngcontent-%COMP%]:hover{background:#f2f4f7;color:#344054}.wfconn-form-panel__body[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:14px}.wfconn-form-panel__footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:14px 20px;border-top:1px solid #e4e7ec;flex-shrink:0}.wfconn-divider[_ngcontent-%COMP%]{font-size:11px;font-weight:600;color:#98a2b3;text-transform:uppercase;letter-spacing:.06em;padding:4px 0 2px;border-bottom:1px solid #f2f4f7}.wfconn-field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:5px;flex:1}.wfconn-field--sm[_ngcontent-%COMP%]{max-width:100px}.wfconn-field-row[_ngcontent-%COMP%]{display:flex;gap:12px;align-items:flex-start}.wfconn-label[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:#344054}.wfconn-label--opt[_ngcontent-%COMP%]{font-weight:400;color:#98a2b3}.wfconn-input[_ngcontent-%COMP%], .wfconn-select[_ngcontent-%COMP%]{height:36px;padding:0 10px;border:1px solid #d0d5dd;border-radius:6px;font-size:13px;color:#101828;background:#fff;width:100%;box-sizing:border-box;outline:none;transition:border-color .15s}.wfconn-input[_ngcontent-%COMP%]:focus, .wfconn-select[_ngcontent-%COMP%]:focus{border-color:#2970ff;box-shadow:0 0 0 3px #2970ff1a}.wfconn-input[_ngcontent-%COMP%]::placeholder, .wfconn-select[_ngcontent-%COMP%]::placeholder{color:#b0b7c3}.wfconn-select[_ngcontent-%COMP%]{cursor:pointer}.wfconn-input-wrap[_ngcontent-%COMP%]{position:relative;display:flex}.wfconn-input-wrap[_ngcontent-%COMP%] .wfconn-input[_ngcontent-%COMP%]{padding-right:36px}.wfconn-input-toggle[_ngcontent-%COMP%]{position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:none;cursor:pointer;color:#98a2b3;padding:0;display:flex}.wfconn-input-toggle[_ngcontent-%COMP%]:hover{color:#344054}.wfconn-form-error[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:8px 10px;background:#fff1f0;border-radius:6px;color:#b42318;font-size:12px}"]})};function xs(i,t){i&1&&m(0,"app-ask-aquera-connections-page")}function bs(i,t){i&1&&m(0,"app-ask-aquera-page")}function ys(i,t){if(i&1&&f(0,xs,1,0,"app-ask-aquera-connections-page")(1,bs,1,0,"app-ask-aquera-page"),i&2){let e,n=r();C(((e=n.config())==null||e.initial==null?null:e.initial.view)==="connections"?0:1)}}var Ye=class i{config=qt(void 0);ready=qe({alias:"aq-ready"});error=qe({alias:"aq-error"});unauthorized=qe({alias:"aq-unauthorized"});host=$(Pt);stopAdopting=null;stopUi=null;tokenTimer=null;configured=!1;constructor(){Te(()=>{let t=this.config();t&&this.apply(t)}),queueMicrotask(()=>{let t=this.host.nativeElement.shadowRoot;t&&(this.stopAdopting=yt(t))})}async apply(t){let e=t.auth;if(lt({baseUrl:t.api.baseUrl,mcpUrl:t.api.mcpUrl,adminApiUrl:t.api.adminApiUrl,utilitiesUrl:t.api.utilitiesUrl,tokenizedOrigins:t.api.tokenizedOrigins,headers:t.api.headers,customerId:t.tenant.customerId??null,productId:t.tenant.productId,productName:t.tenant.productName??null,authMode:e.mode,authToken:e.mode==="token"?e.token:null,getToken:e.mode==="callback"?e.getToken:null,onUnauthorized:()=>this.unauthorized.emit(),features:t.features,ui:t.ui,copy:t.copy,routing:t.routing,initial:{dashboardId:t.initial?.dashboardId??null,conversationId:t.initial?.conversationId??null}}),this.stopUi?.(),this.stopUi=vt(this.host.nativeElement,t.ui),jt(t.api.baseUrl),$t(t.api,e),Qt({productId:t.tenant.productId,name:t.tenant.productName}),Ht(()=>this.unauthorized.emit()),await Ue(),e.mode==="callback"&&!this.tokenTimer&&(this.tokenTimer=setInterval(()=>{Ue()},6e4)),!this.configured){this.configured=!0;let n=R();this.ready.emit({customerId:n.customerId??"",productId:n.productId??""})}}ngOnDestroy(){this.stopAdopting?.(),this.stopUi?.(),this.tokenTimer&&clearInterval(this.tokenTimer)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ge({type:i,selectors:[["dvz-ask-root"]],inputs:{config:[1,"config"]},outputs:{ready:"aq-ready",error:"aq-error",unauthorized:"aq-unauthorized"},decls:1,vars:1,template:function(e,n){e&1&&f(0,ys,2,1),e&2&&C(n.config()?0:-1)},dependencies:[Ae,Pe],styles:[`:host{display:block;height:100%}
|
|
18
|
-
`],encapsulation:3,changeDetection:0})};Rt();var vs="dvz-ask";function ws(i={}){return Vt(Ye,vs,[kt(),Ut([]),Gt(),Et(It([Yt])),{provide:Kt,useFactory:()=>R().baseUrl},{provide:wn,useValue:"workforce/dashboards"},Oe(pe)],i)}ws();export{vs as a,ws as b};
|