GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Windows/SystemApps/Microsoft.Windows.Search_cw5n1h2txyewy/cache/Desktop/ |
Upload File : |
var __rest,WSB;(function(n){class t{static init(){t.aadVerificationContainer=_ge("aadVerificationContainer");t.dialogBox=_ge("dialogBox");t.dynamicPaneWrapper=_ge("dsb-wrapper");t.dynamicPane=_ge("dynamic-pane");t.msbDsbSwitch=_ge("msb_dsb_switch");t.msbDsbBrTop=_ge("msb_dsb_brtop");t.msbDsbRoot=_ge("msb_dsb_root");t.dynamicPaneFullWidth=_ge("dynamic-pane-full");t.flyoutContainer=_ge("flyoutContainer");t.footer=_ge("footer");t.groups=_ge("groups");t.menuContainer=_ge("menuContainer");t.narratorMessageContainer=_ge("narratorMessageContainer");t.overlayContainer=_ge("overlayContainer");t.performanceWidget=_ge("performanceWidget");t.popoverContainer=_ge("popoverContainer");t.qfContainer=_ge("qfContainer");t.qfContainerScroll=_ge("qfContainerScroll");t.qfPreviewPane=_ge("qfPreviewPane");t.qfPreviewScrollArea=_ge("qfPreviewScrollArea");t.root=_ge("root");t.rootContainer=_ge("rootContainer");t.scopesHeader=_ge("scopesHeader");t.shimmerContainer=n.config.showShimmerOnDismiss?_ge("shimmerContainer"):undefined;t.suggestionsList=_ge("suggestionsList");t.topHitHeader=_ge("topHitHeader");t.topResults=_ge("topResults");t.workUpsellBanner=_ge("workUpsellBanner");t.messageBannerBottom=_ge("messageBannerBottom");t.messageBannerTop=_ge("messageBanner");t.notificationBanner=_ge("notificationBanner");t.chatIframe=_ge("qf-chat");t.copilotChat=_ge("copilot-chat-container");t.copilotLoadingScreen=_ge("copilotLoadingScreen");t.copilotPaneContainer=_ge("copilotPaneContainer");t.horizontalScrollBar=_ge("horizontalScrollBar");t.temporaryMessages=_ge("temporaryMessages")}}n.StaticHtmlElements=t})(WSB||(WSB={})),function(n){function r(){if(n.config.limitScaleRange){let t=1;if(SearchAppWrapper.CortanaApp.textScaleFactor>n.MaxTextScaleThres?t=n.MaxTextScaleThres/SearchAppWrapper.CortanaApp.textScaleFactor:SearchAppWrapper.CortanaApp.textScaleFactor<n.MinTextScaleThres&&(t=n.MinTextScaleThres/SearchAppWrapper.CortanaApp.textScaleFactor),t!=1){const n=`${t*100}%`;document.body.style.zoom=n}else document.body.style.zoom=""}}function f(){if(!n.isMiniSerpEnabled())return 0;let t=7;return n.config.allowAnswersToAutoOpenMiniSerp||(t&=-2),n.config.allowDNavToAutoOpenMiniSerp||(t&=-3),n.config.allowWebToAutoOpenMiniSerp||(t&=-5),t}n.limitTextScaleRange=r;class t{}t.QuickAccess=n.config.newQuickAccess?"::{F874310E-B6B7-47DC-BC84-B9E6B38F5903}":"::{679F85CB-0220-4080-B29B-5540CC05AAB6}";t.ThisPC="::{20D04FE0-3AEA-1069-A2D8-08002B30309D}";t.ControlPanel="::{26EE0668-A00A-44D7-9371-BEB064C98683}";const u=[t.QuickAccess,t.ThisPC];class i{constructor(){this.refreshSetting();this.refreshEntrypointApp()}refreshEntrypointApp(){SearchAppWrapper.CortanaApp.hostingEnvironment==3?this.EntryPointApp=1:n.config.forceSettingsAppExperience?this.EntryPointApp=3:(this.EntryPointApp=0,this.AlwaysWide=this.isAlwaysWide(),n.config.initSearchHomeAvailable&&(this.SearchHomeAvailable=n.config.searchHomeSupported))}refreshSetting(){i.TextScaleFactor=SearchAppWrapper.CortanaApp.textScaleFactor;r();const n=SearchAppWrapper.CortanaApp.queryFormulationView.searchHistory;i.DeviceHistoryEnabled=n&&n.isDeviceHistoryEnabled}clearDefaults(){this.QfMode=0;this.PreviewPaneAvailable=!1;this.MiniSERPMode=0;this.AlwaysWide=!1;this.SearchBoxOnTop=!0;this.AllowKeyboardNavCycling=!0;this.AllowKeyboardNavOffCanvas=!1;this.ScopesAvailable=!1;this.FlatListWithoutGroups=!1;this.MaxSuggestionsWhenFlatList=0;this.SearchHomeAvailable=undefined;this.FirstSuggestionSelectedByDefault=!0;this.AllowProtocolSyntheticSuggestions=!0;this.PanelCanResize=!1}isAlwaysWide(){if(n.config.wsbWithCopilotQF)return!1;let t=i.TextScaleFactor>1.25;n.config.disbaleWideForLargeTextScale&&(t=!1);let r=!1;try{r=SearchAppWrapper.CortanaApp.isWideSearch}catch(f){}let u=r!==!1;return(u||n.config.alwaysWideBeforeRS5)&&!t}getAlwaysWideAndPrevewPaneAvailable(){let u=i.TextScaleFactor>1.25;n.config.disbaleWideForLargeTextScale&&(u=!1);let t;try{t=SearchAppWrapper.CortanaApp.isWideSearch}catch(o){}let r;r=n.config.useCobaltCSS?t!==!1:t!==!1&&!!n.Host.getFeatureDWORD("WideAtStartupDelta").featureValue;let f=(r||n.config.alwaysWideBeforeRS5)&&!u,e=f||n.PreviewPane&&!r&&t!==!1;return[f,e]}OnAppVisible(){this.clearDefaults();this.refreshSetting();this.refreshEntrypointApp();n.isFileExplorerCurrentPathThisPcOrQuickAccess=!1;switch(this.EntryPointApp){case 1:let i=n.safeExecute(()=>SearchAppWrapper.CortanaApp.fileExplorerSuggestionPage.currentLocation,"fileExplorerSuggestionPage.currentLocation");i&&!i.startsWith("::")?this.QfMode=5:n.config.wsbInControlPanel&&i&&i.startsWith(t.ControlPanel)?this.QfMode=9:n.contains(u,i)?(n.isFileExplorerCurrentPathThisPcOrQuickAccess=!0,this.QfMode=5):this.QfMode=999999;this.AllowKeyboardNavOffCanvas=!0;this.FlatListWithoutGroups=!0;this.MaxSuggestionsWhenFlatList=10;this.FirstSuggestionSelectedByDefault=!1;this.AllowProtocolSyntheticSuggestions=!1;this.PanelCanResize=!0;break;case 3:this.QfMode=7;this.FlatListWithoutGroups=!0;this.MaxSuggestionsWhenFlatList=10;this.AllowProtocolSyntheticSuggestions=!1;break;case 0:default:{const i=n.config.enableFindInStart&&SearchAppWrapper.CortanaApp.entryPoint=="WNSFIS",[t,r]=i?[!0,!1]:this.getAlwaysWideAndPrevewPaneAvailable();this.QfMode=i?11:t?1:r?0:4;this.PreviewPaneAvailable=i?!1:t||r;this.MiniSERPMode=this.PreviewPaneAvailable?f():0;this.AlwaysWide=t;let u;u=n.shouldUseMsbEnterpriseScopes()?t?n.config.scopesOrderBeginAlwaysWideMsbEnterprise.length>0:n.config.scopesOrderBeginMsbEnterprise.length>0:t?n.config.scopesOrderBeginAlwaysWide.length>0:n.config.scopesOrderBegin.length>0;this.ScopesAvailable=u;this.SearchBoxOnTop=!1;this.SearchHomeAvailable=n.config.searchHomeSupported;n.config.wsbWithCopilotQF&&(this.AlwaysWide=!1,this.PreviewPaneAvailable=!1,this.MiniSERPMode=0)}}}}n.RuntimeConfiguration=i}(WSB||(WSB={})),function(n){var t;(function(n){let t;(function(n){n.User="SRCHHPGUSR"})(t=n.CookieNames||(n.CookieNames={}));let i;(function(n){n.AutoSuggest="AS"})(i=n.CrumbNames||(n.CrumbNames={}));let r;(function(n){n.CursorPosition="cp";n.ConversationId="cvid";n.LogicalId="logicalId";n.SuggestionCount="sc";n.PartialQuery="pq";n.SuggestionPosition="sp";n.SuggestionType="qs";n.PreviewPaneSuggestionType="qsc";n.SkipValue="sk";n.PreviewPaneSkipValue="skc";n.Ghosting="ghc";n.Css="css";n.Count="count";n.DataSet="ds";n.SessionId="sid";n.TimeStamp="qt";n.Query="q";n.ImpressionGuid="ig";n.QFQuery="qry";n.BaseQuery="bq";n.FormCode="form";n.HashedMuid="nclid";n.RequestElToken="elvr";n.ElTokenValue="elv";n.AppId="appid";n.History="history";n.NoHistory="nohs";n.ApiTextDecoration="textdecorations";n.ClientId="clientid";n.Market="mkt";n.Scope="scope";n.CountryCode="cc";n.HomeGeographicRegion="hgr";n.SetLang="setlang";n.ZeroInputSerp="zis";n.Host="host";n.CortanaVersion="version";n.QfMode="qfm";n.SearchHistorySettingOff="seahisoff"})(r=n.QueryParams||(n.QueryParams={}));let u;(function(n){n.ImpressionGuid="X-MSEdge-IG"})(u=n.Headers||(n.Headers={}));let f;(function(n){n.HitHighlighting="h";n.PopularNow="p";n.Local="l";n.Answers="a"})(f=n.Options||(n.Options={}));let e;(function(n){n.Id="id";n.Query="query";n.Url="url";n.Navigation="nav";n.Type="stype";n.Autocomplete="hc";n.InstData="h";n.AriaLabel="aria-label"})(e=n.SuggestionAttributes||(n.SuggestionAttributes={}))})(t=n.Service||(n.Service={}))}(WSB||(WSB={})),function(n){function ii(t,i){if(i){let i=nt.exec(t);return i&&n.TopLevelDomains[i[1].toLowerCase()]==1}return nt.test(t)}function ri(n){return gt.test(n)}function fi(t){let r=t.substr(1).split("%").map(n=>parseInt(n,16));for(var i=0;i<r.length;++i){let t=[r[i],r[i+1]||0,r[i+2]||0,r[i+3]||0];if(t[0]>=240&&++i&&t[3]<128||t[0]>=224&&++i&&t[2]<128||t[0]>=192&&++i&&t[1]<128||t[0]<192&&t[0]>=128||t[0]<32||n.contains(ui,t[0]))return!1}return!0}function ei(n){return n.replace(/%25/g,"%2525").replace(/%([^0-9a-fA-F])/g,"%25$1").replace(/%([^0-9a-fA-F])/g,"%25$1").replace(/%(.[^0-9a-fA-F])/g,"%25$1").replace(/%(.[^0-9a-fA-F])/g,"%25$1").replace(/%(.)?$/g,"%25$1").match(/[^%]+|(?:%..)*/g).map(n=>n.startsWith("%")&&!fi(n)?n.replace(/%/g,"%25"):n).join("")}function h(t){let i=t;return t.includes("%")&&(t=n.safeExecute(()=>ei(t),"sanitizeUrlEncodings",i,i)),n.safeExecute(()=>decodeURI(t),"safeDecodeURI",i,i)}function r(n,t){if(!n)return null;if(n=n.trim(),n.includes("%")&&c(n))if(n.includes("?")){let[,t,i]=/([^?]*)(.*)/.exec(n);t=h(t);n=t+i}else n=h(n);let r=bt.exec(n);if(!r)return null;let u=r[0].length;if(t&&u<n.length)return null;let i={length:u,type:0,protocol:r[1]||"",auth:r[2]||"",hostname:r[3]||"",port:r[4]||"",path:r[5]||"",parameters:r[6]||"",unparsedSegment:n.substr(u)};return i.auth&&!i.auth.includes(":")&&!i.protocol&&!i.port&&!i.path&&!i.parameters?null:i.protocol||i.path&&i.path.endsWith("/")?i:kt.test(i.hostname)||ii(i.hostname,t)||w.test(i.hostname)||k.test(i.hostname)?i:(i.type=i.path&&!ri(i.path)?1:2,i)}function it(n,t){let r=new RegExp("[?&]{1}"+t+"=([^&]+)([\\/\\\\][^?#]*)?([?#].*)?","i"),i=n.match(r);return i?i[1]:null}function ci(n){return si.some(t=>n.startsWith(t))||oi.test(n)||n.toLocaleLowerCase().includes(hi)}function li(n,t,i){let e=0,o=0,s=0;(t.startsWith("read:")||t.startsWith("ftp:"))&&(t=t.replace(f,""));let u=r(t,!0);u&&u.type==0&&(e=vi(i,u),o=rt(i,t,u),s=yi(i,u));n.protocolMatchLength=e;n.domainMatchLength=o;n.pathMatchLength=s}function ai(n,t){let u=0;(n.startsWith("read:")||n.startsWith("ftp:"))&&(n=n.replace(f,""));let i=r(n,!0);return i&&i.type==0&&(u=rt(t,n,i)),u}function vi(n,t){let i=f.exec(n),r=i?i[1]:n.trim();return t.protocol.startsWith(r)?r.length:0}function rt(t,i,r){if(w.test(r.hostname)||k.test(r.hostname))return r.hostname.startsWith(t)||i.startsWith(t)?t.length:0;let u=r.hostname.split("."),f;if(u.length==1)f=HitHighlightingParser.addMarkers(u[0],t);else{u=u.length>2&&n.SecondLevelDomains[u[u.length-2]]?u.splice(0,u.length-2):u.splice(0,u.length-1);let i=u.join(".");f=HitHighlightingParser.addMarkers(i,t)}let e=f.indexOf(HitHighlightingParser.startMarker);if(e==-1)return 0;if(t.includes("."))return t.endsWith("/")&&(t=t.substr(0,t.length-1)),r.hostname.includes(t)?t.length:0;let o=f.indexOf(HitHighlightingParser.endMarker);return o-e-1}function yi(n,t){if(!t.path)return 0;let i=HitHighlightingParser.addMarkers(t.path,n),r=i.indexOf(HitHighlightingParser.startMarker);if(r==-1)return 0;let u=i.indexOf(HitHighlightingParser.endMarker);return u-r-1}function pi(n){return n=ft(n,!1),dt.test(n)}function ut(n){return f.test(n)}function wi(n){return a.test(n)}function c(n){return pt.test(n)}function bi(n){return ut(n)&&!c(n)}function ki(n){let t;return t=typeof n=="string"?n:l(n,!0),t=gi(t),t.trim().replace(/^ht+p(s)?[:;]+[\\\/]*|^\/*/ig,(n,t)=>t?"https://":"http://")}function ft(n,t){return t?n.includes("/")||(n=n.replace(/\\/g,"/")):n.startsWith("//")||n.includes("\\")||(n=n.replace(/\//g,"\\")),n}function di(n){return n=ft(n,!0).replace(/\/+/g,"/"),(n.startsWith("/")?"file:/":"file:///")+n}function gi(n){if(!n||!n.includes("\\"))return n;let i=n.includes("?")?n.indexOf("?"):n.length,r=n.includes("#")?n.indexOf("#"):n.length,t=Math.min(i,r),u=n.substring(0,t),f=n.substr(t);return u.replace(/\\/g,"/")+f}function l(n,t){let i=n.protocol?n.protocol:"";return i+=!t&&n.auth?n.auth:"",i+=n.hostname,i+=n.port?n.port:"",i+=n.path?n.path:"",i+=n.parameters?n.parameters:"",i+(n.unparsedSegment?n.unparsedSegment:"")}function i(n,t){let i=n;if(t&1){let n=et.exec(i);n&&(i=n[1])}if(t&2){let n=ot.exec(i);n&&(i=n[1])}if(t&4){let n=st.exec(i);n&&(i=n[1])}if(t&8){let n=a.exec(i);n&&(i=n[1])}if(t&16){let n=nr.exec(i);n&&(i=n[1])}if(t&32){let n=r(i,!1);if(n){n.protocol=n.protocol.toLocaleLowerCase();n.hostname=n.hostname.toLocaleLowerCase();let t=l(n);i=i.replace(/^(\s*)(?:[^\s]*)(\s*)$/g,"$1"+t+"$2")}}return t&64&&(i=h(i)),i}function tr(n){return a.test(n)}function e(n){return ot.test(n)?1:et.test(n)?2:st.test(n)?3:0}function ir(n,t,r){if(t){if(t=="/")return n;let f=i(t,7);if(f!=t)return n;let u=i(n,r?7:6);if(!u)return n;let o=t.toLowerCase();if("https".startsWith(o)&&!u.startsWith(t))return n;let s=i(f,8);if(s!=f)return u;let e=i(u,8);return e?"www".startsWith(o)&&!e.startsWith(t)?u:e:u}return i(n,r?15:14)||n}function rr(n,t){let i=e(t);switch(e(n)){case 1:return i!=2;case 2:return i!=1;case 3:case 0:return!0}}function ur(t,r,u){if(i(r,127)!=i(u,127))return!1;let f=e(t.originalQuery);return n.contains([1,2],f)&&!rr(r,u)?!1:!0}function ht(n){let t=r(n,!0);if(!t)return null;let i=v(t);return i?t.path.toLocaleLowerCase():null}function v(n){let t=n.hostname.split(".");return n.hostname&&t.length>1?t[t.length-1]=="com"&&fr.some(n=>t[t.length-2]==n):!0}function er(n){let i=!1,t=n.hostname.toLowerCase().split(".");return n.hostname&&t.length>1&&(i=(t[t.length-1]=="com"||t[t.length-1]=="cn")&&t[t.length-2]=="msn"),i}function or(t){if(t=="https://www.bing.com/?form=EDGSTP&pc=MESP"||t=="https://www.bing.com/?form=EDGSTP&pc=MESPB")return!0;let i=ht(t);return!!i&&n.contains(n.WebSearchPaths,i)}async function sr(t,i){let r=!1;if(await new Promise(t=>{n.LocalDataProvider.getAppsByDisplayName(n.CopilotDisplayName,i=>{r=Object.values(i).reduce((n,t)=>n.concat(t),[]).some(t=>t.deviceItem.displayName===n.CopilotDisplayName[0]),t()})}),r){const r=new URL(t);let n=r.searchParams.get("q");n?(n=encodeURIComponent(n),t=`ms-copilot:chat?q=${n}&ref=wsb&form=${i}`):t=`ms-copilot:chat?ref=wsb&form=${i}`}return t}function hr(n){let t=n.match(/^https:\/\/www\.bing\.com\/search\?q=([^&]*)&/);return t&&t[1]?t[1].split("+").join(" "):null}function cr(n){let t=r(n.replace(/^ftp:/g,"http:"),!0);return(t?t.hostname:null)||""}function lr(t){let r=t.queryToFetch.toLocaleLowerCase();if(!r)return!1;let u=i(r,15);return!u||n.contains(["/","ht","htt","http","https","ww","www"],r)||u!=r&&"www".startsWith(i(r,7))}function ar(n){if(yt.test(n)||f.test(n))return!0;let t=n.replace(ni,"/");ti.test(t)?t=t.replace(tt,"."):t.includes(".")&&(t=t.replace(tt,""));let i=r(t,!0);return i&&i.type==0}function vr(n){return n.replace(/[;,/?:@&=+$ ]/g,n=>`%${n.charCodeAt(0).toString(16)}`)}function yr(n,t,i){return v(r(n,!0))?lt(ct(n,i),t):n}function ct(n,t){return o(n,"setlang",t)}function lt(n,t){return o(n,"cc",t)}function o(n,t,i){const{params:u,anchor:f}=pr(n);var r=u,e=it(u,t);return e==null?r=n.indexOf("?")>=0?r.concat(`&${t}=${i}`):r.concat(`?${t}=${i}`):(r=r.replace(new RegExp(`${t}=${e}`,"i"),""),r=o(r,t,i)),f.length>0&&(r=r.concat("#",f)),r=r.replace("?&","?"),r.replace("&&","&")}function pr(n){var t=n.split("#");return t.length==2?{params:t[0],anchor:t[1]}:{params:t[0],anchor:""}}const u="\\-\\s\\[\\]\\/\\\\!@#$%^&*()+={}:;~`\"'|<,>.。?",at="(?:[^"+u+"]-*)*[^"+u+"](?:-*[^"+u+"])*",y="(?:[^"+u+"]-*)*[^"+u+"0-9](?:-*[^"+u+"])*",vt="(?:(?:"+at+"[.。])*"+y+")[.。]?",p="(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])",s="(?:(?:"+p+"\\.){3}"+p+")",w=new RegExp("^"+s+"$"),t="(?:[0-9a-fA-F]{1,4})",b="(?::(?:(?::"+t+"){1,7}|:)|(?:"+t+":){1,7}:|(?:"+t+":){7}"+t+"|(?:"+t+":){1,6}(?::"+t+"){1}|(?:"+t+":){1,5}(?::"+t+"){2}|(?:"+t+":){1,4}(?::"+t+"){3}|(?:"+t+":){1,3}(?::"+t+"){4}|(?:"+t+":){1,2}(?::"+t+"){5}|(?:"+t+":){1,1}(?::"+t+"){6}|fe80:(?::"+t+"){0,4}%[0-9]+|::ffff:"+s+"|)",k=new RegExp("^\\["+b+"\\]$","i"),d="ht+ps?[:;]+[\\\\/]*",yt=new RegExp(d,"i"),g=d+"|/+",pt=new RegExp("^("+g+")","i"),wt=vt+"|"+s+"|\\["+b+"\\]",bt=new RegExp("^("+g+")?([^/@#?]*@)?("+wt+")(:(?:6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{1,4}|[1-9][0-9]{0,3}))?([\\/\\\\][^?#]*)?([?#].*)?","i"),kt=/^localhost[.。]?$/,nt=new RegExp("[.。]("+y+")[.。]?$","i"),dt=/((^[\\]{2}).+)|(^[a-z]:\\.*)/i,f=/^([a-z0-9\-]+):/i,gt=/\s/,tt=/\s+/g,ni=/\s+\/(?!\/)/g,ti=/([^\/]|^)\/(?!\/)/;n.WebSearchPaths=["/search","/entityexplore"];const ui=[33,39,40,41,42,91,93];n.tryParseUrl=r;n.getQueryStringParam=it;const oi=/file:\/\/\/[^:\/]+:\/[^\/]+\/[^\/]+\/AppData\//i,si=["ms-appx:","ms-appx-web:","ms-browser-extension:",],hi="microsoft.microsoftedge_8wekyb3d8bbwe";n.isJunkUrl=ci;n.computeUrlMatchLengths=li;n.computeDomainlMatchLength=ai;n.isUncOrLocalPath=pi;n.startsWithProtocol=ut;n.startsWithWww=wi;n.isHttpProtocol=c;n.isNonHttpProtocol=bi;n.cleanAndFixUrlProtocol=ki;n.cleanAndFixUncOrLocalPath=di;n.parsedUrlToString=l;const et=/^ht+ps:\/*(.*)/i,ot=/^ht+p:\/*(.*)/i,st=/^\/{2,}(.*)/,a=/^www\.(.*)/i,nr=/^(.*[^:\/])\/+$/;n.normalizeUrl=i;n.hasWww=tr;n.getProtocol=e;n.prettyPrintUrl=ir;n.isDuplicateUrl=ur;let fr=["bing","staging-bing-int","working-bing-int","bing-int","bing-exp","binginternal"];n.tryGetBingPathLC=ht;n.isBingHost=v;n.isMsnHost=er;n.isBingSearchUrl=or;n.getCopilotLaunchUrl=sr;n.extractQueryFromBingSearchUrl=hr;n.getDomain=cr;n.isEmptyUrlPrefix=lr;n.queryLooksLikeUrl=ar;n.encodeURIComponentForWindowsProtocol=vr;n.setBingUrlLanguageAndRegion=yr;n.setUrlLang=ct;n.setUrlCC=lt;n.setUrlParameter=o}(WSB||(WSB={})),function(n){let i;(function(n){function t(t,i,r,u,f,e){let o={T:n.QFPERFPING_EVENT_NAME,ST:r,CVID:u,OFFSETS:i,STATE:f,V:n.QFPERFPING_VERSION,RFC:e};return{ImpressionGuid:t,EventType:n.CLIENTINST_EVENT_TYPE,Data:o}}n.CLIENTINST_EVENT_TYPE="ClientInst";n.QFPERFPING_EVENT_NAME="QFPerfPing";n.CLICK_EVENT_TYPE="Click";n.QFPERFPING_VERSION="2";n.QFPERFPING_INVALID_MEASURE=-2;n.INVALID_SEQUENCE_NUMBER=-2;n.KVALUE_SUGGESTIONS_START=1e3;n.KVALUE_SUFFIX_START=1;n.KVALUE_NON_SUGGESTIONS_START=100;n.KVALUE_DSB_MSB_CONTENT=2e3;n.KVALUE_MSB_DSB_SWITCH=4e4;n.KVALUE_DSB_CURRENT_DAY_CONTENT=5e4;n.KVALUE_DSB_PAST_DAYS_CONTENT=6e4;n.KVALUE_DSB_IFRAME_CONTENT=7e4;n.KVALUE_DSB_V2_CONTENT=8e4;n.KVALUE_DSB_MERGED_CONTENT=9e4;n.DEFAULT_APP_NAMESPACE="SmartSearch";n.DEFAULT_SERVICE_NAME="AutoSuggest";n.KVALUE_HIDDEN=1e5;n.DEFAULT_USER_ENGAGEMENT_CONTENT={engagementType:"",engagementSurface:""};n.createPerfPingEvent=t})(i=n.InstrumentationCommon||(n.InstrumentationCommon={}));class t{constructor(n,t,r,u){this._kValue=n;this._qsCode=t;this._handOffType=r;this._workflow=u;this._properties={};this._userEngagementContent=i.DEFAULT_USER_ENGAGEMENT_CONTENT}static createInstrumentedItem(i,r){let u;return n.config.splitWindowsDataInstrumentation?(u=new t(t.generateKValue(i,r),r),n.InstrumentationHelper.updateItemDataTypeProps(u,r)):u=new t(t.generateKValue(i),r),u}static createInstrumentedItemHandOffOverride(i,r,u){let f;return n.config.splitWindowsDataInstrumentation?(f=new t(t.generateKValue(i,r),r,u),n.InstrumentationHelper.updateItemDataTypeProps(f,r)):f=new t(t.generateKValue(i),r,u),f}static createInstrumentedItemHandOffOverrideAndQS(i,r,u,f){let e;return n.config.splitWindowsDataInstrumentation?(e=new t(t.generateKValue(i,r),r,u),n.InstrumentationHelper.updateItemDataTypeProps(e,r)):e=new t(t.generateKValue(i),r,u),e.setProperty(f,r),e}static createInstrumentedItemKvalueOverride(i,r,u,f){let e=new t(i,r,u,f);return n.config.splitWindowsDataInstrumentation&&n.InstrumentationHelper.updateItemDataTypeProps(e,r),e}static createInstrumentedItemForReformulation(i,r){let u;return n.config.splitWindowsDataInstrumentation?(u=new t(t.generateKValue(i,r),r,998),n.InstrumentationHelper.updateItemDataTypeProps(u,r)):u=new t(t.generateKValue(i),r,998),u}static createInstrumentedItemNoHandOff(i,r){let u;return n.config.splitWindowsDataInstrumentation?(u=new t(t.generateKValue(i,r),r,999),n.InstrumentationHelper.updateItemDataTypeProps(u,r)):u=new t(t.generateKValue(i),r,999),u}static getNonSuggestionInstrumentedItem(i,r,u){if(!r[i])throw new Error(`${i} not found in kvalues map`);let f=new t(r[i],i,u);return n.config.splitWindowsDataInstrumentation&&n.InstrumentationHelper.updateItemDataTypeProps(f,i),f}getKValue(){return this._kValue}getAppNS(){return t.AppNS}getLayoutKValue(){return this._kValue+"."+t.Suffix}getHValue(){return(n.config.pruneImpression||n.config.splitImpression)&&this._kValue>=i.KVALUE_HIDDEN?"ID=Hidden_"+t.AppNS+","+this.getLayoutKValue():"ID="+t.AppNS+","+this.getLayoutKValue()}getHandoffType(){return this._handOffType}getQsCode(){return this._qsCode}getWorkflow(){return this._workflow}setProperty(n,t){this._properties[n]=t}getProperties(){return Object.keys(this._properties).length>0?this._properties:undefined}static resetKValues(n){delete this._keystrokesKValues[n]}static generateKValue(t,r){let f=t,u=this._keystrokesKValues[f];return(u>0||(u=i.KVALUE_SUGGESTIONS_START),this._keystrokesKValues[f]=++u,(n.config.pruneImpression||n.config.splitImpression)&&!!r&&n.isWindowsData(r))?u+i.KVALUE_HIDDEN:u}setUserEngagementContent(n){this._userEngagementContent=n}getUserEngagementContent(){return this._userEngagementContent}}t.AppNS=i.DEFAULT_APP_NAMESPACE;t.Suffix=i.KVALUE_SUFFIX_START;t._keystrokesKValues={};n.InstrumentedItem=t}(WSB||(WSB={})),function(n){function ti(){return matchMedia("screen and (-ms-high-contrast)").matches}function a(){return(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.isOffline)?!1:navigator.onLine}function v(n){return n?n.replace(kt,"$1").replace(dt,"$1 "):n}function ii(n){return n?n.replace(/[-{}]/g,"").toLowerCase():null}function ri(n){return!n||Object.keys(n).length===0}function ui(n){return n.canFail}function y(n,t,i,r){n&&(n=n.slice(0,t)+o+n.slice(t,n.length));let u=i(n);if(u){let n=u.indexOf(o);t=n!=-1?n:t;u=u.replace(o,"")}r(u,t)}function fi(t){if(!t)return n.LogWSBError("getInputType",null,new Error("event object is missing"),undefined,undefined,"WindowsTelemetry"),0;switch(t.pointerType){case"mouse":return 2;case"touch":return 3;case"pen":return 4;default:return 1}}function s(n,...t){t.forEach(t=>delete n.enabledDataSources[t])}function ei(n){return n?n.toLowerCase()!="cn"&&n.toLowerCase()!="ru":!1}function p(i,r){if(!i||!r)return!1;var u=!n.config.bingFetchEnabledRegions||n.config.bingFetchEnabledRegions.length==0||t(n.config.bingFetchEnabledRegions,i.toLowerCase()),f=r.split("-")[0],e=!n.config.bingFetchEnabledLang||n.config.bingFetchEnabledLang.length==0||t(n.config.bingFetchEnabledLang,f.toLowerCase());return u&&e}function oi(i,r){if(!i||!r)return!1;var u=!n.config.miniSerpEnabledRegions||n.config.miniSerpEnabledRegions.length==0||t(n.config.miniSerpEnabledRegions,i.toLowerCase()),f=r.split("-")[0],e=!n.config.miniSerpEnabledLang||n.config.miniSerpEnabledLang.length==0||t(n.config.miniSerpEnabledLang,f.toLowerCase());return u&&e}function si(t,i){const r=`${i}:${t}`;return r===w?st():(w=r,n.isMarketEligible(t,i,n.config.trendingSearchInSHEligibleLangRegionPairs))}function hi(t,i){if(!t||!i)return!1;const r=`${i}:${t}`;return r===b?l:(b=r,n.isMarketEligible(t,i,n.config.DSBFullWidthMarkets))}function ci(t,i){if(!t||!i)return!1;const r=`${i}:${t}`;return r===k?ht():(k=r,n.isMarketEligible(t,i,n.config.thumbnailForTSEligibleLangRegionPairs))}function li(t,i,r){let u=t.queryToFetch&&t.queryToFetch.length<n.config.minQueryLengthForWebProvider||!p(i,r);return u&&s(t,"Web"),u}function ai(t){t.queryToFetch&&t.queryToFetch.length<n.config.coPiffTriggerKeystrokeThreshold&&(s(t,"CoPIFF"),s(t,"CoPCFP"))}function d(t){if(t){t=n.normalizeUrl(t,15);for(let n=1;n<t.length-1;++n)if(ni.includes(t[n]))return!0}return!1}function vi(t,i,r){let u,f;return r||(r=0),y(t,i,n=>v(n),(n,t)=>{u=n,f=t}),u&&(n.config&&n.config.doNotRemoveSpaceAfterIn&&u.toLocaleLowerCase().endsWith(" in ")||(u=u.trim()),f=Math.min(f,u.length)),{originalQuery:t,originalCursorPosition:i,queryToFetch:u,cursorPosition:f,enabledDataSources:{},equals:n=>(u?u.toLowerCase():u)==(n.queryToFetch?n.queryToFetch.toLowerCase():n.queryToFetch)&&r==n.topHitRestriction,isMultiWord:d(u),getCacheKey:()=>u,topHitRestriction:r}}function g(i,r){return r&&!r.enabledDataSources[i]?!1:t(n.config.enabledDataSources,i)}function nt(i,r,u,f){let e=f.enabledDataSources[i];return e?e.suggestionIsEnabled&&!e.suggestionIsEnabled(r,u)?!1:t(n.config.enabledDataSources,i):!1}function t(n,t){return n.indexOf(t)!=-1}function yi(n,t){let i=n.indexOf(t);return i!=-1?(n.splice(i,1),!0):!1}function pi(n,t){let i=n.findIndex(t);return i!=-1?n.splice(i,1)[0]:null}function wi(n,t,i){if(t<100)for(let r=n.length-1;n.length>t&&r>=0;--r)i(n[r])&&n.splice(r,1)}function bi(n,i){return n.filter(n=>!t(i,n))}function ki(n,t){if(n.length!=t.length)return!1;for(let i=0;i<n.length;++i)if(n[i]!=t[i])return!1;return!0}function di(n,t){if(n===t)return!0;if(!n||!t||Object.keys(n).length!=Object.keys(t).length)return!1;for(let i in n)if(n[i]!=t[i])return!1;return!0}function tt(){return n.getCurrentDate().getTime()}function it(){return n.getCurrentDate().getHours()}function gi(){if(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.dsbMockCurrentSec)return n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.dsbMockCurrentSec;let t=n.getCurrentDate();return t.getHours()*3600+t.getMinutes()*60+t.getSeconds()}function nr(){const n=it();return n<5||n>=19?3:n>=11?2:1}function e(n){let t=Math.abs(Math.floor(n));return(t<10?"0":"")+t}function tr(){let t=n.getCurrentDate(),i=-t.getTimezoneOffset(),r=i>=0?"+":"-";return t.getFullYear()+"-"+e(t.getMonth()+1)+"-"+e(t.getDate())+"T"+e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())+"."+e(t.getMilliseconds())+r+e(i/60)+":"+e(i%60)}function ir(n,t){return n?n.replace(gt,(n,i)=>t[i]):n}function rr(n){let t=n?n.number:null,i=n?n.name:null;return t==-2147023673||i=="Canceled"}function r(t,i,r,u,f,e){try{return t()}catch(o){return e||n.LogWSBError(i,u,o,undefined,undefined,"WindowsTelemetry"),f&&f(o),r}}function h(n,t,i,u,f,e){return sb_st(()=>r(n,i,null,u,f,e),t)}function ur(n,...t){r(()=>sj_evt.fire(n,...t),n)}function fr(n,t){h(t,1,n)}function c(n,t){let i=[],r=!0,u=(...n)=>{r?i.push(n):t.apply(null,n)};n(u);r=!1;i.forEach(n=>t.apply(null,n))}function er(t,i,r){u=t&&vt()!="ms-appx-web:"&&yt()!="searchapp.bundleassets.example";n.config.enableOfflineWithWeb&&n.config.webHost&&a()&&(u=t);rt=u&&p(i,r);ut=u&&oi(i,r);ft=u&&si(i,r);l=u&&hi(i,r);et=u&&ci(i,r);ot=u&&ei(i)}function or(){const t=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();return(n.Host===null||n.Host===void 0?void 0:n.Host.isFirstPartySearchDisabled())&&t!=1?!1:u}function sr(){return rt}function hr(){return ut}function st(){return ft}function cr(){return l}function ht(){return et}function lr(){const t=n.AccessTokenManager.getWindowsAccountType();return!!n.config.isCodexEligible&&ot&&!n.config.wsbWithCopilotQF&&!n.isThirdPartySearchAllowed()&&(t==2&&n.Host.getIsCodexUser()||t==3||n.isMsbInternalTenant()&&n.config.msbEnableCodexBtnUpperRightMs)}function pr(n){return t(ar,n)}function wr(n){return t(at,n)}function br(n){return t(vr,n)}function kr(n){return n==37}function dr(n){return t(ct,n)}function gr(n){return t(lt,n)}function nu(n){return t(yr,n)}function tu(n,t){return n==121&&t||n==93}function iu(n,t){return n==8||n==46||n==88&&t.ctrlKey}function vt(){return _w.location.protocol}function yt(){return _w.location.host}function ru(){return _w.location.pathname}function uu(){let n=_d.activeElement;return!n||n.id.endsWith("sb_form_q")?_d.body:n}function pt(t){return t&&+t!=n.WindowsApiDefaultDate&&t.getTime&&!isNaN(t.getTime())&&t.getFullYear()!=1600}function wt(t){if(!pt(t))return null;let i=t.getTime(),r=tt();return Math.abs(r-i)/n.DayToMs}function fu(n){let t=wt(n);return t!==null&&t>14}function eu(n){return n==="i"?13:n==="v"?14:0}function ou(){const t=n.Host.getIFFPolarisProviderEnabled()||n.Host.getVegaProviderEnabled(),i=(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(56039577))||(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(56154553))||(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(56384656)),r=n.config.updateSemanticSearchTelemetry;return t&&r&&i}function hu(n){return encodeURIComponent(n).replace(/[!'()*]/g,escape).replace(/%20/g,"+")}const o=String.fromCharCode(57346),kt=new RegExp("^\\s*("+o+")?\\s*"),dt=new RegExp("\\s*("+o+")?\\s+","g"),gt=/{([0-9]+)}/g,ni=" -_/\\";n.DayToMs=864e5;n.HourToMs=36e5;n.MinuteToMs=6e4;n.DebugSourceName="WindowsSearchBox";SharedLogHelper.RegisterErrorFilter(t=>{let i=t?t.number:null,r=t?t.name:null;return i===-2147023673||i===-2147215328||i===-2147215865&&(n.AnaheimDataProvider===null||n.AnaheimDataProvider===void 0?void 0:n.AnaheimDataProvider.getRetryCount())>0||r==="Canceled"});n.isHighContrastEnabled=ti;n.isBrowserOnline=a;n.cleanQuery=v;n.cleanGuid=ii;n.isEmpty=ri;n.canIconFail=ui;n.mantainCursorPositionIn=y;n.getInputType=fi;n.disableDataSources=s;let w="",b="",k="";n.disableWebDataSourceIfNeeded=li;n.disableCoPiffDataSourcesOnConditions=ai;n.isMultiWord=d;n.baseParseQuery=vi;n.isDataSourceEnabled=g;n.isSuggestionTypeEnabled=nt;n.contains=t;n.tryRemove=yi;n.removeFirstWhere=pi;n.trimList=wi;n.except=bi;n.sequenceEqual=ki;n.objEquals=di;n.log=()=>{};n.getCurrentDate=()=>new Date;n.getCurrentTime=tt;n.getCurrentHour=it;n.getCurrentTimeInSeconds=gi;n.getCopilotTimeOfDay=nr;n.getDateWithTimezone=tr;n.fetchWrapper=(n,t,i)=>i();n.formatString=ir;n.isCancellation=rr;n.safeExecute=r;n.safeSetTimeout=h;n.safeFireEvent=ur;n.invokeAsynchronously=fr;n.ensureCallbackIsAsync=c;let u=!0,rt=!0,ut=!0,ft=!0,l=!0,et=!0,ot=!0;n.refreshBingEnabledCache=er;n.isBingEnabled=or;n.isWebProviderEnabled=sr;n.isMiniSerpEnabled=hr;n.isTrendingSearchEnabled=st;n.isDSBV2EnabledMarket=cr;n.isThumbnailForTSEnabled=ht;n.isCodexEligible=lr;const ar=[3,16,17,18,19,20,144,145,],ct=[38,203,211,],vr=[39,37],lt=[40,204,212,],at=ct.concat(lt),yr=at.concat(37,39,36,35);n.isFunctionalKey=pr;n.isUpOrDownKey=wr;n.isLeftOrRightKey=br;n.isLeftKey=kr;n.isUpKey=dr;n.isDownKey=gr;n.isMovingCursorKey=nu;n.isContextMenuKey=tu;n.isDeletionKey=iu;n.getWindowProtocol=vt;n.getWindowHost=yt;n.getWindowPath=ru;n.getCurrentActiveElement=uu;n.WindowsApiDefaultDate=-116444736e5;n.isValidDate=pt;n.getTimeDiffInDays=wt;n.olderThan2Weeks=fu;n.verticalToHandoffType=eu;n.isSemanticSearchTelemetryEnabled=ou;class bt{constructor(){this._cancellations={};this._lastId=0}register(n,t,i){let r=++this._lastId;return this._cancellations[r]={action:n,skipOnDismissAndLaunch:t,where:i},r}unregister(n){delete this._cancellations[n]}cancelAll(n){for(let t in this._cancellations){let i=this._cancellations[t];i.skipOnDismissAndLaunch&&n||r(()=>i.action(),i.where)}this._cancellations={}}}n.CancellationManager=bt;class i{static logError(t,r){var u,f,e,o;if(i.errorCount=i.errorCount+1,n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.lightweightStorageFail){if(i.testHookErrorLogged)return;i.testHookErrorLogged=!0}if((n.LogWSBError("localStorage",t,new Error(r),undefined,undefined,"WindowsTelemetry"),!(i.errorCount>=5))&&(n.logToMC("Bing_QF_LocalStorage",r,"logError",{Msg:(t===null||t===void 0?void 0:t.message)?t.message:"",Stack:(t===null||t===void 0?void 0:t.stack)?t.stack:""}),n.config.enableLocalStorageFailureReport)){let h=typeof sj_cook!="undefined"?sj_cook===null||sj_cook===void 0?void 0:sj_cook.get("MUID","MUID"):(f=(u=_G===null||_G===void 0?void 0:_G.CID)!==null&&u!==void 0?u:_G===null||_G===void 0?void 0:_G.nclid)!==null&&f!==void 0?f:"";const s=n.InstrumentationHelper===null||n.InstrumentationHelper===void 0?void 0:n.InstrumentationHelper.createCleanGuid();if(!h||!s)return;try{if((n.config===null||n.config===void 0?void 0:n.config.disableWSBServerTelemetry)&&(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(40979072))&&((o=(e=SearchAppWrapper===null||SearchAppWrapper===void 0?void 0:SearchAppWrapper.CortanaApp)===null||e===void 0?void 0:e.regionalPolicies)===null||o===void 0?void 0:o.isThirdPartyWebSearchSupported))return}catch(it){}const i=(new Date).getTime(),l={T:"CI.Error",TS:i,Name:"JSError",Text:"[localStorage]"+r,Stack:(t===null||t===void 0?void 0:t.stack)?t.stack:"[localStorage]"+r},c=window.location,a=n.InstrumentationHelper===null||n.InstrumentationHelper===void 0?void 0:n.InstrumentationHelper.createCleanGuid(),v=c.protocol+"//"+c.host+"/QF_KEYSTROKE_VIRTUAL_URL?cvid="+a,y=typeof _G=="object"?_G:{},p=navigator.userAgent,w={CurUrl:window.location.href,Pivot:"QF",IsNonSuggestion:!0,EnrichedClientInfo:{FDPartnerEntry:"autosuggest",ImpressionUrl:v,qfMode:n.RuntimeConfig?`${n.RuntimeConfig.QfMode}`:undefined,DC:y.DA||undefined,isWebView2:p.includes("IsWebView2/True")?1:undefined},TS:i,UTS:i,UxClassification:{client:"windows"}},b=`<CID>${h}</CID>`,k=`<DS><![CDATA[[{"T":"D.Aggregator","Service":"AutoSuggest","Scenario":"Aggregator","AppNS":"SmartSearch","DS":[]}]]]></DS>`,d=`<E><T>Event.ClientInst</T><IG>${s}</IG><D><![CDATA[${JSON.stringify(l)}]]></D><TS>${i}</TS></E>`,g=`<Ovr><requestInfo key="RawQuery" value=""/><requestInfo key="IsQuery" value="false"/><requestInfo key="Form" value=""/><userInfo key="AppName" value="SmartSearch"/></Ovr>`,nt=`<M><IG>${s}</IG>${k}<D><![CDATA[${JSON.stringify(w)}]]></D><Page><Name>Page.SmartSearch.AS.Suggestions</Name>${"<L><![CDATA[[]]\]><\/L>"}</Page><TS>${i}</TS>${g}</M>`,tt=`<ClientInstRequest>${b}<Group>${nt}</Group><Events>${d}</Events></ClientInstRequest>`;fetch("/threshold/xls.aspx",{body:tt,method:"POST",headers:{"Content-Type":"text/xml"}})}}static getItem(t){var r;try{if(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.lightweightStorageFail)throw new Error("TestHook: lightweightStorageFail");return((r=_w.localStorage)===null||r===void 0?void 0:r.getItem(t))||null}catch(u){return i.logError(u,"getItem"),null}}static setItem(t,r){var u;try{if(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.lightweightStorageFail)throw new Error("TestHook: lightweightStorageFail");(u=_w.localStorage)===null||u===void 0?void 0:u.setItem(t,r)}catch(f){i.logError(f,"setItem")}}static removeItem(t){var r;try{if(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.lightweightStorageFail)throw new Error("TestHook: lightweightStorageFail");return(r=_w.localStorage)===null||r===void 0?void 0:r.removeItem(t)}catch(u){i.logError(u,"removeItem")}}static removeItemsWithKeyPrefix(t){try{if(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.lightweightStorageFail)throw new Error("TestHook: lightweightStorageFail");if(!_w.localStorage)return;const i=[];for(let n=0;n<_w.localStorage.length;n++){const r=_w.localStorage.key(n);(r===null||r===void 0?void 0:r.startsWith(t))&&i.push(r)}for(let n=0;n<i.length;n++)_w.localStorage.removeItem(i[n])}catch(r){i.logError(r,"removeItemsWithKeyPrefix")}}static clear(){var t;try{if(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.lightweightStorageFail)throw new Error("TestHook: lightweightStorageFail");return(t=_w.localStorage)===null||t===void 0?void 0:t.clear()}catch(r){i.logError(r,"clear")}}static getLength(){var t;try{if(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.lightweightStorageFail)throw new Error("TestHook: lightweightStorageFail");return((t=_w.localStorage)===null||t===void 0?void 0:t.length)||0}catch(r){return i.logError(r,"length"),0}}static key(t){var r;try{if(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.lightweightStorageFail)throw new Error("TestHook: lightweightStorageFail");return((r=_w.localStorage)===null||r===void 0?void 0:r.key(t))||null}catch(u){return i.logError(u,"key"),null}}}i.errorCount=0;n.LightweightStorage=i;class f{static resetSequenceNumber(){this._sequenceNumber=0}static getSequenceNumber(){return this._sequenceNumber}static incrementSequenceNumber(){this._sequenceNumber++}}f._sequenceNumber=0;n.SequenceNumberManager=f;class su{constructor(t,i,r,u,f){this._suggestionsParsers=t;this._rootViewModel=i;this._suggestionsRenderingManager=r;this._webProviders=u;this._otherProviders=f;this._cancellationManager=new bt;n.Host.bindShown(()=>{this._lastQuery=null,this._currentQuery=null,this._isPaneDismissed=!1});n.Host.bindDismissed(()=>{this.clearFetchTimer(),this.finishPreviousQuery(!0),this.finalizeKeystroke(!0),this._isPaneDismissed=!0,n.config&&n.config.dismissForceFlush&&Log2&&Log2.ForceFlush(),this._rootViewModel.onDismiss()});n.Host.bindQueryChangedOrInitialized((t,i)=>this.onQueryChanged(t,n.config.d,i),undefined,n.config.enableCoreQueryChangeFirst);n.Host.bindOnSubmit((n,t,i)=>this.onSubmit(n,t,i));n.Host.initializeEvents();sj_be(_d.body,"dragstart",t=>{if(!n.isSearchDragAndDropEnabled()){t.preventDefault();t.stopPropagation();return}});sj_b.addEventListener("click",n=>{n.shiftKey&&sj_pd(n)})}clearFetchTimer(){this._fetchTimer&&(sb_ct(this._fetchTimer),this._fetchTimer=null)}finishPreviousQuery(n){this.cancelPreviousQuery(n);this._suggestionsRenderingManager.resetTimers()}finalizeKeystroke(t){let i=f.getSequenceNumber();i>0&&n.InstrumentationHelper.finalizeKeystrokeLog(i);t||f.incrementSequenceNumber()}onQueryChanged(t,i,u){if(this._currentQuery=t,!u&&this._lastQuery&&this._lastQuery.equals(this._currentQuery))this._rootViewModel.onQueryChanged(this._currentQuery,f.getSequenceNumber());else this.clearFetchTimer(),this._completedDataSources={},(this._lastQuery||u)&&this.cancelPreviousQuery(!1),n.config.optimizeGetQueryLogic&&n.Host.getQuery(!0),this.logQueryChange(u,!1),i<=0||this._currentQuery.isSearchHomeZI||this._currentQuery.isThirdPartyZI?(this.fetchForQueryChange(u),r(()=>this.logVariantEventSearchHome(),"logVariantEventSearchHome",null,null,null,!0)):this._fetchTimer=h(()=>{this._fetchTimer=null,this.fetchForQueryChange(u)},i,"fetchTimer"),this._lastQuery=this._currentQuery}logQueryChange(t,i){let r=t?this._currentQuery:n.Host.getQuery();if(r.equals(this._currentQuery)){(this._lastQuery||t)&&this.finishPreviousQuery(i);this.finalizeKeystroke(!1);let r=f.getSequenceNumber();n.InstrumentationHelper.instrumentQueryChangedRequest(r,this._currentQuery)}}onSubmit(t,i,r){this._fetchTimer&&(this._currentQuery||(this._currentQuery=n.Host.getQuery(!0)),this.logQueryChange(!1,!0),this.fetchForQueryChange(!1));this._rootViewModel.submit(t,i,f.getSequenceNumber(),r,this._isPaneDismissed)}cancelPreviousQuery(n){this._cancellationManager&&this._cancellationManager.cancelAll(n)}fetchForQueryChange(t){this.clearFetchTimer();let i=t?this._currentQuery:n.Host.getQuery();if(i.equals(this._currentQuery)){let t=f.getSequenceNumber(),r=!n.config.enabledDataSources.some(n=>g(n,this._currentQuery));if(r)this._rootViewModel.onQueryChanged(this._currentQuery,t);let u=!1;if(this._suggestionsRenderingManager.initiateSequenceNumber(t,this._currentQuery,()=>u=!0),!r){let r=()=>!this._isPaneDismissed&&(n.config.d>0?i.equals(this._currentQuery):t==f.getSequenceNumber())&&!u,e=(new Date).getTime(),o=(n,u,f,o,s,h)=>this.onResponseReceived(i,t,n,u,f,r,o,s,e,h),s=u=>{n.InstrumentationHelper.instrumentFetchesBegin(t);n.config.enabledDataSources.forEach(t=>{n!==undefined&&n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().beginMark(t+".Fetch")});n.fetchWrapper(i,r,()=>{if(!n.isSupportWebResultsInAllScopeInDMAEnabled()&&n.isThirdPartySearchAllowed()&&i.scope==n.Scope.ThirdPartyWeb){this.fetchTPWeb(i,t,u,r);return}this._webProviders.forEach(n=>{this.fetchWeb(i,n,t,u,r)});this._otherProviders.forEach(n=>{this.fetch(i,n,t,u,r)})});n.InstrumentationHelper.instrumentFetchesEnd(t);this._rootViewModel.onQueryChanged(this._currentQuery,t)};c(s,o)}}}fetchTPWeb(t,i,u,f){var e;if(n.isThirdPartySearchAllowed()&&((e=t.thirdPartySearch)===null||e===void 0?void 0:e.applicationUserModelId)){let o=n.Host.initUrlParameters(),e=n.Host.getThirdPartyDataProviderById(t.thirdPartySearch.applicationUserModelId);r(()=>e.fetch(t,u,i,this._cancellationManager,f,o),"fetch "+e.getName())}}fetchWeb(t,i,u,f,e){const s=n.Service.QueryParams;let o=n.Host.getCustomUrlParameters(t);n.Host.shouldRequestEltoken()&&(o[s.RequestElToken]="1");(!n.RuntimeConfiguration.DeviceHistoryEnabled||n.isThirdPartySearchAllowed()||n.config.isDMARegion)&&(o[s.SearchHistorySettingOff]="1");o[s.CursorPosition]=t.cursorPosition.toString();o[s.ConversationId]=n.Host.getConversationId();o[s.ImpressionGuid]=n.InstrumentationHelper.getImpressionGuid(u);let h=n.Host.getCustomHeaders(t);r(()=>i.fetch(t,f,u,this._cancellationManager,e,o,h),"fetch "+i.getName())}fetch(n,t,i,u,f){r(()=>t.fetch(n,u,i,this._cancellationManager,f),"fetch "+t.getName())}onResponseReceived(t,i,r,u,f,e,o,s,h,l){if(e()){if(this._completedDataSources[r]){n.config.forceUseNifQF&&r=="Web"||n.LogWSBError("onResponseReceived",r,new Error(`Data source already completed: ${r}`),undefined,undefined,"WindowsTelemetry");return}n!==undefined&&n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark(r+".Fetch");this._completedDataSources[r]=!l;n.InstrumentationHelper.instrumentResponseReceived(i,r,f,o,s,l);let h=(r,u,o)=>{if(n.InstrumentationHelper.instrumentDataSourceParsed(i,r),n.TweakDiagnostics===null||n.TweakDiagnostics===void 0?void 0:n.TweakDiagnostics.pushDiagnostics("onDataSourceParsed",[r,u]),e()){if(!n.isSupportWebResultsInAllScopeInDMAEnabled()&&n.isThirdPartySearchAllowed()&&t.scope==n.Scope.ThirdPartyWeb){this.onTPSuggestionsParsed(i,r,u);return}this.onSuggestionsParsed(t,i,r,f,u,o,l)}},a=f=>{let o=this._suggestionsParsers[r];o?o.parse(t,i,r,u,e,f,this._cancellationManager):(n.LogWSBError("onResponseReceived",r,new Error("No parser for data source"),undefined,undefined,"WindowsTelemetry"),f(r,[],null))};c(a,h)}}onTPSuggestionsParsed(t,i,u){r(()=>this._rootViewModel.update(!0,u.slice(0,1),!1,t,u.slice(1),[],[i],[{type:n.GroupType.SearchSuggestions}],!0,{}),"rootViewModel.update",0,null,t=>{n&&n.fallbackToPrepopulatedBundle&&n.fallbackToPrepopulatedBundle(t)})}onSuggestionsParsed(t,i,r,u,f,e,o){if(f=f.filter(n=>nt(r,n.type,n.handoffType,t)),n.InstrumentationHelper.instrumentDataSource(i,r,f,e),n.isWebXTFlightsTelemetry()){let o=e===null||e===void 0?void 0:e.responseHeader;if(o&&o.hasOwnProperty("X-FlightsTelemetry-Flight")){let t=o["X-FlightsTelemetry-Flight"];n.InstrumentationHelper.instrumentFlightAssignment(i,t)}this._rootViewModel.onSuggestionsParsed(t,i,r,u,f)}else this._rootViewModel.onSuggestionsParsed(t,i,r,u,f,e);this._suggestionsRenderingManager.queueSuggestions(i,r,f,e,o)}logVariantEventSearchHome(){const t=n.AccessTokenManager.getWindowsAccountType();if(this._currentQuery.isSearchHomeZI&&this._currentQuery.scope==n.Scope.All||this._currentQuery.isWorkScopeZI&&_w.bfbWsbTel&&(t===1||t===4)&&n.isMsbEnterprise()&&!(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.isGccHighTenant())){let t=n.shouldShowDSBLayout(this._currentQuery);bfbWsbTel.logVariantEvent(t)}}}n.Core=su;n.encodeQueryParameter=hu}(WSB||(WSB={})),function(n){function si(t){return n.contains(d,t)}function rt(t){return n.contains(g,t)}function hi(t){return n.contains(fi,t)}function ci(t){return n.contains(tt,t)}function v(t){return n.contains(it,t)}function f(t){return n.contains(ni,t)}function e(t){return n.contains(ti,t)}function li(n){return n==="CopSugg"}function y(t){return n.contains(ii,t)}function ai(t){return n.contains(ri,t)}function vi(t){return n.contains(ei,t)}function yi(t){return n.contains(ui,t)}function pi(n,t){return n===t||f(n)&&f(t)||v(n)&&v(t)}function wi(t){return n.contains(gt,t)}function bi(t){return n.contains(nt,t)}function ut(t){let i=t===null||t===void 0?void 0:t.extensionLC;return!!i&&n.contains([".png",".jpeg",".jpg",".svg",".text",".txt",".pdf",".docx",".json",".csv",".xlsx",".pptx",".md",],i)}function ki(n){return ut(n)||rt(n===null||n===void 0?void 0:n.type)||f(n===null||n===void 0?void 0:n.type)}function di(t){return t&&n.contains([".pptx",],t)}function gi(t){return!!t&&n.contains([".xlsx",],t)}function ft(){return n.isDataSourceEnabled("SSUE",null)}function et(t){var r=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();let i=!n.config.userProfileButtonEnabled||r==t;switch(t){case 2:return i&&n.isSubstrateOutlookAccountConnected;case 1:return i&&n.isSubstrateO365AccountConnected;case 4:return i&&n.isSubstrateO365AccountConnected&&n.isSubstrateOutlookAccountConnected;default:return!1}}function nr(t){let i=SearchAppWrapper.CortanaApp.authenticationManager.getAllSearchWebAccountsAsync;var r=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();return i?!0:r==t}function tr(){return{dataSource:"ANA",groupType:t.SearchSuggestions,requirements:[1],conditionalRequirements:t=>n.isAnaheimDataEnabled(!1,t),suggestionIsEnabled:t=>t=="ANAH"||t=="ANAR"||t=="ANAF"||t=="ANAT"||n.config.topHitMuse&&t=="ANATH"}}function r(n,t,i,r){return h(n,undefined,t,i,r)}function h(t,i,r,u,f){return{dataSource:t,groupType:i,requirements:[1],conditionalRequirements:t=>(r==1?n.isCloudSearchEnabledAadCache:n.isCloudSearchEnabledMsaCache)&&(!f||f(t))&&(u||t&&t.queryToFetch&&t.queryToFetch.length>=n.config.minLengthFor3SonL1)&&nr(r)&&et(r)}}function ir(){return n.isDocSourceEnabledInQws("SREE")}function ot(){if(n.msbHost!==null&&n.msbHost!==void 0)return n.msbHost.qfUtils.isMsbQfInScriptsEarlyLoadState()}function l(t,r){return{dataSource:"MSBC",requirements:[1],conditionalRequirements:u=>{if(!n.msbHost||!n.isBingEnabled())return!1;const f=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType(),e=r===i.Documents&&n.msbHost.qfUtils.isMsbFileReady(),o=r===i.Web&&!n.msbHost.features.isWorkScopeApplicable(),s=!r||e||o;return n.isCloudSearchEnabledAadCache&&s&&(t||u&&u.queryToFetch&&u.queryToFetch.length>=oi)&&(f==1||f==4||n.config.msbMockToken||ot())&&(n.msbHost.isTenantMsbEnabled()||ot())&&!n.msbHost.isGccHighTenant()}}}function a(){var t=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();return!n.isCloudSearchEnabledAadCache&&!n.isCloudSearchEnabledMsaCache||t==3||t==0||!ft()?!1:!et(t)}function st(){return n.isDocSourceEnabledInQws("SSUE")}function ht(){var t=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();return t==2||t==4}function ct(t){return t.isSearchHomeZI&&(n.isDataSourceEnabled("SSUE",t)||n.isDataSourceEnabled("SREE",t))}function rr(n,t){return t.siteTitle&&n.isSearchHomeZI}function ur(){n.ScopeConfig[i.All].getEmptyZIMessages=()=>u(i.All,"EmptyAllMessage",n.isBingEnabled()?"EmptyAllSubMessage":"EmptyAllSubMessageNoWeb",at(!0));n.RuntimeConfig.SearchHomeAvailable==1?(n.ScopeConfig[i.All].icon=n.getSearchSuggestionIcon(),n.ScopeConfig[i.All].enabledDataSourcesForZeroInput=[{dataSource:"TOPP",groupType:t.TopApps,suggestionGroupToggler:c(t.TopApps),conditionalRequirements:t=>n.shouldShowZIDataSource(t)&&!n.canShowSearchHomeAIFeed(t)},{dataSource:"SMA",groupType:t.SmartActions,suggestionGroupToggler:c(t.SmartActions),conditionalRequirements:t=>n.canShowSearchHomeAIFeed(t)},{dataSource:"DFLS",groupType:t.CuratedSuggestions,suggestionGroupToggler:c(t.CuratedSuggestions),conditionalRequirements:t=>n.canShowCuratedSuggestions(t)},{dataSource:"CUSE",groupType:t.CuratedSettings,suggestionGroupToggler:c(t.CuratedSettings),conditionalRequirements:t=>n.canShowCuratedSettings(t)&&!n.canShowSearchHomeAIFeed(t)},{dataSource:"QSCH",groupType:t.QuickSearch,suggestionGroupToggler:c(t.QuickSearch),conditionalRequirements:t=>n.canShowQuickSearch(t)&&!n.canShowSearchHomeAIFeed(t)},{dataSource:"MSBC",groupType:t.QuickWorkSearch,conditionalRequirements:()=>n.canShowQuickWorkSearch()},{dataSource:"MRU",groupType:t.MRUHistory,conditionalRequirements:()=>n.enableMRUSearchHome()||n.config.enableMRUDSBV2&&n.shouldShowDSBFullWidth()},{dataSource:"MWS",groupType:t.MRUHistory,conditionalRequirements:t=>n.enableMRUSearchHome()&&n.canShowWorkSearchMru(t)},{dataSource:"MPP",groupType:t.MRUHistory,conditionalRequirements:()=>n.enableMRUSearchHome()},{dataSource:"MST",groupType:t.MRUHistory,conditionalRequirements:()=>n.enableMRUSearchHome()},{dataSource:"MFF",suggestionIsEnabled:()=>!0,groupType:t.MRUHistory,conditionalRequirements:()=>n.enableMRUSearchHome()},{dataSource:"MRS",groupType:t.MRUHistory,requirements:[1,2],conditionalRequirements:()=>n.enableMRUSearchHome()||n.config.enableMRUDSBV2&&n.shouldShowDSBFullWidth()},{dataSource:"ANA",groupType:t.AnaheimDataList,requirements:[1],conditionalRequirements:t=>n.config.enableWin11SSH?n.shouldShowStaticSearchHome(t)&&n.isAnaheimDataEnabled(!0,t):n.isAnaheimDataEnabled(!0,t),suggestionIsEnabled:n=>n=="QSSG"||n=="ANAT"||n=="ANAH"||n=="ANAR"},{dataSource:"TS",groupType:t.TrendingSearchData,conditionalRequirements:t=>n.isTrendingSearchDataEnabled(t)||n.isTrendingSearchDataInWin11LeftPaneEnabled(t),suggestionIsEnabled:n=>n=="TS"},{dataSource:"RWQ",groupType:t.MRUHistory,conditionalRequirements:t=>n.isRecentWorkSearchEnabled(t)},h("SSUE",t.RecommendedDocs,1,!0,()=>st()),h("SREE",t.RecommendedDocs,1,!0,()=>ir()),{dataSource:"Web",groupType:t.SearchSuggestions,requirements:[1,2],conditionalRequirements:()=>n.isASWebEnabledOnSearchHome()},{dataSource:"QWQS",groupType:t.MsbQuickWorkQueriesTopList,conditionalRequirements:t=>(t===null||t===void 0?void 0:t.isSearchHomeZI)&&t.scope===i.All&&n.msbHost&&n.msbHost.features.isQwsEnabled()&&n.msbHost.isEduTenant()&&n.config.msbDsbEnabled},{dataSource:"AIF",groupType:t.AIFeed,conditionalRequirements:t=>n.canShowSearchHomeAIFeed(t)},],n.canShowAnaheimWin11ZITopSites()?(n.shouldShowStaticSearchHome(n.Host.getQuery(!0))&&(n.ScopeConfig[i.All].staticGroupOrderForZeroInput=()=>[t.Upsell,n.config.wsbWithCopilot?null:t.MRUHistory,n.config.wsbWithCopilot?null:t.CuratedSuggestions,t.AnaheimDataTile,t.CuratedSettings,t.TopApps,t.AnaheimDataList,t.QuickWorkSearchTopList,t.MsbQuickWorkQueriesTopList,t.QuickWorkSearch,t.RecommendedDocs,t.MsbOnRampButton,t.SmartActions,t.AIFeed,t.TrendingSearchData,t.QuickSearch,t.PromoBanner,n.config.wsbWithCopilot?t.MRUHistory:null,n.config.wsbWithCopilot?t.CuratedSuggestions:null]),n.canShowWorkScopeZiPageContent(n.Host.getQuery(),!0)&&(n.ScopeConfig[i.Work].staticGroupOrderForZeroInput=()=>[n.config.wsbWithCopilot?null:t.MRUHistory,n.config.wsbWithCopilot?null:t.CuratedSuggestions,t.CuratedSettings,t.TopApps,t.QuickWorkSearchTopList,t.MsbQuickWorkQueriesTopList,t.QuickWorkSearch,t.RecommendedDocs,t.MsbOnRampButton,t.SmartActions,t.AIFeed,t.TrendingSearchData,t.QuickSearch,n.config.wsbWithCopilot?t.MRUHistory:null,n.config.wsbWithCopilot?t.CuratedSuggestions:null])):n.shouldShowStaticSearchHome(n.Host.getQuery(!0))?(n.ScopeConfig[i.All].staticGroupOrderForZeroInput=()=>[t.Upsell,n.config.wsbWithCopilot?null:t.MRUHistory,n.config.wsbWithCopilot?null:t.CuratedSuggestions,t.CuratedSettings,t.AnaheimDataTile,t.TopApps,t.AnaheimDataList,t.QuickWorkSearchTopList,t.MsbQuickWorkQueriesTopList,t.QuickWorkSearch,t.RecommendedDocs,t.MsbOnRampButton,t.SmartActions,t.AIFeed,t.TrendingSearchData,t.QuickSearch,t.PromoBanner,n.config.wsbWithCopilot?t.MRUHistory:null,n.config.wsbWithCopilot?t.CuratedSuggestions:null],n.canShowWorkScopeZiPageContent(n.Host.getQuery(),!0)&&(n.ScopeConfig[i.Work].staticGroupOrderForZeroInput=()=>[n.config.wsbWithCopilot?null:t.MRUHistory,n.config.wsbWithCopilot?null:t.CuratedSuggestions,t.CuratedSettings,t.TopApps,t.QuickWorkSearchTopList,t.MsbQuickWorkQueriesTopList,t.QuickWorkSearch,t.RecommendedDocs,t.MsbOnRampButton,t.SmartActions,t.AIFeed,t.TrendingSearchData,t.QuickSearch,n.config.wsbWithCopilot?t.MRUHistory:null,n.config.wsbWithCopilot?t.CuratedSuggestions:null])):n.shouldShowDSBLayout(n.Host.getQuery())?(n.ScopeConfig[i.All].staticGroupOrderForZeroInput=()=>[t.Upsell,n.config.wsbWithCopilot?null:t.MRUHistory,n.config.wsbWithCopilot?null:t.CuratedSuggestions,t.AnaheimDataTile,t.TopApps,t.AnaheimDataList,t.QuickWorkSearchTopList,t.MsbQuickWorkQueriesTopList,t.QuickWorkSearch,t.RecommendedDocs,t.MsbOnRampButton,t.SmartActions,t.AIFeed,t.TrendingSearchData,t.QuickSearch,t.PromoBanner,n.config.wsbWithCopilot?t.MRUHistory:null,n.config.wsbWithCopilot?t.CuratedSuggestions:null],n.canShowWorkScopeZiPageContent(n.Host.getQuery(),!0)&&(n.ScopeConfig[i.Work].staticGroupOrderForZeroInput=()=>[t.MRUHistory,t.CuratedSuggestions,t.QuickWorkSearchTopList,t.MsbQuickWorkQueriesTopList,t.QuickWorkSearch,t.RecommendedDocs,t.MsbOnRampButton,])):n.ScopeConfig[i.All].staticGroupOrderForZeroInput=n.shouldEnableAnaheimResetDefault()?()=>[t.Upsell,t.PromoBanner,t.AnaheimDataTile,t.TopApps,n.config.wsbWithCopilot?null:t.MRUHistory,t.AnaheimDataList,t.QuickWorkSearchTopList,t.MsbQuickWorkQueriesTopList,t.QuickWorkSearch,t.RecommendedDocs,t.MsbOnRampButton,t.SmartActions,t.AIFeed,t.TrendingSearchData,t.QuickSearch,t.VisualSearch,n.config.wsbWithCopilot?t.MRUHistory:null]:()=>[t.AnaheimDataTile,t.TopApps,n.config.wsbWithCopilot?null:t.MRUHistory,t.AnaheimDataList,t.QuickWorkSearchTopList,t.MsbQuickWorkQueriesTopList,t.QuickWorkSearch,t.RecommendedDocs,t.MsbOnRampButton,t.SmartActions,t.AIFeed,t.TrendingSearchData,t.QuickSearch,t.Upsell,t.PromoBanner,t.VisualSearch,n.config.wsbWithCopilot?t.MRUHistory:null]):n.ScopeConfig[i.All].enabledDataSourcesForZeroInput=[]}function lt(){n.ScopeConfig={};n.ScopeConfig[i.All_FileExplorer]={icon:null,prefixesLocString:null,enabledDataSources:[{dataSource:"FEH"},{dataSource:"IFF"},{dataSource:"MDOC",conditionalRequirements:()=>n.config.useL2ProvidersInFileExplorer},{dataSource:"MPHO",conditionalRequirements:()=>n.config.useL2ProvidersInFileExplorer},{dataSource:"MVID",conditionalRequirements:()=>n.config.useL2ProvidersInFileExplorer},{dataSource:"SSUE",requirements:[1,2],conditionalRequirements:()=>n.config.cloudSearchInFileExplorer&&(n.isFileExplorerCurrentPathThisPcOrQuickAccess||!!SearchAppWrapper.CortanaApp.fileExplorerSuggestionPage.currentSyncRootAccount)},{dataSource:"SSEE",requirements:[1,2],conditionalRequirements:()=>n.config.cloudSearchInFileExplorer&&(n.isFileExplorerCurrentPathThisPcOrQuickAccess||!!SearchAppWrapper.CortanaApp.fileExplorerSuggestionPage.currentSyncRootAccount)},],enabledDataSourcesForZeroInput:[{dataSource:"FEH"},],getEmptyZIMessages:null};n.ScopeConfig[i.All_SettingsApp]={icon:null,prefixesLocString:null,enabledDataSources:[{dataSource:"ST"},{dataSource:"MST"},{dataSource:"CoPST"},],enabledDataSourcesForZeroInput:[],getEmptyZIMessages:null};n.ScopeConfig[i.All_ControlPanel]={icon:{content:"",type:2},prefixesLocString:"ScopeSettings",enabledDataSources:[{dataSource:"Web",suggestionIsEnabled:()=>!1,requirements:[1,2]},{dataSource:"MRU",suggestionIsEnabled:()=>!1},{dataSource:"MST"},{dataSource:"ST"},{dataSource:"QS",requirements:[1,2]}],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:()=>!1},{dataSource:"MST"},],getEmptyZIMessages:null};n.ScopeConfig[i.All]={icon:{content:"",type:n.config.undocked?8:2,needsAccentColor:!0},prefixesLocString:"ScopeAll",enabledDataSources:[{dataSource:"PP"},{dataSource:"ST"},{dataSource:"FL",conditionalRequirements:t=>{var i;return!n.config.providerConditionAggressive||((i=t===null||t===void 0?void 0:t.queryToFetch)===null||i===void 0?void 0:i.length)>n.config.minQueryLengthForAllScopeProviders}},{dataSource:"LM",conditionalRequirements:t=>{var i;return!n.config.providerConditionAggressive||((i=t===null||t===void 0?void 0:t.queryToFetch)===null||i===void 0?void 0:i.length)>n.config.minQueryLengthForAllScopeProviders}},{dataSource:"IFF",conditionalRequirements:t=>{var i;return!n.config.providerConditionAggressive||((i=t===null||t===void 0?void 0:t.queryToFetch)===null||i===void 0?void 0:i.length)>n.config.minQueryLengthForAllScopeProviders+1}},{dataSource:"CG"},{dataSource:"MRU"},{dataSource:"MPP"},{dataSource:"MST"},{dataSource:"MFF",conditionalRequirements:t=>{var i;return!n.config.providerConditionAggressive||((i=t===null||t===void 0?void 0:t.queryToFetch)===null||i===void 0?void 0:i.length)>n.config.minQueryLengthForAllScopeProviders}},{dataSource:"MRS",groupType:t.MRUHistory,requirements:[1,2],conditionalRequirements:()=>n.config.enableMruProviderInQF&&(n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())===3},{dataSource:"Web",requirements:[1,2],conditionalRequirements:t=>{var i;return((i=t===null||t===void 0?void 0:t.queryToFetch)===null||i===void 0?void 0:i.length)>n.config.minQueryLengthForAllScopeProviders}},{dataSource:"TPWeb",groupType:t.DMAWeb,requirements:[1,3],conditionalRequirements:t=>{var i;return((i=t===null||t===void 0?void 0:t.queryToFetch)===null||i===void 0?void 0:i.length)>n.config.minQueryLengthForAllScopeProviders}},{dataSource:"OSTMA",requirements:[1,2],conditionalRequirements:t=>{var i;return((i=t===null||t===void 0?void 0:t.queryToFetch)===null||i===void 0?void 0:i.length)>n.config.minQueryLengthForAllScopeProviders+(n.config.providerConditionAggressive?1:0)}},{dataSource:"OSTMAN",requirements:[1,2],conditionalRequirements:t=>{var i;return((i=t===null||t===void 0?void 0:t.queryToFetch)===null||i===void 0?void 0:i.length)>n.config.minQueryLengthForAllScopeProviders+(n.config.providerConditionAggressive?1:0)}},{dataSource:"QS",requirements:[1,2],conditionalRequirements:t=>{var i;return((i=t===null||t===void 0?void 0:t.queryToFetch)===null||i===void 0?void 0:i.length)>n.config.minQueryLengthForAllScopeProviders+(n.config.providerConditionAggressive?1:0)}},{dataSource:"SAPP",conditionalRequirements:t=>{var i;return n.isStoreAppEnabled(t)&&((i=t===null||t===void 0?void 0:t.queryToFetch)===null||i===void 0?void 0:i.length)>n.config.minQueryLengthForAllScopeProviders}},{dataSource:"CoPIFF"},{dataSource:"CoPCFP"},{dataSource:"CoPST"},{dataSource:"SWMF",suggestionIsEnabled:n=>e(n),conditionalRequirements:()=>n.Host.getFindSharedFilesEnabled()&&(n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getAadAccountsCount())>0},{dataSource:"RSH",conditionalRequirements:t=>n.isRSHEnabled(t)},tr(),r("SSUE",1,!1,()=>!(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.qfUtils.is3sFileDisabled())),l(!1),],enabledDataSourcesForZeroInput:[],webSyntheticEnabled:t=>t.queryToFetch&&!n.isWebResultsDisabled(),getEmptyZIMessages:null,showUpsellOnSuggestionsList:n.config.accountVerificationInAllScope||n.config.msbAccountVerificationInSearchHome?()=>a():undefined};n.ScopeConfig[i.Apps]={icon:{content:n.config.useCobaltCSS?"":"",type:2},prefixesLocString:"ScopeApps",enabledDataSources:[{dataSource:"Web",suggestionIsEnabled:t=>t=="SPP"&&!n.config.isDMARegion,requirements:[1,2]},{dataSource:"MRU",suggestionIsEnabled:()=>!1},{dataSource:"MPP"},{dataSource:"PP",suggestionIsEnabled:n=>n=="PP"},{dataSource:"OSTMA",requirements:[1,2]},{dataSource:"OSTMAN",requirements:[1,2]},{dataSource:"IBA"},{dataSource:"SAPP",conditionalRequirements:t=>n.isStoreAppEnabled(t)},],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:()=>!1},{dataSource:"TOPP",conditionalRequirements:n=>n.isSearchHomeZI},{dataSource:"MPP"},n.contains(n.config.enabledDataSources,"LRA")?{dataSource:"LRA"}:{dataSource:"PP",suggestionIsEnabled:n=>n=="PP"}],staticGroupOrderForZeroInput:n=>n.isSearchHomeZI?[t.TopApps,t.Apps]:undefined,getEmptyZIMessages:()=>u(i.Apps,"EmptyAppsMessage","EmptyAppsSubMessage","EmptyScopeSearchLocation_PC")};n.ScopeConfig[i.Settings]={icon:{content:"",type:2},prefixesLocString:"ScopeSettings",enabledDataSources:[{dataSource:"Web",suggestionIsEnabled:()=>!1,requirements:[1,2]},{dataSource:"MRU",suggestionIsEnabled:()=>!1},{dataSource:"MST"},{dataSource:"ST"},{dataSource:"QS",requirements:[1,2]},{dataSource:"CoPST"},],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:()=>!1},{dataSource:"MST"},],getEmptyZIMessages:()=>s(i.Settings,!1)};n.ScopeConfig[i.Photos]={icon:{content:"",type:2},prefixesLocString:"ScopePhotos",enabledDataSources:[{dataSource:"MRU",suggestionIsEnabled:()=>!1},{dataSource:"MFF",suggestionIsEnabled:n=>f(n)},{dataSource:"MPHO",suggestionIsEnabled:n=>n=="LI"},{dataSource:"CoPIFF",suggestionIsEnabled:()=>f("LI")},{dataSource:"CoPCFP",suggestionIsEnabled:()=>f("LI")},],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:()=>!1},{dataSource:"MFF",suggestionIsEnabled:n=>f(n)},],getEmptyZIMessages:()=>s(i.Photos,!0)};n.ScopeConfig[i.Videos]={icon:{content:"",type:1},prefixesLocString:"ScopeVideos",enabledDataSources:[{dataSource:"MRU",suggestionIsEnabled:()=>!1},{dataSource:"MFF",suggestionIsEnabled:n=>n=="LV"},{dataSource:"MVID",suggestionIsEnabled:n=>n=="LV"},],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:()=>!1},{dataSource:"MFF",suggestionIsEnabled:n=>n=="LV"},],getEmptyZIMessages:()=>s(i.Videos,!0)};n.ScopeConfig[i.Music]={icon:{content:n.config.useCobaltCSS?"":"",type:2},prefixesLocString:"ScopeMusic",enabledDataSources:[{dataSource:"MRU",suggestionIsEnabled:()=>!1},{dataSource:"MFF",suggestionIsEnabled:n=>n=="MU"},{dataSource:"MMUS",suggestionIsEnabled:n=>n=="MU"},],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:()=>!1},{dataSource:"MFF",suggestionIsEnabled:n=>n=="MU"},],getEmptyZIMessages:()=>s(i.Music,!1)};n.ScopeConfig[i.Documents]={icon:{content:n.config.useCobaltCSS?"":"",type:2},prefixesLocString:"ScopeDocuments",enabledDataSources:[{dataSource:"MRU",suggestionIsEnabled:()=>!1},{dataSource:"MFF",suggestionIsEnabled:n=>e(n)},{dataSource:"MDOC",suggestionIsEnabled:n=>n=="FL"},{dataSource:"CoPIFF",suggestionIsEnabled:n=>e(n)},{dataSource:"CoPCFP",suggestionIsEnabled:n=>e(n)},{dataSource:"MPHO",suggestionIsEnabled:n=>n=="FL",conditionalRequirements:n=>!n||!n.taskFrame},{dataSource:"MVID",suggestionIsEnabled:n=>n=="FL",conditionalRequirements:n=>!n||!n.taskFrame},{dataSource:"MPVD",suggestionIsEnabled:n=>n=="FL",conditionalRequirements:t=>n.config.mergeQueries&&(!t||!t.taskFrame)},{dataSource:"PP",suggestionIsEnabled:n=>n=="LDOC"},{dataSource:"SWMF",suggestionIsEnabled:n=>e(n),conditionalRequirements:()=>n.Host.getFindSharedFilesEnabled()&&(n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getAadAccountsCount())>0},r("SSUE",1,!0,()=>!(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.qfUtils.is3sFileDisabled())),r("SSEE",1,!0,()=>!(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.qfUtils.is3sFileDisabled())),l(!0,i.Documents)],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:()=>!1},{dataSource:"MFF",suggestionIsEnabled:n=>e(n)},{dataSource:"IFF",suggestionIsEnabled:n=>e(n),conditionalRequirements:()=>n.config.enableZeroInputSearchHomeDocuments},h("SSUE",t.RecommendedDocs,1,!0,()=>sr()),h("SREE",t.RecommendedDocs,1,!0,()=>!1),],showUpsellOnSuggestionsList:()=>a(),getEmptyZIMessages:()=>s(i.Documents,!1)};n.ScopeConfig[i.Folders]={icon:{content:"",type:2},prefixesLocString:"ScopeFolders",enabledDataSources:[{dataSource:"MRU",suggestionIsEnabled:()=>!1},{dataSource:"MFF",suggestionIsEnabled:n=>n=="FD"},{dataSource:"MFOL",suggestionIsEnabled:n=>n=="FD"},{dataSource:"CoPIFF",suggestionIsEnabled:()=>y("FD")},{dataSource:"CoPCFP",suggestionIsEnabled:()=>y("FD")},],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:()=>!1},{dataSource:"MFF",suggestionIsEnabled:n=>n=="FD"},],getEmptyZIMessages:()=>s(i.Folders,!1)};n.ScopeConfig[i.Web]={icon:n.config.useCobaltCSS?{content:"",type:2}:{content:"",type:1},prefixesLocString:"ScopeWeb",enabledDataSources:[{dataSource:"MRU",suggestionIsEnabled:(t,i)=>i==1||n.config.enableMruProviderInQF&&i==0&&(n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())===3},{dataSource:"MRS",suggestionIsEnabled:(n,t)=>t==0,conditionalRequirements:()=>n.config.enableZeroInputSearchHomeWeb||n.config.enableMruProviderInQF&&(n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())===3},{dataSource:"Web",suggestionIsEnabled:(t,i)=>n.contains([0,13,14,10,5,1],i),requirements:[1,2]},{dataSource:"PP",suggestionIsEnabled:(n,t)=>t==1},{dataSource:"ANA",suggestionIsEnabled:(n,t)=>t==1&&(n=="ANAH"||n=="ANAR"||n=="ANATH"),requirements:[1,2],conditionalRequirements:()=>n.config.topHitMuse},l(!0,i.Web),],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:(n,t)=>t==1},{dataSource:"MRS",suggestionIsEnabled:(n,t)=>t==0,conditionalRequirements:()=>n.config.enableZeroInputSearchHomeWeb||n.config.enableZIWebScopeMruDsb&&(n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())!==1},{dataSource:"Web",requirements:[1,2],conditionalRequirements:()=>ht()},],webSyntheticEnabled:t=>t.queryToFetch&&n.isBingEnabled(),getEmptyZIMessages:()=>u(i.Web,"EmptyWebMessage","EmptyWebSubMessage")};n.ScopeConfig[i.PathCompletion]={icon:{content:"",type:n.config.undocked?8:2,needsAccentColor:!0},scopeNameLocString:n.config.pathCompletionReplacesAll?"PathCompletionScopeName":null,prefixesLocString:null,enabledDataSources:[{dataSource:"PT"},{dataSource:"CG"},],enabledDataSourcesForZeroInput:[],getEmptyZIMessages:null};n.ScopeConfig[i.Emails]={icon:{content:"",type:2},prefixesLocString:"ScopeEmails",enabledDataSources:[r("SSEE",1,!0),r("SSEC",2,!0),],enabledDataSourcesForZeroInput:[],showUpsellOnSuggestionsList:()=>a(),getEmptyZIMessages:()=>s(i.Emails,!1)};n.ScopeConfig[i.People]={icon:{content:"",type:2},prefixesLocString:"ScopePeople",enabledDataSources:[r("SSUE",1,!0,()=>!(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.isTenantMsbEnabled())),r("SSUC",2,!0),l(!0),],enabledDataSourcesForZeroInput:[r("SSUE",1,!0,()=>hr()),r("SSUC",2,!0),],showUpsellOnSuggestionsList:()=>a(),getEmptyZIMessages:()=>s(i.People,!1)};n.ScopeConfig[i.Work]={icon:{content:"",type:2},prefixesLocString:"ScopeWork",enabledDataSources:[r("SSUE",1,!0,()=>!(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.isTenantMsbEnabled())),r("SSUC",2,!0),l(!0),],enabledDataSourcesForZeroInput:[{dataSource:"DFLS",groupType:t.CuratedSuggestions,suggestionGroupToggler:c(t.CuratedSuggestions),conditionalRequirements:t=>n.canShowCuratedSuggestionInEnterpriseScope(t)},{dataSource:"MWS",groupType:t.MRUHistory,suggestionIsEnabled:()=>!0,conditionalRequirements:t=>n.canShowWorkSearchMru(t)},{dataSource:"MRU",groupType:t.MRUHistory,conditionalRequirements:t=>n.enableMRUSearchHome()&&n.canShowMruInWorkScopeZi(t)},{dataSource:"MPP",groupType:t.MRUHistory,conditionalRequirements:t=>n.enableMRUSearchHome()&&n.canShowMruInWorkScopeZi(t)},{dataSource:"MST",groupType:t.MRUHistory,conditionalRequirements:t=>n.enableMRUSearchHome()&&n.canShowMruInWorkScopeZi(t)},{dataSource:"MFF",suggestionIsEnabled:()=>!0,groupType:t.MRUHistory,conditionalRequirements:t=>n.enableMRUSearchHome()&&n.canShowMruInWorkScopeZi(t)},{dataSource:"MRS",groupType:t.MRUHistory,requirements:[1,2],conditionalRequirements:t=>n.enableMRUSearchHome()&&n.canShowMruInWorkScopeZi(t)},{dataSource:"MSBC",groupType:t.QuickWorkSearch,conditionalRequirements:t=>n.canShowQuickWorkSearch()&&n.canShowMsbSearchHomeInWorkScopeZi(t)},h("SSUE",t.RecommendedDocs,1,!0,t=>st()&&n.canShowMsbSearchHomeInWorkScopeZi(t)),],getEmptyZIMessages:()=>u(i.Work,"EmptyWorkMessage","EmptyWorkSubMessage")};n.ScopeConfig[i.EdgeUrls]={icon:{content:"",type:2},prefixesLocString:null,prefixes:["Edge","url","lucky"],enabledDataSources:[{dataSource:"ANA",suggestionIsEnabled:(n,t)=>t==1&&(n=="ANAH"||n=="ANAR"||n=="ANATH"),requirements:[1,2],conditionalRequirements:()=>n.config.topHitMuse}],enabledDataSourcesForZeroInput:[{dataSource:"ANA",suggestionIsEnabled:(n,t)=>t==1&&(n=="ANAH"||n=="ANAR"||n=="ANATH"),requirements:[1,2],conditionalRequirements:()=>n.config.topHitMuse}],getEmptyZIMessages:()=>u(i.EdgeUrls,"EmptyWebMessage","EmptyWebSubMessage")};n.ScopeConfig[i.Chat]={icon:{content:"",type:2},prefixesLocString:"ScopeChat",enabledDataSources:[],enabledDataSourcesForZeroInput:[],getEmptyZIMessages:()=>["",""]};n.ScopeConfig[i.Copilot]={icon:{content:"",type:2},prefixesLocString:"ScopeCopilot",enabledDataSources:[],enabledDataSourcesForZeroInput:[],getEmptyZIMessages:()=>["",""]};n.ScopeConfig[i.ThirdPartyWeb]={icon:{content:"",type:1},prefixesLocString:"ScopeThirdPartyWeb",enabledDataSources:[{dataSource:"TPWeb",suggestionIsEnabled:(t,i)=>n.contains([1],i),requirements:[1]},],enabledDataSourcesForZeroInput:[{dataSource:"TPWeb",requirements:[1]},],getEmptyZIMessages:()=>u(i.Web,"EmptyWebMessage","EmptyWebSubMessage")};for(let t in n.ScopeConfig)n.ScopeConfig[t].enabledDataSources=n.ScopeConfig[t].enabledDataSources.filter(t=>n.contains(n.config.enabledDataSources,t.dataSource)),n.ScopeConfig[t].enabledDataSourcesForZeroInput=n.ScopeConfig[t].enabledDataSourcesForZeroInput.filter(t=>n.contains(n.config.enabledDataSources,t.dataSource))}function fr(){o=null}function at(t){let u=n.Host.getConnectedAccountInfo(0),f=n.Host.getConnectedAccountInfo(1),i=!!(u||f),r=t&&n.isBingEnabled();return i&&r?"EmptyScopeSearchLocation_PCCloudAndWeb":i?"EmptyScopeSearchLocation_PCAndCloud":r?"EmptyScopeSearchLocation_PCAndWeb":"EmptyScopeSearchLocation_PC"}function s(n,t){return u(n,`Empty${i[n]}Message`,`Empty${i[n]}SubMessage`,at(t))}function u(t,i,r,u){let f=vt(n.ScopeConfig[t]),e=u?n.Host.getLocString(u):"",o=n.Host.getLocString(i,f,e),s=n.Host.getLocString(r,f,e);return[o,s]}function er(){const t=n=>HitHighlightingParser.removeDiacritics(n.toLocaleLowerCase().trim());if(o={},n.RuntimeConfig.ScopesAvailable)for(let r in n.ScopeConfig){let f=parseInt(r),u=n.ScopeConfig[f];if(f!=i.All&&w(f,u)){if(f===i.Work&&or(u),n.isThirdPartySearchAllowed()&&f==i.ThirdPartyWeb){let r=n.Host.getThirdPartySearchApps();r.forEach(n=>{let r=t(n.displayName);o[r]||(o[r]=i.ThirdPartyWeb,u.prefixes=p(t(n.displayName)))});continue}if(!u.prefixes&&u.prefixesLocString){let t=n.Host.getLocString(u.prefixesLocString),i=n.Host.getEnUsLocString(u.prefixesLocString);u.prefixes=p(t,i)}u.prefixes&&u.prefixes.forEach(n=>o[t(n)]=f)}}}function or(t){(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.features.isEduScopeApplicableFromStoredValue())?(t.prefixesLocString="ScopeSchool",t.icon=n.config.useCobaltCSS?{content:"",type:2}:{content:"",type:2},t.getEmptyZIMessages=()=>u(i.Work,"EmptySchoolMessage","EmptyEduSubMessage")):(t.prefixesLocString="ScopeWork",t.icon={content:"",type:2},t.getEmptyZIMessages=()=>u(i.Work,"EmptyWorkMessage","EmptyWorkSubMessage"));t.prefixes=null}function vt(t){if(t.scopeNameLocString)return n.Host.getLocString(t.scopeNameLocString);if(t.prefixes)return t.prefixes[0].trim();if(t.prefixesLocString){let i=t.prefixesLocString;n.isThirdPartySearchAllowed()&&!n.isSupportWebResultsInAllScopeInDMAEnabled()&&i==="ScopeAll"&&(i=n.isServicingSearchBingAs3PEnabled()?"DmaAllScopeName":"ScopeSearch");let r=p(n.Host.getLocString(i));return r[0].trim()}return""}function p(n,t){let i=n;return t&&(i+=","+t),i.search(k)>-1&&(i=i.replace(k,",")),i.split(",")}function sr(){return!!(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.qfUtils.isDocumentZeroQueryEnabled())}function hr(){return!(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.isTenantMsbEnabled())||!!n.config.msbEnablePeopleZQ}function w(t,r){if(n.shouldUseMsbEnterpriseScopes()){if(!n.contains(n.config.enabledScopesMsbEnterprise,i[t]))return!1}else if(!n.contains(n.config.enabledScopes,i[t]))return!1;if(n.config.noMailPeopleScopeInMsa&&(t==i.Emails||t==i.People)){let t=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();if(t!==3&&t!==0)return t===1}if(t==i.Web&&n.isWebResultsDisabled()||t==i.Chat&&(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.isEduTenant()))return!1;if(t==i.Chat&&n.isBingEnabled())return!0;if(t===i.Work)return!!(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.features.isWorkScopeApplicable());if(t==i.ThirdPartyWeb&&n.isThirdPartySearchAllowed()||r.showUpsellOnSuggestionsList&&r.showUpsellOnSuggestionsList())return!0;if(t==i.ThirdPartyWeb)return n.isThirdPartySearchAllowed();let u=n.config.enabledDataSources.filter(n=>n!="MRU");n.isBingEnabled()&&t!=i.Web&&(u=u.filter(n=>n!="Web"));for(let n of r.enabledDataSources)kt(n,null)||(u=u.filter(t=>t!=n.dataSource));return r.enabledDataSources.some(t=>n.contains(u,t.dataSource))?!0:!1}function yt(t){switch(n.RuntimeConfig.QfMode){case 5:return n.ScopeConfig[i.All_FileExplorer];case 7:return n.ScopeConfig[i.All_SettingsApp];case 9:return n.ScopeConfig[i.All_ControlPanel];default:return n.ScopeConfig[b(t)]}}function lr(t,r,u,f,e){e||(e={});const{topHitRestriction:c,forceGroupOnTop:l,fromSearchHome:a,fromSuggestionType:v,inorganic:y,serpURLParams:p}=e;let o=n.baseParseQuery(t,r,c);o.fullPartialQuery=o.queryToFetch;o.scope=i.All;const h=n.Host===null||n.Host===void 0?void 0:n.Host.getMru3pAppCache();if(h){let t=o.originalQuery;n.config.skippingRemoveDiacriticsIndexerRelated||(t=HitHighlightingParser.removeDiacritics(o.originalQuery));let r=t.match(wt)||n.config.forwardSlashScopes&&t.match(bt);if(r){let[,,n]=r;n==(h===null||h===void 0?void 0:h.displayName)&&(o.scope=i.ThirdPartyWeb,o.thirdPartySearch=h)}}o.forceGroupOnTop=l;o.fromSuggestionType=v;o.fromSearchHome=a;o.inorganic=y;o.serpURLParams=p;let s;if(yr(o,f))o.taskFrame=f,o.isFormulatedQuery=!0,s=n.ScopeConfig[b(o)];else{if(o.fullPartialQuery&&(ar(o),u&&o.scope!=u.scope&&(o.isFormulatedQuery=!0)),o.isSearchHomeZI=!o.queryToFetch&&o.scope!=i.ThirdPartyWeb&&(n.RuntimeConfig.SearchHomeAvailable==1||n.RuntimeConfig.SearchHomeAvailable==2&&o.scope!=i.All),o.isWorkScopeZI=!o.queryToFetch&&o.scope===i.Work,o.isWebScopeZI=!o.queryToFetch&&o.scope===i.Web,o.isThirdPartyZI=n.isThirdPartySearchAllowed()&&!o.queryToFetch&&o.scope==i.ThirdPartyWeb&&!!o.thirdPartySearch,o.scope==i.All||o.scope==i.Web){let t=n.tryParseUrl(o.queryToFetch,!0);t&&t.type==0?(o.isProtocol=!0,o.fixedUrl=n.cleanAndFixUrlProtocol(t)):cr.test(o.queryToFetch)&&(o.isProtocol=!0,o.fixedUrl=n.cleanAndFixUrlProtocol(o.queryToFetch))}s=yt(o);let r=o.queryToFetch?s.enabledDataSources:s.enabledDataSourcesForZeroInput;o.availableDataSources={};for(let t of r)n.contains(n.config.enabledDataSources,t.dataSource)&&(o.availableDataSources[t.dataSource]=t);o.enabledDataSources={};for(let n in o.availableDataSources){let t=o.availableDataSources[n];t.suggestionGroupToggler&&t.suggestionGroupToggler.isHidden()||(o.enabledDataSources[n]=t)}let t=o.queryToFetch?s.staticGroupOrder:s.staticGroupOrderForZeroInput;t&&(o.staticGroupOrder=t(o))}return vr(o,s),o.showProgressBar=n.config.enableProgressBarForAllScope?n.config.dataSourcesWithProgressBar.some(n=>!!o.enabledDataSources[n]):n.isL2(o)&&n.config.dataSourcesWithProgressBar.some(n=>!!o.enabledDataSources[n]),o.equals=n=>{var t,r;return(o.queryToFetch?o.queryToFetch.toLowerCase():o.queryToFetch)==(n.queryToFetch?n.queryToFetch.toLowerCase():n.queryToFetch)&&n.scope==o.scope&&(n.scope!=i.ThirdPartyWeb||n.scope==i.ThirdPartyWeb&&((t=n.thirdPartySearch)===null||t===void 0?void 0:t.applicationUserModelId)===((r=o.thirdPartySearch)===null||r===void 0?void 0:r.applicationUserModelId))&&(n.taskFrame?n.taskFrame.raw:"")==(o.taskFrame?o.taskFrame.raw:"")&&n.topHitRestriction==o.topHitRestriction},o.getCacheKey=()=>o.cursorPosition+o.queryToFetch.toLocaleLowerCase()+o.scope+n.regionCache,o}function ar(t){if(n.RuntimeConfig.ScopesAvailable){let s=n.isDataSourceEnabled("PT",null),c=s&&pt.test(t.fullPartialQuery);if(c){t.canBePathCompletion=!0;t.scope=i.PathCompletion;return}let u=t.originalQuery;n.config.skippingRemoveDiacriticsIndexerRelated||(u=HitHighlightingParser.removeDiacritics(t.originalQuery));let h=u.match(wt)||n.config.forwardSlashScopes&&u.match(bt);if(h){let[,l,r,f]=h;r=r.toLocaleLowerCase();let e=r.trim();if(o&&n.contains(Object.keys(o),e)){if(t.scope=o[e],n.config.skippingRemoveDiacriticsIndexerRelated){const n=[i.Documents,i.Folders,i.Music,i.Videos,i.Photos];n.indexOf(t.scope)==-1&&(f=HitHighlightingParser.removeDiacritics(f))}t.queryToFetch=f;t.cursorPosition=Math.max(0,t.originalCursorPosition-l.length);n.mantainCursorPositionIn(t.queryToFetch,t.cursorPosition,n.cleanQuery,(n,i)=>{t.queryToFetch=n,t.cursorPosition=i});t.scope==i.ThirdPartyWeb&&(t.thirdPartySearch=n.Host.getThirdPartySearchAppByName(e));t.scopePrefix=r;t.isMultiWord=n.isMultiWord(t.queryToFetch);t.canBePathCompletion=s&&pt.test(t.queryToFetch)}}}}function kt(t,i){for(let i of t.requirements||[])switch(i){case 1:if(n.config.disableOfflineRequest&&!n.isBrowserOnline())return!1;break;case 2:if(n.isWebResultsDisabled())return!1;break;case 3:if(!n.isSupportWebResultsInAllScopeInDMAEnabled()||!n.isBrowserOnline())return!1}return t.conditionalRequirements&&!t.conditionalRequirements(i)?!1:!0}function vr(t,i){let r=n.RuntimeConfig.QfMode==5&&t.fullPartialQuery.search(":")>=0;if(r){t.enabledDataSources={};return}n.disableWebDataSourceIfNeeded(t,n.Host.getRegion(),n.Host.getLanguage());n.disableCoPiffDataSourcesOnConditions(t);let u=t.queryToFetch?i.enabledDataSources:i.enabledDataSourcesForZeroInput;for(let i of u)kt(i,t)||n.disableDataSources(t,i.dataSource);if(!t.queryToFetch){let i=!n.RuntimeConfiguration.DeviceHistoryEnabled;i&&n.disableDataSources(t,"PP","LRA","FL","LM","IFF")}n.TweakSearch&&n.TweakSearch.disableDataSourcesBasedOnTweakSearch(t);n.config.searchServiceDisabled&&n.disableDataSources(t,"IFF","IBA");!ct(t)||n.isMsbEnterprise()&&(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.features.isQwsEnabled())||n.disableDataSources(t,"QSCH")}function yr(t,i){if(i){let r=i.scope,u=n.ScopeConfig[i.scope];if(w(r,n.ScopeConfig[r])){let f=n.ScopeConfig[r].enabledDataSources.filter(n=>gr(n.dataSource,i));if(f.length>0){for(let i of f)n.contains(n.config.enabledDataSources,i.dataSource)&&(t.enabledDataSources[i.dataSource]=i);return u}}}return null}function pr(t){let r=n.safeExecute(()=>JSON.parse(t),"parseTaskFrame");if(r){let n=kr(r);if(n!=i.All)return{raw:t,parsed:r,scope:n}}return null}function kr(n){switch(n.Uri){case wr:let r=n,t=r.FileType;if(t&&t.Value){if(t.Value=="Picture")return i.Photos;if(t.Value=="Video")return i.Videos}return i.Documents;case br:return i.Emails}return i.All}function b(n){return n?n.taskFrame?n.taskFrame.scope:n.scope:undefined}function dr(n){if(n.taskFrame){let t=n.taskFrame.parsed;if(t)if(n.taskFrame.scope==i.Emails){let n=t,i=n.Subject;if(i&&i.Value)return i.Value;let r=n.Body;if(r&&r.Value)return r.Value;let u=n.From&&n.From.length>0?n.From[0]:null;if(u&&u.Value)return u.Value;let f=n.To&&n.To.length>0?n.To[0]:null;if(f&&f.Value)return f.Value}else{let n=t,r=n.Title;if(r&&r.Value)return r.Value;let u=n.Body;if(u&&u.Value)return u.Value;let i=n.People;if(i&&i[0]&&i[0].Value)return i[0].Value;let f=n.Place;if(f&&f.Value)return f.Value}}return n.queryToFetch}function gr(n,t){if(t.scope==i.Emails)return n=="SSEC"||n=="SSEE";else{let r=t.parsed,i=r.FileSource?r.FileSource.Value:null;switch(n){case"MPVD":case"MDOC":case"MPHO":case"MVID":return i!="onedrive"&&i!="sharepoint";case"SSEE":return i!="thispc"&&i!="onedrive";default:return!1}}}function nu(){}function c(t){let i=""+t;const u=()=>{let t=n.LightweightStorage.getItem(dt)||"";return t.split(",")},r=t=>{let i=t.join(",");n.LightweightStorage.setItem(dt,i)};return{isHidden:()=>!1,toggle:t=>{n.safeExecute(()=>{let n=u();if(t&&n.every(n=>n!=i))n.push(i),r(n);else if(!t){let t=n.findIndex(n=>n==i);t>-1&&(n.splice(t,1),r(n))}},"GroupToggler.toggle")}}}let i;(function(n){n[n.All=0]="All";n[n.Apps=1]="Apps";n[n.Settings=2]="Settings";n[n.Photos=3]="Photos";n[n.Videos=4]="Videos";n[n.Music=5]="Music";n[n.Documents=6]="Documents";n[n.Folders=7]="Folders";n[n.Web=8]="Web";n[n.PathCompletion=9]="PathCompletion";n[n.Emails=10]="Emails";n[n.People=11]="People";n[n.Work=12]="Work";n[n.Chat=13]="Chat";n[n.Copilot=14]="Copilot";n[n.All_FileExplorer=1e3]="All_FileExplorer";n[n.All_Lockscreen=1001]="All_Lockscreen";n[n.All_SettingsApp=1002]="All_SettingsApp";n[n.All_ControlPanel=1003]="All_ControlPanel";n[n.EdgeUrls=1004]="EdgeUrls";n[n.ThirdPartyWeb=1e4]="ThirdPartyWeb"})(i=n.Scope||(n.Scope={}));let t;(function(n){n[n.Apps=0]="Apps";n[n.Settings=1]="Settings";n[n.Cortana=2]="Cortana";n[n.Command=3]="Command";n[n.Photos=4]="Photos";n[n.Videos=5]="Videos";n[n.Music=6]="Music";n[n.Documents=7]="Documents";n[n.Folders=8]="Folders";n[n.Emails=9]="Emails";n[n.Store=10]="Store";n[n.SearchSuggestions=11]="SearchSuggestions";n[n.PathCompletion=12]="PathCompletion";n[n._PowerBi=13]="_PowerBi";n[n.JumpListTasks=14]="JumpListTasks";n[n.JumpListPinned=15]="JumpListPinned";n[n.JumpListRecent=16]="JumpListRecent";n[n.JumpListFrequent=17]="JumpListFrequent";n[n.JumpListCustom=18]="JumpListCustom";n[n._JumpListActivityFeed=19]="_JumpListActivityFeed";n[n.People=20]="People";n[n._EdgeHistory=21]="_EdgeHistory";n[n.LocalPlaces=22]="LocalPlaces";n[n.Bookmarks=25]="Bookmarks";n[n.Related=26]="Related";n[n.Websites=27]="Websites";n[n.Contact=28]="Contact";n[n.JumpListSynthetic=29]="JumpListSynthetic";n[n.JumpListActions=30]="JumpListActions";n[n._StartMenu=31]="_StartMenu";n[n.LocalSearchHistory=32]="LocalSearchHistory";n[n.JumpListSettingsFaq=33]="JumpListSettingsFaq";n[n.JumpListSettingsRelatedSettings=34]="JumpListSettingsRelatedSettings";n[n.ActivityFeedSuggestions=35]="ActivityFeedSuggestions";n[n.TopApps=36]="TopApps";n[n.QuickSearch=37]="QuickSearch";n[n._LockscreenQuickSearch=38]="_LockscreenQuickSearch";n[n.WelcomeExperience=39]="WelcomeExperience";n[n.Upsell=40]="Upsell";n[n.MRUHistory=43]="MRUHistory";n[n.PromoBanner=44]="PromoBanner";n[n.VisualSearch=45]="VisualSearch";n[n._BingDailyImage=46]="_BingDailyImage";n[n._MeetingPrep=48]="_MeetingPrep";n[n.AnaheimDataList=49]="AnaheimDataList";n[n.RecommendedDocs=50]="RecommendedDocs";n[n.QuickWorkSearch=51]="QuickWorkSearch";n[n.QuickWorkSearchTopList=52]="QuickWorkSearchTopList";n[n.CuratedSuggestions=53]="CuratedSuggestions";n[n._RelatedMsbDocuments=54]="_RelatedMsbDocuments";n[n.AnaheimDataTile=55]="AnaheimDataTile";n[n.AnaheimDataTopHit=56]="AnaheimDataTopHit";n[n.DSBGroup=57]="DSBGroup";n[n.CuratedSettings=58]="CuratedSettings";n[n.ThreeFingerTap=59]="ThreeFingerTap";n[n.WorkSuggestions=60]="WorkSuggestions";n[n.Groups=61]="Groups";n[n.TrendingSearchData=62]="TrendingSearchData";n[n.MsbQuickWorkQueriesTopList=63]="MsbQuickWorkQueriesTopList";n[n.AnaheimDataQF=64]="AnaheimDataQF";n[n.BingChat=65]="BingChat";n[n.ChatWithBing=66]="ChatWithBing";n[n.FromYourHistory=67]="FromYourHistory";n[n.AIFeed=68]="AIFeed";n[n.SmartActions=69]="SmartActions";n[n.Copilot=70]="Copilot";n[n.DMAWeb=71]="DMAWeb";n[n.GroupHeader=104]="GroupHeader";n[n.MsbOnRampButton=105]="MsbOnRampButton";n[n.RSHSuggestions=106]="RSHSuggestions"})(t=n.GroupType||(n.GroupType={}));const k=/(\s*,\s*)|([\s]*[،„፡“፣",]+[\s]*)/g,d=["PP","QP","IBA","TOPL","SMA"],g=["ST","QS","SSTS","CoPST"],nt=["SAPP","SPP"],tt=["LI","PSLI","CSLI","LV","MU"],it=["FL","PSFL","CSFL","LDOC","SDOC","FD","PSFD","CSFD","MFIL"].concat(tt),gt=[i.Documents,i.Folders,i.Photos,i.Videos,i.Music],ni=["LI","PSLI","CSLI"],ti=["FL","PSFL","CSFL","SDOC"],ii=["FD","PSFD","CSFD"],ri=["PSFL","CSFL","PSLI","CSLI","PSFD","CSFD"],ui=["PSFL","PSLI","PSFD","CSFL","CSLI","CSFD","CoPST"],fi=["ST","QS","SSTS"],ei=d.concat(g).concat(nt).concat(it).concat(["ANAH","ANAT","ANAR","ANAF","ANATH"]).concat(["PT","CG","DFLS","LURL","FEH","RSH"]),oi=1;n.isApp=si;n.isSetting=rt;n.isNonCopilotPoweredSetting=hi;n.isMedia=ci;n.isFileOrFolder=v;n.isPhoto=f;n.isDocument=e;n.isCopilotSuggestion=li;n.isFolder=y;n.isContentSearch=ai;n.isWindowsData=vi;n.isModelBasedSearchType=yi;n.isSameType=pi;n.isFileOrFolderScope=wi;n.isStore=bi;n.isFileWithCopilotAction=ut;n.isSuggestionWithCopilotAction=ki;n.isPowerPointSuggestion=di;n.isExcelSuggestion=gi;n.substrateProvidersEnabled=ft;n.searchHistoryAllowed=ht;n.isRecommendedDocsGroupEnabled=ct;n.nicerCloudFilesEnabled=rr;n.setZeroInputDataSourcesForL1=ur;n.populateScopeConfig=lt;lt();let o;n.cleanScopePrefixes=fr;n.initScopePrefixes=er;n.getScopeDisplayName=vt;n.isScopeEnabled=w;n.getScopeConfig=yt;n.isAADVerificationRequired=!1;const cr=/^ht+ps?[;:]+|^www[.。]|^\/+/,pt=/^[a-z]:\\|^%[^%]+%\\|^\\/i,wt=/^(([^::]+)[::]\s*)(.*)/,bt=/(\/(\w+)\s*)(.*)/;n.parseQuery=lr;n.parseTaskFrame=pr;const wr="action://FindMyStuff/FindDocument",br="action://FindMyStuff/FindMessage";n.getEffectiveScope=b;n.getEffectiveQuery=dr;const dt="HiddenSuggestionGroups";n.initQueryParser=nu}(WSB||(WSB={})),function(n){function lf(n,t){yi=n;pi=t}function ct(){return yi}function af(){return pi}function vf(n,t){return n.type==t.type&&n.source==t.source}function yf(t){if(n.config.useCobaltCSS)switch(t){case"WNSGPH":return"WSBEDG";case"WMSRPM":return"WMSMAN";case"WMSRPA":return"WMSAUT";case"WSBREW":return"WSREWF";case"WSBBST":return"WSBSTK";case"SBIWSB":return"WSVISS";case"BFBWSL":return"MSBWSL";case"BFBWPP":return"MSBWPP";case"BFBWMS":return"MSBWMS";case"MDSB10":return"MDSB11";case"EDSB10":return"EDSB11";case"WSBWS0":return"WSBWS1";case"WSHBSH":return"WSHBSH";case"WSBWSC":return"WSBWSD";case"BFBQWQ":return"MSBQWQ";case"DSBI10":return"DSBI11";case"DSBC10":return"DSBC11";case"SSHTRD":return"SHTR11";default:return t}return t}function wf(n){switch(n){case"PP":return"Apps";case"ST":return"Settings";case"FL":return"Files";case"LM":return"Media";default:return null}}function bf(n){switch(n){case"FL":case"LM":case"IFF":case"MFF":case"PT":case"CG":case"MPVD":case"MDOC":case"MFOL":case"MPHO":case"MVID":case"MMUS":case"FEH":case"CoPIFF":case"CoPCFP":return!0;case"OSTMA":case"OSTMAN":case"QS":case"PP":case"LRA":case"ST":case"MPP":case"MST":case"IBA":case"THST":case"TOPP":case"QSCH":case"DFLS":case"CUSE":case"QWQS":case"SMA":case"CoPST":case"RSH":return!1}throw new Error("New local data source "+n+" needs to be explicity classified as potentially containing PII or not");}function g(n){let t=l(n);return n.deviceItem&&n.handoffType==2?t+"\t"+n.deviceItem.id:n.handoffType==25?t+"\t"+n.converationId:t+"\t"+n.query}function gf(n,t){return n.msbDomain!=null&&n.msbDomain===t.msbDomain&&n.msbId!=null&&n.msbId===t.msbId}function ne(t,i,r){return t.scope===n.Scope.All&&i.staticGroupType===n.GroupType.DMAWeb&&r.staticGroupType===n.GroupType.DMAWeb}function te(t,i){return t.isSearchHomeZI&&d()&&gu(t)&&!n.config.msbQwsDocsNoRefreshAfterCachedResults&&i.staticGroupType===n.GroupType.RecommendedDocs&&(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.features.isQwsEnabled())}function di(t,i){return t.targetPathLC&&n.isApp(t.type)&&n.isApp(i.type)&&t.targetPathLC.includes("\\installer\\")&&t.targetPathLC.endsWith(".ico")&&t.text==i.text}function gi(n,t){return n.handoffType==5&&n.actionUri=="ms-cortana://navigate/Settings"&&t.deviceItem&&t.deviceItem.id=="CortanaSettings"}function lt(n){let t=nt(n);return t?t.packageFamilyName:null}function nr(t,i,r){if(i){let i=rt(n.FOLDERID_Profile)+"\\onedrive - ",r=t.indexOf(i);if(r>=0){let n=t.indexOf("\\",r+i.length);t=t.substr(n+1)}}else{var u=n.AccessTokenManager.getWindowsIdentity();if(u&&t.startsWith("onedrive for business:\\")&&r){let n=u.indexOf("@");n!=-1&&r.toLocaleLowerCase().indexOf("personal/"+u.substr(0,n))>0&&(t=t.substr(23))}}return t}function tr(t,i,r){var u;let f="";if(r){let t=rt(n.FOLDERID_Profile)+"\\"+n.SubstrateTenantName.toLocaleLowerCase()+"\\",r=i.indexOf(t);if(r>=0){let n=r+t.length,u=i.indexOf(" - ",n);f=i.substr(n,u-n).toLocaleLowerCase();i=i.substr(u+3)}}else i.startsWith("sharepoint:\\")&&(i=i.substr(12),f=(u=t.siteTitle)===null||u===void 0?void 0:u.toLocaleLowerCase());return[i,f]}function ie(i,r,u){if((r.type=="TOPL"||r.type=="DFLS")&&i.isSearchHomeZI||te(i,r)||ne(i,r,u))return t.NotDuplicate;if(gf(r,u)||n.contains([5,4],r.handoffType)&&n.contains([5,4],u.handoffType)&&r.actionUri==u.actionUri&&r.query.toLocaleLowerCase()==u.query.toLocaleLowerCase()||r.handoffType==10&&u.handoffType==10&&r.type==u.type&&!r.htmlContent&&!u.htmlContent&&r.query.toLocaleLowerCase()==u.query.toLocaleLowerCase()||r.type!="PWL"&&r.handoffType==1&&u.handoffType==1&&n.isDuplicateUrl(i,r.url,u.url))return t.NoMetadata;let o=nt(r),s=nt(u),f,e;f=o?o.filePath:r.path;f&&(f=f.toLocaleLowerCase());e=s?s.filePath:u.path;e&&(e=e.toLocaleLowerCase());let h=lt(r),c=lt(u);if(h&&c&&h.toLocaleLowerCase()==c.toLocaleLowerCase())return t.NoMetadata;let l=at(r),v=at(u);if(l&&s||v&&o){let i=f||e,n=l||v,r=n.encodedPath;if(i&&r&&i==r.toLocaleLowerCase()){let i=o||s;return!n.launchArguments||(i.launchArguments||"").toLocaleLowerCase()==n.launchArguments.toLocaleLowerCase()||!i.launchArguments&&n.launchArguments&&i.displayName.toLocaleLowerCase().startsWith(n.displayName.toLocaleLowerCase())?t.NoMetadata:t.NotDuplicate}return t.NotDuplicate}if(r.deviceItem&&u.deviceItem){let i=r.deviceItem.id||"",h=u.deviceItem.id||"";if(n.isSetting(r.type)&&n.isSetting(u.type)&&(i=r.deviceItem.displayName,h=u.deviceItem.displayName),i.toLocaleLowerCase()==h.toLocaleLowerCase())return f&&!o&&e&&!s?t.MergeMetadata:t.NoMetadata;if(o){if(n.isSetting(u.type)&&bi[i]==h)return t.NoMetadata}else if(n.isSetting(r.type)&&(s&&bi[h]==i||n.isSetting(u.type)&&(ki[i]==h||ki[h]==i)))return t.NoMetadata}if(di(r,u)||di(u,r))return t.NoMetadata;if(f&&e){if(f==e)return t.MergeMetadata;if(!o&&!s)if(r.handoffType==u.handoffType){if(r.handoffType==8&&r.url==u.url)return t.MergeMetadata}else{const i=r.type==="MFIL"||u.type==="MFIL",o=r.handoffType!=8&&!a(r),s=u.handoffType!=8&&!a(u);if(f=nr(f,o,r.url),e=nr(e,s,u.url),f==e)return i?t.NoMetadata:t.MergeMetadata;if(n.SubstrateTenantName){let[n,c]=tr(r,f,o),[h,l]=tr(u,e,s);if(c==l&&(h.endsWith(n)||n.endsWith(h)))return i?t.NoMetadata:t.MergeMetadata}}let i=r.targetPathLC,h=u.targetPathLC;if(o&&u.type=="IBA"&&(f=dt(f)),s&&r.type=="IBA"&&(e=dt(e)),(i&&h&&i==h||i&&i==e||h&&f==h||f==e)&&(!o||!s||(o.launchArguments||"").toLocaleLowerCase()==(s.launchArguments||"").toLocaleLowerCase()))return t.NoMetadata}if(gi(r,u)||gi(u,r)||r.type==="PPL"&&u.type==="PPL"&&r.uniqueName&&u.uniqueName&&r.uniqueName.toLocaleLowerCase()===u.uniqueName.toLocaleLowerCase()||r.type==="OLE"&&u.type==="OLE"&&r.internetMessageId===u.internetMessageId||r.type==="BKS"&&u.type==="BKS"&&r.url&&u.url&&r.url===u.url)return t.NoMetadata;if((n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(55758958))&&n.config.enableVegaProviderDedupe&&(r.isVegaMatched||u.isVegaMatched)){const n=r.url,i=u.url;if(n&&i&&n===i)return t.NoMetadata}return t.NotDuplicate}function re(t,i){if(n.isDocument(t===null||t===void 0?void 0:t.type)&&n.isDocument(i===null||i===void 0?void 0:i.type)&&t.deviceItem&&i.deviceItem){let n=t.deviceItem.id,r=i.deviceItem.id;if(!o(n)&&!o(r)&&n.toLocaleLowerCase()==r.toLocaleLowerCase())return!0}return!1}function ue(n){switch(n){case"MFF":case"FL":case"LM":case"IFF":case"MPVD":case"MDOC":case"MPHO":case"MVID":case"MMUS":case"MFOL":case"CoPIFF":return!0;default:return!1}}function fe(t,i){if(!n.IndexerQueryGenerator)return!1;if(n.RuntimeConfig.QfMode==5)return!0;switch(t){case"IBA":case"MPVD":case"MDOC":case"MPHO":case"MVID":case"MMUS":case"MFOL":case"CoPIFF":return!0;case"IFF":return sr(i)||!n.config.minLengthForIBAonL1||i.queryToFetch.length>=n.config.minLengthForIBAonL1;default:return!1}}function ee(t,i,r,u){if(r!="Exchange"){let o;const s=decodeURI(t.url),h=i.toLocaleLowerCase(),c=s.toLocaleLowerCase().indexOf(h);if(c!=-1){let n=s.substr(0,c-1);h.endsWith(".one")&&(n=n.substr(0,n.lastIndexOf("/")));o=encodeURI(n)}else o=t.url;let f=s.split("/").slice(3),e;r==null?e="":r=="OneDriveBusiness"?(e="OneDrive for Business:\\",f.length>2&&f[0].toLocaleLowerCase()=="personal"&&f[2].toLocaleLowerCase()=="documents"&&(f=f.slice(3))):e="SharePoint:\\";h.endsWith(".one")&&f.splice(f.length-2,1);t.path=e+f.join("\\");u&&(r=="OneDriveBusiness"?e=n.Host.getLocString("OneDriveTitle",t.siteTitle):(e=t.siteTitle,f.length>1&&f[0].toLocaleLowerCase()=="teams"&&(f=f.slice(2))),t.prettyPrintedPath=e+" > "+f.join(" > "));o&&(t.locationUrl=o)}}function oe(n){return n.kind=="Modern Setting"}function nt(t){return n.isApp(t.type)?t.deviceItem:null}function se(n){return!!n.suggestions}function he(t){return n.config.useCobaltCSS&&(y(t)||h(t))}function ce(n){return n.deviceItem}function at(n){return n.type=="CG"?n.deviceItem:null}function le(t){return n.isApp(t.type)||n.isSetting(t.type)||n.isFileOrFolder(t.type)&&!yr(t.type)}function ae(t){const i=l(t);return i==n.GroupType.WorkSuggestions||i==n.GroupType.Bookmarks||i==n.GroupType.People||i==n.GroupType.Documents}function l(t,i){if(typeof t.staticGroupType=="number")return t.staticGroupType;switch(t.type){case"TOPL":return n.GroupType.TopApps}if(n.isApp(t.type))return n.GroupType.Apps;if(vt(t))return t.groupType;if(n.isSetting(t.type))return n.GroupType.Settings;if(n.isPhoto(t.type))return n.GroupType.Photos;switch(t.type){case"CG":return n.GroupType.Command;case"PT":return n.GroupType.PathCompletion;case"LV":return n.GroupType.Videos;case"MU":return n.GroupType.Music;case"JL":case"FL":case"PSFL":case"CSFL":case"LDOC":case"SDOC":case"SDFE":case"MFIL":return n.GroupType.Documents;case"FD":case"PSFD":case"CSFD":return n.GroupType.Folders;case"OLE":case"OWA":return n.GroupType.Emails;case"PPL":case"MPPL":return n.GroupType.People;case"MGRP":return i===n.Scope.Work?n.GroupType.Groups:n.GroupType.People;case"BKS":case"MBKS":case"MQNA":case"MBLD":case"MACR":return n.GroupType.Bookmarks;case"ELA":return n.GroupType.LocalPlaces;case"ANAF":case"ANAH":case"ANAT":case"ANAR":return n.GroupType.SearchSuggestions;case"HS":return n.config.enableFromYourHistory?n.GroupType.FromYourHistory:t.staticGroupType===n.GroupType.ChatWithBing?n.GroupType.ChatWithBing:n.GroupType.SearchSuggestions;case"ANATH":return n.GroupType.AnaheimDataTopHit;case"FEH":return n.GroupType.LocalSearchHistory;case"SNSC":case"SNSP":case"SNST":return n.GroupType.VisualSearch;case"RSSG":case"QSSG":case"QWQS":case"QWQA":case"QWQC":return n.GroupType.QuickSearch;case"TS":return n.GroupType.TrendingSearchData;case"SMA":return n.GroupType.SmartActions;case"TP":return n.GroupType.DMAWeb;case"RSH":return n.GroupType.RSHSuggestions;default:switch(t.handoffType){case 3:return n.GroupType.Store;case 5:case 4:return n.GroupType.Cortana;case 10:return t.htmlContent?n.GroupType.SearchSuggestions:n.GroupType.Cortana;case 0:return t.staticGroupType===n.GroupType.ChatWithBing?n.GroupType.ChatWithBing:n.GroupType.SearchSuggestions;case 13:case 14:return n.GroupType.SearchSuggestions;case 21:return n.GroupType.WorkSuggestions;case 1:return n.GroupType.Websites;case 26:return n.GroupType.Copilot;case 25:return n.GroupType.AIFeed}throw new Error("Unexpected handoff type: "+t.handoffType);}}function ir(n){return!n.isAnswer&&(n.handoffType==0||n.handoffType==11||n.handoffType==21)&&n.type!="QSSG"}function rr(n){return n.type=="HS"}function ve(n){return ir(n)||rr(n)||(n===null||n===void 0?void 0:n.isAnswer)}function ur(t){switch(t){case n.GroupType.JumpListTasks:case n.GroupType.JumpListPinned:case n.GroupType.JumpListRecent:case n.GroupType.JumpListFrequent:case n.GroupType.JumpListCustom:return!0;default:return!1}}function ye(t){let i=t.type;return ur(i)||i==n.GroupType.Related||i==n.GroupType.Contact}function vt(n){return!!n.isChild||!!n.parent}function pe(n){return n.type=="JL"}function we(t){switch(t){case n.GroupType.Apps:case n.GroupType.Store:return n.Scope.Apps;case n.GroupType.Settings:return n.Scope.Settings;case n.GroupType.Documents:return n.Scope.Documents;case n.GroupType.Folders:return n.Scope.Folders;case n.GroupType.Photos:return n.Scope.Photos;case n.GroupType.Videos:return n.Scope.Videos;case n.GroupType.Music:return n.Scope.Music;case n.GroupType.LocalPlaces:case n.GroupType.SearchSuggestions:case n.GroupType.FromYourHistory:case n.GroupType.ChatWithBing:case n.GroupType.AnaheimDataQF:case n.GroupType.Websites:case n.GroupType.Bookmarks:return n.Scope.Web;case n.GroupType.Emails:return n.Scope.Emails;case n.GroupType.People:return n.Scope.People;case n.GroupType.AnaheimDataTopHit:if(n.config.topHitMuse)return n.Scope.EdgeUrls;break;case n.GroupType.BingChat:return n.Scope.Chat;case n.GroupType.Copilot:return n.Scope.Copilot}return n.Scope.All}function fr(t){switch(t){case 0:case 7:case 8:return 32;case 1:return 16;case 2:return n.IconSize_GridLayout_Scaled;case 3:return 24;case 4:return 64;case 5:return 200;case 9:return 256}}function be(n,t,i,r){if(n&&n.type==0&&cr(t,r)){let r=t=>{n.ratio=t.height==t.width?1:t.height>t.width?3:2,i()},t=new Image;t.src=n.content;t.onload=()=>r({height:t.height,width:t.width})}else i()}function ke(t){return`${n.config.imageHostName}${t}`}function yt(){let t=n.uiLanguageCache.toLocaleLowerCase();return de[t]||t}function er(n,t,i,r,u,f,e,o,s,h,c,l,a,v){let y={text:t,getIcon:i,icon:r,type:u,query:f,ciMatchedQuery:null,id:c,click:l,handoffType:o,instItem:e,isAnswer:!1,htmlContent:null,classNames:[],selected:!1,featureStore:undefined,sequenceNumber:s,getMruData:()=>null,template:0,mayContainPII:h,features:[],previewPaneType:undefined,reactKey:v};return y.previewPaneType=wt(n,y,a),y}function ge(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt){let it=[];if(g)try{it=JSON.parse(g)}catch(rt){vi("parseChildSuggestions",null,new Error(rt))}let tt={text:t,getIcon:i,icon:r,type:u,query:f,ciMatchedQuery:null,id:undefined,click:undefined,handoffType:o,instItem:e,isAnswer:y,htmlContent:null,classNames:[],selected:!1,featureStore:undefined,sequenceNumber:s,getMruData:()=>et(tt),template:d,mayContainPII:h,features:[],previewPaneType:p,subType:c,additionalInfoText:l,primaryMetadata:a,autoOpenPreviewPaneWhenOnTopHit:v,secondaryIcon:w,segments:b,narratorText:k,childSuggestions:it,webUrl:nt},ut=tt===null||tt===void 0?void 0:tt.isChild;return tt.previewPaneType=ut?wt(n,tt,!0):wt(n,tt,!1),tt}function no(n,t,i,r,u,f,e,o,s){n.subItems==null&&(n.subItems=[]);let c=n.id,h={id:t,sequenceNumber:n.sequenceNumber,selected:!1,text:i,itemView:r,props:u,onSelected:o,click:s,disabled:e,instItem:f,suggestionId:c};return n.subItems.push(h),h}function to(t,i,r,u,f,e,o,s){let h=n.InstrumentationHelper.getInstrumentedSyntheticSuggestion(i,r);if(h)return h;let l=t.scope;h=er(t,null,null,u,r,null,n.InstrumentedItem.getNonSuggestionInstrumentedItem(r,wi.KValues),f,i,!1,r);h.notAResult=!0;h.primaryMetadata=e;o&&(h.additionalInfoText=" - "+h.primaryMetadata);let c=n=>{var t;h.query=n.queryToFetch;h.text=HitHighlightingParser.addMarkers(n.queryToFetch);h.narratorText=or(h);h.click=()=>s(h,n);h.reactKey=r+n.queryToFetch+((t=h.primaryMetadata)!==null&&t!==void 0?t:"")};return c(t),h.updateFromQuery=n=>!n.isProtocol&&n.scope==l&&n.queryToFetch?(c(n),!0):!1,h.getMruData=()=>et(h),n.InstrumentationHelper.instrumentSyntheticSuggestion(i,h),h}function or(n,t){if(n.htmlContent)return null;let i=[n.text],r=n.dateShort;if(r&&i.push(r),t)i.push(t);else{if(n.primaryMetadata){i.push(n.primaryMetadata);let t=n.department;t&&i.push(t)}n.template==1&&n.secondaryMetadata&&i.push(n.secondaryMetadata)}return HitHighlightingParser.removeMarkers(i.join(", "))}function sr(t){return(t===null||t===void 0?void 0:t.scope)!=n.Scope.All||!!(t===null||t===void 0?void 0:t.taskFrame)}function hr(t){return typeof t=="string"?t=="LI"||t=="LV"||t=="PSLI"||t=="CSLI":t==n.GroupType.Photos||t==n.GroupType.Videos}function io(t,i){return typeof t=="string"?n.isDocument(t)&&i==2:t==n.GroupType.Documents&&i==2}function cr(t,i){return hr(t)||vr(t)||n.config.newFilesPreviewPane&&io(t,i)}function ro(t){return!n.config.disableMediaGridLayout&&!n.RuntimeConfig.AlwaysWide&&hr(t)}function uo(t,i){if(!t||!n.RuntimeConfig.ScopesAvailable)return null;if(i.scope==n.Scope.All){let r=[];if(t.ISUPN&&t.ISUPG){let n=t.ISUPN.split("\t"),i=t.ISUPG.split("\t");if(n.length==i.length)for(let t=0;t<n.length;t++)r.push(i[t]+"\t"+n[t]);else vi("parseWebSuppressionSignals",null,new Error("parsedNames.length != parsedGroups.length"))}let i=t.FSUP?t.FSUP.split("\t"):null;if(n.config.disableFSUPForWebSuggGroup&&i){let t=i.indexOf(n.GroupType.SearchSuggestions.toString());t!==-1&&i.splice(t,1)}if(n.config.enableWinStoreAppPreview&&i){let t=i.indexOf(n.GroupType.Store.toString());t!==-1&&i.splice(t,1)}return{fullySuppressedGroups:i,partiallySuppressedGroups:t.PSUP?t.PSUP.split("\t"):null,suppressedSuggestions:r}}return null}function fo(t){return tt||(tt=_d.createElement("span")),n.safeExecute(()=>(tt.innerHTML=t,tt.innerText),t,"decodeHtml")}function eo(n,t){return{matchType:n,matchedText:t}}function e(n){return n.replace(oo,"\\$&")}function so(t,i){if(i){let r=n.config.disableSyntaxHighlight?t.toLocaleLowerCase().includes(i.toLocaleLowerCase()):t.includes(HitHighlightingParser.startMarker),f=r?t:HitHighlightingParser.addMarkers(t,i),u=HitHighlightingParser.split(f).find(n=>n.highlighted);if(u){let o=r?HitHighlightingParser.removeMarkers(t):t,s=n.config.disableSyntaxHighlight?new RegExp("((?:\\\\[^\\\\]+)?\\\\[^\\\\]+)?\\\\("+e(i)+"|"+e(i.toLocaleLowerCase())+").*","i"):new RegExp("((?:\\\\[^\\\\]+)?\\\\[^\\\\]+)?\\\\"+e(u.text)+".*","i"),f=s.exec(o);if(f&&f[0])return{matchType:pt.Location,matchedText:o.startsWith(f[0])?o:String.fromCharCode(8230)+f[0]}}}return null}function ho(t,i){if(i){let r=n.config.disableSyntaxHighlight?t.toLocaleLowerCase().includes(i.toLocaleLowerCase()):t.includes(HitHighlightingParser.startMarker),f=r?t:HitHighlightingParser.addMarkers(t,i),u=HitHighlightingParser.split(f).find(n=>n.highlighted);if(u){let o=r?HitHighlightingParser.removeMarkers(t):t,s,h=n.config.disableSyntaxHighlight?new RegExp("(?:\\S+\\s){0,3}\\b("+e(i)+"|"+e(i.toLocaleLowerCase())+")\\S*(?:\\s\\S+){0,5}","i"):new RegExp("(?:\\S+\\s){0,3}\\b"+e(u.text)+"\\S*(?:\\s\\S+){0,5}","i"),f=h.exec(o);return f&&f[0]&&(s={matchType:pt.Content,matchedText:f[0]}),[o,s]}}return[null,null]}function co(t,i){return!t||!i?!1:n.config.disableSyntaxHighlight?HitHighlightingParser.addMarkers(t,i).toLocaleLowerCase().includes(i.toLocaleLowerCase()):HitHighlightingParser.addMarkers(t,i).includes(HitHighlightingParser.startMarker)}function lo(t){return t==n.Scope.Emails}function ao(t,i){if(n.config.consistentHighlightInQF&&!i)return n.config.reverseHighlightInQF;if(vt(t))return!1;switch(t.handoffType){case 0:case 13:case 14:case 21:case 5:case 10:case 4:return t.type!="QSSG";case 3:return t.type=="STS";case 2:return t.type=="SDFE";case 8:case 12:return t.type=="OWA";default:return!1}}function wt(t,i,r){const u=undefined;if(!n.RuntimeConfig.PreviewPaneAvailable||t.isSearchHomeZI)return u;const f=()=>{if(i.handoffType==1)return uf()?1:n.RuntimeConfig.AlwaysWide?2:u;return n.isBingEnabled()&&n.contains([0,13,14],i.handoffType)&&!i.htmlContent?1:u};if(r)return f();switch(l(i,t===null||t===void 0?void 0:t.scope)){case n.GroupType.Store:return n.RuntimeConfig.AlwaysWide&&i.type!="STS"?2:u;case n.GroupType.Apps:case n.GroupType.Cortana:case n.GroupType.Command:case n.GroupType.Folders:case n.GroupType.Music:case n.GroupType.PathCompletion:case n.GroupType.Emails:case n.GroupType.Photos:case n.GroupType.Settings:case n.GroupType.Videos:case n.GroupType.Copilot:return n.RuntimeConfig.AlwaysWide?2:u;case n.GroupType.Documents:return a(i)?3:n.RuntimeConfig.AlwaysWide?2:u;case n.GroupType.People:return i.handoffType==0?1:i.handoffType==1?u:a(i)?3:n.RuntimeConfig.AlwaysWide?2:u;case n.GroupType.Groups:return 3;case n.GroupType.Bookmarks:return a(i)?3:f();case n.GroupType.Websites:return n.isBingEnabled()&&i.type!="LURL"?1:u;case n.GroupType.AnaheimDataTopHit:return n.config.topHitMuse?2:f();default:return f()}}function vo(t,i,r){let u=r.previewPaneType;if(!u)return!1;let f=i.previewPaneType,e=u==1&&f==1,o=!0;return n.config.msbVerticalWorkScopeEnabled&&r.handoffType===21&&(o=i.msbVerticalHash===r.msbVerticalHash),i.query.toLocaleLowerCase()==r.query.toLocaleLowerCase()&&(!e&&u==f||e&&i.handoffType==r.handoffType)&&o}function o(n){return n==null}function po(t){return t==n.GroupType.Documents&&n.isSubstrateO365AccountConnected}function wo(t){switch(t){case 2:return"OneDrive";case 3:return n.Host.getLocString("OneDriveForBusiness");case 4:return"SharePoint";case 1:return n.Host.getLocString("ThisPC");case 5:return n.Host.getLocString("MsbPeopleGroups");case 6:return n.Host.getLocString("MsbPeopleContacts")}return null}function bo(n){if(br())switch(n){case 37:return 39;case 39:return 37}return n}function lr(){return n.config.wsbWithCopilotQF?{type:0,content:n.getEdgeFallbackIcon()}:n.config.enableEdgeIconForWebSuggInQF?{type:0,className:"EdgeIconForWebSugg"}:n.config.networkIconForWebSugg?{type:0,className:"NetworkIcon"}:n.config.networkWithSpyglassIconForWebSugg?{type:0,className:"NetworkWithSpyglassIcon"}:n.config.bingIconForWebSugg?{type:0,className:"BingIcon"}:n.config.enableBlueSearchBPForWebSuggestion||n.config.enableSolidSearchForWebSuggestion?{content:n.Host.getWindowsTheme()==2?n.config.qfWebSuggestionIconUrlDark:n.config.qfWebSuggestionIconUrlLight,type:0,isWebSuggestionIcon:!0}:{content:"",type:2}}function ko(t){return n.Host.getLocString(t?(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.isEduTenant())?"SeeSchoolAndWebResults":"SeeWorkAndWebResults":iu()?"SeeBingChatResults":ar())}function ar(){return n.config.addOpenPrefixToOnlineSuggestion?"OpenWebResults":n.config.enableNewWebSuggestionAnnotation?n.config.webSuggestionAnnotationKey:"SeeWebResults"}function go(t){return n.msbHost&&n.isDataSourceEnabled("MSBC",t)}function vr(n){return n=="PPL"||n=="MPPL"||n=="MGRP"}function yr(n){return n=="MFIL"}function ns(){const t=n.config.msbSuggestionTophitRule;switch(t){case 1:return kf;case 2:default:return df}}function ts(n){return n=="MPPL"||n=="MGRP"||n=="MBKS"||n=="MQNA"||n=="MFIL"||n=="MBLD"||pr(n)}function pr(n){return n=="MVALL"||wr(n)}function wr(n){return n=="MVPPL"||n=="MVGRP"||n=="MVSIT"||n=="MVFIL"||n=="MVMES"||n=="MVYAM"||n=="MVCON"}function is(n){switch(n){case"MVPPL":return"MPPL";case"MVGRP":return"MGRP";case"MVFIL":return"MFIL";default:return undefined}}function a(n){return n.handoffType===17}function rs(n,t){const i="b_hide";n&&(t?n.classList.remove(i):n.classList.add(i))}function us(t,i){if(!n.config.limitScaleRange){const r="fixedHeightWin11";t&&(i?t.classList.add(r):t.classList.remove(r))}}function it(n,t){n instanceof HTMLElement&&(n.style.width=t)}function fs(t,i,r){if(t){const{TextScaleFactor:f}=n.RuntimeConfiguration,u=f>1,e=n.config.useCobaltCSS;if(i)if(r)u?t.getAttribute("style")||(it(t.querySelector(".dsb-fwp-left"),"57.1%"),t.querySelector(".dsb-fwp-left").style.marginRight="2.2%",it(t.querySelector(".dsb-fwp-right"),"40.7%")):(t.querySelector(".dsb-fwp-left").removeAttribute("style"),t.querySelector(".dsb-fwp-right").removeAttribute("style"));else if(u){if(!t.getAttribute("style")){const n=e?"59.32%":"53.31%";it(t,n)}}else t.removeAttribute("style")}}function br(){return ThresholdUtilities.isRightToLeftLanguage(n.uiLanguageCache)}function es(){bt={}}function rt(t){let i=bt[t];if(typeof i=="undefined"){let r=SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch;r.getFolderPathFromKnownFolderIdGuid?(i=n.safeExecute(()=>r.getFolderPathFromKnownFolderIdGuid(t),"getPathFromFolderID","",t),i=i.toLocaleLowerCase()):i="";bt[t]=i}return i}function os(){kt={}}function dt(n){if(!n.startsWith("{"))return n;let t=kt[n];if(!t){let i=n.match(ss);t=i?rt(i[1])+i[2]:n;kt[n]=t}return t}function hs(n){return n.startsWith("file:")&&(n=n.slice(5)),n.replace(/\//g,"\\")}function cs(t){return n.config.enforceOriginalOrderForTypes[t.type]||n.config.enforceOriginalOrderForTypes[t.type+"|"+t.handoffType]}function ls(t){return t==1?"https://substrate.office.com":(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(55182095))&&n.config.enabledMsaAuthV2?"https://substrate.office.com/M365.Access":n.config.useCobaltCSS?"https://substrate.office.com/M365.Access":"https://substrate.office.com/SubstrateSearch-Internal.ReadWrite"}function as(t){return t==1?"https://outlook.office.com/":(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(55182095))&&n.config.enabledMsaAuthV2?"https://outlook.office.com/M365.Access":n.config.useCobaltCSS?"https://outlook.office.com/M365.Access":"https://outlook.office.com/User.ReadWrite"}function vs(t){return t==1?"https://www.bing.com":(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(55182095))&&n.config.enabledMsaAuthV2?"077c9b95-2f57-4442-8872-134fcc08fcb3/Bing.MSA.Default":"service::cortana.bing.com::mbi_ssl"}function ys(t){return n.TweakSearch&&n.TweakSearch.isTweakSearchEnabled()?n.config[t]:undefined}function ps(){return n.config.skipSelectedScope&&n.RuntimeConfig.AlwaysWide}function kr(t){return ot()||n.config.isDMARegion?!1:n.RuntimeConfig.PreviewPaneAvailable&&n.RuntimeConfig.QfMode!=0&&n.RuntimeConfig.QfMode!=11&&u(t)&&n.canShowUpsell&&!c(t)&&!(SearchAppWrapper.CortanaApp.height<=550)}function ws(){return SearchAppWrapper.CortanaApp.textScaleFactor>1&&SearchAppWrapper.CortanaApp.textScaleFactor<=1.25}function dr(){return ef()}function bs(){return sf()}function gr(t){if(!n.config.wsbWithCopilot||!dr()||!gt())return!1;const i=n.AccessTokenManager.getWindowsAccountType();return u(t)&&!c(t)&&i!==1&&i!==0}function gt(){switch(SearchAppWrapper.CortanaApp.entryPoint){case"WNSFIS":case"WNSSTB":case"WNSSSB":return!1;default:return!0}}function ks(t){if(!n.config.wsbWithCopilot)return!1;const i=n.AccessTokenManager.getWindowsAccountType();return u(t)&&!c(t)&&i!==1&&i!==0}function ds(){if(!n.config.wsbWithCopilotQF||!gt())return!1;const t=n.AccessTokenManager.getWindowsAccountType();return t!==1&&t!==0}function nu(t){return(n.config.supportedQuickAnswersMarkets[t]||n.config.quickAnswerIcon||n.config.quickAnswerWeb)&&tu()}function tu(){return(n.RuntimeConfig.PreviewPaneAvailable||!n.RuntimeConfig.AlwaysWide&&!n.config.useCobaltCSS&&!i())&&n.RuntimeConfig.QfMode!=0&&n.RuntimeConfig.QfMode!=11&&n.isBingEnabled()&&n.isBrowserOnline()}function gs(){var t;return n.config.anaheimResetDefaultTop&&!n.config.anaheimResetDefaultDisabledLang[(t=yt())===null||t===void 0?void 0:t.substring(0,2)]}function nh(){return n.config.enableCodexUpsell&&n.isCodexEligible()}function iu(){return n.config.enableQFSuggestionsToChatRouting&&n.config.enableBingChatString&&n.isCodexEligible()}function th(n){return n+"&showconv=1&sendquery=1"}function ih(t){return!t||typeof t=="undefined"?t:n.config.enableChatURLUpdate?t.replace("/search","/chat"):t}function rh(t,i,r){if(n.config.enableQFSuggestionsToChatRouting&&n.isCodexEligible()&&!!i&&t==0&&r!="ECS")if(n.config.enablePersonalizedChatNudges)return r==="GPC_PLQ";else{const t=i.trim().split(" ").filter(n=>n.trim()!="").length;return t>=n.config.thresholdForQFSuggToBingChat}return!1}function ru(){return n.config.enableQFChatIcon?n.Host.getWindowsTheme()===2?"searchChatIconDark2":"searchChatIconLight2":"searchChatIcon"}function uh(n){n&&n.handoffType==0&&(n.icon={type:0,className:ru()})}function fh(t,i){return!!i&&!!n.config.enableSearchHomeSuggToBingChat&&t==0&&n.AccessTokenManager.getWindowsAccountType()==2}function eh(){if(!n.config.enableSnipSearchV2)return!1;const i="CN";if(!n.revIpRegionCache||n.revIpRegionCache==i||n.regionCache==i||!n.isBingEnabled())return!1;let t=n.Host.getQuery();return kr(t)?!1:y(t)||h(t)?!1:n.Host.isBitmapInClipboardSupported()}function oh(t){return uu(t)&&(!s(!0)||n.config.enableQuickSearch&&s(!0))&&!fu(t)}function uu(t){const i=yt();return(n.isMiniSerpEnabled()||n.config.quickSearchToMsnMarkets[i])&&ft(t)&&!n.isDataSourceEnabled("CUSE",t)}function sh(){if(n.msbHost!==null&&n.msbHost!==void 0)return n.msbHost.features.isEnterpriseScopeEnabled()}function hh(){return n.msbHost&&n.msbHost.features.isQwsEnabled()&&d()&&n.isMiniSerpEnabled()&&(n.msbHost.qfUtils.getIsMsbClientQfTokenReady()||n.msbHost.qfUtils.getQuickWorkSearchCache()!=null)&&n.config.msbDsbEnabled}function s(t,i){var r,u;let f=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();return t?n.config.enableAnaheimWin11ZI?f!=1:(r=n.config.enableAnaheimDataSH&&!n.config.useCobaltCSS&&ft(i)&&f!=1)!==null&&r!==void 0?r:!1:(u=n.config.enableAnaheimDataQF)!==null&&u!==void 0?u:!1}function ch(t){var i,r;return(n.MockUrlParameters===null||n.MockUrlParameters===void 0?void 0:n.MockUrlParameters.isTest)?n.config.enableWinStoreAppDataProvider:((i=n.config===null||n.config===void 0?void 0:n.config.storeAppEnabledRegions)===null||i===void 0?void 0:i.length)>0&&!n.contains(n.config.storeAppEnabledRegions,n.Host.getRegion().toLowerCase())?!1:n.config.enableWinStoreAppDataProvider&&!(n.config.isDMARegion||ot())&&(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(50065374))&&(t?((r=t.queryToFetch)===null||r===void 0?void 0:r.length)>=1:!0)}function lh(){return n.config.enableAuroraDP&&(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(54798046))||!1}function fu(t){const i=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();return n.isTrendingSearchEnabled()&&ft(t)&&i!=1&&n.RuntimeConfig.QfMode!=0&&n.RuntimeConfig.QfMode!=11&&n.RuntimeConfig.QfMode!=4&&!n.isTSFallbackToANA}function eu(){return n.config.enableTSInSearchBox&&n.isThumbnailForTSEnabled()&&b()&&(n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())!==1&&n.RuntimeConfig.QfMode!=0&&n.RuntimeConfig.QfMode!=11&&n.RuntimeConfig.QfMode!=4}function ah(){return eu()&&!su()}function vh(t){const i=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();return n.isTSWin11LeftPaneEnabled&&!!n.config.trendingSearchInWin11LeftPane&&h(t)&&i!=1&&n.RuntimeConfig.QfMode!=0&&n.RuntimeConfig.QfMode!=11&&n.RuntimeConfig.QfMode!=4}function yh(){const t=n.loadTSContentFromWSBCache();if(t){const{cacheTime:r,trendingSearchSuggestions:i}=t;i&&i.length>0&&(i.push(i.shift()),n.setTSContentToCache({cacheTime:r,trendingSearchSuggestions:i}))}}function su(){var t,i;return ut==undefined&&(i=(t=n.LightweightStorage.getItem(ou))!==null&&t!==void 0?t:!1,ut=i&&i.toLowerCase()=="true"),ut}function ph(t){ut=t;n.LightweightStorage.setItem(ou,t.toString());n.InstrumentationHelper.logClientInstEvent("Select","SetTSInSB",n.SequenceNumberManager.getSequenceNumber(),{state:t.toString()})}function wh(){return n.config.enableSyncedHistoryLocal?n.config.enableSearchHistoryMru&&!!n.config.forceUseNifSH&&n.RuntimeConfiguration.DeviceHistoryEnabled&&((n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())==2||(n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())==3)&&n.isBrowserOnline():n.config.enableSearchHistoryMru&&!!n.config.forceUseNifSH&&n.RuntimeConfiguration.DeviceHistoryEnabled&&(n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())==2&&n.isBrowserOnline()}function bh(){var t,i;let r=n.config.mruAsSearchHistoryCacheKey;if(n.config.enableHistoryCacheKeyUpdate&&(n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())==2){let n=(i=(t=ct())===null||t===void 0?void 0:t.getSelectedAccountId())!==null&&i!==void 0?i:"";r+="_"+n}return r}function kh(t){return n.config.msbDsbRecentQueriesEnabled&&!c(t)&&d()&&i()}function ni(){return n.config.enableAnaheimWin11ZITopSites&&n.AccessTokenManager.getWindowsAccountType()==2}function dh(){var t,i;return ni()?!1:n.AnaheimDataProviderV2&&n.AnaheimDataProviderV2.checkAnaheimV2Enable()?(t=p()&&n.LightweightStorage.getItem("AnaheimDataBHListDismissed")!="1"&&(n.config.enableAnaheimDataHS&&n.AnaheimDataParser.HistorySuggestionCount>0||n.config.enableAnaheimDataRC&&n.AnaheimDataParser.RecentlyClosedSuggestionCount>0))!==null&&t!==void 0?t:!1:n.AnaheimDataProvider?(i=p()&&n.config.enableAnaheimDataHS&&n.LightweightStorage.getItem("AnaheimDataBHListDismissed")!="1"&&n.AnaheimDataParser.HistorySuggestionCount>0)!==null&&i!==void 0?i:!1:!1}function gh(){var t,i;return ni()&&(n.AnaheimDataParser.TopSitesSuggestionCount<=3?n.LightweightStorage.setItem("AnaheimDataTSTileDismissed","1"):n.LightweightStorage.setItem("AnaheimDataTSTileDismissed","0")),n.AnaheimDataProviderV2&&n.AnaheimDataProviderV2.checkAnaheimV2Enable()?(t=p()&&n.LightweightStorage.getItem("AnaheimDataTSTileDismissed")!="1"&&n.config.enableAnaheimDataTSTile&&n.AnaheimDataParser.TopSitesSuggestionCount>=3)!==null&&t!==void 0?t:!1:n.AnaheimDataProvider?(i=p()&&n.config.enableAnaheimDataTSTile&&n.LightweightStorage.getItem("AnaheimDataTSTileDismissed")!="1"&&n.AnaheimDataParser.TopSitesSuggestionCount>=3)!==null&&i!==void 0?i:!1:!1}function p(){var t,i;return n.AnaheimDataProviderV2&&n.AnaheimDataProviderV2.checkAnaheimV2Enable()?(t=s(!0)&&n.config.enableAnaheimDataSHUX)!==null&&t!==void 0?t:!1:n.AnaheimDataProvider?(i=s(!0)&&n.config.enableAnaheimDataSHUX&&n.AnaheimDataProvider.getShouldShowAnaheimDataSH())!==null&&i!==void 0?i:!1:!1}function nc(){var t;return n.AnaheimDataProviderV2&&n.AnaheimDataProviderV2.checkAnaheimV2Enable()?(t=ti()&&(n.config.enableAnaheimDataHS&&n.AnaheimDataParser.HistorySuggestionCount>0||n.config.enableAnaheimDataRC&&n.AnaheimDataParser.TopSitesSuggestionCount>0||n.config.enableAnaheimDataFV&&n.AnaheimDataParser.FavoriteSuggestionCount>0||n.config.enableAnaheimDataTSTile&&n.AnaheimDataParser.TopSitesSuggestionCount>0))!==null&&t!==void 0?t:!1:n.AnaheimDataProvider?ti()&&n.AnaheimDataParser.HistorySuggestionCount>0:!1}function ti(){var t,i;return n.AnaheimDataProviderV2&&n.AnaheimDataProviderV2.checkAnaheimV2Enable()?(t=s(!1)&&n.config.enableAnaheimDataQFUX)!==null&&t!==void 0?t:!1:n.AnaheimDataProvider?(i=s(!1)&&n.config.enableAnaheimDataQFUX&&n.config.enableAnaheimDataHS&&n.AnaheimDataProvider.getShouldShowAnaheimDataQF())!==null&&i!==void 0?i:!1:!1}function tc(){var t=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();return n.config.skipWinVersionCheck||(t==2||t==3)&&[4,27,].indexOf(n.osSKUCache)==-1&&!n.isSubstrateO365AccountConnected}function ic(){return nu(n.Host.getLanguage().toLowerCase())||(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.features.isQwsEnabled())||n.config.enableAnaheimDataSH||n.config.enableAnaheimDataQF}function ii(n,t,i){if(typeof n!="object"||n==null)return n;if(n instanceof Date){let t=new Date;return t.setTime(n.getTime()),t}let r=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n));for(let u in n)(!t||t.indexOf(u)<0)&&(r[u]=i&&i.indexOf(u)>=0?n[u]:ii(n[u],t,i));return r}function w(n,t){var i,u,r;if(n===t||typeof n=="function"&&typeof t=="function")return!0;if(typeof n!="object"||n===null||typeof t!="object"||t===null||(i=Object.keys(n),u=Object.keys(t),i.length!==u.length))return!1;for(r=0;r<i.length;r++)if(!Object.hasOwnProperty.call(t,i[r])||!w(n[i[r]],t[i[r]]))return!1;return!0}function rc(t,i,r){return n.config.pureRender?!w(t.props,i)||!w(t.state,r):!0}function uc(t,i){return n.config.pureRender?w(t,i):!0}function fc(t,i,r){if(n.config.pureRender){let n=!0;for(let u of r)if(!w(t[u],i[u])){n=!1;break}return n}return!0}function ec(){return n.config.mruSearchHome&&!c()}function oc(t,i,r,u){return n.Async.safeChainWithGlobalCaching("getIconUrlSuggestion",()=>ThresholdUtilities.createPromise(f=>{let e=hu(t,i,r,u);const o=()=>{if(n.config.wsbUseFetchSendRequest){const n={url:e};return ff("fetchIconUrl",n)}else{let n=SearchAppWrapper.CortanaApp.createStringMap(),t=SearchAppWrapper.CortanaApp.createStringMap();return SearchAppWrapper.CortanaApp.makeHttpRequestAsync(0,e,n,"",t)}},s=t=>{if(t.statusCode!==200){f(null);return}n.Async.safeChain("readIconResponse",()=>t.readAsStreamAsync(),f,()=>f(null),null,null,1)};n.Async.safeChain("fetchIconUrl",o,s,()=>f(null),null,e,1)}),()=>t+"_icon",t=>t?n.toIcon(t,"convertResponseToIcon"):{type:0,content:n.getEdgeFallbackIcon()},null,null,t,1)}function sc(t){return n.Async.safeChainWithGlobalCaching("get3PIcon",i=>t.getLogoAsDataUriAsync(fr(i)).then(t=>n.toIcon(t,"get3PIcon.toIcon",lr())),n=>n+t.displayName)}function hu(t,i=32,r=32,u=1.5){let f=n.getDomain(t).replace("www.",""),e=n.generateKeyFromDomain(f);return"https://th.bing.com/th?id=ODF."+e+"&pid=Api&w="+i+"&h="+r+"&dpr="+u}function b(){return cu()&&hc()}function cu(){return n.isBingEnabled()&&n.RuntimeConfig.AlwaysWide&&n.config.enableDynamicSearchBox&&n.Host.isDSBEnabledByClient()}function hc(){const t=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();return t!=1||lu()}function lu(){return n.AccessTokenManager.getWindowsAccountType()==1&&(i()||au())}function au(){return n.AccessTokenManager.getWindowsAccountType()==1&&!n.Host.isFirstPartySearchDisabled()&&(!i()&&(n.config.msbDsbEnableCustomerDsbWhenMsbDisabled||(n.msbDsbHost===null||n.msbDsbHost===void 0?void 0:n.msbDsbHost.isOffWorkHourDisabledAad())||(n.msbDsbHost===null||n.msbDsbHost===void 0?void 0:n.msbDsbHost.isInDiscoverMode()))||i()&&(n.msbDsbHost===null||n.msbDsbHost===void 0?void 0:n.msbDsbHost.isInBlendedMode()))}function i(){const t=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();return t===1&&(n.msbDsbHost===null||n.msbDsbHost===void 0?void 0:n.msbDsbHost.isEnabled())}function cc(){return n.config.useCobaltCSS&&n.config.msbDsbGleamWin11Rotation?v():vu()}function vu(){return!n.config.useCobaltCSS&&SearchAppWrapper.CortanaApp.entryPoint=="WNSDSB"||n.config.useCobaltCSS&&v()}function lc(){return!n.isBingEnabled()||(n.Host===null||n.Host===void 0?void 0:n.Host.isFirstPartySearchDisabled())}function v(){return SearchAppWrapper.CortanaApp.entryPoint==="WNSTBD"||SearchAppWrapper.CortanaApp.entryPoint==="WNSGBC"||SearchAppWrapper.CortanaApp.entryPoint==="WNSGBM"||SearchAppWrapper.CortanaApp.entryPoint==="WNSGBK"}function yu(){const t=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();let r=n.config.enableWin11SSH&&t!==1&&n.isSearchPointsOfFlexibilityEnabled()&&!n.Host.getPofLaunchUrlExist()&&!v();return(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.showDSBAlways)||n.config.undocked&&!r||SearchAppWrapper.CortanaApp.entryPoint=="WNSDSB"||SearchAppWrapper.CortanaApp.entryPoint=="WNSGLY"||SearchAppWrapper.CortanaApp.entryPoint=="WNSPBS"||SearchAppWrapper.CortanaApp.entryPoint=="WNSALS"||SearchAppWrapper.CortanaApp.entryPoint=="WNSSTB"||SearchAppWrapper.CortanaApp.entryPoint=="WNSPTP"||SearchAppWrapper.CortanaApp.entryPoint=="WNSKBS"||n.config.enableDSBSearchBox&&SearchAppWrapper.CortanaApp.entryPoint=="WNSBOX"&&!i()||rf()&&SearchAppWrapper.CortanaApp.entryPoint=="WNSBOX"&&!i()||SearchAppWrapper.CortanaApp.entryPoint=="WBQRPL"}function u(t){return t?t.isSearchHomeZI&&t.scope==n.Scope.All:n.RuntimeConfig.SearchHomeAvailable==1}function ri(n){return k(n)}function ui(n){return k(n)}function pu(t){return(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.features.isEnterpriseScopeEnabled())&&!(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.features.isEduScopeApplicable())&&(k(t)||n.config.msbWorkSearchMruInShDsbEnabled&&u(t))}function wu(t){return n.config.msbWorkScopeZiPageMruEnabled&&k(t)}function ac(t){return bu(t)&&n.config.curatedSuggestionInWorkScopeEnabled&&(wu(t)||pu(t))}function k(t,i){return(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.features.isWorkScopeZiPageContentEnabled())&&((t===null||t===void 0?void 0:t.isWorkScopeZI)||i)&&n.config.msbDsbEnabled}function vc(t){return n.config.msbWorkScopeFreZiPageContentEnabled&&(ui(t)||ri(t))}function yc(t){return n.config.msbDsbGleamToWorkScopeEnabled&&(t||kc())&&!fi()}function fi(){return n.config.msbDsbNoGleamRedirect||(n.msbDsbHost===null||n.msbDsbHost===void 0?void 0:n.msbDsbHost.isOffWorkHourDisabledAad())||(n.msbDsbHost===null||n.msbDsbHost===void 0?void 0:n.msbDsbHost.isInBlendedMode())||(n.msbDsbHost===null||n.msbDsbHost===void 0?void 0:n.msbDsbHost.isInDiscoverMode())}function pc(n){return n&&fi()}function wc(){return(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.isTenantMsbEnabled())&&!(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.isEduTenant())}function bc(t){return!n.config.msbDsbNoGleamRedirect&&n.config.msbDsbGleamRotation&&(t||cc())&&(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.isTenantMsbEnabled())&&!(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.isEduTenant())}function kc(){return vu()&&(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.isTenantMsbEnabled())&&!(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.isEduTenant())}function h(t){return(u(t)||ri(t)||ht(t))&&b()&&(yu()||ht(t))&&(n.dsbManager===null||n.dsbManager===void 0?void 0:n.dsbManager.hasContent())&&!gr()}function dc(t){return n.config.enableWin11SSH&&t.isSearchHomeZI?!1:y(t)&&n.config.undocked&&n.RuntimeConfig.AlwaysWide}function bu(t){return(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.disableCuratedSuggestion)?!1:(y(t)||h(t))&&!c(t)}function c(t){return du()&&u(t)&&b()&&ku()&&!i()&&!(n.msbDsbSwitchHost===null||n.msbDsbSwitchHost===void 0?void 0:n.msbDsbSwitchHost.shouldShow())&&(n.dsbManager===null||n.dsbManager===void 0?void 0:n.dsbManager.hasContent(!0))&&n.isBrowserOnline()&&!ht(t)}function ku(){if(n.config.enableWin11SSH){const t=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();return n.isSearchPointsOfFlexibilityEnabled()&&v()&&t!==1}return n.config.enableDSBWin11FullWidth?v()||SearchAppWrapper.CortanaApp.entryPoint=="WNSHID":SearchAppWrapper.CortanaApp.entryPoint=="WNSDSB"||SearchAppWrapper.CortanaApp.entryPoint=="WNSHID"}function du(){return n.config.enableDSBFullWidthIter2&&n.isDSBV2EnabledMarket()}function gc(){return b()||n.config.transparentMiniserp}function ft(n){return!ei()||y(n)&&!h(n)}function y(n){return(u(n)||ui(n))&&!h(n)&&ei()}function ei(){return n.config.enableTwoPanesZI&&n.RuntimeConfig.AlwaysWide||n.config.wsbWithCopilotQF}function oi(t){if(n.Host.getJupiterProviderEnabled()&&n.isSetting(t.type)){let n=t;return o(n.match)?{type:t.type,handoffType:t.handoffType,hc:t.hc,highConfidenceMetaSuggestionScore:t.highConfidenceMetaSuggestionScore,prefetchConfidenceScore:t.prefetchConfidenceScore,suggestionKey:g(t)}:{type:t.type,handoffType:t.handoffType,hc:t.hc,highConfidenceMetaSuggestionScore:t.highConfidenceMetaSuggestionScore,prefetchConfidenceScore:t.prefetchConfidenceScore,suggestionKey:g(t),relevance:n.relevance,match:n.match,previewMetadata:ii(n.previewMetadata)}}return{type:t.type,handoffType:t.handoffType,hc:t.hc,highConfidenceMetaSuggestionScore:t.highConfidenceMetaSuggestionScore,prefetchConfidenceScore:t.prefetchConfidenceScore,suggestionKey:g(t)}}function et(t){if(n.config.enableMruProviderInQF&&(n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())===3){let n=t===null||t===void 0?void 0:t.childSuggestions;return n&&n.forEach(n=>n.parent=null),Object.assign(Object.assign({},oi(t)),{query:t.query,textWithoutHH:HitHighlightingParser.removeMarkers(t.text),icon:t.getIcon?null:t.icon,subType:t===null||t===void 0?void 0:t.subType,additionalInfoText:t===null||t===void 0?void 0:t.additionalInfoText,isAnswer:t===null||t===void 0?void 0:t.isAnswer,mayContainPII:t===null||t===void 0?void 0:t.mayContainPII,previewPaneType:t===null||t===void 0?void 0:t.previewPaneType,primaryMetadata:t===null||t===void 0?void 0:t.primaryMetadata,secondaryIcon:t===null||t===void 0?void 0:t.secondaryIcon,segments:t===null||t===void 0?void 0:t.segments,narratorText:t===null||t===void 0?void 0:t.narratorText,template:t===null||t===void 0?void 0:t.template,childSuggestionsInJsonString:JSON.stringify(t===null||t===void 0?void 0:t.childSuggestions)})}return Object.assign(Object.assign({},oi(t)),{query:t.query,textWithoutHH:HitHighlightingParser.removeMarkers(t.text),icon:t.getIcon?null:t.icon})}function nl(n,t){var i,r,u;return Object.assign(Object.assign({},et(n)),{title:n.primaryMetadata,url:t,sourceAppDisplayName:(r=(i=n===null||n===void 0?void 0:n.sourceApp)===null||i===void 0?void 0:i.displayName)!==null&&r!==void 0?r:"",previewPaneUrl:(u=n===null||n===void 0?void 0:n.previewPaneUrl)!==null&&u!==void 0?u:""})}function tl(t){if(n.msbHost!==null&&n.msbHost!==void 0)return n.msbHost.features.isQwsDocSrcEnabled(t)}function gu(t){return(t===null||t===void 0?void 0:t.scope)==n.Scope.All||(t===null||t===void 0?void 0:t.scope)==n.Scope.Work}function il(){return ct().getSelectedAccountId()!=null&&(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.isMsbInternalTenant())&&d()}function d(){if(n.msbHost!==null&&n.msbHost!==void 0)return n.msbHost.shouldForceEnterprise()}function rl(t){return(t===null||t===void 0?void 0:t.isSearchHomeZI)&&(t===null||t===void 0?void 0:t.scope)==n.Scope.People}function nf(n){return n&&{authority:n.accountProviderAuthority,providerId:n.accountProviderId,state:n.accountState,isDefault:n.isDefaultAccount}}function ul(n){return JSON.stringify(nf(n))}function fl(n){return JSON.stringify(n&&n.map(n=>nf(n)))}function el(t,i,r,u,f){n.config.enableBackgroundTaskLogging&&n.safeExecute(()=>{SearchAppWrapper.CortanaApp.logMeasure(t,0,i,JSON.stringify(u?u:{}),f?f:"")},r)}function ol(){let t=n.Host.getWindowsTheme();return t==2}function sl(n,t){var i,r,u,f;if(n.length!==0){let e=n.filter(n=>n.type=="SPP");if(e.length!==0){let o=n.concat(t);for(let t of e){let e=(i=t===null||t===void 0?void 0:t.packageFamilyName)===null||i===void 0?void 0:i.toLowerCase();if(e)for(let t=0;t<o.length;t++){let i=(r=lt(o[t]))===null||r===void 0?void 0:r.toLowerCase();if(i&&e.startsWith(i)){for(let t=n.length-1;t>=0;t--)if(n[t].type=="SPP"){let i=(f=(u=n[t])===null||u===void 0?void 0:u.packageFamilyName)===null||f===void 0?void 0:f.toLowerCase();if(i===e){n.splice(t,1);break}}break}}}}}}function hl(t,i,r,u,f){let o=i.filter(t=>t.type!="SW"&&n.contains(u,l(t))&&!n.contains(f,t.type)),s=r.filter(t=>t.type!="SW"&&n.contains(u,l(t))&&!n.contains(f,t.type)),e=n.config.searchTheWebMaxSuggestionsCount;if(n.config.enableProgressiveSearchTheWebMaxSuggestions&&t)switch(t.queryToFetch.length){case 0:case 1:case 2:case 3:break;case 4:e+=1;break;case 5:e+=2;break;case 6:e+=4;break;case 7:e+=6;break;default:e=25}if(o.length>=e){s.map(n=>n.suppressed=!0);let n=0;o.forEach(t=>t.suppressed=n++>=e)}else{let t=1,n=e-o.length;n>0&&s.filter(()=>t++>=n).map(n=>n.suppressed=!0)}}function tf(n,t,i){if(!n||!t||!i||i.length==0)return!1;const r=i.findIndex(i=>{const r=i.toLowerCase().split(":");if(r.length!==2||!r[0]||!r[1])return!1;const[u,f]=r;return t.toLowerCase().startsWith(u)&&n.toLowerCase()===f});return r!==-1}function cl(n,t,i){const r=document.querySelector(n);r&&(r===document.activeElement?r.removeAttribute(t):r.setAttribute(t,i))}function ll(t,i,r){if(n.config.enableScopeHoverTooltip){const n=document.querySelector(t);n&&(n.matches(":hover")?n.removeAttribute(i):n.setAttribute(i,r))}}function f(){return r||(r=SearchAppWrapper.CortanaApp.regionalPolicies),si||(si={isThirdPartyWebSearchSupported:r.isThirdPartyWebSearchSupported,isThirdPartyZeroInputSupported:r.isThirdPartyZeroInputSupported,shouldSearchLaunchToMRUThirdPartyScope:r.shouldSearchLaunchToMRUThirdPartyScope,isFirstPartyZeroInputSupported:r.isFirstPartyZeroInputSupported,areRecentWebSearchesAllowedInFirstPartyZeroInput:r.areRecentWebSearchesAllowedInFirstPartyZeroInput,isFirstPartyTaskbarGleamSupported:r.isFirstPartyTaskbarGleamSupported,isThirdPartyTaskbarGleamSupported:r.isThirdPartyTaskbarGleamSupported}),si}function ot(){return(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(40979072))&&f().isThirdPartyWebSearchSupported}function al(){return(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(40979072))&&f().isThirdPartyZeroInputSupported}function vl(){return(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(40979072))&&f().shouldSearchLaunchToMRUThirdPartyScope}function yl(){return(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(40979072))&&!f().areRecentWebSearchesAllowedInFirstPartyZeroInput}function rf(){return(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(40979072))&&!f().isFirstPartyTaskbarGleamSupported}function pl(){return(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(54865932))&&f().isThirdPartyWebSearchSupported}function uf(){return!!n.config.enableDMAWebInAllScope&&(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(56097011))&&f().isThirdPartyWebSearchSupported}function wl(t){return t?!!n.config.enableCoPilotPoweredLocalFileProvider&&(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(52754209)):n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(52754209)}function bl(t){return t?!!n.config.enableCoPilotPoweredCloudFileProvider&&(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(51742149)):n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(51742149)}function kl(){const t=n.config.documentAboveWebByDefault,i=(tf(n.Host.getRegion(),n.Host.getLanguage(),n.config.documentGroupAboveWebLanguageRegionPairs)||hi(n.Host.getLanguage(),n.config.documentAboveWebEnabledLanguages))&&(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(45075103)),r=n.config.documentAboveWebNonEn&&!hi(n.Host.getLanguage(),n.config.documentAboveWebDisabledLanguages)&&(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(45721604));return t||i||r}function ff(n,t){return ThresholdUtilities.createPromise(i=>{var r;t!=null&&t.url||i({statusCode:0});const u=(r=t.requestType)!==null&&r!==void 0?r:t.body?"POST":"GET",f=u==="GET"?undefined:t.body||"";fetch(t.url,{method:u,body:f,headers:t.headers}).then(r=>{if(r.ok&&r.status===200){const u={statusCode:r.status,readAsStringAsync:()=>ThresholdUtilities.createPromise(i=>r.json().then(n=>{if(typeof n=="object")i(JSON.stringify(n));else{i(null);throw new Error("Response is not in JSON format");}}).catch(u=>{i(null)})),readAsStreamAsync:()=>ThresholdUtilities.createPromise(n=>r.blob().then(t=>n(t)))};i(u)}else i(Object.assign(Object.assign({},r),{statusCode:r.status}))}).catch(r=>{i({statusCode:400})})})}function dl(){return n.isSearchPointsOfFlexibilityEnabled()&&(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(47251916))&&f().isThirdPartyTaskbarGleamSupported}function gl(){if(n.VelocityKeys!==null&&n.VelocityKeys!==void 0)return n.VelocityKeys.isFeatureEnabled(43283005)}function na(){return document.querySelector(".selected.removeIcon")!==null}function ta(){if(!n.config.enableCodexScope)return!1;const t=n.AccessTokenManager.getWindowsAccountType();return t!==1||!(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.isEduTenant())}function ra(){return ia}function ua(){return n.config.useCobaltCSS&&n.RuntimeConfig.AlwaysWide}function fa(t){return n.config.enableCopilotHistoryInMRU&&(t?t===null||t===void 0?void 0:t.isSearchHomeZI:!0)&&n.AccessTokenManager.getWindowsAccountType()==2}function ea(){const t=localStorage.getItem(n.OptionHoverLocalStorageKey);return t===null||JSON.parse(t)}function ef(){const t=localStorage.getItem(n.OptionCopilotLocalStorageKey);return t===null&&n.config.wsbWithCopilot||JSON.parse(t)}function sf(){const t=localStorage.getItem(n.OptionPersonalizationStorageKey);return t===null&&n.config.wsbWithCopilot||JSON.parse(t)}function oa(){return(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.isPOFEnabled)&&!(n.isSearchShowOnHoverAllowedSettingEnabled===null||n.isSearchShowOnHoverAllowedSettingEnabled===void 0?void 0:n.isSearchShowOnHoverAllowedSettingEnabled())?n.config.optionsToggleDrop:n.config.optionsToggleDrop&&(n.isSearchPointsOfFlexibilityEnabled===null||n.isSearchPointsOfFlexibilityEnabled===void 0?void 0:n.isSearchPointsOfFlexibilityEnabled())&&!(n.isSearchShowOnHoverAllowedSettingEnabled===null||n.isSearchShowOnHoverAllowedSettingEnabled===void 0?void 0:n.isSearchShowOnHoverAllowedSettingEnabled())}function sa(t){t&&!n.TestHookUrlParameters&&(n.config.useCobaltCSS||t!==st.RunAsAdmin&&t!==st.RunAsAdminPreviewPane||SearchAppWrapper.CortanaApp.dismissApp())}function ha(){return(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.isDMA)?!0:ot()}function ht(t){if(!t)return!1;const i=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();return(t===null||t===void 0?void 0:t.isWebScopeZI)&&n.config.enableZIWebScopeMruDsb&&i!==1}function ca(t){return t.includes(n.removeIconWebSearchTitleSubstr)?n.Host.getLocString("DeleteWebSearchSuggestionItem"):n.Host.getLocString("DeleteSelectedSuggestionItem",t)}function hi(n,t){if(!n||!t||t.length==0)return!1;const i=t.findIndex(t=>n.toLowerCase().startsWith(t));return i!==-1}function la(n){return/[\u0600-\u06FF\u0750-\u077F\u0590-\u05FF\u08A0-\u08FF]/.test(n)}function aa(n,t){let i=t?Object.keys(t):[];return i.length>0&&(n+=n.includes("?")?"&":"?",n+=i.map(n=>n+"="+t[n]).join("&")),n}function ci(){return n.config.bingLogToBing}function li(){return n.config.windowsLogToWindows||n.Host.getDataComplianceDefaultEnabledBuild()}function ai(){return n.config.windowsAndBingLogToBing}function va(){return n.config.uploadBingClickToWindows}function vi(t,i,r,u,f,e){n.Host.getSplitDataUploadEndpointEnabled()?(ai()?SharedLogHelper.LogError(t,i,r,u,f):ci()&&e==="BingTelemetry"&&SharedLogHelper.LogError(t,i,r),li()&&e==="WindowsTelemetry"&&SharedLogHelper.LogError(t,i,r,u,f,cf)):SharedLogHelper.LogError(t,i,r,u,f)}function ya(t,i,r,u){n.Host.getSplitDataUploadEndpointEnabled()?(ai()?SharedLogHelper.LogWarning(t,i,r):ci()&&u==="BingTelemetry"&&SharedLogHelper.LogWarning(t,i,r),li()&&u==="WindowsTelemetry"&&SharedLogHelper.LogWarning(t,i,r,cf)):SharedLogHelper.LogWarning(t,i,r)}function pa(){if(n.VelocityKeys!==null&&n.VelocityKeys!==void 0)return n.VelocityKeys.isFeatureEnabled(56242355)}function wa(n){return n.type=="SW"||n.type=="PWL"}let yi,pi;n.OptionHoverLocalStorageKey="isOptionDisplayHoverSelected";n.OptionCopilotLocalStorageKey="isCopilotUIEnabled";n.OptionPersonalizationStorageKey="isPersonalizationEnabled";n.removeIconWebSearchTitleSubstr=", See more search results";n.DataComplianceSchemaVersion_1_0="1.0";n.DataComplianceEventNameSeparator="_";n.DataComplianceTypeDefaultEmptyValue="Empty";n.setWSBCommonResources=lf;n.getAccessTokenManager=ct;n.getPage=af;n.sameGroup=vf;n.mapOSFormCode=yf;let wi;(function(t){t.KValues=(()=>{let n={};return n.GPT=108,n.GT=109,n.GW=110,n.SW=114,n.PWL=115,n.STS=116,n.SBI=117,n.SBV=118,n.SDSC=119,n.SDIO=120,n.IMIO=121,n.COFA=122,n.IMIP=123,n.COOA=124,n.IMDN=125,n.SDFE=126,n.OWA=128,n.OMSS=129,n.OMIO=130,n.OMTS=131,n.OMAC=133,n.OMVA=135,n.SSTS=136,n.AFOT=137,n.SNSC=138,n.RWBD=139,n.RWBN=140,n.EUP=142,n.RWBG=145,n.QSCH=146,n.SKU=148,n.SNSP=149,n.SNST=150,n.APPA=152,n.OMZI=153,n.FB=154,n.MSBA=155,n.ANA=156,n.APB=157,n.MMB=158,n.OMB=159,n.CB=161,n.EDUR=162,n.EDBU=164,n.ORB=165,n.QWQS=166,n.VFO=167,n.CCBL=168,n.CCBR=169,n.RSBK=170,n.RSBU=171,n.RSBD=172,n.COD=173,n.WSNR=174,n.TSO=175,n.CP=176,n})();t.HandoffsForNonSuggestions=(()=>{let n={};return n.GPT=2,n.GT=3,n.GW=0,n.SDSC=2,n.SDIO=2,n.IMIO=2,n.COFA=2,n.COOA=2,n.SNSP=19,n.SNST=19,n.APPA=997,n.OMZI=997,n.FB=997,n.MSBA=2,n.APB=997,n.MMB=997,n.OMB=997,n.CB=997,n.CCBL=19,n.CCBR=19,n.RSBK=19,n.RSBU=19,n.RSBD=19,n})();t.HandoffsForDSBScenarios=(()=>{let n={};return n.ExploreMore=0,n.OnThisDay=0,n.QuoteOfTheDay=0,n.WordOfTheDay=0,n.WholePageTabs=0,n.HeroCardOfTheDay=0,n.RelatedLocal=19,n.RelatedLocal_Hero=0,n.RelatedLocal_CTA=0,n.RelatedShopping_Hero=20,n.RelatedShopping_CTA=20,n.Rewards=0,n.TrendingImages=13,n.TrendingSearch=0,n.TrendingVideos=0,n.ShortVideos=0,n.PersonalizedRecipes=20,n.RelatedRecipe=0,n.KC_HeroCard=0,n.PersonalizedSports=20,n.DSBServerSide=0,n})();t.GroupsForNonSuggestions=(()=>{let t={};return t.GPT=n.GroupType.GroupHeader,t.GT=n.GroupType.GroupHeader,t.GW=n.GroupType.GroupHeader,t.SDSC=n.GroupType.Settings,t.SDIO=n.GroupType.Settings,t.IMIO=n.GroupType.Settings,t.COFA=n.GroupType.Settings,t.COOA=n.GroupType.Settings,t.SNSP=n.GroupType.VisualSearch,t.SNST=n.GroupType.VisualSearch,t.MSBA=n.GroupType.Upsell,t})()})(wi=n.SyntheticQSCodesMaps||(n.SyntheticQSCodesMaps={}));let pf;(function(n){n[n.Open=1]="Open";n[n.RunAs=2]="RunAs";n[n.RunAsUser=3]="RunAsUser";n[n.OpenInBrowser=4]="OpenInBrowser";n[n.OpenFileLocation=5]="OpenFileLocation";n[n.OpenContaining=6]="OpenContaining";n[n.TabletMode_OpenNewWindow=7]="TabletMode_OpenNewWindow";n[n.PinToStartScreen=8]="PinToStartScreen";n[n.StartUnpin=9]="StartUnpin";n[n.TaskbarUnpin=10]="TaskbarUnpin";n[n.StartPin=11]="StartPin";n[n.TaskbarPin=12]="TaskbarPin";n[n.Manage=13]="Manage";n[n.ConnectNetworkDrive=14]="ConnectNetworkDrive";n[n.DisconnectNetworkDrive=15]="DisconnectNetworkDrive";n[n.Uninstall=16]="Uninstall";n[n["Tile.Uninstall"]=17]="Tile.Uninstall";n[n.ItemProperties=18]="ItemProperties";n[n.Settings=19]="Settings";n[n.Review=20]="Review";n[n.Share=21]="Share";n[n.S_Open=1e3]="S_Open";n[n.S_Install=1001]="S_Install";n[n.S_CopyFullPath=1002]="S_CopyFullPath";n[n.S_SendEmail=1003]="S_SendEmail";n[n.S_SendInstantMessage=1004]="S_SendInstantMessage";n[n.S_CopyPersonDetails=1005]="S_CopyPersonDetails";n[n.S_OpenFileLocationInBrowser=1006]="S_OpenFileLocationInBrowser";n[n.S_OpenInOutlookWeb=1007]="S_OpenInOutlookWeb";n[n.S_LaunchOutlookNative=1008]="S_LaunchOutlookNative";n[n.S_OpenInBrowser=1009]="S_OpenInBrowser";n[n.S_SummarizeWithCopilot=1010]="S_SummarizeWithCopilot";n[n.S_OpenCopilot=1011]="S_OpenCopilot";n[n.S_SendToCopilot=1012]="S_SendToCopilot";n[n.S_SettingsAndTroubleshootingHelp=1013]="S_SettingsAndTroubleshootingHelp";n[n.S_DescribeThisImage=1014]="S_DescribeThisImage"})(pf=n.JumplistActionItemType||(n.JumplistActionItemType={}));n.providerFailureLogName=wf;n.localDataSourceMayContainPII=bf;n.getSuggestionKey=g;n.prefixNormalizedSuggTypes=new Set(["NS","NH","NM","NL","NP"]);const bi={"Microsoft.Windows.ControlPanel":"ControlPanel","Microsoft.AutoGenerated.{923DD477-5846-686B-A659-0FCCD73851A8}":"Classic_{E9C71548-B580-43B2-ACDB-1BA924002754}","{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\\dfrgui.exe":"Classic_{7D13A5DB-6081-48BD-8EA3-A9D7FE67A335}","{6D809377-6AF0-444B-8957-A3773F02200E}\\Windows Defender\\MSASCui.exe":"NameSpace_Classic_{D8559EB9-20C0-410E-BEDA-7ED416AECC2A}","{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\\cleanmgr.exe":"Classic_{AACA901F-E74F-4894-B074-F55059532853}","Microsoft.AutoGenerated.{BB044BFD-25B7-2FAA-22A8-6371A93E0456}":"Classic_{45FDB5DF-1457-4A41-A824-7AD9C75767BC}","Microsoft.Windows.PCSettings.DefaultApps":"AAA_SettingsPageAppsDefaults"},ki={"NameSpace_Classic_{F942C606-0914-47AB-BE56-1321B8035096}":"Classic_{232A1851-808C-4B44-A92A-38E862989CE5",AAA_Proxy_Automatic_Config_Group:"AAA_SettingsPageNetworkProxy",AAA_Settings_DeveloperModeGroup:"AAA_SettingsPageRestoreDeveloperOptions",AAA_SystemSettings_Users_PicturePassword:"AAA_SettingsGroupPicturePassword"};let t;(function(n){n[n.NotDuplicate=0]="NotDuplicate";n[n.NoMetadata=1]="NoMetadata";n[n.MergeMetadata=2]="MergeMetadata"})(t||(t={}));const kf=[["PPL","MPPL"],["MFIL"],["MBKS","MACR","MQNA","MGRP","MBLD"],["MVALL"]],df=[["PPL","MPPL"],["MFIL"],["MBKS"],["MACR"],["MQNA","MGRP","MBLD"],["MVALL"]];n.isDuplicate=ie;n.isDuplicateDocument=re;n.MRUDatabaseName="mruWithIndex";n.MSBMRUDatabaseName="msbMruWithIndex";n.ANADatabaseName="anaWithIndex";n.DataProviderDBName={MRUDataProvider:n.MRUDatabaseName,AnaheimDataProvider:n.ANADatabaseName,MSBMRUDataProvider:n.MSBMRUDatabaseName};n.isFileOrFolderLocalDataSource=ue;n.supportsShortcuts=fe;n.setDocumentLocationProperties=ee;n.isModernSetting=oe;n.getAppItem=nt;n.isGroup=se;n.isWin11DSB=he;n.getItemWithFileMetadata=ce;n.getCommandLineItem=at;n.isMRUHistoryGroupType=le;n.isWorkScopeMruGroupType=ae;n.getGroupType=l;n.isWebSuggestion=ir;n.isSearchHistorySuggestion=rr;n.isWebRelatedSuggestion=ve;n.isJumpListGroup=ur;n.isTopHitChildGroup=ye;n.isChildSuggestion=vt;n.isJumpListSuggestion=pe;n.getScope=we;n.IconSize_GridLayout=92;n.IconSize_GridLayout_Medium=68;n.IconSize_GridLayout_Scaled=130;n.getImageSizeValue=fr;n.populateImageRatio=be;n.getImageUrl=ke;let de={"zh-hans-cn":"zh-cn","zh-hans-sg":"zh-cn","zh-hant-hk":"zh-hk","zh-hant-tw":"zh-tw",ko:"ko-kr",ja:"ja-jp",nb:"nb-no"};n.getCurrentLanguage=yt;n.createSuggestion=er;n.createWebSuggestion=ge;n.addSubItemToSuggestion=no;n.getSyntheticSuggestion=to;n.getNarratorText=or;n.isL2=sr;n.iconIsThumbnail=cr;n.displayedInGridLayout=ro;n.parseWebSuppressionSignals=uo;let tt;n.decodeHtml=fo;let pt;(function(n){n[n.Author=1]="Author";n[n.LastModifiedBy=2]="LastModifiedBy";n[n.Content=3]="Content";n[n.Tags=4]="Tags";n[n.Album=5]="Album";n[n.Artist=6]="Artist";n[n.Genre=7]="Genre";n[n.Location=8]="Location";n[n.Relevance=9]="Relevance";n[n.LastSharedBy=10]="LastSharedBy"})(pt=n.MatchType||(n.MatchType={}));n.createMatch=eo;const oo=/[-[\]{}()*+!<=:?.\/\\^$|#,]/g;n.escapeRegex=e;n.tryGetLocationMatch=so;n.tryGetTextContentMatch=ho;n.matchesOnPropertyHH=co;n.uses3lineTemplate=lo;n.hasReverseHighlighting=ao;n.isEquivalentForPreviewPanePurposes=vo;n.isNullOrUndefined=o;class yo{constructor(t,i,r){this.verb=t.verb;this.displayName=t.displayName;this.executeSync=t.executeSync?()=>r(()=>t.executeSync()):()=>r(()=>{n.Async.safeChain("verb.executeAsync",()=>t.executeAsync(),()=>n.Host.manuallyDismissApp(),null,null,null)});this.isDefault=t.isDefault;this.icon=i;this.getIcon=t.getIcon}}n.DeviceItemVerbWrapper=yo;n.shouldSetThisPcGroupSource=po;n.getGroupSourceDisplayName=wo;n.EdgeAppIds=["MSEdge","Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge"];n.AnaheimAppIds=["MSEdge"];n.SpartanAppId="Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge";n.InternetExplorerId="Microsoft.InternetExplorer.Default";n.DMAConsentAppIds=["shell:RecycleBinFolder"];n.DiscoApps=["explorer.exe"];n.DiscoArgs=["fd63767ce71d1289b1fdef49d5283482"];n.CopilotDisplayName=["Copilot"];n.CMC_URL_PROD="copilot.microsoft.com";n.getRtlAdjustedKey=bo;n.getSearchSuggestionIcon=lr;n.getWebSuggestionAnnotation=ko;n.getSeeWebResultsAnnotationKey=ar;n.msbEnabledForQuery=go;n.isOnlineSuggestionPersonType=vr;n.isOnlineSuggestionMsbFile=yr;n.getMsbTophitSuggestionTypeOrder=ns;n.isMsbOnlineSuggestionType=ts;n.isMsbVerticalOnlineSuggestionType=pr;n.isMsbSubverticalOnlineSuggestionType=wr;n.getMsbSuggestionTypeFromSubverticalOnlineSuggestionType=is;n.isMsbQFSuggestion=a;n.setVisibility=rs;n.setFixHeight=us;n.setWidth=it;n.setAdaptiveWidth=fs;n.isRtl=br;n.FOLDERID_Profile="{5E6C858F-0E22-4760-9AFE-EA3317B67173}";n.FOLDERID_SkyDrive="{A52BBA46-E9E1-435f-B3D9-28DAA648C0F6}";n.FOLDERID_System="{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}";n.FOLDERID_SystemX86="{D65231B0-B2F1-4857-A4CE-A8E7C6EA7D27}";let bt={};n.clearFolderCaches=es;n.getKnownFolderPathLC=rt;let kt={};n.clearPathExpansionCache=os;let ss=/^\{([a-z0-9-]{36})\}(.*)/i;n.resolveKnownFolderGUIDsInPath=dt;n.indexerFilePathToRegularPath=hs;n.enforceOriginalOrder=cs;n.getSubstrateResourceOrScope=ls;n.getProfilePictureResourceOrScope=as;n.getBingResourceOrScope=vs;n.getTweakedSetting=ys;n.shouldSkipSelectedScope=ps;n.canShowSearchHomeUpsell=kr;n.isTextUpsized=ws;n.hasCopilotSettingEnabled=dr;n.hasPersonalizationSettingEnabled=bs;n.canShowSearchHomeAIFeed=gr;n.isCopilotAllowedEntryPoint=gt;n.canShowCopilotGreeting=ks;n.canShowCopilotQF=ds;n.shouldEnableQuickSearches=nu;n.preconditionForEnableQuickSearches=tu;n.shouldEnableAnaheimResetDefault=gs;n.shouldEnableCodexUpsell=nh;n.shouldEnableBingChatString=iu;n.appendBingChatParams=th;n.replaceSearchWithChatPath=ih;n.shouldQFSuggToBingChat=rh;n.searchChatIconClassName=ru;n.setSearchSuggestionChatIcon=uh;n.shouldSHSuggToBingChat=fh;n.shouldEnableSnipSearch=eh;n.canShowQuickSearch=oh;n.canShowQuickSearchWithoutANA=uu;n.shouldUseMsbEnterpriseScopes=sh;n.canShowQuickWorkSearch=hh;n.isAnaheimDataEnabled=s;n.isStoreAppEnabled=ch;n.isRSHEnabled=lh;n.isTSFallbackToANA=!1;n.isTrendingSearchDataEnabled=fu;n.isTSInSearchBoxAvailable=eu;n.isTSInSearchBoxEnabled=ah;n.isTSWin11LeftPaneEnabled=!0;n.isTrendingSearchDataInWin11LeftPaneEnabled=vh;n.placeholdertextNeedUpdate=!1;n.updateTrendingsearchCacheSort=yh;const ou="UserDisableTSInSearchBoxKey";let ut;n.isUserDisableTSInSearchBox=su;n.setUserDisableTSInSearchBox=ph;n.isASWebEnabledOnSearchHome=wh;n.getHistoryCacheKeyForSelectedAccount=bh;n.isRecentWorkSearchEnabled=kh;n.canShowAnaheimWin11ZITopSites=ni;n.canShowAnaheimDataSHListE2E=dh;n.canShowAnaheimDataSHTileE2E=gh;n.canShowAnaheimDataSH=p;n.canShowAnaheimDataQFE2E=nc;n.canShowAnaheimDataQF=ti;n.isEligibleWindowsActivationOsSKU=!1;n.isConsumerWindowsSKU=tc;n.shouldShowTwoColumns=ic;n.currentTabStorageKey="currentTab";n.MeetingDismissedEndDateKey="MeetingDismissedStartDate";n.deepCopy=ii;n.shouldComponentUpdateOverload=rc;n.shouldFuncComponentUpdateOverload=uc;n.shouldFuncComponentUpdateBySomeAttr=fc;n.enableMRUSearchHome=ec;n.getFaviconUrlForRawUrl=oc;n.getDmaSuggestionIcon=sc;n.getThumbnailServerUrl=hu;n.isDynamicSearchContentPossible=b;n.isDynamicSearchContentBaseEnabled=cu;n.isDsbEnabledForEnterprise=lu;n.isConsumerDsbEnabledForEnterprise=au;n.isMsbDsbEnabled=i;n.isWebResultsDisabled=lc;n.isWin11GleamEntryPoint=v;n.isDSBAllowedInEntryPoint=yu;n.isZeroInputAllScope=u;n.canShowMsbDsbInWorkScopeZi=ri;n.canShowMsbSearchHomeInWorkScopeZi=ui;n.canShowWorkSearchMru=pu;n.canShowMruInWorkScopeZi=wu;n.canShowCuratedSuggestionInEnterpriseScope=ac;n.canShowWorkScopeZiPageContent=k;n.canShowWorkFreZiPageContent=vc;n.isWorkScopeDsbGleamRedirect=yc;n.shouldDsbGleamRedirectToAllScope=fi;n.shouldDisplayMsbDsbInWorkScope=pc;n.isWorkScopeDsbGleamRedirectOnHoverAllowed=wc;n.isDsbGleamSwitchToScopeEnabled=bc;n.shouldShowDSBLayout=h;n.canShowCuratedSettings=dc;n.canShowCuratedSuggestions=bu;n.isCurrentDayMainMomentDismissed=!1;n.shouldShowDSBFullWidth=c;n.isDSBFullWidthEntryPoint=ku;n.isDSBFullWidthFlightEnabled=du;n.shouldShowTransparentMiniserp=gc;n.shouldShowZIDataSource=ft;n.shouldShowStaticSearchHome=y;n.isTwoPanesZIEnabled=ei;n.getMruSuggestionData=oi;n.getMruWebSuggestionData=et;n.getMruUrlSuggestionData=nl;n.isDocSourceEnabledInQws=tl;n.isMsbQwsDocsCacheEnabled=gu;n.isMsbInternalTenant=il;n.isMsbEnterprise=d;n.isPeopleScopeZI=rl;n.stringifyISearchWebAccount=ul;n.stringifyISearchWebAccounts=fl;n.logToMC=el;n.isDarkModeEnabled=ol;n.dedupStoreAppsSuggestion=sl;n.limitWebSuggestions=hl;n.isMarketEligible=tf;n.PreviewMetadataContainerId="previewMetadataLocation";n.PreviewMetadataContainer={id:"previewMetadataLocation",selected:!1};n.PreviewAppStore={appStoreOpenOrGet:{id:"previewAppstoreOpenOrGet",selected:!1},expandableTextButton:{id:"expandableTextButton",selected:!1},previewActionOpenButton:{id:"previewActionOpenButton",selected:!1}};n.focusedToolTipHandler=cl;n.hoveredToolTipHandler=ll;let si=undefined,r=undefined;n.isThirdPartySearchAllowed=ot;n.isThirdPartyZeroInputEnabledByRegionalPolicy=al;n.isThirdPartyMRUEnabledByRegionalPolicy=vl;n.isZeroInputRecentsDisabledByRegionalPolicy=yl;n.isBingGleamDisabledByRegionalPolicy=rf;n.isServicingSearchBingAs3PEnabled=pl;n.isSupportWebResultsInAllScopeInDMAEnabled=uf;n.isPolarisSearchEnabled=wl;n.isVegaSearchEnabled=bl;n.isHighPriorityFileProviderEnabled=kl;n.fetchUrlAsync=ff;n.isThirdPartyGleamSupported=dl;n.isSearchDragAndDropEnabled=gl;n.isRemoveIconSelected=na;n.isChatScopeEnabled=ta;const ia=navigator.userAgent;n.getUserAgent=ra;n.isWin11AlwaysWide=ua;n.shouldFetchCopilotHistory=fa;n.getSearchContentLocalStorageItem=ea;n.getCopilotUILocalStorageItem=ef;n.getPersonalizationStorageItem=sf;n.isSearchHoverSettingsEnabled=oa;let st;(function(n){n.RunAsAdmin="RunAs";n.RunAsAdminPreviewPane="pp_RunAs"})(st||(st={}));n.dismissAppWhenRunAsAdmin=sa;n.isDMARegion=ha;n.canEnableDsbWebMruInWebScope=ht;n.getRemoveIconTitleAndAriaLabel=ca;n.Max_WEB_RESULTS=8-n.config.reduceInZI;n.isLanguageEligible=hi;n.isRTLLan=la;n.addQueryParamsToUrl=aa;let hf;(function(n){n.ClientInst="ClientInst";n.Impression="Impression";n.Engaged="Engaged"})(hf=n.LogEventType||(n.LogEventType={}));n.shouldBingLogToBing=ci;n.shouldWindowsLogToWindows=li;n.shouldWindowsAndBingLogToBing=ai;n.shouldBingClickToWindows=va;const cf=(t,i,r)=>{var s=n.Host.getRawImpressionGuid(),h=n.Host.getConversationId(),f,e;let c=n.getCurrentTime();const u={eventType:o(t)?hf.ClientInst:t,type:o(r)?n.DataComplianceTypeDefaultEmptyValue:r,subType:n.DataComplianceTypeDefaultEmptyValue};if(typeof i=="string")u.eventData=i;else for(f in i)f=="Name"?u.subType=o(i[f])?n.DataComplianceTypeDefaultEmptyValue:i[f]:u[f]=i[f];const l=[u.eventType,u.type,u.subType].join(n.DataComplianceEventNameSeparator);e=JSON.stringify(u);SearchAppWrapper.CortanaApp.wsbTelemetry.logEvent(l,n.DataComplianceSchemaVersion_1_0,s,h,c,e,2,16777216,2)};n.LogWSBError=vi;n.LogWSBWarning=ya;n.isWebXTFlightsTelemetry=pa;n.isDefaultSynthetic=wa}(WSB||(WSB={})),function(n){let t;(function(n){n.checking="checking";n.downloading="downloading";n.error="error";n.noUpdate="noupdate";n.obsolete="obsolete";n.updateReady="updateready";n.cached="cached"})(t||(t={}));const i=[t.checking,t.downloading,t.error,t.noUpdate,t.obsolete,t.updateReady],r=[t.noUpdate,t.updateReady,t.cached,t.obsolete,t.error];class u{constructor(n=Date.now){this.getNowTimestamp=n;this._appCacheEventIndex=1;this._superFreshEnabled=!1;this._appCache=_w.applicationCache;this.subscribeForEvents()}instrumentSuperFreshUpdate(n){this._appCacheTimeline||(this._appCacheTimeline=this.createAppCacheTimelineObject());this._appCacheTimeline.SuperFreshUpdateData.T=this.getNowTimestamp();this._appCacheTimeline.SuperFreshUpdateData.S=n;this.sendAppCacheEvents()}registerSuperFresh(){this._superFreshEnabled=!0}subscribeForEvents(){i.forEach((n,t)=>sj_be(this._appCache,n,()=>this.handleAppCacheEvent(n,t)));n.config.monitorAppcacheEvent&&r.forEach(t=>sj_be(this._appCache,t,()=>{n.InstrumentationHelper.logClientInstEvent("ClientInst","AppCacheEvent",n.SequenceNumberManager.getSequenceNumber(),{eventName:t},"WindowsTelemetry",16777216)}))}handleAppCacheEvent(i,r){i!=t.checking&&this._appCacheTimeline||(this._appCacheTimeline=this.createAppCacheTimelineObject());this._appCacheTimeline.AppCacheEvents[r]=this.getNowTimestamp();switch(i){case t.obsolete:n.LogWSBWarning("handleAppCacheEvent",null,"AppCache marked as obsolete and will be deleted","WindowsTelemetry");this.sendAppCacheEvents();break;case t.error:case t.noUpdate:this.sendAppCacheEvents();break;case t.updateReady:this._superFreshEnabled||this.sendAppCacheEvents()}}sendAppCacheEvents(){let r=_G.ServerIG;if(!r){n.LogWSBError("sendAppCacheEvents","Could not instrument as server IG not known",new Error("Could not instrument app cache event"),undefined,undefined,"WindowsTelemetry");return}let t=this._appCacheTimeline;if(t){let u=t.AppCacheEvents,f=[{I:t.EventIndex,E:u,S:t.SuperFreshUpdateData,ABT:n.InstrumentationHelper.getConversationStartTimestamp()}];u[2]&&(f[0].OL=navigator.onLine);let i=n.InstrumentationCommon.createPerfPingEvent(r,f,"AppCache",n.Host.getConversationId());n.InstrumentationHelper===null||n.InstrumentationHelper===void 0?void 0:n.InstrumentationHelper.logEvent(i.EventType,i.Data,n.InstrumentationCommon.QFPERFPING_EVENT_NAME,null,null,i.ImpressionGuid,null,null,null,"WindowsTelemetry",16777216);this._appCacheTimeline=this.createAppCacheTimelineObject()}}createAppCacheTimelineObject(){let n={EventIndex:this._appCacheEventIndex,AppCacheEvents:{},SuperFreshUpdateData:{T:undefined,S:undefined}};return this._appCacheEventIndex++,n}}n.AppCacheInstrumentationHelper=u}(WSB||(WSB={})),function(n){const t=["PP","ST","FL","LM"];class i{constructor(){this._isMobile=SearchAppWrapper.CortanaApp.isMobile}logProfilerMarker(t,i,r,u,f){f||(f={});n.safeExecute(()=>{t==1?SearchAppWrapper.CortanaApp.logMeasure("Bing_QF_"+r,i,"QF",JSON.stringify(f),u):SearchAppWrapper.CortanaApp.logVerboseTrace("Bing_QF_"+r,i,"QF",JSON.stringify(f),u)},"logProfilerMarker")}getEnrichedClientInfoForDSB(){var i,r;let t={},u=(i=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())!==null&&i!==void 0?i:0;if(t.windowsAccount=u.toString(),t.snrVersion=n.config.snrVersion,u===1){const i=n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.getTenantVariants();i&&(t.msbTenantVariants=i)}if(n.config.wsbWebView2){const n=this.getWebView2Info();t.isWebView2=(n===null||n===void 0?void 0:n.isWebView2)?1:undefined;t.webView2Version=((r=n===null||n===void 0?void 0:n.webView2Version)===null||r===void 0?void 0:r.length)>0?n.webView2Version:undefined}return t}getEnrichedClientInfo(t){var r,u,f,e,o;let l=typeof _G=="object"?_G:{};const h=n.getUserAgent();let i={};if(i.entryPoint=SearchAppWrapper.CortanaApp.entryPoint,i.previousExperience=SearchAppWrapper.CortanaApp.queryFormulationView.previousExperience,i.qfMode=""+n.RuntimeConfig.QfMode,i.isSearchHome=(t===null||t===void 0?void 0:t.isSearchHomeZI)?1:undefined,i.isSVCss=n.config.useCobaltCSS?1:undefined,i.region=n.regionCache||undefined,i.lang=n.uiLanguageCache||undefined,i.DC=l.DA||undefined,i.isMobile=this._isMobile?1:0,i.isXbox=h.toLowerCase().includes("xbox one")?1:0,i.isHololens=h.toLowerCase().includes("hololens")?1:0,i.windowsColor=n.Host.getWindowsTheme(),i.appColor=n.Host.getAppTheme(),n.config.useCobaltCSS)i.WideAtStartupDelta=440;else{let t=n.Host.getFeatureDWORD("WideAtStartupDelta");t.validFeature&&typeof t.featureValue=="number"&&(i.WideAtStartupDelta=t.featureValue)}t&&t.scope!=n.Scope.All&&(i.scope=n.Scope[t.scope]);(t===null||t===void 0?void 0:t.fromSuggestionType)&&(i.fromClick={sType:t.fromSuggestionType,searchHome:t.fromSearchHome?1:undefined});i.deviceHistoryEnabled=n.RuntimeConfiguration.DeviceHistoryEnabled?1:0;let s=(r=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())!==null&&r!==void 0?r:0;i.windowsAccount=s.toString();let a=(u=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getMsaAccountsCount())!==null&&u!==void 0?u:0;i.msaAccountsCount=a;let v=(f=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getAadAccountsCount())!==null&&f!==void 0?f:0;if(i.aadAccountsCount=v,n.isAADVerificationRequired&&(i.aadAccountVerificationRequired=1),n.isMsftAccountConnected&&(i.msftAccountConnected=1),n.isSubstrateO365AccountConnected&&(i.o365Connected=1),n.isSubstrateOutlookAccountConnected&&(i.outlookConnected=1),n.Host.hasFallbackHappened()&&(i.fallback=1),n.Host.isClientLocationAvailable()&&(i.clientLocationAvailable=1),n.Host.isInputPanelVisible()&&(i.isInputPaneVisible=1),n.Host.getWindowsTheme()==2&&(i.darkMode=1),SearchAppWrapper.CortanaApp.colorPrevalenceEnabled&&(i.colorPrevalence=1),SearchAppWrapper.CortanaApp.isSearchBoxInTaskbar&&(i.searchBoxInTaskbar=1),SearchAppWrapper.CortanaApp.taskbarOrientation&&(i.taskbarOrientation=SearchAppWrapper.CortanaApp.taskbarOrientation),n.config.enableEdgeMuidsTelemetry&&SearchAppWrapper.CortanaApp.edgeMuids&&(i.edgeMuidCount=n.Host.getEdgeMuidCount(),i.edgeMuidDefault=n.Host.getEdgeMuidDefault(),i.edgeMuids=n.Host.getEdgeMuidsAdditional(2).join(",")),n.config.snrVersion&&(i.snrVersion=n.config.snrVersion),n.osSKUCache&&(i.osSKU=n.osSKUCache.toString()),i.ciVersion=n.ConstraintIndex.currentCIVersion,i.defaultBrowser=n.Host.getDefaultBrowser().toString(),t===null||t===void 0?void 0:t.isSearchHomeZI){const t=n.dsbManager===null||n.dsbManager===void 0?void 0:n.dsbManager.getDynamicSearchBoxContentKeyAtShown();t&&(i.dsbContentKey=t)}if(n.config.enableDynamicSearchBox&&(i.isDSBEnabledByClient=n.Host.isDSBEnabledByClient(),i.isDSBContentPossible=n.isDynamicSearchContentPossible()),n.msbHost&&(i.tenantMsbStatus=n.msbHost.getTenantMsbStatus(),s===1||s===0)){i.msbSyncdocFired=n.msbHost.qfUtils.getClientQfSyncDocEventFired();i.msbClientQfState=n.msbHost.qfUtils.getMsbClientQfState();const t=n.msbHost.qfUtils.getClientQfStatusMessage();t&&(i.msbClientQfStatusMsg=t);const r=n.msbHost.getTenantVariants();r&&(i.msbTenantVariants=r);i.msbClientQfTrieState=n.safeExecute(()=>n.msbHost.qfUtils.getMsbClientQfTrieState(),"getMsbClientQfTrieState");i.workChatEligibility=n.msbHost.getChatEligibility();n.msbDsbHost&&(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.features.isMsbDsbBlendFeatureEnabled())&&(i.msbDBM=n.msbDsbHost.getBlendMode())}((e=n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.getFeatures())===null||e===void 0?void 0:e.length)>0&&(i.vks=n.VelocityKeys.getFeatures());i.isSmallIcons=SearchAppWrapper.CortanaApp.isTrayInSmallIconsMode;const c=SearchAppWrapper.CortanaApp.isTraySearchBoxVisibleOnAnyMonitor;if(c!=undefined&&(i.isSearchBoxVisible=c?1:0),n.config.wsbWebView2){const n=this.getWebView2Info();i.isWebView2=(n===null||n===void 0?void 0:n.isWebView2)?1:undefined;i.webView2Version=((o=n===null||n===void 0?void 0:n.webView2Version)===null||o===void 0?void 0:o.length)>0?n.webView2Version:undefined}if(SearchAppWrapper.CortanaApp.systemInfo){const t=n.Host.getSearchAppMemoryCommitMB();i.searchAppMemoryCommitMB=t>0?t:undefined}return i}getSuggestionsPageName(){return"Page.SmartSearch.AS.Suggestions"}getApplicationName(){return"SmartSearch"}getRankerModelId(){return n.Ranking.suggestionFastRankModelIdCurrent}createNonSuggestionDataSourceObject(t,i){return{T:"D.Url",K:i.getKValue(),Val:t,Ho:n.SyntheticQSCodesMaps.HandoffsForNonSuggestions[t],Gr:n.SyntheticQSCodesMaps.GroupsForNonSuggestions[t],NR:1,Properties:i.getProperties()}}createDataSourceObject(t,i){const f=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();let u=t.mayContainPII&&!n.TestHookUrlParameters;(f===1||f===0)&&(u=!0);const o=(i||t.instItem).getKValue(),s=i&&typeof i.getHandoffType()=="number"?i.getHandoffType():t.handoffType,e=i?i.getQsCode():t.type;let r={T:"D.Url",K:o,Q:u?undefined:t.query,MQ:t.ciMatchedQuery?t.ciMatchedQuery:undefined,Val:e,Ho:s,Ans:t.isAnswer?1:undefined,Gr:n.getGroupType(t),HC:t.hc?1:undefined,RAF:t.useRaf?1:undefined,HS:t.fromHistory?1:undefined,F:t.features.length>0?t.features.join(","):undefined,AC:t.autoCompleteType?t.autoCompleteType:undefined,HCMS:t.highConfidenceMetaSuggestionScore,HCS:t.highConfidenceSuggestionScore,LM:t.suggestionLogMeta,Url:u&&e==="FL"?undefined:t.url,Uri:t.actionUri,Src:t.source,Sg:t.segments,NR:t.notAResult?1:undefined};if(t.deviceItem?r.DeviceSignals=n.safeExecute(()=>this.buildDeviceItemDataSource(u,t),"buildDeviceItemDataSource"):n.isJumpListSuggestion(t)&&(r.DeviceSignals=n.safeExecute(()=>this.buildJumpListItemDataSource(t),"buildJumpListItemDataSource")),n.TestHookUrlParameters){let n=t;n.path&&(r.path=n.path);n.targetPathLC&&(r.targetPath=n.targetPathLC)}return r.RankerSignals=this.buildRankerOutputDataSource(t),r}buildRankerOutputDataSource(n){if(!n.rankingScore&&!n.featureStore)return undefined;return{rankingScore:n.rankingScore,featureStore:n.featureStore,mruSuppressionScore:n.mruSuppressionScore,fbcScore:n.fbcScore,previewPaneScore:n.previewPaneScore}}buildJumpListItemDataSource(t){let r=t.jumpListItem,i={Rank:r.usagePoints||undefined,LAD:n.isValidDate(r.lastAccessed)?r.lastAccessed.toJSON():undefined};if(n.TestHookUrlParameters)i.path=r.path,i.description=t.tooltip;else if(!i.Rank&&!i.LAD)return undefined;return i}getPathCompletionItem(n){return n.type=="PT"?n.deviceItem:null}buildDeviceItemDataSource(t,i){var e;let f=i.deviceItem,r={Rank:f.rankScore};if(((e=f===null||f===void 0?void 0:f.propertyHitsString)===null||e===void 0?void 0:e.length)>0?r.PHits=f.propertyHitsString:f.propertyHits&&f.propertyHits.length>0&&(r.PHits=f.propertyHits.join(",")),t||(r.Id=f.id,r.DName!=i.query&&(r.DName=f.displayName)),n.TestHookUrlParameters&&(r.kind=f.kind),n.isSetting(i.type))return r.MDN=n.isModernSetting(f)?1:0,r;let u=n.getAppItem(i);if(u)return r.LAD=n.isValidDate(u.lastAccessed)?u.lastAccessed.toJSON():undefined,r.AppLnch=u.totalLaunches,r.Args=u.launchArguments?1:0,r.MDN=u.isImmersive?1:0,r.Ext=u.extension,n.TestHookUrlParameters&&(r.CDT=n.isValidDate(u.createdDate)?u.createdDate.toJSON():undefined,r.LMD=n.isValidDate(u.lastModifiedDate)?u.lastModifiedDate.toJSON():undefined,r.launchArguments=u.launchArguments,r.filePath=u.filePath),r;let o=n.getItemWithFileMetadata(i);if(o){r.Ext=o.extension;n.TestHookUrlParameters&&(r.itemTypeDisplayName=o.itemTypeDisplayName);let t=n.getCommandLineItem(i);if(t)return n.TestHookUrlParameters&&(r.launchArguments=t.launchArguments,r.encodedPath=t.encodedPath),r;if(!this.getPathCompletionItem(i)){let t=i.deviceItem;r.CDT=n.isValidDate(t.createdDate)?t.createdDate.toJSON():undefined;r.LMD=n.isValidDate(t.lastModifiedDate)?t.lastModifiedDate.toJSON():undefined;r.Ext=t.extension?t.extension:""}}return r}logMasterPageImpression(t){n.safeExecute(()=>n.config.enableCETOFlightAssignment?ThresholdInst.LogMasterPageImpressions(t,null,t.enrichedClientInfo):ThresholdInst.LogPageImpression(t,null,t.enrichedClientInfo),"logMasterImpressionForClient")}logDataSourceTimeout(i,r){if(SearchAppWrapper.CortanaApp.queryFormulationView.logProviderFailure)for(let u of t)n.isDataSourceEnabled(u,r)&&!n.contains(i,u)&&n.safeExecute(()=>SearchAppWrapper.CortanaApp.queryFormulationView.logProviderFailure(n.providerFailureLogName(u),"NoReturnForTopHit"),"logProviderFailure")}onItemClick(){SearchAppWrapper.CortanaApp.queryFormulationView.resetConversationIdNextTimeQFIsShown&&SearchAppWrapper.CortanaApp.queryFormulationView.resetConversationIdNextTimeQFIsShown()}getWebView2Info(){var t;if(!this._cachedWV2Info){const i=n.getUserAgent(),r=i.includes("IsWebView2/True"),u=r?(t=i.match(/\(WebView2Version (.*)\)/))===null||t===void 0?void 0:t[1]:"";this._cachedWV2Info={isWebView2:r,webView2Version:u}}return this._cachedWV2Info}}n.WSBInstrumentationProvider=i}(WSB||(WSB={}));__rest=this&&this.__rest||function(n,t){var u={},r;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&t.indexOf(i)<0&&(u[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(u[i[r]]=n[i[r]]);return u},function(n){const r="/QF_KEYSTROKE_VIRTUAL_URL?",i="autosuggest";class t{static init(i,r){t._keystrokesInstrumentationData={};t._instrumentationProvider=i;t._clientTelemetry=r;ClientInstConfig.queueDumpInterval=n.config.logQueueDumpInterval;_w.ClTrCo.SharedClickSuppressed=!0;n.Host.bindShown(n=>t._clientShownTimestamp=n);n.Host.bindConversationStart(()=>t.onConversationStart());t._conversationTimeline={RawImpressionGuid:"",ImpressionGuid:"",ConversationId:"",AppVisibleStart:n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,AppVisibleFinish:n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,AppShownStart:n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,AppShownFinish:n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE}}static bindFinalizeKeystroke(n){t._finalizeKeystrokeHandlers.push(n)}static bindKeystrokeTimelineUpdated(n){t._keystrokeTimelineUpdatedHandlers.push(n)}static fireKeystrokeTimelineUpdatedHandlers(n){t._keystrokeTimelineUpdatedHandlers.forEach(t=>t(n))}static getRawImpressionGuid(i){let r=t._keystrokesInstrumentationData[i];return r&&r.RawImpressionGuid?r.RawImpressionGuid:(n.LogWSBError("getRawImpressionGuid","sequenceNumber: "+i+" ConversationID: "+n.Host.getConversationId(),new Error("No instrumentation data/no IG found for sequenceNumber"),undefined,undefined,"WindowsTelemetry"),"")}static getImpressionGuid(n){let i=t._keystrokesInstrumentationData[n];if(i&&i.ImpressionGuid)return i.ImpressionGuid;throw"getImpressionGuid(): No IG for sequence "+n;}static updateSuggestionsList(n,i){t._clientTelemetry&&t._clientTelemetry.updateSuggestionsList(n,i)}static instrumentKeyDown(n){t._keyDownTimeStamp=n}static instrumentFetchProviderBegin(i,r){i>0&&t.safeInstrumentPerf(i,i=>{n.config.perfInstV2&&(i.DataProvidersStarted[r]=t.getOffsettedNow())},"instrumentFetchProviderBegin",null)}static instrumentFetchesBegin(i){t.safeInstrumentPerf(i,i=>{i.DataSourcesFetchBegin=t.getOffsettedNow(),n.config.perfInstV2&&(i.DataProviderFetchStart=t.getOffsettedNow())},"instrumentFetchesBegin",null)}static instrumentFetchesEnd(n){t.safeInstrumentPerf(n,n=>{n.DataSourcesFetchEnd=t.getOffsettedNow()},"instrumentFetchesEnd",null)}static instrumentDataSourceParsed(n,i){t.safeInstrumentPerf(n,n=>{let r=t.getOffsettedNow();typeof n.ResponseParsed[i]!="number"?n.ResponseParsed[i]=r:(n.MultipleResponsesParsed[i]||(n.MultipleResponsesParsed[i]=[n.ResponseParsed[i]]),n.MultipleResponsesParsed[i].push(r))},"instrumentDataSourceParsed",i)}static instrumentItemClickForPreviewPane(i,r,u,f,e,o,s,h,c,l){var a;if(r.getHandoffType()!=999){n.config.enableUserEngagementLog&&(r.getUserEngagementContent().previewPaneHit=!0);let v=t.createBaseCustomGPingPayload(e,o);t.addPreviewPaneDataToGPingPayload(v,s,h,c);t.instrumentItemClickAndGPing(v,i,r,u,f,e);n.isSemanticSearchTelemetryEnabled()&&!n.isNullOrUndefined(l)&&((a=t._clientTelemetry)===null||a===void 0?void 0:a.logPreviewPaneItemClickMeasure(h,l))}}static isContextMenuVerbClickEvent(t){switch(t){case"RemoveFromDeviceHistory":case"RemoveFromDeviceHistoryAll":case n.JumplistActionItemType[n.JumplistActionItemType.StartPin]:case n.JumplistActionItemType[n.JumplistActionItemType.StartUnpin]:case n.JumplistActionItemType[n.JumplistActionItemType.TaskbarPin]:case n.JumplistActionItemType[n.JumplistActionItemType.TaskbarUnpin]:case n.JumplistActionItemType[n.JumplistActionItemType.PinToStartScreen]:case n.JumplistActionItemType[n.JumplistActionItemType.S_CopyFullPath]:case n.JumplistActionItemType[n.JumplistActionItemType.S_CopyPersonDetails]:return!1;default:return!0}}static instrumentItemClickForContextMenu(n,i,r,u,f,e,o){if(i.getHandoffType()!=999)if(this.isContextMenuVerbClickEvent(o)){let s=t.createBaseCustomGPingPayload(f,e);t.addContextMenuDataToGPingPayload(s,o);t.instrumentItemClickAndGPing(s,n,i,r,u,f)}else t.instrumentLayoutItemSelect(i,r)}static instrumentItemClick(n,i,r,u,f,e){let o=i.getHandoffType();if(o!=999)if(o==998||o==997)t.instrumentLayoutItemSelect(i,r);else{let o=t.createBaseCustomGPingPayload(f,e);if(i.getProperties()){let n=i.getProperties();t.addExtraPropsToGPingPayload(o,n)}t.instrumentItemClickAndGPing(o,n,i,r,u,f)}}static instrumentItemClickAndGPing(i,r,u,f,e,o){var s,h,c,l;if(!n.config.disableWSBServerTelemetry||!n.isThirdPartySearchAllowed())if(n.Host.getSplitDataUploadEndpointEnabled()){let a="BingData";if(u===null||u===void 0?void 0:u.getProperties()){let n=u.getProperties();n.DataType&&n.DataType.trim()!==""&&(a=n.DataType)}let o=t._keystrokesInstrumentationData[f];if(o?(o.RenderingStarted||t.updatePageIG(f),_G.IG!=o.ImpressionGuid&&n.LogWSBError("instrumentItemClick","IG ("+o.ImpressionGuid+") for sequenceNumber "+f+" does not match the page IG ("+_G.IG+")",new Error("IG for sequence number does not match the currently rendered page's IG (_G.IG)"),undefined,undefined,"WindowsTelemetry")):n.LogWSBError("instrumentItemClick","sequenceNumber: "+f+" ConversationID: "+n.Host.getConversationId(),new Error("No instrumentation data found for sequenceNumber"),undefined,undefined,"WindowsTelemetry"),n.shouldWindowsAndBingLogToBing()?t.sendCustomGPing(i,u.getHValue(),r):n.shouldBingLogToBing()&&n.config.splitWindowsDataInstrumentation&&a==="BingData"&&t.sendCustomGPing(i,u.getHValue(),r),n.shouldWindowsLogToWindows()&&n.config.splitWindowsDataInstrumentation&&a==="WindowsData"||n.shouldBingClickToWindows()&&n.config.splitWindowsDataInstrumentation&&a=="BingData"){c=n.Host.getConversationId();let{}=i,f=__rest(i,["DataType"]);const t={eventType:n.LogEventType.Engaged,type:"Click",subType:n.DataComplianceTypeDefaultEmptyValue,AppNS:u.getAppNS(),K:u.getLayoutKValue(),Properties:JSON.stringify(f)},e=JSON.stringify(t),a=[t.eventType,t.type,t.subType].join(n.DataComplianceEventNameSeparator);((h=(s=SearchAppWrapper===null||SearchAppWrapper===void 0?void 0:SearchAppWrapper.CortanaApp)===null||s===void 0?void 0:s.wsbTelemetry)===null||h===void 0?void 0:h.logEvent)?SearchAppWrapper.CortanaApp.wsbTelemetry.logEvent(a,n.DataComplianceSchemaVersion_1_0,o.ImpressionGuid,c,r,e,4,33554432,2):n.LogWSBWarning("instrumentItemClickAndGPing",null,"Machine doesn't support logEvent function","WindowsTelemetry");_w.ThresholdUtilities&&(l=_w.ThresholdUtilities,l.uploadApiTimes("PCE",t=>{var u,f;const i={eventType:n.LogEventType.ClientInst,type:"CPT2",subType:"Empty",wt:JSON.stringify(t)},e=JSON.stringify(i),s=[i.eventType,i.type,i.subType].join(n.DataComplianceEventNameSeparator);((f=(u=SearchAppWrapper===null||SearchAppWrapper===void 0?void 0:SearchAppWrapper.CortanaApp)===null||u===void 0?void 0:u.wsbTelemetry)===null||f===void 0?void 0:f.logEvent)&&SearchAppWrapper.CortanaApp.wsbTelemetry.logEvent(s,n.DataComplianceSchemaVersion_1_0,o.ImpressionGuid,c,r,e,4,33554432,2)}))}t.finalizeKeystrokeLog(f,1);e&&e();t._instrumentationProvider.onItemClick();n.config.forceLogFlush?Log2.ForceFlush():Log2.FlushMainQueueDontForce();_w.clickFlushedTime=sb_gt()}else{t.sendCustomGPing(i,u.getHValue(),r);let s=t._keystrokesInstrumentationData[f];s?(s.RenderingStarted||t.updatePageIG(f),_G.IG!=s.ImpressionGuid&&n.LogWSBError("instrumentItemClick","IG ("+s.ImpressionGuid+") for sequenceNumber "+f+" does not match the page IG ("+_G.IG+")",new Error("IG for sequence number does not match the currently rendered page's IG (_G.IG)"),undefined,undefined,"WindowsTelemetry"),t._clientTelemetry&&t._clientTelemetry.logItemClickedMeasure(s.ConversationId,s.RawImpressionGuid,u,o)):n.LogWSBError("instrumentItemClick","sequenceNumber: "+f+" ConversationID: "+n.Host.getConversationId(),new Error("No instrumentation data found for sequenceNumber"),undefined,undefined,"WindowsTelemetry");t.finalizeKeystrokeLog(f,1);e&&e();t._instrumentationProvider.onItemClick();n.config.forceLogFlush?Log2.ForceFlush():Log2.FlushMainQueueDontForce();_w.clickFlushedTime=sb_gt()}}static instrumentLayoutItemSelect(n,i){let r={AppNS:n.getAppNS(),K:n.getLayoutKValue()};t.logClientInstEvent("Select","ItemClicked",i,r,"WindowsTelemetry",33554432)}static instrumentDSBChevronSelect(i){let r={scenario:i};t.logClientInstEvent("Select","DSBMegaChevronClicked",n.SequenceNumberManager.getSequenceNumber(),r,"BingTelemetry")}static instrumentDSBChevronDirection(i,r){let u={scenario:i,direction:r};t.logClientInstEvent("Select","DSBMegaChevronDirectionClicked",n.SequenceNumberManager.getSequenceNumber(),u,"BingTelemetry")}static instrumentPerfEvent(i,r,u){n.config.logClientPerf&&t.safeInstrumentPerf(i,n=>{t._instrumentationProvider.logProfilerMarker(1,0,r,n.RawImpressionGuid,{d:u})},"instrumentPerfEvent")}static instrumentAggregateFunctionPerf(i,r){n.config.logClientPerf&&t._clientTelemetry.logAggregateFunctionPerf(i,r)}static instrumentDeviceQueryBegin(n){t._instrumentationProvider.logProfilerMarker(1,0,"StartDeviceQuery",n,{})}static createBaseCustomGPingPayload(n,i){let r={};switch(n){case 1:r.i="k";r.mk=t.getModifierKeyCodes(i);break;case 3:r.i="t";break;case 4:r.i="p";break;case 5:r.i="n";break;case 6:r.i="b";break;case 0:r.i="x";r.mk=t.getModifierKeyCodes(i);break;default:r.mk=t.getModifierKeyCodes(i)}return r}static addContextMenuDataToGPingPayload(n,t){n.cm=t}static addExtraPropsToGPingPayload(n,t){Object.keys(t).forEach(i=>{n[i]=t[i]})}static addPreviewPaneDataToGPingPayload(n,t,i,r){t&&(n.pp=t,i&&(n.ppit=i),typeof r=="number"&&(n.rho=r))}static sendCustomGPing(t,i,r){let u=i;n.isEmpty(t)||(u+="&PR="+JSON.stringify(t));n.safeExecute(()=>_w.si_T(u,null,null,0,r),"logCustomGPing")}static getModifierKeyCodes(n){if(n){let t=n.altKey?"A":"";if(t+=n.ctrlKey?"C":"",t+=n.shiftKey?"S":"",t)return t}return undefined}static notifyTopHitPreviewPaneOpenedOrInterrupted(i,r){let u=t._keystrokesPerfPingData[i];u&&u.PreviewPanePendingInfo!=null&&(u.PreviewPanePendingInfo.latency=t.getOffsettedNow(),r?u.PreviewPaneOpened=u.PreviewPanePendingInfo:u.PreviewPaneCanceled=u.PreviewPanePendingInfo,u.PreviewPanePendingInfo=null,t.tryInstrumentRenderStopped(i,u));n.config.perfInstV2&&r&&t.safeInstrumentPerf(i,n=>{n.PreviewPaneFinish=t.getOffsettedNow()},"instrumentFetchesEnd",null)}static previewPaneOpenedOrClosed(n,i,r,u,f,e){let o=n?"Select":"Unselect",s=n?"PreviewPaneOpened":"PreviewPaneClosed";if(t.logClientInstEvent(o,s,i,e,"WindowsTelemetry",33554432),n&&t._keystrokesPerfPingData[i]&&t.notifyTopHitPreviewPaneOpenedOrInterrupted(i,!0),n&&t._clientTelemetry){let n=t._keystrokesInstrumentationData[i];n&&t._clientTelemetry.logPreviewPaneOpenedMeasure(r,u,f)}}static InstrumentQFPreviewPaneDwell(n){var i;(i=t._clientTelemetry)===null||i===void 0?void 0:i.logPreviewPaneDwellMeasure(n)}static logQFSuggestionsIndexerMatchTypeList(n){var i;t._clientTelemetry&&((i=t._clientTelemetry)===null||i===void 0?void 0:i.logQFSuggestionsIndexerMatchTypeList(n))}static logClientInstEvent(n,i,r,u,f,e){let o=null;if(r){let n=t._keystrokesInstrumentationData[r];n&&(o=n.ImpressionGuid)}t.logEvent(n,u,i,null,null,o,null,null,null,f,e)}static safeInstrument(i,r,u,f){let e=t._keystrokesInstrumentationData[i];if(e)r(e);else{var o=f?" DS: "+f:"";n.LogWSBError(u,(f?f+" ":"")+" sequenceNumber: "+i,new Error("No instrumentation data found for sequenceNumber"+o),undefined,undefined,"WindowsTelemetry")}}static safeInstrumentPerf(i,r,u,f){let e=t._keystrokesPerfPingData[i];if(e)n.safeExecute(()=>r(e),u);else{var o=f?" DS: "+f:"";n.LogWSBError(u,(f?f+" ":"")+" sequenceNumber: "+i+" Current sequenceNumber: "+n.SequenceNumberManager.getSequenceNumber(),new Error("No instrumentation data found for sequenceNumber"+o),undefined,undefined,"WindowsTelemetry")}}static instrumentRenderingStarted(n){t.safeInstrument(n,i=>{i.RenderingStarted=!0,t.updatePageIG(n)},"instrumentRenderingStarted")}static instrumentFlightAssignment(n,i){t._keystrokesFlightAssignment[n]=i}static instrumentQueryChangedRequest(i,r){delete t._keystrokesInstrumentationData[i-1];n.InstrumentedItem.resetKValues(i);let h=t._keystrokesPerfPingData[i];h&&n.LogWSBError("instrumentQueryChangedRequest","sequenceNumber: "+i,new Error("Duplicate BeginRequest for sequenceNumber"),undefined,undefined,"WindowsTelemetry");let f=n.Host.getConversationId(),u=n.Host.getRawImpressionGuid(),e=n.cleanGuid(u),o=n.getCurrentTime(),c={RawImpressionGuid:u,ImpressionGuid:e,ConversationId:f,Query:r,PendingDataSources:{},DataSources:{},RankerExtraInfo:{},DuplicateDS:{},Layout:[],MasterPageImpressionCreated:!1,RenderingStarted:!1,PendingInstrumentedItems:{},PendingSyntheticSuggestions:{},OriginalTimestamp:o},s={RawImpressionGuid:u,ImpressionGuid:e,ConversationId:f,PrefixLength:r.queryToFetch?r.queryToFetch.length:0,SearchHomeRenderEvent:n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,ClientShownEvent:t.getOffsettedNow(t._clientShownTimestamp),RequestBegin:t.getOffsettedNow(o),ResponseReceived:{},MultipleResponsesReceived:{},DataSourcesState:t._searchServiceStatus?{Indexer:t._searchServiceStatus}:undefined,RenderFinished:{},renderGroupFinished:{},AllRenderFinished:0,AllDataSourcesProcessed:!1,PendingIcons:0,PreviewPanePendingInfo:undefined,TopResultRendered:[],ResponseFromCache:{},DataSourcesFetchBegin:0,DataSourcesFetchEnd:0,ResponseParsed:{},PreviewPaneOpened:{},PreviewPaneCanceled:{},PageLoadTime:0,SearchHomeLoadTime:0,FirstRenderTime:0,MultipleResponsesParsed:{},ConversationStart:n.config.perfInstV2?t._conversationStartTimestamp:n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,SequenceStart:n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,DataProviderFetchStart:n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,DataProviderFetchFinish:n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,DataProvidersStarted:{},DataProvidersFinished:{},RendersCompleted:{},RendersColdRank:{},PreviewPaneStart:n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,PreviewPaneFinish:n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,AnaheimDataIndexCount:{},MRUDataTelemetry:{},MRUFilesAndFoldersDefinedCount:n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,MRUFilesAndFoldersUndefinedCount:n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE};t._keystrokesInstrumentationData[i]=c;t._keystrokesPerfPingData[i]=s;t._currentRender=0;n.config.perfInstV2&&t._keyDownTimeStamp!=n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE&&(t.safeInstrumentPerf(i,n=>{n.SequenceStart=t._keyDownTimeStamp-t._conversationStartTimestamp},"instrumentKeyDown",null),t._keyDownTimeStamp=n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE);t._clientTelemetry&&t._clientTelemetry.logNewKeystrokeMeasure(f,u,r);t.updatePageIG(i);t.fireKeystrokeTimelineUpdatedHandlers(s);(n.config.enableMRUFilesAndFoldersTelemetry||n.config.disableMRUFilesAndFoldersWildCards)&&(n.Host.setMRUFilesAndFoldersDefinedCount(0),n.Host.setMRUFilesAndFoldersUndefinedCount(0))}static setSearchServiceStatus(n){t._searchServiceStatus=n}static instrumentResponseReceived(i,r,u,f,e,o){t.safeInstrumentPerf(i,i=>{if(!e){let u=t.getOffsettedNow();typeof i.ResponseReceived[r]!="number"?(i.ResponseReceived[r]=u,n.config.useWhereId&&r=="IFF"):(i.MultipleResponsesReceived[r]||(i.MultipleResponsesReceived[r]=[i.ResponseReceived[r]]),i.MultipleResponsesReceived[r].push(u))}u&&(i.DataSourcesState=i.DataSourcesState||{},i.DataSourcesState[r]=u);f&&(i.ResponseFromCache[r]=f)},"instrumentResponseReceived",r);n.config.perfInstV2&&t.safeInstrumentPerf(i,n=>{o||(n.DataProvidersFinished[r]=t.getOffsettedNow(),n.DataProviderFetchFinish<n.DataProvidersFinished[r]&&(n.DataProviderFetchFinish=n.DataProvidersFinished[r])),u&&(n.DataSourcesState=n.DataSourcesState||{},n.DataSourcesState[r]=u),f&&(n.ResponseFromCache[r]=f)},"instrumentResponseReceived",r)}static instrumentTopResultRendered(i,r,u){t.safeInstrumentPerf(i,f=>{let e=t.getOffsettedNow(),o="T"+r.join(",");if(f.renderGroupFinished[o])u||(f.renderGroupFinished[o].iconsFinished=e);else{if(f.TopResultRendered.push({V:e,T:r.join(",")}),t._clientTelemetry){let n=e-f.RequestBegin;t._clientTelemetry.logTopResultsRenderedMeasure(f.RawImpressionGuid,r,n)}f.renderGroupFinished[o]={iconsFinished:e,suggestionsFinished:e}}t.tryInstrumentRenderStopped(i,f);n.MockUrlParameters&&n.safeFireEvent("TopResultRendered")},"instrumentTopResultRendered")}static instrumentRenderedLocalSuggestion(n,i){let u=t._keystrokesInstrumentationData[n];if(u){let n={},t={};for(var r=0;r<i.length;r++)i[r].type=="FV"?n[r]="TBD":i[r].type=="HU"&&(t[r]="TBD");u.FvSug=n;u.HuSug=t}}static instrumentAggregatorCall(i){t.safeInstrument(i,i=>{let r={fastRankModelId:t._instrumentationProvider.getRankerModelId()};for(let n in i.RankerExtraInfo)r[n]=i.RankerExtraInfo[n];i.RankerExtraInfo={};let u={T:"D.Aggregator",Service:n.InstrumentationCommon.DEFAULT_SERVICE_NAME,Scenario:"Aggregator",AppNS:n.InstrumentationCommon.DEFAULT_APP_NAMESPACE,DS:[],rankerModelIds:r};i.DataSources.aggregator=u},"instrumentAggregatorCall")}static instrumentDSB(){t.safeInstrument(n.SequenceNumberManager.getSequenceNumber(),t=>{let r=n.dsbManager.getInstrumentedProps(),u=[],i=null;if(r){for(let t=0;t<r.length;t++){let e=r[t],f=e===null||e===void 0?void 0:e.instrumentedItem,o=e===null||e===void 0?void 0:e.subItemInstrumentedItems;if(o&&o.length>0)for(let t=0;t<o.length;t++){let i=o[t],r={T:"D.url",Val:i===null||i===void 0?void 0:i.getQsCode(),Ho:i===null||i===void 0?void 0:i.getHandoffType(),Gr:n.GroupType.DSBGroup,K:i===null||i===void 0?void 0:i.getKValue()};(i===null||i===void 0?void 0:i.getProperties())&&(r.Properties=i.getProperties());u.push(r)}i===null&&(i=f===null||f===void 0?void 0:f.getWorkflow());let s=f===null||f===void 0?void 0:f.getProperties(),h={T:"D.url",Val:f===null||f===void 0?void 0:f.getQsCode(),Ho:f===null||f===void 0?void 0:f.getHandoffType(),Gr:n.GroupType.DSBGroup,K:f===null||f===void 0?void 0:f.getKValue()};s&&(h.Properties=s);u.push(h)}let f=Object.assign(Object.assign({T:"D.DSB",Service:n.InstrumentationCommon.DEFAULT_SERVICE_NAME,Scenario:n.shouldShowDSBFullWidth()?"DSBFW":"DSBSC",AppNS:n.InstrumentationCommon.DEFAULT_APP_NAMESPACE},i?{Workflow:i}:undefined),{DS:u});t.DataSources.dsb=f}},"instrumentDSB")}static addDuplicatesDataSource(t){let i=Object.keys(t.DuplicateDS).map(n=>t.DuplicateDS[n]);i.length>0&&(t.DataSources.duplicates={T:"D.Duplicates",Service:n.InstrumentationCommon.DEFAULT_SERVICE_NAME,Scenario:"Duplicates",AppNS:n.InstrumentationCommon.DEFAULT_APP_NAMESPACE,DS:i})}static instrumentDuplicate(i,r,u){t.safeInstrument(i,t=>{let i=t.DuplicateDS[r.instItem.getHValue()];i||(i={T:"D.Duplicate",DS:[{T:"D.DSRef",KRef:r.instItem.getKValue()}]},r.instItem.getAppNS()!=n.InstrumentationCommon.DEFAULT_APP_NAMESPACE&&(i.DS[0].AppNS=r.instItem.getAppNS()),t.DuplicateDS[r.instItem.getHValue()]=i);let f={T:"D.DSRef",KRef:u.instItem.getKValue()};u.instItem.getAppNS()!=n.InstrumentationCommon.DEFAULT_APP_NAMESPACE&&(f.AppNS=u.instItem.getAppNS());i.DS.push(f)},"instrumentDuplicate")}static renderingStopped(n){return n.PendingIcons==0&&n.AllDataSourcesProcessed&&n.PreviewPanePendingInfo==null}static notifyAllDataSourcesProcessed(n){t.safeInstrumentPerf(n,i=>{i.AllDataSourcesProcessed=!0,t.tryInstrumentRenderStopped(n,i)},"notifyAllDataSourcesProcessed")}static notifyIconPending(n,i,r){t.safeInstrumentPerf(n,n=>{n.PendingIcons++},"notifyIconPending",(i?"TR":"SUG")+" From "+(r?r:"unknown"))}static notifyIconReadyOrFailed(n,i,r){t.safeInstrumentPerf(n,n=>{n.PendingIcons--},"notifyIconReadyOrFailed",(i?"TR":"SUG")+" From "+(r?r:"unknown"))}static notifyPreviewPaneStartRender(i){n.config.perfInstV2&&t.safeInstrumentPerf(i,n=>{n.PreviewPaneStart=t.getOffsettedNow()},"previewPaneStart")}static notifyPreviewPanePending(n,i,r){let u=t._keystrokesPerfPingData[n];u&&(u.PreviewPanePendingInfo={previewPaneType:i,suggestionType:r})}static tryInstrumentRenderStopped(i,r){t.renderingStopped(r)&&(t.finalizeKeystrokeLog(i,2),t.logMemoryUsageInWSBClient(i,"RenderStopped"),n.TestHookUrlParameters&&n.safeFireEvent("RenderStopped"))}static logMemoryUsageInWSBClient(i,r){var u;if(SearchAppWrapper.CortanaApp.systemInfo){let f=SearchAppWrapper.CortanaApp.systemInfo;const s=typeof BingAtWork=="undefined"?"":(u=BingAtWork.context)===null||u===void 0?void 0:u.midgardVersion,e=t._instrumentationProvider.getWebView2Info(),o=f.totalCommitMB;let h="TotalCommitMB:"+o+",TotalWorkingSetMB:"+f.totalWorkingSetMB+",SnrVersion:"+n.config.snrVersion+",MsbVersion:"+s+",IsWebView2:"+(e.isWebView2?1:0)+",WebView2Version:"+e.webView2Version;n.Host.setSearchAppMemoryCommitMB(o);t._instrumentationProvider.logProfilerMarker(1,0,r,t.getRawImpressionGuid(i),h)}}static isLayoutLogged(n){return t._keystrokesInstrumentationData[n].MasterPageImpressionCreated}static finalizeKeystrokeLog(n,i=0){t._finalizeKeystrokeHandlers.forEach(n=>n(i==0));let r=t._keystrokesInstrumentationData[n];if(r&&t.logKeystrokeData(r,n),i!=1){let i=t._keystrokesPerfPingData[n];i&&(t.logPerfPingEvent(t.createKeystrokePerfPingEvent(n,i)),t._clientTelemetry&&t._clientTelemetry.logDataSourcePerformancesMeasure(i),t.fireKeystrokeTimelineUpdatedHandlers(i))}}static instrumentZiRendered(i,r,u){r&&t.logMemoryUsageInWSBClient(i,"ZiRendered");n!==undefined&&n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("RenderZeroInput");let f=u?u:null;t.safeInstrumentPerf(i,n=>{n.SearchHomeRenderEvent=t.getOffsettedNow()},"instrumentSearchHomeRender",f)}static instrumentRenderFinished(i,r,u,f,e){if(n.config.perfInstV2&&(t===null||t===void 0?void 0:t._currentRender)<0)n.LogWSBError("instrumentRenderFinished","sequenceNumber: "+i,new Error("Invalid current render for sequence number"),undefined,undefined,"WindowsTelemetry");else if(n.config.perfInstV2&&t._keystrokesPerfPingData[i]==undefined)n.LogWSBError("instrumentRenderFinished","sequenceNumber: "+i+" currentRender: "+t._currentRender,new Error("No keystrokesPerfPingData for sequence number"),undefined,undefined,"WindowsTelemetry");else if(e||t._keystrokesPerfPingData[i].FirstRenderTime||(t._keystrokesPerfPingData[i].FirstRenderTime=t.getOffsettedNow()),n.config.perfInstV2){if(t._keystrokesPerfPingData[i].RendersCompleted[t._currentRender]=t.getOffsettedNow(),(n.config.disableMRUFilesAndFoldersWildCards||n.config.enableMRUFilesAndFoldersTelemetry)&&(n.Host.getMRUFilesAndFoldersDefinedCount()>-1&&(t._keystrokesPerfPingData[i].MRUFilesAndFoldersDefinedCount=n.Host.getMRUFilesAndFoldersDefinedCount()),n.Host.getMRUFilesAndFoldersUndefinedCount()>-1&&(t._keystrokesPerfPingData[i].MRUFilesAndFoldersUndefinedCount=n.Host.getMRUFilesAndFoldersUndefinedCount())),n.isAnaheimDataEnabled(!0)||n.isAnaheimDataEnabled(!1)){if(n.AnaheimDataProvider&&n.AnaheimDataProvider.InstrumentStringNumber){let r=n.AnaheimDataProvider.InstrumentStringNumber;for(let n in r)t._keystrokesPerfPingData[i].AnaheimDataIndexCount[n]=r[n]}if(n.AnaheimDataProviderV2&&n.AnaheimDataProviderV2.InstrumentStringNumber){let r=n.AnaheimDataProviderV2.InstrumentStringNumber;for(let n in r)t._keystrokesPerfPingData[i].AnaheimDataIndexCount[n]=r[n]}if(n.AnaheimDataParser===null||n.AnaheimDataParser===void 0?void 0:n.AnaheimDataParser.getANANumberMap){let r=n.AnaheimDataParser.getANANumberMap();for(let n in r)t._keystrokesPerfPingData[i].AnaheimDataIndexCount[n]=r[n]}}t._currentRender++}t.safeInstrumentPerf(i,n=>{let e=t.getOffsettedNow(),o="S"+r.join(",");n.renderGroupFinished[o]?f||(n.renderGroupFinished[o].iconsFinished=e):(r.forEach(t=>n.RenderFinished[t]=e),n.renderGroupFinished[o]={iconsFinished:e,suggestionsFinished:e});t.tryInstrumentRenderStopped(i,n);t._clientTelemetry&&t._clientTelemetry.logGroupsRenderedMeasure(u)},"instrumentRenderFinished",r.join(","));let o=t._keystrokesPerfPingData[i];o&&t.fireKeystrokeTimelineUpdatedHandlers(o)}static instrumentSyntheticInstrumentedItem(i,r,u){let f=t._keystrokesInstrumentationData[i];f?f.PendingInstrumentedItems[r]=u:n.LogWSBError("instrumentSyntheticInstrumentedItem",r,new Error("keystrokesInstrumentationData not found"),undefined,undefined,"WindowsTelemetry")}static instrumentSyntheticSuggestion(i,r){let u=t._keystrokesInstrumentationData[i];u?u.PendingSyntheticSuggestions[r.type]=r:n.LogWSBError("instrumentSyntheticSuggestion",r.type,new Error("Instrumentation synthetic suggestion after flush"),undefined,undefined,"WindowsTelemetry")}static getInstrumentedSyntheticSuggestion(n,i){return t._keystrokesInstrumentationData[n].PendingSyntheticSuggestions[i]}static instrumentDataSource(i,r,u,f){t.safeInstrument(i,t=>{if(f&&f.rankerExtraInfo)for(let n in f.rankerExtraInfo)t.RankerExtraInfo[n]=f.rankerExtraInfo[n];let i=u||[];if(n.config.splitWindowsDataInstrumentation&&n.config.pruneImpression)for(let u of i){if(n.isWindowsData(u.type))return;t.PendingDataSources[r]?t.PendingDataSources[r].push(u):t.PendingDataSources[r]=[u]}else{let n=t.PendingDataSources[r];t.PendingDataSources[r]=n?n.concat(i):i}},"instrumentDataSource",r)}static processPendingDataSources(i){for(let r in i.PendingDataSources){let u=i.PendingDataSources[r];if(u.length>0){let f=[];for(let n of u){f.push(t._instrumentationProvider.createDataSourceObject(n));for(let i of n.subInstItems||[])f.push(t._instrumentationProvider.createDataSourceObject(n,i))}r=="Web"&&(r="WebAS");f.length>0&&(i.DataSources[r]={T:"D."+r,AppNS:n.InstrumentationCommon.DEFAULT_APP_NAMESPACE,Service:n.InstrumentationCommon.DEFAULT_SERVICE_NAME,Scenario:r,SC:f.length,DS:f})}}i.PendingDataSources={}}static instrumentDwell(i){var r;const f=n.SequenceNumberManager.getSequenceNumber();let u=n.InstrumentedItem.createInstrumentedItem(f,"WSNR"),e=n.isZeroInputAllScope(n.Host.getQuery())?"ZI":"QF";u.setUserEngagementContent({engagementType:"Dwell",engagementSurface:e,dwellTime:i});(r=t._clientTelemetry)===null||r===void 0?void 0:r.logItemDwellMeasure(n.Host.getRawImpressionGuid(),u)}static instrumentSnRProviderFetchUrl(n,i){t.safeInstrument(n,n=>{n.SnRProviderFetchUrl=i},"instrumentSnRProviderFetchUrl")}static onConversationStart(){if(t._conversationStartTimestamp=n.getCurrentTime(),t._searchServiceStatus=null,t._clientTelemetry){let i=n.Host.getConversationId();t._clientTelemetry.logConversationStartMeasure(i)}t._keystrokesPerfPingData=[];t._currentRender=0}static getConversationStartTimestamp(){return t._conversationStartTimestamp}static logDataSourceTimeout(n,i){t._instrumentationProvider.logDataSourceTimeout(n,i)}static getPpoFromPpi(n){return typeof n.latency=="number"?{L:n.latency,T:n.previewPaneType}:{}}static createKeystrokePerfPingEvent(i,r){let u={I:i,PL:r.PrefixLength,K:r.RequestBegin,F:r.DataSourcesFetchEnd,PPO:t.getPpoFromPpi(r.PreviewPaneOpened),PPC:t.getPpoFromPpi(r.PreviewPaneCanceled),RRT:r.ResponseReceived,RPT:r.ResponseParsed,MRT:r.MultipleResponsesReceived,RFT:r.RenderFinished,TRR:r.TopResultRendered,RS:undefined,PLT:undefined,HLT:undefined,FRT:undefined,IRFT:{},TRIR:[],MPT:r.MultipleResponsesParsed,CS:n.config.perfInstV2?r.ConversationStart:undefined,KS:n.config.perfInstV2?r.SequenceStart:undefined,RB:n.config.perfInstV2?r.RequestBegin:undefined,FS:n.config.perfInstV2?r.DataProviderFetchStart:undefined,FF:n.config.perfInstV2?r.DataProviderFetchFinish:undefined,PST:n.config.perfInstV2?r.DataProvidersStarted:undefined,PFT:n.config.perfInstV2?r.DataProvidersFinished:undefined,RC:n.config.perfInstV2?r.RendersCompleted:undefined,RCR:undefined,PS:n.config.perfInstV2?r.PreviewPaneStart:undefined,PF:n.config.perfInstV2?r.PreviewPaneFinish:undefined,ANA:n.config.perfInstV2&&(n.config.enableAnaheimDataSH||n.config.enableAnaheimDataQF)?r.AnaheimDataIndexCount:undefined,MRUFAF:n.config.perfInstV2&&(n.config.enableMRUFilesAndFoldersTelemetry||n.config.disableMRUFilesAndFoldersWildCards)?r.MRUFilesAndFoldersDefinedCount:undefined,MRUFAFU:n.config.perfInstV2&&(n.config.enableMRUFilesAndFoldersTelemetry||n.config.disableMRUFilesAndFoldersWildCards)?r.MRUFilesAndFoldersUndefinedCount:undefined};for(let n in r.renderGroupFinished){let t=r.renderGroupFinished[n];if(t.iconsFinished!=t.suggestionsFinished){let i=n.substr(1);if(n.startsWith("T"))u.TRIR.push({T:i,V:t.iconsFinished});else{let n=i.split(",");for(let i of n)u.IRFT[i]=Math.max(t.iconsFinished,u.IRFT[i]||0)}}}if(t.renderingStopped(r)){let t=0;for(let n in r.renderGroupFinished)t=Math.max(t,r.renderGroupFinished[n].iconsFinished);r.FirstRenderTime&&(u.FRT=r.FirstRenderTime);t&&(r.AllRenderFinished=t,u.RS=t,t=Math.max(t,r.PreviewPaneOpened.latency||r.PreviewPaneCanceled.latency||0),r.PageLoadTime=t,u.PLT=t);r.SearchHomeRenderEvent!=n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE&&(u.HLT=Math.max(u.PLT-u.K,r.SearchHomeRenderEvent))}else{let n=t.getOffsettedNow();u.RS=n;u.PLT=n}return n.InstrumentationCommon.createPerfPingEvent(r.ImpressionGuid,[u],"Keystroke",r.ConversationId,r.DataSourcesState,r.ResponseFromCache)}static updatePageIG(n){_G.IG=t.getImpressionGuid(n)}static createMasterPageImpression(r,u,f,e,o){let c=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();const l=c===1||c===0;let s={dataSources:o||[],layoutNodes:[],pageName:r,rawQuery:l?"":e?e.queryToFetch:"",isQuery:!1,impressionUrl:t.createVirtualImpressionURL(u,f),appName:t._instrumentationProvider.getApplicationName(),enrichedClientInfo:{FDPartnerEntry:i,nclid:_G.nclid,isOffline:n.isBrowserOnline()?0:1,webRequested:f?1:0}},h=n.safeExecute(()=>t._instrumentationProvider.getEnrichedClientInfo(e),"getEnrichedClientInfo");if(h)for(let n in h)s.enrichedClientInfo[n]=h[n];if(n.config.addExtraInstLoad){if(n.config.extraInstLoadSize&&!t.extraInstPayload){let i="";while(i.length<n.config.extraInstLoadSize)i+="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";t.extraInstPayload=i}n.config.addExtraInstLoadPercentage&&Date.now()%100<=n.config.addExtraInstLoadPercentage&&(s.enrichedClientInfo.exInst=t.extraInstPayload)}return s}static logKeystrokeData(i,u){var s,e,h,c;t.processPendingDataSources(i);n.TestHookUrlParameters&&t.addDuplicatesDataSource(i);let o=Object.keys(i.DataSources).map(n=>i.DataSources[n]).concat(t.createNonSuggestionsDataSource(i.PendingInstrumentedItems,i.PendingSyntheticSuggestions));if(i.DataSources={},i.PendingSyntheticSuggestions={},i.PendingInstrumentedItems={},o.length!=0||!i.MasterPageImpressionCreated){let f;if(i.RenderingStarted&&(f=DsLManager.CreateLayoutNode(_d.body,n.InstrumentationCommon.DEFAULT_APP_NAMESPACE,!1,!0,i.MasterPageImpressionCreated,!0)),i.MasterPageImpressionCreated)if(n.Host.getSplitDataUploadEndpointEnabled()){let[s,h]=t.splitDataSource(o),r=[],u=[];for(const n of f)e=this.splitLayoutNodes(n),e.length>=2&&(e[0]&&r.push(e[0]),e[1]&&u.push(e[1]));n.shouldWindowsAndBingLogToBing()?t.logEvent("ClientInst",null,null,o,f,i.ImpressionGuid,null,null,null):n.shouldBingLogToBing()&&t.logEvent("ClientInst",null,null,h,u,i.ImpressionGuid,null,null,null,"BingTelemetry",33554432);n.shouldWindowsLogToWindows()&&t.logEvent("ClientInst",null,null,s,r,i.ImpressionGuid,null,null,null,"WindowsTelemetry",33554432)}else t.logEvent("ClientInst",null,null,o,f,i.ImpressionGuid,null,null,null);else{let e=t.createMasterPageImpression(t._instrumentationProvider.getSuggestionsPageName(),r,i.SnRProviderFetchUrl?i.SnRProviderFetchUrl.substring(i.SnRProviderFetchUrl.indexOf("?")+1):"",i.Query,o);if(f&&(e.layoutNodes=f),i.FvSug&&Object.keys(i.FvSug).length>0&&(e.enrichedClientInfo.FvSug=i.FvSug),i.HuSug&&Object.keys(i.HuSug).length>0&&(e.enrichedClientInfo.HuSug=i.HuSug),e.clientTimestamp=i.OriginalTimestamp,n.Host.getSplitDataUploadEndpointEnabled()){if(n.config.splitImpression){const n=t.splitWindowsMasterPageImpression(e);n.length>=2&&(h=n[0],c=n[1])}n.shouldWindowsAndBingLogToBing()?t.logMasterPageImpression(i.ImpressionGuid,e):n.shouldBingLogToBing()&&(n.config.splitImpression&&c&&t.logMasterPageImpression(i.ImpressionGuid,c),n.config.pruneImpression&&t.logMasterPageImpression(i.ImpressionGuid,e));const r={eventType:n.LogEventType.Impression,type:n.DataComplianceTypeDefaultEmptyValue,subType:n.DataComplianceTypeDefaultEmptyValue,eventData:JSON.stringify(h)},f=[r.eventType,r.type,r.subType].join(n.DataComplianceEventNameSeparator);if(n.shouldWindowsLogToWindows()&&n.config.splitImpression&&h&&SearchAppWrapper.CortanaApp.wsbTelemetry.logEvent(f,n.DataComplianceSchemaVersion_1_0,i.ImpressionGuid,i.ConversationId,i.OriginalTimestamp,JSON.stringify(r),4,33554432,2),n.isWebXTFlightsTelemetry()){let n=this._keystrokesFlightAssignment[u];n&&i.ImpressionGuid&&((s=SearchAppWrapper===null||SearchAppWrapper===void 0?void 0:SearchAppWrapper.CortanaApp)===null||s===void 0?void 0:s.logCriticalFlightsTelemetry(n,i.ImpressionGuid))}}else t.logMasterPageImpression(i.ImpressionGuid,e);i.MasterPageImpressionCreated=!0}}}static splitLayoutNodes(t){if(t){let i=Object.assign({},t),r=Object.assign({},t);if(t.hasOwnProperty("L")){i.L=[];r.L=[];for(const n of t.L){let t=this.splitLayoutNodes(n);t[0]&&i.L.push(t[0]);t[1]&&r.L.push(t[1])}return i.L.length==0&&delete i.L,r.L.length==0&&delete r.L,[i,r]}if(t.hasOwnProperty("K")){let u=t.K.toString(),f=u.split(".",1)[0];return Number(f)>=n.InstrumentationCommon.KVALUE_HIDDEN?[i,null]:[null,r]}}return[null,null]}static splitDataSource(t){let i=[],r=[];for(const u of t){let s=u.DS,e=[],o=[],t=JSON.parse(JSON.stringify(u)),f=JSON.parse(JSON.stringify(u));t.DS=[];f.DS=[];for(const t of s)n.isWindowsData(t===null||t===void 0?void 0:t.Val)?e.push(t):o.push(t);t.DS=e;f.DS=o;i.push(t);r.push(f)}return[i,r]}static splitWindowsMasterPageImpression(n){if(n){let r=JSON.parse(JSON.stringify(n)),u=JSON.parse(JSON.stringify(n)),f=n.dataSources,[e,o]=t.splitDataSource(f);r.dataSources=e;u.dataSources=o;let s=n.layoutNodes;r.layoutNodes=[];u.layoutNodes=[];for(const n of s){var i=this.splitLayoutNodes(n);i.length>=2&&(i[0]&&r.layoutNodes.push(i[0]),i[1]&&u.layoutNodes.push(i[1]))}return[r,u]}return[]}static logPerfPingEvent(i){t.logEvent(i.EventType,i.Data,n.InstrumentationCommon.QFPERFPING_EVENT_NAME,null,null,i.ImpressionGuid,null,null,null,"WindowsTelemetry",16777216);n.ClientTestHooks&&n.ClientTestHooks.DebugLogNoConsole("perfPingEvent",[i])}static logMasterPageImpression(i,r){if(r){if(!i){n.LogWSBError("logMasterPageImpression",null,new Error("Missing impressionGuid"),undefined,undefined,"WindowsTelemetry");return}if(n.config.disableWSBServerTelemetry&&n.isThirdPartySearchAllowed()&&(r===null||r===void 0?void 0:r.pageName)!="Page.SmartSearch.AS.DSB")return;r.impressionGuid=i;t._instrumentationProvider.logMasterPageImpression(r,n.Host.getConversationId());n.ClientTestHooks&&n.ClientTestHooks.DebugLogNoConsole("masterPageImpression",r,i)}}static instrumentAppVisibleFinish(i){let r=n.getCurrentTime();t._conversationTimeline.AppVisibleStart=i;t._conversationTimeline.AppVisibleFinish=r}static instrumentAppShownFinish(i){let r=n.getCurrentTime();t._conversationTimeline.AppShownStart=i;t._conversationTimeline.AppShownFinish=r}static instrumentConversationTimelineFinish(){let i=_G.ServerIG;if(!i){n.LogWSBError("instrumentConversationTimelineFinish","Could not instrument as server IG not known",new Error("Could not instrument initilization finish"),undefined,undefined,"WindowsTelemetry");return}t._conversationTimeline.RawImpressionGuid=n.Host.getRawImpressionGuid();t._conversationTimeline.ImpressionGuid=n.cleanGuid(t._conversationTimeline.RawImpressionGuid);t._conversationTimeline.ConversationId=n.Host.getConversationId();let r={CID:t._conversationTimeline.ConversationId,ASB:t._conversationTimeline.AppShownStart,ASF:t._conversationTimeline.AppShownFinish,AVB:t._conversationTimeline.AppVisibleStart,AVF:t._conversationTimeline.AppVisibleFinish},u=n.InstrumentationCommon.createPerfPingEvent(i,[r],"ConversationTimeline",t._conversationTimeline.ConversationId);t.logPerfPingEvent(u)}static instrumentPerformance(i,r){try{let e=_G.ServerIG;if(!e){n.LogWSBError("instrumentPerformance "+i,"Could not instrument as server IG not known",new Error("Could not instrument performance "+i),undefined,undefined,"WindowsTelemetry");return}let u=_w.performance,f=new window.Map;if(r){let t=n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE;if(u&&u.timing&&(t=u.timing.navigationStart),t<=0)return;let i=r.getTime()-t,e=n.getCurrentTime()-t;f.BLT=i;f.ILT=e}this.addNavigationPerformanceInfo(u,f);"LoadError"!==i&&r||this.addResourcePerformanceInfo(u,f);let o=[f],s=n.InstrumentationCommon.createPerfPingEvent(e,o,i);t.logPerfPingEvent(s)}catch(u){typeof SharedLogHelper!="undefined"&&n.LogWSBError("instrumentPerformanceException",i,u,undefined,undefined,"WindowsTelemetry")}}static addNavigationPerformanceInfo(n,t){if(n&&t){let i=n.getEntriesByType("navigation");if(i&&i.length>0){let n=i[0];n&&(t.WST=Math.round(n.workerStart),t.FST=Math.round(n.fetchStart),t.RQST=Math.round(n.requestStart),t.RPST=Math.round(n.responseStart),t.RPET=Math.round(n.responseEnd),t.DCLST=Math.round(n.domContentLoadedEventStart),t.DCLET=Math.round(n.domContentLoadedEventEnd),t.DCT=Math.round(n.domComplete),t.LEST=Math.round(n.loadEventStart),t.LEET=Math.round(n.loadEventEnd),t.ECBS=n.encodedBodySize?Math.round(n.encodedBodySize):"",t.DCBS=n.decodedBodySize?Math.round(n.decodedBodySize):"")}}}static addResourcePerformanceInfo(n,t){if(n&&t){let r=n.getEntriesByType("resource"),i=[];r.forEach(n=>{if(n.duration>0&&n.duration>2e3){let t=n,r=new window.Map;r.NAME=t.name;r.ENTYPE=t.entryType;r.INITYPE=t.initiatorType;r.NHPL=t.nextHopProtocol;r.ST=Math.round(t.startTime);r.RDET=Math.round(t.redirectEnd);r.FST=Math.round(t.fetchStart);r.DLST=Math.round(t.domainLookupStart);r.DLET=Math.round(t.domainLookupEnd);r.CST=Math.round(t.connectStart);r.SCST=Math.round(t.secureConnectionStart);r.CET=Math.round(t.connectEnd);r.RQST=Math.round(t.requestStart);r.RPST=Math.round(t.responseStart);r.RPET=Math.round(t.responseEnd);r.DURN=Math.round(t.duration);r.ECBS=t.encodedBodySize?Math.round(t.encodedBodySize):"";r.DCBS=t.decodedBodySize?Math.round(t.decodedBodySize):"";r.TFS=t.transferSize?Math.round(t.transferSize):"";i.push(r)}});i.length>0&&(t.RS=i)}}static instrumentDSBEvent(r){let f={dataSources:[],layoutNodes:[],pageName:"Page.SmartSearch.AS.DSB",rawQuery:"",isQuery:!1,impressionUrl:"",appName:t._instrumentationProvider.getApplicationName(),enrichedClientInfo:{FDPartnerEntry:i,nclid:_G.nclid,isOffline:n.isBrowserOnline()?0:1},impressionGuid:t.createCleanGuid()},u={};if(u=n.safeExecute(()=>t._instrumentationProvider.getEnrichedClientInfoForDSB(),".instrumentDSBEvent.getEnrichedClientInfoForDSB"),u)for(let n in u)f.enrichedClientInfo[n]=u[n];for(const n in r)f.enrichedClientInfo[n]=r[n];t._instrumentationProvider.logMasterPageImpression(f,null)}static instrumentGleamClickEvent(t){var u,f,e;try{if((u=n===null||n===void 0?void 0:n.config)===null||u===void 0?void 0:u.disableWSBServerTelemetry)return}catch(w){}let o=typeof sj_cook!="undefined"?sj_cook===null||sj_cook===void 0?void 0:sj_cook.get("MUID","MUID"):(e=(f=_G===null||_G===void 0?void 0:_G.CID)!==null&&f!==void 0?f:_G===null||_G===void 0?void 0:_G.nclid)!==null&&e!==void 0?e:"",r=this.createCleanGuid();if(o&&r){const c=navigator===null||navigator===void 0?void 0:navigator.userAgent,s=n.Host.getConversationId(),i=(new Date).getTime();let h=n.getWindowProtocol()+"//"+n.getWindowHost()+"/QF_KEYSTROKE_VIRTUAL_URL?ASInitIG="+encodeURIComponent(r);s&&(h+="&cvid="+s);let l={CurUrl:window.location.href,Pivot:"QF",IsNonSuggestion:!0,EnrichedClientInfo:{FDPartnerEntry:"autosuggest",ImpressionUrl:h,DC:(_G===null||_G===void 0?void 0:_G.DA)||undefined,isWebView2:c.includes("IsWebView2/True")?1:undefined},TS:i,UTS:i,UxClassification:{client:"windows"}},a={CurUrl:window.location.href,Pivot:"QF",AppNS:n.InstrumentationCommon.DEFAULT_APP_NAMESPACE,Properties:t,TS:i,UTS:i},v=`<M><IG>${r}</IG><D><![CDATA[${JSON.stringify(l)}]]></D><Page><Name>Page.SmartSearch.AS.SearchAppearance</Name><L><![CDATA[[]]]></L></Page><TS>${i}</TS></M>`,y=`<E><T>Event.Click</T><IG>${r}</IG><D><![CDATA[${JSON.stringify(a)}]]></D><TS>${i}</TS></E>`,p=`<ClientInstRequest><CID>${o}</CID><Group>${v}</Group><Events>${y}</Events></ClientInstRequest>`;fetch("/threshold/xls.aspx",{body:p,method:"POST",headers:{"Content-Type":"text/xml"}})}}static getOffsettedNow(i=n.getCurrentTime()){return i-t._conversationStartTimestamp}static createNonSuggestionsDataSource(i,r){let u=[];for(let n in i)u.push(t._instrumentationProvider.createNonSuggestionDataSourceObject(n,i[n]));for(let i in r)(r[i].staticGroupType!=n.GroupType.MsbOnRampButton||r[i].suppressed!=!0)&&u.push(t._instrumentationProvider.createDataSourceObject(r[i]));if(u.length){let t={T:"D.ContentGroup",AppNS:n.InstrumentationCommon.DEFAULT_APP_NAMESPACE,Service:n.InstrumentationCommon.DEFAULT_SERVICE_NAME,Scenario:"NonSuggestions",SC:u.length,DS:u};return[t]}return[]}static createVirtualImpressionURL(t,i){let r=n.getWindowProtocol()+"//"+n.getWindowHost()+t;return r+=i?i:n.Service.QueryParams.ConversationId+"="+n.encodeQueryParameter(n.Host.getConversationId()),_G.ServerIG&&(r+="&ASInitIG="+n.encodeQueryParameter(_G.ServerIG)),r}static createCleanGuid(n){return n?(n^Math.random()*16>>n/4).toString(16):"10000000100040008000100000000000".replace(/[018]/g,t.createCleanGuid)}static createCodexClickItemProps(n,t){return n.setProperty("FID","Codex"),n.setProperty("Namespace","WindowsSearchBox"),n.setProperty("EventType","ConversationViewEnter"),n.setProperty("source",t),n}static updateMessageBannerClickItemProps(n,t){return n.setProperty("FID","ReclaimSearchbox"),n.setProperty("Namespace","WindowsSearchBox"),n.setProperty("EventType","RecleamSearchBoxEventEnter"),n.setProperty("source",t),n}static updateItemDataTypeProps(t,i){return t.setProperty("DataType",n.isWindowsData(i)?"WindowsData":"BingData"),t}static logFlightState(n,i){t._clientTelemetry.logFlightState(n,i)}static logEvent(t,i,r,u,f,e,o,s,h,c,l){var a,v,y;if(!n.config.disableWSBServerTelemetry||!n.isThirdPartySearchAllowed())if(n.Host.getSplitDataUploadEndpointEnabled()){if(n.shouldWindowsAndBingLogToBing()?Log2.LogEvent(t,i,r,u,f,e,o,s,h):n.shouldBingLogToBing()&&c==="BingTelemetry"&&Log2.LogEvent(t,i,r,u,f,e,o,s,h),n.shouldWindowsLogToWindows()&&c==="WindowsTelemetry"){const u={eventType:n.isNullOrUndefined(t)?n.LogEventType.ClientInst:t,type:n.isNullOrUndefined(r)?n.DataComplianceTypeDefaultEmptyValue:r,subType:n.DataComplianceTypeDefaultEmptyValue};if(typeof i=="string")u.eventData=i;else for(a in i)a=="ST"?u.subType=n.isNullOrUndefined(i[a])?n.DataComplianceTypeDefaultEmptyValue:i[a]:a=="T"?u.type=n.isNullOrUndefined(i[a])?n.DataComplianceTypeDefaultEmptyValue:i[a]:u[a]=i[a];const f=[u.eventType,u.type,u.subType].join(n.DataComplianceEventNameSeparator);v=n.Host.getConversationId();let o=n.getCurrentTime();y=JSON.stringify(u);SearchAppWrapper.CortanaApp.wsbTelemetry.logEvent(f,n.DataComplianceSchemaVersion_1_0,e,v,o,y,4,l,2)}}else Log2.LogEvent(t,i,r,u,f,e,o,s,h)}}t._clientShownTimestamp=n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE;t._conversationStartTimestamp=n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE;t._currentRender=0;t._keyDownTimeStamp=n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE;t._keystrokesPerfPingData={};t._keystrokesInstrumentationData={};t._keystrokesFlightAssignment={};t._keystrokeTimelineUpdatedHandlers=[];t._finalizeKeystrokeHandlers=[];n.InstrumentationHelper=t}(WSB||(WSB={})),function(n){const t="&nclid=",i="&ts=",r="&nclidts=",u="&tsms=",f="&elv=",e="&cc=",o="&setlang=",s="&cvid=",h="&qs=",c="&ao=",l="&wsso=";class a{constructor(t=Date.now,i=n.getWindowProtocol()+"//"+n.getWindowHost()){if(this.getNowTimestamp=t,this._baseUrl=i,n.config.enableOfflineWithWeb&&n.config.webHost&&n.isBrowserOnline()&&(this._baseUrl=n.config.webHost),n.config.overrideHost){let t=n.getWindowHost();t.startsWith("www.")&&(this._baseUrl=n.getWindowProtocol()+"//"+n.config.overrideHost+t.substring(3))}}getSearchUrl(t,i,r,u,e,o,s,h,a,v,y){if(!u)if(e===21&&(!n.config.disableMsbBundle||n.msbHost))u=(n.msbHost.features.isEduScopeApplicable()?"/school":"/work")+"/search?q="+n.encodeQueryParameter(i),v&&(u+="&inithash="+v),o=n.mapOSFormCode((v===null||v===void 0?void 0:v.includes("Connectors"))?"WSBWSC":"WSBWS0");else{let t=this.getVerticalFromHandoffType(e);u=(t?"/"+t:"")+"/search?q="+n.encodeQueryParameter(i)}let p=this._baseUrl+u;p+=(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.isWindowsTest)?"&form=MONITR&traffictype=wintest":"&form="+n.encodeQueryParameter(o!==null&&o!==void 0?o:n.Host.getFormCode());a&&(p+=c+"1");p=this.enrichUrlWithSuggestionType(p,h?"P":r);p=this.enrichUrlWithCvid(p);n.config.suppressPqParameter||(p+="&pq="+n.encodeQueryParameter(t));let w=n.Host.getMSNRefIg();if(w&&(p+="&refig="+w),p=this.enrichUrlWithMarketInfo(p),p=this.enrichUrlWithDeviceInfo(p),!s){p=this.enrichUrlWithMuidInfo(p);let t=n.Host.getElToken();t&&this._baseUrl.startsWith("https:")&&(p+=f+n.encodeQueryParameter(t));p=this.enrichUrlWithSafeSearchInfo(p)}let b=n.Host.getSafeSearchSetting();return b&&(p+=l+b),n.config.propagateFiltersToMiniserpUrl&&(p+="&"+y),p}getImageSearchUrl(){let t=this._baseUrl+"/images/detail/upload?FORM="+n.mapOSFormCode("SBIWSB");return(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.isWindowsTest)&&(t+="&isWindowsTest=1&traffictype=Test"),t}getVerticalFromHandoffType(n){return n===13?"images":n===14?"videos":n===15?"shop":""}enrichUrlWithDeviceInfo(t){n.Host.isEducationEnvironment()&&(t+="&DAF0=1");n.Host.isWindowsS()&&(t+="&DAF1=1");let i=n.Host.getPartnerSearchCode();return i&&(t+="&PC="+i),t}enrichUrlWithMarketInfo(t){let i=n.Host.getRegion(),r=n.Host.getLanguage();return i&&(t+=e+i),r&&(t+=o+r),t}enrichUrlWithSafeSearchInfo(t){return n.Host.getSafeSearchSetting()=="Strict"?t+"&adlt=strict":t}enrichUrlWithMuidInfo(f){if(_G.nclid){f+=t+n.encodeQueryParameter(_G.nclid);let e=this.getNowTimestamp().toString();f+=i+n.encodeQueryParameter(e);let o=e.substring(0,e.length-3);f+=r+n.encodeQueryParameter(o);let s=e.substring(e.length-3);f+=u+n.encodeQueryParameter(s)}return f}enrichUrlWithCvid(t){return t+(s+n.encodeQueryParameter(n.Host.getConversationId()))}enrichUrlWithSuggestionType(t,i){return t+(h+n.encodeQueryParameter(i))}getChatUrl(t){return"https://www.bing.com/search?q="+n.encodeQueryParameter(t)+"&showconv=1&sendquery=1&form=WSBMSC"}enrichUrlWithWorkScopeHash(n,t){return n===21&&t?"#"+t:""}}n.NavigationHelper=a}(WSB||(WSB={})),function(n){class t{constructor(t){this._selectableItemsContainer=t;n.Host.bindKeyDown((i,r,u)=>{this.selectedItem=this.getSelectedItem();let f=!1;if(i==9)f=this.selectFirstItemInNextGroup(r&&r.shiftKey);else if((n.isUpOrDownKey(i)||n.isLeftOrRightKey(i))&&this.isMsbDsbSelected(this.selectedItem)){const t=n.isUpKey(i)||n.isLeftKey(i);f=this.selectNextItemInGroup(t)}else n.isUpOrDownKey(i)&&(f=this.selectNextItem(n.isUpKey(i)));t.onAfterKeyDown(i,r,u,f)})}selectFirstItemInNextGroup(t){var s,e,o;const r=this._selectableItemsContainer.getSelectableItemsByGroup();if(r.length==0)return!1;const i=r.findIndex(n=>!!n.find(n=>{var t,i;return n.reactKey?n.reactKey===((t=this.selectedItem)===null||t===void 0?void 0:t.reactKey):n.id===((i=this.selectedItem)===null||i===void 0?void 0:i.id)}));let f;f=i<0?-1:this.isMsbDsbSelected(this.selectedItem)?r[i].findIndex(n=>{var t;return n.id===((t=this.selectedItem)===null||t===void 0?void 0:t.id)}):r[i].findIndex(n=>n==this.selectedItem);this.selectedItem&&(this.selectedItem.selected=!1,(e=(s=this.selectedItem).onUnselected)===null||e===void 0?void 0:e.call(s));let u;return(i<0&&!t?u=r[0][0]:t?!this.isMsbDsbSelected(this.selectedItem)&&f>0?u=r[i][0]:i>0?(u=r[i-1][0],u.hiddenAfterFocus&&i>=2&&(u=r[i-2][0])):i===0&&n.RuntimeConfig.AllowKeyboardNavCycling?u={id:"SearchBox",selected:!1,text:"SearchBox"}:i<0&&n.RuntimeConfig.AllowKeyboardNavCycling&&(u=r[r.length-1][0]):i+1<r.length?u=r[i+1][0]:f+1<r[i].length&&((o=this.selectedItem)===null||o===void 0?void 0:o.scope)==n.Scope.Work&&(u=r[i][f+1]),u)?(this._selectableItemsContainer.select(u,!0),u.onSelected&&u.onSelected(),!0):!1}selectNextItem(t){var o,f,s,e;const i=this._selectableItemsContainer.getSelectableItems();if(i.length==0)return!1;const r=this.selectedItem?i.findIndex(n=>{var t,i;return n.reactKey?n.reactKey===((t=this.selectedItem)===null||t===void 0?void 0:t.reactKey):n.id===((i=this.selectedItem)===null||i===void 0?void 0:i.id)}):-1;this.selectedItem&&(this.selectedItem.selected=!1,(f=(o=this.selectedItem).onUnselected)===null||f===void 0?void 0:f.call(o));const h=t?r==0:r==i.length-1;if(h&&n.RuntimeConfig.AllowKeyboardNavOffCanvas)return this._selectableItemsContainer.select(null,!0),!0;if(h&&!n.RuntimeConfig.AllowKeyboardNavCycling)return!1;const u=t?r<=0?i.length-1:r-1:(r+1)%i.length;return this._selectableItemsContainer.select(i[u],!0),i[u]&&i[u].onSelected&&((e=(s=i[u]).onSelected)===null||e===void 0?void 0:e.call(s)),!0}selectNextItemInGroup(t){var h,e,f,o;const i=this._selectableItemsContainer.getSelectableItemsByGroup();if((i===null||i===void 0?void 0:i.length)==0)return!1;const s=i.findIndex(n=>!!n.find(n=>{var t;return n.id===((t=this.selectedItem)===null||t===void 0?void 0:t.id)}));if(s<0)return!1;const r=i[s],u=r.findIndex(n=>n==this.selectedItem);this.selectedItem&&(this.selectedItem.selected=!1,(e=(h=this.selectedItem).onUnselected)===null||e===void 0?void 0:e.call(h));const l=t?u==0:u==r.length-1;if(l&&!n.RuntimeConfig.AllowKeyboardNavCycling)return!1;const c=t?u<=0?r.length-1:u-1:(u+1)%r.length;return this._selectableItemsContainer.select(i[s][c],!0),(o=(f=r[c])===null||f===void 0?void 0:f.onSelected)===null||o===void 0?void 0:o.call(f),!0}getSelectedItem(){let t;return this.selectedItem||!(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.keyNavSetFocus)?(t=this._selectableItemsContainer.getSelectedItem(),this.isMsbDsbSelected(this.selectedItem)&&(t=this._selectableItemsContainer.getSelectableItems().find(n=>n.selected)||t)):(t=this._selectableItemsContainer.getSelectableItems().find(t=>t.id===(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.keyNavSetFocus)),this._selectableItemsContainer.select(t,!0)),t}isMsbDsbSelected(n){const t=n;return t&&t.dsb&&t.isMsb}}n.KeyboardEvtHandler=t}(WSB||(WSB={})),function(n){n.LatencyTimeout=500;n.MsbPeopleLatencyTimeout=1e3;class t{constructor(n,t,i){this._aggregator=n;this._rootViewModel=t;this._queryIntentClassifier=i;this._sequenceNumber=-1;this._suggestionsQueue={};this._dataSourcesCompleted={};this._expectedLongRunningDataSources=["CoPIFF","CoPCFP","CoPST"]}initiateSequenceNumber(t,i,r){if(!(n.isThirdPartySearchAllowed===null||n.isThirdPartySearchAllowed===void 0?void 0:n.isThirdPartySearchAllowed())||(n.isSupportWebResultsInAllScopeInDMAEnabled===null||n.isSupportWebResultsInAllScopeInDMAEnabled===void 0?void 0:n.isSupportWebResultsInAllScopeInDMAEnabled())||i.scope!=n.Scope.ThirdPartyWeb){if(this._sequenceNumber>=t){n.LogWSBError("initiateSequenceNumber",null,new Error("Unexpected sequence number"));return}this.resetStateForNewQuery(t,i);this._highPriorityDataSources=[];this._normalPriorityDataSources=[];this._lowPriorityDataSources=[];for(let t of n.config.enabledDataSources){let r=i.enabledDataSources[t];r&&(n.config.lowPriorityDataSources[t]?this._lowPriorityDataSources.push(t):n.config.highPriorityDataSources[t]?t==="MSBC"&&(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.qfUtils.isWaitForBackfillEnabled(i.scope))?this._lowPriorityDataSources.push(t):this._highPriorityDataSources.push(t):t==="IFF"&&n.isHighPriorityFileProviderEnabled()?this._highPriorityDataSources.push(t):this._normalPriorityDataSources.push(t))}if(this._HighPriDoneProcessing=this._highPriorityDataSources.length==0,this._highPriorityDataSources.length==0&&this._normalPriorityDataSources.length==0&&this._lowPriorityDataSources.length==0)this.processSuggestions(!1);else{let t=this.getLatencyTimeout();t>0&&(this._bufferingTimer=n.safeSetTimeout(()=>{this._bufferingTimer=null,this.processSuggestions(!0)},t,"processSuggestionsBuffering"),n.config.dataSourceTimeLimit&&(this._processingTimeoutTimer=n.safeSetTimeout(()=>{this._processingTimeoutTimer=null;let t=[...this._highPriorityDataSources.filter(t=>!n.contains(this._arrivedDataSources,t)),...this._normalPriorityDataSources.filter(t=>!n.contains(this._arrivedDataSources,t)),...this._lowPriorityDataSources.filter(t=>!n.contains(this._arrivedDataSources,t)),];t.some(t=>n.contains(this._expectedLongRunningDataSources,t))?n.LogWSBWarning("SuggestionsRenderingManager",t.join(","),new Error("Data provider did not complete before the time limit")):n.LogWSBError("SuggestionsRenderingManager",t.join(","),new Error("Data provider did not complete before the time limit"));this._processingStopped=!0;this._allDataSourcesArrived=!0;this.processSuggestions(!1);r&&r()},n.config.dataSourceTimeLimit,"processSuggestionsTimeout")))}}}getLatencyTimeout(){var t;return this._partialQuery.queryToFetch?this._partialQuery.scope===n.Scope.People&&n.isMsftAccountConnected?(t=n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.msbPeopleL2LatencyTimeout)!==null&&t!==void 0?t:n.MsbPeopleLatencyTimeout:(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.latencyTimeout)?n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.latencyTimeout:n.config.impressionRenderingTimeout?n.config.impressionRenderingTimeout:n.LatencyTimeout:n.LatencyTimeout}queueSuggestions(t,i,r,u,f){if(t>this._sequenceNumber){n.LogWSBError("queueSuggestions",null,new Error("Unexpected sequence number"));return}if(!(t<this._sequenceNumber)){if(this._dataSourcesCompleted[i]){n.LogWSBError("queueSuggestions",i,new Error(`Data source already completed: ${i}`));return}if(!n.contains(this._highPriorityDataSources,i)&&!n.contains(this._normalPriorityDataSources,i)&&!n.contains(this._lowPriorityDataSources,i)){n.LogWSBError("queueSuggestions",i,new Error("Unexpected data source"));return}this._allDataSourcesArrived||(this._suggestionsQueue[i]&&!this._suggestionsQueue[i].updated?this._suggestionsQueue[i].suggestions.push(...r):this._suggestionsQueue[i]={suggestions:r,updated:!1},this._dataSourcesCompleted[i]=!f,u&&(this._extraSignalsMap[i]=u),f||this._arrivedDataSources.push(i),this._allDataSourcesArrived=this.haveAllDataSourcesArrived(this._highPriorityDataSources.concat(this._normalPriorityDataSources).concat(this._lowPriorityDataSources)),this._processingStopped||n.InstrumentationHelper.isLayoutLogged(this._sequenceNumber)?this._allDataSourcesArrived&&(this.resetTimers(),n.InstrumentationHelper.notifyAllDataSourcesProcessed(this._sequenceNumber)):this.processSuggestions(!1))}}resetTimers(){this._bufferingTimer&&(sb_ct(this._bufferingTimer),this._bufferingTimer=null);this._processingTimeoutTimer&&(sb_ct(this._processingTimeoutTimer),this._processingTimeoutTimer=null)}resetStateForNewQuery(t,i){this._arrivedDataSources=[];this._allProcessedDataSources={};this._sequenceNumber=t;this._partialQuery=i;this._suggestionsQueue={};this._dataSourcesCompleted={};this._extraSignalsMap={};this._renderedThisSequenceNumber=!1;this._waitingForMoreResults=!0;this._processingStopped=!1;this._allDataSourcesArrived=n.isEmpty(i.enabledDataSources);this.resetTimers()}getDependencies(t){return n.Host.dataSourceDependencies(t).filter(t=>n.isDataSourceEnabled(t,this._partialQuery))}haveAllDataSourcesArrived(t){return n.config.mergeQueries&&this._partialQuery.scope==n.Scope.Documents?t.every(n=>{switch(n){case"MPHO":case"MVID":case"MDOC":return!!this._partialQuery.enabledDataSources.MPHO&&!!this._partialQuery.enabledDataSources.MVID&&!!this._partialQuery.enabledDataSources.MDOC&&!!this._partialQuery.enabledDataSources.MPVD;default:return!!this._suggestionsQueue[n]}}):t.every(i=>{var r,u;if(i=="MSBC"){const t=n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.qfUtils.isWaitForBackfillEnabled(this._partialQuery.scope),f=!!this._suggestionsQueue[i]&&(((u=(r=this._suggestionsQueue[i])===null||r===void 0?void 0:r.suggestions)===null||u===void 0?void 0:u.length)>0||this._dataSourcesCompleted[i]);return t?f:!!this._suggestionsQueue[i]}return!!this._suggestionsQueue[i]&&this.haveCacheBackedDataSourcesArrived(t)})}haveCacheBackedDataSourcesArrived(t){if(this._partialQuery.isSearchHomeZI&&n.isMsbQwsDocsCacheEnabled(this._partialQuery)&&!n.config.msbQwsDocsNoRefreshAfterCachedResults){const i="SSUE",r="SREE",s=!!this._partialQuery.enabledDataSources[i]&&n.isDocSourceEnabledInQws(i),h=!!this._partialQuery.enabledDataSources[r]&&n.isDocSourceEnabledInQws(r);let u=!1,f=!1;t.forEach(n=>{n==i?u=!0:(n=r)&&(f=!0)});const e=u&&s,o=f&&h;if(e||o){const n=e&&this._dataSourcesCompleted[i],t=o&&this._dataSourcesCompleted[r];return n||t}return!0}return!0}haveAllDataSourcesCompleted(t){return n.config.mergeQueries&&this._partialQuery.scope==n.Scope.Documents?t.every(n=>{switch(n){case"MPHO":case"MVID":case"MDOC":return!!this._partialQuery.enabledDataSources.MPHO&&!!this._partialQuery.enabledDataSources.MVID&&!!this._partialQuery.enabledDataSources.MDOC&&!!this._partialQuery.enabledDataSources.MPVD;default:return!!this._dataSourcesCompleted[n]}}):t.every(n=>!!this._dataSourcesCompleted[n])}processSuggestions(t){let r=[],o=[],i,h=this.getLatencyTimeout()>0&&this._bufferingTimer==null,c=this.haveAllDataSourcesArrived(this._highPriorityDataSources),l=c||h,y=this.haveAllDataSourcesCompleted(this._normalPriorityDataSources),a=this.haveAllDataSourcesCompleted(this._highPriorityDataSources),v=a&&y;const f=this._allDataSourcesArrived||h;t&&n.InstrumentationHelper.logDataSourceTimeout(Object.keys(this._suggestionsQueue),this._partialQuery);let u=t&&!this._renderedThisSequenceNumber,p=(t,f)=>{if(!t.updated&&this.getDependencies(f).every(t=>n.contains(this._arrivedDataSources,t))){if(o.push(f),this._allProcessedDataSources[f]=!0,t.suggestions.length>0){n.config.enableUserEngagementLog&&t.suggestions.forEach(n=>{n.dataSource=f});let e=this.canHaveSuppressions(f)?t.suggestions.filter(n=>!this.isSuppressed(f,n)):t.suggestions;if(e.length>0){i&&i.length!==0||(i=this._renderedThisSequenceNumber?this._rootViewModel.getSuggestions(!0):[]);f=="CoPIFF"&&n.Host.getIFFPolarisProviderEnabled()&&this.maxRankScoreOfDuplicatesSuggestions(e,i);let[t,o]=this.removeDuplicatesAndAssignIds(e,i,r,f);if(n.config.enableMruProviderInQF&&(n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())===3&&f=="Web"){if(f=="Web"){let n=[];t.forEach(t=>{r.find(n=>(n===null||n===void 0?void 0:n.query)==(t===null||t===void 0?void 0:t.query))||i.find(n=>(n===null||n===void 0?void 0:n.query)==(t===null||t===void 0?void 0:t.query))||n.push(t)});r=r.concat(n)}}else r=r.concat(t);o&&(u=!0)}}t.updated=!0}};const e=(t,u)=>{var f,e,o,s,h,c;for(let n in t){let i=t[n],r=this._suggestionsQueue[i];r&&p(r,i)}if(n.config.wsbWithCopilotQF&&u&&this._queryIntentClassifier&&!this._extraSignalsMap.QIC){let t=this._partialQuery.queryToFetch;if(t.split(/\W+/).filter(Boolean).length>1){let l=(f=r===null||r===void 0?void 0:r.filter(n=>n.type=="PP"||n.type=="IBA").length)!==null&&f!==void 0?f:0;l+=(e=i===null||i===void 0?void 0:i.filter(n=>n.type=="PP"||n.type=="IBA").length)!==null&&e!==void 0?e:0;let u=(o=r===null||r===void 0?void 0:r.filter(n=>n.type=="ST").length)!==null&&o!==void 0?o:0;u+=(s=i===null||i===void 0?void 0:i.filter(n=>n.type=="ST").length)!==null&&s!==void 0?s:0;n.Host.getJupiterProviderEnabled()&&(u+=(h=r===null||r===void 0?void 0:r.filter(n=>n.type=="CoPST").length)!==null&&h!==void 0?h:0,u+=(c=i===null||i===void 0?void 0:i.filter(n=>n.type=="CoPST").length)!==null&&c!==void 0?c:0);let a=this._queryIntentClassifier.classify(t,l,u);this._extraSignalsMap.QIC={rankerExtraInfo:{confidence:a}}}}};l&&(n.config.impressionRenderingWaitTimeout?f&&e(this._highPriorityDataSources,!0):e(this._highPriorityDataSources,!0));this._bufferingTimer&&v&&(!n.config.impressionRenderingWaitTimeout||f)&&(sb_ct(this._bufferingTimer),this._bufferingTimer=null);let s=l&&!this._HighPriDoneProcessing;s=s||!!(n.config.impressionRenderingWaitTimeout&&f);let w=s||(this.getLatencyTimeout()>0?this._bufferingTimer==null:c);w&&(e(this._normalPriorityDataSources),e(this._lowPriorityDataSources));this._waitingForMoreResults&&v&&(this._waitingForMoreResults=!1,(!this._renderedThisSequenceNumber||this._rootViewModel.mayNeedFlush()||(i||this._rootViewModel.getSuggestions(!0)).length==0)&&(u=!0));this._partialQuery.showProgressBar&&this._allDataSourcesArrived&&(u=!0);(r.length>0||u)&&(i||(i=this._renderedThisSequenceNumber?this._rootViewModel.getSuggestions(!0):[]),n.config.impressionRenderingWaitTimeout?f&&this.addSuggestions(i,r,o,u):this.addSuggestions(i,r,o,u));this._allDataSourcesArrived&&(this.resetTimers(),n.InstrumentationHelper.notifyAllDataSourcesProcessed(this._sequenceNumber),this._rootViewModel.toggleProgressBar(!1),(n.Host.useImprovedIndexingMessage()||(n.MockUrlParameters===null||n.MockUrlParameters===void 0?void 0:n.MockUrlParameters.windowsSearchCatalogStatus))&&(this._partialQuery.queryToFetch?this._rootViewModel.updateIndexingNotificationVisibility():this._rootViewModel.hideIndexingIncompleteNotification()));this._HighPriDoneProcessing=a}getAggregatorResult(n,t,i){let r=this.waitingForWebProvider();return this._aggregator.rank(t,i,this._extraSignalsMap,this._partialQuery,n,this._sequenceNumber,r)}waitingForWebProvider(){return n.isBrowserOnline()&&["Web"].concat(this.getDependencies("Web")).some(t=>n.isDataSourceEnabled(t,this._partialQuery)&&!this._allProcessedDataSources[t])}addSuggestions(t,i,r,u){let e=this._renderedThisSequenceNumber?this._rootViewModel.getCurrentTopResults():[],f=n.safeExecute(()=>this.getAggregatorResult(e,t,i),"getAggregatorResults",null);f||(f={topResults:e,suggestionsToAdd:i,suggestionsToRemove:[],groupOrder:[]});n.InstrumentationHelper.instrumentAggregatorCall(this._sequenceNumber);n.shouldShowDSBLayout(this._partialQuery)&&n.InstrumentationHelper.instrumentDSB();i=f.suggestionsToAdd;let o=f.suggestionsToRemove;for(let i of f.topResults)n.contains(t,i)&&!n.contains(e,i)&&o.push(i);if(u||i.length!=0||o.length!=0||!n.sequenceEqual(e,f.topResults)){let s=!this._renderedThisSequenceNumber;if(s&&(this._renderedThisSequenceNumber=!0,n.InstrumentationHelper.instrumentRenderingStarted(this._sequenceNumber)),n.config.useGroupTitleEdgeBS&&this._partialQuery&&!this._partialQuery.isSearchHomeZI&&i)for(let t of i)t&&(t.type=="ANAF"||t.type=="ANAH"||t.type=="ANAR"||t.type=="ANAT")&&(t.staticGroupType=n.GroupType.AnaheimDataQF);n.TweakDiagnostics===null||n.TweakDiagnostics===void 0?void 0:n.TweakDiagnostics.pushDiagnostics("onAddSuggestions",f);let h=n.safeExecute(()=>this._rootViewModel.update(s,f.topResults,this._waitingForMoreResults,this._sequenceNumber,i,o,r,f.groupOrder,this._allDataSourcesArrived,this._extraSignalsMap),"rootViewModel.update",0,null,t=>{n&&n.fallbackToPrepopulatedBundle&&n.fallbackToPrepopulatedBundle(t)});h==0&&(this._processingStopped=!0,this.resetTimers())}}isAnaheimSuggestionDupeWithMRU(t,i){if(i.type=="ANAH"||i.type=="ANAR"){let r=i;if(n.isBingSearchUrl(r.url)){let i=n.extractQueryFromBingSearchUrl(r.url);if(i&&n.contains(t,i))return!0}}return!1}maxRankScoreOfDuplicatesSuggestions(t,i){var r,u;for(let f=0;f<i.length;++f){let e=i[f];if(n.isDocument(e===null||e===void 0?void 0:e.type)||n.isPhoto(e===null||e===void 0?void 0:e.type)||n.isFolder(e===null||e===void 0?void 0:e.type)){let o=t.filter(t=>n.isDuplicateDocument(e,t));for(let t of o)!n.isNullOrUndefined((r=t===null||t===void 0?void 0:t.deviceItem)===null||r===void 0?void 0:r.rankScore)&&!n.isNullOrUndefined((u=e===null||e===void 0?void 0:e.deviceItem)===null||u===void 0?void 0:u.rankScore)&&t.deviceItem.rankScore>e.deviceItem.rankScore&&(i[f].maxRankScoreForLocalDevice=t.deviceItem.rankScore),(n.config.enableCopIFFExpPlan||n.config.mergeMultipleResouces)&&(t.isPolarisMatched?(i[f].isPolarisMatched=!0,i[f].indexerIntentFeature=!0):t.isVegaMatched&&(i[f].isVegaMatched=!0,i[f].indexerIntentFeature=!0))}}}removeDuplicatesAndAssignIds(t,i,r,u){var f;let o=n=>{var t,i;n.id||(n.id=n.path?n.path:n.type+n.text+((t=n.additionalInfoText)!==null&&t!==void 0?t:"")+(n.handoffType===17?(i=n.reactKey)!==null&&i!==void 0?i:"":""))},e=!1;if(u=="ANA"&&this._suggestionsQueue.MRS){let n=(f=this._suggestionsQueue.MRS.suggestions)===null||f===void 0?void 0:f.map(n=>n.query);n&&(t=t.filter(t=>!this.isAnaheimSuggestionDupeWithMRU(n,t)))}if(this._aggregator.canHaveDuplicates(u,this._partialQuery)){let f=[];for(let s=0;s<t.length;++s){const c=t[s];let h=i.findIndex(n=>this._aggregator.mergeDuplicates(this._partialQuery,n,c));if(h>=0){let t=i[h];t.needsRefreshAfterDeduping&&(e=!0);n.InstrumentationHelper.instrumentDuplicate(this._sequenceNumber,t,c);continue}if(h=r.findIndex(n=>this._aggregator.mergeDuplicates(this._partialQuery,n,c)),h>=0){let t=r[h],i=null;const u=n.config.msbReplaceDupLocalFiles&&c.type==="MFIL"&&t.type==="FL";u&&(i=this.replaceSuggestionInList(r,h,c),t=r[h]);t.needsRefreshAfterDeduping&&(t.needsRefreshAfterDeduping=!1,t.previewPaneNeedsRefreshAfterDeduping=!1);n.InstrumentationHelper.instrumentDuplicate(this._sequenceNumber,t,i!==null&&i!==void 0?i:c);continue}if(this._aggregator.canHaveDuplicatesWithinDataSource(u,this._partialQuery)&&(h=f.findIndex(n=>this._aggregator.mergeDuplicates(this._partialQuery,n,c)),h>=0)){let t=f[h];t.needsRefreshAfterDeduping&&(t.needsRefreshAfterDeduping=!1,t.previewPaneNeedsRefreshAfterDeduping=!1);n.InstrumentationHelper.instrumentDuplicate(this._sequenceNumber,f[h],c);continue}o(c);f.push(c)}return[f,e]}return t.forEach(n=>o(n)),[t,e]}canHaveSuppressions(t){return n.config.suppressDataSources[t]||n.config.dataSourcesWithSuppressedTypes[t]}isSuppressed(t,i){return n.config.suppressDataSources[t]||n.config.suppressTypes[i.type]}replaceSuggestionInList(n,t,i){const r=n[t];return r?(i.duplicates=r.duplicates,i.needsRefreshAfterDeduping=!0,i.previewPaneNeedsRefreshAfterDeduping=!0,n[t]=i,r):r}}n.SuggestionsRenderingManager=t}(WSB||(WSB={})),function(n){function w(n){return n.handoffType==1?n.query:HitHighlightingParser.removeMarkers(n.text)}function f(n){if(n.length==0)return 0;let t=0;for(let i=0;i<n.length;i++)t=(t<<5)-t+n.charCodeAt(i)|0;return t}function o(n){let t=1779033703,i=3144134277,r=1013904242,u=2773480762;for(let e=0,f;e<n.length;e++)f=n.charCodeAt(e),t=i^Math.imul(t^f,597399067),i=r^Math.imul(i^f,2869860233),r=u^Math.imul(r^f,951274213),u=t^Math.imul(u^f,2716044179);return t=Math.imul(r^t>>>18,597399067),i=Math.imul(u^i>>>22,2869860233),r=Math.imul(t^r>>>17,951274213),u=Math.imul(i^u>>>19,2716044179),t^=i^r^u,i^=t,r^=t,u^=t,[t>>>0,i>>>0,r>>>0,u>>>0]}function s(n,t,i,r){return function(){n|=0;t|=0;i|=0;r|=0;let u=(n+t|0)+r|0;return r=r+1|0,n=t^t>>>9,t=i+(i<<3)|0,i=i<<21|i>>>11,i=i+u|0,(u>>>0)/4294967296}}function b(n){n||(n="default");let t=o(n);return s(t[0],t[1],t[2],t[3])}function t(n,t){if(!n)return t.length;if(!t)return n.length;let u=[],i;for(i=0;i<=t.length;i++)u[i]=[i];let r;for(r=0;r<=n.length;r++)u[0][r]=r;for(i=1;i<=t.length;i++)for(r=1;r<=n.length;r++)u[i][r]=t.charAt(i-1)==n.charAt(r-1)?u[i-1][r-1]:Math.min(u[i-1][r-1]+1,Math.min(u[i][r-1]+1,u[i-1][r]+1));return u[t.length][n.length]}function k(n,i){return n&&(n=n.toLocaleLowerCase()),i&&(i=i.toLocaleLowerCase()),t(n,i)}function h(n,t,i){let r=0;if(t>0||i>0)if(t>0&&i>0){if(i>t){let n=t;t=i;i=n}r=n/(t-n+i)}else r=Number.MAX_VALUE;return r}function c(n,t){let i=n.length,u=t.length;if(i===0&&u===0)return 1;let s=new Array(i),o=new Array(u),r=0,h=0,c=Math.floor(Math.max(i,u)/2)-1;for(let e=0;e<i;e++){let i=Math.max(0,e-c),h=Math.min(u,e+c+1);for(var f=i;f<=h;f++)if(!o[f]&&n[e]==t[f]){s[e]=!0;o[f]=!0;r++;break}}if(r===0)return 0;let e=0;for(let r=0;r<i;r++)if(s[r]){while(!o[e])e++;n[r]!=t[e]&&h++;e++}return(r/i+r/u+(r-h/2)/r)/3}function d(n,t){let i=c(n,t);if(i<1)return i;let r=l(n,t);return i+r*.1*(1-i)}function l(n,t){let i=0;for(;i<4;i++)if(n[i]!=t[i])return i;return++i}function g(n,t){return!n||!t?0:n.length+1<=t.length&&t[n.length]==" "?1:n.length==t.length?1:0}function nt(n){let i=0,t=1;if(n&&n.length>1)for(let r=1;r<n.length;r++)n.charAt(r)==n.charAt(r-1)?t++:t=1,t>i&&(i=t);else if(n)return 1;return i}function tt(n){return n&&n.length>0?n.trim().split(" ").length:0}function it(n){let t=new RegExp("^[0-9a-zA-Z ]+$");return n&&t.test(n)?1:0}function rt(n){return n&&n.length>0&&n.charAt(n.length-1)==" "?1:0}function ut(n){return n&&n.length>0&&(n.includes("http://")||n.includes("https://")||n.includes("."))?1:0}function ft(t,i,r,u){t.includes("?")&&(r[117]=1,ct(t)&&(r[127]=1));t.replace("///","").replace("//","").includes("/")&&(r[118]=1);t.includes(".")&&(r[119]=1);let o=u.cvid+u.privacyNumber+t;r[120]=f(o);let e=t.toLocaleLowerCase();if((e.startsWith("www.")||e.startsWith("http://www.")||e.startsWith("https://www."))&&(r[122]=1),e.startsWith("www.")||e.startsWith("http://")?r[123]=1:e.startsWith("https://")?r[124]=1:e.startsWith("ftp://")?r[125]=1:r[126]=1,i){let t=n.normalizeUrl(e,15),u=n.normalizeUrl(i,15).toLocaleLowerCase();t.startsWith(u)&&(r[187]=1)}}function et(n,i,r,u,e){if(e){r[128]=t(e,i);r[129]=e.length;let n=u.cvid+u.privacyNumber+e;r[130]=f(n)}}function ot(n,i,r){let u=n.toLocaleLowerCase();r[140]=n.length;let f=u.split(" ");if(r[144]=f.length,i){r[141]=t(n,i);r[142]=Math.min(100,h(r[141],i.length,n.length));let e=i.toLocaleLowerCase();u.includes(e)&&(r[143]=1);u.startsWith(e)&&(r[188]=1);for(let n of f)if(n==e){r[145]=1;break}}}function ct(n){let t=ht.find(t=>n.startsWith(t));return n=t?n.substr(t.length):n,st.some(t=>n.startsWith(t))}function lt(n){let t=0;if(n)for(let i in n){let r=n[i];r&&r.prefixLaunchCount&&(t+=r.prefixLaunchCount)}return t}function at(t,i,r,u){if(r){let f=r[t];f&&(i[47]=f.prefixLaunchCount,i[49]=f.lastLaunchTime,i[101]=u,u>0&&(i[100]=f.prefixLaunchCount/u),f.previewPaneLaunchCount&&f.lastPreviewPaneLaunchTime&&(i[301]=f.previewPaneLaunchCount,f.lastPreviewPaneLaunchTime==f.lastLaunchTime&&(i[302]=1),i[303]=n.getCurrentTime()-f.lastPreviewPaneLaunchTime))}}function vt(n,t,i){if(i){let r=i[n];r&&(t[281]=r.probability,t[282]=r.weight)}}function yt(n,t,r,u,f,e){if(t){let s=i(u,r),o=t[s];o&&(f?(n[153]=o.ProbSugClickGivenPref,n[152]=o.ClicksOnSugGivenPref):e?(n[161]=o.Loglikelihood,n[162]=o.ProbSugClickGivenBackground,n[163]=o.ClicksOnSugGivenPref,n[164]=o.ProbSugClickGivenPref,n[165]=o.CCR,n[166]=o.EventCount,n[293]=o.ProbSugClickGivenPrefTime,n[168]=o.CCRTime,n[294]=o.ProbSugClickGivenBackgroundTime,n[295]=o.LoglikelihoodTime):(n[6]=o.Loglikelihood,n[3]=o.ProbSugClickGivenBackground,n[151]=o.ClicksOnSugGivenPref,n[0]=o.ProbSugClickGivenPref,n[94]=o.CCR,n[95]=o.EventCount,n[290]=o.ProbSugClickGivenPrefTime,n[155]=o.CCRTime,n[291]=o.ProbSugClickGivenBackgroundTime,n[292]=o.LoglikelihoodTime))}}function pt(n,t,i){if(t){let r=t[i];r&&(n[256]=r.PSGPCR,n[257]=r.PSGCCR,n[258]=r.PSGSTR,n[286]=r.PSGSATCCR,n[287]=r.PSGSATPCR)}}function i(n,t){return(n+"\t"+t).toLocaleLowerCase()}function r(t,i,r){i==11..toString()&&i==0..toString();switch(n.config.athenaKeyType){case 0:return t||n.LogWSBError("getAthenaGroupKey",null,new Error("Athena key group is empty"),undefined,undefined,"WindowsTelemetry"),t;case 1:return i||n.LogWSBError("getAthenaGroupKey",null,new Error("Athena key handoff is empty"),undefined,undefined,"WindowsTelemetry"),i;case 2:return r||n.LogWSBError("getAthenaGroupKey",null,new Error("Athena key suggestion type is empty"),undefined,undefined,"WindowsTelemetry"),i||n.LogWSBError("getAthenaGroupKey",null,new Error("Athena key handoff is empty"),undefined,undefined,"WindowsTelemetry"),r+"_"+i;default:return n.LogWSBError("getAthenaGroupKey",null,new Error("Athena key group type is not set"),undefined,undefined,"WindowsTelemetry"),""}}function u(t,i,r){switch(n.config.athenaKeyType){case 0:return i==t;case 1:return r==t;case 2:return r==t;default:return!1}}function wt(t){let i={};return t?(n.config.athenaKeyType==2?dt(t,i):(bt(t,i),kt(t,i)),i):i}function bt(t,f){let a=t.Suggestions?t.Suggestions.split("\t"):[],v=t.ProbSugClickGivenPrefs?t.ProbSugClickGivenPrefs.split("\t"):[],y=t.ClicksOnSugGivenPrefs?t.ClicksOnSugGivenPrefs.split("\t"):[],p=t.ProbSugClickGivenBackground?t.ProbSugClickGivenBackground.split("\t"):[],w=t.Loglikelihoods?t.Loglikelihoods.split("\t"):[],c=t.SuggestionGroups?t.SuggestionGroups.split("\t"):[],b=t.ProbSugClickGivenPrefWeeks?t.ProbSugClickGivenPrefWeeks.split("\t"):[],l=t.ProbSugClickGivenPrefWeekends?t.ProbSugClickGivenPrefWeekends.split("\t"):[],k=t.ProbSugClickGivenBackgroundWeeks?t.ProbSugClickGivenBackgroundWeeks.split("\t"):[],nt=t.ProbSugClickGivenBackgroundWeekends?t.ProbSugClickGivenBackgroundWeekends.split("\t"):[],d=t.LoglikelihoodWeeks?t.LoglikelihoodWeeks.split("\t"):[],g=t.LoglikelihoodWeekends?t.LoglikelihoodWeekends.split("\t"):[],s=n.config.athenaKeyType==0||!t.SuggestionHandOffTypes?[]:t.SuggestionHandOffTypes.split("\t"),o=a.length,h=e();if(u(o,c.length,s.length))for(let t=0;t<o;t++){let e=c&&c.length>t?c[t]:"",tt=s&&s.length>t?s[t]:"",it=r(e,tt,""),u=i(a[t],it);f[u]={SuggestionGroup:+c[t]};p.length==o&&(f[u].ProbSugClickGivenBackground=Number(p[t]));v.length==o&&(f[u].ProbSugClickGivenPref=Number(v[t]));y.length==o&&(f[u].ClicksOnSugGivenPref=Number(y[t]));w.length==o&&(f[u].Loglikelihood=Number(w[t]));n.config.athenaKeyType!=0&&s.length==o&&(f[u].SuggestionHandOffType=Number(s[t]));b.length!=o||h?l.length==o&&h&&(f[u].ProbSugClickGivenPrefTime=Number(l[t])):f[u].ProbSugClickGivenPrefTime=Number(b[t]);k.length!=o||h?l.length==o&&h&&(f[u].ProbSugClickGivenBackgroundTime=Number(nt[t])):f[u].ProbSugClickGivenBackgroundTime=Number(k[t]);d.length!=o||h?g.length==o&&h&&(f[u].LoglikelihoodTime=Number(g[t])):f[u].LoglikelihoodTime=Number(d[t])}else n.LogWSBError("parseLLSignals",null,new Error("Length doesn't match"),undefined,undefined,"WindowsTelemetry")}function kt(t,f){let c=t.CCRSuggestions?t.CCRSuggestions.split("\t"):[],h=t.CCRSuggestionGroups?t.CCRSuggestionGroups.split("\t"):[],l=t.CCRs?t.CCRs.split("\t"):[],a=t.EventCounts?t.EventCounts.split("\t"):[],s=n.config.athenaKeyType==0||!t.CCRSuggestionHandOffTypes?[]:t.CCRSuggestionHandOffTypes.split("\t"),v=t.CCRsWeek?t.CCRsWeek.split("\t"):[],y=t.CCRsWeekend?t.CCRsWeekend.split("\t"):[],o=c.length,p=e();if(u(o,h.length,s.length))for(let t=0;t<o;t++){let e=h&&h.length>t?h[t]:"",w=s&&s.length>t?s[t]:"",b=r(e,w,""),u=i(c[t],b);f[u]||(f[u]={SuggestionGroup:Number(h[t])});l.length==o&&(f[u].CCR=Number(l[t]));a.length==o&&(f[u].EventCount=Number(a[t]));n.config.athenaKeyType!=0&&s.length==o&&(f[u].CCRSuggestionHandOffType=Number(s[t]));v.length!=o||p?y.length==o&&p&&(f[u].CCRTime=Number(y[t])):f[u].CCRTime=Number(v[t])}else n.LogWSBError("parseCCRSignals",null,new Error("Length doesn't match"),undefined,undefined,"WindowsTelemetry")}function dt(t,i){let e=t.SugTypes?t.SugTypes.split("\t"):[],o=t.HandOffTypes?t.HandOffTypes.split("\t"):[],s=t.PSGPCRs?t.PSGPCRs.split("\t"):[],h=t.PSGCCRs?t.PSGCCRs.split("\t"):[],c=t.PSGSTRs?t.PSGSTRs.split("\t"):[],l=t.PSGSATCCRs?t.PSGSATCCRs.split("\t"):[],a=t.PSGSATPCRs?t.PSGSATPCRs.split("\t"):[],f=e.length;if(u(f,0,o.length))for(let n=0;n<f;n++){let u=e[n],v=o[n],t=r("",v,u);i[t]={};s.length==f&&(i[t].PSGPCR=Number(s[n]));h.length==f&&(i[t].PSGCCR=Number(h[n]));c.length==f&&(i[t].PSGSTR=Number(c[n]));l.length==f&&(i[t].PSGSATCCR=Number(l[n]));a.length==f&&(i[t].PSGSATPCR=Number(a[n]))}else n.LogWSBError("parseGroupEngagementSignals",null,new Error("Length doesn't match"),undefined,undefined,"WindowsTelemetry")}function gt(n,t){let i={};if(t){let u=0,f=0,r={};for(let{key:e,value:o}of t){r[e]={lexicalSimilarity:0,groupClickCounts:{},groupWeight:{}};f+=a(r,e,n);let t=y(o);r[e].groupClickCounts=t.groupLaunches;for(let n in r[e].groupClickCounts)i[n]||(i[n]={probability:0,weight:0}),i[n].probability+=t.groupHits[n],u+=t.groupHits[n]}v(i,r,f,u)}return i}function ni(n,t){let i={};if(t){let u=0,f=0,r={};for(let{key:o,value:e}of t){r[o]={lexicalSimilarity:0,groupClickCounts:{},groupWeight:{}};f+=a(r,o,n);for(let n in e)e[n]&&e[n].prefixLaunchCount&&(i[n]||(i[n]={probability:0,weight:0}),r[o].groupClickCounts[n]=e[n].prefixLaunchCount,i[n].probability++,u++)}v(i,r,f,u)}return i}function a(n,t,i){let r=t.length-i.length,u=r/t.length;return n[t].lexicalSimilarity=1-u,n[t].lexicalSimilarity}function v(n,t,i,r){let u=0;for(let n in t){let r=t[n];r.lexicalSimilarity/=i;for(let n in r.groupClickCounts){let t=r.groupClickCounts[n];r.groupWeight[n]=t*r.lexicalSimilarity;u+=r.groupWeight[n]}}for(let t in n)n[t].probability/=r;for(let i in t){let r=t[i];for(let t in r.groupClickCounts)n[t]||(n[t]={probability:0,weight:0}),r.groupWeight[t]/=u,n[t].weight+=r.groupWeight[t]}}function y(n){let i=(n,t,i)=>n[t]=n[t]?n[t]+i:i,t={groupLaunches:{},groupHits:{},otherGroupLaunches:0};for(let r in n){let u=n[r];if(u&&u.prefixLaunchCount){let f=u.groupType;f||f===0?(i(t.groupLaunches,f,u.prefixLaunchCount),i(t.groupHits,f,1)):t.otherGroupLaunches+=u.prefixLaunchCount}}return t}function ti(n,t,i,r){if(r){let f=i(t),u=r[f];u&&(n[266]=u.probability,n[267]=u.weight)}}function e(t){let i=t?t.getDay():n.getCurrentDate().getDay();return i==6||i==0}function ii(n){for(let t in n)n[t]?n[t]=p(Number(n[t])):delete n[t]}function p(n){return Number(n.toFixed(5))}function ri(n,t){n.featureStore||(n.featureStore={});n.featureStore[t]=1}n.getTextForLexicalFeatures=w;n.stringHashCode=f;n.cyrb128=o;n.sfc32=s;n.getRNG=b;n.getEditDistance=t;n.getEditDistanceIgnoreCase=k;n.computeEditDistanceRatio=h;n.computeJaroSimilarity=c;n.computeJaroWinklerSimilarity=d;n.computeJaroWinklerPrefixOverLapCount=l;n.isWordBoundary=g;n.countMaxContiguousRepeatedChars=nt;n.getNumberOfWords=tt;n.containsOnlyDigitsLettersOrSpaces=it;n.endsWithSpace=rt;n.prefixIsLikeUrl=ut;n.computeUrlFeatures=ft;n.computeDomainFeatures=et;n.computeTitleFeatures=ot;const st=["www.bing.","cn.bing.","www.google.","www.yandex.","www.baidu.","www.yahoo.",],ht=["http://","https://",];n.getSumMruLaunches=lt;n.setMRUSignal=at;n.setMRUBackPropSignal=vt;n.setEngagementSignals=yt;n.setSuggestionGroupEngagementSignals=pt;n.getEngagementSignalKey=i;n.getAthenaGroupKey=r;n.checkAthenaGroupLength=u;n.parseWebEngagementSignals=wt;n.computeGroupBackpropagatedClicks=gt;n.computeSuggestionBackpropagatedClicks=ni;n.evaluateGroupLaunches=y;n.setMRUGroupBackpropClicks=ti;n.isWeekend=e;n.removeUndefinedAndZeroAndTrimValues=ii;n.trimFeatureStoreValue=p;n.setFlagInFeatureStore=ri;n.AutoSuggestFeatureMap={1e3:1070,2e3:1071,2011:1072,2152:1073,2153:1074,2200:1075,10015:1076,10018:1077,11001:1078,11002:1079,11021:1080,30001:1081}}(WSB||(WSB={})),function(n){var t;(function(t){function r(n){return n[1060]?n[1060]:0}function u(n){return n.isSearchHomeZI}const i=.4;t.suggestionRankingModels={};t.suggestionFastRankModelIdCurrent="STH_00000000-0000-0000-0000-000000000000";t.randomizationRank=r;t.suggestionRankingModels.STH_randomizationranker=r;class f{rank(t,i,r,f,e,o,s,h,c){var v,y,p,w,a;if(u(t))return{topResults:[],mruSuppressions:null};if(t.scope==n.Scope.PathCompletion)return this.rankPathCompletion(i);let b=n.isL2(t)?null:{mruGroupRatios:null,maxGroupCCR:null,maxGroupProbSugClickGivenPref:null,mruGroupBackpropWeights:null,mruGroupBackpropRatios:null},k=i.slice();this.orderSuggestions(t,i,r,f,o,s,h,b,e);this.setMRUHintEnabled(t,i);this.setGroupSuppressionSignals(b,i);let d=this.getTopHitCandidates(t,i,c.searchTheWeb,k),l=this.createMulticlassClassifierTopHitSuggestionList(d);if((n.config.enableCopIFFExpPlan||n.config.mergeMultipleResouces)&&l.length>0&&(n.isDocument((v=l[0])===null||v===void 0?void 0:v.type)||n.isPhoto((y=l[0])===null||y===void 0?void 0:y.type))&&!n.isNullOrUndefined((p=l[0])===null||p===void 0?void 0:p.deviceItem)){let t=undefined,r=0,u=n.isNullOrUndefined(l[0].maxRankScoreForLocalDevice)?l[0].deviceItem.rankScore:l[0].maxRankScoreForLocalDevice;for(let f=0;f<i.length;f++)n.getGroupType(i[f])!==n.getGroupType(l[0])||n.isNullOrUndefined((w=i[f])===null||w===void 0?void 0:w.deviceItem)||(a=n.isNullOrUndefined(i[f].maxRankScoreForLocalDevice)?i[f].deviceItem.rankScore:i[f].maxRankScoreForLocalDevice,t===undefined?a>u&&(t=i[f],r=a):a>r&&(t=i[f],r=a));t!==undefined&&(l[0]=t)}return this.replaceTopSettingSuggestions(l,i),{topResults:l,mruSuppressions:b}}replaceTopSettingSuggestions(t,i){var r;if(n.Host.getJupiterProviderEnabled()&&n.Host.getCoPSTRankPlanEnabled()&&t.length>0){let u=t.findIndex(t=>n.isSetting(t.type));if(u>=0){let o=t.findIndex(t=>n.isDefaultSynthetic(t)),s=t.findIndex(t=>n.isWebRelatedSuggestion(t)),f=undefined,e=this.getSettingRankScore(t[u]);for(let o=0;o<i.length;o++)if(n.getGroupType(i[o])===n.getGroupType(t[u])&&!n.isNullOrUndefined((r=i[o])===null||r===void 0?void 0:r.deviceItem)){let r=this.getSettingRankScore(i[o]);n.isNullOrUndefined(f)?this.compareSettingScore(r,i[o],e,t[u])&&(e=r,f=i[o]):this.compareSettingScore(r,i[o],e,f)&&(e=r,f=i[o])}n.isNullOrUndefined(f)||(t[u]=f);let h=o>=0?o:s>=0?s:-1;if(h>=0&&t.length===2&&h<u){let n=t.slice(0,1)[0];t.splice(0,1);t.push(n)}}}}compareSettingScore(t,i,r,u){return n.Host.getJupiterProviderEnabled()&&n.Host.getCoPSTRankPlanEnabled()?n.isNonCopilotPoweredSetting(i.type)&&n.isNonCopilotPoweredSetting(u.type)?t>r:i.type=="CoPST"&&u.type=="CoPST"?n.isModernSetting(i.deviceItem)&&n.isModernSetting(u.deviceItem)?t<r:n.isModernSetting(i.deviceItem)&&!n.isModernSetting(u.deviceItem)?!0:!1:n.isNonCopilotPoweredSetting(i.type)&&u.type=="CoPST"?!0:i.type=="CoPST"&&n.isNonCopilotPoweredSetting(u.type)?!1:(n.LogWSBError("compareSettingScore",i.type,new Error("Invalid setting type"),undefined,undefined,"WindowsTelemetry"),undefined):undefined}getSettingRankScore(t){var i;return n.Host.getJupiterProviderEnabled()&&n.Host.getCoPSTRankPlanEnabled()?n.isNonCopilotPoweredSetting(t.type)?t.rankingScore:t.type=="CoPST"?(i=t.deviceItem)===null||i===void 0?void 0:i.rankScore:(n.LogWSBError("getSettingRankScore",t.type,new Error("Invalid setting type"),undefined,undefined,"WindowsTelemetry"),undefined):undefined}isNotChromeIntent(n,t){let i="google chrome";if(t.length==0)return!1;let r=t.filter(n=>n.query.toLocaleLowerCase()==i&&n.type=="PP");return r.length>0&&!n.queryToFetch.includes("c")&&!n.queryToFetch.includes("h")&&!n.queryToFetch.includes("r")&&!n.queryToFetch.includes("m")?!0:!1}setMRUHintEnabled(t,i){if(n.config.enableMRUHint){let r=t.queryToFetch.toLocaleLowerCase();for(let t=0;t<i.length;t++){let u=i[t].featureStore;u[281]&&u[282]&&(n.config.enableMRUHint!=1&&i[t].text.toLocaleLowerCase().startsWith(r)||(i[t].mruHintEnabled=!0))}}}rankPathCompletion(n){let t=n.find(n=>n.type=="CG")||n[0];return{topResults:t?[t]:[],mruSuppressions:null}}selectFastRankRanker(i){if(i)t.suggestionFastRankModelIdCurrent=i;else if(n.config.wsbEnableRandomization){let i=n.getRNG(n.Host.getConversationId());t.suggestionFastRankModelIdCurrent=n.config.wsbRandomizationProbability==1||i()<n.config.wsbRandomizationProbability?"STH_randomizationranker":"STH_00000000-0000-0000-0000-000000000000"}let r=t.suggestionRankingModels[t.suggestionFastRankModelIdCurrent];if(!r){let i;if(i=n.config.secondRankerId&&(n.isMsftAccountConnected||n.isMsbEnterprise()||n.AccessTokenManager.getWindowsAccountType()==1)?n.config.secondRankerId:n.config.mainRankerId,i){if(r=t.suggestionRankingModels[i],r)return t.suggestionFastRankModelIdCurrent=i,r;if(i!=n.config.mainRankerId)r=this.selectFastRankRanker(n.config.mainRankerId);else if(t.suggestionFastRankModelIdCurrent="STH_00000000-0000-0000-0000-000000000002",n.config.enbaleGetRankerNewLog){let r=[];for(let n in t.suggestionRankingModels)r.push(n);let u=r.sort().join("|");n.LogWSBError("getRanker",i+"#TAB#"+u,new Error("Model not found"),undefined,undefined,"WindowsTelemetry")}else n.LogWSBError("getRanker",i,new Error("Model not found"),undefined,undefined,"WindowsTelemetry")}else n.LogWSBError("getRanker",i,new Error("fastRank RankerId not defined"),undefined,undefined,"WindowsTelemetry"),t.suggestionFastRankModelIdCurrent="STH_00000000-0000-0000-0000-000000000003"}return r}orderSuggestions(t,i,r,u,f,e,o,s,h){var l,a;if(n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().beginMark("WSBRanking.orderSuggestions"),!n.config.bypassRankerOnNoNewSuggestions||t.hasNewSuggestions){let v=n.safeExecute(()=>this.createFeatureStore(t,i,r,u,f,e,o,s,h),"createFeatureStore");v=v||i.map(()=>({}));let p=this.selectFastRankRanker();if(p){let t=-1,r=-1;for(let u=0;u<i.length;u++){let f=v[u];if(i[u].handoffType!==21||!i[u].skipRerank){let e=n.safeExecute(()=>p(f),"calculateRankingScore");if(i[u].rankingScore=n.trimFeatureStoreValue(e),i[u].featureStore=f,n.config.enableMruProviderInQF&&n.config.useRankerRankScore&&((l=i[u])===null||l===void 0?void 0:l.subType)==="MRUHS"&&(n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())===3){if(t===-1){t=u;continue}r===-1?i[t].rankingScore>=i[u].rankingScore?r=u:(r=t,t=u):i[t].rankingScore>=i[u].rankingScore?i[r].rankingScore<i[u].rankingScore&&(r=u):(r=t,t=u)}}}if(n.config.enableMruProviderInQF&&n.config.useRankerRankScore&&(n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())===3)for(let n=i.length-1;n>=0;--n)((a=i[n])===null||a===void 0?void 0:a.subType)==="MRUHS"&&n!==t&&n!==r&&i.splice(n,1)}if(n.config.enableAnaheimRelevance){let t=[];n.config.enableAnaheimRelevance==1?t=i.filter(n=>n.anaheimRankingSignals):n.config.enableAnaheimRelevance==2&&(t=i.filter(t=>n.getGroupType(t)==n.GroupType.SearchSuggestions));this.getWebRankingWithAnaheimAdapter(t)}let y=i.filter(n=>n.type=="MB"),[c]=this.splitSuggestionsByGroup(i);if(i.sort((n,t)=>t.rankingScore-n.rankingScore),y.length>1){let n=i.map((n,t)=>n.type=="MB"?t:undefined).filter(n=>typeof n=="number");for(let t=0;t<y.length;++t)i[n[t]]=y[t]}if(c.length>0){let[,t]=this.splitSuggestionsByGroup(i);if(n.config.enableRankByGroupFirstEle){let r;if(n.Host.getJupiterProviderEnabled()&&n.Host.getCoPSTRankPlanEnabled()){let n=t.findIndex(n=>n.type=="CoPST")>=0;r=n?!0:(t===null||t===void 0?void 0:t.length)>0&&t[0].rankingScore>c[0].rankingScore}else r=(t===null||t===void 0?void 0:t.length)>0&&t[0].rankingScore>c[0].rankingScore;i.splice(0);r?i.push(...t,...c):i.push(...c,...t)}}n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("WSBRanking.orderSuggestions")}}splitSuggestionsByGroup(t){const[i,r]=t.reduce(([i,t],r)=>n.getGroupType(r)===n.GroupType.SearchSuggestions?[[...i,r],t]:[i,[...t,r]],[[],[]]);return[i,r]}getWebRankingWithAnaheimAdapter(t){const i=10,e=-1;let r=!1,u=new Array(i),f=n=>{if(n==e&&!r)return r=!0,-400;n=Math.floor(n);n>i-1&&(n=i-1);let t=-(n*100+500)-u[n];return u[n]+=1,t},o=n=>{for(let t of n)if(t.suggestionLogMeta){let n=this.getSuggestionScoreFromSuggestionLogMeta(t.suggestionLogMeta);if(n)return n}return 64e3};t.sort((n,t)=>t.rankingScore-n.rankingScore);for(let n=0;n<i;++n)u[n]=0;let s=o(t);for(let u of t){let t=this.getRankingBucketWithAnaheimAdapter(u,s,i);u.rankingScore=t!=null&&t>=0?!r&&u.anaheimRankingSignals&&t<=n.config.anaheimDataTopHitThreshold?f(e):f(t):f(i)}}getRankingBucketWithAnaheimAdapter(t,i,r){let u=Math.pow(2,-(i/8e3)+2);if(t.anaheimRankingSignals){let i=t.anaheimRankingSignals.dateVisited,u=(n.getCurrentTime()-i.getTime())/864e5,f=t.anaheimRankingSignals.visitCount,e=t.anaheimRankingSignals.urlTypedCount,o=.6*Math.exp(-u/14)+.25*(1-Math.exp(-f/6))+.15*(1-Math.exp(-e/2));return Math.floor(r*(1-o))}if(t.suggestionLogMeta){let n=this.getSuggestionScoreFromSuggestionLogMeta(t.suggestionLogMeta);if(n)return Math.floor((n-i)/u)}return null}getSuggestionScoreFromSuggestionLogMeta(n){let t=";2152:";return n&&n.indexOf(t)>=0?parseInt(n.substring(n.indexOf(t)+6).split(";")[0].slice(1,-1)):NaN}getTopWebSuggestion(t){if(t.length==0)return null;n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().beginMark("WSBRanking.getTopWebSuggestion");let i=t[0],r=64e3;if(t.length>1)for(let n of t)if(n.suggestionLogMeta){let t=this.getSuggestionScoreFromSuggestionLogMeta(n.suggestionLogMeta);!isNaN(t)&&t<r&&(r=t,i=n)}return n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("WSBRanking.getTopWebSuggestion"),i}applyQueryOverride(t){return n.config.msbQueryOverrideTenant&&(t===null||t===void 0?void 0:t.queryToFetch)&&n.contains(n.config.msbQueryOverrideTenant,t.queryToFetch.toLowerCase())}bypassFallbackForMSB(t,i,r){return(n.config.bypassFallbackOnMSBTopHit==2||n.config.bypassFallbackOnMSBTopHit==3)&&i.every(t=>n.isWebSuggestion(t)||n.isMsbQFSuggestion(t)||t.isAnswer)?n.isMsftAccountConnected&&this.applyQueryOverride(t)?!1:!0:(n.config.bypassFallbackOnMSBTopHit==1||n.config.bypassFallbackOnMSBTopHit==4)&&!i.some(t=>n.isApp(t.type)||n.isSetting(t.type))&&r.length>0&&n.isMsbOnlineSuggestionType(r[0].type)?!0:n.config.bypassFallbackOnMSBTopHit==4&&!i.some(t=>n.isApp(t.type)||n.isSetting(t.type))&&r.length>1&&(r[0].isAnswer||n.isWebSuggestion(r[0]))&&(n.isMsbOnlineSuggestionType(r[1].type)||r.length>2&&r[0].isAnswer&&r[1].isAnswer&&n.isMsbOnlineSuggestionType(r[2].type))?!0:!1}getTopHitCandidates(t,r,u,f){n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().beginMark("WSBRanking.getTopHitCandidates");let e=r.filter(n=>this.allowInTopHit(t,n,f));if(this.bypassFallbackForMSB(t,r,e,f)){const s=n.getMsbTophitSuggestionTypeOrder();let o=[],u=[];for(const t of s)if(u=n.config.useWsbRankingForMsbFile&&t.length==1&&t[0]=="MFIL"?r.filter(n=>n.type=="MFIL"&&n.autoOpenPreviewPaneWhenOnTopHit):f.filter(n=>t.indexOf(n.type)>-1&&n.autoOpenPreviewPaneWhenOnTopHit),u.length>0)break;if(u.length>0&&u[0].autoOpenPreviewPaneWhenOnTopHit&&(n.config.bypassFallbackOnMSBTopHit!=3||n.getTextForLexicalFeatures(u[0]).toLowerCase().startsWith(t.queryToFetch.toLowerCase()))&&o.push(u[0]),n.config.bypassFallbackOnMSBTopHit==4&&(e[0].isAnswer||n.isWebSuggestion(e[0]))&&(e[0].isAnswer||this.getFallbackClassifierScore(e[0])>i)&&o.push(e[0]),o.length>0)return n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("WSBRanking.getTopHitCandidates"),o}if(this.enableFallbackClassifier(t,e,u)){if(e=this.getFallbackClassifierSuggestions(e,u),n.config.enableGGSupp&&this.isNotChromeIntent(t,e))return n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("WSBRanking.getTopHitCandidates"),[];if(n.config.demoteWebForApps){let i=this.getTopAppSuggestion(r),u=i?i.query.toLocaleLowerCase():"";i&&this.allowInTopHit(t,i)&&e.every(t=>n.isWebSuggestion(t))&&(u.startsWith(t.queryToFetch)||u.includes(" "+t.queryToFetch))&&(e=[i])}return n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("WSBRanking.getTopHitCandidates"),e}return n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("WSBRanking.getTopHitCandidates"),e}getFallbackClassifierScore(i){let r=n.safeExecute(()=>t.suggestionRankingModels[n.config.fallbackClassifierId],"getFallbackClassifier"),u=r?n.safeExecute(()=>r(i.featureStore),"calculateFallbackClassifierScore"):0;return n.trimFeatureStoreValue(u)}getFallbackClassifierSuggestions(r,u){if(r=r.filter(n=>n.type!="SW"),r.every(n=>n.type=="SW"||n.type=="MACR")||(r=r.filter(n=>n.type!="MACR")),r.length>0){let e=0,f=r[0];if(f.fbcScore=this.getFallbackClassifierScore(f),e=n.config.enableAppsSettingsFbcScoreThreshold?n.isApp(f.type)||n.isSetting(f.type)?n.config.appsSettingsFbcScoreThreshold:n.isWebSuggestion(f)?i:n.config.nonWebFbcScoreThreshold:n.isWebSuggestion(f)?n.config.webFbcScoreThreshold>0?n.config.webFbcScoreThreshold:i:n.config.nonWebFbcScoreThreshold,f.fbcScore<e){if(n.config.disableTopHitForFBC&&f.handoffType!=0&&!t.topHitIsMultiEntity(r)&&1!=(n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())){let t=-1;if(t=r.findIndex(n=>n.handoffType==0),t>=0){if(n.config.asTopHitPosForFBC==1){let n=r.slice(t,t+1);return n.push(f),n}if(n.config.asTopHitPosForFBC==2){let n=r.slice(0,1);return n.push(r[t]),n}return r.slice(t,t+1)}}this.isSyntheticWebBlockedInTopHit(u,f)&&(e=0)}return f.fbcScore>=e?r.slice(0,t.topHitIsMultiEntity(r)?2:1):[]}return[]}enableFallbackClassifier(t,i,r){if(r&&n.config.fallbackClassifierId&&i.length>0){let t=i[0];return n.getGroupType(t)==n.GroupType.Cortana?!1:t.isAnswer?!1:!0}return!1}getTopAppSuggestion(t){for(let i of t)if(n.isApp(i.type))return i;return null}isRecourse(t){return t.notAResult&&!n.contains(["SW","PWL","SSTS"],t.type)}allowInTopHit(t,i,r){if((t===null||t===void 0?void 0:t.scope)!=n.Scope.Web&&i.type=="SW"&&(r===null||r===void 0?void 0:r.length)>1&&this.isSyntheticWebBlockedInTopHit(i,r[0]))return!1;let u=!r||r.length==1;if(n.config.demoteTopHitOnNoQueryMatch&&(n.isApp(i.type)||n.isSetting(i.type))&&!i.ciMatchedQuery&&!i.query.toLocaleLowerCase().includes(t.queryToFetch.toLocaleLowerCase()))return!1;if(t.topHitRestriction==1&&i.query.toLocaleLowerCase()!=t.queryToFetch.toLocaleLowerCase()&&(n.contains(i.features,"ForcePrefixOnTop")||i.features.push("ForcePrefixOnTop")),this.isRecourse(i))return u;let f=n.getGroupType(i);switch(f){case n.GroupType.Store:return i.hc;case n.GroupType.Command:return i.hc||u;case n.GroupType.LocalPlaces:return!1}if(n.getScope(f)==n.Scope.Emails&&!i.hc)return!1;if(n.enforceOriginalOrder(i)&&r)for(let n of r){if(n==i)break;if(n.type==i.type&&n.handoffType==i.handoffType&&n.sourceForGroup==i.sourceForGroup)return!1}return n.RuntimeConfig.QfMode!=11&&n.RuntimeConfig.AlwaysWide&&!i.previewPaneType?!1:!0}isSyntheticWebBlockedInTopHit(t,i){return n.config.enableBlockSWTopHit&&t.type=="SW"&&i.rankingScore-t.rankingScore>n.config.swTopHitRankScoreThreshold&&!n.prefixNormalizedSuggTypes.has(i.type)?!0:!1}createMulticlassClassifierTopHitSuggestionList(i){let r=0;if(n.config.disableTopHitForFBC)r=i.length;else if(n.Host.getJupiterProviderEnabled()&&n.Host.getCoPSTRankPlanEnabled())r=Math.min(i.length,n.config.maxNumberOfTopResults)-1;else for(let t=0;t<Math.min(i.length,n.config.maxNumberOfTopResults);t++)i[t].rankingScore!==undefined&&i[t].rankingScore>.5&&(r=t);return r==0&&t.topHitIsMultiEntity(i)&&(r=1),n.config.bypassFallbackOnMSBTopHit==4&&i.length>0&&n.isMsbOnlineSuggestionType(i[0].type)&&(r=1),i.slice(0,r+1)}createFeatureStore(t,i,r,u,f,e,o,s,h){let p=[],a=0,w=0,v=0,y=t.queryToFetch.toLocaleLowerCase(),nt=t=>n.getGroupType(t),b=n.getSumMruLaunches(u),k=0,d={};if(u){let t=n.evaluateGroupLaunches(u);k=t.otherGroupLaunches;d=t.groupLaunches}let g=n.computeGroupBackpropagatedClicks(t.queryToFetch,h),tt=n.computeSuggestionBackpropagatedClicks(t.queryToFetch,h);for(let t of i)if(t.handoffType==2){let i=n.getAppItem(t);i&&(w+=i.totalLaunches,i.totalLaunches>a&&(a=i.totalLaunches));t.deviceItem&&t.deviceItem.rankScore>v&&(v=t.deviceItem.rankScore)}let c={};n.isWeekend()&&(c[440]=1);c[441]=this.getLocalHourBucket(new Date);let l=y.split(" ");for(let n of l){if(n=="install"){c[451]=1;break}if(n=="uninstall"){c[450]=1;break}}if(l&&l.length>0){let n=l[0];c[452]=n.indexOf("c:")>-1||n.indexOf("d:")>-1||n.indexOf("e:")>-1||n.indexOf("f:")>-1?1:0}for(let h of i){let i=this.getSuggestionFeatureStore(y,h,f,r,w,o);i[13]=a;i[7]=v;r&&r.WebSignalsAvailable&&(i[93]=1);n.setMRUSignal(n.getSuggestionKey(h),i,u,b);this.setMRUGroupLaunchRatios(i,h,b,d,k,s);n.setMRUBackPropSignal(n.getSuggestionKey(h),i,tt);g&&n.setMRUGroupBackpropClicks(i,h,nt,g);let l=n.getTextForLexicalFeatures(h);if(l){if(h.handoffType==1){n.computeUrlFeatures(l,t.queryToFetch,i,e);let r=n.getDomain(l);n.computeDomainFeatures(h,t.queryToFetch,i,e,r,f)}if(n.isFileOrFolder(h.type)){let t=e.cvid+e.privacyNumber+l;i[131]=n.stringHashCode(t)}}if(c&&(i[440]=c[440],i[441]=c[441],i[451]=c[451],i[450]=c[450],i[452]=c[452]),n.config.enbaleCateFeature){n.config.undocked?i[1003]=1:i[1002]=1;switch(n.AccessTokenManager.getWindowsAccountType()){case 2:i[1032]=1;break;case 1:i[1030]=1;break;case 3:i[1031]=1;break;case 0:i[1033]=1}n.isApp(h.type)?i[1029]=1:n.isSetting(h.type)?i[1022]=1:h.type=="SW"?i[1021]=1:n.isWebSuggestion(h)?i[1023]=1:h.handoffType==10?i[1015]=1:n.isDocument(h.type)?i[1017]=1:n.isFolder(h.type)?i[1018]=1:n.isPhoto(h.type)?i[1020]=1:h.type=="CG"?i[1016]=1:h.type=="LV"?i[1024]=1:h.type=="MU"?i[1028]=1:h.type=="PPL"?i[1025]=1:h.type=="MD"?i[1026]=1:i[1019]=1}if(n.config.wsbEnableRandomization){let t=n.Host.getConversationId(),r=n.getRNG(t);if(n.config.wsbRandomizationProbability==1||r()<n.config.wsbRandomizationProbability){let r=t+y+h.type+l,u=n.getRNG(r);i[1060]=n.trimFeatureStoreValue(u())}}n.removeUndefinedAndZeroAndTrimValues(i);p.push(i)}return p}setGroupSuppressionSignals(t,i){if(t){t.maxGroupCCR={};t.maxGroupProbSugClickGivenPref={};t.mruGroupBackpropRatios={};t.mruGroupBackpropWeights={};for(let r of i)if(r.featureStore){let i=n.getGroupType(r),u=r.featureStore[94]||0,f=r.featureStore[0]||0;t.maxGroupCCR[i]=t.maxGroupCCR[i]?Math.max(t.maxGroupCCR[i],u):u;t.maxGroupProbSugClickGivenPref[i]=t.maxGroupProbSugClickGivenPref[i]?Math.max(t.maxGroupProbSugClickGivenPref[i],f):f;t.mruGroupBackpropRatios[i]=r.featureStore[266];t.mruGroupBackpropWeights[i]=r.featureStore[267];(t.mruGroupBackpropWeights[i]||t.mruGroupBackpropRatios[i])&&(t.backPropDataExists=!0)}}}setMRUGroupLaunchRatios(t,i,r,u,f,e){var o,s,h,c,l,a,v,y;if(r){e&&(e.mruGroupRatios={});t[186]=f/r;for(let f in u){let p=u[f]/r;n.getGroupType(i)==Number(f)&&(t[271]=p);e&&(e.mruGroupRatios[f]=p);switch(Number(f)){case n.GroupType.Apps:t[169]=p;break;case n.GroupType.Settings:t[170]=p;break;case n.GroupType.Cortana:t[171]=p;break;case n.GroupType.Command:t[172]=p;break;case n.GroupType.Photos:t[173]=p;break;case n.GroupType.Videos:t[174]=p;break;case n.GroupType.Music:t[175]=p;break;case n.GroupType.Documents:t[176]=p;break;case n.GroupType.Folders:t[177]=p;break;case n.GroupType.Emails:t[178]=p;break;case n.GroupType.Store:t[179]=p;break;case n.GroupType.SearchSuggestions:if(n.config.enableFromYourHistory){t[262]=((o=t[262])!==null&&o!==void 0?o:0)+p;let i=((s=u[n.GroupType.Websites])!==null&&s!==void 0?s:0)+((h=u[n.GroupType.FromYourHistory])!==null&&h!==void 0?h:0);t[180]=i>0?(i+u[f])/r:p}else t[262]=p,t[180]=u[n.GroupType.Websites]?(u[n.GroupType.Websites]+u[f])/r:p;break;case n.GroupType.FromYourHistory:t[262]=((c=t[262])!==null&&c!==void 0?c:0)+p;let i=((l=u[n.GroupType.Websites])!==null&&l!==void 0?l:0)+((a=u[n.GroupType.SearchSuggestions])!==null&&a!==void 0?a:0);t[180]=i>0?(i+u[f])/r:p;break;case n.GroupType.Websites:if(t[263]=p,n.config.enableFromYourHistory){let i=((v=u[n.GroupType.SearchSuggestions])!==null&&v!==void 0?v:0)+((y=u[n.GroupType.FromYourHistory])!==null&&y!==void 0?y:0);t[180]=i>0?(i+u[f])/r:p}else t[180]=u[n.GroupType.SearchSuggestions]?(u[n.GroupType.SearchSuggestions]+u[f])/r:p;break;case n.GroupType.PathCompletion:t[181]=p;break;case n.GroupType.People:t[184]=p;break;case n.GroupType.Bookmarks:t[260]=p;break;case n.GroupType.LocalPlaces:t[261]=p}}}}getRank(t){var i=undefined;if(t.deviceItem&&typeof t.deviceItem.rankScore!="undefined"&&(i=t.deviceItem.rankScore),!n.isNullOrUndefined(t.maxRankScoreForLocalDevice)&&t.maxRankScoreForLocalDevice>i&&(i=t.maxRankScoreForLocalDevice),i!=undefined)return i;let r=n.isJumpListSuggestion(t)?t.jumpListItem.usagePoints:undefined;return typeof r!="undefined"?r:undefined}getSuggestionFeatureStore(t,i,r,u,f,e){let o={};this.setTypeSignal(i,o);let l=n.getAppItem(i);l?(o[2]=l.totalLaunches,o[92]=l.launchArguments?1:0,f>0&&(o[103]=l.totalLaunches/f),this.addLastAccessDate(l.lastAccessed,o)):this.addLastAccessDate(n.isJumpListSuggestion(i)?i.jumpListItem.lastAccessed:null,o);o[99]=i.confidence;o[150]=i.source;o[283]=i.pinnedToTaskbar?1:undefined;i.hc&&(o[189]=1);n.config.wsbEnableWebLMFeatures&&i.highConfidenceSuggestionScore&&(o[1090]=i.highConfidenceSuggestionScore);o[17]=i.highConfidenceMetaSuggestionScore;let p=this.getRank(i);typeof p!="undefined"?o[16]=p:o[4]=1;var h=i;h.matchedOnlyOnContent&&(o[259]=1);h.matchedOnlyOnAuthor&&(o[273]=1);h.lastModifiedDate&&(o[268]=n.getTimeDiffInDays(h.lastModifiedDate));n.config.populateLastAccessDateForFiles&&h.lastAccessDate&&(o[9]=n.getTimeDiffInDays(h.lastAccessDate),o[19]=0);h.extensionLC==".lnk"&&(o[272]=1);(n.config.enableCopIFFExpPlan||n.config.mergeMultipleResouces)&&(i.isLexicalMatched&&(o[1040]=1),i.isFullTextMatched&&(o[1041]=1),i.isPolarisMatched&&(o[1042]=1),i.isVegaMatched&&(o[1043]=1),i.indexerIntentFeature&&(o[1050]=1));n.Host.getJupiterProviderEnabled()&&(i.isJupiterMatched&&(o[1044]=1),i.indexerIntentFeature&&(o[1050]=1));o[23]=i.prefetchConfidenceScore;o[264]=u&&u.ProbNextKS!==undefined?u.ProbNextKS:1;o[296]=u&&u.ProbNextKSV2!==undefined?u.ProbNextKSV2:1;this.setThresholdRatios(o,u);this.setRatios(o,u);let a=n.getGroupType(i),v=i.query;i.type=="SW"&&(v="SearchTheWeb");let y=n.getAthenaGroupKey(String(a),String(i.handoffType),i.type);n.setEngagementSignals(o,r,y,v,!1,!1);n.setEngagementSignals(o,e,y,v,!1,!0);e&&!r&&n.setEngagementSignals(o,e,y,v,!1,!1);o[10]=t.length;(i.isAnswer||a==n.GroupType.Cortana)&&(o[11]=1);let c=n.getTextForLexicalFeatures(i),s=c?c.toLocaleLowerCase():null;c||(o[132]=1);s==t&&(o[133]=1);i.handoffType==2&&(o[8]=1,n.isSetting(i.type)&&(o[64]=1),n.isApp(i.type)&&(o[83]=1));(a==n.GroupType.SearchSuggestions||n.config.enableFromYourHistory&&a==n.GroupType.FromYourHistory)&&(i.type!="SW"&&(o[82]=1),o[25]=1);let w=o[132]==1;if(w?o[137]=t.length:(o[137]=c.length,o[134]=n.getEditDistance(t,s),o[135]=Math.min(100,n.computeEditDistanceRatio(o[134],t.length,c.length)),o[136]=n.isWordBoundary(t,c),o[284]=Math.abs(c.length-t.length)),!w&&s){s.indexOf(t)>-1&&(o[143]=1);s.substring(0,t.length)===t&&(o[188]=1);let i=s.split(" ");for(let n of i)if(n==t){o[145]=1;break}o[420]=n.computeJaroSimilarity(t,s);o[421]=n.computeJaroWinklerSimilarity(t,s)}if(o[1]==1&&i.deviceItem){let t=n.getAppItem(i);t.extension&&(o[400]=t.extension===".exe"?1:0,o[401]=t.extension===".appref-ms"?1:0);s&&(o[402]=s.indexOf("install")>-1?1:0)}if(!o[1]&&(n.isDocument(i.type)||n.isFolder(i.type)||i.type=="ST")&&(o[403]=1),(i.type=="QP"||i.type=="QS"||i.type=="SC"||i.type=="OS")&&(o[404]=1),o[8]==1&&(o[27]=o[133]),(i.isAnswer||a==n.GroupType.Cortana)&&(o[55]=o[133]),(i.type=="HS"||i.fromHistory)&&(o[121]=1),o[41]=o[83]==1?o[40]:o[64]==1?o[39]:o[11]==1?o[32]:o[89]==1?o[54]:o[85]==1?o[30]:o[86]==1?o[53]:o[87]==1?o[52]:o[61]==1?o[31]:o[88]==1?o[51]:o[63]==1?o[35]:o[82]==1?o[29]:o[90]==1?o[50]:o[59]==1?o[34]:o[37],n.isSetting(i.type)||n.isApp(i.type)){let n=i.ciMetaData;this.computeConstraintIndexFeatures(i.deviceItem,o,n);i.ciMatchedQuery=this.getConstraintIndexMatchedQuery(n);o[269]&&o[270]&&(o[405]=Math.sqrt(o[269]*o[270]))}return i.signals&&(o[230]=i.signals.DistanceToEntity,o[231]=i.signals.DistanceToEntityPrecision,o[232]=i.signals.RankingScore),n.config.wsbEnableWebLMFeatures&&i.suggestionLogMeta&&this.setSuggestionLogMetaFeatures(i.suggestionLogMeta,o),o}setSuggestionLogMetaFeatures(t,i){t.split(";").forEach(t=>{const[r,u]=t.split(":").map(n=>n===null||n===void 0?void 0:n.trim());if(r&&u){const f=parseInt(r),e=parseFloat(u.replace(/"/g,""));if(!isNaN(f)&&!isNaN(e)){const o=n.AutoSuggestFeatureMap[f];o&&(i[o]=e)}}})}addLastAccessDate(t,i){let r=n.getTimeDiffInDays(t);r!=null?i[9]=r:i[19]=1}setTypeSignal(n,t){switch(n.type){case"LDOC":case"FL":case"PSFL":case"CSFL":t[61]=1;break;case"LI":case"PSLI":case"CSLI":t[85]=1;break;case"LV":t[86]=1;break;case"MU":t[87]=1;break;case"FD":case"PSFD":case"CSFD":t[88]=1;break;case"CG":t[89]=1;break;case"PT":t[90]=1;break;case"PP":case"IBA":t[1]=1;break;case"ML":case"MD":t[21]=1;break;case"SPP":case"SAPP":t[1014]=1;break;case"SW":t[59]=1}}setRatios(n,t){t&&t.AppsRatio!==undefined&&(n[26]=t.AppsRatio,t.SettingsRatio&&(n[5]=t.SettingsRatio),t.StoreRatio&&(n[57]=t.StoreRatio),t.PrefixProbability&&(n[12]=t.PrefixProbability),t.FilesRatio&&(n[24]=t.FilesRatio),t.WebRatio&&(n[18]=t.WebRatio),t.PhotosVideosMusicRatio&&(n[28]=t.PhotosVideosMusicRatio),t.ContactsRatio&&(n[56]=t.ContactsRatio),t.LocalProtocolRatio&&(n[91]=t.LocalProtocolRatio))}setThresholdRatios(n,t){t&&t.ThApps!==undefined?(n[40]=t.ThApps,t.ThStore&&(n[35]=t.ThStore),t.ThSetting&&(n[39]=t.ThSetting),t.ThCortAns&&(n[32]=t.ThCortAns),t.ThPrefixCount&&(n[38]=t.ThPrefixCount),t.ThWeb&&(n[29]=t.ThWeb),t.ThSearchTheWeb&&(n[34]=t.ThSearchTheWeb),t.ThOther&&(n[37]=t.ThOther),t.ThFile&&(n[31]=t.ThFile),t.ThFolder&&(n[51]=t.ThFolder),t.ThPath&&(n[50]=t.ThPath),t.ThEmail&&(n[33]=t.ThEmail),t.ThCommAns&&(n[54]=t.ThCommAns),t.ThPhotoAns&&(n[30]=t.ThPhotoAns),t.ThVideoAns&&(n[53]=t.ThVideoAns),t.ThMusicAns&&(n[52]=t.ThMusicAns),t.ThDNav&&(n[147]=t.ThDNav)):n[42]=1}computeConstraintIndexFeatures(n,t,i){if(n&&n.rawIndexResponse){if(!i)return;if(t[157]=i.GrammarScore,t[158]=i.MatchScore,i.Parses&&i.Parses.length>0&&i.Parses[0].Entities&&i.Parses[0].Entities.length>0)for(let n of i.Parses[0].Entities)if(t[159]=n.EntityScore,n.Attributes)for(let i of n.Attributes)i.Name=="gscore"?t[269]=Number(i.Value):i.Name=="lscore"&&(t[270]=Number(i.Value))}}getConstraintIndexMatchedQuery(n){return!n||n.MatchScore==0?null:n.Query}getLocalHourBucket(n){let t=n.getHours(),i=1;return t>=0&&t<6?i=1:t>=6&&t<12?i=2:t>=12&&t<18?i=3:t>=18&&t<=23&&(i=4),i}}t.FastRankRanker=f})(t=n.Ranking||(n.Ranking={}))}(WSB||(WSB={})),function(n){class t{constructor(t){this._instrumentationProvider=t;n.Host.bindDismissed(()=>this.flushAggregatedMeasure(!0));this._keystrokeAggregatedFunctionPerf={}}onNewKeystroke(n,t,i){this.flushAggregatedMeasure();this._aggregatedMeasureFlushed=!1;this._currentLeftPaneSuggestions=null;this._currentRawImpressionGuid=t;this._currentRawClientImpressionGuid=SearchAppWrapper.CortanaApp.impressionId;this._keystrokeAggregatedMeasure={CVID:n,WebView2Info:this._instrumentationProvider.getWebView2Info()};this._keystrokeAggregatedFunctionPerf={};this._currentKeystrokeAggregatedMeasureIsForSearchHome=i}flushAggregatedMeasure(t){if((t||this._currentKeystrokeAggregatedMeasureIsForSearchHome)&&!this._aggregatedMeasureFlushed){if(n.config.logClientPerf){let n=Object.keys(this._keystrokeAggregatedFunctionPerf);if(this._keystrokeAggregatedFunctionPerf&&n.length>0){let t="";for(let i of n){let n=this._keystrokeAggregatedFunctionPerf[i];t+=n.functionName+","+n.numCalls+","+n.totalDuration+";"}t=t.substr(0,t.length-1);this._instrumentationProvider.logProfilerMarker(1,0,"KeystrokeAggregatedFuncPerf",this._currentRawClientImpressionGuid,t)}}else this._keystrokeAggregatedMeasure&&Object.keys(this._keystrokeAggregatedMeasure).length>1&&this.logProfilerMarker(1,0,"KeystrokeAggregatedMeasure",this._currentRawImpressionGuid,this._currentRawClientImpressionGuid,this._keystrokeAggregatedMeasure);this._aggregatedMeasureFlushed=!0}}logSingleMeasure(n,t,i){this.logProfilerMarker(1,0,n,t,SearchAppWrapper.CortanaApp.impressionId||t,i)}logProfilerMarker(n,t,i,r,u,f){f&&typeof f!="string"&&u!=r&&(f.ServerIG=r);this._instrumentationProvider.logProfilerMarker(n,t,i,u,f)}logAggregate(n,t){this._keystrokeAggregatedMeasure[n]=t}logAggregateFunctionPerf(n,t){let i=this._keystrokeAggregatedFunctionPerf[n];this._keystrokeAggregatedFunctionPerf[n]=i?{functionName:i.functionName,numCalls:i.numCalls+1,totalDuration:i.totalDuration+t}:{functionName:n,numCalls:1,totalDuration:t}}getItemLayoutFromSuggestionsList(n){if(this._currentLeftPaneSuggestions){const t=this._currentLeftPaneSuggestions.topResults,i=this._currentLeftPaneSuggestions.groups;for(let i=0;i<t.length;++i)if(t[i].instItem==n)return{IsInTopResult:!0,GroupType:undefined,PositionInGroup:i};for(let t of i)for(let i=0;i<t.suggestions.length;++i)if(t.suggestions[i].instItem==n)return{IsInTopResult:undefined,GroupType:t.typeWithSource.type,PositionInGroup:i}}return undefined}updateSuggestionsList(n,t){this._currentLeftPaneSuggestions={topResults:n,groups:t}}logDataSourcePerformancesMeasure(n){let t=n.RequestBegin,i=Object.keys(n.ResponseReceived).map(i=>({Name:i,ResponseReceivedTime:n.ResponseReceived[i]-t,RenderedTime:n.RenderFinished[i]-t,Status:n.DataSourcesState&&n.DataSourcesState[i]})),r=n.TopResultRendered.map(n=>({Type:n.T,Time:n.V-t})),u={DataSources:i,TopResultRendered:r};this.logAggregate("DataSourcePerformancesMeasure",u)}logNewKeystrokeMeasure(t,i,r){this.onNewKeystroke(t,i,r.isSearchHomeZI);let u={ScopeInQuery:r.scopePrefix,Scope:r.scope,IsSearchHome:r.isSearchHomeZI};u.CIVersion=n.ConstraintIndex.currentCIVersion;this.logAggregate("NewKeystrokeMeasure",u)}logTopResultsRenderedMeasure(n,t){const i=this._instrumentationProvider.getWebView2Info();this._instrumentationProvider.logProfilerMarker(1,0,"topResultRendered",n,"IsWebView2:"+(i.isWebView2?1:0)+",WebView2Version:"+i.webView2Version);let r={SuggestionTypes:t};this.logAggregate("TopResultsRenderedMeasure",r)}logGroupsRenderedMeasure(n){let t={GroupTypes:n};this.logAggregate("GroupsRenderedMeasure",t)}logPreviewPaneOpenedMeasure(t,i,r){const u=this._instrumentationProvider.getWebView2Info();this._instrumentationProvider.logProfilerMarker(1,0,"previewPaneOpened",this._currentRawClientImpressionGuid,n.getPreviewPaneTypeAsString(i)+",IsWebView2:"+(u.isWebView2?1:0)+",WebView2Version:"+u.webView2Version);let f={ParentType:t.getQsCode(),PreviewPaneType:i,ParentLayoutInfo:this.getItemLayoutFromSuggestionsList(t),AutoOpened:r||undefined};this.logAggregate("LastPreviewPaneOpened",f)}logConversationStartMeasure(n){const t=this._instrumentationProvider.getWebView2Info();this.logSingleMeasure("ConversationStartMeasure",n,"IsWebView2:"+(t.isWebView2?1:0)+",WebView2Version:"+t.webView2Version)}logItemClickedMeasure(n,t,i,r){let u={CVID:n,ItemType:i.getQsCode(),InputType:r,LayoutInfo:this.getItemLayoutFromSuggestionsList(i)};this.flushAggregatedMeasure(!0);this.logSingleMeasure("ItemClickedMeasure",t,u);this.logUserEngagementTelemetry(t,i)}logUserEngagementTelemetry(t,i){var r;n.config.enableUserEngagementLog&&(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(49805431))&&!n.isNullOrUndefined(SearchAppWrapper)&&!n.isNullOrUndefined(SearchAppWrapper===null||SearchAppWrapper===void 0?void 0:SearchAppWrapper.CortanaApp)&&typeof((r=SearchAppWrapper===null||SearchAppWrapper===void 0?void 0:SearchAppWrapper.CortanaApp)===null||r===void 0?void 0:r.logCriticalUserEngagementTelemetry)=="function"&&n.safeExecute(()=>{var n;let r=i.getUserEngagementContent();(n=SearchAppWrapper===null||SearchAppWrapper===void 0?void 0:SearchAppWrapper.CortanaApp)===null||n===void 0?void 0:n.logCriticalUserEngagementTelemetry(JSON.stringify(r),t)},"logUserEngagementTelemetry")}logItemDwellMeasure(n,t){this.logUserEngagementTelemetry(n,t)}logQFSuggestionsIndexerMatchTypeList(t){var i,r,u;typeof((u=(r=(i=SearchAppWrapper===null||SearchAppWrapper===void 0?void 0:SearchAppWrapper.CortanaApp)===null||i===void 0?void 0:i.queryFormulationView)===null||r===void 0?void 0:r.deviceSearch)===null||u===void 0?void 0:u.onDeviceItemsDisplayed)=="function"&&n.safeExecute(()=>{var n,i,r;(r=(i=(n=SearchAppWrapper===null||SearchAppWrapper===void 0?void 0:SearchAppWrapper.CortanaApp)===null||n===void 0?void 0:n.queryFormulationView)===null||i===void 0?void 0:i.deviceSearch)===null||r===void 0?void 0:r.onDeviceItemsDisplayed(t)},"logQFSuggestionsIndexerMatchTypeList")}logPreviewPaneItemClickMeasure(t,i){n.safeExecute(()=>{if(t.vbt&&!n.isNullOrUndefined(i)&&typeof i.onItemAction=="function"){let r=n.JumplistActionItemType[t.vbt];const u="S_";r.startsWith(u)&&(r=r.substring(u.length));r==="Open"&&(r="Launch");i.onItemAction(r)}},"logPreviewPaneItemClickMeasure")}logPreviewPaneDwellMeasure(t){n.safeExecute(()=>{let n=t===null||t===void 0?void 0:t.deviceItem;typeof(n===null||n===void 0?void 0:n.onItemAction)=="function"&&(n===null||n===void 0?void 0:n.onItemAction("Dwell"))},"logPreviewPaneDwellMeasure")}logFlightState(n,t){this.logSingleMeasure("BingExpFlight",this._currentRawClientImpressionGuid,`FX:${t?1:0}${n}`)}}n.WindowsTelemetry=t}(WSB||(WSB={})),function(n){const t=/[+.\\*?\[\]()]/g,i={".":"\\.","+":"\\+","*":"\\*","\\":"\\\\","?":"\\?","[":"\\[","]":"\\]","(":"\\(",")":"\\)"},r=/^(?:https?:\/\/)?(.*)/,u=/^(?:(?:https?:\/\/(?:www\.)?)|(?:www\.))(.*)/,f=/^\s+/;class e{constructor(){n.Host.bindKeyDown(t=>{n.isUpOrDownKey(t)&&this.reset()});n.Host.bindQueryChangedOrInitialized(n=>{this._currentQuery=n,!this._fullAutoCompletedQuery||this._fullAutoCompletedQuery.startsWith(n.originalQuery)||n.originalQuery.startsWith(this._fullAutoCompletedQuery)||this.reset()})}apply(t){if(t.query!=this._autoCompletedQuery){let i=this._currentQuery.originalQuery;if(n.Host.setAutoCompleteQueryText(""),this._currentQuery.originalCursorPosition===i.length){let u=this._currentQuery.scopePrefix?this._currentQuery.scopePrefix.length+1:0,n=i.substr(u).replace(f,"").toLowerCase(),r=t.query.toLowerCase();if(n!==r){let f=1,u=this.fullAutoCompleteOffset(r,n);if(u<0&&t.url&&(u=this.infixAutoCompleteOffset(r,n),f=2),u<0&&(u=this.directNavAutoCompleteOffset(r,n)),u>=0){this.setAutoCompletedQuery(i,t.query,u);t.autoCompleteType=f;return}}}this._autoCompletedQuery&&(this.reset(),n.Host.setAutoCompleteQueryText(i))}}reset(){this._autoCompletedQuery=null;this._fullAutoCompletedQuery=null}fullAutoCompleteOffset(n,t){let i=n.startsWith(t);return i?t.length:-1}infixAutoCompleteOffset(n,u){let f=n.search("[ .:,\\\\/+_&-]"+u.replace(t,n=>i[n]));if(f>0){let t=n.substring(0,f+1).match(r)[1],i=t?t.match(/[ .:,\\/+_&-]+/g).length+1:1;if(i<3)return f+1+u.length}return-1}directNavAutoCompleteOffset(n,t){let i=t.match(u);if(i){let t=i[1];if(t.length>0&&n.startsWith(i[1]))return t.length}return-1}setAutoCompletedQuery(t,i,r){let u=t+i.slice(r);n.Host.setAutoCompleteQueryText(u);this._autoCompletedQuery=i;this._fullAutoCompletedQuery=u}}n.WSBAutoComplete=e}(WSB||(WSB={})),function(n){var t;(function(t){function i(n,t){return!n.suppressed&&n.handoffType==0&&!n.htmlContent&&n.query.toLocaleLowerCase()==t.queryToFetch.toLocaleLowerCase()}function f(n){return n.length>=2&&n[0].type=="MB"&&n[1].type=="MB"}function e(t){var i,r;return t.length>=2&&(n.isStore((i=t[0])===null||i===void 0?void 0:i.type)||n.isStore((r=t[1])===null||r===void 0?void 0:r.type))}let r;(function(n){n[n.NotDuplicate=0]="NotDuplicate";n[n.NoMetadata=1]="NoMetadata";n[n.MergeMetadata=2]="MergeMetadata"})(r||(r={}));const u={"{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\\cmd.exe":{appToPromote:"Microsoft.WindowsTerminal_8wekyb3d8bbwe!App",enabled:n.config.promoteTerminalOverCmd},"Microsoft.Windows.MediaPlayer32":{appToPromote:"Microsoft.ZuneMusic_8wekyb3d8bbwe!Microsoft.ZuneMusic",enabled:n.config.demoteWindowsMediaPlayer}};t.isWebSuggestionForPrefix=i;t.topHitIsMultiEntity=f;t.topHitHasStoreApp=e;class o{constructor(n,t,i,r,u,f,e){this._navigationHelper=n;this._previousKeystrokeCache=t;this._ranker=i;this._renderedTopResults=r;this._previewPane=u;this._upsellViewModel=f;this._copilotViewModel=e}launchWebSearch(t,i,r,u,f){let e=t.queryToFetch;n.Host.launchSearchAsync(e,this._navigationHelper.getSearchUrl(t.fullPartialQuery,e,r,null,u,undefined,undefined,undefined,undefined,f),i,r)}getProtocol(t,i){let u="PWL",r=n.InstrumentationHelper.getInstrumentedSyntheticSuggestion(i,u);if(r)return r;r=n.createSuggestion(t,null,n.Host.getEdgeIcon,null,u,null,n.InstrumentedItem.getNonSuggestionInstrumentedItem(u,n.SyntheticQSCodesMaps.KValues),1,i,!1,"tp",()=>n.Host.launchUrlWithHttpProtocolAsync(r.url,{medium:"MSBLink"}));r.notAResult=!0;let f=t=>{let i=n.prettyPrintUrl(t.fixedUrl,t.queryToFetch,!0);r.url=t.fixedUrl;r.tooltip=t.fixedUrl;r.query=i;r.text=HitHighlightingParser.addMarkers(i);r.narratorText=n.getNarratorText(r,n.Host.getLocString("DirectNavSuggestion"));r.reactKey=u+t.fixedUrl};return f(t),r.updateFromQuery=n=>n.isProtocol?(f(n),!0):!1,n.InstrumentationHelper.instrumentSyntheticSuggestion(i,r),r}getWebSearch(t,i,r,u,f,e){let o=n.contains([13,14],f);return n.getSyntheticSuggestion(t,i,r,u,f,e,o,(n,t)=>this.launchWebSearch(t,n.useRaf,r,f,n.msbVerticalHash))}getExplorerSearch(t,i){let r=n.getSyntheticSuggestion(t,i,"SDFE",{content:"",type:1},2,n.Host.getLocString("SearchInFileExplorer"),!0,(t,i)=>n.Host.launchSearchInFileExplorer(i.queryToFetch));return n.shouldSetThisPcGroupSource(n.GroupType.Documents,t)&&(r.sourceForGroup=1),r}getOutlookWebAccessSearch(t,i){let r=n.AccessTokenManager.getWindowsAccountType()==1;return n.getSyntheticSuggestion(t,i,"OWA",{content:"",type:2},r?8:12,n.Host.getLocString("SearchInOutlookWeb"),!0,()=>{r?n.Host.launchUrlWithHttpProtocolAsync("https://outlook.office.com/owa",{medium:"MSBLink"}):n.Host.launchUrlWithEdgeProtocolAsync("https://outlook.live.com/owa",{medium:"MSBLink"})})}getStoreSearch(t,i){return n.getSyntheticSuggestion(t,i,"STS",{content:"",type:2},3,n.Host.getLocString("SearchForAppsInTheStore"),!0,(t,i)=>n.Host.launchStoreSearchAsync(i.queryToFetch))}getRecourse(t,i){var r;if(!t.queryToFetch||t.taskFrame)return null;switch(n.getEffectiveScope(t)){case n.Scope.Apps:return n.isBingEnabled()&&((r=SearchAppWrapper.CortanaApp.isStoreAppEnabled)!==null&&r!==void 0?r:!0)?this.getStoreSearch(t,i):null;case n.Scope.Documents:return this.getExplorerSearch(t,i);case n.Scope.Emails:return n.ScopeConfig[n.Scope.Emails].showUpsellOnSuggestionsList()?null:this.getOutlookWebAccessSearch(t,i);case n.Scope.Photos:return n.isWebResultsDisabled()?null:this.getWebSearch(t,i,"SBI",{content:"",type:2},13,n.Host.getLocString("SearchForWebImages"));case n.Scope.Videos:return n.isWebResultsDisabled()?null:this.getWebSearch(t,i,"SBV",{content:"",type:1},14,n.Host.getLocString("SearchForWebVideos"));default:return null}}getSyntheticSuggestions(t,i,r){var u,o;const l=n.getScopeConfig(t),a=l.webSyntheticEnabled&&l.webSyntheticEnabled(t),f=0,e="SW";n.canShowCopilotQF()?(r&&r.QIC&&(o=r.QIC.rankerExtraInfo.confidence),o&&o[0]==n.QueryIntentClassification.Conversation?u=this._copilotViewModel.getCopilotSuggestion():a&&(u=this.getWebSearch(t,i,e,n.getSearchSuggestionIcon(),f,n.getWebSuggestionAnnotation(n.msbEnabledForQuery(t))))):a&&(n.shouldQFSuggToBingChat(f,t.originalQuery,"SW")?(u=n.getSyntheticSuggestion(t,i,e,undefined,f,n.getWebSuggestionAnnotation(),!1,(t,i)=>n.Host.launchSearchAsync(i.queryToFetch,this._navigationHelper.getSearchUrl(i.fullPartialQuery,i.queryToFetch,e,n.replaceSearchWithChatPath(n.appendBingChatParams(`/search?q=${n.encodeQueryParameter(i.queryToFetch)}`)),f,"WSBQFC"),t===null||t===void 0?void 0:t.useRaf,"WSBQFC")),n.setSearchSuggestionChatIcon(u),n.getGroupType(u)===n.GroupType.ChatWithBing&&(u.primaryMetadata=n.Host.getLocString("CodexChatButtonUpperRight"))):u=this.getWebSearch(t,i,e,n.getSearchSuggestionIcon(),f,n.getWebSuggestionAnnotation(n.msbEnabledForQuery(t))));let v;v=n.isThirdPartySearchAllowed()?null:t.isProtocol&&n.RuntimeConfig.AllowProtocolSyntheticSuggestions?this.getProtocol(t,i):null;const s=this.getRecourse(t,i);s&&(s.rankingScore=-Number.MAX_VALUE);const h=[];t.scope==n.Scope.All&&t.isSearchHomeZI&&n.msbHost&&n.msbHost.qfUtils.isDocumentZeroQueryEnabled()&&n.msbHost.features.isQwsEnabled()&&n.isMsbEnterprise()&&!n.msbHost.isGccHighTenant()&&h.push(n.msbHost.qfUtils.getOnRampButtonSuggestion(t,i));this._upsellViewModel&&h.push(this._upsellViewModel.getUpsellSyntheticSuggestion(t,i));let c=[];if(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.features.isWorkScopeApplicable()){c=n.msbHost.verticalManager.getSyntheticSuggestions(t,i);for(const n of c)if(n&&(n.click=()=>this.launchWebSearch(t,n.useRaf,n.type,n.handoffType,n.msbVerticalHash),n.childSuggestions!=undefined))for(const i of n.childSuggestions)i.click=()=>this.launchWebSearch(t,i.useRaf,i.type,i.handoffType,i.msbVerticalHash)}return{protocol:v,searchTheWeb:u,recourse:s,msbVerticals:c,others:h.filter(n=>!!n)}}canHaveDuplicates(t,i){switch(t){case"Web":case"MRU":case"MWS":case"RWQ":case"OSTMA":case"OSTMAN":case"MSBC":case"QS":case"PP":case"IBA":case"LRA":case"ST":case"FL":case"LM":case"IFF":case"CG":case"PT":case"MPP":case"MST":case"MFF":case"MRS":case"MPVD":case"MDOC":case"MFOL":case"MPHO":case"MVID":case"MMUS":case"SSUE":case"SSUC":case"ANA":case"QWQS":case"CoPIFF":case"CoPCFP":case"CoPST":case"TPWeb":case"SWMF":return!0;case"SMA":case"FEH":case"TOPP":case"QSCH":case"TS":case"AIF":case"DFLS":case"CUSE":case"SREE":case"SAPP":return!1;case"SSEE":return i.scope==n.Scope.Documents||i.scope==n.Scope.Emails||n.RuntimeConfig.QfMode==5;case"SSEC":return i.scope==n.Scope.Emails;case"RSH":return!1}throw new Error("New data source "+t+" needs to be explicity classified as needed deduping with other data sources or not");}canHaveDuplicatesWithinDataSource(t,i){switch(t){case"MPP":case"MST":case"MRU":case"ST":case"MSBC":case"MWS":case"TPWeb":return!0;case"SSEE":case"SSEC":return i.scope==n.Scope.Emails}return n.supportsShortcuts(t,i)}mergeDuplicates(t,i,u){let f=n.isDuplicate(t,i,u);return f?(i.type==="MFIL"||u.type==="MFIL")&&n.config.msbReplaceDupLocalFiles&&u.type==="MFIL"?!0:(f==r.MergeMetadata&&n.enrichMetadataFromDuplicate(t,i,u),n.Host.getJupiterProviderEnabled()&&f==r.NoMetadata&&n.checkAndEnrichMetaForSettingSuggestions(i,u))?!0:(i.duplicates=i.duplicates||[],n.contains(i.duplicates,u)||(i.duplicates.push(u),i.needsRefreshAfterDeduping=!0,i.previewPaneNeedsRefreshAfterDeduping=f==r.MergeMetadata),!0):!1}shuffle(n,t){let i=n.length,r=0;while(i!==0)r=Math.floor(t()*i),i--,[n[i],n[r]]=[n[r],n[i]];return n}rank(t,r,u,f,e,o,s){var b,k;const it=n.isL2(f);it&&(s=!1);let y=u.Web,d=y?y.rankingSignals:null,st=y?y.webTopResultRoutingType:1,p=u.MRU,rt=null,v=null,ut=null;d&&(d.WebSignalsAvailable=!0,rt=y.engagementSignals,v=y.suppressedGroups);this._previousKeystrokeCache&&(ut=this._previousKeystrokeCache.getPreviousEventWebSignalsData(f.queryToFetch));let ht=p?p.SuggestionEngagementData:null,ct=p?p.LookupCompletions:null,lt={cvid:n.Host.getConversationId(),privacyNumber:n.Host.getPrivacyNumber()},a=this.getSyntheticSuggestions(f,o,u);if(f.scope!=n.Scope.Web&&n.config.enableSearchTheWebMaxSuggestions){let i=[n.GroupType.SearchSuggestions,n.GroupType.FromYourHistory,n.GroupType.Websites];n.limitWebSuggestions(f,t,r,i,["ANAH","ANAR","ANATH"])}n.config.enableWinStoreAppPreview&&(n.dedupStoreAppsSuggestion(r,t),n.dedupStoreAppsSuggestion(t,r));r=r.slice();v&&(v.fullySuppressedGroups&&v.fullySuppressedGroups.length>0&&(this.removePromotedFSUPGroups(r,v.fullySuppressedGroups),r=r.filter(t=>!n.contains(v.fullySuppressedGroups,String(this.getGroupTypeForSuppressions(t)))||t.type==="SAPP")),v.suppressedSuggestions&&v.suppressedSuggestions.length>0&&(r=r.filter(t=>!n.contains(v.suppressedSuggestions,n.getSuggestionKey(t))||t.type==="SAPP")));t.length==0&&(a.others.length>0&&r.unshift(...a.others),a.protocol&&r.unshift(a.protocol),((b=a.msbVerticals)===null||b===void 0?void 0:b.length)>0&&(a.msbVerticals[0].isQfWorkSuggestionMode=r.length>=1,r.push(...a.msbVerticals)));this.ensureUniqueReactKeys(r);let g=e.length==1&&e[0].childSuggestions&&e[0].childSuggestions.some(n=>n.displayed),ft=this.getSuggestionsToRank(g,t,r,a,o);n.config.bypassRankerOnNoNewSuggestions&&r&&r.length&&(f.hasNewSuggestions=!0);let w=this._ranker.rank(f,ft,d,ht,ct,rt,lt,ut,a);this._previousKeystrokeCache&&!s&&this._previousKeystrokeCache.updateSpellerTriggerData(f.queryToFetch,ft);t.length==0&&a.recourse&&r.push(a.recourse);let c=this.determineTopResults(e,r,w,a,f,o,g);if(n.config.enableWebSynonymScoreTopHit&&((f===null||f===void 0?void 0:f.scope)==n.Scope.All||(f===null||f===void 0?void 0:f.scope)==n.Scope.Apps)){let n=(k=t.find(n=>Math.abs(n.prefetchConfidenceScore-1e4)<Number.MIN_VALUE))!==null&&k!==void 0?k:t.find(n=>{var t;if((t=n.duplicates)!==null&&t!==void 0)return t.some(n=>Math.abs(n.prefetchConfidenceScore-1e4)<Number.MIN_VALUE)});n&&(c.length==0?c.push(n):c[0]!==n&&(c[1]=c[0],c[0]=n))}let nt=t.filter(t=>!n.contains(e,t)),l=this.determineSuggestionsToAddToGroups(it,nt,r,e,c,a,f,g,s);if(n.config.enableMruProviderInQF&&n.config.useRankerRankScore&&(n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())===3){let t=l.filter(n=>(n===null||n===void 0?void 0:n.subType)==="MRUHS");t.sort((n,t)=>t.rankingScore-n.rankingScore);t=t.slice(0,2);l=l.filter(i=>(i===null||i===void 0?void 0:i.subType)!=="MRUHS"||n.contains(t,i))}if(!n.RuntimeConfig.FlatListWithoutGroups&&w.mruSuppressions&&w.mruSuppressions.backPropDataExists)this.applyMRUSuppressions(w,e,c,l,f);else if(v&&v.partiallySuppressedGroups&&this.canPartiallySuppressGroups(c,l,f))for(let t of l)if(!i(t,f)){let i=this.getGroupTypeForSuppressions(t);if(this.canBePartiallySuppressed(t,i)&&n.contains(v.partiallySuppressedGroups,String(i))&&!n.contains(e,t)){if(t.sequenceNumber<n.config.minSequenceForPSUP)continue;t.suppressed=!0}}if(n.config.enableQFChatWithBingSuggestions){let i=[],t=[];for(let r of l)if(r&&(n.getGroupType(r)===n.GroupType.SearchSuggestions||n.config.enableFromYourHistory&&n.getGroupType(r)===n.GroupType.FromYourHistory)&&r.type!="MB"&&n.shouldQFSuggToBingChat(r.handoffType,r.query,r.type)){let u=n.deepCopy(r);u.staticGroupType=n.GroupType.ChatWithBing;u.primaryMetadata=n.Host.getLocString("AskCopilot");u.instItem=n.InstrumentedItem.createInstrumentedItem(o,r.type);i.push(u);n.config.enableQFChatdupSuggestion&&(r.id+="_dup",r.icon=n.getSearchSuggestionIcon(),r.handoffType=0,r.click=()=>n.Host.launchSearchAsync(r.query,this._navigationHelper.getSearchUrl(r.query,r.query,"SW",null,0,undefined,undefined,undefined,undefined),r===null||r===void 0?void 0:r.useRaf),r.reactKey+="dup",t.push(r))}else t.push(r);n.InstrumentationHelper.instrumentDataSource(o,"Web",i,null);t=t.concat(i);l=t.slice()}let tt=[];this.removeProtocolIfDuplicate(f,a,c,nt,l,tt);this.setUseRafFlag(c,l,f,st);let h=this.getGroupOrder(f,l,nt);if(f.staticGroupOrder){let n=[];for(let t of f.staticGroupOrder){let i=h.findIndex(n=>n.type==t);i>=0&&(n.push(h[i]),h.splice(i,1))}n.length>0&&(n.push(...h),h=n)}else if(f.forceGroupOnTop){let i=f.forceGroupOnTop,t=h.findIndex(t=>n.sameGroup(t,i));if(t>=0&&(h.splice(t,1),h.unshift(i)),t=h.findIndex(t=>n.isTopHitChildGroup(t)),t>=0){let n=h[t];h.splice(t,1);h.unshift(n)}}if(n.RuntimeConfig.FlatListWithoutGroups&&(c=c.concat(l.filter(n=>!n.suppressed)),l=[],n.trimList(c,n.RuntimeConfig.MaxSuggestionsWhenFlatList,i=>!n.contains(t,i)&&!i.notAResult),tt.length!=0))throw new Error("Can't remove suggestions from groups when there are no groups");if(n.config.promoteEdgeOverIE&&this.promoteEdgeOverInternetExplorer(l,c),n.config.transitionIEToEdge&&this.transitionInternetExplorerToEdge(c),n.config.enablePartnerPromotions&&this.promotePartnerSuggestions(l,c,f.queryToFetch),n.config.enablePromoteWebSuggestionsGroup&&c.length>0){const t=n.isApp(c[0].type);if(t){let t=h.findIndex(t=>t.type==n.GroupType.SearchSuggestions);if(t!==-1&&t!==0){let n=h.splice(t,1);h.splice(0,0,n[0])}}}if(n.config.enablePromoteWebSuggestionsGroupForAll&&f.scope==n.Scope.All){let t=h.findIndex(t=>t.type==n.GroupType.SearchSuggestions),i=h.findIndex(t=>t.type==n.GroupType.Related);if(i!==-1&&i==0){if(t!==-1&&t!==0){let n=h.splice(t,1);h.splice(1,0,n[0])}}else if(t!==-1&&t!==0){let n=h.splice(t,1);h.splice(0,0,n[0])}}let at=h.slice(0);const et=c.filter(t=>n.isMsbQFSuggestion(t)).length>0,ot=c.filter(t=>n.isWebSuggestion(t)||t.isAnswer).length>0;if(et?h=this.promoteMsbSuggestions(c,h):ot&&(h=this.promoteMsbSuggestionsAboveWeb(h)),(ot||et)&&l.forEach(t=>{if(n.isMsbQFSuggestion(t)){const i=n.getGroupType(t);this.isMsbGroupTypePromoted(i,at,h)&&(t.suppressed=!1)}}),n.config.trendingSearchAboveTiles){let t=h.findIndex(t=>t.type==n.GroupType.TopApps||t.type==n.GroupType.AnaheimDataTile),i=h.findIndex(t=>t.type==n.GroupType.TrendingSearchData);if(t!==-1)if(i!==-1){let r=h.splice(i,1);if(h.splice(t,0,r[0]),n.config.anaheimDataListAboveTiles){let i=h.findIndex(t=>t.type==n.GroupType.AnaheimDataList);if(i!==-1){let n=h.splice(i,1);h.splice(t+1,0,n[0])}}}else if(n.config.anaheimDataListAboveTiles){let i=h.findIndex(t=>t.type==n.GroupType.AnaheimDataList);if(i!==-1){let n=h.splice(i,1);h.splice(t,0,n[0])}}}else if(n.config.anaheimDataListAboveTiles){let t=h.findIndex(t=>t.type==n.GroupType.TopApps||t.type==n.GroupType.AnaheimDataTile),i=h.findIndex(t=>t.type==n.GroupType.AnaheimDataList);if(t!==-1&&i!==-1){let n=h.splice(i,1);h.splice(t,0,n[0])}}if(n.config.trendingSearchInWin11LeftPane){const i=h.findIndex(t=>t.type===n.GroupType.MRUHistory),t=h.findIndex(t=>t.type===n.GroupType.TrendingSearchData);i==-1&&t>-1&&(h.splice(t,1),l=l.filter(n=>n.type!=="TS"))}if(n.config.enableFromYourHistory&&(h=this.promoteTargetGroupBeforeSourceGroup(n.GroupType.FromYourHistory,n.GroupType.SearchSuggestions,h)),n.config.wsbEnableRandomization){let t=n.getRNG(n.Host.getConversationId());(n.config.wsbRandomizationProbability==1||t()<n.config.wsbRandomizationProbability)&&this.shuffle(h,t)}return{topResults:c,suggestionsToAdd:l,suggestionsToRemove:tt,groupOrder:h}}isMsbGroupTypePromoted(t,i,r){let u=-1,f=-1;return t===n.GroupType.Documents?(u=i.findIndex(n=>this.isMsbFileGroupType(n)),f=r.findIndex(n=>this.isMsbFileGroupType(n))):(u=i.findIndex(n=>n.type===t),f=r.findIndex(n=>n.type===t)),f<u}promoteMsbSuggestionsAboveWeb(t){const f=t.filter(t=>t.type==n.GroupType.SearchSuggestions);if(f.length==0)return t;let r=t.filter(n=>this.isMsbGroupTypes(n));if(r.length==0)return t;t=t.filter(n=>!this.isMsbGroupTypes(n));const u=t.findIndex(t=>t.type==n.GroupType.SearchSuggestions);let i=t.slice(0,u);i.push(...r);const e=t.slice(u);return i.push(...e),i}promoteTargetGroupBeforeSourceGroup(n,t,i){let u=i.filter(t=>t.type==n);if(u.length==0)return i;const e=i.filter(n=>n.type==t);if(e.length==0)return i;i=i.filter(t=>t.type!=n);const f=i.findIndex(n=>n.type==t);let r=i.slice(0,f);r.push(...u);const o=i.slice(f);return r.push(...o),r}isArithmeticExpression(n){return/^[\+\-]?((\d*\.\d+|\d+)\s*[\+\-\*\/\^]\s*)+((\d*\.\d+|\d+)\s*)$/.test(n)}promoteMsbSuggestions(t,i){let r=i.filter(n=>this.isMsbGroupTypes(n));const u=r.filter(t=>t.type===n.GroupType.Bookmarks);u.length>0&&(r=r.filter(t=>t.type!==n.GroupType.Bookmarks),r.unshift(...u));const f=t.filter(t=>n.isMsbQFSuggestion(t)&&(t.type==="MPPL"||t.type==="MFIL")).length>0;if(f){const n=r.filter(n=>this.isMsbFileGroupType(n));n.length>0&&(r=r.filter(n=>!this.isMsbFileGroupType(n)),r.unshift(...n))}return r.length>0&&(i=i.filter(n=>!this.isMsbGroupTypes(n)),i.unshift(...r)),i}removePromotedFSUPGroups(t,i){for(let r in n.config.disableFSUPPartnerAppIds){let u=t[t.findIndex(n=>n.deviceItem&&n.deviceItem.id==r)];if(u){let t=this.getGroupTypeForSuppressions(u).toString();n.contains(i,t)&&n.tryRemove(i,t)}}}transitionInternetExplorerToEdge(t){var r;let i=(r=n.Host.getQuery().originalQuery)===null||r===void 0?void 0:r.toLowerCase();if(i==="ie"||(i===null||i===void 0?void 0:i.startsWith("internet e"))){let i=t.findIndex(t=>t.deviceItem&&n.contains(n.AnaheimAppIds,t.deviceItem.id));if(i>=0){t[i].primaryMetadata=n.Host.getLocString("EdgeToIEUpsell");t[i].classNames.twoLineMax||t[i].classNames.push("twoLineMax");let r="&ciaid=actpermedge&source=windowsSearch";t[i].click=n.config.useCobaltCSS?()=>n.Host.launchUrlWithEdgeProtocolAsync("https://go.microsoft.com/fwlink/?linkid=2181241"+r,{medium:"MSBLink"}):()=>n.Host.launchUrlWithEdgeProtocolAsync("https://go.microsoft.com/fwlink/?linkid=2181242"+r,{medium:"MSBLink"})}}}promoteEdgeOverInternetExplorer(t,i){let r=i.findIndex(t=>t.deviceItem&&t.deviceItem.id==n.InternetExplorerId),u=t.findIndex(t=>t.deviceItem&&n.contains(n.AnaheimAppIds,t.deviceItem.id));r>=0&&u>=0&&(i.unshift(t.splice(u,1)[0]),t.unshift(i.splice(r+1,1)[0]))}promotePartnerSuggestions(n,t,i){for(let r in u)if(u[r].enabled){let e=t.findIndex(n=>n.deviceItem&&n.deviceItem.id==r),f=n.findIndex(n=>n.deviceItem&&n.deviceItem.id==u[r].appToPromote);e>=0&&f>=0&&n[f].query.toLocaleLowerCase().includes(i)&&(t.unshift(n.splice(f,1)[0]),n.unshift(t.splice(e+1,1)[0]))}}applyMRUSuppressions(t,r,u,f,e){if(this.canPartiallySuppressGroups(u,f,e)){const o=3.34728026,s=3.523466,h=3.72204852,c=.5865976,l=1.37432766,a=-1.75450325;let u={};for(let v of f)if(!i(v,e)){let i=n.getGroupType(v);if(this.canBePartiallySuppressed(v,i)){if(!u[i]){let r=t.mruSuppressions.maxGroupCCR?t.mruSuppressions.maxGroupCCR[i]||0:0,f=t.mruSuppressions.maxGroupProbSugClickGivenPref?t.mruSuppressions.maxGroupProbSugClickGivenPref[i]||0:0,e=t.mruSuppressions.mruGroupRatios?t.mruSuppressions.mruGroupRatios[i]||0:0,v=t.mruSuppressions.mruGroupBackpropRatios?t.mruSuppressions.mruGroupBackpropRatios[i]||0:0,y=t.mruSuppressions.mruGroupBackpropWeights?t.mruSuppressions.mruGroupBackpropWeights[i]||0:0,p=o*r+s*f+h*e+c*v+l*y+a,w=1/(1+Math.exp(-p));u[i]=n.trimFeatureStoreValue(w)}v.mruSuppressionScore=u[i];let f=this.getGroupSuppressionCutOff(v);if(v.mruSuppressionScore<f&&!n.contains(r,v)){if(n.config.forceCoPilotPoweredResultsVisible&&(n.isDocument(v.type)||n.isPhoto(v.type)||n.isFolder(v.type)))continue;if(n.Host.getJupiterProviderEnabled()&&n.Host.getForceCoPSTResultRenderingEnabled()&&n.isSetting(v.type))continue;v.suppressed=!0}}}}}getGroupSuppressionCutOff(t){return n.config.msbUseSuppressionsThreshold&&n.isMsbQFSuggestion(t)?n.config.msbSuppressionsThreshold:n.config.lRModelCutOff}isMsbFileGroupType(t){return t.type===n.GroupType.Documents&&t.source===7?!0:!1}isMsbGroupTypes(t){return t.type===n.GroupType.People||t.type===n.GroupType.Bookmarks?!0:this.isMsbFileGroupType(t)?!0:!1}allowedInGroups(n){return n.isAnswer?n.allowedInGroups:!0}getGroupTypeForSuppressions(t){let i=n.getGroupType(t);return i==n.GroupType.LocalPlaces?n.GroupType.SearchSuggestions:i}canBePartiallySuppressed(t,i){return n.getScope(i)!=n.Scope.All}canPartiallySuppressGroups(t,i,r){return n.config.noGroupSuppressions&&!n.isThirdPartySearchAllowed()?!1:t.every(n=>!n.query.toLocaleLowerCase().includes(r.queryToFetch))?!1:n.RuntimeConfig.ScopesAvailable?t.every(t=>n.getGroupType(t)==n.GroupType.SearchSuggestions)&&i.every(t=>n.getGroupType(t)==n.GroupType.SearchSuggestions)?!1:!0:!1}isProtocolDuplicate(t,i,r){return t==r?!1:t.type=="MD"?!0:t.handoffType==1&&n.isDuplicateUrl(i,t.url,r.url)}removeProtocolIfDuplicate(t,i,r,u,f,e){if(i.protocol){let o=n=>!n.suppressed&&this.isProtocolDuplicate(n,t,i.protocol);if(r.some(o)||u.some(o)||f.some(o)){if(n.tryRemove(r,i.protocol)){if(!r.length){let t=n.removeFirstWhere(u,o)||n.removeFirstWhere(f,o);r.push(t)}}else n.tryRemove(f,i.protocol)||n.contains(u,i.protocol)&&e.push(i.protocol);i.protocol=null}}}getSuggestionsToRank(t,i,r,u){t&&(i=i.filter(t=>!n.isChildSuggestion(t)));u.recourse&&(i=i.filter(n=>n!=u.recourse));let f=i.concat(r);return u.searchTheWeb&&!n.contains(i,u.searchTheWeb)&&f.push(u.searchTheWeb),n.config.topHitMuse&&f.forEach(n=>{var t,i,r,u;return n.tooltip="Rank:"+((t=n.rankingScore)===null||t===void 0?void 0:t.toString())+" launch:"+((i=n.anaheimRankingSignals)===null||i===void 0?void 0:i.visitCount)+" DateV:"+((u=(r=n.anaheimRankingSignals)===null||r===void 0?void 0:r.dateVisited)===null||u===void 0?void 0:u.toString())}),f}determineTopResults(t,r,u,o,s,h,c){var y,p,w,b,k,d,g,nt,tt,it,a;if(n.config.wsbEnableRandomization){let t=n.getRNG(n.Host.getConversationId());if(n.config.wsbRandomizationProbability==1||t()<n.config.wsbRandomizationProbability)return[]}if(c||!s.queryToFetch)return t;if(n.RuntimeConfig.QfMode!=5&&(s===null||s===void 0?void 0:s.scope)==n.Scope.All&&!n.isNullOrUndefined(o===null||o===void 0?void 0:o.searchTheWeb)&&this.isArithmeticExpression(s.queryToFetch)){let n=r.find(n=>(n===null||n===void 0?void 0:n.query)===o.searchTheWeb.query&&n.type!="SW");if(n=n?n:Object.assign({},o.searchTheWeb),n.query+="=",t.length==0)return t[0]=n,t;if(!t[0].isAnswer&&t[0].query!=n.query)return t[1]=t[0],t[0]=n,i(t[1],s)&&t.splice(0,1),t}if(n.config.stickyTopResultsV2&&t.length>1&&!n.isL2(s))if((n.config.enableBoostWebAnswer||n.config.enableBoostSWAnswer)&&s.scope==n.Scope.All){if(!(t.length==2&&(n.isApp(t[0].type)||n.isSetting(t[0].type)||n.isFileOrFolder(t[0].type))&&(t[1]==o.searchTheWeb||n.isWebSuggestion(t[1])||t[1].type=="MB")))return t}else if(n.config.enablePutASInSecondTopHit&&s.scope==n.Scope.All){if(!(t.length==2&&(t[1]==o.searchTheWeb||n.isWebSuggestion(t[1])||t[1].type=="MB")))return t}else if(n.config.promoteAS2SecondTopWhenTopHitIsFLorFD&&s.scope==n.Scope.All){if(!(t.length==2&&n.isFileOrFolder(t[0].type)&&(t[1]==o.searchTheWeb||n.isWebSuggestion(t[1])||t[1].type=="MB")))return t}else return t;if(s.inorganic&&s.queryToFetch){if(t.length>0)return t;if(((y=o.searchTheWeb)===null||y===void 0?void 0:y.query)===s.queryToFetch)return t.push(o.searchTheWeb),t}let l=u.topResults;if((n.config.enableWinStoreAppPreview||n.config.enableWinStoreAppDataProvider)&&s.queryToFetch.length>=n.config.minPrefixLengthForSpp&&!n.config.disableSPPPromoteChange)if(n.isL2(s)){if(l.length==0&&(s===null||s===void 0?void 0:s.scope)==n.Scope.Apps)for(let t=0;t<r.length;t++)if(n.isStore((tt=r[t])===null||tt===void 0?void 0:tt.type)){l.push(r[t]);break}}else{if(l.length==1){if(n.isWebRelatedSuggestion(l[0])){for(let t=0;t<r.length;t++)if(n.isStore((p=r[t])===null||p===void 0?void 0:p.type)){l.unshift(r[t]);break}}else if(!n.isStore((w=l[0])===null||w===void 0?void 0:w.type)){let t=n.config.disableChangeWhenTopIsApp&&n.isApp(l[0].type),i=n.config.disableChangeWhenTopIsAppOrSetting&&(n.isApp(l[0].type)||n.isSetting(l[0].type)),u=t||i||n.config.disableChangeWhenTopIsNotWeb;if(!u)for(let t=0;t<r.length;t++)if(n.isStore((b=r[t])===null||b===void 0?void 0:b.type)){l.push(r[t]);break}}}else if(l.length==2)if(n.isWebRelatedSuggestion(l[0])){if(n.isStore((k=l[1])===null||k===void 0?void 0:k.type)){for(let t=0;t<r.length;t++)if(n.isStore((g=r[t])===null||g===void 0?void 0:g.type)){l[0]=l[1];l[1]=r[t];break}}else for(let t=0;t<r.length;t++)if(n.isStore((d=r[t])===null||d===void 0?void 0:d.type)){l[1]=l[0];l[0]=r[t];break}}else if(n.isWebRelatedSuggestion(l[1])){let t=n.config.disableChangeWhenTopIsApp&&n.isApp(l[0].type),i=n.config.disableChangeWhenTopIsAppOrSetting&&(n.isApp(l[0].type)||n.isSetting(l[0].type)),u=t||i||n.config.disableChangeWhenTopIsNotWeb;if(!u)for(let t=0;t<r.length;t++)if(n.isStore((nt=r[t])===null||nt===void 0?void 0:nt.type)){l[1]=r[t];break}}if(l.length==2){let t=l.findIndex(n=>n.type==="MB"),i=l.findIndex(t=>n.isStore(t.type));i>=0&&t>=0&&(n.config.enableSPPDisableMB?i==0?l.pop():l.shift():n.config.enableMBDisableSPP&&(t==0?l.pop():l.shift()))}}let rt=this._previewPane?this._previewPane.getPreviewedSuggestionToForceTopHit():null;if(rt&&this._ranker.allowInTopHit(s,rt)){let i=t=>n.isEquivalentForPreviewPanePurposes(s,rt,t),u=l.findIndex(i);if(u!=0){let n;u>0?(n=l[u],l.splice(u,1)):n=t.find(i)||r.find(i)||(o.searchTheWeb?[o.searchTheWeb]:[]).find(i);n&&l.unshift(n)}}if(o.protocol&&o.searchTheWeb&&this._ranker.allowInTopHit(s,o.protocol)&&n.tryRemove(l,o.searchTheWeb),o.searchTheWeb){let n=l.indexOf(o.searchTheWeb);n>=0&&l.some(n=>n!=o.searchTheWeb&&i(n,s))&&l.splice(n,1)}l.length==0&&(n.config.stickyTopResultsV2&&n.config.enableBoostWebAnswer&&s.scope==n.Scope.All&&t.length==2&&(n.isApp(t[0].type)||n.isSetting(t[0].type)||n.isFileOrFolder(t[0].type))&&t[1]==o.searchTheWeb?l.push(t[0]):n.config.stickyTopResultsV2&&t.length>0&&s.scope==n.Scope.All&&t.length==2&&(n.config.enablePutASInSecondTopHit||n.config.promoteAS2SecondTopWhenTopHitIsFLorFD)&&(n.isWebSuggestion(r[1])||r[1].type=="MB"||t[1]==o.searchTheWeb)?l.push(t[0]):n.config.stickyTopResultsV2&&t.length>0?l.push(...t):o.protocol&&this._ranker.allowInTopHit(s,o.protocol)?l.push(o.protocol):o.searchTheWeb&&this._ranker.allowInTopHit(s,o.searchTheWeb)?l.push(o.searchTheWeb):o.recourse&&this._ranker.allowInTopHit(s,o.recourse)&&l.push(o.recourse));let v=n.getEffectiveScope(s)==n.Scope.Emails?n.config.maxNumberOfEmailsInTopResult:Math.max(n.config.maxNumberOfTopResults,f(l)?2:0,e(l)?2:0,t.length);if(n.config.bypassFallbackOnMSBTopHit==4&&l.length>0&&n.isMsbOnlineSuggestionType(l[0].type)&&(v=2),l.length>v&&(l=l.slice(0,v)),n.config.synthWebNoBestMatch&&l.length==1){let t=[n.GroupType.SearchSuggestions,n.GroupType.FromYourHistory,n.GroupType.Websites],i=r.filter(i=>!n.contains(t,n.getGroupType(i))),u=l.filter(i=>!n.contains(t,n.getGroupType(i)));i.length==0&&u.length==0&&(l=[])}for(let i=t.length-1;i>=0;--i){let u=t[i];n.contains(l,u)||(u.useRaf&&(u.useRaf=!1),u!=o.searchTheWeb&&r.unshift(u))}l.length==1&&n.safeExecute(()=>this.applyAppOverride(l,r),"applyDeviceInfoOverride");l.forEach(n=>n.suppressed=!1);let ut=n.isL2(s);if(n.config.stickyTopResultsV2&&l.length==1&&t.length==1&&!ut){let r=l[0],i=t[0];r==i||n.isDefaultSynthetic(i)||n.config.msbDisableStickyWeb&&n.isWebSuggestion(i)&&n.isMsbOnlineSuggestionType(r.type)||l.unshift(i)}else if((n.config.enablePutASInSecondTopHit||n.config.promoteAS2SecondTopWhenTopHitIsFLorFD)&&n.config.stickyTopResultsV2&&l.length==1&&t.length>1&&!ut){let r=l[0],i=t[0];r==i||n.isDefaultSynthetic(i)||n.config.msbDisableStickyWeb&&n.isWebSuggestion(i)&&n.isMsbOnlineSuggestionType(r.type)||l.unshift(i)}if(n.config.enableBoostASTopHitForLowClickType&&s.queryToFetch.length==1&&l.length==1&&!n.isWebSuggestion(l[0])&&!n.isApp(l[0].type))for(let t=0;t<r.length;t++)if(n.isWebSuggestion(r[t])||r[t].type=="MB"){l.splice(0,0,r[t]);break}if(n.config.enableBoostASTopHitForFile&&s.queryToFetch.length==1&&l.length==1&&!n.isWebSuggestion(l[0])&&!n.isApp(l[0].type)&&!n.isSetting(l[0].type))for(let t=0;t<r.length;t++)if(n.isWebSuggestion(r[t])||r[t].type=="MB"){l.splice(0,0,r[t]);break}if(n.config.enableBoostWebAnswer&&s.scope==n.Scope.All&&l.length===1&&(n.isApp(l[0].type)||n.isSetting(l[0].type)||n.isFileOrFolder(l[0].type))&&(!n.config.enableBoostWebAnswerScoreLimit||n.config.enableBoostWebAnswerScoreLimit&&l[0].rankingScore<n.config.boostWebAnswerScoreThreshold))for(let t=0;t<r.length;t++)if(n.isWebSuggestion(r[t])||r[t].type=="MB"){l.push(r[t]);break}if(n.config.enableBoostSWAnswer&&s.scope==n.Scope.All&&l.length===1&&(n.isApp(l[0].type)||n.isSetting(l[0].type)||n.isFileOrFolder(l[0].type))&&(!n.config.enableBoostWebAnswerScoreLimit||n.config.enableBoostWebAnswerScoreLimit&&l[0].rankingScore<n.config.boostWebAnswerScoreThreshold)&&l.length===1&&o.searchTheWeb&&(o.protocol&&this._ranker.allowInTopHit(s,o.protocol)||l.push(o.searchTheWeb)),n.config.enableBoostWebAnswer&&s.scope==n.Scope.All&&l.length===1&&(n.isApp(l[0].type)||n.isSetting(l[0].type)||n.isFileOrFolder(l[0].type))&&o.searchTheWeb&&this._ranker.allowInTopHit(s,o.searchTheWeb)&&(!n.config.enableBoostWebAnswerScoreLimit||n.config.enableBoostWebAnswerScoreLimit&&l[0].rankingScore<n.config.boostWebAnswerScoreThreshold)&&l.push(o.searchTheWeb),n.config.promoteAS2SecondTopWhenTopHitIsFLorFD&&s.scope==n.Scope.All&&l.length===1&&n.isFileOrFolder(l[0].type)&&n.config.thresholdForQFToSkipGIQS>0&&s.queryToFetch.length>n.config.thresholdForQFToSkipGIQS){for(let t=0;t<r.length;t++)if(!n.contains(l,r[t])&&(n.isWebSuggestion(r[t])||r[t].type=="MB")){l.push(r[t]);break}l.length===1&&o.searchTheWeb&&!n.contains(l,o.searchTheWeb)&&l.push(o.searchTheWeb)}if(n.config.enablePutASInSecondTopHit&&s.scope==n.Scope.All&&l.length===1&&l[0].type!="MB"){for(let t=0;t<r.length;t++)if(!n.contains(l,r[t])&&(n.isWebSuggestion(r[t])||r[t].type=="MB")){l.push(r[t]);break}l.length===1&&o.searchTheWeb&&!n.contains(l,o.searchTheWeb)&&l.push(o.searchTheWeb)}if(n.config.stickyTopResultsV2&&t.length==1&&n.config.enableSuperStickySWTopHit){let u=l.filter(n=>n.handoffType==0),f=l.filter(n=>n.type=="ANAH"||n.type=="ANAR"),i=r.filter(n=>n.type=="ANAH"||n.type=="ANAR").sort((n,t)=>t.rankingScore-n.rankingScore);f.length==0&&i.length>0?l.push(i[0]):o.searchTheWeb&&u.length==0&&this._ranker.allowInTopHit(s,o.searchTheWeb)&&(n.config.enableSoftSuperStickySWTopHit&&t[0].rankingScore<2||n.config.enableHardSuperStickySWTopHit&&t[0].rankingScore<0||!n.config.enableHardSuperStickySWTopHit&&t[0].rankingScore<1)&&l.push(o.searchTheWeb)}if(n.config.enableMRUHint&&l.length>0&&this._previousKeystrokeCache){let n=this._previousKeystrokeCache.getPreviousTopHit();n&&n.mruHintEnabled&&n.text==l[0].text&&n.type==l[0].type&&(l[0].mruHintEnabled=!0)}if(this.promoteIFFPolarisToTopResults(s,l,r),n.config.enableCISpeller&&l.length==1&&this._previousKeystrokeCache&&(l[0].type=="PP"||l[0].type=="ST")&&this._previousKeystrokeCache.setPreviousTopHit(ut?null:l[0]),n.config.topHitMuse&&l.forEach(n=>{var t,i,r,u;return n.tooltip="thRank:"+((t=n.rankingScore)===null||t===void 0?void 0:t.toString())+" thlaunch:"+((i=n.anaheimRankingSignals)===null||i===void 0?void 0:i.visitCount)+" thDateV:"+((u=(r=n.anaheimRankingSignals)===null||r===void 0?void 0:r.dateVisited)===null||u===void 0?void 0:u.toString())}),l.length>2&&(n.config.enableSuperStickySWTopHit||n.config.enableSuperBouncySWTopHit))n.tryRemove(l,o.searchTheWeb);else if(n.config.enableSuperBouncySWTopHit){let i=[];for(a in r){let t=r[a].staticGroupType;t||(t=n.getGroupType(r[a]));t&&i.indexOf(t)<0&&i.push(t)}for(a in t){let r=t[a].staticGroupType;r||(r=n.getGroupType(t[a]));r&&i.indexOf(r)<0&&i.push(r)}i.length>1&&(i.indexOf(n.GroupType.SearchSuggestions)>=0||n.config.enableFromYourHistory&&i.indexOf(n.GroupType.FromYourHistory)>=0)?n.config.enablePutASInSecondTopHit||n.config.promoteAS2SecondTopWhenTopHitIsFLorFD||n.tryRemove(l,o.searchTheWeb):l.length==0&&i.length==1&&(i.indexOf(n.GroupType.SearchSuggestions)>=0||n.config.enableFromYourHistory&&i.indexOf(n.GroupType.FromYourHistory)>=0)&&l.push(o.searchTheWeb)}if(n.config.disableQFPreviewBtnForChatSugg)for(a in l)((it=l[a].icon)===null||it===void 0?void 0:it.className)===n.searchChatIconClassName()&&(l[a].icon=n.getSearchSuggestionIcon(),l[a].primaryMetadata=n.Host.getLocString("SeeWebResults"),l[a].click=()=>{var t;return n.Host.launchSearchAsync(l[a].query,this._navigationHelper.getSearchUrl(l[a].query,l[a].query,l[a].type,null,0,undefined,undefined,undefined,undefined),(t=l[a])===null||t===void 0?void 0:t.useRaf)});return n.config.wsbWithCopilotQF&&(v=1,l.length>v&&(l=l.slice(0,v))),n.Host.enableAddCopilotActionToBestMatch()&&l.length==1&&n.isSuggestionWithCopilotAction(l[0])&&l.push(this.createCopilotSuggestion(l[0],s)),(s===null||s===void 0?void 0:s.scope)==n.Scope.All&&n.isSupportWebResultsInAllScopeInDMAEnabled()&&l.some(n=>n.type==="TP")&&this.appendDMASearchAppSuggestionsToTopResults(s,l,r,h),l}createCopilotSuggestion(t,i){let r="",e="",h=n.Host.getLocString("StartANewConversation");n.isSetting(t===null||t===void 0?void 0:t.type)?r=n.config.copilotSettingSuggestionString:n.isPhoto(t===null||t===void 0?void 0:t.type)?r=n.config.copilotPhotoSuggestionString:(e=t===null||t===void 0?void 0:t.extensionLC,r=n.isPowerPointSuggestion(e)?n.config.copilotPPTSuggestionString:n.isExcelSuggestion(e)?n.config.copilotExcelSuggestionString:n.config.copilotFileSuggestionString);let c=!!r&&n.Host.getLocString(r,`${HitHighlightingParser.addMarkers(t.query)}`),o=!!r&&n.Host.getLocString(r,`${t.query}`),s="&q="+o+"&form=WSBQFE",u=t===null||t===void 0?void 0:t.path;!u||(s+="&file="+u);let f=n.createSuggestion(i,c,t.getIcon,{type:0,content:null},"CopSugg",o,n.InstrumentedItem.createInstrumentedItem(t.sequenceNumber,"CopSugg"),26,t.sequenceNumber,!1,null,()=>{n.Host.launchUriWithCopilotProtocalAsync(s),SearchAppWrapper.CortanaApp.dismissApp()},!1);return f.primaryMetadata=h,f.copilotSuggestionInBestMatchMirrorType=t===null||t===void 0?void 0:t.type,!u||(f.copilotSuggestionInBestMatchMirrorFilePath=u),f}appendDMASearchAppSuggestionsToTopResults(t,i,r,u){var o,s;const h=n.Host.getDMAWebProvidersOrderMap(),l=new Set,c={},e=[],f=[];for(const n of i)n.type==="TP"?(((o=n.sourceApp)===null||o===void 0?void 0:o.applicationUserModelId)&&l.add(n.sourceApp.applicationUserModelId),f.push(n)):e.push(n);for(const n of r){const t=(s=n.sourceApp)===null||s===void 0?void 0:s.applicationUserModelId;t&&!c[t]&&(c[t]=n)}for(const n of Object.values(h)){const i=n.applicationUserModelId;if(!l.has(i)){const r=c[i];f.push(r||this.createDMAPlaceholderSuggestion(t,n,u))}}f.sort((n,t)=>{var i,r;const u=n.sourceApp?((i=h[n.sourceApp.applicationUserModelId])===null||i===void 0?void 0:i.order)||Number.MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,f=t.sourceApp?((r=h[t.sourceApp.applicationUserModelId])===null||r===void 0?void 0:r.order)||Number.MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER;return u-f});const a=i.findIndex(n=>n.type==="TP");a!==-1?e.splice(a,0,...f):e.push(...f);i.length=0;i.push(...e)}createDMAPlaceholderSuggestion(t,i,r){const u=n.createSuggestion(t,t.queryToFetch,null,n.getSearchSuggestionIcon(),"TP",t.queryToFetch,n.InstrumentedItem.createInstrumentedItem(r,"TP"),1,r,!1,`DMA-${i.displayName}-Placeholder`,()=>{},!1,`DMA-${i.displayName}-Placeholder`);u.previewPaneType=1;u.sourceApp=n.Host.getThirdPartySearchAppByName(i.displayName);u.primaryMetadata=n.Host.getLocString("DMAWebSearchResults",i.displayName)+" ("+n.Host.getLocString("Loading").toLocaleLowerCase()+")";let f=u.sourceApp;return f&&f.getLogoAsDataUriAsync&&(u.getIcon=n.getDmaSuggestionIcon(f)),u}applyAppOverride(n,t){const i=["Microsoft.Office.WINWORD.EXE","{6D809377-6AF0-444B-8957-A3773F02200E}\\Windows NT\\Accessories\\wordpad.exe"];let r=n[0].deviceItem?n[0].deviceItem.id:null;if(r&&r.startsWith(i[1])){let r=t.findIndex(n=>n.deviceItem&&n.deviceItem.id&&n.deviceItem.id.startsWith(i[0]));r>=0&&n.splice(0,1,t[r])}}setUseRafFlag(t,i,r,u){if(n.isCortanaEnabledCache&&u==2)for(let n of t)n.handoffType!=0||n.isAnswer||(n.useRaf=!0)}determineANASuggestionsToRemoveForZeroInput(t,i,r){const u=n.canShowAnaheimDataSH(),f=n.canShowAnaheimDataSHTileE2E(),e=n.canShowAnaheimDataSHListE2E();r.isSearchHomeZI&&u&&r.scope==n.Scope.All&&t.forEach((t,r)=>{n.config.enableAnaheimDataTSTile&&(f?n.canShowAnaheimWin11ZITopSites()||t.type!="TOPL"||i.push(r):t.type=="ANAT"&&i.push(r)),n.canShowAnaheimWin11ZITopSites()&&t.type=="QSSG"&&i.push(r),e?t.type=="QSSG"&&i.push(r):(t.type=="ANAH"||t.type=="ANAR")&&i.push(r)})}determineSuggestionsToAddToGroups(t,r,u,f,e,o,s,h,c){let l=u.filter(t=>!n.contains(e,t)),a=[];n.RuntimeConfig.FlatListWithoutGroups||l.forEach((t,i)=>{this.allowedInGroups(t)||(n.getScope(n.getGroupType(t))==n.Scope.All?a.push(i):t.suppressed=!0)});this.determineANASuggestionsToRemoveForZeroInput(l,a,s);for(let n=a.length-1;n>=0;--n)l.splice(a[n],1);if(o.searchTheWeb){let t=e.indexOf(o.searchTheWeb);if(t!=-1){let r=n.removeFirstWhere(l,n=>i(n,s));r&&(e[t]=r)}}let v=l.filter(t=>n.contains([n.GroupType.SearchSuggestions,n.GroupType.FromYourHistory,n.GroupType.Websites,n.GroupType.LocalPlaces],n.getGroupType(t))),p=l.filter(n.enforceOriginalOrder);const y=u.find(n=>n.handoffType===21);return n.config.enableAnaheimRelevance==2&&(v=l.filter(t=>n.contains([n.GroupType.Websites,n.GroupType.LocalPlaces],n.getGroupType(t)))),!h&&this.canRenderChildSuggestions(e,c,s)?this.addChildSuggestions(t,e[0],l):(s===null||s===void 0?void 0:s.scope)===n.Scope.Work&&y&&this.addChildSuggestions(t,y,l),s.queryToFetch&&l.sort((n,t)=>t.rankingScore-n.rankingScore),this.insertDefaultSearchTheWeb(s,o,e,r,l,v),l=this.insertSuggestionsToRightPlace(l,p),l=this.insertSuggestionsToRightPlace(l,v),n.config.topHitMuse&&e.forEach(n=>{var t,i,r,u;return n.tooltip="gaRank:"+((t=n.rankingScore)===null||t===void 0?void 0:t.toString())+" galaunch:"+((i=n.anaheimRankingSignals)===null||i===void 0?void 0:i.visitCount)+" gaDateV:"+((u=(r=n.anaheimRankingSignals)===null||r===void 0?void 0:r.dateVisited)===null||u===void 0?void 0:u.toString())}),l}insertDefaultSearchTheWeb(t,r,u,f,e,o){if(r.searchTheWeb&&(t.scope==n.Scope.Web||t.scope==n.Scope.All)){let n=o.findIndex(n=>i(n,t));if(f.some(n=>i(n,t))||u.some(n=>i(n,t))){if(n!=-1){let t=o[n];o.splice(n,1);e.splice(e.indexOf(t),1)}}else n==-1&&(o.unshift(r.searchTheWeb),e.unshift(r.searchTheWeb))}}getGroupOrder(t,i,r){switch(t.scope){case n.Scope.Web:if(!t.queryToFetch)return n.config.enableFromYourHistory?[{type:n.GroupType.Websites},{type:n.GroupType.FromYourHistory},{type:n.GroupType.SearchSuggestions}]:[{type:n.GroupType.Websites},{type:n.GroupType.SearchSuggestions}];break;case n.Scope.Apps:return[{type:n.GroupType.Apps},{type:n.GroupType.Store}];case n.Scope.Photos:return[{type:n.GroupType.Photos},{type:n.GroupType.SearchSuggestions}];case n.Scope.Videos:return[{type:n.GroupType.Videos},{type:n.GroupType.SearchSuggestions}]}let u=r.concat(i);u.sort((n,t)=>t.rankingScore-n.rankingScore);let s=[],o=[],e=[];for(let t of u)if(t.suppressed)o.push(t);else if(s.push(t),n.config.enableStaticGroupRanking){let r=n.getGroupType(t),i={type:r,source:t.sourceForGroup};e.some(t=>n.sameGroup(t,i))||e.push(i)}o.length!=0&&(u=s.concat(o));let f=[];n.config.enableStaticGroupRanking&&n.isMarketEligible(n.Host.getRegion(),n.Host.getLanguage(),n.config.disableWebCheckForGroupingLanguageRegionPairs)&&u.length>0?f=this.getStaticGroupOrder(e):n.config.enableStaticGroupRanking&&u.length>0&&n.getGroupType(u[0])!=n.GroupType.SearchSuggestions&&n.getGroupType(u[0])!=n.GroupType.FromYourHistory&&(f=this.getStaticGroupOrder(e));for(let i of u){let u=n.getGroupType(i,t===null||t===void 0?void 0:t.scope),r=this.getTypeWithSource(u,i);f.some(t=>n.sameGroup(t,r))||(!n.config.enableStaticGroupRanking||!n.isTopHitChildGroup(r)||i.handoffType===21?f.push(r):f.unshift(r))}return f}getTypeWithSource(t,i){const r=t==n.GroupType.MRUHistory?undefined:i.sourceForGroup;return{type:t,source:r}}addChildSuggestions(t,i,r){i.calculateChildSuggestions&&i.calculateChildSuggestions();i.childSuggestions&&i.childSuggestions.length>0&&Object.keys(n.config.topHitChildGroups).forEach((n,u)=>{const f=parseInt(n),e=this.getMaxChildSuggestions(t,i,f);if(e>0){const n=i.childSuggestions.filter(n=>n.groupType==f).slice(0,e);n.forEach((n,t)=>{n.handoffType===21||(n.rankingScore=1e4-100*u-t),r.push(n)})}})}getMaxChildSuggestions(t,i,r){var u;return n.isMsbVerticalOnlineSuggestionType(i.type)?t?((u=i.childSuggestions)===null||u===void 0?void 0:u.length)||0:n.config.msbVerticalChildSuggestionsInL1||0:n.contains(n.config.suppressedTopHitChildGroups,r)?0:n.config.topHitChildGroups[r]}canRenderChildSuggestions(t,i){if(n.RuntimeConfig.FlatListWithoutGroups||t.length!=1)return!1;let r=t[0];if(n.RuntimeConfig.AlwaysWide){const n=r.previewPaneType===1,t=r.handoffType===21,i=r.type==="MPPL"&&!!r.calculateChildSuggestions;if(!n&&!t&&!i)return!1}if(!i||r.handoffType===21)return!0;if(this._renderedTopResults.topResults.length==1){let t=this._renderedTopResults.topResults[0];return t.hasChildSuggestionsDisplayed&&t.query==r.query&&n.getGroupType(t)==n.getGroupType(r)}return!1}insertSuggestionsToRightPlace(t,i){if(i.length==0)return t;let r=[],u=i[0];for(let f=0;f<t.length;f++){let e=t[f];e==u?r=r.concat(i):n.contains(i,e)||r.push(e)}return r}ensureUniqueReactKeys(t){let i={};if(t)for(let r=t.length-1;r>=0;r--){let u=t[r];if(i[u.reactKey]){let i=t.splice(r,1),u=i[0].mayContainPII?i[0].type:i[0].reactKey;n.LogWSBError("ensureUniqueReactKeys","Found two suggestions with the same key: "+u,undefined,undefined,undefined,"WindowsTelemetry")}else i[u.reactKey]=1}}getStaticGroupOrder(t){let r=[],i=[{type:n.GroupType.Apps},{type:n.GroupType.Settings},{type:n.GroupType.Documents,source:1},];n.config.enableCopIFFAboveTheWeb&&(i=[{type:n.GroupType.Apps},{type:n.GroupType.Settings},{type:n.GroupType.Documents},{type:n.GroupType.Documents,source:1},{type:n.GroupType.Documents,source:2},{type:n.GroupType.Documents,source:3},{type:n.GroupType.Documents,source:4},{type:n.GroupType.Photos},{type:n.GroupType.Folders},{type:n.GroupType.Store}]);n.config.enableCopIFFAboveAll&&(i=[{type:n.GroupType.Documents},{type:n.GroupType.Documents,source:1},{type:n.GroupType.Documents,source:2},{type:n.GroupType.Documents,source:3},{type:n.GroupType.Documents,source:4},{type:n.GroupType.Photos},{type:n.GroupType.Folders},{type:n.GroupType.Apps},{type:n.GroupType.Settings},{type:n.GroupType.Store}]);(n.config.enableWinStoreAppPreview||n.config.enableWinStoreAppDataProvider)&&(i=[{type:n.GroupType.Apps},{type:n.GroupType.Settings},{type:n.GroupType.Store},{type:n.GroupType.Documents,source:1},]);n.isHighPriorityFileProviderEnabled()&&n.AccessTokenManager.getWindowsAccountType()!=1&&(i=[{type:n.GroupType.Apps},{type:n.GroupType.Settings},{type:n.GroupType.Documents},],(n.config.enableWinStoreAppPreview||n.config.enableWinStoreAppDataProvider)&&(i=[{type:n.GroupType.Apps},{type:n.GroupType.Settings},{type:n.GroupType.Store},{type:n.GroupType.Documents},]),n.config.enableCopIFFAboveTheWeb&&(i=[{type:n.GroupType.Apps},{type:n.GroupType.Settings},{type:n.GroupType.Documents},{type:n.GroupType.Documents,source:1},{type:n.GroupType.Documents,source:2},{type:n.GroupType.Documents,source:3},{type:n.GroupType.Documents,source:4},{type:n.GroupType.Photos},{type:n.GroupType.Folders},{type:n.GroupType.Store}]),n.config.enableCopIFFAboveAll&&(i=[{type:n.GroupType.Documents},{type:n.GroupType.Documents,source:1},{type:n.GroupType.Documents,source:2},{type:n.GroupType.Documents,source:3},{type:n.GroupType.Documents,source:4},{type:n.GroupType.Photos},{type:n.GroupType.Folders},{type:n.GroupType.Apps},{type:n.GroupType.Settings},{type:n.GroupType.Store}]));n.config.topHitMuse&&(i=[{type:n.GroupType.Apps},{type:n.GroupType.AnaheimDataTopHit},{type:n.GroupType.Settings},{type:n.GroupType.Documents,source:1}]);for(let u of i)t.some(t=>n.sameGroup(t,u))&&r.push(u);return t.some(t=>n.sameGroup(t,{type:n.GroupType.SearchSuggestions}))&&r.push({type:n.GroupType.SearchSuggestions}),n.config.enableFromYourHistory&&t.some(t=>n.sameGroup(t,{type:n.GroupType.FromYourHistory}))&&r.push({type:n.GroupType.FromYourHistory}),r}promoteIFFPolarisToTopResults(t,i,r){var u,f,e,o,s,h,c,l,a,v,y;if((n.config.enableCopIFFAboveTheWeb||n.config.enableCopIFFAboveAll)&&t.scope==n.Scope.All){if(i.length>0)if(n.isPhoto((u=i[0])===null||u===void 0?void 0:u.type)||n.isFileOrFolder((f=i[0])===null||f===void 0?void 0:f.type)){for(let u=0;u<r.length;u++)if(n.isContentSearch((e=r[u])===null||e===void 0?void 0:e.type)&&n.isSameType((o=r[u])===null||o===void 0?void 0:o.type,(s=i[0])===null||s===void 0?void 0:s.type)&&!n.isDuplicate(t,i[0],r[u])){i[1]=r[u];break}}else if(n.isWebSuggestion(i[0]))for(let t=0;t<r.length;t++)if(n.isContentSearch((h=r[t])===null||h===void 0?void 0:h.type)){i[1]=r[t];break}}else if(n.config.enableCopIFFPromoteByRelevance&&t.scope==n.Scope.All&&i.length>0)if(n.isPhoto((c=i[0])===null||c===void 0?void 0:c.type)||n.isFileOrFolder((l=i[0])===null||l===void 0?void 0:l.type)){for(let u=0;u<r.length;u++)if(!n.isDuplicate(t,i[0],r[u])){n.isSameType((a=r[u])===null||a===void 0?void 0:a.type,(v=i[0])===null||v===void 0?void 0:v.type)&&(i[1]=r[u]);break}}else if(n.isWebSuggestion(i[0]))for(let t=0;t<r.length;t++){n.isContentSearch((y=r[t])===null||y===void 0?void 0:y.type)&&(i[1]=r[t]);break}}}t.Aggregator=o})(t=n.Ranking||(n.Ranking={}))}(WSB||(WSB={})),function(n){function e(t,i){t(n.getCurrentTime(),n.getInputType(i),i)}function i(n,t){let i=parseInt(n.substr(1),16),r=i>>16&255,u=i>>8&255,f=i&255;return"rgba("+r+","+u+","+f+","+t+")"}function r(n,t){var i=parseInt(n.slice(1),16),r=t<0?0:255,u=t<0?t*-1:t,f=i>>16,e=i>>8&255,o=i&255;return"#"+(16777216+(Math.round((r-f)*u)+f)*65536+(Math.round((r-e)*u)+e)*256+(Math.round((r-o)*u)+o)).toString(16).slice(1)}n.invokeClickHandler=e;n.SinglePaneWidth=344;n.PreviewPaneWidth=440;n.DebugWindowWidth=800;n.CobaltPreviewPaneWidth=410;const o="qfContainer",u="workScopeSubVerticalsContainer";let t,f="aria-selected";n.MaxTextScaleThres=1.2;n.MinTextScaleThres=.8;class s{constructor(){this._windowsTemporaryMessageShown=!1;this._progressBarVisible=!1;this._previewPaneVisible=!1;this._debugWindowVisible=!1;this._suggestionsContainerHeight=0;this._renderingInProgress=!1;this._narratorLaunchHandlers=[];this._viewData={};this._targetElemCache={};this._shimmerShown=!1;this._copilotChatQueryCount=0;this.scrollTo=(t,i,r)=>{var s;let f=_ge(t.id);const l=(s=this._qfContainer)===null||s===void 0?void 0:s.contains(f);while(r&&l&&(f===null||f===void 0?void 0:f.offsetParent.id)!==o)f=f.parentElement;let e;const h=n.msbDsbHost&&n.isMsbEnterprise()&&t.dsb,c=i&&h?_ge(n.MsbDsb.MAINPAGE_CONTAINER_SCROLL):n.StaticHtmlElements.msbDsbRoot;if(n.config.disbaleWideForLargeTextScale){const t=f.closest(".suggsList")!=null;e=h?c:!n.config.enableWin11SSH&&i&&!t?n.StaticHtmlElements.root:r&&(f===null||f===void 0?void 0:f.id)===u?n.StaticHtmlElements.qfContainerScroll:this._qfContainer;this.scrollToElement(f,e,e.offsetHeight);this.scrollToElementBottomHorizontalScrollBar(f,_qs(".resultsContainer"),_qs(".resultsContainer").offsetWidth)}else e=h?c:!n.config.enableWin11SSH&&i?n.StaticHtmlElements.root:r&&(f===null||f===void 0?void 0:f.id)===u?n.StaticHtmlElements.qfContainerScroll:this._qfContainer,this.scrollToElement(f,e,e.offsetHeight)};let r=new MutationObserver(n=>{if(!this._renderingInProgress){let t=[],i;for(let r of n){let n=r.target;i=n.id;t.push(n.getAttribute(f)=="true"?1:0)}(t.length==1&&t[0]==0||t.length==2&&t[0]^t[1])&&this._narratorLaunchHandlers.forEach(n=>n(i))}});r.observe(document,{subtree:!0,attributes:!0,attributeFilter:[f]});n.View.getLocString=(t,...i)=>n.Host.getLocString(t,...i);this.addViewData("TestHooksEnabled",n.TestHookUrlParameters);t=SearchAppWrapper.CortanaApp;this._qfContainer=n.config.disbaleWideForLargeTextScale?n.StaticHtmlElements.qfContainerScroll:n.config.useCobaltCSS?n.StaticHtmlElements.qfContainerScroll:n.StaticHtmlElements.qfContainer;this._messageBannerArea=n.StaticHtmlElements.messageBannerBottom;n.Host.bindAppVisible(()=>{let i=t.width,r=t.height;if(i&&r)this.setDimensions(i,r);else{const t=n.Host.getCachedCortanaHeaders();if(t&&t["X-BM-DeviceDimensionsLogical"]){let[n,i]=t["X-BM-DeviceDimensionsLogical"].split("x");this.setDimensions(parseInt(n),i)}else ThresholdUtilities.getCortanaHeaders(t=>{if(t){n.Host.setCortanaHeadersCache(t);let[i,r]=t["X-BM-DeviceDimensionsLogical"].split("x");this.setDimensions(parseInt(i),r)}else SharedLogHelper===null||SharedLogHelper===void 0?void 0:SharedLogHelper.LogError("setDeviceDimensions",undefined,"get Cortana headers failed")})}this._isFileExplorerOrControlPanel=n.RuntimeConfig.QfMode==5||n.RuntimeConfig.QfMode==9;n.RuntimeConfig.PreviewPaneAvailable&&(this.initPreviewPane(),n.setVisibility(n.StaticHtmlElements.qfPreviewPane,n.RuntimeConfig.AlwaysWide),!n.RuntimeConfig.AlwaysWide&&n.Host.hasFallbackHappened()&&t.resetToDefaultSize(),n.config.disbaleWideForLargeTextScale&&n.RuntimeConfiguration.TextScaleFactor>1.25&&(n.StaticHtmlElements.qfPreviewPane.classList.add("largeTextSize"),n.StaticHtmlElements.horizontalScrollBar.classList.add("largeTextSize"),n.StaticHtmlElements.temporaryMessages.classList.add("largeTextSize"),n.StaticHtmlElements.qfContainerScroll.classList.add("largeTextSize"),_qs(".resultsContainer").style.overflowX="auto",n.config.isDMARegion||n.isThirdPartySearchAllowed()||_qs(".scopesListContainer").classList.add("largeTextSizeInvisible")));this.initDebugWindow();this.setConditionalCss("wideByDefault",n.RuntimeConfig.AlwaysWide);this.setConditionalCss("handIconHover",n.config.enableHandIconWhenHover);this.setConditionalCss("win11",n.config.useCobaltCSS);this.setConditionalCss("fileExplorer",this._isFileExplorerOrControlPanel);this.setConditionalCss("isCopilot",n.config.wsbWithCopilot);this.setConditionalCss("isCopilotSearchHome",n.config.wsbWithCopilot);this.setConditionalCss("copilotSinglePane",n.config.wsbWithCopilotQF);this.setConditionalCss("biggerTopHitIcon",!!n.config.enableBiggerIconTopHit);this.setConditionalCss("panelCanResize",n.RuntimeConfig.PanelCanResize);this.setConditionalCss("flatListWithoutGroups",n.RuntimeConfig.FlatListWithoutGroups);this.setConditionalCss("searchBoxOnTop",n.RuntimeConfig.SearchBoxOnTop);this.setConditionalCss("noScopes",!n.RuntimeConfig.ScopesAvailable);this.setConditionalCss("twoColumns",n.shouldShowTwoColumns());this.setConditionalCss("enableAnaheimData",!n.config.enableWin11SSH&&(n.isAnaheimDataEnabled(!0)||n.isAnaheimDataEnabled(!1)));this.setConditionalCss("enableAnaheimTopSitesWin11",n.canShowAnaheimWin11ZITopSites());this.setConditionalCss("trendingSearchInWin11LeftPane",n.config.trendingSearchInWin11LeftPane);this.setConditionalCss("edgeUpsell",n.shouldEnableAnaheimResetDefault());this.setConditionalCss("scope-with-background",n.config.useCobaltCSS);this.setConditionalCss("msbDsbWide",n.config.msbDsbWide&&n.RuntimeConfig.AlwaysWide);this.setQueryBasedCss(null);this.setConditionalCss("reclaimSearchboxCampaign",n.config.enableMessageBanner);this.setConditionalCss("wsbOnWebView2",n.config.wsbWebView2);this.setConditionalCss("visibleScrollbar",n.config.visibleScrollbar&&n.config.wsbWebView2);this.setConditionalCss("notificationBannerShown",n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(40979072));this.setConditionalCss("newIndexingMessage",n.Host.useImprovedIndexingMessage());this.setConditionalCss("win11sshpof",n.config.enableWin11SSH&&(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(44533041))&&(n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType())!==1)});n.Host.bindBootstrapDone(()=>{n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().beginMark("WSBPage.bindBootstrapDone");let t=_ge("preBootstrapPane");t&&(n.setVisibility(t,!1),t.remove());n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("WSBPage.bindBootstrapDone")});n.Host.bindShown(()=>{if(n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().beginMark("WSBPage.bindShown"),this.applyAccentColor(),n.config.isRewardsWidgetEnabled&&this.addRewardsWidget(),this.setThemeBasedCss(),n.setVisibility(n.StaticHtmlElements.root,!0),n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("WSBPage.bindShown"),n.config.enableMessageBanner&&t.isUserOnboarded()){let i=t.getSearchAppLaunchCount();i<4&&(n.InstrumentationHelper.logClientInstEvent("ClientInst","ReclaimSearchBoxBannerShown",null,{shownCnt:String(i)},"WindowsTelemetry",33554432),t.setSearchAppLaunchCount(i+1))}});n.Host.bindAppHidden(()=>{n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().beginMark("WSBPage.bindAppHidden"),this._openPreviewPaneButtonCache=undefined,n.setVisibility(n.StaticHtmlElements.qfPreviewPane,!1),n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("WSBPage.bindAppHidden")});n.Host.bindQueryChangedOrInitialized(()=>{n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().beginMark("WSBPage.bindQueryChangedOrInitialized"),this._isFileExplorerOrControlPanel&&this.updateFENarratorSuggestionCount(null),n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("WSBPage.bindQueryChangedOrInitialized")});n.Host.bindSearchBoxClick(()=>{n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().beginMark("WSBPage.bindSearchBoxClick"),n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("WSBPage.bindSearchBoxClick")});const i=()=>{n.RuntimeConfig.AlwaysWide||(this._previewPaneVisible=!1,n.setVisibility(n.StaticHtmlElements.qfPreviewPane,!1)),(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.features.isWorkUpsellApplicable())&&this.updateWorkUpsellAreaView(undefined),n.config.enableMessageBanner&&this.updateMessageBannerAreaView(null),(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(40979072))&&this.updateNotificationBannerAreaView(null),this.setDebugWindowVisibility(!1),n.config.wsbWithCopilotQF&&(n.setVisibility(n.StaticHtmlElements.qfContainer,!0),n.setVisibility(n.StaticHtmlElements.qfPreviewPane,!0),n.setVisibility(n.StaticHtmlElements.groups,!0),n.setVisibility(n.StaticHtmlElements.copilotChat,!1))};n.Host.bindDismissed(()=>{this.resetSuggestionsContainerHeight(),i(),n.config.showShimmerOnDismiss&&(this._shimmerShown=!0,n.StaticHtmlElements.shimmerContainer.classList.remove("b_hide"),n.StaticHtmlElements.rootContainer.classList.add("b_hide"))});!n.View.PerformanceWidget||!n.StaticHtmlElements.performanceWidget||(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.hidePerfWidget)||(n.setVisibility(n.StaticHtmlElements.performanceWidget,!0),n.Host.bindShown(()=>{this.renderReactView("performanceWidget",n.View.PerformanceWidget,{keystrokeTimeline:null})}),n.InstrumentationHelper.bindKeystrokeTimelineUpdated(t=>{this.renderReactView("performanceWidget",n.View.PerformanceWidget,{keystrokeTimeline:t})}));n.config.alwaysWideBeforeRS5&&t.addEventListener("openanimationcompleted",()=>{this.ensureWebViewWidthExpanded()});t.addEventListener("resettingtodefaultsize",()=>{i()});n.config.limitScaleRange&&window.addEventListener("resize",()=>{n.limitTextScaleRange()});sj_be(sj_b,"contextmenu",n=>{let t=n.target;while(t){if(t.classList.contains("allowcontextmenu"))break;t=t.parentElement}t||sj_pd(n)})}setConditionalCss(t,i){this.setConditionalCssOnElement(n.StaticHtmlElements.root,t,i)}setConditionalCssOnElement(n,t,i){i?n.classList.add(t):n.classList.remove(t)}setQueryBasedCss(t,i){this.setConditionalCss("zeroInput19H1",(t===null||t===void 0?void 0:t.isSearchHomeZI)||!!(t===null||t===void 0?void 0:t.isThirdPartyZI));(t===null||t===void 0?void 0:t.scope)==n.Scope.ThirdPartyWeb&&i&&this.setConditionalCss("zeroInput19H1",!1);this.setConditionalCss("wideByDefault",n.config.wsbWithCopilotQF?t===null||t===void 0?void 0:t.isSearchHomeZI:n.RuntimeConfig.AlwaysWide);this.setConditionalCss("twoPanesZI",n.shouldShowStaticSearchHome(t)||n.shouldShowDSBLayout(t));this.setConditionalCss("dsb",n.shouldShowDSBLayout(t));this.setConditionalCss("dsbFullWidth",n.shouldShowDSBFullWidth(t));this.setConditionalCss("transparentMiniserp",n.shouldShowTransparentMiniserp());this.setConditionalCss("allScope",t&&t.scope==n.Scope.All);this.setConditionalCss("chatScope",!!n.isChatScopeEnabled()&&(t===null||t===void 0?void 0:t.scope)==n.Scope.Chat);this.setConditionalCss("searchHomeToggle",!!n.isChatScopeEnabled()&&(t===null||t===void 0?void 0:t.isSearchHomeZI)||n.isThirdPartySearchAllowed()&&!n.isSupportWebResultsInAllScopeInDMAEnabled()&&n.Host.isThirdPartySearchAppsEnabled());n.dsbManager===null||n.dsbManager===void 0?void 0:n.dsbManager.setDsbPanesVisibility(t)}setThemeBasedCss(){if(n.config.isThemeAware){var t=n.Host.getWindowsTheme();this.setConditionalCss("darkTheme",t==2);this.setConditionalCss("lightTheme",t==1);_d.body.classList.add("notRS5");n.config.showShimmerOnDismiss&&(this.setConditionalCssOnElement(n.StaticHtmlElements.shimmerContainer,"darkTheme",t==2),this.setConditionalCssOnElement(n.StaticHtmlElements.shimmerContainer,"lightTheme",t==1))}else n.config.searchHomeSupported&&(this.setConditionalCss("lightTheme",!0),this.setConditionalCss("lightThemeRS5",!0))}initPreviewPane(){let t=n.RuntimeConfiguration.TextScaleFactor||1;n.config.limitScaleRange&&(t>n.MaxTextScaleThres?t=n.MaxTextScaleThres:t<n.MinTextScaleThres&&(t=n.MinTextScaleThres));let i=n.config.useCobaltCSS?n.CobaltPreviewPaneWidth/t:n.PreviewPaneWidth/t;n.config.wsbWithCopilotQF&&(i-=40);n.StaticHtmlElements.qfPreviewPane.classList.remove("transitionOn");n.StaticHtmlElements.qfPreviewPane.style.minWidth=i+"px"}initDebugWindow(){this._debugWindow||(this._debugWindow=_ge("qfDebugPane"),this._debugWindow&&(this._debugWindow.style.flexBasis=n.DebugWindowWidth+"px"))}setDimensions(n){if(!this._previewPaneVisible&&!this._debugWindowVisible){this.onPaneWidthSet(n);this._originalPaneWidth=n}}ensureWebViewWidthExpanded(){let i=n.SinglePaneWidth+n.PreviewPaneWidth;n.RuntimeConfig.QfMode==1&&t.width<i&&(t.setPaneWidth(i),this.setDimensions(i,null))}getScrollTop(){return this._qfContainer.scrollTop}scrollToTop(){n.config.optimizeScrollTop&&this._qfContainer.scrollTop===0||(this._qfContainer.scrollTop=0);n.config.optimizeScrollTop&&_d.body.scrollTop===0||(_d.body.scrollTop=0)}scrollToLeft(){_qs(".resultsContainer").scrollLeft=0}scrollRightPaneToTop(){const t=document.getElementById("localScrollArea"),i=document.getElementById("qfPreviewScrollArea"),r=document.querySelector(".previewDataSection > div > ul");t&&i&&r&&(t.scrollTop!==0||i.scrollTop!==0)&&r.firstElementChild===document.activeElement&&(n.config.useCobaltCSS?t.scrollTop=0:i.scrollTop=0)}scrollToElement(n,t,i){let u=t.scrollTop,r=n===null||n===void 0?void 0:n.offsetTop,f=r+(n===null||n===void 0?void 0:n.offsetHeight);f>u+i?t.scrollTop=f-i:r<u&&(t.scrollTop=r)}scrollToElementBottomHorizontalScrollBar(n,t,i){let f=t.scrollLeft,r=n===null||n===void 0?void 0:n.getBoundingClientRect().left,e=r<100?0:100,u=r+n.offsetWidth+e;r<0?t.scrollLeft=0:u>f+i&&(t.scrollLeft=u-i)}getSuggestionsContainerHeight(){return this._suggestionsContainerHeight||this.calculateSuggestionsContainerHeight(),this._suggestionsContainerHeight}getSuggestionsContainerWidth(){return(n.MockUrlParameters===null||n.MockUrlParameters===void 0?void 0:n.MockUrlParameters.isTest)?t.width:_w.innerWidth}resetSuggestionsContainerHeight(){this._suggestionsContainerHeight=0}calculateSuggestionsContainerHeight(){let t=n.StaticHtmlElements.root.clientHeight;t<440&&(t=440);let i=_ge("temporaryMessage");t-=i.offsetHeight;this._suggestionsContainerHeight=t}getPanelWidthFor(t){let i=this._originalPaneWidth;return i+=t&1?n.PreviewPaneWidth:0,i+(t&2?n.DebugWindowWidth:0)}getPanelState(){switch(t.width-this._originalPaneWidth){case 0:return 0;case n.PreviewPaneWidth:return 1;case n.DebugWindowWidth:return 2;case n.PreviewPaneWidth+n.DebugWindowWidth:return 3;default:return 0}}openSidePanel(n){let i=this.getPanelState();if(i==0&&this.setDimensions(t.width,null),!(i&n)){let u=i|n,r=this.getPanelWidthFor(u);t.setPaneWidth(r);this.onPaneWidthSet(r)}}closeSidePanel(i){let r=this.getPanelState();if(r&i){let f=r&~i,u=this.getPanelWidthFor(f);u!=this._originalPaneWidth||n.config.alwaysWideBeforeRS5?t.setPaneWidth(u):t.resetToDefaultSize();this.onPaneWidthSet(u)}}onPaneWidthSet(t){n.safeFireEvent("CortanaPaneWidthSet",t)}getOpenPreviewPaneButton(){if(!n.RuntimeConfig.PreviewPaneAvailable)return null;if(!this._openPreviewPaneButtonCache){let t=n.isRtl(),i=t?"":"";this._openPreviewPaneButtonCache={defaultIcon:{content:i,type:2},openedIcon:{content:t?"":"",type:2},clickHandler:this._openPreviewPaneClickHandler}}return this._openPreviewPaneButtonCache}setContextMenuHandler(n){this._contextMenuHandler=n}setSuggestionClickHandler(n){this._suggestionClickHandler=n}setOpenPreviewPaneClickHandler(n){this._openPreviewPaneClickHandler=n}setExpanderClickInstrumentation(n){this._expanderClickInstrumentation=n}updateGroupsView(t,i,r,u,f){var o,s,h;if((n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.forceRenderingCrashOnSecondConversation)&&n.Host.getPaneCloseCount())throw new Error("Simulated exception");if(n.shouldShowDSBLayout(t.query)){let t=n.Host.getBindDimissTime(),i=n.Host.getBindShownTime();if(t&&i&&(i-t)/1e3>n.DSB_RESET_SECONDS){if(n.config.useCobaltCSS){const t=document===null||document===void 0?void 0:document.getElementById("dsb-moment-container");t&&(!n.config.optimizeScrollTop||t.scrollTop!==0)&&(t.scrollTop=0)}else n.config.optimizeScrollTop&&n.StaticHtmlElements.dynamicPane.scrollTop===0||(n.StaticHtmlElements.dynamicPane.scrollTop=0);n.StaticHtmlElements.dynamicPaneFullWidth&&(!n.config.optimizeScrollTop||n.StaticHtmlElements.dynamicPaneFullWidth.scrollTop!==0)&&(n.StaticHtmlElements.dynamicPaneFullWidth.scrollTop=0)}!n.StaticHtmlElements.msbDsbRoot||n.config.optimizeScrollTop&&(n.StaticHtmlElements.msbDsbRoot.classList.contains("b_hide")||n.StaticHtmlElements.msbDsbRoot.scrollTop===0)||(n.StaticHtmlElements.msbDsbRoot.scrollTop=0)}i||this.setQueryBasedCss(t.query,t.topResults.length!=0);this.setConditionalCss("noSuggestions",t.topResults.length==0&&t.groups.length==0);n.config.disbaleWideForLargeTextScale&&n.RuntimeConfiguration.TextScaleFactor>1.25||this.setConditionalCss("noextrapadding",SearchAppWrapper.CortanaApp.isSearchBoxInTaskbar&&(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(53927647)));let c=t.query&&t.query.isSearchHomeZI;if(c){let n=t.groups.filter(n=>!n.suggestions.every(n=>n.suppressed==!0));t.groups=n}let l=c?null:((o=t.query)===null||o===void 0?void 0:o.scopePrefix)==="work"?null:" - "+n.getWebSuggestionAnnotation(n.msbEnabledForQuery(t.query)),a=n.config.clearMru&&(!t.query||!t.query.queryToFetch)&&t.groups.length>0&&t.groups[0].type!=n.GroupType.QuickSearch;u&&this.updateMessageBannerAreaView(null);let e={groups:t.groups,contextMenuHandler:this._contextMenuHandler,clickHandler:this._suggestionClickHandler,openPreviewPaneButton:this.getOpenPreviewPaneButton(),isSearchHome:c,isWorkScopeZI:(s=t.query)===null||s===void 0?void 0:s.isWorkScopeZI,webSuggestionAnnotation:l,deleteMRUButtonCallback:a?()=>this.deleteMRUButtonCallback():null,notifyIconPending:(t,i,r)=>n.InstrumentationHelper.notifyIconPending(t,i,r),notifyIconReadyOrFailed:(t,i,r)=>n.InstrumentationHelper.notifyIconReadyOrFailed(t,i,r),scope:(h=t.query)===null||h===void 0?void 0:h.scope,updateFullyExpandState:r,scrollTo:this.scrollTo,messageBannerModel:u,copilotGreetingData:f};if(n.config.enableMRUDSBV2&&n.shouldShowDSBFullWidth(t.query)?this.renderReactView("dsb-fwp-groups-ssh",n.View.WindowsGroups,n.config.reactGroups?n.deepCopy(e,["parent"],["deviceItem"]):e):this.renderReactView("groups",n.View.WindowsGroups,n.config.reactGroups?n.deepCopy(e,["parent"],["deviceItem"]):e),n.config.msbEnableAccountManager&&!i){const t=n.Host.getQuery();n.shouldShowDSBLayout(t)&&this.setQueryBasedCss(t)}}deleteMRUButtonCallback(){sj_evt.fire("clearMRUButtonClicked");n.Host.refreshCurrentPane()}updateFENarratorSuggestionCount(t){let i="";this._isFileExplorerOrControlPanel&&t&&(i=n.Host.getLocString("SuggestionCountNarrator",`${t}`));this.updateNarratorMessageView(i)}updateTopResultsView(t,i){if(!this._shimmerShown||i||(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.forceLoadingShimmer)||(this._shimmerShown=!1,n.StaticHtmlElements.shimmerContainer.classList.add("b_hide"),n.StaticHtmlElements.rootContainer.classList.remove("b_hide")),i||this.setQueryBasedCss(t.query,t.topResults.length!=0),this.setConditionalCss("noSuggestions",t.topResults.length==0&&t.groups.length==0),this._isFileExplorerOrControlPanel){let n=t.topResults.length;this.updateFENarratorSuggestionCount(n>0?n:null)}let r={suggestions:t.topResults,contextMenuHandler:this._contextMenuHandler,clickHandler:this._suggestionClickHandler,openPreviewPaneButton:this.getOpenPreviewPaneButton(),isSearchHome:t.query&&t.query.isSearchHomeZI,notifyIconPending:(t,i,r)=>n.InstrumentationHelper.notifyIconPending(t,i,r),notifyIconReadyOrFailed:(t,i,r)=>n.InstrumentationHelper.notifyIconReadyOrFailed(t,i,r)};this.renderReactView("topResults",n.View.WindowsTopResults,n.config.reactGroups?n.deepCopy(r,["parent"],["deviceItem"]):r)}updateCopilotChatView(t,i,r,u){this._copilotChatQueryCount=this._copilotChatQueryCount+1;this.renderReactView("copilot-chat-container",n.View.CopilotChat,{queryText:t,queryCount:this._copilotChatQueryCount,conversationId:i,historyMessage:r,accessToken:u})}showTemporaryMessage(t,i,r,u){if(this._windowsTemporaryMessageShown)this.hideTemporaryMessage(),n.safeSetTimeout(()=>this.showTemporaryMessage(t),100,"showTemporaryMessage");else{let f={messageText:t,icon:i!==null&&i!==void 0?i:{content:"",type:2},messageClassName:r!==null&&r!==void 0?r:"slideInMessage",clickHandler:()=>{this.hideTemporaryMessage(),n.Host.setFocusInSearchBox(null,"temporaryMessage")},action:u};this.updateTemporaryMessageView(f);this._windowsTemporaryMessageShown=!0}}hideTemporaryMessage(){this._windowsTemporaryMessageShown&&(this.updateTemporaryMessageView(null),this._windowsTemporaryMessageShown=!1)}updateTemporaryMessageView(t){this.renderReactView("temporaryMessage",n.View.WindowsMessage,{dataModel:t})}updateDialogBox(t){this.renderReactView("dialogBox",n.View.WindowsDialogBox,{dataModel:t})}updateMessageBannerAreaView(t){t?(n.setVisibility(this._messageBannerArea,!0),this.renderReactView("messageBannerBottom",n.View.WSBMessageBanner,{dataModel:t})):n.setVisibility(this._messageBannerArea,!1)}updateNotificationBannerAreaView(t){(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(40979072))&&t?(n.setVisibility(n.StaticHtmlElements.notificationBanner,!0),this.renderReactView("notificationBanner",n.View.NotificationBanner,{dataModel:t})):n.setVisibility(n.StaticHtmlElements.notificationBanner,!1)}updateRewardsFlyout(t){this.renderReactView("rewardsFlyoutContainer",n.View.RewardsFlyout,{dataModel:t})}renderAdvancedOptionsMessages(t){this.renderReactView("temporaryOption",n.View.AdvancedOptions,n.config.reactGroups?n.deepCopy({advancedOptions:t}):{advancedOptions:t})}updateTopHitHeaderView(t){this.renderReactView("topHitHeader",n.View.TopHitHeader,n.config.reactGroups?n.deepCopy({dataModel:t},["parent"]):{dataModel:t})}createFlyout(t){return n.config.enableEducationalFlyout?(this._flyoutController||(this._flyoutController=new n.FlyoutController(this),n.Host.bindQueryChangedOrInitialized(n=>{this._flyoutController.onQueryChange(n)})),this._flyoutController.createFlyout(t)):null}renderFlyoutAreaView(t){t.acknowledgeFlyoutText=n.Host.getLocString("AcknowledgeFlyoutText");t.nextFlyoutText=n.Host.getLocString("NextFlyoutText");t.stepCounterText=n.Host.getLocString("FlyoutStepCounterFormat",(t.currentStep+1).toString(),t.nbSteps.toString());t.dismissFlyoutText=n.Host.getLocString("DismissFlyout");this._flyoutController.setQuery(n.Host.getQuery());n.RuntimeConfig.QfMode===0||n.RuntimeConfig.QfMode===4||n.RuntimeConfig.QfMode===11?n.StaticHtmlElements.flyoutContainer.classList.add("flyoutSinglePane"):n.StaticHtmlElements.flyoutContainer.classList.remove("flyoutSinglePane");this.renderReactView("flyoutContainer",n.View.Flyout,{dataModel:t});this.showFlyoutAreaView();t.overlay&&this.showOverlayAreaView()}renderAADVerificationAreaView(t){n.View.AADVerification&&n.StaticHtmlElements.aadVerificationContainer&&(this.renderReactView("aadVerificationContainer",n.View.AADVerification,{dataModel:t,isEduTenant:!!(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.isEduTenant())}),n.setVisibility(n.StaticHtmlElements.aadVerificationContainer,!0))}showFlyoutAreaView(){n.setVisibility(n.StaticHtmlElements.flyoutContainer,!0);n.StaticHtmlElements.flyoutContainer.style.animation="none";n.StaticHtmlElements.flyoutContainer.offsetHeight;n.StaticHtmlElements.flyoutContainer.style.animation=null}hideFlyoutAreaView(){n.setVisibility(n.StaticHtmlElements.flyoutContainer,!1)}showOverlayAreaView(){n.setVisibility(n.StaticHtmlElements.overlayContainer,!0)}hideOverlayAreaView(){n.setVisibility(n.StaticHtmlElements.overlayContainer,!1)}updateTopBrandingBarView(t){!n.msbHost||(n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.features.isScopeListBrandingLogoEnabled())||this.renderReactView("msbTopBrandingBar",n.View.MsbBrandingBar,{dataModel:t})}updateWorkUpsellAreaView(t){t?(n.setVisibility(n.StaticHtmlElements.workUpsellBanner,!0),this.renderReactView("workUpsellBanner",n.View.WorkUpsellBanner,{dataModel:t})):n.setVisibility(n.StaticHtmlElements.workUpsellBanner,!1)}removeWorkUpsellAreaView(){var t;(t=n.StaticHtmlElements.workUpsellBanner)===null||t===void 0?void 0:t.remove()}updateScopesHeaderView(t){!this._shimmerShown||!t||(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.forceLoadingShimmer)||(this._shimmerShown=!1,n.StaticHtmlElements.shimmerContainer.classList.add("b_hide"),n.StaticHtmlElements.rootContainer.classList.remove("b_hide"));this.renderReactView("scopesHeader",n.config.optimizeScopesReactRender?n.View.ScopesHeaderV2:n.View.ScopesHeader,{dataModel:t})}updateNarratorMessageView(t){t&&n.StaticHtmlElements.narratorMessageContainer.setAttribute("aria-label",t);this.renderReactView("narratorMessageContainer",n.View.NarratorAnnouncement,{message:t})}updatePreviewErrorMessageView(t){this.renderReactView("errorPane",n.View.PreviewErrorMessageContainer,{dataModel:t,icon:{content:"",type:2}})}updatePreviewContainerView(t){this.renderReactView("localPane",n.View.WindowsPreviewContainer,{dataModel:t,expanderClickInstrumentation:this._expanderClickInstrumentation,chevronDownIcon:{content:"",type:2}})}updatePreviewContainerCopilotView(t,i,r){var u,f;n.RuntimeConfiguration.TextScaleFactor<=1.25&&(this._copilotChatQueryCount=this._copilotChatQueryCount+1,_ge("copilotLoadingScreen").classList.add("b_hide"),_ge("copilotInlinePreview").classList.remove("b_hide"),this.renderReactView("copilotInlinePreview",n.View.CopilotChat,{queryCount:this._copilotChatQueryCount,queryText:(u=t===null||t===void 0?void 0:t.queryText)!==null&&u!==void 0?u:"",isQF:(f=t===null||t===void 0?void 0:t.isQF)!==null&&f!==void 0?f:!1,conversationId:i,accessToken:r,historyMessage:[],chatClickHandler:t===null||t===void 0?void 0:t.chatClickHandler}))}updateMsbPreviewContainerView(n){let t=_ge("b_bfb");if(t!=null){const n=_w.BingAtWork;n&&n.clearMsbContainer&&n.clearMsbContainer();t.remove()}let i=_ge("msbPane");n.suggestion?(t=sj_ce("div","b_bfb"),t.classList.add("fbig"),i.appendChild(t),i.classList.add("localPreviewContainer","msbPreviewContainer")):i.classList.remove("localPreviewContainer","msbPreviewContainer")}updateMenuView(t){this.renderReactView("menuContainer",n.View.WindowsMenu,{dataModel:t})}updatePopoverView(t){this.renderReactView("popoverContainer",n.View.Popover,{dataModel:t})}setProgressIndicatorVisibility(t){this._progressBarVisible!=t&&(this._progressBar||(this._progressBar=_ge("b_progress")),n.setVisibility(this._progressBar,t),this._progressBarVisible=t)}setPreviewPaneVisibility(t){this._previewPaneVisible!=t&&(t||this.closeSidePanel(1),n.setVisibility(n.StaticHtmlElements.qfPreviewPane,t),t&&this.openSidePanel(1),this._previewPaneVisible=t)}toggleDebugWindowVisibility(){return this.setDebugWindowVisibility(!this._debugWindowVisible),this._debugWindowVisible}updateOptionsWindowView(t){this.renderReactView("optionsContainer",n.View.OptionsWindow,{dataModel:t})}hideMobileAppUpsellCard(){const n=_qs("#dynamic-pane-full")||_qs("#dynamic-pane");if(n){const n=_qs("#dynamic-pane-full .dsb-mobile-app-upsell-card");n&&(n.style.display="none");const t=_qs("#dynamic-pane .dsb-mobile-app-upsell-card");t&&(t.style.display="none")}}updateDynamicSearchView(t,i,r,u,f,e){if(!t&&!u){n.config.enableSSHUnshownFix||(n.setZeroInputDataSourcesForL1(),n.Host.refreshCurrentPane());return}const o=n.Host.getQuery();n.isDSBFullWidthFlightEnabled()?n.config.optimizeDsbInitRender&&n.shouldShowDSBFullWidth(o)&&i?this.renderDsbV2Moment(i):!n.config.optimizeDsbInitRender||n.shouldShowDSBFullWidth(o)&&i?(this.renderDsbV1Moment(t,r,u,f,e),i&&this.renderDsbV2Moment(i)):this.renderDsbV1Moment(t,r,u,f,e):this.renderDsbV1Moment(t,r,u,f,e);this.setQueryBasedCss(o)}renderDsbV1Moment(t,i,r,u,f){const e=n.msbDsbHost===null||n.msbDsbHost===void 0?void 0:n.msbDsbHost.isInBlendedMode();this.renderReactView("dynamic-pane",n.View.DSB.Templates.DynamicSearchBoxTemplateContainer,{moment:t,hideHeader:e,shouldShowDSBFlipper:i,isPastMoment:r,previousDateInFlipper:u,nextDateInFlipper:f})}renderDsbV2Moment(t){var r;let u="dsb-fwp-left-content",i=_ge(u);if(i){let n=i.nextElementSibling,u=i.parentElement;t.isMainColumnInLeft===!1?n&&((r=n.getAttribute("class"))===null||r===void 0?void 0:r.includes("dsb-fwp-right"))&&(n.setAttribute("class","dsb-fwp-right switched"),i.removeAttribute("class"),i.setAttribute("class","dsb-fwp-left"),u.removeChild(i),u.removeChild(n),u.appendChild(n),u.appendChild(i)):(i.setAttribute("class","dsb-fwp-left non-switched"),n||(n=i.previousElementSibling,n&&(n.removeAttribute("class"),n.setAttribute("class","dsb-fwp-right"),u.removeChild(i),u.removeChild(n),u.appendChild(i),u.appendChild(n))))}this.renderReactView(u,n.View.DSB.Templates.DSBFullWidthContainer,{moment:t,side:n.View.DSB.Templates.FullWidthContainerSide.Left});this.renderReactView("dsb-fwp-right-content",n.View.DSB.Templates.DSBFullWidthContainer,{moment:t,side:n.View.DSB.Templates.FullWidthContainerSide.Right})}setDebugWindowVisibility(t){n.setVisibility(this._debugWindow,t);n.RuntimeConfig.AlwaysWide?this.setConditionalCss("debugWindowOpen",t):t?this.openSidePanel(2):this.closeSidePanel(2);this._debugWindowVisible=t}applyAccentColor(){let u=n.Host.getAccentColor();if(this._lastAccentColor!=u){let e,o="accent-style",f=_ge(o);f||(f=_d.createElement("style"),f.setAttribute("id",o),f.type="text/css",e=!0);let t=":root {";t+=`--accent0: ${u};`;t+=`--accent1: ${i(u,.3)};`;t+=`--accent2: ${i(u,.1)};`;t+=`--accent3: ${i(u,.4)};`;t+=`--accent4: ${i(u,.6)};`;t+=`--accent5: ${i(u,.7)};`;t+=`--accent6: ${i(u,.15)};`;t+=`--accent7: ${r(u,-.35)};`;t+=`--accent8: ${r(u,-.2)};`;t+=`--accent9: ${r(u,-.1)};`;t+=`--accent10: ${i(u,0)};`;t+=`--accent11: ${n.Host.getAccentColor(1)};`;t+=`--accent12: ${n.Host.getAccentColor(-2)};`;t+=`--accent13: ${n.Host.getAccentColor(2)};`;t+=`--accent14: ${n.Host.getAccentColor(-1)};`;t+=`--accent15: ${i(u,.9)};`;t+=`--accent16: ${i(u,.8)};`;t+=`--accent17: ${i(n.Host.getAccentColor(1),.9)};`;t+=`--accent18: ${i(n.Host.getAccentColor(1),.8)};`;t+=`--accent19: ${i(n.Host.getAccentColor(-2),.9)};`;t+=`--accent20: ${i(n.Host.getAccentColor(-2),.8)};`;t+=`--accent21: ${r(n.Host.getAccentColor(1),.1)};`;t+=`--accent22: ${r(n.Host.getAccentColor(-2),.1)};`;t+=`--accent23: ${r(n.Host.getAccentColor(1),.2)};`;t+=`--accent24: ${r(n.Host.getAccentColor(-2),.2)};`;t+="}";f.innerHTML=t;e&&_d.head.appendChild(f);this._lastAccentColor=u}}addRewardsWidget(){const t=_d.createElement("script");t.src=n.config.rewardsWidgetBundleUrl;t.id="rewards-widget";t.setAttribute("data-report-activity","false");t.setAttribute("data-pid","WindowsSearchBox");t.async=!0;_d.head.appendChild(t)}adjustHeightAsync(){n.safeSetTimeout(()=>n.Host.adjustHeight(),0,"adjustHeightAsync")}bindOnNarratorLaunch(n){this._narratorLaunchHandlers.push(n)}render(t){this._renderingTimer&&sb_ct(this._renderingTimer);this._renderingInProgress=!0;try{n.View.ViewData=this.getViewData();t()}finally{this._renderingTimer=n.safeSetTimeout(()=>{this._renderingTimer=null,this._renderingInProgress=!1},0,"BasePage render")}}renderReactView(t,i,r){n!==undefined&&n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().beginMark("React Render - "+t);let u=this._targetElemCache[t];u||(this._targetElemCache[t]=u=_ge(t));let f=r;f.adjustHeight||(f.adjustHeight=()=>this.adjustHeightAsync());this.render(()=>_w.ReactDOM.render(React.createElement(i,r),u),t);n!==undefined&&n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("React Render - "+t)}addViewData(n,t){this._viewData[n]=t}getViewData(){return this._viewData}}n.Page=s}(WSB||(WSB={})),function(n){const t=54e5,i=20;class r{constructor(r){this._appCacheInstrumentationHelper=r;this._isReloadSuppressedAppCache=!1;this._pendingReload=!1;r.registerSuperFresh();n.Host.hasFallbackHappened()&&(this._isReloadSuppressedAppCache=!0,this._lastReloadAfterFallback=n.getCurrentTime());n.Host.bindAppHidden(()=>{var r;(this._isReloadSuppressedAppCache=this._lastReloadAfterFallback&&n.getCurrentTime()-this._lastReloadAfterFallback<t,this._isReloadSuppressedAppCache)||(n.logToMC("Bing_QF_SuperFreshAppCache",`SuperFreshAppCache_bindAppHidden_${this._pendingReload}`,"logSuperFreshAppCache"),!this._pendingReload&&n.Host.getPaneCloseCount()>=((r=n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.reloadAfterConversations)!==null&&r!==void 0?r:i)&&(this._pendingReload=!0),this._pendingReload&&(this.logReloadAttempt(),this.reload()))});const u=window.applicationCache;sj_be(u,"updateready",()=>this.onUpdateReady());n.Host.bindConversationStart(()=>{this._isReloadSuppressedAppCache=!0,this.shouldCheckForUpdate()&&n.contains([1,4,5],u.status)&&(n.logToMC("Bing_QF_SuperFreshAppCache",`SuperFreshAppCache_appCache_${u.status}`,"logSuperFreshAppCache"),n.config.fixInvalidMUID&&sj_cook&&sj_cook.clear("MUID","/"),n.safeExecute(()=>u.update(),"probe for manifest update: "+u.status))})}shouldCheckForUpdate(){if(!n.isBingEnabled())return!1;return(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.disableAppCache)?!1:!0}onUpdateReady(){this.logReloadAttempt();n.logToMC("Bing_QF_SuperFreshAppCache",`SuperFreshAppCache_onUpdateReady_${this._isReloadSuppressedAppCache}_${n.Host.getIsReloadSuppressedBgTask()}`,"logSuperFreshAppCache");this._isReloadSuppressedAppCache||n.Host.getIsReloadSuppressedBgTask()?this._pendingReload=!0:this.reload()}reload(){n.logToMC("Bing_QF_SuperFreshAppCache",`SuperFreshAppCache_reload_on_${n.Host.getPaneCloseCount()}`,"logSuperFreshAppCache");n.Host.reloadWebViewAsync()}logReloadAttempt(){this._appCacheInstrumentationHelper.instrumentSuperFreshUpdate(this._isReloadSuppressedAppCache)}}n.SuperFreshAppCache=r}(WSB||(WSB={})),function(n){let t;(function(t){function u(t,i,r,u,o,s,h=1,c){var v,y,p;let b=Date.now();(n.config===null||n.config===void 0?void 0:n.config.perfLogging)&&performance.mark(t+"_start");let w=(new Error).stack,l,a=i=>{const r=i instanceof Error&&(i.message===e||i.message===f);if(!r){i.stack&&(w=i.stack+"\n"+w);i.stack=w;l&&(o===null||o===void 0?void 0:o.unregister(l));switch(h){case 1:SharedLogHelper.LogError(t,s,c||i);break;case 2:n.LogWSBWarning(t,s,c||i,"WindowsTelemetry")}u&&u(i)}};try{let u=i();if(u){let i=null;u.cancel?i=()=>u.cancel():!((p=(y=(v=window===null||window===void 0?void 0:window.chrome)===null||v===void 0?void 0:v.webview)===null||y===void 0?void 0:y.hostObjects)===null||p===void 0?void 0:p.cancelPromise)||(n.MockUrlParameters===null||n.MockUrlParameters===void 0?void 0:n.MockUrlParameters.isTest)||(i=()=>window.chrome.webview.hostObjects.cancelPromise(u));o&&i&&(l=o.register(i,!1,t+" cancellation"));let f=i=>{let u=Date.now()-b;n.InstrumentationHelper.instrumentAggregateFunctionPerf(t,u);(n.config===null||n.config===void 0?void 0:n.config.perfLogging)&&performance.mark(t+"_end");l&&o.unregister(l);r&&n.safeExecute(()=>r(i),t+" safeChain() completion");(n.config===null||n.config===void 0?void 0:n.config.perfLogging)&&performance.measure(t,t+"_start",t+"_end")};u.done?u.done(f,a):u.then(f,a)}else a(new Error("No promise returned"))}catch(k){a(k)}}function o(n,t,i,r,f=1,e){return new Promise((o,s)=>u(n,t,o,s,i,r,f,e))}function r(t,i,r,u){i.completed=!0;i.result=r;i.pendingCallbacks.forEach(t=>n.safeExecute(()=>t(r),u));i.pendingCallbacks=null}function s(){i={}}function h(){let n=[];for(let t in i)i[t].completed||n.push(t);n.forEach(n=>delete i[n])}function c(u,f,e,o,s,h,c,l,a=1){return(v,y)=>{let w=e(v),p=i[w];if(p||(p={started:!1,completed:!1,result:null,pendingCallbacks:[]},i[w]=p),p.completed)y(p.result);else if(p.pendingCallbacks.push(y),!p.started){p.started=!0;let e=()=>{t.safeChain(u,()=>f(v),n=>{h&&!h(n)&&delete i[w],r(w,p,o?o(n):n,u)},t=>{n.isCancellation(t)?r(w,p,null,u):l?(l-=1,e()):r(w,p,s,u)},null,c,a)};e()}}}const f="Canceled",e="Promise canceled";t.safeChain=u;t.safePromise=o;let i={};t.clearGlobalCache=s;t.clearPendingItemsFromCache=h;t.safeChainWithGlobalCaching=c})(t=n.Async||(n.Async={}));let i;(function(n){function t(n,t,i){let r={};for(let u of n){let n=t[u];n&&(r[u]=i(n))}return r}function i(n){for(let t in n)if(n[t])return!1;return!0}n.map=t;n.isEmpty=i})(i=n.Map||(n.Map={}))}(WSB||(WSB={})),function(n){const i="show",t=n.config.useCobaltCSS?23:10;class r{constructor(t,i,r){this._page=t;this._showIcons=i;this.adjustHeight=r;this._menuStack=[];this._itemClickHandler=(t,i)=>{i.button==0&&(t.subItems?t.isSelectable&&!t.isExpanded&&(this.showSubMenu(t),t.isSticky=!0):t.click&&(t.click(n.getCurrentTime(),n.getInputType(i)),n.dismissAppWhenRunAsAdmin(t.id)))};this._itemEnterHandler=t=>{t.isSelectable&&!t.isExpanded&&(t.subItems&&(this._hoverTimer&&sb_ct(this._hoverTimer),this._hoverTimer=n.safeSetTimeout(()=>{this._hoverTimer=0;let n=_ge(t.id);t&&!t.isExpanded&&n&&n.matches(":hover")&&this.showSubMenu(t)},500,"menu item mouse enter")),this.stickParent(t))};this._itemLeaveHandler=t=>{t.isExpanded&&!t.isSticky&&n.safeSetTimeout(()=>{let n=_ge(t.id);t&&!t.isSticky&&n&&!n.matches(":hover")&&(t.subItems.some(n=>n==this._selectedItem)&&this.select(null,!1),this.dismissSubMenu(t))},450,"menu item mouse leave")};sj_be(_d.body,"mouseup",t=>{n.StaticHtmlElements.menuContainer.contains(t.target)||this.dismiss()});n.TestHookUrlParameters||sj_be(_w,"blur",()=>this.dismiss());sj_evt.bind("ajax.threshold.pageStart",()=>this.dismiss());n.Host.bindKeyEscape(n=>{this.isMenuVisible()&&(n.handled=!0,this._menuStack.length>0?this.reselectParentItem():this.dismiss(!0))})}showSubMenu(t){if(!t.isExpanded){this._selectedItem&&this.select(null,!1);let i=_ge(t.id),r=i.querySelector(".contextMenu");t.isExpanded=!0;n.setVisibility(r,!0);this.adjustSubMenuPosition(i,r);this._menuStack.push(t);this._page.updateMenuView(this.getDataModel())}}dismissSubMenu(t){if(this._selectedItem&&this.select(null,!1),t){let n=this._menuStack.indexOf(t);if(n<0)return;let i=this._menuStack.slice(n);for(let n=0;n<i.length;++n)this.dismissSubMenu()}else{t=this._menuStack.pop();let i=_ge(t.id),r=i.querySelector(".contextMenu");t.isExpanded=!1;t.isSticky=!1;n.setVisibility(r,!1)}this._page.updateMenuView(this.getDataModel())}showMenu(t,r){if(this._menuItems.length){n.setVisibility(n.StaticHtmlElements.menuContainer,!0);let u=this.getDataModel();this._page.updateMenuView(u);for(let n of this._menuItems)n.getIcon&&n.getIcon(1,t=>{n.icon=t,this._page.updateMenuView(this.getDataModel())});const f="renderContextMenu";n.safeSetTimeout(()=>{var o;this.adjustPosition(t,r,u.menuType!=0);n.StaticHtmlElements.menuContainer.classList.add(i);let e=_qs("#menuContainer > .contextMenu");if(this._inputType!==2){let n=(o=this._menuItems)===null||o===void 0?void 0:o.filter(n=>n===null||n===void 0?void 0:n.click)[0];n&&this.select(n,!1)}else e===null||e===void 0?void 0:e.focus();e.scrollTop=0;n.Host.setFocusInWebView(f)},0,f)}}innerShowContextMenu(t,i,r,u,f,e){this.dismiss();let o=this.getContextMenuItems(t,u);o&&o.length>0&&(this._menuItems=o,this._onDismiss=f,this._menuType=0,this._inputType=e,i-=n.StaticHtmlElements.root.offsetLeft,r-=n.StaticHtmlElements.root.offsetTop,this.showMenu(i,r))}showDropdownMenu(i,r,u,f,e){if(this.dismiss(),this._parentElement=r,this._inputType=e,i&&i.length>0){this._menuItems=i;this._onDismiss=f;this._menuType=u;let e;if(n.config.useCobaltCSS&&!n.isRtl()&&(r.id==="optionsButton"||r.id==="userProfileButton")){let i=n.StaticHtmlElements.menuContainer;if(!i)return;let r=i.offsetWidth;e=n.StaticHtmlElements.root.offsetWidth-r-t}else e=r.offsetLeft;let o=r.offsetTop+r.offsetHeight+1;n.isRtl()&&(e+=r.offsetWidth);(n.isSearchHoverSettingsEnabled()||n.config.wsbWithCopilot)&&this._parentElement.id==="optionsButton"?(this._isSearchContentChecked=n.getSearchContentLocalStorageItem(),this._isCopilotUIChecked=n.getCopilotUILocalStorageItem(),this._isPersonalizationChecked=n.getPersonalizationStorageItem(),this._isOptionToggleContextMenu=!0):this._isOptionToggleContextMenu=!1;this.showMenu(e,o)}}showContextMenuOnElement(n,t,i,r,u){let f=t.getBoundingClientRect();this._inputType=r;let e=f.left+t.offsetWidth/2,o=f.top+this._page.getScrollTop()+t.offsetHeight/2;this.showContextMenuOnXY(n,e,o,i,this._inputType,u)}showContextMenuOnXY(t,i,r,u,f,e){if(this._parentElement=null,this._inputType=f,e){let n=t.childSuggestions.filter(n=>n.text===e.text);n&&n.length&&(t=n[0])}let o=n.getVerbsAsync("showContextMenu",t,n.config.rawVerbs,!1,e=>n.safeSetTimeout(()=>this.innerShowContextMenu(n.extendVerbs(e,t,this._page),i,r,(i,r,u,f)=>{n.InstrumentationHelper.instrumentItemClickForContextMenu(r,t.instItem,t.sequenceNumber,t.instrumentPingBack,u,f,i)},u,f),0,"showContextMenu handler"),()=>!0);e||o||(this._page.hideTemporaryMessage(),n.Host.setFocusInSearchBox(null,"noContextMenu"))}getSelectableItems(){if(this._menuItems){let n=[];if(this._menuStack.length>0){let t=this._menuStack[this._menuStack.length-1];n=t.subItems}else n=this._menuItems;return n.map(n=>n.groupItems?n.groupItems:[n]).reduce((n,t)=>(n.push(...t),n),[]).filter(n=>n.isSelectable)}return[]}getSelectableItemsByGroup(){return[]}getSelectedItem(){return this._selectedItem}getDataModel(){return{clickHandler:this._itemClickHandler,enterHandler:this._itemEnterHandler,expandIcon:this.getExpandIcon(),inputType:this._inputType,isOptionToggleContextMenu:this._isOptionToggleContextMenu,isSearchContentChecked:this._isSearchContentChecked,isCopilotUIChecked:this._isCopilotUIChecked,isPersonalizationChecked:this._isPersonalizationChecked,items:this._menuItems,leaveHandler:this._itemLeaveHandler,menuType:this._menuType,setSearchContentLocalStorageItem:this.setSearchContentLocalStorageItem,setCopilotUILocalStorageItem:this.setCopilotUILocalStorageItem,setPersonalizationLocalStorageItem:this.setPersonalizationLocalStorageItem,showIcons:this._showIcons}}getExpandIcon(){return{content:n.isRtl()?"":"",type:2}}select(n){if(this._selectedItem){let n=_ge(this._selectedItem.id);n&&n.blur();this._selectedItem.selected=!1}if(this._selectedItem=n,this._selectedItem){let n=_ge(this._selectedItem.id);n&&n.focus();this._selectedItem.selected=!0}n&&this.stickParent(n);this._page.updateMenuView(this.getDataModel())}stickParent(n){let t=this.getParent(n);t&&(t.isSticky=!0);let i=this.getSiblings(n);for(let n of i)n.isSticky&&(n.isSticky=!1,this._itemLeaveHandler(n,null))}isItemInMenuOrMenuGroup(n,t){return t.some(t=>t==n||t.groupItems&&t.groupItems.indexOf(n)>=0)}getParent(n){for(let t of this._menuStack)if(this.isItemInMenuOrMenuGroup(n,t.subItems))return t;if(this.isItemInMenuOrMenuGroup(n,this._menuItems))return null;throw new Error(`Item: '${n.id}' was not found`);}getSiblings(n,t=false){let i=this.getParent(n),r=i?i.subItems:this._menuItems;return r.map(n=>n.groupItems?n.groupItems:[n]).reduce((n,t)=>(n.push(...t),n),[]).filter(i=>i.isSelectable&&(t||i!=n))}selectSubItem(n,t){this.showSubMenu(n);this.select(t,!1)}reselectParentItem(){let n=this._menuStack[this._menuStack.length-1];this.dismissSubMenu();this.select(n,!1)}onAfterKeyDown(t,i,r,u){if((r||u)&&!n.isUpOrDownKey(t))return!1;if(t=n.getRtlAdjustedKey(t),t==39||t==13){let n=this._selectedItem;if(n&&n.subItems&&n.subItems[0]){let t=n.subItems.filter(n=>n.isSelectable)[0];if(t)return this.selectSubItem(n,t),!0}}else if(t==37){if(this._menuStack.length>0)return this.reselectParentItem(),!0}else if(n.isUpOrDownKey(t)&&this._selectedItem){let n=this._menuStack.length==0?_qs(".contextMenu"):_ge(this._menuStack[this._menuStack.length-1].id).querySelector(".contextMenu");return n&&this._page.scrollToElement(_ge(this._selectedItem.id),n,n.offsetHeight),!0}return t==13}isMenuVisible(){return!!this._menuItems}dismiss(t){if(this._menuItems&&(this._menuItems=null,this._selectedItem&&(this._selectedItem.selected=!1,this._selectedItem=null),this._page.updateMenuView(this.getDataModel()),n.StaticHtmlElements.menuContainer.classList.remove(i),n.StaticHtmlElements.menuContainer.style.width=null,n.setVisibility(n.StaticHtmlElements.menuContainer,!1),n.RuntimeConfig.PanelCanResize&&(n.StaticHtmlElements.root.style.minHeight="",this.adjustHeight()),this._menuStack=[]),t&&this._parentElement&&this._parentElement.focus(),this._parentElement=null,this._inputType=null,this._onDismiss){let n=this._onDismiss;this._onDismiss=null;n()}}adjustSubMenuPosition(i,r){if(this._menuItems){const f=n.StaticHtmlElements.menuContainer;let a=f.offsetWidth,v=r.offsetHeight,o=r.offsetWidth,y=0,e=window.getComputedStyle(r).paddingTop;e.endsWith("px")&&(e=e.substr(0,e.length-2),y=+e+1);let h=0,p=_qs("#menuContainer .contextMenu").scrollTop,c=n.isRtl(),l=6;for(let n of this._menuStack){let t=_ge(n.id).querySelector(".contextMenu");l=+t.style.zIndex;h+=t.offsetLeft;p+=t.scrollTop;c=t.offsetLeft<0}++l;let u=f.offsetLeft+h+i.offsetLeft,s=f.offsetTop+i.offsetTop-p-y,w=n.StaticHtmlElements.root.offsetWidth-(u+a),b=u,k=o<w,d=o<b;(c||!k)&&d?u-=o:c&&d||!k?u=b>w?t:n.StaticHtmlElements.root.offsetWidth-o-t:u+=a-2;s+v>n.StaticHtmlElements.root.offsetHeight&&(s=Math.max(n.StaticHtmlElements.root.offsetHeight-v,n.StaticHtmlElements.root.offsetTop));u-=f.offsetLeft+h;s-=f.offsetTop;r.style.left=u+"px";r.style.top=s+"px";r.style.zIndex=l.toString()}}adjustPosition(i,r,u){if(this._menuItems){const o=n.StaticHtmlElements.menuContainer;let f=o.offsetWidth,h=o.offsetHeight;f>n.StaticHtmlElements.root.offsetWidth&&(f=n.StaticHtmlElements.root.offsetWidth,o.style.width=f+"px");let e=i,s=r;n.isRtl()?(e-=f,e<0&&(e=u?t:i)):e+f>n.StaticHtmlElements.root.offsetWidth&&(e=u?n.StaticHtmlElements.root.offsetWidth-f-t:Math.max(i-f,n.StaticHtmlElements.root.offsetLeft));!u&&s+h>n.StaticHtmlElements.root.offsetHeight&&(s=Math.max(n.StaticHtmlElements.root.offsetHeight-h,n.StaticHtmlElements.root.offsetTop));o.style.left=e+"px";o.style.top=s+"px";n.RuntimeConfig.PanelCanResize&&(n.StaticHtmlElements.root.style.minHeight=s+h+"px",this.adjustHeight())}}getContextMenuItems(t,i){return t.map((t,r)=>{let u={id:encodeURIComponent(t.verb),text:t.displayName,isSeparator:!t.verb,selected:!1,isDefault:t.isDefault,icon:t.icon,getIcon:t.getIcon,click:undefined,title:undefined,cssClass:undefined,isSelectable:!!t.verb};return u.isSeparator?u.id="Separator"+r:u.click=(r,u)=>{i(t.verb,r,u,null),t.executeSync?(n.safeExecute(()=>t.executeSync(),"verb.executeSync",null,t.verb),this.dismiss()):n.Async.safeChain("verb.executeAsync",()=>t.executeAsync(),()=>this.dismiss(),null,null,t.verb)},u})}setSearchContentLocalStorageItem(t){localStorage.setItem(n.OptionHoverLocalStorageKey,JSON.stringify(t));(n.isSearchPointsOfFlexibilityEnabled===null||n.isSearchPointsOfFlexibilityEnabled===void 0?void 0:n.isSearchPointsOfFlexibilityEnabled())&&n.dsbManager.updateGleamDataPofSchema(t)}setCopilotUILocalStorageItem(t){localStorage.setItem(n.OptionCopilotLocalStorageKey,JSON.stringify(t))}setPersonalizationLocalStorageItem(t){localStorage.setItem(n.OptionPersonalizationStorageKey,JSON.stringify(t))}}n.MenuFactory=r}(WSB||(WSB={})),function(n){const t="ConnectedAccounts";class i{constructor(){this._accountsCache={};(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.clearSSOCache)&&this.clear();this.init()}setToken(n,t){this.setTokenInfo(t,n);this.writeToLocalStorage()}findAccount(n,t){let i=this._accountsCache[n];return i&&!this.isExpired(i.LastUpdated,t,i.ExpireDateTime)?i:null}clear(){this._accountsCache={};this.writeToLocalStorage()}init(){this._accountsCache={};let i=n.LightweightStorage.getItem(t);i&&(this._accountsCache=n.safeExecute(()=>JSON.parse(i),"parseConnectedAccountString",{}))}writeToLocalStorage(){n.LightweightStorage.setItem(t,JSON.stringify(this._accountsCache))}isExpired(t,i,r){if(i===undefined)return!1;if(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.forceTokenRefresh)return!0;let u=n.getCurrentTime();if(r&&u>r)return!0;let f=Math.floor((u-t)/6e4);return f<0||f>=i}setTokenInfo(t,i){let r=this._accountsCache[t],u=n.getCurrentTime();r={Token:i.Token,LastUpdated:u,ExpireDateTime:i.ExpireDateTime,TenantName:i.TenantName,RoutingHint:i.RoutingHint,UserName:i.UserName,TenantId:i.TenantId,UserObjectId:i.UserObjectId,UserFirstName:i.UserFirstName};this._accountsCache[t]=r}}n.TokenStore=i}(WSB||(WSB={})),function(n){n.SelectedAccountIdStorageKey="SelectedAuthAccountId";const i="consumers",r="organizations",f=60,u="72f988bf-86f1-41af-91ab-2d7cd011db47";class t{constructor(n){this._tokenStore=n;this._pendingCallbacks={};this._availableMsaAccounts=[];this._availableAadAccounts=[];this._accessTokenAvailableHandlers=[];this._verifyAccountRequired=[];this._accountTypeChangedHandlers=[];this._accountsEnumeratedBeforeConnectHandlers=[];this._selectedAccountChangedBeforeConnectHandlers=[];this._selectedAccountChangedHandlers=[];this._reconnectAadReportHandlers=[];SearchAppWrapper.CortanaApp.addEventListener("experiencelaunched",()=>{SearchAppWrapper.CortanaApp.experienceId=="NotebookOffline"&&this._tokenStore.clear()})}static getWindowsAccountType(){return t._windowsAccountType}static internalSetWindowsAccountType(n){t._windowsAccountType=n}static getWindowsIdentity(){return t._windowsIdentity}static internalSetWindowsIdentity(n){t._windowsIdentity=n}static getMsaAccountsCount(){return t._msaAccountsCount}static internalSetMsaAccountsCount(n){t._msaAccountsCount=n}static getAadAccountsCount(){return t._aadAccountsCount}static internalSetAadAccountsCount(n){t._aadAccountsCount=n}authTypeMatchesWindowsAccountType(n){var i=t.getWindowsAccountType();return i==4||(n==0?i==2:i==1)}setWindowsAccountType(i){var r=t.getWindowsAccountType();t.internalSetWindowsAccountType(i);this.authTypeMatchesWindowsAccountType(1)&&n.isCloudSearchEnabledAadCache||(n.isMsftAccountConnected=!1);i!=r&&this.fireAccountTypeChanged()}getAllSyncingAccounts(n,t,i,r,u){let o=SearchAppWrapper.CortanaApp.fileExplorerSuggestionPage.registeredSyncRootInfo,f=[];for(let n in o){let t=o[n];typeof t=="string"&&t.includes("@")&&f.push(t)}f.length==0&&u([]);let e={responses:0,accounts:[]};for(let o of f)this.getAccountByUserName(n,t,o,i,r,n=>{++e.responses,n&&n.Token&&e.accounts.push(n),e.responses==f.length&&u(e.accounts)})}getAllAvailableAccounts(n){return n==0?this.getEnabledMSAAccounts().slice(0):this.getEnabledAADAccounts().slice(0)}getCachedAccountInfo(n){if(!this.authTypeMatchesWindowsAccountType(n))return null;switch(n){case 1:return this._cachedAAD;case 0:return this._cachedMSA;default:return null}}getSelectedAccountInfo(){let t=this.getSelectedAccountId(),n;const i=this.getEnabledAADAccounts().concat(this.getEnabledMSAAccounts());if(i.length>0){if(t&&(n=i.filter(n=>n.accountId==t)[0],n))return this.cacheAccount(n),n;if(!n){const t=this.getEnabledAADAccounts(),i=this.getEnabledMSAAccounts();if(t.length>0){const i=t.findIndex(n=>n.isDefaultAccount==!0);n=i>-1?t[i]:t[0]}else if(i.length>0){const t=i.findIndex(n=>n.isDefaultAccount==!0);n=t>-1?i[t]:i[0]}}n&&this.setSelectedAccount(n,0)}return n}setSelectedAccount(i,r){this.cacheAccount(i);let u=this.getSelectedAccountId();if(this.setSelectedAccountId(i.accountId),t.getWindowsAccountType()!=4){let t=this.getAccountType(i);if(u==i.accountId)return;let f=this.isAadAccount(u),e=this.isAadAccount(i.accountId);f&&e&&_w.bfbWsbTel&&bfbWsbTel.logValue("AccountChanged","AadToAad");this.setWindowsAccountType(t);n.config.msbEnableAccountManager&&this.fireSelectedAccountChangedBeforeConnect({prevousAccountId:u,nextAccount:i});this.connectAccounts([i],r);this.setSelectedAccountId(i.accountId);this.fireSelectedAccountChanged(i);(n.VelocityKeys===null||n.VelocityKeys===void 0?void 0:n.VelocityKeys.isFeatureEnabled(40979072))&&(SearchAppWrapper.CortanaApp.authenticationManager.currentAccount=i);r==3&&n.InstrumentationHelper.logClientInstEvent("ClientInst","AccountChanged",n.SequenceNumberManager===null||n.SequenceNumberManager===void 0?void 0:n.SequenceNumberManager.getSequenceNumber(),{accountType:t===null||t===void 0?void 0:t.toString()},"WindowsTelemetry",33554432)}}reconnectAad(n){const u=this.getSelectedAccountInfo();if((u===null||u===void 0?void 0:u.accountProviderAuthority)!==r){n();return}const e=500,o=40;let i=0;const t={success:!0,retryCount:i,errors:[]},f=()=>{this.getAccount(1,"https://substrate.office.com",!1,!0,(r,u)=>{r?(t.success=!0,t.retryCount=i,this.fireReconnectAadReport(t),n()):(t.errors.push(u||"<EMPTY>"),i>o?(t.success=!1,t.retryCount=i,this.fireReconnectAadReport(t),n()):(i++,sb_st(f,e)))},u)};f()}isMsaAvailable(){return this._availableMsaAccounts.length>0}isAadAvailable(){return this._availableAadAccounts.length>0}getSelectedAccountId(){const t=n.LightweightStorage.getItem(n.SelectedAccountIdStorageKey),i=t!==null&&t!==void 0?t:this._cachedSelectedAccountId;return n.config.enablePersistentStorageCarryover&&n.PSCache&&n.PSCache.changeSelectedAccountId(i),i}setSelectedAccountId(t){this._cachedSelectedAccountId=t;n.LightweightStorage.setItem(n.SelectedAccountIdStorageKey,t);n.config.enablePersistentStorageCarryover&&n.PSCache&&n.PSCache.changeSelectedAccountId(t)}isAadAccount(n){return this._availableAadAccounts.filter(t=>t.accountId==n).length>0}cacheAccount(t){n.Host.isAccountNotConsented(t)||(t.accountProviderAuthority==i?this._cachedMSA=t:this._cachedAAD=t)}cacheAllAccounts(r){this._availableMsaAccounts=[];this._availableAadAccounts=[];for(let t of r)n.Host.isAccountNotConsented(t)||(t.accountProviderAuthority==i?this._availableMsaAccounts.push(t):this._availableAadAccounts.push(t));t.internalSetMsaAccountsCount(this._availableMsaAccounts.length);t.internalSetAadAccountsCount(this._availableAadAccounts.length)}getEnabledMSAAccounts(){return n.isCloudSearchEnabledMsaCache?this._availableMsaAccounts:[]}getEnabledAADAccounts(){return n.isCloudSearchEnabledAadCache?this._availableAadAccounts:[]}getAccountType(n){const{accountProviderAuthority:t}=n;switch(t){case i:return 2;case r:return 1;default:return 3}}getAccountByUserName(t,i,r,u,f,e){let o,s=i==0?this._availableMsaAccounts:this._availableAadAccounts;if(s.length>0&&(o=s.find(n=>n.accountUserName.toLocaleLowerCase()==r.toLocaleLowerCase())),o){let r=t?n.getSubstrateResourceOrScope(i):n.getBingResourceOrScope(i);this.getAccount(i,r,u,f,e,o)}else e(null)}getAccountByUserNamePromise(n,t,i,r,u){return new Promise(f=>{this.getAccountByUserName(n,t,i,r,u,f)})}getAccount(n,t,i,r,u,f){if(!t)throw new Error("Resource or Scope has to be set");let o=n=>{let t=this._pendingCallbacks[e];this._pendingCallbacks[e]=null;t.forEach(t=>t(n))};if(!this.authTypeMatchesWindowsAccountType(n)){u(null,"AuthTypeMismatch");return}f||(f=this.getCachedAccountInfo(n));let e=t+i+r+(f?f.accountId:"");if(this._pendingCallbacks[e]){this._pendingCallbacks[e].push(u);return}this._pendingCallbacks[e]=[u];this.authenticate(n,t,i,r,o,f)}authenticate(t,i,r,e,o,s){let c=`${t}.${i}${s?"|"+s.accountId:""}`;if(e){const e=r?0:f,s=n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.noAuthCache;let i=s?null:this._tokenStore.findAccount(c,e);if(i){t==1&&(n.isMsftAccountConnected=i.RoutingHint&&i.RoutingHint.indexOf(u)>-1);o(i);return}}let h=n=>o(null,n);if(n.isBrowserOnline()){let r=SearchAppWrapper.CortanaApp.authenticationManager.createAuthenticateRequest();r.accountType="Windows";r.silentMode=e;t==1?r.resource=i:r.scope=i;let f=s&&SearchAppWrapper.CortanaApp.authenticationManager.authenticateSearchWebAccountAsync;const l=f?()=>SearchAppWrapper.CortanaApp.authenticationManager.authenticateSearchWebAccountAsync(r,s):()=>SearchAppWrapper.CortanaApp.authenticationManager.authenticateAsync(r);n.Async.safeChain("authenticateAsyncWAM",l,i=>{if(n.TestHookUrlParameters)if(e){if(n.TestHookUrlParameters.ssoAuthFail){h("MockedError");return}}else if(n.TestHookUrlParameters.uxAuthFail){h("MockedError");return}if(!i){n.log("WAM returned null");h("WamReturnsNull");return}if(i.token){const r=i.properties,f=r.UPN||i.userName,e=r.tid||r.TenantId,s=r.OID;if(!f){n.log("WAM didn't return UPN");h("WamReturnsNoUpn");return}let l;t==0?l=`MSA:${f}`:(n.isMsftAccountConnected=e==u,e&&s&&(l=`OID:${s}@${e}`));const a={Token:i.token,ExpireDateTime:r.exp?parseInt(r.exp)*1e3-3e5:null,TenantName:r.tenant_display_name||"",RoutingHint:l||f,UserName:f,TenantId:e,UserObjectId:s,UserFirstName:r.FirstName||""};t==0&&(a.ExpireDateTime=n.getCurrentTime()+n.HourToMs);this._tokenStore.setToken(a,c);const v=this._tokenStore.findAccount(c);o(v)}else{const t=JSON.stringify({errorCode:i.errorCode,errorMessage:i.errorMessage,status:i.status,accountId:i.accountId,authority:i.authority}),u=JSON.stringify({accountProviderId:r.accountProviderId,clientId:r.clientId,resource:r.resource,scope:r.scope,accountType:r.accountType,silentMode:r.silentMode});n.log(`WAM error: result=${t}, request=${u}; useMultiauth=${!!f}`);h(`WamError: ${t}`)}},n=>h(`AsyncCallError: ${(n===null||n===void 0?void 0:n.message)||JSON.stringify(n)}`))}else h("NotOnline")}bindAccessTokenAvailable(n){this._accessTokenAvailableHandlers.push(n)}bindVerifyAccountRequired(n){this._verifyAccountRequired.push(n)}bindAccountTypesChanged(n){this._accountTypeChangedHandlers.push(n)}bindAccountsEnumeratedBeforeConnect(n){this._accountsEnumeratedBeforeConnectHandlers.push(n)}bindSelectedAccountChangedBeforeConnect(n){this._selectedAccountChangedBeforeConnectHandlers.push(n)}bindSelectedAccountChanged(n){this._selectedAccountChangedHandlers.push(n)}bindReconnectAadReport(n){this._reconnectAadReportHandlers.push(n)}fireAccountTypeChanged(){this._accountTypeChangedHandlers.forEach(n=>n())}fireAccountsEnumeratedBeforeConnect(){this._accountsEnumeratedBeforeConnectHandlers.forEach(n=>n())}fireSelectedAccountChangedBeforeConnect(n){this._selectedAccountChangedBeforeConnectHandlers.forEach(t=>t(n))}fireSelectedAccountChanged(n){this._selectedAccountChangedHandlers.forEach(t=>t(n))}fireReconnectAadReport(n){this._reconnectAadReportHandlers.forEach(t=>t(n))}tryConnect(t,i,r){let f=t==1?n.isSubstrateO365AccountConnected:n.isSubstrateOutlookAccountConnected;if(!f){const u=n.getSubstrateResourceOrScope(t);this.getAccount(t,u,!1,!0,i=>{let f=!!i;t==1?n.isSubstrateO365AccountConnected=f:n.isSubstrateOutlookAccountConnected=f;f?this._accessTokenAvailableHandlers.forEach(i=>n.safeExecute(()=>i(t,u,r),"accessTokenAvailable",null,`${t}`)):this._verifyAccountRequired.forEach(i=>n.safeExecute(()=>i(t,u,r),"accessTokenAvailable",null,`${t}`))},i)}}updateWindowsAccountType(t){let e=!1,f=!1;for(let u of t)switch(u.accountProviderAuthority){case i:e=n.isCloudSearchEnabledMsaCache;break;case r:f=n.isCloudSearchEnabledAadCache}let u=3;if(n.config.userProfileButtonEnabled){let n=this.getSelectedAccountInfo();n&&(u=this.getAccountType(n))}else!f||!n.isMsbEnterprise()||(n.MockUrlParameters===null||n.MockUrlParameters===void 0?void 0:n.MockUrlParameters.isTest)?e&&f?u=4:f?u=1:e&&(u=2):u=1;this.setWindowsAccountType(u)}connectAccounts(t,u){n.isSubstrateO365AccountConnected=!1;n.isSubstrateOutlookAccountConnected=!1;for(let f of t)f.accountProviderAuthority==i&&n.isCloudSearchEnabledMsaCache?this.tryConnect(0,f,u):f.accountProviderAuthority==r&&n.isCloudSearchEnabledAadCache&&this.tryConnect(1,f,u)}accountTypeToAuthType(n){switch(n){case 2:return 0;case 1:return 1;default:throw new Error(`Not a logged in account: ${n}`);}}enumerateAccountAuthority(u){n.Async.safeChain("enumerateAccountAuthorityAsync",()=>SearchAppWrapper.CortanaApp.authenticationManager.enumerateAccountAuthorityAsync(),f=>{var e=t.getWindowsAccountType();if(e==0){let u=3;switch(f.Windows){case i:u=2;break;case r:u=1}if(this.setWindowsAccountType(u),e=t.getWindowsAccountType(),e!=3){let i=this.accountTypeToAuthType(e);this.getAccount(i,n.getBingResourceOrScope(i),!1,!0,n=>{let i=n&&n.UserName?n.UserName:"";t.internalSetWindowsIdentity(i)},undefined)}}n.substrateProvidersEnabled()&&(n.isCloudSearchEnabledAadCache&&e==1?this.tryConnect(1,null,1):n.isCloudSearchEnabledMsaCache&&e==2&&this.tryConnect(0,null,1));u()})}enumerateMultiAccountAuthority(u){if(!SearchAppWrapper.CortanaApp.authenticationManager.getAllSearchWebAccountsAsync){this.enumerateAccountAuthority(u);return}let f;n.Async.safeChain("getAllSearchWebAccountsAsync",()=>(f=n.getCurrentTime(),SearchAppWrapper.CortanaApp.authenticationManager.getAllSearchWebAccountsAsync()),e=>{const c=n.getCurrentTime()-f,y=n.getCurrentTime();this.cacheAllAccounts(e);let o=[],l=this.getSelectedAccountId();if(this._availableMsaAccounts.length>0){let n=this._availableMsaAccounts.findIndex(n=>n.accountId==l),t=n>=0?n:Math.max(this._availableMsaAccounts.findIndex(n=>n.isDefaultAccount),0),i=this._availableMsaAccounts[t];o.push(i)}if(this._availableAadAccounts.length>0){let n=this._availableAadAccounts.findIndex(n=>n.accountId==l),t=n>=0?n:Math.max(this._availableAadAccounts.findIndex(n=>n.isDefaultAccount),0),i=this._availableAadAccounts[t];o.push(i)}if(!n.config.userProfileButtonEnabled)for(let n of o)this.cacheAccount(n);const p=t.getWindowsAccountType();if(this.updateWindowsAccountType(o),n.config.msbEnableAccountManager&&this.fireAccountsEnumeratedBeforeConnect(),t.getWindowsAccountType()!=p){const u=(i,r)=>{this.getAccount(i,n.getBingResourceOrScope(i),!1,!0,n=>{let i=n&&n.UserName?n.UserName:"";t.internalSetWindowsIdentity(i)},r)};for(let t of o)t.accountProviderAuthority==i&&n.isCloudSearchEnabledMsaCache?u(0,t):t.accountProviderAuthority==r&&n.isCloudSearchEnabledAadCache&&u(1,t)}(n.isCloudSearchEnabledAadCache||n.isCloudSearchEnabledMsaCache)&&n.substrateProvidersEnabled()&&this.connectAccounts(o,1);u();const s="WebAccounts";let a=_G.ServerIG;if(!a){n.LogWSBError("instrumentPerformance "+s,"Could not instrument as server IG not known",new Error("Could not instrument performance "+s));return}const v=n.getCurrentTime()-y;let w={AllSearchWebAccounts:c,AllSearchWebAccountsCallback:v};const b=[w];let h=n.InstrumentationCommon.createPerfPingEvent(a,b,s);n.InstrumentationHelper===null||n.InstrumentationHelper===void 0?void 0:n.InstrumentationHelper.logEvent(h.EventType,h.Data,n.InstrumentationCommon.QFPERFPING_EVENT_NAME,null,null,h.ImpressionGuid,null,null,null,"WindowsTelemetry",16777216)})}promptAutheticateDialog(t,i,r,u){const f=f=>{let e=!!f;t==1?n.isSubstrateO365AccountConnected=e:n.isSubstrateOutlookAccountConnected=e;e?(r(),this._accessTokenAvailableHandlers.forEach(r=>n.safeExecute(()=>r(t,i,2),"promptAccessTokenAvailable",null,`${t}`))):(u(),this._verifyAccountRequired.forEach(r=>n.safeExecute(()=>r(t,i,2),"promptAccessTokenAvailable",null,`${t}`)))};this.getAccount(t,i,!1,!1,f,undefined)}}t._windowsAccountType=0;n.AccessTokenManager=t}(WSB||(WSB={})),function(n){const r="cohortProfile",u="WSBFirstOpenedDate",f=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/,i=29;class t{static getSingleton(){return t._singleton||SharedLogHelper.LogError("cohortProfileManager.getSingleton()",null,"CohortProfileManager._singleton should be initialized first!"),t._singleton}static initSingleton(){return t._singleton||(t._singleton=new t),t._singleton}constructor(){this._cohortProfile=[];n.Host.bindShown(()=>{this.deserializeCohortProfile(),this.updateCohortProfileBasedOnWSBOpenedDate(),this.determineWSBNewUser()});n.Host.bindDismissed(()=>{this.serializeCohortProfile()})}serializeCohortProfile(){n.LightweightStorage.setItem(r,JSON.stringify(this._cohortProfile));n.LightweightStorage.setItem(u,JSON.stringify(this._WSBFirstOpenedDate))}deserializeCohortProfile(){let t=n.LightweightStorage.getItem(r);t&&(this._cohortProfile=n.safeExecute(()=>JSON.parse(t,this.reviver),"cohortProfile",null));let i=n.LightweightStorage.getItem(u);i&&(this._WSBFirstOpenedDate=n.safeExecute(()=>JSON.parse(i,this.reviver),"firstOpen",null))}reviver(n,t){return typeof t=="string"&&f.test(t)?new Date(t):t}createCohortProfile(){this._cohortProfile=[];for(let n=0;n<30;n++)this._cohortProfile.push({date:null,count:0});let n=new Date;this._cohortProfile[i].date=this.getCurrentDate(n);this._cohortProfile[i].count=1}recordWSBFirstOpenedDate(){for(let n=0;n<30;n++)this._cohortProfile[n].date&&(!this._WSBFirstOpenedDate||this._cohortProfile[n].date<this._WSBFirstOpenedDate)&&(this._WSBFirstOpenedDate=this._cohortProfile[n].date)}updateCohortProfileBasedOnWSBOpenedDate(){if(this._cohortProfile.length==0)this.createCohortProfile(),this.recordWSBFirstOpenedDate();else{this._WSBFirstOpenedDate||this.recordWSBFirstOpenedDate();let t=this.getWSBLastOpenedDate(),r=new Date,n=this.getCurrentDate(r);if(t.getTime()===n.getTime())this._cohortProfile[i].count+=1;else{let r=this.getDaysBetween(t,n);if(r>30)this.createCohortProfile();else{let t=[];for(let n=0;n<30;n++)t.push({date:this._cohortProfile[n].date,count:this._cohortProfile[n].count});for(let n=r;n<30;n++)this._cohortProfile[n-r]=t[n];for(let t=0,n=30-r;t<r;t++,n++)this._cohortProfile[n].date=null,this._cohortProfile[n].count=0;this._cohortProfile[i].date=n;this._cohortProfile[i].count=1}}}}getCurrentDate(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate())}getDaysBetween(n,t){var i=n.getTime(),r=t.getTime(),u=r-i;return Math.round(u/864e5)}determineWSBNewUser(){this._isWSBNewUser=!1;let n=7,t=0;for(let i=30-n;i<30-t;i++)this._WSBFirstOpenedDate!=null&&this._cohortProfile[i].date!=null&&this._WSBFirstOpenedDate.getTime()===this._cohortProfile[i].date.getTime()&&(this._isWSBNewUser=!0)}isWSBNewUser(){return this._isWSBNewUser}getWSBFirstOpenedDate(){return this._WSBFirstOpenedDate}getWSBLastOpenedDate(){return this._cohortProfile[i].date}getTimesOfWSBOpenedInLastNDays(n){if(n>30)return-1;let t=0;for(let i=30-n;i<30;i++)t+=this._cohortProfile[i].count;return t}resetCohortProfileManager(){t._singleton=null;this._cohortProfile=[];this._WSBFirstOpenedDate=null}resetWSBFirstOpenedDate(){this._WSBFirstOpenedDate=null}}n.CohortProfileManager=t}(WSB||(WSB={})),function(n){var t;(function(t){function i(){n.Host.bindAppHidden(()=>{SearchAppWrapper.CortanaApp.isBingEnabled&&n.isBrowserOnline()&&n.safeExecute(()=>r.start("asgw",["fp.msedge.net/conf/v2/asgw/fpconfig.min.json"],2e3),"AFDFootprint.start",null,null)})}t.init=i;var r=(()=>{function ct(t,u,f,e="",o="",s={},h){try{if(!t||t.trim().length===0||Number(f)!==f||f%1!=0||f<0)return;const v=o.trim().length>0,p=e.trim().length>0;p&&e.trim().length>l&&(e=e.trim().substr(0,l));var c=window.location.protocol=="file:"?"https://":window.location.protocol+"//";if(!JSON||!XMLHttpRequest)return;if(window.XMLHttpRequest){const n=new XMLHttpRequest;if(!("onload"in n)||!("onerror"in n)||!("ontimeout"in n)||!("getAllResponseHeaders"in n))return}else return;const b=y(),k=i(),g=`MonitorID=${t}${v?`&customerId=${o}`:""}&rid=${k}&w3c=${b}&prot=${window.location.protocol}&v=${ft}${p?`&tag=${e}`:""}&DATA=`,w=()=>{const n=lt(fpconfig,c);if(n.length!==0){const i=at(n,c,d,s),t=[];for(let n of fpconfig.r)t.push(c+n+"?"+g);pt(i,a,f,t,null,h)}};if(typeof fpconfig=="undefined"){for(let n in u)u[n]=c+u[n]+"?"+`monitorId=${t}${v?`&customerId=${o}`:""}`;const i=n=>{try{fpconfig=JSON.parse(n.responseText);w()}catch(t){}};r(u,0,n,i)}else w()}catch(v){}}function r(t,i,u,f){if(!(i>=t.length)){u!==n&&u!==rt&&(u=n);const o=()=>{r(t,i+1,u,f)},e=new XMLHttpRequest;e.open(u,t[i],!0);e.onload=()=>{e.readyState===4&&e.status===200?f!=null&&f(e):o()};e.onerror=o;e.timeout=a;e.ontimeout=o;e.send()}}function lt(n,r){const e=[];let l=0;const p=b|t;for(let t of n.e)t.w>0&&t.m&p&&(l+=t.w,e.push({endpoint:t.e,cumWeight:l,weight:t.w,measurementTypes:t.m}));const a=r.toLowerCase()===k?[f,s,c]:[u,o,h],w=[v,nt,v],d=[1,3,2],y=[],g=Math.min(n.n,e.length);for(let n=0;n<g;n++){const t=Math.floor(Math.random()*l);let n=null;for(let i=0;i<e.length;i++)n==null?t<e[i].cumWeight&&(n=e[i],e[i].cumWeight=0):e[i].cumWeight-=n.weight;l-=n.weight;const r=n.endpoint.charAt(0)==="*"?i():"";for(let t=0;t<a.length;t++)n.measurementTypes&a[t]&&y.push({id:n.endpoint,testImage:w[t],measurementType:a[t],guid:r,rank:d[t]})}return y.sort((n,t)=>n.rank-t.rank),y}function at(n,r,u,f={}){const e=[];for(let o of n){const h=o.measurementType,c=o.testImage,l=o.guid;let n=o.id,s=r+(f&&f[n]||n);if(n.indexOf(".")===-1)s+=".clo.footprintdns.com";else if(n.charAt(0)==="*"){const t=n.substring(2);s=r+l+"."+t;n=t==="clo.footprintdns.com"||t==="fp.measure.office.com"||t==="azr.footprintdns.com"?l:t}s+=g;const a=s+u+"?"+i(),v=(h&t)!==h;e.push({url:a,requestID:n,object:u,conn:"cold",measurementType:h,report:v});const y=s+c+"?"+i();e.push({url:y,requestID:n,object:c,conn:"warm",measurementType:h,report:!0})}return e}function vt(n,t,i,r,u,f){const e=[];for(let o=0;o<f.length;o++)if(f[o].report){const c=n[o],h=f[o].measurementType,l=yt(c,h),s={};s.RequestID=f[o].requestID;s.Object=f[o].object;s.Conn=f[o].conn;s.Result=l;s.T=h;t[o]&&(s.Rip=t[o]);i[o]&&(s.Ep=i[o]);r[o]&&(s.Fe=r[o]);u[o]&&(s.Mn=u[o]);e.push(s)}return e}function yt(n,i){if(n<=0)return n;if(i&t&&n>0){const t=tt/(n/it);return Math.round(t)}return Math.round(n)}function i(){function n(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return n()+n()+n()+n()+n()+n()+n()+n()}function y(){return window.performance&&window.performance.getEntriesByName?!0:!1}function pt(t,i,u,f,e,o){function c(n){t[n].conn==="cold"?(t[n+1].report=!1,l(n+2)):l(n+1)}function k(n){let r;const u=new Image;u.onload=()=>{s[n]=(new Date).getTime()-f,r&&clearTimeout(r),l(n+1)};u.onerror=()=>{r&&clearTimeout(r),c(n)};r=setTimeout(()=>{u.onload=null,u.onerror=null,c(n)},i);let f=(new Date).getTime();u.src=t[n].url}function d(r){try{const u=new XMLHttpRequest;u.open(n,t[r].url,!0);u.onload=()=>{try{if(u.readyState===4)if(u.status===200){s[r]=(new Date).getTime()-f;const n=u.getAllResponseHeaders();if(n){const t=n.split("\r\n");t.forEach(function(n){var t=n.substring(0,n.indexOf(":")).toLowerCase(),i=n.substring(n.indexOf(":")+1);t===et?a[r]=i:t===ot?v[r]=i:t===st?w[r]=i:t===ht&&(b[r]=i)})}l(r+1)}else s[r]=0-u.status,c(r);else c(r)}catch(n){}};u.onerror=()=>{c(r)};u.ontimeout=()=>{c(r)};u.timeout=i;const f=(new Date).getTime();u.send()}catch(u){}}function l(n){try{n<t.length?t[n].measurementType&p?k(n):d(n):(g(),e!=null&&e())}catch(i){}}const s=[],a=[],v=[],w=[],b=[];for(var h=0;h<t.length;h++)s[h]=ut,a[h]=null,v[h]=null,w[h]=null,b[h]=null;const g=()=>{if(f!=null&&f.length!==0){if(y())for(let n=0;n<t.length;n++){const r=t[n].url,i=window.performance.getEntriesByName(r);s[n]>=0&&i&&i[0]&&(s[n]=i[0].duration)}const i=vt(s,a,v,w,b,t),e=JSON.stringify(i),u=[];for(let n=0;n<f.length;n++){const t=f[n]+e;u.push(t)}r(u,0,n,()=>{try{o&&o(i)}catch(n){}})}};setTimeout(()=>{l(0)},u)}const u=1,f=2,e=u|f,o=8,s=16,t=o|s,p=e|t,h=128,c=256,w=h|c,b=e|w,k="http://",l=200,d="trans.gif",g="/apc/",a=5e3,v="trans.gif",nt="100k.gif",tt=822.128,it=1e3,n="GET",rt="POST",ut=-1,ft="20190506",et="x-userhostaddress",ot="x-endpoint",st="x-frontend",ht="x-machinename";return{start:ct}})()})(t=n.AFDFootprintV2||(n.AFDFootprintV2={}))}(WSB||(WSB={})),function(n){class t{constructor(n,t){this.id=n;this._controller=t;this.flyoutMaxHeight=170;this.slackSize=10;this.currentStep=0;this.steps=[];this.dismissIntervalMs=0;this.repeatMax=1}addMessage(n,t=null,i,r,u){let f={message:n,title:t};return i&&(f=Object.assign(Object.assign({},f),this.getPositions(i))),r&&(f.id=r),u&&(f.iconKey=u),this.steps.push(f),this}button(n,t,i,r){return this.buttonMessage=n,this.buttonIcon={content:r,type:2},this.buttonClickHandler=i==1?(n,i)=>{this.hide(),t(n,i)}:(n,i)=>{this.dismiss(),t(n,i)},this}showButton(n){return this.showButtonMessage=n,this}icon(n){return this._icon=n,this}overlay(n){return this._overlay=n,this}hasOverlay(){return this._overlay}isLinkTextButton(n){return this._isLinkText=n,this}getPositions(t,i){var f,e,o,s,h,c,l,a;const it=n.RuntimeConfig.QfMode===0||n.RuntimeConfig.QfMode===4||n.RuntimeConfig.QfMode===11;let v=it?336:400,y=152;const k=(e=(f=n.StaticHtmlElements.root)===null||f===void 0?void 0:f.scrollHeight)!==null&&e!==void 0?e:document.body.scrollHeight,d=(s=(o=n.StaticHtmlElements.root)===null||o===void 0?void 0:o.scrollWidth)!==null&&s!==void 0?s:document.body.scrollWidth,r=t.getBoundingClientRect();if(!i){const n=r.bottom>k-this.flyoutMaxHeight;i=n?"Top":"Bottom"}let g,u,p,nt,w;const tt=r.top+r.height/2,b=(c=(h=n.StaticHtmlElements.root)===null||h===void 0?void 0:h.getBoundingClientRect().top)!==null&&c!==void 0?c:0;switch(i){case"Top":g=k-r.top+this.slackSize;break;case"Bottom":u=r.bottom+this.slackSize-b;break;case"Left":u=Math.max(Math.min(tt-y/2-b,d-y),4);break;default:return null}switch(i){case"Top":case"Bottom":const t=r.left+r.width/2;p=Math.max(Math.min(t-v/2,d-v),this.slackSize);w=Math.max(Math.min(t-p-this.slackSize,v-this.slackSize),this.slackSize);break;case"Left":const i=(a=(l=n.StaticHtmlElements.root)===null||l===void 0?void 0:l.getBoundingClientRect().right)!==null&&a!==void 0?a:0;nt=i-r.left+this.slackSize;w=Math.max(Math.min(tt-u-b-this.slackSize,y-this.slackSize),this.slackSize)}return{position:i,top:u,bottom:g,left:p,right:nt,beakOffset:w}}target(n,t){if(!n)return this;const i=this.getPositions(n,t);return this.position=i.position,this.bottom=i.bottom,this.top=i.top,this.beakOffset=i.beakOffset,this.left=i.left,this.right=i.right,this}setSticky(){return this.sticky=!0,this}isSticky(){return this.sticky}show(){return(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.isTest)&&!(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.showFlyoutInTests)||this._controller.showFlyout(this),this}dismissible(n,t){return this.dismissIntervalMs=n,this.dismissMessage=t,this}repeat(n){return this.repeatMax=n,this}dataModel(){if(!this.isValid())return null;const n=this.steps[this.currentStep],{message:t,title:i}=n;return{title:i,message:t,flyoutClass:this.flyoutClass,left:this.stepHasProperty("left")?n.left:this.left,right:this.stepHasProperty("right")?n.right:this.right,top:this.stepHasProperty("top")?n.top:this.top,bottom:this.stepHasProperty("bottom")?n.bottom:this.bottom,beakOffset:this.stepHasProperty("beakOffset")?n.beakOffset:this.beakOffset,nextStep:()=>this.nextStep(),nbSteps:this.steps.length,currentStep:this.currentStep,position:this.stepHasProperty("position")?n.position:this.position,iconKey:this.stepHasProperty("iconKey")?n.iconKey:this._icon,showDismissButton:this.dismissIntervalMs!=null&&this.dismissMessage!=null,buttonClickHandler:(t,i)=>{this.buttonClickHandler(t,i),this._controller.instrumentClientEvent("FlyoutSubmit",{id:this.stepHasProperty("id")?n.id:this.id},"WindowsTelemetry")},showButtonMessage:this.showButtonMessage,buttonMessage:this.buttonMessage,buttonIcon:this.buttonIcon,dismissMessage:this.dismissMessage,dismissClickHandler:()=>{this.dismiss(),this._controller.instrumentClientEvent("FlyoutDismiss",{id:this.stepHasProperty("id")?n.id:this.id},"WindowsTelemetry")},id:this.stepHasProperty("id")?n.id:this.id,overlay:this._overlay,isLinkText:this._isLinkText}}setClass(n){return this.flyoutClass=n,this}isValid(){return this.steps.length>0&&(!isNaN(this.left)||!isNaN(this.right))&&(!isNaN(this.top)||!isNaN(this.bottom))||!!(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.isTest)}dismiss(){return this._controller.dismissFlyout(this.id),this}shouldBeShown(){let t=this._controller.getLastTimeShown(this.id),i=this._controller.getTimesShown(this.id);return(t==0||t+this.dismissIntervalMs<=n.getCurrentTime())&&i<this.repeatMax}hide(){return this.currentStep=0,this._controller.hideFlyout(this.id),this}nextStep(){this.currentStep=Math.min(this.currentStep+1,this.steps.length-1);this.show()}stepHasProperty(n){return n in this.steps[this.currentStep]}}class i{constructor(n){this._page=n;this.lastShownKey=n=>`flyout-last-shown-${n}`;this.timesShownKey=n=>`flyout-times-shown-${n}`}createFlyout(n){return new t(n,this)}showFlyout(n){const t=this.currentFlyout&&this.currentFlyout.id!=n.id;if(t&&(this.currentFlyout=n),this.currentFlyout=n,this.shouldShow(this.currentFlyout)){const t=n.dataModel();t&&(this._page.renderFlyoutAreaView(t),this.instrumentClientEvent("FlyoutShow",{id:this.currentFlyout.id},"WindowsTelemetry"))}}hideFlyout(t=null){t&&this.currentFlyout&&t!==this.currentFlyout.id||(this.currentFlyout&&this.currentFlyout.hasOverlay()&&(this._page.hideOverlayAreaView(),n.StaticHtmlElements.root.classList.remove("overlayEnabled")),this.currentFlyout=null,this._page.hideFlyoutAreaView())}dismissFlyout(t){t&&this.currentFlyout&&t!==this.currentFlyout.id||(this.hideFlyout(t),n.LightweightStorage.setItem(this.lastShownKey(t),n.getCurrentTime().toString()),n.LightweightStorage.setItem(this.timesShownKey(t),(this.getTimesShown(t)+1).toString()))}wasDismissed(t){return!!n.LightweightStorage.getItem(this.lastShownKey(t))}shouldShow(n){return n.shouldBeShown()}getLastTimeShown(t){const i=parseInt(n.LightweightStorage.getItem(this.lastShownKey(t)));return i?i:0}getTimesShown(t){const i=parseInt(n.LightweightStorage.getItem(this.timesShownKey(t)));return i?i:0}onQueryChange(n){this.currentFlyout&&!this.currentFlyout.isSticky()&&this.queryOnActivation&&n.fullPartialQuery!=this.queryOnActivation.fullPartialQuery&&this.currentFlyout.hide()}setQuery(n){this.queryOnActivation=n}instrumentClientEvent(t,i={},r){n.InstrumentationHelper!=null&&n.InstrumentationHelper.logClientInstEvent("Select",t,n.SequenceNumberManager.getSequenceNumber(),i,r,33554432)}}n.FlyoutController=i}(WSB||(WSB={})),function(n){const r="show",i=10,t=7;class u{constructor(t){this._page=t;n.Host.bindKeyEscape(n=>{this.isPopoverVisible()&&(n.handled=!0,this.dismiss(!0))});n.Host.bindShown(()=>{this.dismiss(!1)});sj_be(n.StaticHtmlElements.popoverContainer,"mouseenter",()=>{this.clearDismissTimer()});sj_be(n.StaticHtmlElements.popoverContainer,"mouseleave",()=>{this.waitForEnterBeforeDismiss()});this.onMouseLeavesParent=this.onMouseLeavesParent.bind(this)}getElementOffsetFromRoot(t){let r=0,i=0;while(t&&t!=n.StaticHtmlElements.root)r+=t.offsetLeft,i+=t.offsetTop-t.scrollTop,t=t.offsetParent;if(n.canShowAnaheimWin11ZITopSites()){let n=this._page.getScrollTop();i-=n}return[r,i]}showPopover(n,t,i,r,u,f,e){if(this._parentElement){if(this._parentElement==i){this.clearDismissTimer();return}this.dismiss(e)}if(this._returnFocusToSearchBox=r,this._finishedOpening=!1,this._parentElement=i,sj_be(this._parentElement,"mouseleave",this.onMouseLeavesParent),n){this._text=n;this._buttons=t;this._className=f||"";let[r,o]=this.getElementOffsetFromRoot(i);r+=i.offsetWidth/2;this.showPopoverAt(r,o,u,e)}}isPopoverVisible(){return!!this._text&&this._finishedOpening}dismiss(t,i){this.clearDismissTimer();this._text&&(this._text=null,this._buttons=[],this._className="",n.StaticHtmlElements.popoverContainer.firstChild.blur(),this._selectedItem&&(this._selectedItem.selected=!1,this._selectedItem=null),this._page.updatePopoverView(this.getDataModel(i)),n.StaticHtmlElements.popoverContainer.classList.remove(r),n.setVisibility(n.StaticHtmlElements.popoverContainer,!1),n.StaticHtmlElements.popoverContainer.style.top=null,n.StaticHtmlElements.popoverContainer.style.width=null,n.StaticHtmlElements.popoverContainer.style.bottom=null,n.StaticHtmlElements.popoverContainer.style.left=null);this._parentElement&&(sj_ue(this._parentElement,"mouseleave",this.onMouseLeavesParent),t&&(this._parentElement.focus(),this._returnFocusToSearchBox&&n.Host.setFocusInSearchBox(null,"popoverDismissed")));this._parentElement=null}getSelectableItems(){return this._buttons||[]}getSelectableItemsByGroup(){return[]}getSelectedItem(){return this._selectedItem}select(n,t,i){if(this._selectedItem){let n=_ge(this._selectedItem.id);n&&n.blur();this._selectedItem.selected=!1}if(this._selectedItem=n,this._selectedItem){let n=_ge(this._selectedItem.id);n&&n.focus();this._selectedItem.selected=!0}this._page.updatePopoverView(this.getDataModel(i))}submit(t){if(t.action){let i=n.getCurrentTime();if(t.instItem){n.InstrumentationHelper.instrumentItemClick(i,t.instItem,t.sequenceNumber,null,2,null);let r=this.getSelectableItems();for(let t of r){let i=t;i.instItem&&n.InstrumentationHelper.instrumentSyntheticInstrumentedItem(i.sequenceNumber,i.instItem.getQsCode(),i.instItem)}}t.action()}}onAfterKeyDown(t){if(t=n.getRtlAdjustedKey(t),t==39||t==37){let n=this.getSelectableItems();if(n.length>0){let r=this.getSelectedItem(),i=n.indexOf(r);i+=t==39?1:-1;i<0?this.select(n[n.length-1],!1):this.select(n[i%n.length],!1)}return!0}return t==13}onItemClick(n,t){t.button==0&&this.submit(n)}onMouseLeavesParent(){this.waitForEnterBeforeDismiss()}waitForEnterBeforeDismiss(){this.clearDismissTimer();this._dismissTimer=n.safeSetTimeout(()=>{this._dismissTimer=null,!this._parentElement||this._parentElement.matches(":hover")||n.StaticHtmlElements.popoverContainer.matches(":hover")||this.dismiss()},100,"waitForDismiss")}clearDismissTimer(){this._dismissTimer&&(sb_ct(this._dismissTimer),this._dismissTimer=null)}getDataModel(n){return{text:this._text,items:this._buttons,clickHandler:(n,t)=>this.onItemClick(n,t),className:this._className,isSideBeak:n}}showPopoverAtSide(r,u){if(this._text){const f=n.StaticHtmlElements.popoverContainer;let e=f.offsetWidth+1,o=n.StaticHtmlElements.root.offsetWidth-2*i;e>o&&(e=o);let s=r,h=u-t;s+=t*2;f.style.width=e+"px";f.style.left=`${s}px`;f.style.top=`${h}px`;let c=_qs(".popover .beak.sidebeak",n.StaticHtmlElements.popoverContainer);c.style.top=`${t*4}px`;this._finishedOpening=!0}}showPopoverAtTop(r,u){if(this._text){const o=n.StaticHtmlElements.popoverContainer;let f=o.offsetWidth+1,h=n.StaticHtmlElements.root.offsetWidth-2*i;f>h&&(f=h);let e=0,c=n.StaticHtmlElements.root.offsetHeight-u;r-=f/2;c+=t;r<i?e=i-r:r+f>n.StaticHtmlElements.root.offsetWidth-i&&(e=n.StaticHtmlElements.root.offsetWidth-i-(r+f));o.style.width=f+"px";o.style.left=`${r+e}px`;o.style.bottom=`${c}px`;e<f/-2+t?e=f/-2+t:e>f/2-t&&(e=f/2-t);let s=_qs(".popover .beak",n.StaticHtmlElements.popoverContainer);s.style.left=`calc(50% - ${e}px`;n.isTSInSearchBoxAvailable()&&(o.style.left="524px",s.style.left=null,s.style.right="20px");this._finishedOpening=!0}}showPopoverAt(t,i,u,f){n.setVisibility(n.StaticHtmlElements.popoverContainer,!0);let o=this.getDataModel(f);this._page.updatePopoverView(o);const e="renderPopover";n.safeSetTimeout(()=>{if(f?this.showPopoverAtSide(t,i):this.showPopoverAtTop(t,i),n.StaticHtmlElements.popoverContainer.classList.add(r),u&&this._buttons&&this._buttons.length!=0)this.select(this.getSelectableItems()[0],!1,f);else{let t=n.StaticHtmlElements.popoverContainer.firstElementChild;t.focus()}n.Host.setFocusInWebView(e)},0,e)}}n.PopoverFactory=u}(WSB||(WSB={})),function(n){function e(n,t){return n<<t|n>>>32-t}function t(n,t){let i=(n&65535)+(t&65535),r=(n>>16)+(t>>16)+(i>>16);return r<<16|i&65535}function c(n,t,i){return n&t|~n&i}function l(n,t,i){return n&i|t&~i}function a(n,t,i){return n^t^i}function v(n,t,i){return t^(n|~i)}function i(n,i,r,u,f,o,s){return n=t(n,t(t(c(i,r,u),f),s)),t(e(n,o),i)}function r(n,i,r,u,f,o,s){return n=t(n,t(t(l(i,r,u),f),s)),t(e(n,o),i)}function u(n,i,r,u,f,o,s){return n=t(n,t(t(a(i,r,u),f),s)),t(e(n,o),i)}function f(n,i,r,u,f,o,s){return n=t(n,t(t(v(i,r,u),f),s)),t(e(n,o),i)}function y(n){let t=[],i=n.length*8;t[(n.length>>2)-1]=undefined;for(let n=0;n<t.length;n+=1)t[n]=0;for(let r=0;r<i;r+=8)t[r>>5]|=(n.charCodeAt(r/8)&255)<<r%32;return t[i>>5]|=128<<i%32,t[(i+64>>>9<<4)+14]=i,t}function o(n){let t="",i="";for(let r=0;r<=3;r++){let u=n>>>r*8&255;i="0"+u.toString(16);t=t+i.substr(i.length-2,2)}return t}function s(n){let st,ht,ct,lt,e=1732584193,s=4023233417,h=2562383102,c=271733878;const a=7,v=12,p=17,w=22,b=5,k=9,d=14,g=20,nt=4,tt=11,it=16,rt=23,ut=6,ft=10,et=15,ot=21;n=unescape(encodeURIComponent(n));let l=y(n);for(let n=0;n<l.length;n+=16)st=e,ht=s,ct=h,lt=c,e=i(e,s,h,c,l[n+0],a,3614090360),c=i(c,e,s,h,l[n+1],v,3905402710),h=i(h,c,e,s,l[n+2],p,606105819),s=i(s,h,c,e,l[n+3],w,3250441966),e=i(e,s,h,c,l[n+4],a,4118548399),c=i(c,e,s,h,l[n+5],v,1200080426),h=i(h,c,e,s,l[n+6],p,2821735955),s=i(s,h,c,e,l[n+7],w,4249261313),e=i(e,s,h,c,l[n+8],a,1770035416),c=i(c,e,s,h,l[n+9],v,2336552879),h=i(h,c,e,s,l[n+10],p,4294925233),s=i(s,h,c,e,l[n+11],w,2304563134),e=i(e,s,h,c,l[n+12],a,1804603682),c=i(c,e,s,h,l[n+13],v,4254626195),h=i(h,c,e,s,l[n+14],p,2792965006),s=i(s,h,c,e,l[n+15],w,1236535329),e=r(e,s,h,c,l[n+1],b,4129170786),c=r(c,e,s,h,l[n+6],k,3225465664),h=r(h,c,e,s,l[n+11],d,643717713),s=r(s,h,c,e,l[n+0],g,3921069994),e=r(e,s,h,c,l[n+5],b,3593408605),c=r(c,e,s,h,l[n+10],k,38016083),h=r(h,c,e,s,l[n+15],d,3634488961),s=r(s,h,c,e,l[n+4],g,3889429448),e=r(e,s,h,c,l[n+9],b,568446438),c=r(c,e,s,h,l[n+14],k,3275163606),h=r(h,c,e,s,l[n+3],d,4107603335),s=r(s,h,c,e,l[n+8],g,1163531501),e=r(e,s,h,c,l[n+13],b,2850285829),c=r(c,e,s,h,l[n+2],k,4243563512),h=r(h,c,e,s,l[n+7],d,1735328473),s=r(s,h,c,e,l[n+12],g,2368359562),e=u(e,s,h,c,l[n+5],nt,4294588738),c=u(c,e,s,h,l[n+8],tt,2272392833),h=u(h,c,e,s,l[n+11],it,1839030562),s=u(s,h,c,e,l[n+14],rt,4259657740),e=u(e,s,h,c,l[n+1],nt,2763975236),c=u(c,e,s,h,l[n+4],tt,1272893353),h=u(h,c,e,s,l[n+7],it,4139469664),s=u(s,h,c,e,l[n+10],rt,3200236656),e=u(e,s,h,c,l[n+13],nt,681279174),c=u(c,e,s,h,l[n+0],tt,3936430074),h=u(h,c,e,s,l[n+3],it,3572445317),s=u(s,h,c,e,l[n+6],rt,76029189),e=u(e,s,h,c,l[n+9],nt,3654602809),c=u(c,e,s,h,l[n+12],tt,3873151461),h=u(h,c,e,s,l[n+15],it,530742520),s=u(s,h,c,e,l[n+2],rt,3299628645),e=f(e,s,h,c,l[n+0],ut,4096336452),c=f(c,e,s,h,l[n+7],ft,1126891415),h=f(h,c,e,s,l[n+14],et,2878612391),s=f(s,h,c,e,l[n+5],ot,4237533241),e=f(e,s,h,c,l[n+12],ut,1700485571),c=f(c,e,s,h,l[n+3],ft,2399980690),h=f(h,c,e,s,l[n+10],et,4293915773),s=f(s,h,c,e,l[n+1],ot,2240044497),e=f(e,s,h,c,l[n+8],ut,1873313359),c=f(c,e,s,h,l[n+15],ft,4264355552),h=f(h,c,e,s,l[n+6],et,2734768916),s=f(s,h,c,e,l[n+13],ot,1309151649),e=f(e,s,h,c,l[n+4],ut,4149444226),c=f(c,e,s,h,l[n+11],ft,3174756917),h=f(h,c,e,s,l[n+2],et,718787259),s=f(s,h,c,e,l[n+9],ot,3951481745),e=t(e,st),s=t(s,ht),h=t(h,ct),c=t(c,lt);return(o(e)+o(s)+o(h)+o(c)).toLowerCase()}function p(n){let t=s(n);if(t==null||t.length!==32)return null;for(let n=0;n<32;n++){let i=t[n];if(!(/^\d+$/.test(i)||i>="a"&&i<="f"))return null}t+=0;let i="";for(let n=0;n<11;n++){let r=t[n*3],u=t[n*3+1],f=t[n*3+2],e=((r>="a"?r.charCodeAt(0)-"a".charCodeAt(0)+10:r.charCodeAt(0)-"0".charCodeAt(0))<<8)+((u>="a"?u.charCodeAt(0)-"a".charCodeAt(0)+10:u.charCodeAt(0)-"0".charCodeAt(0))<<4)+(f>="a"?f.charCodeAt(0)-"a".charCodeAt(0)+10:f.charCodeAt(0)-"0".charCodeAt(0));i=w(i,e)}return i}function w(n,t){return n.concat(h[Math.floor(t/64)]).concat(h[t%64])}n.calculateMd5=s;const h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";n.generateKeyFromDomain=p}(WSB||(WSB={})),function(n){class t{constructor(){this.promise=new Promise(n=>this.signal=n)}}n.Flag=t;class i{constructor(){this.flags=[];this.locked=!1}lock(){if(this.locked){const n=new t;return this.flags.push(n),n.promise}return this.locked=!0,Promise.resolve()}release(){if(this.flags.length>0){const n=this.flags.shift();n.signal()}else this.locked=!1}isLocked(){return this.locked}}n.Mutex=i}(WSB||(WSB={}))