@aquera/data-visualizer-sdk 0.0.14 → 0.0.16

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.
@@ -0,0 +1,18 @@
1
+ import{$ as rn,A as jt,Aa as Ue,B as Yt,Ba as Ge,Ca as He,D as Qt,Da as je,Ea as xn,F as se,Fa as rt,G as Kt,Ga as bn,Ha as yn,I as be,Ia as vn,Ja as wn,Ka as kn,L as Jt,M as Xt,N as Zt,Na as Pn,Oa as An,P as Ie,Pa as Mn,Qa as Sn,R as en,Ra as de,Sa as Tn,T as tn,U as nn,V as Ve,W as on,X as ye,Xa as lt,Y as ot,Z as at,Za as Fn,_ as an,a as vt,aa as ln,b as wt,bb as Dn,ca as sn,cb as st,d as It,da as dn,db as On,ea as cn,f as Vt,fa as _n,ga as pn,ha as un,i as le,ia as Re,j as xe,ja as gn,k as Rt,ka as mn,l as zt,la as hn,ma as Cn,n as Nt,na as fn,o as it,p as $t,pa as ze,q as Lt,ra as Ne,s as Wt,v as ee,w as Bt,wa as $e,x as Ut,xa as Le,y as Gt,ya as We,z as Ht,za as Be}from"./chunk-O6T6EAR2.js";import{Ab as k,Eb as g,Gb as r,Ja as et,Jb as St,Ka as Oe,Kb as pe,La as s,Lb as ue,N as he,Ob as oe,Pb as Z,Qb as B,Rb as tt,S as $,Sb as _,Tb as v,Ub as F,Vb as Q,Wb as Tt,X as p,Y as u,ab as Ce,ac as Ft,bc as re,cc as nt,dc as Dt,ea as kt,fb as fe,fc as Ot,gc as qe,ha as Pt,ia as x,kb as Mt,kc as qt,la as Pe,lb as A,lc as q,mb as h,nb as C,ob as Y,oc as Ee,p as V,pa as At,pc as Et,qb as D,rb as O,sb as b,tb as l,ub as d,vb as m,zb as _e}from"./chunk-U4S2XPPP.js";import{a as y,b as T,d as De}from"./chunk-ZW5NV4UO.js";function qn(){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,welcomePrompts:!0,dashboardsMenu:!0,executiveSummary:!0,alerts:!0,library:!0},ui:{theme:"light",density:"comfortable",header:!0,locale:"en"},copy:ui(),routing:"none",initial:{dashboardId:null,conversationId:null}}}function ui(){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",searchConversationsPlaceholder:"Search conversations\u2026",searchDashboardsPlaceholder:"Search dashboards\u2026",noResultsMatchFilters:"No results match your filters",renameLabel:"Rename",deleteLabel:"Delete",groupToday:"Today",groupYesterday:"Yesterday",groupPrevious7Days:"Previous 7 days",groupOlder:"Older",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.",couldntDeleteDashboard:"Couldn't delete that dashboard. Please try again.",couldntGenerateSummary:"Failed to generate summary.",couldntSaveDashboard:"Couldn't save the dashboard. Please try again.",chartTypeChangeFailed:"Chart type change failed"}}}var En=Lt("dvz-ask",qn);function R(){return En.read()}function dt(i){let t=qn(),e=T(y(y({},t),ve(i)),{features:y(y({},t.features),ve(i.features??{})),ui:y(y({},t.ui),ve(i.ui??{})),copy:T(y(y({},t.copy),ve(i.copy??{})),{errors:y(y({},t.copy.errors),ve(i.copy?.errors??{}))}),initial:y(y({},t.initial),ve(i.initial??{})),headers:y(y({},t.headers),i.headers??{})});return i.tokenizedOrigins||(e.tokenizedOrigins=[e.baseUrl,e.adminApiUrl,e.mcpUrl,e.utilitiesUrl,e.proxyUrl].filter(n=>!!n)),En.write(e)}async function Ye(){return Wt(R())}function In(i,t){return i.replace("{n}",String(t))}function ve(i){let t={};for(let[e,n]of Object.entries(i))n!==void 0&&(t[e]=n);return t}var ge=class i{http=$(xe);tokenStore=$(se);get customerId(){return R().customerId??this.tokenStore.tenantId()??""}async fetchGridPage(t,e,n,o,a,c,f,w){let M=`${R().baseUrl}/api/customers/${this.customerId}/products/${be()}/workforce/data-grid/${t}?pageIndex=${e}&pageSize=${n}`,S=(o??[]).filter(P=>P&&P.value!=null&&String(P.value).trim()!=="");return S.length&&(M+=`&filters=${encodeURIComponent(JSON.stringify(S))}`),a&&Object.keys(a).length&&(M+=`&dashboardFilters=${encodeURIComponent(JSON.stringify(a))}`),f&&f.length&&(M+=`&resolvedFilters=${encodeURIComponent(JSON.stringify(f))}`),c&&(M+=`&dashboardId=${encodeURIComponent(c)}`),w&&(M+=`&conversationId=${encodeURIComponent(w)}`),V(this.http.get(M))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=he({token:i,factory:i.\u0275fac,providedIn:"root"})};var ct=["image/png","image/jpeg","image/webp","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"],Vn=10*1024*1024,_t=1,pt=10,gi=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"];function ut(i,t){return gi.includes(t)||/\.(xls|xlsx)$/i.test(i)}var we=class i{http=$(xe);tokenStore=$(se);lastSentCustomerId=null;lastSentProductId=null;get customerId(){return R().customerId??this.tokenStore.tenantId()??""}get productId(){return R().productId??be()}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=y({},n);o!==this.lastSentCustomerId&&(c.customerId=o),a!==this.lastSentProductId&&(c.productId=a);let f;try{f=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(M){throw M instanceof le?new Error(M.error?.error?.message||M.error?.message||M.message):M}if(f.error)throw new Error(f.error.message);let w=f.result;if(w?.isError)throw new Error(w.structuredContent?.error?.message??w.content?.[0]?.text??`${t} failed`);return w?.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 f=await V(this.http.get(`${this.baseUrl}/conversations/${t}`));if(!f?.data)return null;let a=f.data,{messages:w}=a;return{conversation:De(a,["messages"]),messages:w??[]}}let e=await this.callMcpTool("getConversation",{conversationId:t});if(!e?.conversation)return null;let c=e.conversation,{messages:n}=c;return{conversation:De(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,f,w){return c?.length||!R().features.mcpGateway?this.streamChatViaSse(t,e,n,o,a,c,f,w):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 f=Date.now(),w=new URL(this.mcpGatewayUrl());w.searchParams.set("customerId",this.customerId),w.searchParams.set("productId",this.productId);let M=this.tokenStore.accessToken()??"",S=!1,P=!1,z=I=>{switch(S=!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??""),P=!0;return}let E=I?.structuredContent??{};if(!S){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??""),P=!0},K=I=>{if(I.method==="notifications/gateway/stream"){z(I.params??{});return}if(I.id===f){if(I.error){n.onError(I.error.message??"askAquera failed"),n.onFinish("error",t??""),P=!0;return}X(I.result)}},U;try{U=await fetch(w.toString(),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream",Authorization:`Bearer ${M}`},body:JSON.stringify({jsonrpc:"2.0",id:f,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}K(I);return}let ce=U.body.getReader(),N=new TextDecoder,J="";for(;;){let{done:I,value:E}=await ce.read();if(I)break;J+=N.decode(E,{stream:!0});let L=J.split(`
2
+
3
+ `);J=L.pop()??"";for(let G of L){let H=G.split(`
4
+ `).find(W=>W.startsWith("data:"));if(H){try{K(JSON.parse(H.slice(5).trim()))}catch{}if(P)return}}}P||(n.onError("Stream ended unexpectedly"),n.onFinish("error",t??""))}async streamChatViaSse(t,e,n,o,a,c,f,w){let M=this.tokenStore.accessToken()??"",S=`${this.baseUrl}/v1/conversations/chat`,P={message:e};t&&(P.conversationId=t),o&&(P.connectionId=o),c?.length&&(P.attachments=c),f&&(P.isPipeline=!0),w&&(P.dashboardId=w);let z=await fetch(S,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${M}`},body:JSON.stringify(P),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(),K=new TextDecoder,U="";for(;;){let{done:j,value:ce}=await X.read();if(j)break;U+=K.decode(ce,{stream:!0});let N=U.split(`
5
+ `);U=N.pop()??"";for(let J of N){let I=J.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 le?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 le?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 le?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 le?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(w=>!!w.id).map(w=>({widgetId:w.id})),c;try{c=await V(this.http.post(`${this.baseUrl}/dashboards/${t}/filter/suggest?status=${o}`,{query:e,refreshCache:!1,widgets:a}))}catch(w){throw w instanceof le?new Error(w.error?.error||w.message):w}if(c?.success===!1)throw new Error(c.error||"Request failed");let f=c?.data??{completions:[],suggestions:[]};return{nextToken:f.nextToken,completions:Array.isArray(f.completions)?f.completions:[],suggestions:Array.isArray(f.suggestions)?f.suggestions:[]}}async applyFilters(t,e,n,o="draft",a,c){let f=await new Promise((X,K)=>{let U=this.http.post(`${this.baseUrl}/dashboards/${n}/filter/apply?status=${o}`,An(t,e,c)).subscribe({next:j=>X(j),error:j=>{K(j instanceof le?new Error(j.error?.error||j.message):j)}});if(a){if(a.aborted){U.unsubscribe();let j=new Error("Aborted");j.name="AbortError",K(j);return}a.addEventListener("abort",()=>{U.unsubscribe();let j=new Error("Aborted");j.name="AbortError",K(j)},{once:!0})}});if(f?.success===!1)throw new Error(f.error||"Request failed");let w=f?.data??f,M=Array.isArray(w)?w:w?.widgets;if(!Array.isArray(M))throw new Error("Invalid response from apply-filters API");let S=!Array.isArray(w)&&Array.isArray(w?.resolvedFilters)?w.resolvedFilters:[],P=!Array.isArray(w)&&typeof w?.filterExplanation=="string"?w.filterExplanation:typeof f?.filterExplanation=="string"?f.filterExplanation:null,z=P&&P.trim()?P.trim():null;return{widgets:M,resolvedFilters:S,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 w=await a.text().catch(()=>a.statusText);throw new Error(`Upload failed (${a.status}): ${w}`)}let c=await a.json().catch(()=>null),f=c?.data?.key??c?.key;if(!f)throw new Error("Upload failed: malformed response");return{key:f}}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(S){e.onError(S instanceof Error?S.message:"Network error");return}if(!a.ok){let S=await a.json().catch(()=>null);e.onError(S?.error??`Request failed (${a.status})`);return}if(!a.body){e.onError("No response body received");return}let c=a.body.getReader(),f=new TextDecoder,w="",M=S=>{let P=S.trim();if(!P)return;let z;try{z=JSON.parse(P)}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:S,value:P}=await c.read();if(S)break;w+=f.decode(P,{stream:!0});let z=w.split(`
6
+ `);w=z.pop()??"";for(let X of z)M(X)}w.trim()&&M(w)}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=De(a,["published"]);return R().features.mcpGateway?(await this.callMcpTool("createDashboard",y(y({},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 updateDashboard(t,e){await V(this.http.put(`${this.baseUrl}/dashboards/${t}?published=false`,e))}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=he({token:i,factory:i.\u0275fac,providedIn:"root"})};function Rn({hasMessages:i,artifactOpen:t,builderOpen:e}){return t?"split":e?"builder":i?"conversation":"idle"}function zn(i,t,e){let n=e||"Working",o=i.map(c=>c.id==="thinking"&&c.status==="running"?T(y({},c),{status:"done"}):c),a=o.findIndex(c=>c.status==="running"&&c.baseLabel===n);if(a>=0){let c=o[a],f=[...o];return f[a]=T(y({},c),{callIds:[...c.callIds,t],pending:c.pending+1}),f}return[...o,{id:t,callIds:[t],pending:1,baseLabel:n,label:n,status:"running"}]}function Nn(i,t,e,n){return i.map(o=>{if(!o.callIds.includes(t))return o;let a=Math.max(0,o.pending-1);return T(y({},o),{pending:a,detail:n?o.detail:e||o.detail,status:a===0?"done":o.status})})}function gt(i){let{finishReason:t,sawError:e,producedContent:n}=i;return t==="error"?!0:t==null?e:e&&!n}var $n=i=>T(y({},i),{isStreaming:!1,thinking:void 0,hasError:!0});function Ln(i,t,e){return i.some(n=>n.id===t)?i.map(n=>n.id===t?$n(n):n):[...i,$n(e(t))]}var Qe=class i{http=$(xe);tokenStore=$(se);get customerId(){return R().customerId??this.tokenStore.tenantId()??""}get productId(){return R().productId??be()}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=he({token:i,factory:i.\u0275fac,providedIn:"root"})};var mi=[/\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],hi=[/\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],Ci={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}},fi=[[/\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 mt(i,t,e=new Date){let n=(i??"").trim();if(!n)return null;let o=hi.some(f=>f.test(n)),a=xi(n,mi);if(!a&&!o)return null;let c=bi(n);return{extendsExisting:o,metric:yi(n,t),horizon:vi(n,c??t.defaults.granularity,e),granularity:c,trigger:a||"refers to an existing chart"}}function xi(i,t){for(let e of t){let n=e.exec(i);if(n)return n[0]}return""}function bi(i){for(let[t,e]of fi)if(t.test(i))return e}function yi(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 vi(i,t,e){let n=Ci[t],o=/\bnext\s+(\d+)\s+(weeks?|months?|quarters?|years?)\b/i.exec(i);if(o){let f=Number(o[1]),w=o[2].toLowerCase().replace(/s$/,"");return Math.max(1,Math.round(f*n[w]))}let a=/\bnext\s+(week|month|quarter|year)\b/i.exec(i);if(a){let f=a[1].toLowerCase();return Math.max(1,n[f])}if(/\b(?:by|through)\s+(?:year[-\s]?end|end\s+of\s+(?:the\s+)?year|EOY)\b/i.test(i))return wi(t,e);let c=/\bby\s+Q([1-4])\b/i.exec(i);if(c)return ki(t,Number(c[1]),e)}function wi(i,t){let e=12-(t.getMonth()+1);return Math.max(1,Wn(e,i))}function ki(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,Wn(a,i))}function Wn(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 Pi=new Set(["line","area","spline","areaspline"]),ht="(?:jan|feb|mar|apr|may|jun|jul|aug|sep|sept|oct|nov|dec)[a-z]*",ne="(?:19|20)\\d{2}",Bn="(?:0?[1-9]|[12]\\d|3[01])",Ct="(?:0?[1-9]|1[0-2])",Ai=[new RegExp(`^${ne}[-/.]${Ct}(?:[-/.]${Bn})?$`,"i"),new RegExp(`^${Bn}[-/.]${Ct}[-/.]${ne}$`,"i"),new RegExp(`^${Ct}[-/.]${ne}$`,"i"),new RegExp(`^${ne}-?w\\d{1,2}$`,"i"),new RegExp(`^w(?:ee)?k\\s*\\d{1,2}[,\\s]+${ne}$`,"i"),new RegExp(`^${ht}[\\s-]*'?\\d{2}$`,"i"),new RegExp(`^${ht}[\\s-]*${ne}$`,"i"),new RegExp(`^${ne}[\\s-]*${ht}$`,"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 Mi(i){let t=(i??[]).map(n=>String(n??"").trim()).filter(Boolean);return t.length<3?!1:t.filter(n=>Ai.some(o=>o.test(n))).length/t.length>=.8}var Si=[/forecast/i,/confidence/i,/project/i,/upper|lower/i,/band/i,/target/i],Gn=3;function Ke(i){return i?.config?.chart??i?.chart??{}}function Hn(i){let t=Ke(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=Ke(i),e=String(t?.type??"").toLowerCase();if(!Pi.has(e))return!1;let n=Ti(i);if(!n||n.values.length<Gn)return!1;let o=Kn(t);return o.length?Mi(o):!!n.times?.length}function Ti(i){let t=Ke(i),e=Qn(t);if(!e.length)return null;let n=e.find(o=>!Jn(o.name))??e[0];return Yn(t,n)}function jn(i){let t=Ke(i),e=Qn(t).filter(o=>!Jn(o.name)),n=[];return e.forEach((o,a)=>{let c=Yn(t,o);c&&n.push(T(y({},c),{name:o.name||(e.length>1?`Series ${a+1}`:"")}))}),n}function Yn(i,t){let e=Di(t.data),n=e.map(c=>c.value);if(n.length<Gn)return null;let o=e.every(c=>c.time!==void 0)?e.map(c=>c.time):void 0,a=Kn(i).slice(0,n.length);return y({labels:a.length===n.length?a:o?o.map(c=>Fi(c)):n.map((c,f)=>String(f+1)),values:n},o?{times:o}:{})}function Fi(i){return new Date(i).toLocaleDateString("en-US",{month:"short",year:"numeric"})}function Qn(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 Kn(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 Jn(i){return Si.some(t=>t.test(i))}function Di(i){let t=[];for(let e of i){let n=Oi(e);if(n===null)break;t.push(n)}return t}function Oi(i){if(typeof i=="number"&&Number.isFinite(i))return{value:i};if(Array.isArray(i)&&i.length===2&&typeof i[1]=="number")return y({value:i[1]},typeof i[0]=="number"?{time:i[0]}:{});if(i&&typeof i=="object"&&typeof i.y=="number"){let t=i;return y({value:t.y},typeof t.x=="number"?{time:t.x}:{})}return null}var xt={Weekly:{Weekly:1,Monthly:4,Quarterly:13,Yearly:52},Monthly:{Monthly:1,Quarterly:3,Yearly:12},Quarterly:{Quarterly:1,Yearly:4},Yearly:{Yearly:1}},ft={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"}},Un=4;function qi(i,t,e){let n=xt[t]?.[e];return n?Math.max(1,Math.floor(i/n)):null}function Xn(i,t,e){return e.map(n=>{let o=ft[n]??ft.Monthly,a=qi(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 ${ft[i]?.adjective??i.toLowerCase()}`}:a<Un?{value:n,enabled:!1,fittedPeriods:a,maxHorizon:0,label:o,reason:`only ${a} ${a===1?o.singular:o.plural} of history, needs at least ${Un}`}:{value:n,enabled:!0,fittedPeriods:a,maxHorizon:Math.max(1,Math.floor(a/2)),label:o}})}function Zn(i,t,e,n){if(t===e)return Math.max(1,Math.min(i,n));let o=xt[t]?.[e],a=xt[e]?.[t],c=o?i/o:a?i*a:i;return Math.max(1,Math.min(Math.round(c),n))}var Ei="#2970FF",ei="#7A5AF8";var ti={Weekly:6048e5,Monthly:26298e5,Quarterly:78894e5,Yearly:315576e5},ni={Weekly:"Week",Monthly:"Month",Quarterly:"Quarter",Yearly:"Year"};function Ii(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 ii(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 oi(i,t){let e=ti[i.granularity]??ti.Monthly,n=Ii(i.history,e),o=n[n.length-1]??Date.now(),a=i.forecastTimes?.length===t.length?i.forecastTimes:t.map((P,z)=>Math.round(o+(z+1)*e)),c=t.length>0,f=[...n.map(P=>ii(P,i.granularity)),...c?a.map(P=>ii(P,i.granularity)):[]],w=(i.series?.length??0)>1,M=w?i.series.map(P=>y({name:P.note?`${P.name} \xB7 ${P.note}`:P.name,actual:P.values},P.points?.length?{projected:P.points.map(z=>z.value),interval:P.points.map(z=>[z.low,z.high])}:{})):[y({name:"Actuals",color:Ei,actual:i.history.values},c?{projected:t.map(P=>P.value),interval:t.map(P=>[P.low,P.high])}:{})],S={type:"line",enableForecasting:!0,categories:f,data:M,lineWidth:2,showMarkers:!1,valueSuffix:i.valueSuffix??"",xAxisTitle:ni[i.granularity]??ni.Monthly,projection:T(y({start:null},w?{}:{color:ei}),{dashStyle:"Dash",showNowLine:!0,nowLabel:"",bandLabel:"Projected",interval:T(y({name:`${i.confidence}% confidence`},w?{}:{color:ei}),{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:S},queryMeta:{sql:`-- forecast:${i.metric}`}}}function bt(i,t=[]){let e=i.guardrails?.passed?i.points??[]:[],n=e[e.length-1],o=y({horizon:i.horizon,confidence:i.confidence,granularity:i.granularity},n?{value:n.value,low:n.low,high:n.high}:{}),a=e.length?Me(i.narrative,o):i.guardrails?.body?`I can't forecast this reliably. ${i.guardrails.body}`:"I can't forecast this series.",c=Vi(i,t),f=i.skipped??[],w=(i.meta??[]).map(M=>({label:M.label,value:Me(M.value,o)}));return f.length&&c.length>1&&w.push({label:"Series",value:`${c.length-f.length} of ${c.length} forecast \u2014 ${f.map(M=>M.name).join(", ")} left as history`}),{chart:Ri(i,e,c),answer:a,meta:w,points:e,horizon:i.horizon,granularity:i.granularity,confidence:i.confidence,maxHorizon:i.maxHorizon}}function Vi(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 f=o.get(n(c.name));f?.values?.length&&a.push({name:c.name,values:f.values,note:"not forecast"})}return a}function Ri(i,t,e=[]){return oi(e.length?T(y({},i),{series:e}):i,t)}function Me(i,t){return String(i??"").replace(/\{\{(\w+)\}\}/g,(e,n)=>n in t?String(t[n]):e)}function yt(i){if(i.forecast||i.isStreaming||i.charts?.length!==1)return!1;let t=i.charts[0]?.config;return Hn(t)?!1:Je(t)}var Ni=["aqChat"],$i=["artifactGrid"],Li=["composerEl"],Wi=["aiExecutiveSummary"],Bi=()=>[1,2,3,4],ke=()=>[],li=i=>({$implicit:i}),te=(i,t)=>t.id,ie=(i,t)=>t.key,Ui=(i,t)=>t.templateId,si=(i,t)=>t.label,di=(i,t)=>t.component,Gi=(i,t)=>t.name,Xe=(i,t)=>t.value,Hi=(i,t)=>t.action;function ji(i,t){if(i&1){let e=k();l(0,"button",30),g("click",function(){p(e);let o=r();return u(o.addReplyQuote())}),m(1,"nile-glyph",31),_(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),F(" ",n.copy().replyButton," ")}}function Yi(i,t){if(i&1){let e=k();l(0,"nile-nav-tab-group",57),g("nile-tab-change",function(o){p(e);let a=r(2);return u(a.setChatPaneTab(o.detail.value))}),l(1,"nile-nav-tab",58),_(2),d(),l(3,"nile-nav-tab",59),_(4),d()()}if(i&2){let e=r(2);A("value",e.chatPaneTab()),s(2),v(e.copy().chatTabLabel),s(2),v(e.copy().libraryTabLabel)}}function Qi(i,t){if(i&1){let e=k();l(0,"span",35),m(1,"nile-glyph",60),l(2,"span",61),_(3),d(),l(4,"button",62),g("click",function(){p(e);let o=r(2);return u(o.clearScope())}),m(5,"nile-glyph",63),d()()}if(i&2){let e=t;s(),b("name",e.kind==="dataset"?"ng-database":"ng-dataflow-04"),s(2),Q("",e.kind==="dataset"?"Dataset":"Pipeline",": ",e.name)}}function Ki(i,t){i&1&&(l(0,"div",45),m(1,"nile-skeleton-loader",64)(2,"nile-skeleton-loader",65),d())}function Ji(i,t){i&1&&m(0,"nile-glyph",69)}function Xi(i,t){if(i&1){let e=k();l(0,"nile-menu-item",67),g("click",function(){let o=p(e).$implicit,a=r(3);return u(a.selectScope("dataset",o))}),l(1,"span",68),_(2),d(),h(3,Ji,1,0,"nile-glyph",69),d()}if(i&2){let e,n=t.$implicit,o=r(3);s(2),v(n.name),s(),C(((e=o.selectedScope())==null?null:e.id)===n.id?3:-1)}}function Zi(i,t){if(i&1&&(l(0,"div",66),_(1),d()),i&2){let e=r(3);s(),v(e.copy().noDatasetsFound)}}function eo(i,t){if(i&1&&D(0,Xi,4,2,"nile-menu-item",null,te,!1,Zi,2,1,"div",66),i&2){let e=r(2);O(e.datasets())}}function to(i,t){i&1&&(l(0,"div",45),m(1,"nile-skeleton-loader",64)(2,"nile-skeleton-loader",65),d())}function no(i,t){i&1&&m(0,"nile-glyph",69)}function io(i,t){if(i&1){let e=k();l(0,"nile-menu-item",67),g("click",function(){let o=p(e).$implicit,a=r(3);return u(a.selectScope("pipeline",o))}),l(1,"span",68),_(2),d(),h(3,no,1,0,"nile-glyph",69),d()}if(i&2){let e,n=t.$implicit,o=r(3);s(2),v(n.name),s(),C(((e=o.selectedScope())==null?null:e.id)===n.id?3:-1)}}function oo(i,t){if(i&1&&(l(0,"div",66),_(1),d()),i&2){let e=r(3);s(),v(e.copy().noPipelinesFound)}}function ao(i,t){if(i&1&&D(0,io,4,2,"nile-menu-item",null,te,!1,oo,2,1,"div",66),i&2){let e=r(2);O(e.pipelines())}}function ro(i,t){if(i&1&&(l(0,"nile-menu-item",70)(1,"div",71),m(2,"nile-skeleton-loader",72),l(3,"div",73),m(4,"nile-skeleton-loader",74)(5,"nile-skeleton-loader",75),d()()()),i&2){let e=t.$implicit;s(3),Z("max-width",e,"px")}}function lo(i,t){if(i&1&&D(0,ro,6,2,"nile-menu-item",70,Y),i&2){let e=r(2);O(e.menuSkeletonRows)}}function so(i,t){if(i&1&&(l(0,"div",54),_(1),d()),i&2){let e=r(2);s(),v(e.copy().noResultsMatchFilters)}}function co(i,t){if(i&1){let e=k();l(0,"input",84),g("ngModelChange",function(o){p(e);let a=r(5);return u(a.renameDraft.set(o))})("click",function(o){return o.stopPropagation()})("keydown.enter",function(o){p(e);let a=r().$implicit,c=r(4);return u(c.commitRenameConversation(o,a))})("keydown.escape",function(o){p(e);let a=r(5);return u(a.cancelRename(o))})("blur",function(o){p(e);let a=r().$implicit,c=r(4);return u(c.commitRenameConversation(o,a))}),d()}if(i&2){let e=r(5);b("ngModel",e.renameDraft())}}function _o(i,t){if(i&1&&(l(0,"span",85),_(1),d(),l(2,"span",86),_(3),d()),i&2){let e=r().$implicit,n=r(4);b("title",e.title||"Untitled"),s(),v(e.title||"Untitled"),s(2),v(n.conversationMeta(e))}}function po(i,t){if(i&1){let e=k();l(0,"nile-menu-item",67),g("click",function(){let o=p(e).$implicit,a=r(4);return u(a.selectConversation(o.id))}),l(1,"div",71),m(2,"nile-glyph",77),l(3,"div",73),h(4,co,1,1,"input",78)(5,_o,4,3),d(),l(6,"div",79)(7,"button",80),g("click",function(o){let a=p(e).$implicit,c=r(4);return u(c.startRename(o,a.id,a.title))}),m(8,"nile-glyph",81),d(),l(9,"button",82),g("click",function(o){let a=p(e).$implicit,c=r(4);return u(c.deleteConversation(o,a.id))}),m(10,"nile-glyph",83),d()()()()}if(i&2){let e=t.$implicit,n=r(4);A("active",e.id===n.activeConversationId()?"":null),s(4),C(n.renamingId()===e.id?4:5),s(3),A("aria-label",n.copy().renameLabel),s(2),A("aria-label",n.copy().deleteLabel)}}function uo(i,t){if(i&1&&(l(0,"div",76),_(1),d(),D(2,po,11,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;s(),v(e.label),s(),O(e.items)}}function go(i,t){if(i&1&&(l(0,"div",54),_(1),d()),i&2){let e=r(3);s(),v(e.copy().noConversationsYet)}}function mo(i,t){if(i&1&&D(0,uo,4,1,null,null,ie,!1,go,2,1,"div",54),i&2){let e=r(2);O(e.groupedConversations())}}function ho(i,t){if(i&1&&(l(0,"nile-menu-item",70)(1,"div",71),m(2,"nile-skeleton-loader",72),l(3,"div",73),m(4,"nile-skeleton-loader",74)(5,"nile-skeleton-loader",91),d()()()),i&2){let e=t.$implicit;s(3),Z("max-width",e,"px")}}function Co(i,t){if(i&1&&D(0,ho,6,2,"nile-menu-item",70,Y),i&2){let e=r(3);O(e.menuSkeletonRows)}}function fo(i,t){if(i&1&&(l(0,"div",54),_(1),d()),i&2){let e=r(3);s(),v(e.copy().noResultsMatchFilters)}}function xo(i,t){if(i&1){let e=k();l(0,"input",84),g("ngModelChange",function(o){p(e);let a=r(6);return u(a.renameDraft.set(o))})("click",function(o){return o.stopPropagation()})("keydown.enter",function(o){p(e);let a=r().$implicit,c=r(5);return u(c.commitRenameDashboard(o,a))})("keydown.escape",function(o){p(e);let a=r(6);return u(a.cancelRename(o))})("blur",function(o){p(e);let a=r().$implicit,c=r(5);return u(c.commitRenameDashboard(o,a))}),d()}if(i&2){let e=r(6);b("ngModel",e.renameDraft())}}function bo(i,t){if(i&1&&(l(0,"span",85),_(1),d(),l(2,"span",86),_(3),d()),i&2){let e=r().$implicit,n=r(5);b("title",e.name||"Untitled"),s(),v(e.name||"Untitled"),s(2),v(n.dashboardMeta(e))}}function yo(i,t){if(i&1){let e=k();l(0,"nile-menu-item",67),g("click",function(){let o=p(e).$implicit,a=r(5);return u(a.openRelatedDashboard(o.id))}),l(1,"div",71),m(2,"nile-glyph",92),l(3,"div",73),h(4,xo,1,1,"input",78)(5,bo,4,3),d(),l(6,"div",79)(7,"button",80),g("click",function(o){let a=p(e).$implicit,c=r(5);return u(c.startRename(o,a.id,a.name))}),m(8,"nile-glyph",81),d(),l(9,"button",82),g("click",function(o){let a=p(e).$implicit,c=r(5);return u(c.deleteDashboardFromMenu(o,a.id))}),m(10,"nile-glyph",83),d()()()()}if(i&2){let e=t.$implicit,n=r(5);A("active",n.builderOpen()&&e.id===n.builderDashboardId()?"":null),s(4),C(n.renamingId()===e.id?4:5),s(3),A("aria-label",n.copy().renameLabel),s(2),A("aria-label",n.copy().deleteLabel)}}function vo(i,t){if(i&1&&(l(0,"div",76),_(1),d(),D(2,yo,11,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;s(),v(e.label),s(),O(e.items)}}function wo(i,t){if(i&1&&(l(0,"div",54),_(1),d()),i&2){let e=r(4);s(),v(e.copy().noDashboardsYet)}}function ko(i,t){if(i&1&&D(0,vo,4,1,null,null,ie,!1,wo,2,1,"div",54),i&2){let e=r(3);O(e.groupedDashboards())}}function Po(i,t){if(i&1){let e=k();l(0,"nile-dropdown",87),g("nile-hide",function(){p(e);let o=r(2);return u(o.showRelatedDashboards.set(!1))}),l(1,"nile-lite-tooltip",88)(2,"button",89),g("click",function(){p(e);let o=r(2);return u(o.showRelatedDashboards.set(!o.showRelatedDashboards()))}),m(3,"nile-glyph",90),d()(),l(4,"nile-menu",51),g("nile-search-value",function(o){p(e);let a=r(2);return u(a.dashSearch.set((o.detail==null?null:o.detail.value)??""))}),l(5,"nile-menu-item",52),g("click",function(){p(e);let o=r(2);return u(o.openNewDashboard())}),m(6,"nile-glyph",53),_(7),d(),h(8,Co,2,0)(9,fo,2,1,"div",54)(10,ko,3,1),d()()}if(i&2){let e=r(2);b("open",e.showRelatedDashboards()),s(4),A("noResultsMessage",e.copy().noResultsMatchFilters),s(3),F(" ",e.copy().newDashboardLabel," "),s(),C(e.dashboardsLoading()?8:e.dashSearchEmpty()?9:10)}}function Ao(i,t){if(i&1){let e=k();l(0,"nile-lite-tooltip",56)(1,"button",93),g("click",function(){p(e);let o=r(2);return u(o.openGallery())}),m(2,"nile-glyph",94),d()()}}function Mo(i,t){if(i&1){let e=k();l(0,"header",12)(1,"div",32),h(2,Yi,5,3,"nile-nav-tab-group",33),d(),l(3,"div",34),h(4,Qi,6,3,"span",35),l(5,"nile-dropdown",36),g("nile-hide",function(){p(e);let o=r();return u(o.closeScopeMenu())}),l(6,"nile-lite-tooltip",37)(7,"button",38),g("click",function(){p(e);let o=r();return u(o.openScopeMenu())}),m(8,"nile-glyph",39),d()(),l(9,"nile-menu")(10,"nile-menu-item")(11,"nile-dropdown",40)(12,"span",41),m(13,"nile-glyph",42),l(14,"span",43),_(15,"Dataset"),d(),m(16,"nile-glyph",44),d(),l(17,"nile-menu"),h(18,Ki,3,0,"div",45)(19,eo,3,1),d()()(),l(20,"nile-menu-item")(21,"nile-dropdown",40)(22,"span",41),m(23,"nile-glyph",46),l(24,"span",43),_(25,"Pipeline"),d(),m(26,"nile-glyph",44),d(),l(27,"nile-menu"),h(28,to,3,0,"div",45)(29,ao,3,1),d()()()()(),l(30,"nile-dropdown",47),g("nile-hide",function(){p(e);let o=r();return u(o.showConversationPicker.set(!1))}),l(31,"nile-lite-tooltip",48)(32,"button",49),g("click",function(){p(e);let o=r();return u(o.showConversationPicker.set(!o.showConversationPicker()))}),m(33,"nile-glyph",50),d()(),l(34,"nile-menu",51),g("nile-search-value",function(o){p(e);let a=r();return u(a.convSearch.set((o.detail==null?null:o.detail.value)??""))}),l(35,"nile-menu-item",52),g("click",function(){p(e);let o=r();return u(o.newConversation())}),m(36,"nile-glyph",53),_(37),d(),h(38,lo,2,0)(39,so,2,1,"div",54)(40,mo,3,1),d()(),h(41,Po,11,4,"nile-dropdown",55),h(42,Ao,3,0,"nile-lite-tooltip",56),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(),b("open",n.showScopePicker()),s(13),C(n.scopeLoading()?18:19),s(10),C(n.scopeLoading()?28:29),s(2),b("open",n.showConversationPicker()),s(2),b("disabled",n.isStreaming()),s(2),A("noResultsMessage",n.copy().noResultsMatchFilters),s(3),F(" ",n.copy().newConversationLabel," "),s(),C(n.conversationsLoading()?38:n.convSearchEmpty()?39:40),s(3),C(n.features().dashboardsMenu?41:-1),s(),C(n.features().promptGallery?42:-1)}}function So(i,t){if(i&1){let e=k();l(0,"button",108),g("click",function(){let o=p(e).$implicit,a=r(4);return u(a.selectWidgetTemplateCategory(o.key))}),_(1),l(2,"span",109),_(3),d()()}if(i&2){let e=t.$implicit,n=r(4);B("aq-picker-chip--active",n.widgetTemplateActiveCategory()===e.key),s(),F("",e.label," "),s(2),v(n.widgetTemplateCountForCategory(e.key))}}function To(i,t){if(i&1){let e=k();l(0,"div",106)(1,"button",108),g("click",function(){p(e);let o=r(3);return u(o.selectWidgetTemplateCategory("all"))}),_(2),l(3,"span",109),_(4),d()(),D(5,So,4,4,"button",110,ie),d()}if(i&2){let e=r(3);s(),B("aq-picker-chip--active",e.widgetTemplateActiveCategory()==="all"),s(),F("",e.copy().libraryAllCategoryLabel," "),s(2),v(e.widgetTemplateAllTemplates().length),s(),O(e.templateCategories())}}function Fo(i,t){if(i&1&&m(0,"nile-skeleton-loader",112),i&2){let e=t.$implicit;Z("width",e,"px")}}function Do(i,t){if(i&1&&(l(0,"div",107),D(1,Fo,1,2,"nile-skeleton-loader",111,Y),d()),i&2){let e=r(3);s(),O(e.libraryChipSkeletonWidths)}}function Oo(i,t){if(i&1){let e=k();l(0,"nile-input",104),g("nile-input",function(o){p(e);let a=r(2);return u(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){p(e);let a=r(2);return u(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))}),m(1,"nile-glyph",105),d(),h(2,To,7,4,"div",106)(3,Do,3,0,"div",107)}if(i&2){let e=r(2);b("placeholder",e.copy().librarySearchWidgetsPlaceholder)("value",e.librarySearch()),s(2),C(!e.templateCategoriesLoading()&&!e.widgetTemplateTemplatesLoading()?2:3)}}function qo(i,t){if(i&1){let e=k();l(0,"button",108),g("click",function(){let o=p(e).$implicit,a=r(4);return u(a.selectTemplateCategory(o.key))}),_(1),l(2,"span",109),_(3),d()()}if(i&2){let e=t.$implicit,n=r(4);B("aq-picker-chip--active",n.templateActiveCategory()===e.key),s(),F("",e.label," "),s(2),v(n.templateCountForCategory(e.key))}}function Eo(i,t){if(i&1){let e=k();l(0,"div",106)(1,"button",108),g("click",function(){p(e);let o=r(3);return u(o.selectTemplateCategory("all"))}),_(2),l(3,"span",109),_(4),d()(),D(5,qo,4,4,"button",110,ie),d()}if(i&2){let e=r(3);s(),B("aq-picker-chip--active",e.templateActiveCategory()==="all"),s(),F("",e.copy().libraryAllCategoryLabel," "),s(2),v(e.templateAllTemplates().length),s(),O(e.templateCategories())}}function Io(i,t){if(i&1&&m(0,"nile-skeleton-loader",112),i&2){let e=t.$implicit;Z("width",e,"px")}}function Vo(i,t){if(i&1&&(l(0,"div",107),D(1,Io,1,2,"nile-skeleton-loader",111,Y),d()),i&2){let e=r(3);s(),O(e.libraryChipSkeletonWidths)}}function Ro(i,t){if(i&1){let e=k();l(0,"nile-input",104),g("nile-input",function(o){p(e);let a=r(2);return u(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){p(e);let a=r(2);return u(a.librarySearch.set((o.detail==null?null:o.detail.value)??""))}),m(1,"nile-glyph",105),d(),h(2,Eo,7,4,"div",106)(3,Vo,3,0,"div",107)}if(i&2){let e=r(2);b("placeholder",e.copy().librarySearchDashboardsPlaceholder)("value",e.librarySearch()),s(2),C(e.templateCategoriesLoading()?3:2)}}function zo(i,t){if(i&1&&(l(0,"div",119),m(1,"nile-skeleton-loader",120)(2,"nile-skeleton-loader",121)(3,"nile-skeleton-loader",122)(4,"nile-skeleton-loader",123),d()),i&2){let e=t.$implicit;s(),A("width",e)}}function No(i,t){if(i&1&&(l(0,"div",114)(1,"div",115),m(2,"nile-skeleton-loader",116)(3,"nile-skeleton-loader",117),d(),l(4,"div",118),D(5,zo,5,1,"div",119,Y),d()()),i&2){let e=t.$implicit;s(5),O(e)}}function $o(i,t){if(i&1&&(l(0,"div",113),D(1,No,7,0,"div",114,Y),d()),i&2){let e=r(3);s(),O(e.librarySkeletonGroups)}}function Lo(i,t){if(i&1){let e=k();l(0,"div",128),g("click",function(){let o=p(e).$implicit,a=r(6);return u(a.openWidgetDetailFromCard(o.templateId))}),m(1,"nile-kpi-chart",129),l(2,"button",130),g("click",function(o){let a=p(e).$implicit,c=r(6);return o.stopPropagation(),u(c.toggleWidgetTemplateSelection(a.templateId))}),m(3,"nile-glyph",131),d()()}if(i&2){let e=t.$implicit,n=r(6);B("aq-lib-card-wrap--selected",n.widgetTemplatePickerSelectedIds().includes(e.templateId)),s(),b("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 Wo(i,t){if(i&1){let e=k();l(0,"div",114)(1,"div",115)(2,"span",125),_(3),d(),l(4,"button",126),g("click",function(){let o=p(e).$implicit,a=r(5);return u(a.toggleLibraryGroupSelection(o.cards))}),_(5),d()(),l(6,"div",118),D(7,Lo,4,10,"div",127,Ui),d()()}if(i&2){let e=t.$implicit,n=r(5);s(3),Q("",e.label," \xB7 ",e.cards.length),s(2),F(" ",n.isGroupFullySelected(e.cards)?n.copy().libraryClearSelectionButton:n.copy().librarySelectAllButton," "),s(2),O(e.cards)}}function Bo(i,t){if(i&1&&D(0,Wo,9,3,"div",114,ie),i&2){let e=r(4);O(e.libraryWidgetGroups())}}function Uo(i,t){if(i&1&&(l(0,"div",124),_(1),d()),i&2){let e=r(4);s(),v(e.librarySearch()?e.copy().noWidgetsMatch:e.copy().noWidgetsInCategory)}}function Go(i,t){if(i&1&&h(0,Bo,2,0)(1,Uo,2,1,"div",124),i&2){let e=r(3);C(e.libraryWidgetGroups().length?0:1)}}function Ho(i,t){if(i&1&&h(0,$o,3,0,"div",113)(1,Go,2,1),i&2){let e=r(2);C(e.templateCategoriesLoading()||e.widgetTemplateTemplatesLoading()?0:1)}}function jo(i,t){if(i&1&&(l(0,"div",133),m(1,"nile-skeleton-loader",134),l(2,"div",135),m(3,"nile-skeleton-loader",120)(4,"nile-skeleton-loader",122)(5,"nile-skeleton-loader",136),d()()),i&2){let e=t.$implicit;s(3),A("width",e)}}function Yo(i,t){if(i&1&&(l(0,"div",114)(1,"div",115),m(2,"nile-skeleton-loader",116),d(),l(3,"div",132),D(4,jo,6,1,"div",133,Y),d()()),i&2){let e=t.$implicit;s(4),O(e)}}function Qo(i,t){if(i&1&&(l(0,"div",113),D(1,Yo,6,0,"div",114,Y),d()),i&2){let e=r(3);s(),O(e.librarySkeletonGroups)}}function Ko(i,t){if(i&1&&(l(0,"div",140),m(1,"db-dash-card-chart",148),d()),i&2){let e=r().$implicit;s(),b("config",e.preview)}}function Jo(i,t){i&1&&(l(0,"div",141),m(1,"span",149)(2,"span",150)(3,"span",151)(4,"span",152)(5,"span",153),d())}function Xo(i,t){if(i&1&&(l(0,"span",142),m(1,"nile-glyph",154),_(2),d()),i&2){let e=r().$implicit,n=r(5);s(2),F(" ",n.withCount(n.copy().libraryWidgetCountChip,(e.widgets==null?null:e.widgets.length)??0)," ")}}function Zo(i,t){if(i&1&&(l(0,"div",146),_(1),d()),i&2){let e=r().$implicit;s(),v(e.description)}}function ea(i,t){if(i&1){let e=k();l(0,"button",138),g("click",function(){let o=p(e).$implicit,a=r(5);return u(a.openWidgetDetailPanelForTemplate(o))}),l(1,"div",139),h(2,Ko,2,1,"div",140)(3,Jo,6,0,"div",141),h(4,Xo,3,1,"span",142),d(),l(5,"div",143)(6,"div",144)(7,"span",145),_(8),d(),h(9,Zo,2,1,"div",146),d(),m(10,"nile-glyph",147),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),v(e.name),s(),C(e.description?9:-1)}}function ta(i,t){if(i&1&&(l(0,"div",114)(1,"div",115)(2,"span",125),_(3),d()(),l(4,"div",132),D(5,ea,11,4,"button",137,te),d()()),i&2){let e=t.$implicit;s(3),Q("",e.label," \xB7 ",e.templates.length),s(2),O(e.templates)}}function na(i,t){if(i&1&&D(0,ta,7,2,"div",114,ie),i&2){let e=r(3);O(e.libraryDashboardGroups())}}function ia(i,t){if(i&1&&(l(0,"div",124),_(1),d()),i&2){let e=r(3);s(),v(e.librarySearch()?e.copy().noDashboardsMatch:e.copy().noDashboardsInCategory)}}function oa(i,t){if(i&1&&h(0,Qo,3,0,"div",113)(1,na,2,0)(2,ia,2,1,"div",124),i&2){let e=r(2);C(e.templateTemplatesLoading()?0:e.libraryDashboardGroups().length?1:2)}}function aa(i,t){if(i&1){let e=k();l(0,"div",103)(1,"span",155),_(2),d(),l(3,"nile-button",21),g("click",function(){p(e);let o=r(2);return u(o.addSelectedWidgetTemplates())}),m(4,"nile-glyph",156),_(5),d()()}if(i&2){let e=r(2);s(2),F(" ",e.withCount(e.copy().librarySelectedCount,e.widgetTemplatePickerSelectedIds().length)," "),s(3),F(" ",e.withCount(e.copy().libraryAddToCanvasButton,e.widgetTemplatePickerSelectedIds().length)," ")}}function ra(i,t){if(i&1){let e=k();l(0,"div",13)(1,"div",95)(2,"p",96)(3,"strong",97),_(4),d(),_(5),d(),l(6,"nile-nav-tab-group",98),g("nile-tab-change",function(o){p(e);let a=r();return a.artifactPickerTab.set(o.detail.value),a.widgetTemplatePickerSelectedIds.set([]),u(a.librarySearch.set(""))}),l(7,"nile-nav-tab",99),_(8),l(9,"span",100),_(10),d()(),l(11,"nile-nav-tab",101),_(12),l(13,"span",100),_(14),d()()(),h(15,Oo,4,3)(16,Ro,4,3),d(),l(17,"div",102),h(18,Ho,2,1)(19,oa,3,1),d(),h(20,aa,6,2,"div",103),d()}if(i&2){let e=r();s(4),v(e.copy().libraryIntroTitle),s(),F(" ",e.copy().libraryIntro," "),s(),A("value",e.artifactPickerTab()),s(2),v(e.copy().libraryWidgetsTabLabel),s(2),v(e.widgetTemplateAllTemplates().length),s(2),v(e.copy().libraryDashboardsTabLabel),s(2),v(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 la(i,t){i&1&&(l(0,"div",167),m(1,"nile-skeleton-loader",168),l(2,"div",169),m(3,"nile-skeleton-loader",74),d()())}function sa(i,t){i&1&&(l(0,"div",166),D(1,la,4,0,"div",167,Y),d()),i&2&&(s(),O(re(0,Bi)))}function da(i,t){if(i&1&&(l(0,"span",176),_(1),d()),i&2){let e=r().$implicit;s(),v(e.badge)}}function ca(i,t){if(i&1){let e=k();l(0,"button",173),g("click",function(){let o=p(e).$implicit,a=r(5);return u(a.onWelcomePromptPick(o))}),m(1,"nile-glyph",174),l(2,"span",175),_(3),d(),h(4,da,2,1,"span",176),d()}if(i&2){let e=t.$implicit;B("prompt-card--ai",e.tone==="ai"),s(),A("name",e.icon)("color",e.tone==="ai"?"#7a5af8":"#717680"),s(2),v(e.label),s(),C(e.badge?4:-1)}}function _a(i,t){if(i&1&&(l(0,"div",170),D(1,ca,5,6,"button",172,si),d()),i&2){let e=r(4);s(),O(e.welcomePromptCards())}}function pa(i,t){if(i&1){let e=k();l(0,"div",171)(1,"button",177),g("click",function(){p(e);let o=r(4);return u(o.openGallery())}),m(2,"nile-glyph",178),l(3,"span"),_(4),d()()()}if(i&2){let e=r(4);s(4),v(e.copy().promptGalleryLabel)}}function ua(i,t){if(i&1&&(h(0,_a,3,0,"div",170),h(1,pa,5,1,"div",171)),i&2){let e=r(3);C(e.features().welcomePrompts?0:-1),s(),C(e.features().promptGallery?1:-1)}}function ga(i,t){if(i&1&&(l(0,"div",157)(1,"div",159)(2,"div",160),m(3,"nile-glyph",161),d(),l(4,"h2",162),_(5),d(),l(6,"p",163),_(7),d(),l(8,"div",164),_e(9,165),d(),h(10,sa,3,1,"div",166)(11,ua,2,2),d()()),i&2){let e=r(2),n=oe(7);s(5),v(e.copy().welcomeTitle),s(2),v(e.copy().welcomeSubtitle),s(2),b("ngTemplateOutlet",n),s(),C(e.features().welcomePrompts&&!e.welcomePromptCards().length?10:11)}}function ma(i,t){i&1&&(l(0,"div",181),m(1,"nile-skeleton-loader",182),d(),l(2,"div",183),m(3,"nile-skeleton-loader",184)(4,"nile-skeleton-loader",185)(5,"nile-skeleton-loader",186),d(),l(6,"div",181),m(7,"nile-skeleton-loader",187),d(),l(8,"div",183),m(9,"nile-skeleton-loader",188)(10,"nile-skeleton-loader",189),d())}function ha(i,t){if(i&1&&(l(0,"div",191),m(1,"nile-glyph",194),l(2,"span",195),_(3),d()()),i&2){let e=r(2).$implicit;s(3),v(e.quotedText)}}function Ca(i,t){if(i&1&&(l(0,"span",200),_(1),d()),i&2){let e=r().$implicit;s(),v(e.answer)}}function fa(i,t){if(i&1&&(l(0,"div",196),m(1,"nile-glyph",197),l(2,"div",198)(3,"span",199),_(4),d(),h(5,Ca,2,1,"span",200),d()()),i&2){let e=t.$implicit;s(4),v(e.title),s(),C(e.answer&&e.answer!=="Use this"?5:-1)}}function xa(i,t){if(i&1&&(l(0,"div",192),D(1,fa,6,2,"div",196,Y),d()),i&2){let e=r(2).$implicit,n=r(4);s(),O(n.answerSummaryRows(e))}}function ba(i,t){if(i&1&&_(0),i&2){let e=r(2).$implicit;F(" ",e.text," ")}}function ya(i,t){if(i&1&&(l(0,"div",201),m(1,"nile-glyph",202),l(2,"span",203),_(3),d()()),i&2){let e=t.$implicit;s(),A("name",e.contentType.startsWith("image/")?"ng-image-03":"ng-file-06"),s(),A("title",e.name),s(),v(e.name)}}function va(i,t){if(i&1&&(l(0,"div",193),D(1,ya,4,3,"div",201,ie),d()),i&2){let e=r(2).$implicit;s(),O(e.attachments??re(0,ke))}}function wa(i,t){if(i&1&&(l(0,"nile-ai-chat-bubble",190),h(1,ha,4,1,"div",191),h(2,xa,3,0,"div",192)(3,ba,1,1),h(4,va,3,1,"div",193),d()),i&2){let e=r().$implicit;b("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 ka(i,t){if(i&1&&m(0,"nile-ai-steps",204),i&2){let e=r(2).$implicit;b("steps",e.tools)}}function Pa(i,t){if(i&1&&m(0,"nile-ai-token-stream",213),i&2){let e=r(4).$implicit,n=r(4);b("text",n.cleanText(e.text))("speedMs",n.streamSpeed)}}function Aa(i,t){if(i&1&&m(0,"nile-markdown",214),i&2){let e=r(4).$implicit,n=r(4);b("value",n.cleanText(e.text))}}function Ma(i,t){if(i&1&&h(0,Pa,1,2,"nile-ai-token-stream",213)(1,Aa,1,1,"nile-markdown",214),i&2){let e=r(3).$implicit;C(e.isStreaming?0:1)}}function Sa(i,t){if(i&1&&(l(0,"span",215),_(1),d()),i&2){let e=r().$implicit;s(),Q("Setup ",e.step.current," of ",e.step.total)}}function Ta(i,t){i&1&&(l(0,"span",224),_(1),d()),i&2&&(s(),v(t))}function Fa(i,t){if(i&1&&(l(0,"span",226),_(1),d()),i&2){let e=r().$implicit;s(),v(e.hint)}}function Da(i,t){if(i&1&&(l(0,"span"),_(1),d()),i&2){let e=r().$implicit;tt("choice-card__chip"+(e.tone?" choice-card__chip--"+e.tone:"")),s(),v(e.text)}}function Oa(i,t){if(i&1&&h(0,Da,2,3,"span",228),i&2){let e=t.$implicit;C(e.tone!=="green"&&e.tone!=="yellow"&&e.tone!=="red"?0:-1)}}function qa(i,t){if(i&1&&(l(0,"span",227),D(1,Oa,1,1,null,null,Y),d()),i&2){let e=r().$implicit;s(),O(e.meta)}}function Ea(i,t){if(i&1&&(l(0,"nile-radio",220)(1,"span",221)(2,"span",222),_(3),d(),l(4,"span",223),h(5,Ta,2,1,"span",224),l(6,"span",225),_(7),d(),h(8,Fa,2,1,"span",226),h(9,qa,3,0,"span",227),d()()()),i&2){let e,n=t.$implicit,o=t.$index,a=t.$index,c=r(2).$implicit,f=r(3).$implicit,w=r(4);B("choice-card--chosen",(c.selected||c.draftSelection)===n.id)("choice-card--locked",!!c.selected||w.isStreaming()),A("name","choice-"+f.id+"-"+o)("value",n.id)("checked",(c.selected||c.draftSelection)===n.id?"":null)("disabled",c.selected||w.isStreaming()?"":null),s(3),v(a+1),s(2),C((e=w.optionBadgeText(n))?5:-1,e),s(2),v(w.optionPrimaryText(n)),s(),C(!w.optionBadgeText(n)&&n.hint?8:-1),s(),C(n.meta!=null&&n.meta.length?9:-1)}}function Ia(i,t){if(i&1){let e=k();l(0,"nile-radio-group",218),g("nile-change",function(o){p(e);let a=r().$implicit,c=r(3).$implicit,f=r(4);return u(f.onChoiceChange(c,a,o.detail.value))}),D(1,Ea,10,13,"nile-radio",219,te),d()}if(i&2){let e=r(),n=e.$implicit,o=e.$index,a=r(3).$implicit,c=r(4);A("label",n.prompt||"Choose an index")("name","choice-"+a.id+"-"+o)("value",n.selected||n.draftSelection||null)("disabled",n.selected||c.isStreaming()?"":null),s(),O(n.options)}}function Va(i,t){if(i&1&&(l(0,"p",217),_(1),d()),i&2){let e=r(8);s(),v(e.copy().noChoiceOptions)}}function Ra(i,t){if(i&1&&_(0),i&2){let e=r(3).$implicit;F(" \u2713 Something else: ",e.chatDraftText," (edit) ")}}function za(i,t){if(i&1&&(m(0,"nile-glyph",234),_(1)),i&2){let e=r(10);s(),F(" ",e.copy().somethingElseButton," ")}}function Na(i,t){if(i&1){let e=k();l(0,"button",231),g("click",function(){p(e);let o=r(3).$implicit,a=r(3).$implicit,c=r(4);return u(c.requestPlan(a,o))}),_(1),d()}if(i&2){let e=r(10);b("disabled",e.isStreaming()),s(),F(" ",e.copy().givePlanButton," ")}}function $a(i,t){if(i&1){let e=k();l(0,"button",235),g("click",function(){p(e);let o=r(3).$implicit,a=r(3).$implicit,c=r(4);return u(c.previewWidget(a,o))}),m(1,"nile-glyph",236),_(2),d()}if(i&2){let e=r(3).$implicit,n=r(7);b("disabled",n.isStreaming()),s(2),F(' Preview "',n.choiceTitle(e),'" ')}}function La(i,t){if(i&1){let e=k();l(0,"div",229)(1,"button",231),g("click",function(){p(e);let o=r(2).$implicit,a=r(3).$implicit,c=r(4);return u(c.openChatDraft(a,o))}),h(2,Ra,1,1)(3,za,2,1),d(),h(4,Na,2,2,"button",232),h(5,$a,3,2,"button",233),d()}if(i&2){let e=r(2).$implicit,n=r(7);s(),b("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 Wa(i,t){if(i&1){let e=k();l(0,"div",230)(1,"span",237),_(2,"Something else"),d(),l(3,"div",238)(4,"nile-input",239),g("nile-input",function(o){p(e);let a=r(2).$implicit,c=r(3).$implicit,f=r(4);return u(f.onChatDraftTextChange(c,a,o.detail.value))})("keydown.enter",function(){p(e);let o=r(2).$implicit,a=r(3).$implicit,c=r(4);return u(c.defineChatDraft(a,o))}),d(),l(5,"nile-button",21),g("click",function(){p(e);let o=r(2).$implicit,a=r(3).$implicit,c=r(4);return u(c.defineChatDraft(a,o))}),_(6),d()()()}if(i&2){let e=r(2).$implicit,n=r(7);s(4),b("value",e.chatDraftText??""),A("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(),A("disabled",!(e.chatDraftText!=null&&e.chatDraftText.trim())||n.isStreaming()?"":null),s(),F(" ",n.copy().defineItButton," ")}}function Ba(i,t){if(i&1&&h(0,La,6,4,"div",229)(1,Wa,7,5,"div",230),i&2){let e=r().$implicit;C(e.chatOpen?1:0)}}function Ua(i,t){if(i&1&&(l(0,"div",207),h(1,Sa,2,2,"span",215),h(2,Ia,3,4,"nile-radio-group",216)(3,Va,2,1,"p",217),h(4,Ba,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 Ga(i,t){if(i&1){let e=k();l(0,"button",240),g("click",function(){p(e);let o=r(3).$implicit,a=r(4);return u(a.resumeChoicePanel(o))}),_(1),d()}if(i&2){let e=r(3).$implicit,n=r(4);s(),Q(" ",n.panelAnsweredCount(e.choices??re(2,ke))," of ",(e.choices??re(3,ke)).length," answered \u2014 Resume ")}}function Ha(i,t){i&1&&(l(0,"span",242),m(1,"span",248),_(2,"Live "),d())}function ja(i,t){i&1&&(l(0,"span",243),_(1,"Preview"),d())}function Ya(i,t){i&1&&m(0,"div",251)}function Qa(i,t){if(i&1&&m(0,"nile-glyph",255),i&2){let e=r().$implicit;Z("color",e.color),b("name",e.glyph)("method",e.method||"stroke")}}function Ka(i,t){if(i&1){let e=k();h(0,Ya,1,0,"div",251),l(1,"nile-menu-item",252),g("click",function(){let o=p(e).$implicit;r();let a=oe(1),c=r(4).$implicit;return r(4).onInlineWidgetMenuItem(c,o),u(a.hide())}),l(2,"span",253),h(3,Qa,1,4,"nile-glyph",254),_(4),d()()}if(i&2){let e=t.$implicit;C(e.divider?0:-1),s(3),C(e.glyph?3:-1),s(),F(" ",e.label," ")}}function Ja(i,t){if(i&1&&(l(0,"nile-dropdown",244,4)(2,"button",249),m(3,"nile-glyph",250),d(),l(4,"nile-menu"),D(5,Ka,5,3,null,null,ie),d()()),i&2){let e=r(4).$implicit,n=r(4);s(5),O(n.inlineWidgetMenuItems(e))}}function Xa(i,t){i&1&&(l(0,"div",259),m(1,"nile-spinner",262),l(2,"span"),_(3,"Loading chart types\u2026"),d()())}function Za(i,t){if(i&1&&(l(0,"p",260),_(1),d()),i&2){let e=r(9);s(),v(e.copy().noChartTypesFit)}}function er(i,t){i&1&&m(0,"nile-spinner",262)}function tr(i,t){if(i&1&&m(0,"nile-glyph",267),i&2){let e=r().$implicit,n=r(11);b("name",n.chartTypeIcon(e.type))}}function nr(i,t){if(i&1){let e=k();l(0,"button",266),g("click",function(){let o=p(e).$implicit,a=r(11);return u(a.selectInlineChartType(o.component))}),h(1,er,1,0,"nile-spinner",262)(2,tr,1,1,"nile-glyph",267),l(3,"span"),_(4),d()()}if(i&2){let e=t.$implicit,n=r(11);A("disabled",n.inlineChartTypeApplying()?"":null),s(),C(n.inlineChartTypeApplyingComponent()===e.component?1:2),s(3),v(e.label)}}function ir(i,t){if(i&1&&(l(0,"p",263),_(1,"Recommended"),d(),l(2,"div",264),D(3,nr,5,3,"button",265,di),d()),i&2){let e=r(10);s(3),O(e.inlineSensibleChartTypes())}}function or(i,t){i&1&&m(0,"nile-spinner",262)}function ar(i,t){if(i&1&&m(0,"nile-glyph",267),i&2){let e=r().$implicit,n=r(11);b("name",n.chartTypeIcon(e.type))}}function rr(i,t){if(i&1){let e=k();l(0,"button",269),g("click",function(){let o=p(e).$implicit,a=r(11);return u(a.selectInlineChartType(o.component))}),h(1,or,1,0,"nile-spinner",262)(2,ar,1,1,"nile-glyph",267),l(3,"span"),_(4),d()()}if(i&2){let e=t.$implicit,n=r(11);A("disabled",n.inlineChartTypeApplying()?"":null),s(),C(n.inlineChartTypeApplyingComponent()===e.component?1:2),s(3),v(e.label)}}function lr(i,t){if(i&1&&(l(0,"p",263),_(1,"Other types"),d(),l(2,"div",264),D(3,rr,5,3,"button",268,di),d()),i&2){let e=r(10);s(3),O(e.inlineOtherChartTypes())}}function sr(i,t){if(i&1&&(h(0,ir,5,0),h(1,lr,5,0)),i&2){let e=r(9);C(e.inlineSensibleChartTypes().length>0?0:-1),s(),C(e.inlineOtherChartTypes().length>0?1:-1)}}function dr(i,t){if(i&1&&(l(0,"p",261),_(1),d()),i&2){let e=r(9);s(),v(e.inlineChartTypeError())}}function cr(i,t){if(i&1){let e=k();l(0,"nile-dropdown",256),g("nile-hide",function(){p(e);let o=r(8);return u(o.closeInlineChartTypePicker())}),m(1,"span",257),l(2,"div",258),h(3,Xa,4,0,"div",259)(4,Za,2,1,"p",260)(5,sr,2,2),h(6,dr,2,1,"p",261),d()()}if(i&2){let e=r(4).$implicit,n=r(4);b("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 _r(i,t){if(i&1){let e=k();l(0,"span",272),_(1),l(2,"button",273),g("click",function(){let o=p(e).$implicit,a=r(6).$implicit,c=r(4);return u(c.removeInlineFilter(a.charts[0],o.id))}),m(3,"nile-glyph",274),d()()}if(i&2){let e=t.$implicit,n=r(6).$implicit,o=r(4);s(),F(" ",o.inlineFilterChipLabel(n.charts[0],e)," "),s(),A("disabled",o.inlineFilterApplying()?"":null)}}function pr(i,t){if(i&1&&(l(0,"div",271),D(1,_r,4,2,"span",272,te),d()),i&2){let e=r(5).$implicit,n=r(4);s(),O(n.inlineActiveFilters(e.charts[0]))}}function ur(i,t){i&1&&(l(0,"div",259),m(1,"nile-spinner",262),l(2,"span"),_(3,"Loading filterable fields\u2026"),d()())}function gr(i,t){if(i&1&&(l(0,"p",261),_(1),d()),i&2){let e=r(9);s(),v(e.inlineFilterFieldsError())}}function mr(i,t){if(i&1&&(l(0,"p",260),_(1),d()),i&2){let e=r(9);s(),v(e.copy().noFilterableFields)}}function hr(i,t){if(i&1&&(l(0,"option",277),_(1),d()),i&2){let e=t.$implicit;b("value",e.name),s(),v(e.label)}}function Cr(i,t){if(i&1&&(l(0,"option",277),_(1),d()),i&2){let e=t.$implicit;b("value",e.value),s(),v(e.label)}}function fr(i,t){i&1&&(l(0,"div",259),m(1,"nile-spinner",278),l(2,"span"),_(3,"Loading values\u2026"),d()())}function xr(i,t){if(i&1){let e=k();l(0,"input",282),g("ngModelChange",function(o){p(e);let a=r(11);return u(a.inlineFilterBuilderValue.set(o))})("keydown.enter",function(){p(e);let o=r(7).$implicit,a=r(4);return u(a.addInlineFilter(o.charts[0]))}),d()}if(i&2){let e=r(11);b("placeholder",e.copy().filterValuePlaceholder)("ngModel",e.inlineFilterBuilderValue())}}function br(i,t){if(i&1){let e=k();l(0,"span",284),_(1,"and"),d(),l(2,"input",283),g("ngModelChange",function(o){p(e);let a=r(12);return u(a.inlineFilterBuilderValue2.set(o))}),d()}if(i&2){let e=r(12);s(2),b("ngModel",e.inlineFilterBuilderValue2())}}function yr(i,t){if(i&1){let e=k();l(0,"input",283),g("ngModelChange",function(o){p(e);let a=r(11);return u(a.inlineFilterBuilderValue.set(o))}),d(),h(1,br,3,1)}if(i&2){let e,n=r(7).$implicit,o=r(4);b("ngModel",o.inlineFilterBuilderValue()),s(),C((e=o.inlineFilterSelectedOperator(n.charts[0]))!=null&&e.needsSecondValue?1:-1)}}function vr(i,t){if(i&1){let e=k();l(0,"span",284),_(1,"and"),d(),l(2,"input",286),g("ngModelChange",function(o){p(e);let a=r(12);return u(a.inlineFilterBuilderValue2.set(o))}),d()}if(i&2){let e=r(12);s(2),b("placeholder",e.copy().filterValuePlaceholder)("ngModel",e.inlineFilterBuilderValue2())}}function wr(i,t){if(i&1){let e=k();l(0,"input",285),g("ngModelChange",function(o){p(e);let a=r(11);return u(a.inlineFilterBuilderValue.set(o))})("keydown.enter",function(){p(e);let o=r(7).$implicit,a=r(4);return u(a.addInlineFilter(o.charts[0]))}),d(),h(1,vr,3,2)}if(i&2){let e,n=r(7).$implicit,o=r(4);b("placeholder",o.copy().filterValuePlaceholder)("ngModel",o.inlineFilterBuilderValue()),s(),C((e=o.inlineFilterSelectedOperator(n.charts[0]))!=null&&e.needsSecondValue?1:-1)}}function kr(i,t){if(i&1){let e=k();l(0,"label",287)(1,"input",288),g("change",function(){let o=p(e).$implicit,a=r(12);return u(a.toggleInlineFilterMultiValue(o.value))}),d(),l(2,"span"),_(3),d()()}if(i&2){let e=t.$implicit,n=r(12);s(),b("checked",n.inlineFilterBuilderValues().includes(e.value)),s(2),Q("",e.label,"",e.count!=null?" ("+e.count+")":"")}}function Pr(i,t){if(i&1&&(l(0,"div",280),D(1,kr,4,3,"label",287,Xe),d()),i&2){let e=r(11);s(),O(e.inlineFilterValuesFor(e.inlineFilterBuilderFieldId()))}}function Ar(i,t){if(i&1&&(l(0,"option",277),_(1),d()),i&2){let e=t.$implicit;b("value",e.value),s(),Q("",e.label,"",e.count!=null?" ("+e.count+")":"")}}function Mr(i,t){if(i&1){let e=k();l(0,"select",276),g("ngModelChange",function(o){p(e);let a=r(11);return u(a.inlineFilterBuilderValue.set(o))}),l(1,"option",289),_(2,"Select\u2026"),d(),D(3,Ar,2,3,"option",277,Xe),d()}if(i&2){let e=r(11);b("ngModel",e.inlineFilterBuilderValue()),s(3),O(e.inlineFilterValuesFor(e.inlineFilterBuilderFieldId()))}}function Sr(i,t){if(i&1&&h(0,xr,1,2,"input",279)(1,yr,2,2)(2,wr,2,3)(3,Pr,3,0,"div",280)(4,Mr,5,1,"select",281),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 Tr(i,t){if(i&1&&(l(0,"p",261),_(1),d()),i&2){let e=r(10);s(),v(e.inlineFilterApplyError())}}function Fr(i,t){if(i&1){let e=k();l(0,"div",275)(1,"select",276),g("ngModelChange",function(o){p(e);let a=r(5).$implicit,c=r(4);return u(c.onInlineFilterFieldChange(a.charts[0],o))}),D(2,hr,2,2,"option",277,Gi),d(),l(4,"select",276),g("ngModelChange",function(o){p(e);let a=r(9);return u(a.onInlineFilterOperatorChange(o))}),D(5,Cr,2,2,"option",277,Xe),d(),h(7,fr,4,0,"div",259)(8,Sr,5,1),l(9,"nile-button",20),g("click",function(){p(e);let o=r(5).$implicit,a=r(4);return u(a.addInlineFilter(o.charts[0]))}),_(10," Add filter "),d()(),h(11,Tr,2,1,"p",261)}if(i&2){let e=r(5).$implicit,n=r(4);s(),b("ngModel",n.inlineFilterBuilderFieldId()),s(),O(n.inlineFilterFields(e.charts[0])),s(2),b("ngModel",n.inlineFilterBuilderOperator()),s(),O(n.inlineFilterOperators(e.charts[0])),s(2),C(n.inlineFilterValuesLoading()?7:8),s(2),A("loading",n.inlineFilterApplying()?"":null)("disabled",n.inlineFilterApplying()?"":null),s(2),C(n.inlineFilterApplyError()?11:-1)}}function Dr(i,t){if(i&1){let e=k();l(0,"nile-dropdown",256),g("nile-hide",function(){p(e);let o=r(8);return u(o.closeInlineFilterBuilder())}),m(1,"span",257),l(2,"div",270)(3,"p",260),_(4,"Filters this preview only \u2014 nothing is saved."),d(),h(5,pr,3,0,"div",271),h(6,ur,4,0,"div",259)(7,gr,2,1,"p",261)(8,mr,2,1,"p",260)(9,Fr,12,6),d()()}if(i&2){let e=r(4).$implicit,n=r(4);b("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 Or(i,t){if(i&1&&(l(0,"span",290)(1,"span",291),_(2),d(),l(3,"span",292),_(4),d()()),i&2){let e=t.$implicit;s(2),F("",e.label,":"),s(2),v(e.value)}}function qr(i,t){if(i&1&&(l(0,"div",246),D(1,Or,5,2,"span",290,si),d()),i&2){let e=r(4).$implicit;s(),O(e.forecastMeta??re(0,ke))}}function Er(i,t){if(i&1){let e=k();l(0,"nile-button",293),g("click",function(){p(e);let o=r(5).$implicit,a=r(4);return u(a.tryAlternatePreview(o.charts[0]))}),_(1),d()}if(i&2){let e=r(5).$implicit,n=r(4);b("disabled",n.isStreaming()),s(),F(' Try "',n.previewAltLabel(e.charts[0]),'" instead ')}}function Ir(i,t){if(i&1){let e=k();l(0,"nile-button",293),g("click",function(){p(e);let o=r(4).$implicit,a=r(4);return u(a.skipPreview(o.charts[0]))}),_(1," Skip this widget "),d(),h(2,Er,2,2,"nile-button",294),l(3,"nile-button",295),g("click",function(){p(e);let o=r(4).$implicit,a=r(4);return u(a.acceptPreview(o.charts[0]))}),m(4,"nile-glyph",156),_(5," Add to dashboard "),d()}if(i&2){let e=r(4).$implicit,n=r(4);b("disabled",n.isStreaming()),s(2),C(n.previewAltLabel(e.charts[0])?2:-1),s(),b("disabled",n.isStreaming())}}function Vr(i,t){if(i&1&&(l(0,"div",54),_(1),d()),i&2){let e=r(10);s(),v(e.copy().noResultsMatchFilters)}}function Rr(i,t){i&1&&_e(0)}function zr(i,t){if(i&1){let e=k();l(0,"nile-menu-item",67),g("click",function(){let o=p(e).$implicit,a=r(8).$implicit,c=r(4);return u(c.addInlineToExisting(a.charts,o.id))}),fe(1,Rr,1,0,"ng-container",301),d()}if(i&2){let e=t.$implicit;r(12);let n=oe(37);s(),b("ngTemplateOutlet",n)("ngTemplateOutletContext",nt(2,li,e))}}function Nr(i,t){if(i&1&&(l(0,"div",76),_(1),d(),D(2,zr,2,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;s(),v(e.label),s(),O(e.items)}}function $r(i,t){if(i&1&&(l(0,"div",54),_(1),d()),i&2){let e=r(11);s(),v(e.copy().noDashboardsYet)}}function Lr(i,t){if(i&1&&D(0,Nr,4,1,null,null,ie,!1,$r,2,1,"div",54),i&2){let e=r(10);O(e.groupedPickerDashboards())}}function Wr(i,t){if(i&1){let e=k();l(0,"nile-dropdown",299),g("nile-hide",function(){p(e);let o=r(9);return u(o.inlinePickerFor.set(null))}),l(1,"nile-button",300),g("click",function(){p(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",156),_(3),d(),l(4,"nile-menu",51),g("nile-search-value",function(o){p(e);let a=r(9);return u(a.pickerSearch.set((o.detail==null?null:o.detail.value)??""))}),l(5,"nile-menu-item",52),g("click",function(){p(e);let o=r(5).$implicit,a=r(4);return u(a.addInlineWidget(o.charts))}),m(6,"nile-glyph",53),_(7),d(),h(8,Vr,2,1,"div",54)(9,Lr,3,1),d()()}if(i&2){let e=r(5).$implicit,n=r(4);b("open",n.inlinePickerFor()===e.id),s(),A("loading",n.committingAction()==="add"?"":null)("disabled",n.committingAction()?"":null),s(2),F(" ",n.copy().addToDashboardButton," "),s(),A("noResultsMessage",n.copy().noResultsMatchFilters),s(3),F(" ",n.copy().newDashboardLabel," "),s(),C(n.pickerSearchEmpty()?8:9)}}function Br(i,t){if(i&1){let e=k();l(0,"nile-button",21),g("click",function(){p(e);let o=r(5).$implicit,a=r(4);return u(a.addInlineDefault(o.charts))}),m(1,"nile-glyph",156),_(2),d()}if(i&2){let e=r(9);A("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()?"":null),s(2),F(" ",e.builderOpen()?e.copy().addToCurrentDashboardButton:e.copy().addToDashboardButton," ")}}function Ur(i,t){if(i&1){let e=k();l(0,"nile-button",20),g("click",function(){p(e);let o=r(4).$implicit,a=r(4);return u(a.addToLibrary(o.charts[0]))}),m(1,"nile-glyph",296),_(2),d(),h(3,Wr,10,7,"nile-dropdown",297)(4,Br,3,3,"nile-button",298)}if(i&2){let e=r(8);s(2),F(" ",e.copy().addToLibraryButton," "),s(),C(!e.builderOpen()&&e.nonAutoDashboards().length>1?3:4)}}function Gr(i,t){if(i&1&&(l(0,"div",209)(1,"div")(2,"shared-nile-chart-widget",241),h(3,Ha,3,0,"span",242),h(4,ja,2,0,"span",243),h(5,Ja,7,0,"nile-dropdown",244),h(6,cr,7,3,"nile-dropdown",245),h(7,Dr,10,3,"nile-dropdown",245),d()(),h(8,qr,3,1,"div",246),l(9,"div",247),h(10,Ir,6,3)(11,Ur,5,2),d()()),i&2){let e=r(3).$implicit,n=r(4);s(),tt(n.inlineChartClass(e.charts[0])),s(),b("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 Hr(i,t){i&1&&(l(0,"span",243),_(1,"Preview"),d(),_(2," \xB7 "))}function jr(i,t){if(i&1){let e=k();l(0,"nile-button",293),g("click",function(){p(e);let o=r(5).$implicit,a=r(4);return u(a.tryAlternatePreview(o.charts[0]))}),_(1),d()}if(i&2){let e=r(5).$implicit,n=r(4);b("disabled",n.isStreaming()),s(),F(' Try "',n.previewAltLabel(e.charts[0]),'" instead ')}}function Yr(i,t){if(i&1){let e=k();l(0,"div",247)(1,"nile-button",293),g("click",function(){p(e);let o=r(4).$implicit,a=r(4);return u(a.skipPreview(o.charts[0]))}),_(2," Skip this widget "),d(),h(3,jr,2,2,"nile-button",294),l(4,"nile-button",295),g("click",function(){p(e);let o=r(4).$implicit,a=r(4);return u(a.acceptPreview(o.charts[0]))}),m(5,"nile-glyph",156),_(6," Add to dashboard "),d()()}if(i&2){let e=r(4).$implicit,n=r(4);s(),b("disabled",n.isStreaming()),s(2),C(n.previewAltLabel(e.charts[0])?3:-1),s(),b("disabled",n.isStreaming())}}function Qr(i,t){if(i&1){let e=k();l(0,"div",302),g("click",function(){p(e);let o=r(3).$implicit,a=r(4);return u(a.openArtifact(o.charts,o.id))}),l(1,"div",303),m(2,"nile-glyph",304),d(),l(3,"div",305)(4,"span",306),_(5),d(),l(6,"span",307),h(7,Hr,3,0),_(8),d()(),l(9,"nile-button",21),g("click",function(o){p(e);let a=r(3).$implicit,c=r(4);return o.stopPropagation(),u(c.openArtifact(a.charts,a.id))}),_(10),m(11,"nile-glyph",308),d()(),h(12,Yr,7,3,"div",247)}if(i&2){let e=r(3).$implicit,n=r(4);s(5),v(e.dashboardTitle||e.charts[0].title),s(2),C(n.isPreviewChart(e.charts[0])?7:-1),s(),Q(" Dashboard \xB7 ",e.charts.length," widget",e.charts.length!==1?"s":""," "),s(2),F(" ",n.copy().viewButton," "),s(2),C(e.charts.length===1&&n.isPreviewChart(e.charts[0])?12:-1)}}function Kr(i,t){if(i&1){let e=k();l(0,"div",210),m(1,"nile-glyph",309),l(2,"span",310),_(3),d(),l(4,"button",311),g("click",function(){p(e);let o=r(3).$implicit,a=r(4);return u(a.recomputeStoredForecast(o))}),_(5),d()()}if(i&2){let e=r(3).$implicit,n=r(4);s(3),v(n.restoredForecastLabel(e)),s(),b("disabled",n.isStreaming()),s(),F(" ",n.copy().recomputeButton," ")}}function Jr(i,t){if(i&1&&m(0,"nile-glyph",314),i&2){let e=r().$implicit;A("name",e.icon)("color",e.tone==="ai"?"#7a5af8":"#717680")}}function Xr(i,t){if(i&1&&(l(0,"span",316),_(1),d()),i&2){let e=r().$implicit;s(),v(e.badge)}}function Zr(i,t){if(i&1){let e=k();l(0,"button",313),g("click",function(){let o=p(e).$implicit,a=r(4).$implicit,c=r(4);return u(c.onFollowUp(o,a))}),h(1,Jr,1,2,"nile-glyph",314),l(2,"span",315),_(3),d(),h(4,Xr,2,1,"span",316),d()}if(i&2){let e=t.$implicit,n=r(8);B("follow-up--ai",e.tone==="ai"),b("disabled",n.isStreaming()),s(),C(e.icon?1:-1),s(2),v(e.label),s(),C(e.badge?4:-1)}}function el(i,t){if(i&1&&(l(0,"div",211),D(1,Zr,5,6,"button",312,Hi),d()),i&2){let e=r(3).$implicit;s(),O(e.followUps??re(0,ke))}}function tl(i,t){if(i&1&&(l(0,"div",212),m(1,"nile-glyph",317),l(2,"span",318),_(3),d()()),i&2){let e=r(7);s(3),v(e.copy().errors.assistantErrorFallback)}}function nl(i,t){if(i&1&&(l(0,"nile-ai-chat-bubble",205)(1,"div",206),h(2,Ma,2,1),D(3,Ua,5,3,"div",207,Y),h(5,Ga,2,4,"button",208),h(6,Gr,12,13,"div",209)(7,Qr,13,6),h(8,Kr,6,3,"div",210),h(9,el,3,1,"div",211),h(10,tl,4,1,"div",212),d()()),i&2){let e=r(2).$implicit,n=r(4);b("role","ai")("hideIcon",!0),s(2),C(e.text&&!n.suppressTextFor(e)?2:-1),s(),O(n.nonPanelChoices(e)),s(2),C(n.isMultiChoice(e)&&n.isChoicePanelDismissed(e)&&!n.isChoicePanelComplete(e.choices??re(8,ke))?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 il(i,t){if(i&1&&(h(0,ka,1,1,"nile-ai-steps",204),h(1,nl,11,9,"nile-ai-chat-bubble",205)),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 ol(i,t){if(i&1&&(h(0,wa,5,4,"nile-ai-chat-bubble",190),h(1,il,2,2)),i&2){let e=t.$implicit;C(e.role==="user"?0:-1),s(),C(e.role==="assistant"?1:-1)}}function al(i,t){if(i&1&&D(0,ol,2,2,null,null,te),i&2){let e=r(3);O(e.messages())}}function rl(i,t){if(i&1&&(l(0,"span",321),_(1),d()),i&2){let e=r(2);s(),Tt("",t," ",e.index+1," OF ",e.choices.length)}}function ll(i,t){if(i&1&&(l(0,"span",321),_(1),d()),i&2){let e=r(2);s(),Q("",e.index+1," OF ",e.choices.length)}}function sl(i,t){i&1&&(l(0,"span",335),_(1),d()),i&2&&(s(),v(t))}function dl(i,t){if(i&1&&(l(0,"span",337),_(1),d()),i&2){let e=r().$implicit;s(),v(e.hint)}}function cl(i,t){if(i&1){let e=k();l(0,"nile-radio",331),g("click",function(){p(e);let o=r(2),a=r(4);return u(a.onPanelSkip(o.msg))}),l(1,"span",332)(2,"span",333),_(3),d(),l(4,"span",334),h(5,sl,2,1,"span",335),l(6,"span",336),_(7),d(),h(8,dl,2,1,"span",337),d()()()}if(i&2){let e,n=t.$implicit,o=t.$index,a=r(2),c=r(4);A("name","choice-panel-"+a.msg.id+"-"+a.index)("value",n.id)("checked",(a.choices[a.index].draftSelection||a.choices[a.index].selected)===n.id?"":null)("disabled",c.isStreaming()?"":null),s(3),v(o+1),s(2),C((e=c.optionBadgeText(n))?5:-1,e),s(2),v(c.optionPrimaryText(n)),s(),C(!c.optionBadgeText(n)&&n.hint?8:-1)}}function _l(i,t){if(i&1){let e=k();l(0,"button",235),g("click",function(){p(e);let o=r(3),a=r(4);return u(a.previewWidget(o.msg,o.choices[o.index]))}),m(1,"nile-glyph",236),_(2),d()}if(i&2){let e=r(3),n=r(4);b("disabled",n.isStreaming()),s(2),F(' Preview "',n.choiceTitle(e.choices[e.index]),'" ')}}function pl(i,t){if(i&1){let e=k();l(0,"button",231),g("click",function(){p(e);let o=r(3),a=r(4);return u(a.requestPlan(o.msg,o.choices[o.index]))}),_(1),d()}if(i&2){let e=r(7);b("disabled",e.isStreaming()),s(),F(" ",e.copy().givePlanButton," ")}}function ul(i,t){if(i&1){let e=k();l(0,"div",229)(1,"button",231),g("click",function(){p(e);let o=r(2),a=r(4);return u(a.openChatDraft(o.msg,o.choices[o.index]))}),m(2,"nile-glyph",234),_(3),d(),h(4,_l,3,2,"button",233),h(5,pl,2,2,"button",232),l(6,"button",338),g("click",function(){p(e);let o=r(2),a=r(4);return u(a.onPanelSkip(o.msg))}),_(7," Skip "),d()()}if(i&2){let e=r(2),n=r(4);s(),b("disabled",n.isStreaming()),s(2),F(" ",n.copy().somethingElseButton," "),s(),C(e.choices[e.index].kind==="widget_plan"?4:-1),s(),C(e.choices[e.index].kind==="clarification"?5:-1),s(),A("disabled",n.isStreaming()?"":null)}}function gl(i,t){if(i&1){let e=k();l(0,"div",230)(1,"div",238)(2,"nile-input",239),g("nile-input",function(o){p(e);let a=r(2),c=r(4);return u(c.onChatDraftTextChange(a.msg,a.choices[a.index],o.detail.value))})("keydown.enter",function(){p(e);let o=r(2),a=r(4);return u(a.onPanelChatDraftConfirm(o.msg,o.choices[o.index]))}),d(),l(3,"nile-button",21),g("click",function(){p(e);let o=r(2),a=r(4);return u(a.onPanelChatDraftConfirm(o.msg,o.choices[o.index]))}),_(4),d()()()}if(i&2){let e=r(2),n=r(4);s(2),b("value",e.choices[e.index].chatDraftText??""),A("placeholder",n.chatDraftPlaceholderFor(e.choices[e.index]))("disabled",n.isStreaming()?"":null),s(),A("disabled",!(e.choices[e.index].chatDraftText!=null&&e.choices[e.index].chatDraftText.trim())||n.isStreaming()?"":null),s(),F(" ",n.copy().defineItButton," ")}}function ml(i,t){if(i&1){let e=k();l(0,"div",320),h(1,rl,2,3,"span",321)(2,ll,2,2,"span",321),l(3,"div",322)(4,"button",323),g("click",function(){p(e);let o=r(),a=r(4);return u(a.onPanelPrev(o.msg))}),m(5,"nile-glyph",324),d(),l(6,"button",323),g("click",function(){p(e);let o=r(),a=r(4);return u(a.onPanelSkip(o.msg))}),m(7,"nile-glyph",325),d(),l(8,"button",326),g("click",function(){p(e);let o=r(),a=r(4);return u(a.dismissChoicePanel(o.msg))}),m(9,"nile-glyph",327),d()()(),l(10,"nile-radio-group",328),g("nile-change",function(o){p(e);let a=r(),c=r(4);return u(c.onChoiceChange(a.msg,a.choices[a.index],o.detail.value))}),D(11,cl,9,8,"nile-radio",329,te),d(),h(13,ul,8,5,"div",229)(14,gl,5,5,"div",230),l(15,"p",330),_(16,"\u2191\u2193 to navigate \xB7 \u21B5 to select \xB7 or type below"),d()}if(i&2){let e,n=r(),o=r(4);s(),C((e=o.panelBadgeLabel(n.choices[n.index]))?1:2,e),s(3),A("disabled",n.index===0?"":null),s(2),A("disabled",o.isStreaming()?"":null),s(4),A("label",n.choices[n.index].prompt||"Choose an option")("name","choice-panel-"+n.msg.id+"-"+n.index)("value",n.choices[n.index].draftSelection||n.choices[n.index].selected||null)("disabled",o.isStreaming()?"":null),s(),O(n.choices[n.index].options),s(2),C(n.choices[n.index].chatOpen?14:13)}}function hl(i,t){if(i&1&&(l(0,"li",340)(1,"span",342),_(2),d(),l(3,"span",343),_(4),d()()),i&2){let e=t.$implicit,n=r(6);s(2),v(n.choiceTitle(e)),s(2),v(n.panelAnswerLabel(e))}}function Cl(i,t){if(i&1){let e=k();l(0,"div",320)(1,"span",321),_(2,"READY TO SUBMIT"),d(),l(3,"button",326),g("click",function(){p(e);let o=r(),a=r(4);return u(a.dismissChoicePanel(o.msg))}),m(4,"nile-glyph",327),d()(),l(5,"ul",339),D(6,hl,5,2,"li",340,Y),d(),l(8,"div",341)(9,"button",323),g("click",function(){p(e);let o=r(),a=r(4);return u(a.onPanelPrev(o.msg))}),m(10,"nile-glyph",324),_(11," Back "),d(),l(12,"nile-button",21),g("click",function(){p(e);let o=r(),a=r(4);return u(a.submitChoices(o.msg))}),_(13),d()()}if(i&2){let e=r(),n=r(4);s(6),O(e.choices),s(6),A("disabled",!n.hasPendingDraft(e.msg)||n.isStreaming()?"":null),s(),F(" ",n.copy().submitAnswersButton," ")}}function fl(i,t){if(i&1&&(l(0,"div",319),h(1,ml,17,8)(2,Cl,14,2),d()),i&2){let e=t;s(),C(e.index<e.choices.length?1:2)}}function xl(i,t){if(i&1&&(l(0,"div",180),h(1,fl,3,1,"div",319),_e(2,165),d()),i&2){let e,n=r(3),o=oe(7);s(),C((e=n.activeChoicePanel())?1:-1,e),s(),b("ngTemplateOutlet",o)}}function bl(i,t){if(i&1){let e=k();l(0,"nile-ai-chat",179,3),g("mouseup",function(o){p(e);let a=r(2);return u(a.onThreadMouseUp(o))}),h(2,ma,11,0)(3,al,2,0),h(4,xl,3,2,"div",180),d()}if(i&2){let e=r(2);s(2),C(e.loadingConversation()?2:3),s(2),C(e.messages().length?4:-1)}}function yl(i,t){if(i&1&&h(0,ga,12,4,"div",157)(1,bl,5,2,"nile-ai-chat",158),i&2){let e=r();C(!e.loadingConversation()&&!e.messages().length?0:1)}}function vl(i,t){if(i&1&&(l(0,"div",345),m(1,"nile-glyph",352),l(2,"span"),_(3),d()()),i&2){let e=r(2);s(3),v(e.copy().dropFilesOverlay)}}function wl(i,t){if(i&1){let e=k();l(0,"div",346),m(1,"nile-glyph",31),l(2,"span",353),_(3),d(),l(4,"button",354),g("click",function(){p(e);let o=r(2);return u(o.clearReplyQuote())}),m(5,"nile-glyph",355),d()()}i&2&&(s(3),v(t))}function kl(i,t){i&1&&m(0,"nile-spinner",358)}function Pl(i,t){if(i&1){let e=k();l(0,"button",361),g("click",function(){p(e);let o=r().$implicit,a=r(3);return u(a.retryAttachment(o.id))}),_(1,"Retry"),d()}}function Al(i,t){if(i&1){let e=k();l(0,"div",357),m(1,"nile-glyph",202),l(2,"span",203),_(3),d(),h(4,kl,1,0,"nile-spinner",358)(5,Pl,2,0,"button",359),l(6,"button",360),g("click",function(){let o=p(e).$implicit,a=r(3);return u(a.removeAttachment(o.id))}),m(7,"nile-glyph",355),d()()}if(i&2){let e=t.$implicit;B("aq-chip--error",e.status==="error"),s(),A("name",e.contentType.startsWith("image/")?"ng-image-03":"ng-file-06"),s(),A("title",e.name),s(),v(e.name),s(),C(e.status==="uploading"?4:e.status==="error"?5:-1)}}function Ml(i,t){if(i&1&&(l(0,"div",347),D(1,Al,8,6,"div",356,te),d()),i&2){let e=r(2);s(),O(e.attachments())}}function Sl(i,t){if(i&1){let e=k();l(0,"nile-button",362),g("click",function(){p(e),r();let o=oe(5);return u(o.click())}),m(1,"nile-glyph",363),d()}if(i&2){let e=r(2);A("disabled",e.isStreaming()||e.attachAtCapacity()?"":null)}}function Tl(i,t){if(i&1){let e=k();l(0,"div",344),g("dragenter",function(o){p(e);let a=r();return u(a.onComposerDragEnter(o))})("dragover",function(o){p(e);let a=r();return u(a.onComposerDragOver(o))})("dragleave",function(o){p(e);let a=r();return u(a.onComposerDragLeave(o))})("drop",function(o){p(e);let a=r();return u(a.onComposerDrop(o))}),h(1,vl,4,1,"div",345),h(2,wl,6,1,"div",346),h(3,Ml,3,0,"div",347),l(4,"input",348,5),g("change",function(o){p(e);let a=r();return u(a.onFilesPicked(o))}),d(),l(6,"nile-ai-prompt",349,6),g("keydown",function(o){p(e);let a=r();return u(a.onComposerKeydown(o))})("nile-change",function(o){p(e);let a=r();return u(a.inputText.set((o.detail==null?null:o.detail.value)??""))})("nile-submit",function(o){p(e);let a=r();return u(a.onComposerSubmit(o.detail==null?null:o.detail.value))})("nile-stop",function(){p(e);let o=r();return u(o.stopStream())}),l(8,"div",350),g("click",function(o){return o.stopPropagation()}),h(9,Sl,2,1,"nile-button",351),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(),A("accept",n.acceptUploadTypes),s(2),B("aq-attach-full",n.attachAtCapacity()),b("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 Fl(i,t){if(i&1){let e=k();l(0,"div",364),g("pointerdown",function(o){p(e);let a=r();return u(a.startChatResize(o))}),d()}if(i&2){let e=r();B("is-active",e.isResizing())}}function Dl(i,t){if(i&1){let e=k();l(0,"div",366)(1,"div",371)(2,"span",372),_(3,"Preview"),d(),l(4,"span",373),_(5),d()(),l(6,"div",374)(7,"div",375),m(8,"nile-glyph",376),l(9,"nile-slide-toggle",377),g("nile-change",function(o){p(e);let a=r(2);return u(a.onFiltersToggle(o.detail.checked))}),d()(),l(10,"div",378)(11,"nile-button",379),g("click",function(){p(e);let o=r(2);return u(o.undoCanvas())}),m(12,"nile-glyph",380),_(13," Undo "),d(),l(14,"nile-button",381),g("click",function(){p(e);let o=r(2);return u(o.redoCanvas())}),m(15,"nile-glyph",382),d()(),m(16,"span",383),l(17,"nile-button",384),g("click",function(){p(e);let o=r(2);return u(o.closeArtifact())}),m(18,"nile-glyph",385),d()()()}if(i&2){let e=r(2);s(5),v(e.artifactSubtitle()),s(2),B("aq-filters-pill--active",e.artifactHasFilter()),s(2),b("isChecked",e.artifactHasFilter()),s(2),A("disabled",e.canUndoCanvas()?null:""),s(3),A("disabled",e.canRedoCanvas()?null:""),s(),A("color",e.canRedoCanvas()?"#344054":"#d0d5dd")}}function Ol(i,t){if(i&1&&(l(0,"div",368),m(1,"nile-glyph",386),l(2,"p",387),_(3),d(),l(4,"p",388),_(5),d()()),i&2){let e=r(2);s(3),v(e.copy().emptyCanvasTitle),s(2),v(e.copy().emptyCanvasSubtitle)}}function ql(i,t){if(i&1){let e=k();l(0,"shared-dashboard-grid",389,7),g("selectionChange",function(o){p(e);let a=r(2);return u(a.onSelectionChange(o))})("forecast",function(o){p(e);let a=r(2);return u(a.onArtifactForecast(o))})("setAlert",function(o){p(e);let a=r(2);return u(a.onSetAlert(o))})("filterSubmit",function(o){p(e);let a=r(2);return u(a.onArtifactFilterSubmit(o))})("filterChange",function(o){p(e);let a=r(2);return u(a.onArtifactFilterChange(o))})("dslWidgetUpdated",function(o){p(e);let a=r(2);return u(a.onDslWidgetUpdated(o))})("dslEditorClosed",function(){p(e);let o=r(2);return u(o.onArtifactDslEditorClosed())})("widgetClick",function(o){p(e);let a=r(2);return u(a.onKpiWidgetClicked(o))}),d()}if(i&2){let e=r(2);b("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 El(i,t){if(i&1){let e=k();l(0,"nile-button",20),g("click",function(){let o=p(e),a=r(3);return u(a.forecastFromChart(o))}),m(1,"nile-glyph",392),_(2),d()}if(i&2){let e=r(3);s(2),F(" ",e.copy().forecastButton," ")}}function Il(i,t){if(i&1){let e=k();l(0,"nile-button",20),g("click",function(){p(e);let o=r(3);return u(o.openStoryPicker())}),m(1,"nile-glyph",393),_(2),d()}if(i&2){let e=r(3);A("disabled",e.committingAction()||!e.hasSelection()?"":null),s(2),F(" ",e.copy().addToStoryButton," ")}}function Vl(i,t){if(i&1&&(l(0,"div",54),_(1),d()),i&2){let e=r(4);s(),v(e.copy().noResultsMatchFilters)}}function Rl(i,t){i&1&&_e(0)}function zl(i,t){if(i&1){let e=k();l(0,"nile-menu-item",67),g("click",function(){let o=p(e).$implicit,a=r(6);return a.showAddPicker.set(!1),u(a.addToExistingDashboard(o.id))}),fe(1,Rl,1,0,"ng-container",301),d()}if(i&2){let e=t.$implicit;r(6);let n=oe(37);s(),b("ngTemplateOutlet",n)("ngTemplateOutletContext",nt(2,li,e))}}function Nl(i,t){if(i&1&&(l(0,"div",76),_(1),d(),D(2,zl,2,4,"nile-menu-item",null,te)),i&2){let e=t.$implicit;s(),v(e.label),s(),O(e.items)}}function $l(i,t){if(i&1&&(l(0,"div",54),_(1),d()),i&2){let e=r(5);s(),v(e.copy().noDashboardsYet)}}function Ll(i,t){if(i&1&&D(0,Nl,4,1,null,null,ie,!1,$l,2,1,"div",54),i&2){let e=r(4);O(e.groupedPickerDashboards())}}function Wl(i,t){if(i&1){let e=k();l(0,"nile-dropdown",394),g("nile-hide",function(){p(e);let o=r(3);return u(o.showAddPicker.set(!1))}),l(1,"nile-button",300),g("click",function(){p(e);let o=r(3);return u(o.showAddPicker.set(!o.showAddPicker()))}),m(2,"nile-glyph",156),_(3),d(),l(4,"nile-menu",51),g("nile-search-value",function(o){p(e);let a=r(3);return u(a.pickerSearch.set((o.detail==null?null:o.detail.value)??""))}),l(5,"nile-menu-item",52),g("click",function(){p(e);let o=r(3);return o.showAddPicker.set(!1),u(o.addArtifactToDashboard())}),m(6,"nile-glyph",53),_(7),d(),h(8,Vl,2,1,"div",54)(9,Ll,3,1),d()()}if(i&2){let e=r(3);b("open",e.showAddPicker()),s(),A("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),s(2),F(" ",e.copy().addToDashboardButton," "),s(),A("noResultsMessage",e.copy().noResultsMatchFilters),s(3),F(" ",e.copy().newDashboardLabel," "),s(),C(e.pickerSearchEmpty()?8:9)}}function Bl(i,t){if(i&1){let e=k();l(0,"nile-button",21),g("click",function(){p(e);let o=r(3);return u(o.addArtifactToDashboard())}),m(1,"nile-glyph",156),_(2),d()}if(i&2){let e=r(3);A("loading",e.committingAction()==="add"?"":null)("disabled",e.committingAction()||!e.hasSelection()?"":null),s(2),F(" ",e.builderOpen()?e.copy().addToCurrentDashboardButton:e.copy().addToDashboardButton," ")}}function Ul(i,t){if(i&1){let e=k();l(0,"div",370),h(1,El,3,1,"nile-button",390),h(2,Il,3,2,"nile-button",390),l(3,"nile-button",20),g("click",function(){p(e);let o=r(2);return u(o.publishAsNewDashboard())}),_(4),d(),h(5,Wl,10,7,"nile-dropdown",391)(6,Bl,3,3,"nile-button",298),d()}if(i&2){let e,n=r(2);s(),C((e=n.artifactForecastMsg())?1:-1,e),s(),C(-1),s(),A("loading",n.committingAction()==="publish"?"":null)("disabled",n.committingAction()||!n.hasSelection()?"":null),s(),F(" ",n.copy().publishAsDashboardButton," "),s(),C(!n.builderOpen()&&n.nonAutoDashboards().length>1?5:6)}}function Gl(i,t){if(i&1&&(l(0,"aside",365),h(1,Dl,19,7,"div",366),l(2,"div",367),h(3,Ol,6,2,"div",368)(4,ql,2,15,"shared-dashboard-grid",369),d(),h(5,Ul,7,6,"div",370),_e(6,165),d()),i&2){let e=r(),n=oe(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(),b("ngTemplateOutlet",n)}}function Hl(i,t){i&1&&m(0,"nile-spinner",406)}function jl(i,t){i&1&&m(0,"nile-glyph",407)}function Yl(i,t){if(i&1){let e=k();l(0,"input",403),g("input",function(o){p(e);let a=r(2);return u(a.dashboardTitleDraft.set(o.target.value))})("keydown.enter",function(){p(e);let o=r(2);return u(o.commitDashboardTitle())})("keydown.escape",function(){p(e);let o=r(2);return u(o.cancelEditDashboardTitle())}),d(),l(1,"nile-lite-tooltip",404)(2,"button",405),g("click",function(){p(e);let o=r(2);return u(o.commitDashboardTitle())}),h(3,Hl,1,0,"nile-spinner",406)(4,jl,1,0,"nile-glyph",407),d()()}if(i&2){let e=r(2);b("value",e.dashboardTitleDraft()),s(2),b("disabled",e.renamingDashboard()),s(),C(e.renamingDashboard()?3:4)}}function Ql(i,t){i&1&&m(0,"nile-skeleton-loader",397)}function Kl(i,t){if(i&1){let e=k();l(0,"nile-lite-tooltip",409)(1,"button",410),g("click",function(){p(e);let o=r(3);return u(o.startEditDashboardTitle())}),m(2,"nile-glyph",411),d()()}}function Jl(i,t){if(i&1&&(l(0,"span",408),_(1),d(),h(2,Kl,3,0,"nile-lite-tooltip",409)),i&2){let e=r(2);s(),v((e.builderRef==null?null:e.builderRef.dashboardName())||"Dashboard"),s(),C(e.builderDashboardId()?2:-1)}}function Xl(i,t){if(i&1){let e=k();l(0,"section",16)(1,"header",395)(2,"div",32)(3,"nile-button",384),g("click",function(){p(e);let o=r();return u(o.closeBuilder())}),m(4,"nile-glyph",396),d(),h(5,Yl,5,3)(6,Ql,1,0,"nile-skeleton-loader",397)(7,Jl,3,2),d(),l(8,"div",34)(9,"nile-lite-tooltip",398)(10,"button",399),g("click",function(){p(e);let o=r();return u(o.toggleBuilderFullscreen())}),m(11,"nile-glyph",400),d()(),l(12,"shared-builder-toolbar",401),g("action",function(o){p(e);let a=r();return u(a.onBuilderMenuAction(o))}),d()()(),l(13,"shared-builder-host",402),g("exitBuilder",function(){p(e);let o=r();return u(o.closeBuilder())})("executiveSummary",function(o){p(e);let a=r();return u(a.onExecutiveSummary(o))})("galleryPrompt",function(o){p(e);let a=r();return u(a.inputText.set(o))})("published",function(o){p(e);let a=r();return u(a.onBuilderPublished(o))})("widgetClick",function(o){p(e);let a=r();return u(a.onKpiWidgetClicked(o))}),d(),_e(14,165),d()}if(i&2){let e=r(),n=oe(32);s(5),C(e.editingDashboardTitle()?5:e.builderRef!=null&&e.builderRef.loading()?6:7),s(4),b("content",e.builderFullscreen()?"Exit full screen":"Full screen"),s(),A("aria-label",e.builderFullscreen()?"Exit full screen":"Full screen"),s(),A("name",e.builderFullscreen()?"ng-minimize":"ng-maximize"),s(),b("canToggleFilter",!0)("hasFilter",(e.builderRef==null?null:e.builderRef.hasFilter())??!1)("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(),b("dashboardId",e.builderDashboardId())("preseeded",e.builderPreseeded())("galleryPrompts",e.suggestions())("canAddToStory",!1),s(),b("ngTemplateOutlet",n)}}function Zl(i,t){if(i&1){let e=k();l(0,"label",422)(1,"input",423),g("change",function(){let o=p(e).$implicit,a=r(3);return u(a.onGranularityPick(o))}),d(),l(2,"span"),_(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),A("title",e.reason||null),s(),b("value",e.value)("checked",n.granularity===e.value)("disabled",!e.enabled),s(2),v(e.value)}}function es(i,t){i&1&&(l(0,"p",416),_(1),d()),i&2&&(s(),v(t))}function ts(i,t){if(i&1&&(l(0,"p",416),_(1),d()),i&2){let e=r();s(),v(e.granularityNote)}}function ns(i,t){if(i&1&&(l(0,"div",412)(1,"span",424),_(2,"Model"),d(),l(3,"div",425)(4,"p",426),_(5),d(),l(6,"p",427),_(7),d()()()),i&2){let e=t;s(5),v(e.title),s(2),v(e.body)}}function is(i,t){if(i&1&&(l(0,"div",412)(1,"span",424),_(2,"Guardrails"),d(),l(3,"div",428)(4,"p",426),m(5,"nile-glyph",429),_(6),d(),l(7,"p",427),_(8),d()()()),i&2){let e=t;s(3),B("fs-card--pass",e.passed)("fs-card--warn",!e.passed),s(2),A("name",e.passed?"ng-check":"ng-alert-circle")("color",e.passed?"#079455":"#dc6803"),s(),F(" ",e.title," "),s(2),v(e.body)}}function os(i,t){if(i&1){let e=k();l(0,"div",412)(1,"label",413),_(2," Horizon \u2014 "),l(3,"span",414),_(4),d()(),l(5,"input",415),g("input",function(o){p(e);let a=r(2);return u(a.onHorizonInput(o.target.value))}),d(),l(6,"p",416),_(7),d()(),l(8,"div",412)(9,"span",417),_(10,"Granularity"),d(),l(11,"div",418),D(12,Zl,4,9,"label",419,Xe),d(),h(14,es,2,1,"p",416)(15,ts,2,1,"p",416),d(),l(16,"div",412)(17,"label",420),_(18," Confidence interval \u2014 "),l(19,"span",414),_(20),d()(),l(21,"input",421),g("input",function(o){p(e);let a=r(2);return u(a.onConfidenceIndexInput(o.target.value))}),d(),l(22,"p",416),_(23),d()(),h(24,ns,8,2,"div",412),h(25,is,9,8,"div",412)}if(i&2){let e,n,o,a=t,c=r(),f=r();s(4),Q("",c.horizon," ",f.horizonUnit()),s(),Z("--fs-fill",f.horizonFill()),b("value",c.horizon),A("max",f.horizonMax())("aria-valuetext",c.horizon+" "+f.horizonUnit()),s(2),v(f.horizonNote()),s(5),O(f.granularityChoices()),s(2),C((e=f.unavailableGranularityNote())?14:15,e),s(6),F("",c.confidence,"%"),s(),Z("--fs-fill",f.confidenceFill()),b("value",f.confidenceIndex()),A("max",a.confidenceLevels.length-1)("aria-valuetext",c.confidence+"%"),s(2),v(a.confidenceNote),s(),C((n=a.modelCard)?24:-1,n),s(),C((o=a.guardrails)?25:-1,o)}}function as(i,t){if(i&1&&h(0,os,26,18),i&2){let e,n=r();C((e=n.forecastCopy())?0:-1,e)}}function rs(i,t){if(i&1&&(l(0,"div",433),m(1,"nile-skeleton-loader",434),l(2,"div",435),m(3,"nile-skeleton-loader",74),d()()),i&2){let e=t.$implicit;s(2),Z("width",e,"px")}}function ls(i,t){if(i&1&&(l(0,"div",431),D(1,rs,4,2,"div",433,Y),d()),i&2){let e=r(2);s(),O(e.gallerySkeletonRows)}}function ss(i,t){if(i&1){let e=k();l(0,"nile-ai-prompts",436),g("nile-item-click",function(o){p(e);let a=r(2);return u(a.onGalleryPromptPick(o.detail==null?null:o.detail.data))}),d()}if(i&2){let e=r(2);b("items",e.galleryPromptItems())("vertical",!0)("wrap",!0)}}function ds(i,t){if(i&1&&(l(0,"div",124),_(1),d()),i&2){let e=r(2);s(),Q("",e.copy().noPromptsMatch,' "',e.gallerySearch(),'".')}}function cs(i,t){if(i&1&&(l(0,"div",124),_(1),d()),i&2){let e=r(2);s(),v(e.copy().noPromptsYet)}}function _s(i,t){if(i&1){let e=k();l(0,"nile-input",430),g("nile-input",function(o){p(e);let a=r();return u(a.gallerySearch.set((o.detail==null?null:o.detail.value)??""))})("nile-change",function(o){p(e);let a=r();return u(a.gallerySearch.set((o.detail==null?null:o.detail.value)??""))}),m(1,"nile-glyph",105),d(),h(2,ls,3,0,"div",431)(3,ss,1,3,"nile-ai-prompts",432)(4,ds,2,2,"div",124)(5,cs,2,1,"div",124)}if(i&2){let e=r();b("placeholder",e.copy().promptGallerySearchPlaceholder)("value",e.gallerySearch()),s(2),C(e.suggestionsLoading()?2:e.filteredGalleryPrompts().length?3:e.gallerySearch().trim()?4:5)}}function ps(i,t){i&1&&(l(0,"nile-breadcrumb-item"),_(1),d()),i&2&&(s(),F(" ",t," "))}function us(i,t){i&1&&_(0),i&2&&F(" ",t," ")}function gs(i,t){i&1&&m(0,"nile-skeleton-loader",440)}function ms(i,t){if(i&1&&m(0,"nile-skeleton-loader",448),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 hs(i,t){if(i&1&&(l(0,"div",446),D(1,ms,1,8,"nile-skeleton-loader",447,Y),d()),i&2){let e=r(4);Z("height",e.widgetDetailPanelSkeletonHeight(),"px"),s(),O(e.widgetDetailPanelSkeletonSlots())}}function Cs(i,t){i&1&&(l(0,"div",445)(1,"div",449),m(2,"nile-skeleton-loader",450)(3,"nile-skeleton-loader",450)(4,"nile-skeleton-loader",450),d(),m(5,"nile-skeleton-loader",451),d())}function fs(i,t){if(i&1&&h(0,hs,3,2,"div",444)(1,Cs,6,0,"div",445),i&2){let e=r(3);C(e.widgetDetailPanelSkeletonSlots().length?0:1)}}function xs(i,t){if(i&1){let e=k();l(0,"shared-dashboard-grid",452),g("selectionChange",function(o){p(e);let a=r(3);return u(a.widgetDetailPanelSelectedIds.set(o))}),d()}if(i&2){let e=r(3);b("widgets",e.widgetDetailPanelWidgets())("editMode",!1)("selectable",e.widgetDetailPanelKind()==="dashboard")("selectedWidgetIds",e.widgetDetailPanelSelectedIds())("canSetAlert",!1)("canAddToStory",!1)("canForecast",!1)}}function bs(i,t){if(i&1){let e=k();l(0,"div",443)(1,"span",453),_(2),d(),l(3,"nile-button",20),g("click",function(){p(e);let o=r(3);return u(o.toggleSelectAllDetailPanelWidgets())}),_(4),d(),l(5,"nile-button",20),g("click",function(){p(e);let o=r(3);return u(o.addSelectedDetailPanelWidgetsToCanvas())}),m(6,"nile-glyph",454),_(7),d(),l(8,"nile-button",21),g("click",function(){p(e);let o=r(3);return u(o.replaceCanvasWithDetailPanel())}),m(9,"nile-glyph",455),_(10," Replace canvas "),d()()}if(i&2){let e=r(3);s(2),Q(" ",e.widgetDetailPanelSelectedIds().length," of ",e.widgetDetailPanelWidgets().length," selected "),s(2),F(" ",e.isDetailPanelFullySelected()?"Deselect all":"Select all"," "),s(),A("disabled",e.widgetDetailPanelSelectedIds().length?null:""),s(2),F(" Add ",e.widgetDetailPanelSelectedIds().length," to canvas "),s(),A("disabled",e.widgetDetailPanelWidgets().length?null:"")}}function ys(i,t){if(i&1){let e=k();l(0,"div",443)(1,"nile-button",21),g("click",function(){p(e);let o=r(3);return u(o.addWidgetTemplateFromDetailPanel())}),m(2,"nile-glyph",156),_(3," Add to dashboard "),d()()}}function vs(i,t){if(i&1){let e=k();l(0,"div",437)(1,"div",438)(2,"nile-breadcrumb",439),g("nile-click",function(){p(e);let o=r(2);return u(o.closeWidgetDetailPanel())}),l(3,"nile-breadcrumb-item"),_(4),d(),h(5,ps,2,1,"nile-breadcrumb-item"),l(6,"nile-breadcrumb-item"),h(7,us,1,1)(8,gs,1,0,"nile-skeleton-loader",440),d()()(),l(9,"div",441),h(10,fs,2,1)(11,xs,1,7,"shared-dashboard-grid",442),d(),h(12,bs,11,6,"div",443)(13,ys,4,0,"div",443),d()}if(i&2){let e,n,o=r(2);s(4),F(" ",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 ws(i,t){if(i&1&&h(0,vs,14,5,"div",437),i&2){let e=r();C(e.widgetDetailPanelOpen()?0:-1)}}function ks(i,t){if(i&1){let e=k();l(0,"app-alert-drawer",456),g("closed",function(){p(e);let o=r();return u(o.onAlertClosed())})("saved",function(){p(e);let o=r();return u(o.onAlertClosed())}),d()}if(i&2){let e,n=r();b("open",n.alertDrawerOpen())("widget",n.alertWidget())("dashboardId",null)("source",n.alertSource())("sourceName",((e=n.selectedScope())==null?null:e.name)??"")("authoringMode","chat")}}function Ps(i,t){i&1&&m(0,"nile-executive-summary",28,8)}function As(i,t){if(i&1){let e=k();l(0,"app-story-picker-drawer",457),g("closed",function(){p(e);let o=r();return u(o.closeStoryPicker())})("added",function(){p(e);let o=r();return u(o.onAddedToStory())}),d()}if(i&2){let e=r();b("open",e.storyPickerOpen())("widget",e.storyPickerWidget())}}function Ms(i,t){if(i&1&&(l(0,"div",71),m(1,"nile-glyph",92),l(2,"div",73)(3,"span",85),_(4),d(),l(5,"span",86),_(6),d()()()),i&2){let e=t.$implicit,n=r();s(3),b("title",e.name||"Untitled"),s(),v(e.name||"Untitled"),s(2),v(n.dashboardMeta(e))}}function me(){return Math.random().toString(36).slice(2)}function Ss(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 f of c)n.push(T(y({},f),{y:o}));o+=Math.max(...c.map(f=>f.h))}return n}var Ts=4,Fs="forecast-settings",Ds="forecast-this";function ci(i){return i.split(`
7
+ `).map(t=>{let e=/^For "[^"]+":\s*(.*)$/.exec(t);return e?e[1]:t}).join(`
8
+ `)}function ai(i){return{id:i.id,role:i.role,text:i.role==="user"?ci(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 Se=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=st(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(T(y({},this.artifactToWidget(t)),{id:"chat-alert"})))}aqChatEl;builderRef;artifactGridRef;composerRef;aiExecutiveSummaryEl;svc=$(we);tokenStore=$(se);features(){return R().features}copy(){return R().copy}showHeader(){return R().ui.header}withCount(t,e){return In(t,e)}zone=$(kt);appRef=$(Mt);route=$(Ut);router=$(Gt);dashboardState=$(an);publishRepo=$(de);globalWidget=$(Tn);forecastApi=$(Qe);forecastService=$(ln);loading=x(!0);conversations=x([]);activeConversationId=x(null);conversationCustomerId=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=T(y({},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)=>T(y({},this.artifactToWidget(e)),{id:`detail-panel-${n}`}));return ot(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,Ts).map(e=>(R().features.forecast&&t?!!mt(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 Ve({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)=>T(y({},this.artifactToWidget(o)),{id:`${t}-${a}`})),n=ot(e);return on(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?T(y({},o),{config:a.config,edited:a.edited}):o,f=n.get(o.id);return f?T(y({},c),{config:f}):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(()=>Rn({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=()=>{let t=this.tokenStore.tenantId();return R().customerId??t??""};attachments=x([]);uploadsInFlight=q(()=>this.attachments().some(t=>t.status==="uploading"));excelCount=q(()=>this.attachments().filter(t=>ut(t.name,t.contentType)).length);nonExcelCount=q(()=>this.attachments().length-this.excelCount());attachAtCapacity=q(()=>this.nonExcelCount()>=_t&&this.excelCount()>=pt);acceptUploadTypes=[...ct,".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(){Pe(()=>{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 f=[...c.widgetSuggestions??[],...c.conversationStarters??[]];this.suggestions.set(f.length?f: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)),Pe(()=>{let t=this.customerId();t&&qt(()=>{let e=this.conversationCustomerId();!e||e===t||this.resetForTenantChange()})})}resetForTenantChange(){this.activeConversationId.set(null),this.conversationCustomerId.set(null),this.conversationConnectionId.set(null),this.messages.set([]),this.conversations.set([]),this.closeArtifact(),this.builderOpen.set(!1),this.builderPreseeded.set(!1),this.builderDashboardId.set(null),this.conversationsLoading.set(!0),this.svc.listConversations().then(t=>this.conversations.set(t)).catch(()=>this.conversations.set([])).finally(()=>this.conversationsLoading.set(!1)),this.loadConversationDashboards()}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.conversationCustomerId.set(this.customerId()),this.conversationConnectionId.set(o.conversation.connectionId??null),this.messages.set(o.messages.map(ai)),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 st(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.conversationCustomerId.set(this.customerId()),this.conversationConnectionId.set(e.conversation.connectionId??null),this.messages.set(e.messages.map(ai)),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.conversationCustomerId.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.conversationCustomerId.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(T(y({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)}}}convSearch=x("");dashSearch=x("");renamingId=x(null);renameDraft=x("");static BUCKETS=[{key:"today",maxDays:0},{key:"yesterday",maxDays:1},{key:"week",maxDays:7},{key:"older",maxDays:1/0}];daysAgo(t){if(!t)return 1/0;let e=new Date(t);if(Number.isNaN(e.getTime()))return 1/0;let n=new Date;n.setHours(0,0,0,0);let o=new Date(e);return o.setHours(0,0,0,0),Math.round((n.getTime()-o.getTime())/864e5)}relativeStamp(t){if(!t)return"";let e=new Date(t);return Number.isNaN(e.getTime())?"":this.daysAgo(t)===0?e.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):e.toLocaleDateString(void 0,{month:"short",day:"numeric"})}bucketLabel(t){let e=this.copy();return t==="today"?e.groupToday:t==="yesterday"?e.groupYesterday:t==="week"?e.groupPrevious7Days:e.groupOlder}groupByRecency(t,e){let n=[],o=[...t].sort((a,c)=>new Date(e(c)??0).getTime()-new Date(e(a)??0).getTime());for(let a of i.BUCKETS){let c=o.filter(f=>this.daysAgo(e(f))<=a.maxDays);if(c.length&&n.push({key:a.key,label:this.bucketLabel(a.key),items:c}),o=o.filter(f=>this.daysAgo(e(f))>a.maxDays),!o.length)break}return n}matches(t,e){return e?(t??"").toLowerCase().includes(e.toLowerCase()):!0}groupedConversations=q(()=>this.groupByRecency(this.conversations().filter(t=>this.matches(t.title,this.convSearch())),t=>t.updatedAt));groupedDashboards=q(()=>this.groupByRecency(this.nonAutoDashboards().filter(t=>this.matches(t.name,this.dashSearch())),t=>t.updatedAt));pickerSearch=x("");groupedPickerDashboards=q(()=>this.groupByRecency(this.nonAutoDashboards().filter(t=>this.matches(t.name,this.pickerSearch())),t=>t.updatedAt));pickerSearchEmpty=q(()=>!!this.pickerSearch()&&this.groupedPickerDashboards().length===0);convSearchEmpty=q(()=>!!this.convSearch()&&this.groupedConversations().length===0);dashSearchEmpty=q(()=>!!this.dashSearch()&&this.groupedDashboards().length===0);countClause(t,e){return typeof t!="number"||!Number.isFinite(t)?"":`${t} ${e}${t===1?"":"s"}`}conversationMeta(t){let e=this.relativeStamp(t.lastMessageAt??t.updatedAt);return[this.countClause(t.messageCount,"message"),e].filter(Boolean).join(" \xB7 ")}dashboardMeta(t){let e=this.relativeStamp(t.updatedAt);return[this.countClause(t.widgetCount,"widget"),e].filter(Boolean).join(" \xB7 ")}startRename(t,e,n){t.stopPropagation(),this.renamingId.set(e),this.renameDraft.set(n??"")}cancelRename(t){t?.stopPropagation(),this.renamingId.set(null)}async commitRenameConversation(t,e){t.stopPropagation();let n=this.renameDraft().trim();if(this.renamingId.set(null),!(!n||n===e.title))try{await this.svc.updateConversation(e.id,{title:n}),this.conversations.update(o=>o.map(a=>a.id===e.id?T(y({},a),{title:n}):a))}catch{}}async commitRenameDashboard(t,e){t.stopPropagation();let n=this.renameDraft().trim();if(this.renamingId.set(null),!(!n||n===e.name))try{await this.svc.updateDashboard(e.id,{name:n}),this.conversationDashboards.update(o=>o.map(a=>a.id===e.id?T(y({},a),{name:n}):a))}catch{}}async deleteDashboardFromMenu(t,e){t.stopPropagation();try{await this.svc.deleteDashboard(e),this.conversationDashboards.update(n=>n.filter(o=>o.id!==e)),this.builderDashboardId()===e&&this.builderOpen.set(!1)}catch{}}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?T(y({},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=ut(t.name,t.type);if(e&&this.excelCount()>=pt||!e&&this.nonExcelCount()>=_t||!e&&!ct.includes(t.type)||t.size>Vn||this.attachments().some(f=>f.name===t.name&&f.size===t.size&&f.file?.lastModified===t.lastModified))return;let o=me(),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(f=>[...f,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?y(y({},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?T(y({},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?T(y({},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}`),T(y({},a),{selected:"__chat__",draftSelection:void 0,chatOpen:!1});if(!a.draftSelection)return a;let f=a.options.find(w=>w.id===a.draftSelection);return f&&(e.push(f.reply??f.label),n.push(`${this.choiceTitle(a)}: ${f.label}`)),T(y({},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?T(y({},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?T(y({},o),{chatOpen:!0,draftSelection:void 0}):o)}))}onChatDraftTextChange(t,e,n){this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?T(y({},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?T(y({},a),{chatOpen:!1}):a)}));return}this.updateAssistantMsg(t.id,o=>({choices:(o.choices??[]).map(a=>a===e?T(y({},a),{selected:"__chat__",chatOpen:!1}):a)})),this.inputText.set(this.chatDraftReply(e,n)),this.sendMessage()}}choicePanelIndex=new Map;dismissedChoicePanels=new Set;nonPanelChoices(t){return this.isMultiChoice(t)?[]:t.choices??[]}panelAnsweredCount(t){return t.filter(e=>!!e.selected||!!e.draftSelection||!!e.chatDraftText?.trim()).length}isChoicePanelComplete(t){return t.every(e=>!!e.selected)}choicePanelIndexFor(t,e){return this.choicePanelIndex.has(t.id)||this.choicePanelIndex.set(t.id,this.panelAnsweredCount(e)),Math.min(this.choicePanelIndex.get(t.id),e.length)}activeChoicePanel(){let t=this.messages();for(let e=t.length-1;e>=0;e--){let n=t[e];if(!this.isMultiChoice(n))continue;let o=n.choices;if(!this.isChoicePanelComplete(o)&&!this.dismissedChoicePanels.has(n.id))return{msg:n,choices:o,index:this.choicePanelIndexFor(n,o)}}return null}panelBadgeLabel(t){switch(t.kind){case"plan_intake":return"SETUP";case"widget_clarification":case"clarification":return"CLARIFY";default:return null}}chatDraftPlaceholderFor(t){switch(t.kind){case"widget_clarification":return this.copy().chatDraftPlaceholderWidget;case"widget_plan":return this.copy().chatDraftPlaceholderPlan;case"plan_intake":return this.copy().chatDraftPlaceholderIntake;default:return this.copy().chatDraftPlaceholderClarification}}panelAnswerLabel(t){let e=t.chatDraftText?.trim();if(e)return e;let n=t.draftSelection??t.selected,o=t.options.find(a=>a.id===n);return o?o.label==="Use this"?"Recommended":o.label:"Skipped"}optionPrimaryText(t){return t.label==="Use this"&&t.hint?t.hint:t.label}optionBadgeText(t){return t.label==="Use this"&&t.hint?"Recommended":null}advanceChoicePanel(t){let e=this.choicePanelIndex.get(t.id)??0;this.choicePanelIndex.set(t.id,e+1)}onPanelChatDraftConfirm(t,e){!e.chatDraftText?.trim()||this.isStreaming()||(this.defineChatDraft(t,e),this.advanceChoicePanel(t))}onPanelSkip(t){this.isStreaming()||this.advanceChoicePanel(t)}onPanelPrev(t){let e=this.choicePanelIndex.get(t.id)??0;e>0&&this.choicePanelIndex.set(t.id,e-1)}dismissChoicePanel(t){this.dismissedChoicePanels.add(t.id)}resumeChoicePanel(t){this.dismissedChoicePanels.delete(t.id)}isChoicePanelDismissed(t){return this.dismissedChoicePanels.has(t.id)}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(S=>S instanceof HTMLElement&&S.classList.contains("reply-badge")))return;let n=document.getSelection(),o=n?.toString().trim()??"",a=e.some(S=>S instanceof HTMLElement&&S.classList.contains("assistant-text"));if(!n||!o||!a){this.quoteBadge.set(null);return}let c=46,f=Math.min(Math.max(t.clientX,c+8),window.innerWidth-c-8),M=t.clientY>=34;this.quoteBadge.set({text:o,top:t.clientY,left:f,above:M})}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?mt(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=jn(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},f=t.charts[0]?.config??{};return this.runForecast(e,c,{queryMeta:f.queryMeta,dataSourceId:f.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=yt(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&&yt(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=bt(o,e.series??[]);this.lastForecastRequest=T(y({},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=S=>!!S&&this.messages().some(P=>P.id===S);if(o.inPlace&&a(this.forecastChartMsgId)){let S=this.messages().find(P=>P.id===this.forecastChartMsgId)?.charts[0]?.config??{};return this.recomputeForecastInPlace(this.forecastChartMsgId,e,{queryMeta:n.queryMeta??S.queryMeta,dataSourceId:n.dataSourceId??S.dataSourceId})}let c=a(o.chartMsgId??null)?o.chartMsgId:null;this.inputText.set("");let f={id:me(),role:"user",text:t,charts:[],isStreaming:!1,hasError:!1},w=me(),M={id:"forecast",callIds:["forecast"],pending:1,baseLabel:"Forecasting",label:"Forecasting",status:"running"};this.messages.update(S=>[...S,f,{id:w,role:"assistant",text:"",thinking:"Forecasting",charts:[],isStreaming:!0,hasError:!1,animate:!0,forecast:!0,tools:[M]}]),this.isStreaming.set(!0),this.scrollToBottom();try{let S=await this.forecastApi.compute(y(y({},e),this.activeConversationId()?{conversationId:this.activeConversationId(),prompt:t}:{})),P=bt(S,e.series??[]);this.lastForecastRequest=y(y(T(y({},e),{horizon:P.horizon,granularity:P.granularity,confidence:P.confidence}),S.historyQuery?.sql?{historySql:S.historyQuery.sql}:{}),S.cohortQuery?.sql?{cohortSql:S.cohortQuery.sql}:{}),this.appliedForecastSettings.set({horizon:P.horizon,granularity:P.granularity,confidence:P.confidence}),this.forecastMaxHorizon.set(P.maxHorizon),this.forecastFitted.set({periods:S.fittedPeriods,granularity:S.sourceGranularity}),this.forecastGuardrails.set(S.guardrails),this.forecastModelCard.set(S.modelCard),S.conversationTitle&&this.forecastTitle.set(S.conversationTitle),n.queryMeta&&(P.chart.queryMeta=n.queryMeta),n.dataSourceId&&(P.chart.dataSourceId=n.dataSourceId),P.chart.config&&(P.chart.config.forecast={enabled:!0,horizon:P.horizon,granularity:P.granularity,confidence:P.confidence});let z={title:P.chart.title,componentName:P.chart.componentName,config:P.chart},X=c??w;if(this.forecastChartMsgId=X,this.forecastTurnMsgId=w,c){let K=this.messages().find(U=>U.id===c);this.updateAssistantMsg(c,y({charts:[z],forecastMeta:P.meta,forecast:!0},K?.preForecastCharts?.length?{}:{preForecastCharts:K?.charts??[]})),this.updateAssistantMsg(w,{isStreaming:!1,thinking:void 0,tools:[],text:P.answer,followUps:S.followUps})}else this.updateAssistantMsg(w,{isStreaming:!1,thinking:void 0,tools:[],text:P.answer,charts:[z],forecastMeta:P.meta,followUps:S.followUps});this.isStreaming.set(!1),this.scrollToBottom()}catch(S){let P=S;P?.isRefusal&&P.message?this.updateAssistantMsg(w,{isStreaming:!1,thinking:void 0,tools:[],text:P.message}):(console.error("[ask-aquera] forecast failed",S),this.updateAssistantMsg(w,{isStreaming:!1,thinking:void 0,tools:[],hasError:!0})),this.isStreaming.set(!1)}}refineForecast(t,e){let n=this.lastForecastRequest;if(!n)return;let o=T(y(y({},n),t),{filters:y(y({},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===Ds){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===Fs){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 Xn(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:Me(t.copy?.granularityNote??"",n),confidenceNote:Me(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&&y(y({},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:Zn(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(y({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:me(),role:"user",text:this.pendingDisplayOverride??ci(e),answerSummary:!!this.pendingDisplayOverride,quotedText:t,charts:[],attachments:a,isStreaming:!1,hasError:!1};this.pendingDisplayOverride=null,this.messages.update(N=>[...N,c]);let f=me();this.messages.update(N=>[...N,{id:f,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 w=new AbortController;this.streamAbort=w,this.scrollToBottom();let M="",S="Thinking",P=[],z=!1,X=!1,K=!1,U=new Set,j=N=>{let J=N?.queryMeta,I=J?.sql??(J?.dsl?JSON.stringify(J.dsl):N?.title??"");return`${N?.componentName??""}|${I}`},ce=()=>{if(z||P.length===0)return;z=!0;let N=P.splice(0);this.updateAssistantMsg(f,J=>({charts:[...J.charts,...N]})),this.scrollToBottom()};try{let N=this.selectedScope(),J=N?N.id:null,I=N?.kind==="pipeline";await this.svc.streamChat(this.activeConversationId(),n,{onText:E=>{M+=E,!z&&P.length>=1&&this.zone.run(()=>ce())},onToolStart:(E,L)=>{M="",S=L||"Working",this.zone.run(()=>{this.updateAssistantMsg(f,G=>({thinking:S,tools:zn(G.tools??[],E,S)}))})},onToolResult:(E,L,G)=>{this.zone.run(()=>{this.updateAssistantMsg(f,H=>({tools:Nn(H.tools??[],E,L,G)}))})},onDataPart:async E=>{if(E.data_type==="adhoc_viz"&&E.data){await kn(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(f,ae=>{let Fe=G?ae.charts.findIndex(H):-1;return{charts:Fe===-1?[...ae.charts,L]:ae.charts.map((_i,pi)=>pi===Fe?L:_i)}}),this.scrollToBottom();return}let W=G?P.findIndex(H):-1;W===-1?P.push(L):P[W]=L,P.length>=2&&ce()})}},onDashboardTitle:E=>{E&&this.zone.run(()=>this.updateAssistantMsg(f,{dashboardTitle:E}))},onChoice:E=>{E?.options?.length&&this.zone.run(()=>this.updateAssistantMsg(f,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 P){let W=G(H.config);W&&(H.config=T(y({},H.config),{layout:W}))}this.zone.run(()=>this.updateAssistantMsg(f,H=>({charts:H.charts.map(W=>{let ae=G(W.config);return ae?T(y({},W),{config:T(y({},W.config),{layout:ae})}):W})})))},onError:()=>{X=!0},onFinish:(E,L)=>{K=!0,this.zone.run(()=>{ce(),this.updateAssistantMsg(f,{isStreaming:!1,thinking:void 0,text:M}),this.isStreaming.set(!1);let G=this.messages().find(W=>W.id===f);gt({finishReason:E,sawError:X,producedContent:!!(G?.text||G?.charts.length||G?.choices?.length)})&&this.showStreamError(f),L&&!this.activeConversationId()&&(this.activeConversationId.set(L),this.conversationCustomerId.set(this.customerId()),this.conversationsLoading.set(!0),this.svc.listConversations().then(W=>{this.conversations.set(W);let ae=W.find(Fe=>Fe.id===L);this.conversationConnectionId.set(ae?.connectionId??null)}).finally(()=>this.conversationsLoading.set(!1))),this.loadConversationDashboards(),this.messages().find(W=>W.id===f)?.charts.length||this.scrollToBottom()})}},J,w.signal,a,I,this.builderDashboardId())}catch(N){w.signal.aborted||N instanceof DOMException&&N.name==="AbortError"||this.zone.run(()=>this.showStreamError(f))}finally{this.zone.run(()=>{!K&&gt({sawError:X,producedContent:!1})&&this.showStreamError(f),this.updateAssistantMsg(f,{isStreaming:!1,thinking:void 0}),this.streamAbort===w&&(this.isStreaming.set(!1),this.streamAbort=null)})}}showStreamError(t){this.messages.update(e=>Ln(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?T(y({},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=nn();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(Ss((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(f=>({title:f.title,componentName:f.componentName,config:f})))}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 xn(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=>!Ve(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:f,filterExplanation:w}=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(f),this.applySummary.set(Pn(c,this.buildActiveFilters(t.filters))),this.filterExplanation.set(w)}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=tn(this.baseArtifactWidgets(),t,o=>Ve(o)),n=new Map;for(let[o,a]of e)n.set(o,{config:a.config,edited:a.edited});this.filterOverlay.set(n)}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(y({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=ye(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=ye(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=ye(t.map(a=>this.artifactToWidget(a)));this.dashboardState.addWidgets(n);let o=await this.svc.createDashboard(T(y({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=ye(t.map(o=>{let a=me();return y({id:a},at(this.artifactToWidget(o),a))}));await this.svc.createDashboard(T(y({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=T(y({},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=ye(this.activeArtifact().map(n=>{let o=me();return y({id:o},at(this.artifactToWidget(n),o))}));this.savingDashboard.set(!0);try{let n=await this.svc.createDashboard(T(y({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=bn(n).map(w=>{if(w.type==="custom"){let S=w.id==="manageFilters"&&o>0?`${w.label} (${o})`:w.label;return{key:w.id,label:S,glyph:w.glyph,divider:w.divider,method:w.method,color:w.color,kind:"custom"}}let M=w.downloadPng?"exportPng":w.downloadCsv?"exportCsv":"print";return{key:M,label:w.label??M,glyph:w.glyph,divider:w.divider,kind:M}});this.isDslEditableChart(e)&&a.push({key:"editDsl",label:"Edit query",glyph:"ng-code",divider:!0,kind:"custom"});let c=this.inlineViewModeFor(e),f=this.inlineHasQueryableData(e);return c==="chart"?(a.push({key:"viewData",label:"Chart Data",glyph:"ng-table",divider:!this.isDslEditableChart(e),kind:"custom"}),f&&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"}),f&&c!=="records"&&a.push({key:"viewRecords",label:"View Records",glyph:"ng-database",kind:"custom"})),c!=="chart"?yn(a,w=>w.key==="viewChart"||w.key==="viewRecords",w=>w.key==="setAlert"||w.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=T(y({},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=$(cn,{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}=un(e);if(!this.isKpiChart(t))return{type:"grid",data:o,columns:n.map(M=>({id:M,header:M,accessorKey:M,enableSorting:!0}))};let c=o[0]?.[n[0]]??null,f=pn({config:t.config?.config,queryMeta:this.chartQueryMeta(t)});return{type:"grid",data:[{field:"Value",text:c,emphasize:!0},...f.map(M=>({field:M.label,text:M.text}))],columns:[{id:"field",header:"Field",accessorKey:"field",enableSorting:!1,width:"140px",cell:M=>it`<strong>${M.value}</strong>`},{id:"text",header:"Value",accessorKey:"text",enableSorting:!1,cell:M=>{let P=M.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 it`<span style=${P}>${M.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=T(y({},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=>T(y({},c),{charts:c.charts.map(f=>f===t?o:f)})))}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?Re(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(!(!gn(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?Re(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?Re(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 hn(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(mn),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(M=>M.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 M=this.inlineFilterBuilderValues();if(M.length===0)return;a={id:`f${++this.inlineFilterSeq}`,fieldId:e,operator:n,values:[...M]}}else{let M=this.inlineFilterBuilderValue().trim();if(!M)return;let S=o.needsSecondValue?this.inlineFilterBuilderValue2().trim():void 0;if(o.needsSecondValue&&!S)return;a={id:`f${++this.inlineFilterSeq}`,fieldId:e,operator:n,value:M,value2:S}}let c=this.inlineChartKey(t),f=[...this.inlineFilters.get(c)??[],a];await this.reapplyInlineFilters(t,c,f)&&(this.inlineFilters.set(c,f),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),y(y({},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(),ze()}extractMessage(t,e){return Ne(t,e)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Ce({type:i,selectors:[["app-ask-aquera-page"]],viewQuery:function(e,n){if(e&1&&St(Ni,5)(lt,5)($i,5)(Li,5)(Wi,5)(rt,5),e&2){let o;pe(o=ue())&&(n.aqChatEl=o.first),pe(o=ue())&&(n.builderRef=o.first),pe(o=ue())&&(n.artifactGridRef=o.first),pe(o=ue())&&(n.composerRef=o.first),pe(o=ue())&&(n.aiExecutiveSummaryEl=o.first),pe(o=ue())&&(n.inlineChartWidgets=o)}},hostBindings:function(e,n){e&1&&g("dragover",function(a){return a.preventDefault()},et)("drop",function(a){return a.preventDefault()},et)("selectionchange",function(){return n.onTextSelectionChange()},Oe)("wheel",function(){return n.hideQuoteBadge()},Oe)("keydown.escape",function(){return n.hideQuoteBadge()},Oe)},features:[Ft([Ie(ge),en(de),rn(de),_n(de),sn(de),dn(de),fn(de),vn(()=>null)])],decls:38,vars:36,consts:[["composerTpl",""],["widgetDetailPanelTpl",""],["dashPickerRow",""],["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"],["stay-open-on-select","","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"],["searchEnabled","","customSearch","",3,"nile-search-value"],[1,"list-new",3,"click"],["slot","prefix","name","ng-plus","method","stroke","size","14","color","#2970ff"],[1,"menu-empty"],["stay-open-on-select","","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"],[3,"click"],[1,"scope-item__name"],["slot","suffix","name","ng-check","method","stroke","size","14","color","#2970ff"],["aria-hidden","true",1,"menu-skeleton-item"],[1,"list-row"],["variant","rounded","width","14","height","14","border-radius","4px"],[1,"list-row__text"],["variant","text","width","100%","height","14"],["variant","text","width","60%","height","12"],[1,"list-group"],["name","ng-message-square","method","stroke","size","14",1,"list-row__icon"],["type","text",1,"list-row__rename",3,"ngModel"],[1,"list-row__actions"],["type","button",1,"list-row__act",3,"click"],["name","ng-edit-02","method","stroke","size","14"],["type","button",1,"list-row__act","list-row__act--danger",3,"click"],["name","ng-trash-01","method","stroke","size","14"],["type","text",1,"list-row__rename",3,"ngModelChange","click","keydown.enter","keydown.escape","blur","ngModel"],[1,"list-row__title",3,"title"],[1,"list-row__meta"],["stay-open-on-select","","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"],["variant","text","width","58","height","12"],["name","ng-bar-chart-square-02","method","stroke","size","14","color","#667085",1,"list-row__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"],[1,"prompt-gallery-row"],["type","button",1,"prompt-card",3,"prompt-card--ai"],["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"],["type","button",1,"choice-picker__step","choice-picker__resume-chip"],[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__badge"],[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"],["type","button",1,"choice-picker__step","choice-picker__resume-chip",3,"click"],[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",1,"dash-picker",3,"open"],["variant","primary","size","small"],["placement","top-end","distance","6",1,"dash-picker",3,"nile-hide","open"],["slot","trigger","variant","primary","size","small","caret","",3,"click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[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,"choice-panel"],[1,"choice-panel__header"],[1,"choice-panel__count"],[1,"choice-panel__nav-group"],["type","button",1,"choice-panel__nav",3,"click"],["name","ng-chevron-left","method","stroke","size","14"],["name","ng-chevron-right","method","stroke","size","14"],["type","button",1,"choice-panel__nav","choice-panel__close",3,"click"],["name","ng-x","method","stroke","size","14"],[1,"choice-panel__options",3,"nile-change"],[1,"choice-panel-option"],[1,"choice-panel__hint"],[1,"choice-panel-option",3,"click"],[1,"choice-panel-option__label"],[1,"choice-panel-option__num"],[1,"choice-panel-option__text"],[1,"choice-panel-option__badge"],[1,"choice-panel-option__name"],[1,"choice-panel-option__hint"],["type","button",1,"choice-panel__skip",3,"click"],[1,"choice-panel__review"],[1,"choice-panel__review-row"],[1,"choice-panel__footer","choice-panel__footer--review"],[1,"choice-panel__review-title"],[1,"choice-panel__review-answer"],[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",1,"dash-picker",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",1,"dash-picker",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","canToggleFilter","hasFilter","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",9),h(1,ji,3,7,"button",10),l(2,"div",11),h(3,Mo,43,12,"header",12),h(4,ra,21,10,"div",13),h(5,yl,2,1),fe(6,Tl,10,16,"ng-template",null,0,qe),d(),h(8,Fl,1,2,"div",14),h(9,Gl,7,6,"aside",15),h(10,Xl,15,18,"section",16),l(11,"nile-dialog",17),g("nile-request-close",function(){return n.saveDialogOpen.set(!1)})("nile-hide",function(){return n.saveDialogOpen.set(!1)}),l(12,"nile-input",18),g("nile-input",function(a){return n.saveDashboardName.set(a.detail.value)})("keydown.enter",function(){return n.confirmSaveDashboard()}),d(),l(13,"div",19)(14,"nile-button",20),g("click",function(){return n.saveDialogOpen.set(!1)}),_(15),d(),l(16,"nile-button",21),g("click",function(){return n.confirmSaveDashboard()}),_(17),d()()(),l(18,"nile-drawer",22),g("nile-request-close",function(){return n.closeForecastSettings()})("nile-hide",function(){return n.closeForecastSettings()}),l(19,"span",23),m(20,"nile-glyph",24),l(21,"span"),_(22),d()(),h(23,as,1,1),l(24,"div",25)(25,"nile-button",20),g("click",function(){return n.closeForecastSettings()}),_(26),d(),l(27,"nile-button",21),g("click",function(){return n.applyForecastSettings()}),_(28),d()()(),l(29,"nile-drawer",26),g("nile-request-close",function(){return n.closeGallery()})("nile-hide",function(){return n.closeGallery()}),h(30,_s,6,3),d(),fe(31,ws,1,1,"ng-template",null,1,qe),h(33,ks,1,6,"app-alert-drawer",27),h(34,Ps,2,0,"nile-executive-summary",28),d(),h(35,As,1,2,"app-story-picker-drawer",29),fe(36,Ms,7,3,"ng-template",null,2,qe)),e&2){let o,a;B("aq-shell--fullscreen",n.builderFullscreen())("aq-shell--resizing",n.isResizing()),A("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(),b("label",n.copy().saveDashboardDialogLabel),A("open",n.saveDialogOpen()?"":null),s(),b("placeholder",n.copy().dashboardNamePlaceholder)("value",n.saveDashboardName()),s(3),v(n.copy().cancelButton),s(),A("loading",n.savingDashboard()?"":null)("disabled",!n.saveDashboardName().trim()||n.savingDashboard()?"":null),s(),F(" ",n.copy().saveDashboardButton," "),s(),b("label",n.copy().forecastSettingsLabel)("open",n.forecastSettingsOpen()),s(4),v(n.copy().forecastSettingsLabel),s(),C((a=n.forecastDraft())?23:-1,a),s(3),v(n.copy().cancelButton),s(2),v(n.copy().applyButton),s(),b("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:[It,je,Ge,He,$e,Be,Ue,Le,We,Dn,Fn,rt,wn,lt,Mn,On],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), .dash-picker[_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}.dash-picker[_ngcontent-%COMP%]::part(panel){width:420px;max-width:92vw;overflow:hidden}.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%], .dash-picker[_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%], .dash-picker[_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(label), .related-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(label), .dash-picker[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(label){display:flex;flex:1 1 auto;min-width:0;margin:0}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(base), .related-dropdown[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(base), .dash-picker[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]::part(base){width:100%;min-width:0;overflow:hidden}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item.list-new[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu-item.list-new[_ngcontent-%COMP%], .dash-picker[_ngcontent-%COMP%] nile-menu-item.list-new[_ngcontent-%COMP%]{position:sticky;top:0;z-index:2;background:#fff}.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}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__title[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__title[_ngcontent-%COMP%]{color:var(--ng-colors-text-brand-primary, #155eef);font-weight:600}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__icon[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__icon[_ngcontent-%COMP%]{color:var(--ng-colors-text-brand-primary, #155eef);opacity:1}.conv-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__meta[_ngcontent-%COMP%], .related-dropdown[_ngcontent-%COMP%] nile-menu-item[active][_ngcontent-%COMP%] .list-row__meta[_ngcontent-%COMP%]{color:var(--ng-colors-text-brand-secondary, #2970ff)}.list-group[_ngcontent-%COMP%]{padding:10px 8px 4px;font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--ng-colors-text-quaternary, #a4a7ae);pointer-events:none}.list-new[_ngcontent-%COMP%]{border-bottom:1px solid var(--ng-colors-border-tertiary, #f5f5f5)}.list-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;max-width:100%;min-width:0;overflow:hidden}.list-row__icon[_ngcontent-%COMP%]{flex-shrink:0;opacity:.55;color:var(--ng-colors-text-tertiary-600, #535862)}.list-row__text[_ngcontent-%COMP%]{flex:1 1 0;min-width:0;max-width:100%;overflow:hidden;display:flex;flex-direction:column;gap:2px}.list-row__title[_ngcontent-%COMP%]{font-size:13px;line-height:18px;font-weight:500;color:var(--ng-colors-text-primary-900, #181d27);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.list-row__meta[_ngcontent-%COMP%]{font-size:12px;line-height:16px;color:var(--ng-colors-text-tertiary-600, #535862);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.list-row__rename[_ngcontent-%COMP%]{width:100%;min-width:0;font:inherit;font-size:13px;font-weight:500;color:var(--ng-colors-text-primary-900, #181d27);padding:1px 6px;border:1px solid var(--ng-colors-border-primary, #d5d7da);border-radius:6px;background:#fff;outline:none}.list-row__rename[_ngcontent-%COMP%]:focus{border-color:var(--ng-colors-text-brand-primary, #155eef)}.list-row__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:2px;flex:0 0 auto;margin-left:auto}.list-row__act[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--ng-colors-text-tertiary-600, #535862);opacity:.45;cursor:pointer;transition:opacity .12s,background-color .12s,color .12s}.list-row__act[_ngcontent-%COMP%]:hover{opacity:1;background:var(--ng-colors-bg-tertiary, #f5f5f5)}.list-row__act--danger[_ngcontent-%COMP%]:hover{color:#d92d20}.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__badge[_ngcontent-%COMP%]{display:inline-block;margin-bottom:2px;font-size:10.5px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--ng-colors-fg-success-primary, #17b26a)}.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}.choice-picker__resume-chip[_ngcontent-%COMP%]{display:inline-block;margin-top:16px;padding:6px 10px;border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:6px;background:var(--ng-colors-bg-secondary, #f5f5f6);cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.choice-picker__resume-chip[_ngcontent-%COMP%]:hover{border-color:var(--ng-colors-border-brand, #7f56d9);background:var(--ng-colors-bg-brand-primary, #f9f5ff)}.choice-panel[_ngcontent-%COMP%]{margin-bottom:10px;padding:14px 16px;border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:12px;background:var(--ng-colors-bg-primary, #fff);box-shadow:0 4px 16px #10182814}.choice-panel__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.choice-panel__count[_ngcontent-%COMP%]{font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--ng-colors-text-tertiary-600, #98a2b3)}.choice-panel__nav-group[_ngcontent-%COMP%]{display:flex;align-items:center;gap:2px}.choice-panel__nav[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:4px;width:24px;height:24px;padding:0;border:none;border-radius:6px;background:transparent;color:var(--ng-colors-text-tertiary-600, #667085);cursor:pointer;transition:background-color .15s ease,color .15s ease}.choice-panel__nav[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-secondary, #f5f5f6);color:var(--ng-colors-text-primary-900, #181d27)}.choice-panel__nav[_ngcontent-%COMP%]:disabled{opacity:.35;cursor:default}.choice-panel__close[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-error-primary, #fef3f2);color:var(--ng-colors-text-error-primary, #d92d20)}.choice-panel__options[_ngcontent-%COMP%]{display:block;width:100%}.choice-panel-option[_ngcontent-%COMP%]{display:block}.choice-panel-option[_ngcontent-%COMP%]::part(base){width:100%;box-sizing:border-box;margin:0;padding:8px 10px;gap:0;align-items:center;border:none;border-radius:6px;background:transparent;cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.choice-panel-option[_ngcontent-%COMP%]::part(control){display:none}.choice-panel-option[_ngcontent-%COMP%]::part(label){flex:1 1 auto;min-width:0;margin:0}.choice-panel-option[_ngcontent-%COMP%]:hover::part(base){background:var(--ng-colors-bg-brand-primary, #f9f5ff)}.choice-panel-option__label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;min-width:0}.choice-panel-option__num[_ngcontent-%COMP%]{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:5px;font-size:11px;font-weight:700;color:var(--ng-colors-text-tertiary-600, #667085);background:var(--ng-colors-bg-secondary, #f5f5f6)}.choice-panel-option__text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1px;min-width:0}.choice-panel-option__name[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--ng-colors-text-primary-900, #181d27);line-height:1.4;overflow-wrap:anywhere}.choice-panel-option__hint[_ngcontent-%COMP%]{font-size:12px;font-weight:400;line-height:1.4;color:var(--ng-colors-text-tertiary-600, #535862)}.choice-panel-option__badge[_ngcontent-%COMP%]{display:inline-block;margin-bottom:2px;font-size:10px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--ng-colors-fg-success-primary, #17b26a)}.choice-panel__footer[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-top:10px}.choice-panel__footer--review[_ngcontent-%COMP%]{justify-content:space-between}.choice-panel__skip[_ngcontent-%COMP%]{flex:0 0 auto;padding:6px 10px;border:none;border-radius:6px;font-size:12.5px;font-weight:600;color:var(--ng-colors-text-tertiary-600, #667085);background:transparent;cursor:pointer}.choice-panel__skip[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-secondary, #f5f5f6);color:var(--ng-colors-text-primary-900, #181d27)}.choice-panel__hint[_ngcontent-%COMP%]{margin:10px 0 0;font-size:11px;color:var(--ng-colors-text-tertiary-600, #98a2b3);text-align:center}.choice-panel__review[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.choice-panel__review-row[_ngcontent-%COMP%]{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:6px 8px;border-radius:6px;background:var(--ng-colors-bg-secondary, #f5f5f6)}.choice-panel__review-title[_ngcontent-%COMP%]{font-size:12.5px;font-weight:600;color:var(--ng-colors-text-tertiary-600, #535862);flex:0 0 auto}.choice-panel__review-answer[_ngcontent-%COMP%]{font-size:13px;font-weight:500;color:var(--ng-colors-text-primary-900, #181d27);text-align:right;overflow-wrap:anywhere}.ai-executive-summary[_ngcontent-%COMP%]::part(trigger){display:none}']})};var Os=(i,t)=>t.id;function qs(i,t){if(i&1&&(l(0,"div",9),m(1,"div",12),l(2,"span"),_(3),d()()),i&2){let e=r();s(3),v(e.copy().loadingConnections)}}function Es(i,t){if(i&1){let e=k();l(0,"div",10)(1,"div",13),m(2,"nile-glyph",14),d(),l(3,"h3",15),_(4),d(),l(5,"p",16),_(6),d(),l(7,"button",7),g("click",function(){p(e);let o=r();return u(o.openForm())}),m(8,"nile-glyph",8),_(9),d()()}if(i&2){let e=r();s(4),v(e.copy().noConnectionsTitle),s(2),v(e.copy().noConnectionsSub),s(3),F(" ",e.copy().registerConnectionButton," ")}}function Is(i,t){i&1&&(l(0,"span",23),_(1,"Active"),d())}function Vs(i,t){i&1&&(l(0,"span",24),_(1,"Inactive"),d())}function Rs(i,t){i&1&&(l(0,"span",25),m(1,"nile-glyph",34),_(2," Schema "),d())}function zs(i,t){i&1&&m(0,"span",28)}function Ns(i,t){i&1&&m(0,"nile-glyph",29)}function $s(i,t){i&1&&m(0,"span",28)}function Ls(i,t){i&1&&m(0,"nile-glyph",31)}function Ws(i,t){if(i&1&&(l(0,"span",37),_(1),d()),i&2){let e=r(3).$implicit;s(),Q("",e.testResult.sampleTables.slice(0,4).join(", "),"",e.testResult.sampleTables.length>4?"\u2026":"")}}function Bs(i,t){if(i&1&&(m(0,"nile-glyph",36),l(1,"span"),_(2),d(),h(3,Ws,2,2,"span",37)),i&2){let e=r(2).$implicit;s(2),F("Reachable \xB7 ",e.testResult.tableCount," tables"),s(),C(e.testResult.sampleTables.length?3:-1)}}function Us(i,t){if(i&1&&(m(0,"nile-glyph",38),l(1,"span"),_(2),d()),i&2){let e=r(2).$implicit,n=r(2);s(2),F("Unreachable \xB7 ",e.testResult.error??n.copy().errors.connectionTestFailedFallback)}}function Gs(i,t){if(i&1&&(l(0,"div",35),h(1,Bs,4,2)(2,Us,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 Hs(i,t){if(i&1){let e=k();l(0,"div",18)(1,"div",19)(2,"div",20)(3,"span",21),_(4),d(),l(5,"span",22),_(6),d(),h(7,Is,2,0,"span",23)(8,Vs,2,0,"span",24),h(9,Rs,3,0,"span",25),d(),l(10,"div",26)(11,"button",27),g("click",function(){let o=p(e).$implicit,a=r(2);return u(a.testConnection(o.id))}),h(12,zs,1,0,"span",28)(13,Ns,1,0,"nile-glyph",29),_(14),d(),l(15,"button",30),g("click",function(){let o=p(e).$implicit,a=r(2);return u(a.deleteConnection(o.id,o.name))}),h(16,$s,1,0,"span",28)(17,Ls,1,0,"nile-glyph",31),d()()(),l(18,"div",32),_(19),Dt(20,"date"),d(),h(21,Gs,3,5,"div",33),d()}if(i&2){let e=t.$implicit,n=r(2);B("wfconn-card--deleting",e.deleting),s(4),v(e.name),s(2),v(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),b("disabled",e.testing||e.deleting),s(),C(e.testing?12:13),s(2),F(" ",n.copy().testConnectionButton," "),s(),b("disabled",e.testing||e.deleting),s(),C(e.deleting?16:17),s(3),F(" Created ",Ot(20,15,e.createdAt,"mediumDate")," "),s(2),C(e.testResult?21:-1)}}function js(i,t){if(i&1&&(l(0,"div",11),D(1,Hs,22,18,"div",17,Os),d()),i&2){let e=r();s(),O(e.connections())}}function Ys(i,t){if(i&1){let e=k();l(0,"div",46)(1,"label",47),_(2,"Server"),d(),l(3,"input",60),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchMssql("server",o))}),d()(),l(4,"div",46)(5,"label",47),_(6,"Database"),d(),l(7,"input",61),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchMssql("database",o))}),d()(),l(8,"div",62)(9,"div",46)(10,"label",47),_(11,"Username"),d(),l(12,"input",63),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchMssql("user",o))}),d()(),l(13,"div",46)(14,"label",47),_(15,"Password"),d(),l(16,"div",64)(17,"input",65),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchMssql("password",o))}),d(),l(18,"button",66),g("click",function(){p(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),_(23,"Schema"),d(),l(24,"input",68),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchMssql("schema",o))}),d()(),l(25,"div",69)(26,"label",47),_(27,"Port"),d(),l(28,"input",70),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchMssql("port",+o))}),d()()()}if(i&2){let e=r(2);s(3),b("ngModel",e.mssql().server),s(4),b("ngModel",e.mssql().database),s(5),b("ngModel",e.mssql().user),s(5),b("type",e.showPassword()?"text":"password")("ngModel",e.mssql().password),s(2),A("name",e.showPassword()?"ng-eye-off":"ng-eye"),s(5),b("ngModel",e.mssql().schema),s(4),b("ngModel",e.mssql().port)}}function Qs(i,t){if(i&1){let e=k();l(0,"div",46)(1,"label",47),_(2,"URL"),d(),l(3,"input",71),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchOpensearch("url",o))}),d()(),l(4,"div",62)(5,"div",46)(6,"label",47),_(7,"Username"),d(),l(8,"input",72),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchOpensearch("username",o))}),d()(),l(9,"div",46)(10,"label",47),_(11,"Password"),d(),l(12,"div",64)(13,"input",65),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchOpensearch("password",o))}),d(),l(14,"button",66),g("click",function(){p(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),b("ngModel",e.opensearch().url),s(5),b("ngModel",e.opensearch().username),s(5),b("type",e.showPassword()?"text":"password")("ngModel",e.opensearch().password),s(2),A("name",e.showPassword()?"ng-eye-off":"ng-eye")}}function Ks(i,t){if(i&1){let e=k();l(0,"div",62)(1,"div",46)(2,"label",47),_(3,"Host"),d(),l(4,"input",73),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchPostgres("host",o))}),d()(),l(5,"div",69)(6,"label",47),_(7,"Port"),d(),l(8,"input",74),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchPostgres("port",+o))}),d()()(),l(9,"div",46)(10,"label",47),_(11,"Database"),d(),l(12,"input",61),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchPostgres("database",o))}),d()(),l(13,"div",62)(14,"div",46)(15,"label",47),_(16,"Username"),d(),l(17,"input",75),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchPostgres("user",o))}),d()(),l(18,"div",46)(19,"label",47),_(20,"Password"),d(),l(21,"div",64)(22,"input",65),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchPostgres("password",o))}),d(),l(23,"button",66),g("click",function(){p(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),_(27,"Schema"),d(),l(28,"input",76),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchPostgres("schema",o))}),d()()}if(i&2){let e=r(2);s(4),b("ngModel",e.postgres().host),s(4),b("ngModel",e.postgres().port),s(4),b("ngModel",e.postgres().database),s(5),b("ngModel",e.postgres().user),s(5),b("type",e.showPassword()?"text":"password")("ngModel",e.postgres().password),s(2),A("name",e.showPassword()?"ng-eye-off":"ng-eye"),s(4),b("ngModel",e.postgres().schema)}}function Js(i,t){if(i&1){let e=k();l(0,"div",46)(1,"label",47),_(2,"Account"),d(),l(3,"input",77),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchSnowflake("account",o))}),d()(),l(4,"div",62)(5,"div",46)(6,"label",47),_(7,"Database"),d(),l(8,"input",78),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchSnowflake("database",o))}),d()(),l(9,"div",46)(10,"label",47),_(11,"Schema"),d(),l(12,"input",79),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchSnowflake("schema",o))}),d()()(),l(13,"div",46)(14,"label",47),_(15,"Warehouse"),d(),l(16,"input",80),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchSnowflake("warehouse",o))}),d()(),l(17,"div",62)(18,"div",46)(19,"label",47),_(20,"Username"),d(),l(21,"input",81),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchSnowflake("user",o))}),d()(),l(22,"div",46)(23,"label",47),_(24,"Password"),d(),l(25,"div",64)(26,"input",65),g("ngModelChange",function(o){p(e);let a=r(2);return u(a.patchSnowflake("password",o))}),d(),l(27,"button",66),g("click",function(){p(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),b("ngModel",e.snowflake().account),s(5),b("ngModel",e.snowflake().database),s(4),b("ngModel",e.snowflake().schema),s(4),b("ngModel",e.snowflake().warehouse),s(5),b("ngModel",e.snowflake().user),s(5),b("type",e.showPassword()?"text":"password")("ngModel",e.snowflake().password),s(2),A("name",e.showPassword()?"ng-eye-off":"ng-eye")}}function Xs(i,t){if(i&1&&(l(0,"div",56),m(1,"nile-glyph",38),_(2),d()),i&2){let e=r(2);s(2),F(" ",e.formError()," ")}}function Zs(i,t){if(i&1&&(m(0,"span",82),_(1)),i&2){let e=r(2);s(),F(" ",e.copy().registeringButton," ")}}function ed(i,t){if(i&1&&(m(0,"nile-glyph",83),_(1)),i&2){let e=r(2);s(),F(" ",e.copy().registerAndTestButton," ")}}function td(i,t){if(i&1){let e=k();l(0,"div",39),g("click",function(){p(e);let o=r();return u(o.closeForm())}),d(),l(1,"aside",40)(2,"div",41)(3,"span",42),_(4),d(),l(5,"button",43),g("click",function(){p(e);let o=r();return u(o.closeForm())}),m(6,"nile-glyph",44),d()(),l(7,"div",45)(8,"div",46)(9,"label",47),_(10,"Connection name"),d(),l(11,"input",48),g("ngModelChange",function(o){p(e);let a=r();return u(a.formConnectionName.set(o))}),d()(),l(12,"div",46)(13,"label",47),_(14,"Display name "),l(15,"span",49),_(16,"(optional)"),d()(),l(17,"input",48),g("ngModelChange",function(o){p(e);let a=r();return u(a.formDisplayName.set(o))}),d()(),l(18,"div",46)(19,"label",47),_(20,"Adapter type"),d(),l(21,"select",50),g("ngModelChange",function(o){p(e);let a=r();return u(a.formAdapter.set(o))}),l(22,"option",51),_(23,"MSSQL (SQL Server)"),d(),l(24,"option",52),_(25,"OpenSearch"),d(),l(26,"option",53),_(27,"PostgreSQL"),d(),l(28,"option",54),_(29,"Snowflake"),d()()(),l(30,"div",55),_(31,"Connection config"),d(),h(32,Ys,29,8),h(33,Qs,16,5),h(34,Ks,29,8),h(35,Js,29,8),h(36,Xs,3,1,"div",56),d(),l(37,"div",57)(38,"button",58),g("click",function(){p(e);let o=r();return u(o.closeForm())}),_(39),d(),l(40,"button",59),g("click",function(){p(e);let o=r();return u(o.submitRegister())}),h(41,Zs,2,1)(42,ed,2,1),d()()()}if(i&2){let e=r();s(4),v(e.copy().registerConnectionTitle),s(7),b("ngModel",e.formConnectionName())("placeholder",e.copy().connectionNamePlaceholder),s(6),b("ngModel",e.formDisplayName())("placeholder",e.copy().displayNamePlaceholder),s(4),b("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),b("disabled",e.saving()),s(),v(e.copy().cancelButton),s(),b("disabled",e.saving()),s(),C(e.saving()?41:42)}}var Te=class i{svc=$(we);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=>T(y({},n),{[t]:e}))}patchOpensearch(t,e){this.opensearch.update(n=>T(y({},n),{[t]:e}))}patchPostgres(t,e){this.postgres.update(n=>T(y({},n),{[t]:e}))}patchSnowflake(t,e){this.snowflake.update(n=>T(y({},n),{[t]:e}))}buildConfig(){switch(this.formAdapter()){case"mssql":return y({},this.mssql());case"opensearch":return y({},this.opensearch());case"postgres":return y({},this.postgres());case"snowflake":return y({},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?T(y({},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?T(y({},o),{testing:!1,testResult:e}):o))}catch{this.connections.update(e=>e.map(n=>n.id===t?T(y({},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?T(y({},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?T(y({},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(),ze()}extractMessage(t,e){return Ne(t,e)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Ce({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"),_(6),d()(),l(7,"span",5),_(8,"/"),d(),l(9,"span",6),_(10),d()(),l(11,"button",7),g("click",function(){return n.openForm()}),m(12,"nile-glyph",8),_(13),d()(),h(14,qs,4,1,"div",9)(15,Es,10,3,"div",10)(16,js,3,0,"div",11),h(17,td,43,15),d()),e&2&&(s(6),v(n.copy().connectionsBreadcrumbHome),s(4),v(n.copy().connectionsTitle),s(3),F(" ",n.copy().registerConnectionButton," "),s(),C(n.loading()?14:!n.hasConnections()&&!n.showForm()?15:16),s(3),C(n.showForm()?17:-1))},dependencies:[je,Ge,He,$e,Be,Ue,Le,We,Ht,Vt],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 id(i,t){i&1&&m(0,"app-ask-aquera-connections-page")}function od(i,t){i&1&&m(0,"app-ask-aquera-page")}function ad(i,t){if(i&1&&h(0,id,1,0,"app-ask-aquera-connections-page")(1,od,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 Ze=class i{config=Et(void 0);ready=Ee({alias:"aq-ready"});error=Ee({alias:"aq-error"});unauthorized=Ee({alias:"aq-unauthorized"});host=$(At);stopAdopting=null;stopUi=null;tokenTimer=null;configured=!1;constructor(){Pe(()=>{let t=this.config();t&&this.apply(t)}),queueMicrotask(()=>{let t=this.host.nativeElement.shadowRoot;t&&(this.stopAdopting=vt(t))})}async apply(t){let e=t.auth;if(Kt(t.api.baseUrl),Bt(t.api,e),dt({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=wt(this.host.nativeElement,t.ui),Jt({productId:t.tenant.productId,name:t.tenant.productName}),Qt(()=>this.unauthorized.emit()),await Ye(),e.mode==="callback"&&!this.tokenTimer&&(this.tokenTimer=setInterval(()=>{Ye()},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=Ce({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&&h(0,ad,2,1),e&2&&C(n.config()?0:-1)},dependencies:[Te,Se],styles:[`:host{display:block;height:100%}
18
+ `],encapsulation:3,changeDetection:0})};$t();var rd="dvz-ask";function ld(i={}){return Nt(Ze,rd,[Pt(),jt([]),Yt(),Rt(zt([Xt])),{provide:Zt,useFactory:()=>R().baseUrl},{provide:Sn,useValue:"workforce/dashboards"},Ie(ge)],i)}ld();export{rd as a,ld as b};