import{bB as ws,bC as ys,bD as e,r as o,bE as _s,bF as js,bG as vs,bH as Cs,bI as we,bJ as ks,bK as Is,bL as Ts,bM as Ns,bN as Ls,bO as As,bP as Fs,bQ as Rs,bR as Ps,bS as Es,bT as Ms,bU as St}from"./vendor-c02d77b0.js";import{I as ie,S as k,P as Os,T as Ae,B as J,a as U,u as Us,b as g,C as Tt,D as Nt,c as Vs,d as zs,M as Gs,e as Bs,L as qs,f as Ds,g as $s,h as Lt,i as se,j as Fe,k as wt,l as Qs,m as Hs,n as yt,o as Ws,p as Ks,q as Js,r as D,s as Xs}from"./fluentui-react-2f12a35c.js";import{E as Zs,M as _t,e as Ys,D as At,f as en}from"./fluentui-icons-7554e566.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const d of r)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&i(h)}).observe(document,{childList:!0,subtree:!0});function s(r){const d={};return r.integrity&&(d.integrity=r.integrity),r.referrerPolicy&&(d.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?d.credentials="include":r.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(r){if(r.ep)return;r.ep=!0;const d=s(r);fetch(r.href,d)}})();const Ft=new ws({config:{connectionString:"InstrumentationKey=cf432019-06b4-42cb-a765-7e349dd1dcf9;IngestionEndpoint=https://westus-0.in.applicationinsights.azure.com/;LiveEndpoint=https://westus.livediagnostics.monitor.azure.com/;ApplicationId=a1ffac9e-b1ce-4510-98b1-07e8ffe2b38f"}});Ft.loadAppInsights();const tn="_container_bz041_3",sn="_chatRoot_bz041_25",nn="_commandsContainer_bz041_43",an="_contentContainer_bz041_61",on="_introductionNote_bz041_81",rn="_dotLottieContainer_bz041_95",ln="_importantNoteContainer_bz041_107",cn="_importantNoteIcon_bz041_125",dn="_importantNoteContent_bz041_139",un="_importantNoteTitle_bz041_147",hn="_importantNoteText_bz041_159",pn="_iconWithShadow_bz041_169",mn="_chatContainer_bz041_217",gn="_chatAnalysisPanel_bz041_219",fn="_chatMessageStream_bz041_255",bn="_chatMessageGpt_bz041_275",xn="_chatMessageGptMinWidth_bz041_289",Sn="_chatInput_bz041_301",u={container:tn,chatRoot:sn,commandsContainer:nn,contentContainer:an,introductionNote:on,dotLottieContainer:rn,importantNoteContainer:ln,importantNoteIcon:cn,importantNoteContent:dn,importantNoteTitle:un,importantNoteText:hn,iconWithShadow:pn,chatContainer:mn,chatAnalysisPanel:gn,chatMessageStream:fn,chatMessageGpt:bn,chatMessageGptMinWidth:xn,chatInput:Sn},wn=".auth/me",yn=".auth/refresh";async function _n(){const t=await fetch("/auth_setup");if(!t.ok)throw new Error(`auth setup response was not ok: ${t.status}`);return await t.json()}const W=await _n(),H=W.useLogin,ae=W.requireAccessControl,jn=W.enableUnauthenticatedAccess,jt=ae&&!jn,vn=W.msalConfig;W.loginRequest;const Cn=W.tokenRequest,kn=()=>window.location.origin+W.msalConfig.auth.redirectUri;globalThis.cachedAppServicesToken=null;const ye=()=>{const t=s=>{const i=new Date;return new Date(s.expires_on)>i};if(globalThis.cachedAppServicesToken&&t(globalThis.cachedAppServicesToken))return Promise.resolve(globalThis.cachedAppServicesToken);const n=()=>fetch(wn).then(s=>s.ok?s.json().then(i=>i.length>0?{id_token:i[0].id_token,access_token:i[0].access_token,user_claims:i[0].user_claims.reduce((r,d)=>(r[d.typ]=d.val,r),{}),expires_on:i[0].expires_on}:null):null);return n().then(s=>s?t(s)?(globalThis.cachedAppServicesToken=s,s):fetch(yn).then(i=>i.ok?n():null):null)},In=await ye()!=null,Tn=async t=>!!(t&&t.getActiveAccount()||await ye()),oe=async t=>{const n=await ye();return n?Promise.resolve(n.access_token):t.acquireTokenSilent({...Cn,redirectUri:kn()}).then(s=>s.accessToken).catch(s=>{console.log(s)})},Nn=async t=>{const n=t.getActiveAccount();if(n)return n.idTokenClaims;const s=await ye();if(s)return s.user_claims},_e="";async function X(t){return H&&!In&&t?{Authorization:`Bearer ${t}`}:{}}async function Ln(){return await(await fetch(`${_e}/config`,{method:"GET"})).json()}async function xo(t,n){const s=await X(n),i=await fetch(`${_e}/ask`,{method:"POST",headers:{...s,"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await i.json();if(i.status>299||!i.ok)throw Error(r.error||"Unknown error");return r}async function An(t,n,s){let i=`${_e}/chat`;n&&(i+="/stream");const r=await X(s);return await fetch(i,{method:"POST",headers:{...r,"Content-Type":"application/json"},body:JSON.stringify(t)})}async function Fn(t){return await fetch("/speech",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:t})}).then(n=>n.status==200?n.blob():n.status==400?(console.log("Speech synthesis is not enabled."),null):(console.error("Unable to get speech synthesis."),null)).then(n=>n?URL.createObjectURL(n):null)}function Rt(t){return`${_e}/content/${t}`}async function Rn(t,n){const s=await fetch("/upload",{method:"POST",headers:await X(n),body:t});if(!s.ok)throw new Error(`Uploading files failed: ${s.statusText}`);return await s.json()}async function Pn(t,n){const s=await X(n),i=await fetch("/delete_uploaded",{method:"POST",headers:{...s,"Content-Type":"application/json"},body:JSON.stringify({filename:t})});if(!i.ok)throw new Error(`Deleting file failed: ${i.statusText}`);return await i.json()}async function En(t){const n=await fetch("/list_uploaded",{method:"GET",headers:await X(t)});if(!n.ok)throw new Error(`Listing files failed: ${n.statusText}`);return await n.json()}var A=(t=>(t.Hybrid="hybrid",t.Vectors="vectors",t.Text="text",t))(A||{}),V=(t=>(t.TextAndImages="textAndImages",t.Images="images",t.Texts="texts",t))(V||{}),E=(t=>(t.Embedding="embedding",t.ImageEmbedding="imageEmbedding",t.Both="both",t))(E||{});const Mn="_answerContainer_1lpt6_1",On="_answerLogo_1lpt6_21",Un="_answerText_1lpt6_29",Vn="_selected_1lpt6_67",zn="_citationLearnMore_1lpt6_75",Gn="_citation_1lpt6_75",Bn="_followupQuestionsList_1lpt6_119",qn="_followupQuestionLearnMore_1lpt6_127",Dn="_followupQuestion_1lpt6_119",$n="_supContainer_1lpt6_165",Qn="_retryButton_1lpt6_223",Hn="_loadingdots_1lpt6_267",Wn="_loading_1lpt6_267",F={answerContainer:Mn,answerLogo:On,answerText:Un,selected:Vn,citationLearnMore:zn,citation:Gn,followupQuestionsList:Bn,followupQuestionLearnMore:qn,followupQuestion:Dn,supContainer:$n,retryButton:Qn,loadingdots:Hn,loading:Wn};function Kn(t,n,s){const i=[];let r=t.trim();if(n){let l=r.length;for(let m=r.length-1;m>=0&&r[m]!=="]";m--)if(r[m]==="["){l=m;break}r=r.substring(0,l)}return{answerHtml:r.split(/\[([^\]]+)\]/g).map((l,p)=>{if(p%2===0)return l;{let m;i.indexOf(l)!==-1?m=i.indexOf(l)+1:(i.push(l),m=i.length);const w=Rt(l);return ys(e.jsx("a",{className:"supContainer",title:l,onClick:()=>s(w),children:e.jsx("sup",{children:m})}))}}).join(""),citations:i}}const Pt=()=>e.jsx("div",{className:"conversation-bot-avatar",style:{backgroundImage:"url('https://cdn.filestackcontent.com/drZbMUDcSqC1kOKrZawN')",width:"60px",height:"60px",backgroundSize:"cover",backgroundPosition:"center",borderRadius:"50%",flexShrink:"0",marginRight:"10px",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.2)",border:"2px solid white"}}),Jn=window.speechSynthesis||window.webkitSpeechSynthesis;let Q=null;try{Q=Jn}catch{console.error("SpeechSynthesis is not supported")}const Xn=function(t){if(Q){const n=new SpeechSynthesisUtterance(t);return n.lang="en-US",n.volume=1,n.rate=1,n.pitch=1,n.voice=Q.getVoices().filter(s=>s.lang==="en-US")[0],n}},Zn=({answer:t})=>{const[n,s]=o.useState(!1),i=d=>{if(Q!=null){if(n){Q.cancel(),s(!1);return}const h=Xn(d);if(!h)return;Q.speak(h),h.onstart=()=>{s(!0)},h.onend=()=>{s(!1)}}},r=n?"red":"black";return e.jsx(ie,{style:{color:r},iconProps:{iconName:"Volume3"},title:"Speak answer",ariaLabel:"Speak answer",onClick:()=>i(t),disabled:!Q})};let be=new Audio;const Yn=({url:t})=>{const[n,s]=o.useState(!1),i=async()=>{if(n){be.pause(),s(!1);return}if(!t){console.error("Speech output is not yet available.");return}be=new Audio(t),await be.play(),be.addEventListener("ended",()=>{s(!1)}),s(!0)},r=n?"red":"black";return e.jsx(ie,{style:{color:r},iconProps:{iconName:"Volume3"},title:"Speak answer",ariaLabel:"Speak answer",onClick:()=>i(),disabled:!t})},vt=({answer:t,isSelected:n,isStreaming:s,onCitationClicked:i,onThoughtProcessClicked:r,onSupportingContentClicked:d,onFollowupQuestionClicked:h,showFollowupQuestions:l,showSpeechOutputAzure:p,showSpeechOutputBrowser:m,speechUrl:w})=>{const y=t.context?.followup_questions,S=t.message.content,_=o.useMemo(()=>Kn(S,s,i),[t]),x=_s.sanitize(_.answerHtml);return e.jsxs(k,{className:`${F.answerContainer} ${n&&F.selected}`,verticalAlign:"space-between",children:[e.jsx(k.Item,{children:e.jsxs(k,{horizontal:!0,horizontalAlign:"space-between",children:[e.jsx(Pt,{}),e.jsxs("div",{children:[e.jsx(ie,{style:{color:"black"},iconProps:{iconName:"ClipboardList"},title:"Show supporting content",ariaLabel:"Show supporting content",onClick:()=>d(),disabled:!t.context.data_points}),p&&e.jsx(Yn,{url:w}),m&&e.jsx(Zn,{answer:x})]})]})}),e.jsx(k.Item,{grow:!0,children:e.jsx("div",{className:F.answerText,dangerouslySetInnerHTML:{__html:x}})}),!!_.citations.length&&e.jsx(k.Item,{children:e.jsxs(k,{horizontal:!0,wrap:!0,tokens:{childrenGap:5},children:[e.jsx("span",{className:F.citationLearnMore,children:"Citations:"}),_.citations.map((f,j)=>{const K=Rt(f);return e.jsx("a",{className:F.citation,title:f,onClick:()=>i(K),children:`${++j}. ${f}`},j)})]})}),!!y?.length&&l&&h&&e.jsx(k.Item,{children:e.jsxs(k,{horizontal:!0,wrap:!0,className:`${_.citations.length?F.followupQuestionsList:""}`,tokens:{childrenGap:6},children:[e.jsx("span",{className:F.followupQuestionLearnMore,children:"Follow-up questions:"}),y.map((f,j)=>e.jsx("a",{className:F.followupQuestion,title:f,onClick:()=>h(f),children:`${f}`},j))]})})]})},ea=()=>{const t=js({from:{opacity:0},to:{opacity:1}});return e.jsx(vs.div,{style:{...t},children:e.jsxs(k,{className:F.answerContainer,verticalAlign:"space-between",children:[e.jsx(Pt,{}),e.jsx(k.Item,{grow:!0,children:e.jsxs("p",{className:F.answerText,children:["Generating answer",e.jsx("span",{className:F.loadingdots})]})})]})})},ta=({error:t,onRetry:n})=>e.jsxs(k,{className:F.answerContainer,verticalAlign:"space-between",children:[e.jsx(Zs,{"aria-hidden":"true","aria-label":"Error icon",primaryFill:"red"}),e.jsx(k.Item,{grow:!0,children:e.jsx("p",{className:F.answerText,children:t})}),e.jsx(Os,{className:F.retryButton,onClick:n,text:"Retry"})]}),sa="_questionInputContainer_2j32c_1",na="_questionInputTextArea_2j32c_21",aa="_questionInputButtonsContainer_2j32c_31",re={questionInputContainer:sa,questionInputTextArea:na,questionInputButtonsContainer:aa},oa=window.speechRecognition||window.webkitSpeechRecognition;let T=null;try{T=new oa,T!=null&&(T.lang="en-US",T.interimResults=!0)}catch{console.error("SpeechRecognition not supported"),T=null}const ra=({updateQuestion:t})=>{const[n,s]=o.useState(!1),i=()=>{if(T==null){console.error("SpeechRecognition not supported");return}T.onresult=d=>{let h="";for(const l of d.results)h+=l[0].transcript;t(h)},T.onend=()=>{s(!1)},T.onerror=d=>{T&&(T.stop(),d.error=="no-speech"?alert("No speech was detected. Please check your system audio settings and try again."):d.error=="language-not-supported"?alert(`Speech recognition error detected: ${d.error}. The speech recognition input functionality does not yet work on all browsers, like Edge in Mac OS X with ARM chips. Try another browser/OS.`):alert(`Speech recognition error detected: ${d.error}.`))},s(!0),T.start()},r=()=>{if(T==null){console.error("SpeechRecognition not supported");return}T.stop(),s(!1)};return T==null?e.jsx(e.Fragment,{}):e.jsxs(e.Fragment,{children:[!n&&e.jsx("div",{className:re.questionInputButtonsContainer,children:e.jsx(Ae,{content:"Ask question with voice",relationship:"label",children:e.jsx(J,{size:"large",icon:e.jsx(_t,{primaryFill:"rgba(115, 118, 225, 1)"}),onClick:i})})}),n&&e.jsx("div",{className:re.questionInputButtonsContainer,children:e.jsx(Ae,{content:"Stop recording question",relationship:"label",children:e.jsx(J,{size:"large",icon:e.jsx(_t,{primaryFill:"rgba(250, 0, 0, 0.7)"}),disabled:!n,onClick:r})})})]})},Se=o.createContext({loggedIn:!1,setLoggedIn:t=>{}}),ia=({onSend:t,disabled:n,placeholder:s,clearOnSend:i,initQuestion:r,showSpeechInput:d})=>{const[h,l]=o.useState(""),{loggedIn:p}=o.useContext(Se);o.useEffect(()=>{r&&l(r)},[r]);const m=()=>{n||!h.trim()||(t(h),i&&l(""))},w=x=>{x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),m())},y=(x,f)=>{f?f.length<=1e3&&l(f):l("")},S=jt&&!p,_=n||!h.trim()||jt;return S&&(s="Please login to continue..."),e.jsxs(k,{horizontal:!0,className:re.questionInputContainer,children:[e.jsx(U,{className:re.questionInputTextArea,disabled:S,placeholder:s,multiline:!0,resizable:!1,borderless:!0,value:h,onChange:y,onKeyDown:w}),e.jsx("div",{className:re.questionInputButtonsContainer,children:e.jsx(Ae,{content:"Submit question",relationship:"label",children:e.jsx(J,{size:"large",icon:e.jsx(Ys,{primaryFill:"rgba(115, 118, 225, 1)"}),disabled:_,onClick:m})})}),d&&e.jsx(ra,{updateQuestion:l})]})},la="_examplesNavList_1umas_1",ca="_example_1umas_1",da="_exampleText_1umas_57",Re={examplesNavList:la,example:ca,exampleText:da},ua=({text:t,value:n,onClick:s})=>e.jsx("div",{className:Re.example,onClick:()=>s(n),children:e.jsx("p",{className:Re.exampleText,children:t})}),ha=["Summarize CD-64 zone in White Rock (Comprehensive Development 64).","Can I walk my dog on the promenade?","Use a table to list the parameters for RT-2 zone.","List the process for the major development.","What safety measures should be taken when storing gas containers in a garage?","Where can I check the recycling calendar?","Who should I contact if a tree obstructing driver sightlines at an intersection?","Do I need a permit if I want to create a parking area on the boulevard in front of my house?","How to know where the sanitary/storm connection of my house is located?","Where to pay the water utility bill?"],pa=["Compare the impact of interest rates and GDP in financial markets.","What is the expected trend for the S&P 500 index over the next five years? Compare it to the past S&P 500 performance","Can you identify any correlation between oil prices and stock market trends?"],ma=({onExampleClicked:t,useGPT4V:n})=>e.jsx("ul",{className:Re.examplesNavList,children:(n?pa:ha).map((s,i)=>e.jsx("li",{children:e.jsx(ua,{text:s,value:s,onClick:t})},i))}),ga="_container_16z3p_1",fa="_message_16z3p_17",Ct={container:ga,message:fa},xe=({message:t})=>e.jsx("div",{className:Ct.container,children:e.jsx("div",{className:Ct.message,children:t})}),kt={childrenGap:4,maxWidth:300},ba={root:{padding:20}},xa={root:{marginBottom:-3}},Sa={iconName:"Info"},v=t=>{const[n,{toggle:s}]=Us(!1),i=g("description"),r=g("iconButton");return e.jsxs(e.Fragment,{children:[e.jsxs(k,{horizontal:!0,verticalAlign:"center",tokens:kt,children:[e.jsx("label",{id:t.labelId,htmlFor:t.fieldId,children:t.label}),e.jsx(ie,{id:r,iconProps:Sa,title:"Info",ariaLabel:"Info",onClick:s,styles:xa})]}),n&&e.jsx(Tt,{target:"#"+r,setInitialFocus:!0,onDismiss:s,ariaDescribedBy:i,role:"alertdialog",children:e.jsxs(k,{tokens:kt,horizontalAlign:"start",styles:ba,children:[e.jsx("span",{id:i,children:t.helpText}),e.jsx(Nt,{onClick:s,children:"Close"})]})})]})},wa="_thoughtProcess_j4orz_1",ya="_tList_j4orz_15",_a="_tListItem_j4orz_27",ja="_tStep_j4orz_79",va="_tCodeBlock_j4orz_93",Ca="_tProp_j4orz_101",ka="_citationImg_j4orz_119",Ia={thoughtProcess:wa,tList:ya,tListItem:_a,tStep:ja,tCodeBlock:va,tProp:Ca,citationImg:ka};var $=(t=>(t.ThoughtProcessTab="thoughtProcess",t.SupportingContentTab="supportingContent",t.CitationTab="citation",t))($||{});const Ta="_downloadButton_11qw1_1",Na="_markdownViewer_11qw1_11",La="_loading_11qw1_29",Aa="_error_11qw1_41",Fa="_markdown_11qw1_11",B={downloadButton:Ta,markdownViewer:Na,loading:La,error:Aa,markdown:Fa},Ra=({src:t})=>{const[n,s]=o.useState(""),[i,r]=o.useState(!0),[d,h]=o.useState(null),l=p=>{const m=/<a\s+(?:[^>]*?\s+)?href=['"](#[^"']*?)['"][^>]*?>/g;return p.replace(m,"")};return o.useEffect(()=>{(async()=>{try{const m=await fetch(t);if(!m.ok)throw new Error("Failed loading markdown file.");const w=await m.text(),y=await Cs.parse(w),S=l(y);s(S)}catch(m){h(m)}finally{r(!1)}})()},[t]),e.jsx("div",{children:i?e.jsx("div",{className:`${B.loading} ${B.markdownViewer}`,children:e.jsx(Vs,{size:zs.large,label:"Loading file"})}):d?e.jsx("div",{className:`${B.error} ${B.markdownViewer}`,children:e.jsxs(Gs,{messageBarType:Bs.error,isMultiline:!1,children:[d.message,e.jsx(qs,{href:t,download:!0,children:"Download the file"})]})}):e.jsxs("div",{children:[e.jsx(ie,{className:B.downloadButton,style:{color:"black"},iconProps:{iconName:"Save"},title:"Save",ariaLabel:"Save",href:t,download:!0}),e.jsx("div",{className:`${B.markdown} ${B.markdownViewer}`,dangerouslySetInnerHTML:{__html:n}})]})})},Pa={disabled:!0,style:{color:"grey"}},Ea=({answer:t,activeTab:n,activeCitation:s,citationHeight:i,className:r,onActiveTabChanged:d})=>{t.context.thoughts,t.context.data_points;const h=!s,[l,p]=o.useState(""),m=H?we().instance:void 0,w=async()=>{const S=m?await oe(m):void 0;if(s){const _=s.indexOf("#")?s.split("#")[1]:"",f=await(await fetch(s,{method:"GET",headers:await X(S)})).blob();let j=URL.createObjectURL(f);_&&(j+="#"+_),p(j)}};o.useEffect(()=>{w()},[]);const y=()=>{if(!s)return null;switch(s.split(".").pop()?.toLowerCase()){case"png":return e.jsx("img",{src:l,className:Ia.citationImg,alt:"Citation Image"});case"md":return e.jsx(Ra,{src:s});default:return e.jsx("iframe",{title:"Citation",src:l,width:"100%",height:i})}};return e.jsx(Ds,{className:r,selectedKey:n,onLinkClick:S=>S&&d(S.props.itemKey),children:e.jsx($s,{itemKey:$.CitationTab,headerText:"Citation",headerButtonProps:h?Pa:void 0,children:y()})})},Ma="_container_nwwgz_1",Oa={container:Ma},Ua=({className:t,disabled:n,onClick:s})=>e.jsx("div",{className:`${Oa.container} ${t??""}`,children:e.jsx(J,{icon:e.jsx(At,{}),disabled:n,onClick:s,children:"Clear chat"})}),Va="_container_5ljyb_1",za="_callout_5ljyb_17",Ga="_list_5ljyb_27",Ba="_item_5ljyb_39",ne={container:Va,callout:za,list:Ga,item:Ba},qa=({className:t,disabled:n})=>{const[s,i]=o.useState(!1),[r,d]=o.useState(!1),[h,l]=o.useState(!0),[p,m]=o.useState({}),[w,y]=o.useState(),[S,_]=o.useState(),[x,f]=o.useState([]);if(!H)throw new Error("The UploadFile component requires useLogin to be true");const j=we().instance,K=async()=>{i(!s);try{const b=await oe(j);if(!b)throw new Error("No authentication token available");z(b)}catch(b){console.error(b),l(!1)}},z=async b=>{En(b).then(N=>{l(!1),m({}),f(N)})},je=async b=>{m({...p,[b]:"pending"});try{const N=await oe(j);if(!N)throw new Error("No authentication token available");await Pn(b,N),m({...p,[b]:"success"}),z(N)}catch(N){m({...p,[b]:"error"}),console.error(N)}},le=async b=>{if(b.preventDefault(),!b.target.files||b.target.files.length===0)return;d(!0);const N=b.target.files[0],ce=new FormData;ce.append("file",N);try{const M=await oe(j);if(!M)throw new Error("No authentication token available");const ve=await Rn(ce,M);y(ve),d(!1),_(void 0),z(M)}catch(M){console.error(M),d(!1),_("Error uploading file - please try again or contact admin.")}};return e.jsx("div",{className:`${ne.container} ${t??""}`,children:e.jsxs("div",{children:[e.jsx(J,{id:"calloutButton",icon:e.jsx(en,{}),disabled:n,onClick:K,children:"Manage file uploads"}),s&&e.jsxs(Tt,{role:"dialog",gapSpace:0,className:ne.callout,target:"#calloutButton",onDismiss:()=>i(!1),setInitialFocus:!0,children:[e.jsx("form",{encType:"multipart/form-data",children:e.jsxs("div",{children:[e.jsx(Lt,{children:"Upload file:"}),e.jsx("input",{accept:".txt, .md, .json, .png, .jpg, .jpeg, .bmp, .heic, .tiff, .pdf, .docx, .xlsx, .pptx, .html",className:ne.chooseFiles,type:"file",onChange:le})]})}),r&&e.jsx(se,{children:"Uploading files..."}),!r&&S&&e.jsx(se,{children:S}),!r&&w&&e.jsx(se,{children:w.message}),e.jsx("h3",{children:"Previously uploaded files:"}),h&&e.jsx(se,{children:"Loading..."}),!h&&x.length===0&&e.jsx(se,{children:"No files uploaded yet"}),x.map((b,N)=>e.jsxs("div",{className:ne.list,children:[e.jsx("div",{className:ne.item,children:b}),e.jsxs(J,{icon:e.jsx(At,{}),onClick:()=>je(b),disabled:p[b]==="pending"||p[b]==="success",children:[!p[b]&&"Delete file",p[b]=="pending"&&"Deleting file...",p[b]=="error"&&"Error deleting.",p[b]=="success"&&"File deleted"]})]},N))]})]})})},Da="_container_17evt_1",$a={container:Da},C={promptTemplate:"Overrides the prompt used to generate the answer based on the question and search results. To append to existing prompt instead of replace whole prompt, start your prompt with '>>>'.",temperature:"Sets the temperature of the request to the LLM that generates the answer. Higher temperatures result in more creative responses, but they may be less grounded.",seed:"Sets a seed to improve the reproducibility of the model's responses. The seed can be any integer.",searchScore:"Sets a minimum score for search results coming back from Azure AI search. The score range depends on whether you're using hybrid (default), vectors only, or text only.",rerankerScore:"Sets a minimum score for search results coming back from the semantic reranker. The score always ranges between 0-4. The higher the score, the more semantically relevant the result is to the question.",retrieveNumber:"Sets the number of search results to retrieve from Azure AI search. More results may increase the likelihood of finding the correct answer, but may lead to the model getting 'lost in the middle'.",excludeCategory:"Specifies a category to exclude from the search results. There are no categories used in the default data set.",useSemanticReranker:"Enables the Azure AI Search semantic ranker, a model that re-ranks search results based on semantic similarity to the user's query.",useSemanticCaptions:"Sends semantic captions to the LLM instead of the full search result. A semantic caption is extracted from a search result during the process of semantic ranking.",suggestFollowupQuestions:"Asks the LLM to suggest follow-up questions based on the user's query.",useGPT4Vision:"Uses GPT-4-Turbo with Vision to generate responses based on images and text from the index.",vectorFields:"Specifies which embedding fields in the Azure AI Search Index will be searched, both the 'Images and text' embeddings, 'Images' only, or 'Text' only.",gpt4VisionInputs:"Sets what will be sent to the vision model. 'Images and text' sends both images and text to the model, 'Images' sends only images, and 'Text' sends only text.",retrievalMode:"Sets the retrieval mode for the Azure AI Search query. `Vectors + Text (Hybrid)` uses a combination of vector search and full text search, `Vectors` uses only vector search, and `Text` uses only full text search. Hybrid is generally optimal.",streamChat:"Continuously streams the response to the chat UI as it is generated.",useOidSecurityFilter:"Filter search results based on the authenticated user's OID.",useGroupsSecurityFilter:"Filter search results based on the authenticated user's groups."},Qa=({updateRetrievalMode:t,updateVectorFields:n,showImageOptions:s,defaultRetrievalMode:i})=>{const[r,d]=o.useState(A.Hybrid),[h,l]=o.useState(E.Both),p=(x,f)=>{d(f?.data||A.Hybrid),t(f?.data||A.Hybrid)},m=(x,f)=>{l(f?.key),n([f?.key])};o.useEffect(()=>{n(s?[E.Embedding,E.ImageEmbedding]:[E.Embedding])},[s]);const w=g("retrievalMode"),y=g("retrievalModeField"),S=g("vectorFields"),_=g("vectorFieldsField");return e.jsxs(k,{className:$a.container,tokens:{childrenGap:10},children:[e.jsx(Fe,{id:y,label:"Retrieval mode",selectedKey:i.toString(),options:[{key:"hybrid",text:"Vectors + Text (Hybrid)",selected:r==A.Hybrid,data:A.Hybrid},{key:"vectors",text:"Vectors",selected:r==A.Vectors,data:A.Vectors},{key:"text",text:"Text",selected:r==A.Text,data:A.Text}],required:!0,onChange:p,"aria-labelledby":w,onRenderLabel:x=>e.jsx(v,{labelId:w,fieldId:y,helpText:C.retrievalMode,label:x?.label})}),s&&[A.Vectors,A.Hybrid].includes(r)&&e.jsx(Fe,{id:_,label:"Vector fields (Multi-query vector search)",options:[{key:E.Embedding,text:"Text Embeddings",selected:h===E.Embedding},{key:E.ImageEmbedding,text:"Image Embeddings",selected:h===E.ImageEmbedding},{key:E.Both,text:"Text and Image embeddings",selected:h===E.Both}],onChange:m,"aria-labelledby":S,onRenderLabel:x=>e.jsx(v,{labelId:S,fieldId:_,helpText:C.vectorFields,label:x?.label})})]})},Ha=()=>{const{instance:t}=we();t.getActiveAccount();const[n,s]=o.useState(void 0);o.useEffect(()=>{(async()=>{s(await Nn(t))})()},[]);const i=l=>typeof l=="string"?l:JSON.stringify(l),d=(l=>Object.keys(l??{}).map(p=>{let m=p;try{const y=new URL(p).pathname.split("/");p=y[y.length-1]}catch{}return{name:p,value:i((l??{})[m])}}))(n),h=[wt({columnId:"name",compare:(l,p)=>l.name.localeCompare(p.name),renderHeaderCell:()=>"Name",renderCell:l=>l.name}),wt({columnId:"value",compare:(l,p)=>l.value.localeCompare(p.value),renderHeaderCell:()=>"Value",renderCell:l=>l.value})];return e.jsxs("div",{children:[e.jsx(Lt,{children:"ID Token Claims"}),e.jsxs(Qs,{items:d,columns:h,sortable:!0,getRowId:l=>l.name,children:[e.jsx(Hs,{children:e.jsx(yt,{children:({renderHeaderCell:l})=>e.jsx(Ws,{children:l()})})}),e.jsx(Ks,{children:({item:l,rowId:p})=>e.jsx(yt,{children:({renderCell:m})=>e.jsx(Js,{children:m(l)})},p)})]})]})},Wa="_container_17evt_1",Ka={container:Wa},Ja=({updateGPT4VInputs:t,updateUseGPT4V:n,isUseGPT4V:s,gpt4vInputs:i})=>{const[r,d]=o.useState(s),[h,l]=o.useState(i||V.TextAndImages),p=(x,f)=>{n(!!f),d(!!f)},m=(x,f)=>{if(f){const j=f.key;t(j||V.TextAndImages),j&&l(j)}};o.useEffect(()=>{r&&t(V.TextAndImages)},[r]);const w=g("useGPT4V"),y=g("useGPT4VField"),S=g("gpt4VInput"),_=g("gpt4VInputField");return e.jsxs(k,{className:Ka.container,tokens:{childrenGap:10},children:[e.jsx(D,{id:y,checked:r,label:"Use GPT vision model",onChange:p,"aria-labelledby":w,onRenderLabel:x=>e.jsx(v,{labelId:w,fieldId:y,helpText:C.useGPT4Vision,label:x?.label})}),r&&e.jsx(Fe,{id:_,selectedKey:h,label:"GPT vision model inputs",options:[{key:V.TextAndImages,text:"Images and text"},{text:"Images",key:V.Images},{text:"Text",key:V.Texts}],required:!0,onChange:m,"aria-labelledby":S,onRenderLabel:x=>e.jsx(v,{labelId:S,fieldId:_,helpText:C.gpt4VisionInputs,label:x?.label})})]})},Xa=()=>{const[t,n]=o.useState(!1),[s,i]=o.useState(""),[r,d]=o.useState(.3),[h,l]=o.useState(null),[p,m]=o.useState(0),[w,y]=o.useState(0),[S,_]=o.useState(5),[x,f]=o.useState(A.Hybrid),[j,K]=o.useState(!0),[z,je]=o.useState(!1),[le,b]=o.useState(!1),[N,ce]=o.useState(""),[M,ve]=o.useState(!0),[Et,Mt]=o.useState([E.Embedding]),[Pe,Ot]=o.useState(!1),[Ee,Ut]=o.useState(!1),[Me,Vt]=o.useState(V.TextAndImages),[de,zt]=o.useState(!1),G=o.useRef(""),Ce=o.useRef(null),[ue,he]=o.useState(!1),[Oe,ke]=o.useState(!1),[pe,Ie]=o.useState(),[Gt,Ue]=o.useState(),[me,ge]=o.useState(void 0),[fe,Ve]=o.useState(0),[I,Te]=o.useState([]),[ze,Ge]=o.useState([]),[Z,Bt]=o.useState([]),[Be,qt]=o.useState(!1),[qe,Dt]=o.useState(!1),[$t,Qt]=o.useState(!1),[Ht,Wt]=o.useState(!1),[Kt,Jt]=o.useState(!1),[De,Xt]=o.useState(!1),[Ne,Zt]=o.useState(!1),Yt=async()=>{Ln().then(a=>{qt(a.showGPT4VOptions),K(a.showSemanticRankerOption),Dt(a.showSemanticRankerOption),Qt(a.showVectorOption),a.showVectorOption||f(A.Text),Wt(a.showUserUpload),Jt(a.showSpeechInput),Xt(a.showSpeechOutputBrowser),Zt(a.showSpeechOutputAzure)})},es=async(a,c,L)=>{let te="",R={};const O=P=>new Promise(xs=>{setTimeout(()=>{te+=P;const Ss={...R,message:{content:te,role:R.message.role}};Ge([...c,[a,Ss]]),xs(null)},33)});try{ke(!0);for await(const P of Is(L))if(P.context&&P.context.data_points)P.message=P.delta,R=P;else if(P.delta.content)he(!1),await O(P.delta.content);else if(P.context)R.context={...R.context,...P.context};else if(P.error)throw Error(P.error)}finally{ke(!1)}return{...R,message:{content:te,role:R.message.role}}},$e=H?we().instance:void 0,{loggedIn:Le}=o.useContext(Se),Y=async a=>{G.current=a,pe&&Ie(void 0),he(!0);const c=$e?await oe($e):void 0;Ft.trackEvent({name:"QuestionSubmitted",properties:{question:a}});try{const te={messages:[...I.flatMap(O=>[{content:O[0],role:"user"},{content:O[1].message.content,role:"assistant"}]),{content:a,role:"user"}],context:{overrides:{prompt_template:s.length===0?void 0:s,exclude_category:N.length===0?void 0:N,top:S,temperature:r,minimum_reranker_score:p,minimum_search_score:w,retrieval_mode:x,semantic_ranker:j,semantic_captions:le,suggest_followup_questions:M,use_oid_security_filter:Pe,use_groups_security_filter:Ee,vector_fields:Et,use_gpt4v:de,gpt4v_input:Me,...h!==null?{seed:h}:{}}},session_state:I.length?I[I.length-1][1].session_state:null},R=await An(te,z,c);if(!R.body)throw Error("No response body");if(z){const O=await es(a,I,R.body);Te([...I,[a,O]])}else{const O=await R.json();if(R.status>299||!R.ok)throw Error(O.error||"Unknown error");Te([...I,[a,O]])}}catch(L){Ie(L)}finally{he(!1)}},ts=()=>{G.current="",pe&&Ie(void 0),Ue(void 0),ge(void 0),Te([]),Ge([]),he(!1),ke(!1)};o.useEffect(()=>Ce.current?.scrollIntoView({behavior:"smooth"}),[ue]),o.useEffect(()=>Ce.current?.scrollIntoView({behavior:"auto"}),[ze]),o.useEffect(()=>{Yt()},[]),o.useEffect(()=>{if(I&&Ne)for(let a=0;a<I.length;a++)Z[a]||Fn(I[a][1].message.content).then(c=>{Bt([...Z.slice(0,a),c,...Z.slice(a+1)])})},[I]);const ss=(a,c)=>{i(c||"")},ns=(a,c)=>{d(parseFloat(c||"0"))},as=(a,c)=>{l(parseInt(c||""))},os=(a,c)=>{y(parseFloat(c||"0"))},rs=(a,c)=>{m(parseFloat(c||"0"))},is=(a,c)=>{_(parseInt(c||"3"))},ls=(a,c)=>{K(!!c)},cs=(a,c)=>{b(!!c)},ds=(a,c)=>{je(!!c)},us=(a,c)=>{ce(c||"")},hs=(a,c)=>{ve(!!c)},ps=(a,c)=>{Ot(!!c)},ms=(a,c)=>{Ut(!!c)},gs=a=>{Y(a)},[fs,bs]=o.useState(0),Qe=(a,c)=>{Ue(a),ge($.CitationTab),Ve(c),bs(L=>L+1)},ee=(a,c)=>{ge(me===a&&fe===c?void 0:a),Ve(c)},He=g("promptTemplate"),We=g("promptTemplateField"),Ke=g("temperature"),Je=g("temperatureField"),Xe=g("seed"),Ze=g("seedField"),Ye=g("searchScore"),et=g("searchScoreField"),tt=g("rerankerScore"),st=g("rerankerScoreField"),nt=g("retrieveCount"),at=g("retrieveCountField"),ot=g("excludeCategory"),rt=g("excludeCategoryField"),it=g("semanticRanker"),lt=g("semanticRankerField"),ct=g("semanticCaptions"),dt=g("semanticCaptionsField"),ut=g("suggestFollowupQuestions"),ht=g("suggestFollowupQuestionsField"),pt=g("useOidSecurityFilter"),mt=g("useOidSecurityFilterField"),gt=g("useGroupsSecurityFilter"),ft=g("useGroupsSecurityFilterField"),bt=g("shouldStream"),xt=g("shouldStreamField");return e.jsxs("div",{className:u.container,children:[e.jsxs("div",{className:u.commandsContainer,children:[e.jsx(Ua,{className:u.commandButton,onClick:ts,disabled:!G.current||ue}),Ht&&e.jsx(qa,{className:u.commandButton,disabled:!Le})]}),e.jsxs("div",{className:u.chatRoot,children:[e.jsxs("div",{className:u.chatContainer,children:[G.current?e.jsxs("div",{className:u.chatMessageStream,children:[Oe&&ze.map((a,c)=>e.jsxs("div",{children:[e.jsx(xe,{message:a[0]}),e.jsx("div",{className:u.chatMessageGpt,children:e.jsx(vt,{isStreaming:!0,answer:a[1],isSelected:!1,onCitationClicked:L=>Qe(L,c),onThoughtProcessClicked:()=>ee($.ThoughtProcessTab,c),onSupportingContentClicked:()=>ee($.SupportingContentTab,c),onFollowupQuestionClicked:L=>Y(L),showFollowupQuestions:M&&I.length-1===c,showSpeechOutputAzure:Ne,showSpeechOutputBrowser:De,speechUrl:Z[c]},c)})]},c)),!Oe&&I.map((a,c)=>e.jsxs("div",{children:[e.jsx(xe,{message:a[0]}),e.jsx("div",{className:u.chatMessageGpt,children:e.jsx(vt,{isStreaming:!1,answer:a[1],isSelected:fe===c&&me!==void 0,onCitationClicked:L=>Qe(L,c),onThoughtProcessClicked:()=>ee($.ThoughtProcessTab,c),onSupportingContentClicked:()=>ee($.SupportingContentTab,c),onFollowupQuestionClicked:L=>Y(L),showFollowupQuestions:M&&I.length-1===c,showSpeechOutputAzure:Ne,showSpeechOutputBrowser:De,speechUrl:Z[c]},c)})]},c)),ue&&e.jsxs(e.Fragment,{children:[e.jsx(xe,{message:G.current}),e.jsx("div",{className:u.chatMessageGptMinWidth,children:e.jsx(ea,{})})]}),pe?e.jsxs(e.Fragment,{children:[e.jsx(xe,{message:G.current}),e.jsx("div",{className:u.chatMessageGptMinWidth,children:e.jsx(ta,{error:pe.toString(),onRetry:()=>Y(G.current)})})]}):null,e.jsx("div",{ref:Ce})]}):e.jsxs("div",{className:u.chatEmptyState,children:[e.jsxs("div",{className:u.contentContainer,children:[e.jsx("div",{className:u.importantNoteContainer,children:e.jsxs("div",{className:u.importantNoteContent,children:[e.jsx("h2",{className:u.importantNoteTitle,children:"Important:"}),e.jsxs("p",{className:u.importantNoteText,children:["The City Regulations Assistant (CRA) helps with inquiries about city regulations, bylaws, property taxes, recycling and more. Enter your question in the text field or click on an example below. Engage in a conversation by selecting suggested follow-up questions or by narrowing down your questions for more accurate responses. The CRA does not search the internet and cannot address queries unrelated to city bylaws. Responses are informative but do not constitute as legal advice. Before using the CRA, please read the  ",e.jsx("a",{href:"https://www.whiterockcity.ca/1209/12772/City-Regulations-Assistant",target:"_blank",rel:"noopener noreferrer",children:"Terms of Use and Disclaimer"}),"."]})]})}),e.jsx("div",{className:u.dotLottieContainer,children:e.jsx(ks,{src:"https://lottie.host/4e7b195d-3936-4443-b87c-4c8da7d0c732/7akGrebQ3p.json",loop:!0,speed:"1",autoplay:!0,backgroundColor:"#f2f2f2"})}),e.jsxs("div",{className:u.introductionNote,children:[e.jsx("p",{children:"Access relevant applications using the following links:"}),e.jsx("a",{href:"https://maps.whiterockcity.ca/wroms/",target:"_blank",rel:"noopener noreferrer",children:e.jsx("img",{src:"https://whiterock.maps.arcgis.com/sharing/rest/content/items/a7f70941051c44f59dd40036a1df972d/data",alt:"White Rock City Maps",className:u.iconWithShadow})}),e.jsx("a",{href:"https://whiterock.maps.arcgis.com/apps/instant/3dviewer/index.html?appid=2831a4704f724bdab7ac4d638f41fa18",target:"_blank",rel:"noopener noreferrer",children:e.jsx("img",{src:"https://whiterock.maps.arcgis.com/sharing/rest/content/items/bbd67f470aee4b1591e2ef820bf0ce69/data",alt:"3D White Rock",className:u.iconWithShadow})}),e.jsx("a",{href:"https://data.whiterockcity.ca/",target:"_blank",rel:"noopener noreferrer",children:e.jsx("img",{src:"https://whiterock.maps.arcgis.com/sharing/rest/content/items/9101ac4293bc496f98467a5e26fc42cf/data",alt:"Open Data Portal",className:u.iconWithShadow})}),e.jsx("a",{href:"https://whiterock.maps.arcgis.com/apps/instant/interactivelegend/index.html?appid=02057edb95cd41f2aa6eef991edc04d0",target:"_blank",rel:"noopener noreferrer",children:e.jsx("img",{src:"https://whiterock.maps.arcgis.com/sharing/rest/content/items/43b82e4623fc46838ea0a1d5ee7de746/data",alt:"Business Location Map",className:u.iconWithShadow})}),e.jsx("a",{href:"https://www.whiterockcity.ca/345/Open-Data",target:"_blank",rel:"noopener noreferrer",children:e.jsx("img",{src:"https://whiterock.maps.arcgis.com/sharing/rest/content/items/7215630d2f174ecc86648df0e69ceb15/data",alt:"Open Data Dashboard",className:u.iconWithShadow})})]})]}),e.jsx("div",{className:u.chatExample,children:e.jsx(ma,{onExampleClicked:gs,useGPT4V:de})})]}),e.jsx("div",{className:u.chatInput,children:e.jsx(ia,{clearOnSend:!0,placeholder:"Enter your question here.",disabled:ue,onSend:a=>Y(a),showSpeechInput:Kt})})]}),I.length>0&&me&&e.jsx(Ea,{className:u.chatAnalysisPanel,activeCitation:Gt,onActiveTabChanged:a=>ee(a,fe),citationHeight:"1024px",answer:I[fe][1],activeTab:me},fs),e.jsxs(Xs,{headerText:"Configure answer generation",isOpen:t,isBlocking:!1,onDismiss:()=>n(!1),closeButtonAriaLabel:"Close",onRenderFooterContent:()=>e.jsx(Nt,{onClick:()=>n(!1),children:"Close"}),isFooterAtBottom:!0,children:[e.jsx(U,{id:We,className:u.chatSettingsSeparator,defaultValue:s,label:"Override prompt template",multiline:!0,autoAdjustHeight:!0,onChange:ss,"aria-labelledby":He,onRenderLabel:a=>e.jsx(v,{labelId:He,fieldId:We,helpText:C.promptTemplate,label:a?.label})}),e.jsx(U,{id:Je,className:u.chatSettingsSeparator,label:"Temperature",type:"number",min:0,max:1,step:.1,defaultValue:r.toString(),onChange:ns,"aria-labelledby":Ke,onRenderLabel:a=>e.jsx(v,{labelId:Ke,fieldId:Je,helpText:C.temperature,label:a?.label})}),e.jsx(U,{id:Ze,className:u.chatSettingsSeparator,label:"Seed",type:"text",defaultValue:h?.toString()||"",onChange:as,"aria-labelledby":Xe,onRenderLabel:a=>e.jsx(v,{labelId:Xe,fieldId:Ze,helpText:C.seed,label:a?.label})}),e.jsx(U,{id:et,className:u.chatSettingsSeparator,label:"Minimum search score",type:"number",min:0,step:.01,defaultValue:w.toString(),onChange:os,"aria-labelledby":Ye,onRenderLabel:a=>e.jsx(v,{labelId:Ye,fieldId:et,helpText:C.searchScore,label:a?.label})}),qe&&e.jsx(U,{id:st,className:u.chatSettingsSeparator,label:"Minimum reranker score",type:"number",min:1,max:4,step:.1,defaultValue:p.toString(),onChange:rs,"aria-labelledby":tt,onRenderLabel:a=>e.jsx(v,{labelId:tt,fieldId:st,helpText:C.rerankerScore,label:a?.label})}),e.jsx(U,{id:at,className:u.chatSettingsSeparator,label:"Retrieve this many search results:",type:"number",min:1,max:50,defaultValue:S.toString(),onChange:is,"aria-labelledby":nt,onRenderLabel:a=>e.jsx(v,{labelId:nt,fieldId:at,helpText:C.retrieveNumber,label:a?.label})}),e.jsx(U,{id:rt,className:u.chatSettingsSeparator,label:"Exclude category",onChange:us,"aria-labelledby":ot,onRenderLabel:a=>e.jsx(v,{labelId:ot,fieldId:rt,helpText:C.excludeCategory,label:a?.label})}),qe&&e.jsxs(e.Fragment,{children:[e.jsx(D,{id:lt,className:u.chatSettingsSeparator,checked:j,label:"Use semantic ranker for retrieval",onChange:ls,"aria-labelledby":it,onRenderLabel:a=>e.jsx(v,{labelId:it,fieldId:lt,helpText:C.useSemanticReranker,label:a?.label})}),e.jsx(D,{id:dt,className:u.chatSettingsSeparator,checked:le,label:"Use semantic captions",onChange:cs,disabled:!j,"aria-labelledby":ct,onRenderLabel:a=>e.jsx(v,{labelId:ct,fieldId:dt,helpText:C.useSemanticCaptions,label:a?.label})})]}),e.jsx(D,{id:ht,className:u.chatSettingsSeparator,checked:M,label:"Suggest follow-up questions",onChange:hs,"aria-labelledby":ut,onRenderLabel:a=>e.jsx(v,{labelId:ut,fieldId:ht,helpText:C.suggestFollowupQuestions,label:a?.label})}),Be&&e.jsx(Ja,{gpt4vInputs:Me,isUseGPT4V:de,updateUseGPT4V:a=>{zt(a)},updateGPT4VInputs:a=>Vt(a)}),$t&&e.jsx(Qa,{defaultRetrievalMode:x,showImageOptions:de&&Be,updateVectorFields:a=>Mt(a),updateRetrievalMode:a=>f(a)}),H&&e.jsxs(e.Fragment,{children:[e.jsx(D,{id:mt,className:u.chatSettingsSeparator,checked:Pe||ae,label:"Use oid security filter",disabled:!Le||ae,onChange:ps,"aria-labelledby":pt,onRenderLabel:a=>e.jsx(v,{labelId:pt,fieldId:mt,helpText:C.useOidSecurityFilter,label:a?.label})}),e.jsx(D,{id:ft,className:u.chatSettingsSeparator,checked:Ee||ae,label:"Use groups security filter",disabled:!Le||ae,onChange:ms,"aria-labelledby":gt,onRenderLabel:a=>e.jsx(v,{labelId:gt,fieldId:ft,helpText:C.useGroupsSecurityFilter,label:a?.label})})]}),e.jsx(D,{id:xt,className:u.chatSettingsSeparator,checked:z,label:"Stream chat completion responses",onChange:ds,"aria-labelledby":bt,onRenderLabel:a=>e.jsx(v,{labelId:bt,fieldId:xt,helpText:C.streamChat,label:a?.label})}),H&&e.jsx(Ha,{})]})]})]})},Za="_layout_127j8_1",Ya="_header_127j8_17",eo="_headerContainer_127j8_39",to="_logoContainer_127j8_51",so="_logo_127j8_51",no="_beta_127j8_69",ao="_headerTitle_127j8_87",oo="_headerNavList_127j8_115",ro="_headerNavPageLink_127j8_143",io="_headerNavPageLinkActive_127j8_145",lo="_headerNavLeftMargin_127j8_171",co="_microsoftLogo_127j8_181",uo="_githubLogo_127j8_183",q={layout:Za,header:Ya,headerContainer:eo,logoContainer:to,logo:so,beta:no,headerTitle:ao,headerNavList:oo,headerNavPageLink:ro,headerNavPageLinkActive:io,headerNavLeftMargin:lo,microsoftLogo:co,githubLogo:uo},It=()=>{const[t,n]=o.useState(!1),s=o.useRef(null),i=r=>{s.current&&!s.current.contains(r.target)&&n(!1)};return o.useEffect(()=>(t?document.addEventListener("mousedown",i):document.removeEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}),[t]),e.jsxs("div",{className:q.layout,children:[e.jsx("header",{className:q.header,role:"banner",children:e.jsxs("div",{className:q.headerContainer,ref:s,children:[e.jsx("a",{href:"https://www.whiterockcity.ca/",target:"_blank",title:"City of White Rock",className:q.logoContainer,children:e.jsx("img",{src:"https://whiterock.maps.arcgis.com/sharing/rest/content/items/14911c0ffb634cae9db96dae49c9584f/data",alt:"",className:q.logo})}),e.jsxs("h2",{className:q.headerTitle,children:["City Regulations Assistant ",e.jsx("span",{className:q.beta,children:"(Beta)"})]})]})}),e.jsx(Ts,{})]})},ho=()=>{const[t,n]=o.useState(!1);if(H){var s=new Ns(vn);return!s.getActiveAccount()&&s.getAllAccounts().length>0&&s.setActiveAccount(s.getActiveAccount()),s.addEventCallback(i=>{if(i.eventType===Ls.LOGIN_SUCCESS&&i.payload){const r=i.payload;s.setActiveAccount(r)}}),o.useEffect(()=>{(async()=>{n(await Tn(s))})()},[]),e.jsx(As,{instance:s,children:e.jsx(Se.Provider,{value:{loggedIn:t,setLoggedIn:n},children:e.jsx(It,{})})})}else return e.jsx(Se.Provider,{value:{loggedIn:t,setLoggedIn:n},children:e.jsx(It,{})})};Fs();const po=Rs([{path:"/",element:e.jsx(ho,{}),children:[{index:!0,element:e.jsx(Xa,{})},{path:"qa",lazy:()=>St(()=>import("./Ask-f411d933.js"),["assets/Ask-f411d933.js","assets/vendor-c02d77b0.js","assets/fluentui-icons-7554e566.js","assets/fluentui-react-2f12a35c.js","assets/Ask-84488669.css"])},{path:"*",lazy:()=>St(()=>import("./NoPage-4598e956.js"),["assets/NoPage-4598e956.js","assets/vendor-c02d77b0.js"])}]}]);Ps.createRoot(document.getElementById("root")).render(e.jsx(Es.StrictMode,{children:e.jsx(Ms,{router:po})}));export{vt as A,ma as E,V as G,v as H,Se as L,ia as Q,A as R,Ha as T,qa as U,E as V,$ as a,ta as b,Ea as c,Ja as d,Qa as e,Ln as f,Fn as g,oe as h,xo as i,ae as r,C as t,H as u};
//# sourceMappingURL=index-076fe0af.js.map
