var __spreadArrays,__assign,WSB;(function(n){function u(){if(!n.isMiniSerpEnabled())return 0;var t=7;return n.config.allowAnswersToAutoOpenMiniSerp||(t&=-2),n.config.allowDNavToAutoOpenMiniSerp||(t&=-3),n.config.allowWebToAutoOpenMiniSerp||(t&=-5),t}var t=function(){function t(){}return 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}",t}(),i=[t.QuickAccess,t.ThisPC],r=function(){function r(){this.refreshEntrypointApp()}return r.prototype.refreshEntrypointApp=function(){this.EntryPointApp=SearchAppWrapper.CortanaApp.hostingEnvironment==3?1:n.config.forceSettingsAppExperience?3:0},r.prototype.clearDefaults=function(){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},r.prototype.getAlwaysWideAndPrevewPaneAvailable=function(){var u=SearchAppWrapper.CortanaApp.textScaleFactor>1.25,t;try{t=SearchAppWrapper.CortanaApp.isWideSearch}catch(e){}var i=t!==!1&&!!n.Host.getFeatureDWORD("WideAtStartupDelta").featureValue,r=(i||n.config.alwaysWideBeforeRS5)&&!u,f=r||n.PreviewPane&&!i&&t!==!1;return[r,f]},r.prototype.OnAppVisible=function(){var r;this.clearDefaults();this.refreshEntrypointApp();n.isFileExplorerCurrentPathThisPcOrQuickAccess=!1;switch(this.EntryPointApp){case 1:r=n.safeExecute(function(){return SearchAppWrapper.CortanaApp.fileExplorerSuggestionPage.currentLocation},"fileExplorerSuggestionPage.currentLocation");r&&!r.startsWith("::")?this.QfMode=5:n.config.wsbInControlPanel&&r&&r.startsWith(t.ControlPanel)?this.QfMode=9:n.contains(i,r)?(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:var e=this.getAlwaysWideAndPrevewPaneAvailable(),f=e[0],o=e[1];this.QfMode=f?1:o?0:4;this.PreviewPaneAvailable=f||o;this.MiniSERPMode=this.PreviewPaneAvailable?u():0;this.AlwaysWide=f;this.ScopesAvailable=f?n.config.scopesOrderBeginAlwaysWide.length>0:n.config.scopesOrderBegin.length>0;this.SearchBoxOnTop=!1;this.SearchHomeAvailable=n.config.searchHomeSupported}},r}();n.RuntimeConfiguration=r})(WSB||(WSB={})),function(n){var t;(function(n){var t,i,r,u,f,e;(function(n){n.User="SRCHHPGUSR"})(t=n.CookieNames||(n.CookieNames={})),function(n){n.AutoSuggest="AS"}(i=n.CrumbNames||(n.CrumbNames={})),function(n){n.CursorPosition="cp";n.ConversationId="cvid";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"}(r=n.QueryParams||(n.QueryParams={})),function(n){n.ImpressionGuid="X-MSEdge-IG"}(u=n.Headers||(n.Headers={})),function(n){n.HitHighlighting="h";n.PopularNow="p";n.Local="l";n.Answers="a"}(f=n.Options||(n.Options={})),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 ri(t,i){if(i){var r=nt.exec(t);return r&&n.TopLevelDomains[r[1].toLowerCase()]==1}return nt.test(t)}function ui(n){return ni.test(n)}function fi(t){for(var i,u=t.substr(1).split("%").map(function(n){return parseInt(n,16)}),r=0;r=240&&++r&&i[3]<128)||i[0]>=224&&++r&&i[2]<128||i[0]>=192&&++r&&i[1]<128||i[0]<192&&i[0]>=128||i[0]<32||n.contains(it,i[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(function(n){return n.startsWith("%")&&!fi(n)?n.replace(/%/g,"%25"):n}).join("")}function h(t){var i=t;return t.includes("%")&&(t=n.safeExecute(function(){return ei(t)},"sanitizeUrlEncodings",i,i)),n.safeExecute(function(){return decodeURI(t)},"safeDecodeURI",i,i)}function r(n,t){var r,u,i;if(!n)return null;if(n=n.trim(),n.includes("%")&&c(n))if(n.includes("?")){var e=/([^?]*)(.*)/.exec(n),f=e[1],o=e[2];f=h(f);n=f+o}else n=h(n);return(r=kt.exec(n),!r)?null:(u=r[0].length,t&&u2&&n.SecondLevelDomains[u[u.length-2]]?u.splice(0,u.length-2):u.splice(0,u.length-1),o=u.join("."),f=HitHighlightingParser.addMarkers(o,t)),e=f.indexOf(HitHighlightingParser.startMarker),e==-1)?0:t.includes(".")?(t.endsWith("/")&&(t=t.substr(0,t.length-1)),r.hostname.includes(t)?t.length:0):(s=f.indexOf(HitHighlightingParser.endMarker),s-e-1)}function yi(n,t){var i,r,u;return t.path?(i=HitHighlightingParser.addMarkers(t.path,n),r=i.indexOf(HitHighlightingParser.startMarker),r==-1)?0:(u=i.indexOf(HitHighlightingParser.endMarker),u-r-1):0}function pi(n){return n=ft(n,!1),gt.test(n)}function ut(n){return f.test(n)}function wi(n){return a.test(n)}function c(n){return wt.test(n)}function bi(n){return ut(n)&&!c(n)}function ki(n){var t;return t=typeof n=="string"?n:l(n,!0),t=gi(t),t.trim().replace(/^ht+p(s)?[:;]+[\\\/]*|^\/*/ig,function(n,t){return 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;var 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){var 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){var i=n,u,f,e;return t&1&&(u=et.exec(i),u&&(i=u[1])),t&2&&(u=ot.exec(i),u&&(i=u[1])),t&4&&(u=st.exec(i),u&&(i=u[1])),t&8&&(u=a.exec(i),u&&(i=u[1])),t&16&&(u=nr.exec(i),u&&(i=u[1])),t&32&&(f=r(i,!1),f&&(f.protocol=f.protocol.toLocaleLowerCase(),f.hostname=f.hostname.toLocaleLowerCase(),e=l(f),i=i.replace(/^(\s*)(?:[^\s]*)(\s*)$/g,"$1"+e+"$2"))),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){var f,u,o,s,e;return t?t=="/"?n:(f=i(t,7),f!=t)?n:(u=i(n,r?7:6),!u)?n:(o=t.toLowerCase(),"https".startsWith(o)&&!u.startsWith(t))?n:(s=i(f,8),s!=f)?u:(e=i(u,8),!e)?u:"www".startsWith(o)&&!e.startsWith(t)?u:e:i(n,r?15:14)||n}function rr(n,t){var 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;var f=e(t.originalQuery);return n.contains([1,2],f)&&!rr(r,u)?!1:!0}function ct(n){var t=r(n,!0),i;return t?(i=v(t),i?t.path.toLocaleLowerCase():null):null}function v(n){var t=n.hostname.split(".");return n.hostname&&t.length>1?t[t.length-1]=="com"&&ht.some(function(n){return t[t.length-2]==n}):!0}function fr(t){if(t=="https://www.bing.com/?form=EDGSTP&pc=MESP"||t=="https://www.bing.com/?form=EDGSTP&pc=MESPB")return!0;var i=ct(t);return!!i&&n.contains(n.WebSearchPaths,i)}function er(n){var t=r(n.replace(/^ftp:/g,"http:"),!0);return(t?t.hostname:null)||""}function or(t){var r=t.queryToFetch.toLocaleLowerCase(),f,u;return r?(f=["/","ht","htt","http","https","ww","www"],u=i(r,15),!u||n.contains(f,r)||u!=r&&"www".startsWith(i(r,7))):!1}function sr(n){var t,i;return pt.test(n)||f.test(n)?!0:(t=n.replace(ti,"/"),ii.test(t)?t=t.replace(tt,"."):t.includes(".")&&(t=t.replace(tt,"")),i=r(t,!0),i&&i.type==0)}function hr(t,i,r,u,f){var o,e;if(!t||!i||!r)return"";o=encodeURIComponent(i);e={triggeringMode:"Explicit",intent:r};u&&(e.entityId=u);var h=JSON.stringify(e),c=encodeURIComponent(h),s=n.formatString(t.bfbSearchUrl,[o,c,f]);return _G&&_G.IG?s+"&cvid="+encodeURIComponent(_G.IG):s}function cr(t,i,r){var u=n.formatString(t.bfbSearchUrl,[i,"",r]);return _G&&_G.IG?u+"&cvid="+encodeURIComponent(_G.IG):u}function lr(n){return n.replace(/[;,/?:@&=+$ ]/g,function(n){return"%"+n.charCodeAt(0).toString(16)})}function ar(n,t,i){return v(r(n,!0))?at(lt(n,i),t):n}function lt(n,t){return o(n,"setlang",t)}function at(n,t){return o(n,"cc",t)}function o(n,t,i){var u=vr(n),f=u.params,e=u.anchor,r=f,s=rt(f,t);return s==null?r=n.indexOf("?")>=0?r.concat("&"+t+"="+i):r.concat("?"+t+"="+i):(r=r.replace(new RegExp(t+"="+s,"i"),""),r=o(r,t,i)),e.length>0&&(r=r.concat("#",e)),r=r.replace("?&","?"),r.replace("&&","&")}function vr(n){var t=n.split("#");return t.length==2?{params:t[0],anchor:t[1]}:{params:t[0],anchor:""}}var u="\\-\\s\\[\\]\\/\\\\!@#$%^&*()+={}:;~`\"'|<,>.。?",vt="(?:[^"+u+"]-*)*[^"+u+"](?:-*[^"+u+"])*",y="(?:[^"+u+"]-*)*[^"+u+"0-9](?:-*[^"+u+"])*",yt="(?:(?:"+vt+"[.。])*"+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?[:;]+[\\\\/]*",pt=new RegExp(d,"i"),g=d+"|/+",wt=new RegExp("^("+g+")","i"),bt=yt+"|"+s+"|\\["+b+"\\]",kt=new RegExp("^("+g+")?([^/@#?]*@)?("+bt+")(:(?: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"),dt=/^localhost[.。]?$/,nt=new RegExp("[.。]("+y+")[.。]?$","i"),gt=/((^[\\]{2}).+)|(^[a-z]:\\.*)/i,f=/^([a-z0-9\-]+):/i,ni=/\s/,tt=/\s+/g,ti=/\s+\/(?!\/)/g,ii=/([^\/]|^)\/(?!\/)/,it,ht;n.WebSearchPaths=["/search","/entityexplore"];it=[33,39,40,41,42,91,93];n.tryParseUrl=r;n.getQueryStringParam=rt;var oi=/file:\/\/\/[^:\/]+:\/[^\/]+\/[^\/]+\/AppData\//i,si=["ms-appx:","ms-appx-web:","ms-browser-extension:",],hi="microsoft.microsoftedge_8wekyb3d8bbwe";n.isJunkUrl=ci;n.computeUrlMatchLengths=li;n.isUncOrLocalPath=pi;n.startsWithProtocol=ut;n.startsWithWww=wi;n.isHttpProtocol=c;n.isNonHttpProtocol=bi;n.cleanAndFixUrlProtocol=ki;n.cleanAndFixUncOrLocalPath=di;n.parsedUrlToString=l;var 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;ht=["bing","staging-bing-int","working-bing-int","bing-int","bing-exp","binginternal"];n.tryGetBingPathLC=ct;n.isBingHost=v;n.isBingSearchUrl=fr;n.getDomain=er;n.isEmptyUrlPrefix=or;n.queryLooksLikeUrl=sr;n.buildBfbSearchUrl=hr;n.buildMsbWorkSearchUrl=cr;n.encodeURIComponentForWindowsProtocol=lr;n.setBingUrlLanguageAndRegion=ar;n.setUrlLang=lt;n.setUrlCC=at;n.setUrlParameter=o}(WSB||(WSB={})),function(n){var t,i;(function(n){function t(t,i,r,u,f,e){var 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_CONTENT=500;n.KVALUE_DSB_MSB_CONTENT=800;n.DEFAULT_APP_NAMESPACE="SmartSearch";n.DEFAULT_SERVICE_NAME="AutoSuggest";n.createPerfPingEvent=t})(t=n.InstrumentationCommon||(n.InstrumentationCommon={}));i=function(){function n(n,t,i){this._kValue=n;this._qsCode=t;this._handOffType=i;this._properties={}}return n.createInstrumentedItem=function(t,i){return new n(n.generateKValue(t),i)},n.createInstrumentedItemHandOffOverride=function(t,i,r){return new n(n.generateKValue(t),i,r)},n.createInstrumentedItemKvalueOverride=function(t,i,r){return new n(t,i,r)},n.createInstrumentedItemForReformulation=function(t,i){return new n(n.generateKValue(t),i,998)},n.createInstrumentedItemNoHandOff=function(t,i){return new n(n.generateKValue(t),i,999)},n.getNonSuggestionInstrumentedItem=function(t,i,r){if(!i[t])throw new Error(t+" not found in kvalues map");return new n(i[t],t,r)},n.prototype.getKValue=function(){return this._kValue},n.prototype.getAppNS=function(){return n.AppNS},n.prototype.getLayoutKValue=function(){return this._kValue+"."+n.Suffix},n.prototype.getHValue=function(){return"ID="+n.AppNS+","+this.getLayoutKValue()},n.prototype.getHandoffType=function(){return this._handOffType},n.prototype.getQsCode=function(){return this._qsCode},n.prototype.setProperty=function(n,t){this._properties[n]=t},n.prototype.getProperties=function(){return Object.keys(this._properties).length>0?this._properties:undefined},n.resetKValues=function(n){delete this._keystrokesKValues[n]},n.generateKValue=function(n){var r=n,i=this._keystrokesKValues[r];return i>0||(i=t.KVALUE_SUGGESTIONS_START),this._keystrokesKValues[r]=++i,i},n.AppNS=t.DEFAULT_APP_NAMESPACE,n.Suffix=t.KVALUE_SUFFIX_START,n._keystrokesKValues={},n}();n.InstrumentedItem=i}(WSB||(WSB={}));__spreadArrays=this&&this.__spreadArrays||function(){for(var i=0,n=0,r=arguments.length;nt&&r>=0;--r)i(n[r])&&n.splice(r,1)}function ui(n,i){return n.filter(function(n){return!t(i,n)})}function fi(n,t){if(n.length!=t.length)return!1;for(var i=0;i=0?"+":"-";return t.getFullYear()+"-"+r(t.getMonth()+1)+"-"+r(t.getDate())+"T"+r(t.getHours())+":"+r(t.getMinutes())+":"+r(t.getSeconds())+"."+r(t.getMilliseconds())+u+r(i/60)+":"+r(i%60)}function si(n,t){return n?n.replace(ht,function(n,i){return t[i]}):n}function hi(n){var t=n?n.number:null,i=n?n.name:null;return t==-2147023673||i=="Canceled"}function u(n,t,i,r,u,f){try{return n()}catch(e){return f||SharedLogHelper.LogError(t,r,e),u&&u(e),i}}function o(n,t,i,r,f,e){return sb_st(function(){return u(n,i,null,r,f,e)},t)}function ci(n){for(var i=[],t=1;t14}function sr(n){return n==="i"?13:n==="v"?14:0}function hr(n){return encodeURIComponent(n).replace(/[!'()*]/g,escape).replace(/%20/g,"+")}var f=String.fromCharCode(57346),ot=new RegExp("^\\s*("+f+")?\\s*"),st=new RegExp("\\s*("+f+")?\\s+","g"),ht=/{([0-9]+)}/g,ct=" -_/\\",lt=-2147215328,at=-2147023673,h,ft,i,et;n.DayToMs=864e5;n.HourToMs=36e5;n.MinuteToMs=6e4;n.DebugSourceName="WindowsSearchBox";SharedLogHelper.RegisterErrorFilter(function(n){var t=n?n.number:null,i=n?n.name:null;return t===at||t===lt||i==="Canceled"});n.isHighContrastEnabled=vt;n.isBrowserOnline=yt;n.cleanQuery=c;n.cleanGuid=pt;n.isEmpty=wt;n.canIconFail=bt;n.mantainCursorPositionIn=l;n.getInputType=kt;n.disableDataSources=a;n.disableWebDataSourceIfNeeded=gt;n.isMultiWord=y;n.baseParseQuery=ni;n.isDataSourceEnabled=p;n.isSuggestionTypeEnabled=w;n.contains=t;n.tryRemove=ti;n.removeFirstWhere=ii;n.trimList=ri;n.except=ui;n.sequenceEqual=fi;n.objEquals=ei;n.log=function(){};n.getCurrentDate=function(){return new Date};n.getCurrentTime=b;n.getDateWithTimezone=oi;n.fetchWrapper=function(n,t,i){return i()};n.formatString=si;n.isCancellation=hi;n.safeExecute=u;n.safeSetTimeout=o;n.safeFireEvent=ci;n.invokeAsynchronously=li;n.ensureCallbackIsAsync=s;var e=!0,k=!0,d=!0;n.refreshBingEnabledCache=ai;n.isBingEnabled=vi;n.isWebProviderEnabled=yi;n.isMiniSerpEnabled=pi;var wi=[3,16,17,18,19,20,144,145,],g=[38,203,211,],nt=[40,204,212,],tt=g.concat(nt),bi=tt.concat(37,39,36,35);n.isFunctionalKey=ki;n.isUpOrDownKey=di;n.isUpKey=gi;n.isDownKey=nr;n.isMovingCursorKey=tr;n.isContextMenuKey=ir;n.isDeletionKey=rr;n.getWindowProtocol=it;n.getWindowHost=ur;n.getWindowPath=fr;n.getCurrentActiveElement=er;n.WindowsApiDefaultDate=-116444736e5;n.isValidDate=rt;n.getTimeDiffInDays=ut;n.olderThan2Weeks=or;n.verticalToHandoffType=sr;h=function(){function n(){this._cancellations={};this._lastId=0}return n.prototype.register=function(n,t,i){var r=++this._lastId;return this._cancellations[r]={action:n,skipOnDismissAndLaunch:t,where:i},r},n.prototype.unregister=function(n){delete this._cancellations[n]},n.prototype.cancelAll=function(n){var t=function(t){var r=i._cancellations[t];r.skipOnDismissAndLaunch&&n||u(function(){return r.action()},r.where)},i=this;for(var r in this._cancellations)t(r);this._cancellations={}},n}();n.CancellationManager=h;ft=function(){function n(){}return n.prototype.getItem=function(n){var t;try{return((t=_w.localStorage)===null||t===void 0?void 0:t.getItem(n))||null}catch(i){return SharedLogHelper.LogError("localStorage",i,new Error("getItem")),null}},n.prototype.setItem=function(n,t){var i;try{(i=_w.localStorage)===null||i===void 0?void 0:i.setItem(n,t)}catch(r){SharedLogHelper.LogError("localStorage",r,new Error("setItem"))}},n.prototype.removeItem=function(n){var t;try{return(t=_w.localStorage)===null||t===void 0?void 0:t.removeItem(n)}catch(i){SharedLogHelper.LogError("localStorage",i,new Error("removeItem"))}},n.prototype.clear=function(){var n;try{return(n=_w.localStorage)===null||n===void 0?void 0:n.clear()}catch(t){SharedLogHelper.LogError("localStorage",t,new Error("clear"))}},n.prototype.getLength=function(){var n;try{return((n=_w.localStorage)===null||n===void 0?void 0:n.length)||0}catch(t){return SharedLogHelper.LogError("localStorage",t,new Error("length")),0}},n.prototype.key=function(n){var t;try{return((t=_w.localStorage)===null||t===void 0?void 0:t.key(n))||null}catch(i){return SharedLogHelper.LogError("localStorage",i,new Error("key")),null}},n}();n.LightweightStorage=ft;i=function(){function n(){}return n.resetSequenceNumber=function(){this._sequenceNumber=0},n.getSequenceNumber=function(){return this._sequenceNumber},n.incrementSequenceNumber=function(){this._sequenceNumber++},n._sequenceNumber=0,n}();n.SequenceNumberManager=i;et=function(){function t(t,i,r,u,f){var e=this;this._suggestionsParsers=t;this._rootViewModel=i;this._suggestionsRenderingManager=r;this._webProviders=u;this._otherProviders=f;n.config.cancellationEnabled&&(this._cancellationManager=new h);n.Host.bindShown(function(){e._lastQuery=null;e._currentQuery=null;e._isPaneDismissed=!1});n.Host.bindDismissed(function(){e.clearFetchTimer();e.finishPreviousQuery(!0);e.finalizeKeystroke(!0);e._isPaneDismissed=!0;e._rootViewModel.onDismiss()});n.Host.bindQueryChangedOrInitialized(function(t,i){return e.onQueryChanged(t,n.config.d,i)});n.Host.bindOnSubmit(function(n,t,i){return e.onSubmit(n,t,i)});n.Host.initializeEvents();sj_be(_d.body,"dragstart",function(n){return n.preventDefault(),n.stopPropagation(),!1});sj_b.addEventListener("click",function(n){n.shiftKey&&sj_pd(n)})}return t.prototype.clearFetchTimer=function(){this._fetchTimer&&(sb_ct(this._fetchTimer),this._fetchTimer=null)},t.prototype.finishPreviousQuery=function(n){this.cancelPreviousQuery(n);this._suggestionsRenderingManager.resetTimers()},t.prototype.finalizeKeystroke=function(t){var r=i.getSequenceNumber();r>0&&n.InstrumentationHelper.finalizeKeystrokeLog(r);t||i.incrementSequenceNumber()},t.prototype.onQueryChanged=function(n,t,r){var u=this;if(this._currentQuery=n,!r&&this._lastQuery&&this._lastQuery.equals(this._currentQuery))this._rootViewModel.onQueryChanged(this._currentQuery,i.getSequenceNumber());else this.clearFetchTimer(),this._completedDataSources={},(this._lastQuery||r)&&this.cancelPreviousQuery(!1),this.logQueryChange(r,!1),t<=0||this._currentQuery.isSearchHomeZI?this.fetchForQueryChange(r):this._fetchTimer=o(function(){u._fetchTimer=null;u.fetchForQueryChange(r)},t,"fetchTimer"),this._lastQuery=this._currentQuery},t.prototype.logQueryChange=function(t,r){var f=t?this._currentQuery:n.Host.getQuery(),u;f.equals(this._currentQuery)&&((this._lastQuery||t)&&this.finishPreviousQuery(r),this.finalizeKeystroke(!1),u=i.getSequenceNumber(),n.InstrumentationHelper.instrumentQueryChangedRequest(u,this._currentQuery))},t.prototype.onSubmit=function(t,r,u){this._fetchTimer&&(this._currentQuery||(this._currentQuery=n.Host.getQuery()),this.logQueryChange(!1,!0),this.fetchForQueryChange(!1));this._rootViewModel.submit(t,r,i.getSequenceNumber(),u,this._isPaneDismissed)},t.prototype.cancelPreviousQuery=function(n){this._cancellationManager&&this._cancellationManager.cancelAll(n)},t.prototype.fetchForQueryChange=function(t){var u=this,f,r,o,h;if(this.clearFetchTimer(),f=t?this._currentQuery:n.Host.getQuery(),f.equals(this._currentQuery)){if(r=i.getSequenceNumber(),o=!n.config.enabledDataSources.some(function(n){return p(n,u._currentQuery)}),o)this._rootViewModel.onQueryChanged(this._currentQuery,r);if(h=!1,this._suggestionsRenderingManager.initiateSequenceNumber(r,this._currentQuery,function(){return h=!0}),!o){var e=function(){return!u._isPaneDismissed&&(n.config.d>0?f.equals(u._currentQuery):r==i.getSequenceNumber())&&!h},c=(new Date).getTime(),l=function(n,t,i,o,s,h){return u.onResponseReceived(f,r,n,t,i,e,o,s,c,h)},a=function(t){n.InstrumentationHelper.instrumentFetchesBegin(r);n.config.enabledDataSources.forEach(function(t){n!==undefined&&n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().beginMark(t+".Fetch")});n.fetchWrapper(f,e,function(){u._webProviders.forEach(function(i){u.fetchWeb(f,i,r,t,e);n.config.enableFetchStartLogging&&n.InstrumentationHelper.instrumentFetchProviderBegin(r,i.getName().replace("DataProvider",""))});u._otherProviders.forEach(function(i){u.fetch(f,i,r,t,e);n.config.enableFetchStartLogging&&n.InstrumentationHelper.instrumentFetchProviderBegin(r,i.getName().replace("DataProvider",""))})});n.InstrumentationHelper.instrumentFetchesEnd(r);u._rootViewModel.onQueryChanged(u._currentQuery,r)};s(a,l)}}},t.prototype.fetchWeb=function(t,i,r,f,e){var c=this,s=n.Service.QueryParams,o=n.Host.getCustomUrlParameters(t),h;n.Host.shouldRequestEltoken()&&(o[s.RequestElToken]="1");o[s.CursorPosition]=t.cursorPosition.toString();o[s.ConversationId]=n.Host.getConversationId();o[s.ImpressionGuid]=n.InstrumentationHelper.getImpressionGuid(r);h=n.Host.getCustomHeaders(t);u(function(){return i.fetch(t,f,r,c._cancellationManager,e,o,h)},"fetch "+i.getName())},t.prototype.fetch=function(n,t,i,r,f){var e=this;u(function(){return t.fetch(n,r,i,e._cancellationManager,f)},"fetch "+t.getName())},t.prototype.onResponseReceived=function(t,i,r,u,f,e,o,h,c,l){var a=this,v,y;if(e()){if(this._completedDataSources[r]){n.config.forceUseNifQF&&r=="Web"||SharedLogHelper.LogError("onResponseReceived",r,new Error("Data source already completed"));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,h,l);v=function(r,u,o){if(n.InstrumentationHelper.instrumentDataSourceParsed(i,r),e())a.onSuggestionsParsed(t,i,r,f,u,o,l)};y=function(n){var f=a._suggestionsParsers[r];f?f.parse(t,i,r,u,e,n,a._cancellationManager):(SharedLogHelper.LogError("onResponseReceived",r,new Error("No parser for data source")),n(r,[],null))};s(y,v)}},t.prototype.onSuggestionsParsed=function(t,i,r,u,f,e,o){f=f.filter(function(n){return w(r,n.type,n.handoffType,t)});n.InstrumentationHelper.instrumentDataSource(i,r,f,e);this._rootViewModel.onSuggestionsParsed(t,i,r,u,f,e);this._suggestionsRenderingManager.queueSuggestions(i,r,f,e,o)},t}();n.Core=et;n.encodeQueryParameter=hr}(WSB||(WSB={})),function(n){function bt(t){return n.contains(vt,t)}function kt(t){return n.contains(yt,t)}function dt(t){return n.contains(nt,t)}function gt(t){return n.contains(pt,t)}function ni(t){return n.contains(wt,t)}function o(t){return{dataSource:"ODC",requirements:[1,2],conditionalRequirements:function(){var t=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();return n.isCloudSearchEnabledMsaCache&&(t==2||t==4)},suggestionIsEnabled:t?function(n){return n==t}:undefined}}function tt(){return n.isDataSourceEnabled("SSUE",null)}function it(t){var r=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType(),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 ti(t){var i=SearchAppWrapper.CortanaApp.authenticationManager.getAllSearchWebAccountsAsync,r=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();return i?!0:r==t}function ii(){return{dataSource:"ANA",groupType:t.SearchSuggestions,requirements:[1],conditionalRequirements:function(){return n.isAnaheimDataEnabled(!1)},suggestionIsEnabled:function(t){return t=="ANAH"||n.config.topHitMuse&&t=="ANATH"}}}function r(n,t,i,r){return s(n,undefined,t,i,r)}function s(t,i,r,u,f){return{dataSource:t,groupType:i,requirements:[1],conditionalRequirements:function(t){return(r==1?n.isCloudSearchEnabledAadCache:n.isCloudSearchEnabledMsaCache)&&(!f||f())&&(u||t&&t.queryToFetch&&t.queryToFetch.length>=n.config.minLengthFor3SonL1)&&ti(r)&&it(r)}}}function ri(){return n.config.use3sRecMeetingRelatedEntities&&(n.isMsftAccountConnected||n.config.cloudDocsZiWw)}function rt(){return n.isDocSourceEnabledInQws("SREE")}function l(t,i){return{dataSource:"MSBC",requirements:[1,2],conditionalRequirements:function(r){var u=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();return n.isCloudSearchEnabledAadCache&&(!i||typeof n.isMsbFileReady=="function"&&n.isMsbFileReady())&&(t||r&&r.queryToFetch&&r.queryToFetch.length>=n.config.msbClientQfMinQueryLength)&&(u==1||u==4||n.config.msbMockToken)&&typeof n.isTenantMsbEnabled=="function"&&n.isTenantMsbEnabled()}}}function v(t){return{dataSource:"MSBS",requirements:[1,2],conditionalRequirements:function(i){var r=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();return n.isCloudSearchEnabledAadCache&&(t||i&&i.queryToFetch&&i.queryToFetch.length>=n.config.msbServerQfMinQueryLength)&&(r==1||r==4)&&typeof n.isTenantMsbEnabled=="function"&&n.isTenantMsbEnabled()}}}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||!tt()?!1:!it(t)}function ui(){var t=n.isDocSourceEnabledInQws("SSUE"),i=(n.config.enableSsueOnZeroInput||n.config.msbEnableDocumentZQ)&&(n.isMsftAccountConnected||n.config.cloudDocsZiWw);return t||i&&!rt()}function y(){var t=n.AccessTokenManager===null||n.AccessTokenManager===void 0?void 0:n.AccessTokenManager.getWindowsAccountType();return t==2||t==4}function ut(t){return t.isSearchHomeZI&&(n.isDataSourceEnabled("SSUE",t)||n.isDataSourceEnabled("SREE",t))}function fi(t,i){return i.siteTitle&&(t.isSearchHomeZI||n.config.nicerCloudFiles&&(n.isMsftAccountConnected||n.config.cloudDocsZiWw))}function ei(){n.ScopeConfig[i.All].getEmptyZIMessages=function(){return f(i.All,"EmptyAllMessage",n.isBingEnabled()?"EmptyAllSubMessage":"EmptyAllSubMessageNoWeb",p(!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:function(t){return n.shouldShowZIDataSource(t)&&!(n.cohortProfileManager===null||n.cohortProfileManager===void 0?void 0:n.cohortProfileManager.isWWEVisibleSinglePane())&&!(typeof n.shouldHideTopApp=="function"&&n.shouldHideTopApp()&&n.isMsbEnterprise()&&!n.config.msbQwsDynamicDisableEnabled&&n.isQwsSuccessRateThresholdMet())}},{dataSource:"WWE",groupType:t.WelcomeExperience,conditionalRequirements:function(){if(n.cohortProfileManager!==null&&n.cohortProfileManager!==void 0)return n.cohortProfileManager.isWWEVisible()}},{dataSource:"DFLS",groupType:t.CuratedSuggestions,suggestionGroupToggler:c(t.CuratedSuggestions),conditionalRequirements:function(t){return n.shouldShowStaticSearchHome(t)||n.shouldShowDSBLayout(t)}},{dataSource:"CUSE",groupType:t.CuratedSettings,suggestionGroupToggler:c(t.CuratedSettings),conditionalRequirements:function(t){return n.shouldShowStaticSearchHome(t)&&n.config.undocked&&n.RuntimeConfig.AlwaysWide}},{dataSource:"QSCH",groupType:t.QuickSearch,suggestionGroupToggler:c(t.QuickSearch),conditionalRequirements:function(t){return n.canShowQuickSearch(e,t)}},{dataSource:"MSBC",groupType:t.QuickWorkSearch,conditionalRequirements:function(){return n.canShowQuickWorkSearch(e)}},{dataSource:"MSNN",groupType:t.MSNNews,suggestionGroupToggler:c(t.MSNNews),conditionalRequirements:function(){return n.config.msnNewsSearch&&n.shouldEnableMSNNewsSearches(n.getCurrentLanguage())&&n.canShowMSNNewsTab(e)}},{dataSource:"MRU",groupType:t.MRUHistory,conditionalRequirements:function(){return n.enableMRUSearchHome()}},{dataSource:"MPP",groupType:t.MRUHistory,conditionalRequirements:function(){return n.enableMRUSearchHome()}},{dataSource:"MST",groupType:t.MRUHistory,conditionalRequirements:function(){return n.enableMRUSearchHome()}},{dataSource:"MFF",suggestionIsEnabled:function(){return!0},groupType:t.MRUHistory,conditionalRequirements:function(){return n.enableMRUSearchHome()}},{dataSource:"MRS",groupType:t.MRUHistory,requirements:[1,2],conditionalRequirements:function(){return n.enableMRUSearchHome()},suggestionIsEnabled:function(n,t){return t==0}},{dataSource:"ANA",groupType:t.AnaheimDataList,requirements:[1],conditionalRequirements:function(){return n.isAnaheimDataEnabled(!0)},suggestionIsEnabled:function(n){return n=="QSSG"||n=="ANAT"||n=="ANAH"}},s("SSUE",t.RecommendedDocs,1,!0,function(){return ui()}),s("SREE",t.RecommendedDocs,1,!0,function(){return ri()||rt()}),{dataSource:"Web",groupType:t.SearchSuggestions,conditionalRequirements:function(){return n.config.forceUseNifSH}}],n.ScopeConfig[i.All].staticGroupOrderForZeroInput=n.shouldShowStaticSearchHome(n.Host.getQuery())?function(){return[t.MRUHistory,t.CuratedSuggestions,t.CuratedSettings,t.TopApps,t.QuickWorkSearchTopList,t.QuickWorkSearch,t.RecommendedDocs,t.QuickSearch,t.Upsell,t.PromoBanner,]}:n.shouldShowDSBLayout(n.Host.getQuery())?function(){return[t.MRUHistory,t.CuratedSuggestions,t.TopApps,t.QuickWorkSearchTopList,t.QuickWorkSearch,t.RecommendedDocs,t.Upsell,t.PromoBanner,]}:n.shouldEnableAnaheimResetDefault()?function(){return[t.Upsell,t.PromoBanner,t.TopApps,t.AnaheimDataTile,t.MRUHistory,t.AnaheimDataList,t.WelcomeExperience,t.MSNNews,t.QuickWorkSearchTopList,t.QuickWorkSearch,t.RecommendedDocs,t.QuickSearch,t.VisualSearch,]}:function(){return[t.TopApps,t.AnaheimDataTile,t.MRUHistory,t.AnaheimDataList,t.WelcomeExperience,t.MSNNews,t.QuickWorkSearchTopList,t.QuickWorkSearch,t.RecommendedDocs,t.QuickSearch,t.Upsell,t.PromoBanner,t.VisualSearch,]}):n.ScopeConfig[i.All].enabledDataSourcesForZeroInput=[]}function ft(){n.ScopeConfig={};n.ScopeConfig[i.All_FileExplorer]={icon:null,prefixesLocString:null,enabledDataSources:[{dataSource:"FEH"},{dataSource:"IFF"},{dataSource:"MDOC",conditionalRequirements:function(){return n.config.useL2ProvidersInFileExplorer}},{dataSource:"MPHO",conditionalRequirements:function(){return n.config.useL2ProvidersInFileExplorer}},{dataSource:"MVID",conditionalRequirements:function(){return n.config.useL2ProvidersInFileExplorer}},{dataSource:"ODC",requirements:[1,2],conditionalRequirements:function(){return n.config.cloudSearchInFileExplorer&&(n.isFileExplorerCurrentPathThisPcOrQuickAccess||!!SearchAppWrapper.CortanaApp.fileExplorerSuggestionPage.currentSyncRootAccount)}},{dataSource:"SSUE",requirements:[1,2],conditionalRequirements:function(){return n.config.cloudSearchInFileExplorer&&(n.isFileExplorerCurrentPathThisPcOrQuickAccess||!!SearchAppWrapper.CortanaApp.fileExplorerSuggestionPage.currentSyncRootAccount)}},{dataSource:"SSEE",requirements:[1,2],conditionalRequirements:function(){return 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"},],enabledDataSourcesForZeroInput:[],getEmptyZIMessages:null};n.ScopeConfig[i.All_ControlPanel]={icon:{content:"",type:2},prefixesLocString:"ScopeSettings",enabledDataSources:[{dataSource:"Web",suggestionIsEnabled:function(){return!1},requirements:[1,2]},{dataSource:"MRU",suggestionIsEnabled:function(){return!1}},{dataSource:"MST"},{dataSource:"ST"},{dataSource:"QS",requirements:[1,2]}],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:function(){return!1}},{dataSource:"MST"},],getEmptyZIMessages:null};n.ScopeConfig[i.All]={icon:{content:"",type:2,needsAccentColor:!0},prefixesLocString:"ScopeAll",enabledDataSources:[{dataSource:"PP"},{dataSource:"ST"},{dataSource:"FL",conditionalRequirements:function(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:function(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:function(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:"LDIC",conditionalRequirements:function(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:"CG"},{dataSource:"MRU"},{dataSource:"MPP"},{dataSource:"MST"},{dataSource:"MFF",conditionalRequirements:function(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",requirements:[1,2],conditionalRequirements:function(t){var i;return y()&&((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:"Web",requirements:[1,2],conditionalRequirements:function(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:function(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:function(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)}},ii(),r("SSUE",1,!1,function(){return!(typeof n.is3sFileDisabled=="function"&&n.is3sFileDisabled())}),l(!1),v(!1)],enabledDataSourcesForZeroInput:[],webSyntheticEnabled:function(t){return t.queryToFetch&&n.isBingEnabled()},getEmptyZIMessages:null,showUpsellOnSuggestionsList:n.config.accountVerificationInAllScope||n.config.msbAccountVerificationInSearchHome?function(){return a()}:undefined};n.ScopeConfig[i.Apps]={icon:{content:n.config.useCobaltCSS?"":"",type:2},prefixesLocString:"ScopeApps",enabledDataSources:[{dataSource:"Web",suggestionIsEnabled:function(){return!1},requirements:[1,2]},{dataSource:"MRU",suggestionIsEnabled:function(){return!1}},{dataSource:"MPP"},{dataSource:"PP",suggestionIsEnabled:function(n){return n=="PP"}},{dataSource:"OSTMA",requirements:[1,2]},{dataSource:"IBA"},],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:function(){return!1}},{dataSource:"TOPP",conditionalRequirements:function(n){return n.isSearchHomeZI}},{dataSource:"MPP"},n.contains(n.config.enabledDataSources,"LRA")?{dataSource:"LRA"}:{dataSource:"PP",suggestionIsEnabled:function(n){return n=="PP"}}],staticGroupOrderForZeroInput:function(n){return n.isSearchHomeZI?[t.TopApps,t.Apps]:undefined},getEmptyZIMessages:function(){return f(i.Apps,"EmptyScopeMessageNew","EmptyScopeSubMessageLong","EmptyScopeSearchLocation_PC")}};n.ScopeConfig[i.Settings]={icon:{content:"",type:2},prefixesLocString:"ScopeSettings",enabledDataSources:[{dataSource:"Web",suggestionIsEnabled:function(){return!1},requirements:[1,2]},{dataSource:"MRU",suggestionIsEnabled:function(){return!1}},{dataSource:"MST"},{dataSource:"ST"},{dataSource:"QS",requirements:[1,2]}],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:function(){return!1}},{dataSource:"MST"},],getEmptyZIMessages:function(){return u(i.Settings,!1)}};n.ScopeConfig[i.Photos]={icon:{content:"",type:2},prefixesLocString:"ScopePhotos",enabledDataSources:[{dataSource:"MRU",suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="LI"}},{dataSource:"MPHO",suggestionIsEnabled:function(n){return n=="LI"}},o("LI"),],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="LI"}},],getEmptyZIMessages:function(){return u(i.Photos,!0)}};n.ScopeConfig[i.Videos]={icon:{content:"",type:1},prefixesLocString:"ScopeVideos",enabledDataSources:[{dataSource:"MRU",suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="LV"}},{dataSource:"MVID",suggestionIsEnabled:function(n){return n=="LV"}},o("LV"),],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="LV"}},],getEmptyZIMessages:function(){return u(i.Videos,!0)}};n.ScopeConfig[i.Music]={icon:{content:n.config.useCobaltCSS?"":"",type:2},prefixesLocString:"ScopeMusic",enabledDataSources:[{dataSource:"MRU",suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="MU"}},{dataSource:"MMUS",suggestionIsEnabled:function(n){return n=="MU"}},o("MU"),],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="MU"}},],getEmptyZIMessages:function(){return u(i.Music,!1)}};n.ScopeConfig[i.Documents]={icon:{content:n.config.useCobaltCSS?"":"",type:2},prefixesLocString:"ScopeDocuments",enabledDataSources:[{dataSource:"MRU",suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="FL"}},{dataSource:"MDOC",suggestionIsEnabled:function(n){return n=="FL"}},{dataSource:"MPHO",suggestionIsEnabled:function(n){return n=="FL"},conditionalRequirements:function(n){return!n||!n.taskFrame}},{dataSource:"MVID",suggestionIsEnabled:function(n){return n=="FL"},conditionalRequirements:function(n){return!n||!n.taskFrame}},{dataSource:"MPVD",suggestionIsEnabled:function(n){return n=="FL"},conditionalRequirements:function(t){return n.config.mergeQueries&&(!t||!t.taskFrame)}},o("FL"),{dataSource:"PP",suggestionIsEnabled:function(n){return n=="LDOC"}},r("SSUE",1,!0,function(){return!(typeof n.is3sFileDisabled=="function"&&n.is3sFileDisabled())}),r("SSEE",1,!0,function(){return!(typeof n.is3sFileDisabled=="function"&&n.is3sFileDisabled())}),l(!0,!0)],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="FL"}},s("SSUE",t.RecommendedDocs,1,!0,function(){return(n.config.enableSsueOnZeroInput||n.config.msbEnableDocumentZQ)&&(n.config.cloudDocsOnZiL2||n.config.msbEnableDocumentZQ)&&(n.isMsftAccountConnected||n.config.cloudDocsZiWw)}),s("SREE",t.RecommendedDocs,1,!0,function(){return n.config.cloudDocsOnZiL2&&(n.isMsftAccountConnected||n.config.cloudDocsZiWw)}),],showUpsellOnSuggestionsList:function(){return a()},getEmptyZIMessages:function(){return f(i.Documents,"EmptyScopeMessageNew","EmptyScopeSubMessageLong",p(!1))}};n.ScopeConfig[i.Folders]={icon:{content:"",type:2},prefixesLocString:"ScopeFolders",enabledDataSources:[{dataSource:"MRU",suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="FD"}},{dataSource:"MFOL",suggestionIsEnabled:function(n){return n=="FD"}},{dataSource:"LDIC"},o("FD"),],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="FD"}},],getEmptyZIMessages:function(){return u(i.Folders,!1)}};n.ScopeConfig[i.Web]={icon:n.config.useCobaltCSS?{content:"",type:2}:{content:"",type:1},prefixesLocString:"ScopeWeb",enabledDataSources:[{dataSource:"MRU",suggestionIsEnabled:function(n,t){return t==1}},{dataSource:"Web",suggestionIsEnabled:function(t,i){return n.contains([0,13,14,10,5,1],i)},requirements:[1,2]},{dataSource:"PP",suggestionIsEnabled:function(n,t){return t==1}},{dataSource:"MSNN",suggestionIsEnabled:function(n,t){return t==1},requirements:[1,2],conditionalRequirements:function(n){return(n===null||n===void 0?void 0:n.fromSearchHome)&&(n===null||n===void 0?void 0:n.queryToFetch)=="Good news - MSN"}},{dataSource:"ANA",suggestionIsEnabled:function(n,t){return t==1&&(n=="ANAH"||n=="ANATH")},requirements:[1,2],conditionalRequirements:function(){return n.config.topHitMuse}},l(!0),v(!0)],enabledDataSourcesForZeroInput:[{dataSource:"MRU",suggestionIsEnabled:function(n,t){return t==1}},{dataSource:"Web",requirements:[1,2],conditionalRequirements:function(){return y()}},],webSyntheticEnabled:function(t){return t.queryToFetch&&n.isBingEnabled()},getEmptyZIMessages:function(){return f(i.Web,"EmptyWebMessage","EmptyWebSubMessage")}};n.ScopeConfig[i.PathCompletion]={icon:{content:"",type: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:function(){return a()},getEmptyZIMessages:function(){return u(i.Emails,!1)}};n.ScopeConfig[i.People]={icon:{content:"",type:2},prefixesLocString:"ScopePeople",enabledDataSources:[r("SSUE",1,!0,function(){return!(typeof n.isTenantMsbEnabled=="function"&&n.isTenantMsbEnabled())}),r("SSUC",2,!0),l(!0),v(!0)],enabledDataSourcesForZeroInput:[r("SSUE",1,!0,function(){return!(typeof n.isTenantMsbEnabled=="function"&&n.isTenantMsbEnabled())}),r("SSUC",2,!0),],showUpsellOnSuggestionsList:function(){return a()},getEmptyZIMessages:function(){return u(i.People,!1)}};n.ScopeConfig[i.Work]={icon:{content:"",type:2},prefixesLocString:"ScopeWork",enabledDataSources:[],enabledDataSourcesForZeroInput:[],getEmptyZIMessages:function(){return f(i.Work,"EmptyWorkMessage","EmptyWorkSubMessage")}};n.ScopeConfig[i.EdgeUrls]={icon:{content:"",type:2},prefixesLocString:null,prefixes:["Edge","url","lucky"],enabledDataSources:[{dataSource:"ANA",suggestionIsEnabled:function(n,t){return t==1&&(n=="ANAH"||n=="ANATH")},requirements:[1,2],conditionalRequirements:function(){return n.config.topHitMuse}}],enabledDataSourcesForZeroInput:[{dataSource:"ANA",suggestionIsEnabled:function(n,t){return t==1&&(n=="ANAH"||n=="ANATH")},requirements:[1,2],conditionalRequirements:function(){return n.config.topHitMuse}}],getEmptyZIMessages:function(){return u(i.EdgeUrls,!0)}};for(var e in n.ScopeConfig)n.ScopeConfig[e].enabledDataSources=n.ScopeConfig[e].enabledDataSources.filter(function(t){return n.contains(n.config.enabledDataSources,t.dataSource)}),n.ScopeConfig[e].enabledDataSourcesForZeroInput=n.ScopeConfig[e].enabledDataSourcesForZeroInput.filter(function(t){return n.contains(n.config.enabledDataSources,t.dataSource)})}function oi(){h=null}function p(t){var 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 u(n,t){return f(n,"EmptyScopeMessageNew","EmptyScopeSubMessageShort",p(t))}function f(t,i,r,u){var f=et(n.ScopeConfig[t]).toLocaleLowerCase(),e=u?n.Host.getLocString(u):"",o=n.Host.getLocString(i,f,e),s=n.Host.getLocString(r,f,e);return[o,s]}function si(){var u=function(n){return HitHighlightingParser.removeDiacritics(n.toLocaleLowerCase().trim())},t,r;if(h={},n.RuntimeConfig.ScopesAvailable){t=function(t){var f=parseInt(t),r=n.ScopeConfig[f],e,o;f!=i.All&&w(f,r)&&(!r.prefixes&&r.prefixesLocString&&(e=n.Host.getLocString(r.prefixesLocString),o=n.Host.getEnUsLocString(r.prefixesLocString),r.prefixes=ot(e,o)),r.prefixes&&r.prefixes.forEach(function(n){return h[u(n)]=f}))};for(r in n.ScopeConfig)t(r)}}function et(t){if(t.scopeNameLocString)return n.Host.getLocString(t.scopeNameLocString);if(t.prefixes)return t.prefixes[0].trim();if(t.prefixesLocString){var i=ot(n.Host.getLocString(t.prefixesLocString));return i[0].trim()}return""}function ot(n,t){var i=n;return t&&(i+=","+t),i.search(g)>-1&&(i=i.replace(g,",")),i.split(",")}function w(t,r){var u,o,f,e,s;if(!n.contains(n.config.enabledScopes,i[t])||t==i.Web&&!n.isBingEnabled())return!1;if(t===i.Work)return typeof n.isMsbWorkScopeApplicable=="function"&&n.isMsbWorkScopeApplicable();if(r.showUpsellOnSuggestionsList&&r.showUpsellOnSuggestionsList())return!0;for(u=n.config.enabledDataSources.filter(function(n){return n!="MRU"}),n.isBingEnabled()&&t!=i.Web&&(u=u.filter(function(n){return n!="Web"})),o=function(n){ct(n,null)||(u=u.filter(function(t){return t!=n.dataSource}))},f=0,e=r.enabledDataSources;f=0,s,u,f,e,o;if(h){t.enabledDataSources={};return}for(n.disableWebDataSourceIfNeeded(t,n.Host.getRegion(),n.Host.getLanguage()),s=t.queryToFetch?r.enabledDataSources:r.enabledDataSourcesForZeroInput,u=0,f=s;u0))){for(u=0,o=e;u0?t.From[0]:null,s&&s.Value)return s.Value;if(h=t.To&&t.To.length>0?t.To[0]:null,h&&h.Value)return h.Value}else{if(u=e,c=u.Title,c&&c.Value)return c.Value;if(r=u.Body,r&&r.Value)return r.Value;if(f=u.People,f&&f[0]&&f[0].Value)return f[0].Value;if(l=u.Place,l&&l.Value)return l.Value}return n.queryToFetch}function wi(n,t){if(t.scope==i.Emails)return n=="SSEC"||n=="SSEE";var u=t.parsed,r=u.FileSource?u.FileSource.Value:null;switch(n){case"MPVD":case"MDOC":case"MPHO":case"MVID":return r!="onedrive"&&r!="sharepoint";case"SSEE":return r!="thispc"&&r!="onedrive";default:return!1}}function bi(n){e=n}function c(t){var i=""+t,r=function(){var n=e.getItem(d)||"";return n.split(",")},u=function(n){var t=n.join(",");e.setItem(d,t)};return{isHidden:n.config.enableSearchHomeCustomization?function(){return n.safeExecute(function(){return r().some(function(n){return n==i})},"GroupToggler.isHidden")}:function(){return!1},toggle:function(t){n.safeExecute(function(){var n=r(),f;t&&n.every(function(n){return n!=i})?(n.push(i),u(n)):t||(f=n.findIndex(function(n){return n==i}),f>-1&&(n.splice(f,1),u(n)))},"GroupToggler.toggle")}}}var i,t,h,ht,b,lt,at,e,d;(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.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"})(i=n.Scope||(n.Scope={})),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.MSNNews=42]="MSNNews";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.GroupHeader=104]="GroupHeader"}(t=n.GroupType||(n.GroupType={}));var g=/،/g,vt=["PP","QP","IBA","TOPL"],yt=["ST","QS","SSTS"],nt=["LI","LV","MU"],pt=["FL","LDOC","FD","MFIL"].concat(nt),wt=[i.Documents,i.Folders,i.Photos,i.Videos,i.Music];n.isApp=bt;n.isSetting=kt;n.isMedia=dt;n.isFileOrFolder=gt;n.isFileOrFolderScope=ni;n.substrateProvidersEnabled=tt;n.searchHistoryAllowed=y;n.isRecommendedDocsGroupEnabled=ut;n.nicerCloudFilesEnabled=fi;n.setZeroInputDataSourcesForL1=ei;n.populateScopeConfig=ft;ft();n.cleanScopePrefixes=oi;n.initScopePrefixes=si;n.getScopeDisplayName=et;n.isScopeEnabled=w;n.getScopeConfig=st;ht=/^ht+ps?[;:]+|^www[.。]|^\/+/;b=/^[a-z]:\\|^%[^%]+%\\|^\\/i;n.parseQuery=hi;n.parseTaskFrame=vi;lt="action://FindMyStuff/FindDocument";at="action://FindMyStuff/FindMessage";n.getEffectiveScope=k;n.getEffectiveQuery=pi;d="HiddenSuggestionGroups";n.initQueryParser=bi}(WSB||(WSB={}));__assign=this&&this.__assign||function(){return __assign=Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i=0&&(t=t.substr(f+u.length))):t.startsWith("onedrive:\\")&&(t=t.substr(10)),t}function vt(t,i,u){var e,o,h,f,s;return i?(e=r(n.FOLDERID_Profile)+"\\onedrive - ",o=t.indexOf(e),o>=0&&(h=t.indexOf("\\",o+e.length),t=t.substr(h+1))):(f=n.AccessTokenManager.getWindowsIdentity(),f&&t.startsWith("onedrive for business:\\")&&u&&(s=f.indexOf("@"),s!=-1&&u.toLocaleLowerCase().indexOf("personal/"+f.substr(0,s))>0&&(t=t.substr(23)))),t}function yt(t,i,u){var e,o="",s,h,f,c;return u?(s=r(n.FOLDERID_Profile)+"\\"+n.SubstrateTenantName.toLocaleLowerCase()+"\\",h=i.indexOf(s),h>=0&&(f=h+s.length,c=i.indexOf(" - ",f),o=i.substr(f,c-f).toLocaleLowerCase(),i=i.substr(c+3))):i.startsWith("sharepoint:\\")&&(i=i.substr(12),o=(e=t.siteTitle)===null||e===void 0?void 0:e.toLocaleLowerCase()),[i,o]}function lr(i,r,u){var s,h,e,o,g,nt,tt,it,k,c,l,w,b;if((r.type=="TOPL"||r.type=="DFLS")&&i.isSearchHomeZI||cr(i,r))return t.NotDuplicate;if(hr(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)||(s=f(r),h=f(u),e=s?s.filePath:r.path,e&&(e=e.toLocaleLowerCase()),o=h?h.filePath:u.path,o&&(o=o.toLocaleLowerCase()),g=lt(r),nt=lt(u),g&&nt&&g.toLocaleLowerCase()==nt.toLocaleLowerCase()))return t.NoMetadata;if(tt=p(r),it=p(u),tt&&h||it&&s){var rt=e||o,a=tt||it,ut=a.encodedPath;return rt&&ut&&rt==ut.toLocaleLowerCase()?(k=s||h,!a.launchArguments||(k.launchArguments||"").toLocaleLowerCase()==a.launchArguments.toLocaleLowerCase()||!k.launchArguments&&a.launchArguments&&k.displayName.toLocaleLowerCase().startsWith(a.displayName.toLocaleLowerCase())?t.NoMetadata:t.NotDuplicate):t.NotDuplicate}if(r.deviceItem&&u.deviceItem){if(c=r.deviceItem.id||"",l=u.deviceItem.id||"",n.isSetting(r.type)&&n.isSetting(u.type)&&(c=r.deviceItem.displayName,l=u.deviceItem.displayName),c.toLocaleLowerCase()==l.toLocaleLowerCase())return e&&!s&&o&&!h?t.MergeMetadata:t.NoMetadata;if(s){if(n.isSetting(u.type)&&v[c]==l)return t.NoMetadata}else if(n.isSetting(r.type)&&(h&&v[l]==c||n.isSetting(u.type)&&(y[c]==l||y[l]==c)))return t.NoMetadata}if(ht(r,u)||ht(u,r))return t.NoMetadata;if(e&&o){if(e==o)return t.MergeMetadata;if(!s&&!h)if(r.handoffType==u.handoffType){if(r.handoffType==8&&r.url==u.url)return t.MergeMetadata}else{if(e=at(e,r.handoffType!=7),o=at(o,u.handoffType!=7),e==o)return t.MergeMetadata;var ft=r.type==="MFIL"||u.type==="MFIL",et=r.handoffType!=8&&r.handoffType!=17,ot=u.handoffType!=8&&u.handoffType!=17;if(e=vt(e,et,r.url),o=vt(o,ot,u.url),e==o)return ft?t.NoMetadata:t.MergeMetadata;if(n.SubstrateTenantName){var st=yt(r,e,et),pt=st[0],kt=st[1],wt=yt(u,o,ot),bt=wt[0],dt=wt[1];if(kt==dt&&(bt.endsWith(pt)||pt.endsWith(bt)))return ft?t.NoMetadata:t.MergeMetadata}}if(w=r.targetPathLC,b=u.targetPathLC,s&&u.type=="IBA"&&(e=d(e)),h&&r.type=="IBA"&&(o=d(o)),(w&&b&&w==b||w&&w==o||b&&e==b||e==o)&&(!s||!h||(s.launchArguments||"").toLocaleLowerCase()==(h.launchArguments||"").toLocaleLowerCase()))return t.NoMetadata}return ct(r,u)||ct(u,r)?t.NoMetadata:r.type==="PPL"&&u.type==="PPL"&&r.uniqueName&&u.uniqueName&&r.uniqueName.toLocaleLowerCase()===u.uniqueName.toLocaleLowerCase()?t.NoMetadata:r.type==="OLE"&&u.type==="OLE"&&r.internetMessageId===u.internetMessageId?t.NoMetadata:r.type==="BKS"&&u.type==="BKS"&&r.url&&u.url&&r.url===u.url?t.NoMetadata:t.NotDuplicate}function ar(n){switch(n){case"MFF":case"FL":case"LM":case"IFF":case"MPVD":case"MDOC":case"MPHO":case"MVID":case"MMUS":case"MFOL":return!0;default:return!1}}function vr(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":return!0;case"IFF":return gt(i)||!n.config.minLengthForIBAonL1||i.queryToFetch.length>=n.config.minLengthForIBAonL1;default:return!1}}function yr(t,i,r,u){var o,f,e;if(r!="Exchange"){var s,h=decodeURI(t.url),c=i.toLocaleLowerCase(),l=h.toLocaleLowerCase().indexOf(c);l!=-1?(o=h.substr(0,l-1),c.endsWith(".one")&&(o=o.substr(0,o.lastIndexOf("/"))),s=encodeURI(o)):s=t.url;f=h.split("/").slice(3);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:\\";c.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(" > "));s&&(t.locationUrl=s)}}function pr(n){return n.kind=="Modern Setting"}function f(t){return n.isApp(t.type)?t.deviceItem:null}function wr(n){return!!n.suggestions}function br(t){return n.config.useCobaltCSS&&(a(t)||u(t))}function kr(n){return n.deviceItem}function p(n){return n.type=="CG"?n.deviceItem:null}function dr(t){return n.isApp(t.type)||n.isSetting(t.type)||n.isFileOrFolder(t.type)&&!fi(t.type)}function w(t){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(b(t))return t.groupType;if(n.isSetting(t.type))return n.GroupType.Settings;switch(t.type){case"CG":return n.GroupType.Command;case"PT":return n.GroupType.PathCompletion;case"LI":return n.GroupType.Photos;case"LV":return n.GroupType.Videos;case"MU":return n.GroupType.Music;case"JL":case"FL":case"LDOC":case"SDFE":case"MFIL":return n.GroupType.Documents;case"FD":return n.GroupType.Folders;case"OLE":case"OWA":return n.GroupType.Emails;case"PPL":case"MPPL":case"MGRP":return n.GroupType.People;case"BKS":case"MBKS":case"MQNA":case"MBLD":return n.GroupType.Bookmarks;case"ELA":return n.GroupType.LocalPlaces;case"NEWS":return n.GroupType.MSNNews;case"ANAF":case"ANAH":case"ANAT":case"ANAR":return 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":return n.GroupType.QuickSearch;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:case 13:case 14:case 21:return n.GroupType.SearchSuggestions;case 1:return n.GroupType.Websites}throw new Error("Unexpected handoff type: "+t.handoffType);}}function gr(n){return!n.isAnswer&&(n.handoffType==0||n.handoffType==11||n.handoffType==21)&&n.type!="QSSG"}function pt(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 nu(t){var i=t.type;return pt(i)||i==n.GroupType.Related||i==n.GroupType.Contact||i==n.GroupType.RelatedMsbDocuments}function b(n){return!!n.isChild||!!n.parent}function tu(n){return n.type=="JL"}function wt(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.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}return n.Scope.All}function iu(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}}function ru(n,t,i){if(n&&n.type==0&&ti(t)){var u=function(t){n.ratio=t.height==t.width?1:t.height>t.width?3:2;i()},r=new Image;r.src=n.content;r.onload=function(){return u({height:r.height,width:r.width})}}else i()}function e(){var t=n.uiLanguageCache.toLocaleLowerCase();return bt[t]||t}function kt(n,t,i,r,u,f,e,o,s,h,c,l,a,v){var 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:function(){return null},template:0,mayContainPII:h,features:[],previewPaneType:undefined,reactKey:v};return y.previewPaneType=pu(n,y,a),y}function uu(n,t,i,r,u,f,e,o,s){n.subItems==null&&(n.subItems=[]);var 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 fu(t,i,r,u,f,e,o,s){var h=n.InstrumentationHelper.getInstrumentedSyntheticSuggestion(i,r),l,c;return h?h:(l=t.scope,h=kt(t,null,null,u,r,null,n.InstrumentedItem.getNonSuggestionInstrumentedItem(r,ot.KValues),f,i,!1,r),h.notAResult=!0,h.primaryMetadata=e,o&&(h.additionalInfoText=" - "+h.primaryMetadata),c=function(n){var t;h.query=n.queryToFetch;h.text=HitHighlightingParser.addMarkers(n.queryToFetch);h.narratorText=dt(h);h.click=function(){return s(h,n)};h.reactKey=r+n.queryToFetch+((t=h.primaryMetadata)!==null&&t!==void 0?t:"")},c(t),h.updateFromQuery=function(n){return!n.isProtocol&&n.scope==l&&n.queryToFetch?(c(n),!0):!1},h.getMruData=function(){return ft(h)},n.InstrumentationHelper.instrumentSyntheticSuggestion(i,h),h)}function dt(n,t){var i,r,u;return n.htmlContent?null:(i=[n.text],r=n.dateShort,r&&i.push(r),t?i.push(t):(n.primaryMetadata&&(i.push(n.primaryMetadata),u=n.department,u&&i.push(u)),n.template==1&&n.secondaryMetadata&&i.push(n.secondaryMetadata)),HitHighlightingParser.removeMarkers(i.join(", ")))}function gt(t){return t.scope!=n.Scope.All||!!t.taskFrame}function ni(t){return typeof t=="string"?t=="LI"||t=="LV":t==n.GroupType.Photos||t==n.GroupType.Videos}function ti(n){return ni(n)||ui(n)}function eu(t){return!n.config.disableMediaGridLayout&&!n.RuntimeConfig.AlwaysWide&&ni(t)}function ou(t,i){var f,u,e,r;if(!t||!n.RuntimeConfig.ScopesAvailable)return null;if(i.scope==n.Scope.All){if(f=[],t.ISUPN&&t.ISUPG)if(u=t.ISUPN.split("\t"),e=t.ISUPG.split("\t"),u.length==e.length)for(r=0;r=0?n[r]:wi(n[r],t,i));return f}function it(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-1&&(i.frSC=e.toString()),o=n.config.enableColdStartRanking||n.config.enableColdStartRanking1?n.Host.getCRCount():-1,o>-1&&(i.crC=o.toString()),s=n.config.enableColdStartRanking||n.config.enableColdStartRanking1?n.Host.getNCRCount():-1,s>-1&&(i.ncrC=s.toString()),h=n.config.enableColdStartRanking||n.config.enableColdStartRanking1?n.Host.getFCRCount():-1,h>-1&&(i.fcrC=h.toString()),this._windowsFlights&&(i.windowsFlights=this._windowsFlights),typeof n.getTenantMsbStatus=="function"&&(i.tenantMsbStatus=n.getTenantMsbStatus()),typeof n.getMsbClientQfState=="function"&&(i.msbClientQfState=n.getMsbClientQfState()),i},i.prototype.getSuggestionsPageName=function(){return"Page.SmartSearch.AS.Suggestions"},i.prototype.getApplicationName=function(){return"SmartSearch"},i.prototype.getRankerModelId=function(){return n.config.mainRankerId},i.prototype.createNonSuggestionDataSourceObject=function(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()}},i.prototype.createDataSourceObject=function(t,i){var f=this,e=t.mayContainPII&&!n.TestHookUrlParameters,o=(i||t.instItem).getKValue(),s=i&&typeof i.getHandoffType()=="number"?i.getHandoffType():t.handoffType,h=i?i.getQsCode():t.type,r={T:"D.Url",K:o,Q:e?undefined:t.query,MQ:t.ciMatchedQuery?t.ciMatchedQuery:undefined,Val:h,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,Uri:t.actionUri,Src:t.source,Sg:t.segments,NR:t.notAResult?1:undefined},u;return t.deviceItem?r.DeviceSignals=n.safeExecute(function(){return f.buildDeviceItemDataSource(e,t)},"buildDeviceItemDataSource"):n.isJumpListSuggestion(t)&&(r.DeviceSignals=n.safeExecute(function(){return f.buildJumpListItemDataSource(t)},"buildJumpListItemDataSource")),n.TestHookUrlParameters&&(u=t,u.path&&(r.path=u.path),u.targetPathLC&&(r.targetPath=u.targetPathLC)),r.RankerSignals=this.buildRankerOutputDataSource(t),r},i.prototype.buildRankerOutputDataSource=function(n){if(!n.rankingScore&&!n.featureStore)return undefined;return{rankingScore:n.rankingScore,featureStore:n.featureStore,mruSuppressionScore:n.mruSuppressionScore,fbcScore:n.fbcScore,previewPaneScore:n.previewPaneScore}},i.prototype.buildJumpListItemDataSource=function(t){var 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},i.prototype.getPathCompletionItem=function(n){return n.type=="PT"?n.deviceItem:null},i.prototype.buildDeviceItemDataSource=function(t,i){var f=i.deviceItem,r={Rank:f.rankScore},u,o,s,e;if(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;if(u=n.getAppItem(i),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;if(o=n.getItemWithFileMetadata(i),o){if(r.Ext=o.extension,n.TestHookUrlParameters&&(r.itemTypeDisplayName=o.itemTypeDisplayName),s=n.getCommandLineItem(i),s)return n.TestHookUrlParameters&&(r.launchArguments=s.launchArguments,r.encodedPath=s.encodedPath),r;this.getPathCompletionItem(i)||(e=i.deviceItem,r.CDT=n.isValidDate(e.createdDate)?e.createdDate.toJSON():undefined,r.LMD=n.isValidDate(e.lastModifiedDate)?e.lastModifiedDate.toJSON():undefined,r.Ext=e.extension?e.extension:"")}return r},i.prototype.logMasterPageImpression=function(t){n.safeExecute(function(){return ThresholdInst.LogPageImpression(t,null,t.enrichedClientInfo)},"logMasterImpressionForClient")},i.prototype.logDataSourceTimeout=function(i,r){var e,u,f,o;if(SearchAppWrapper.CortanaApp.queryFormulationView.logProviderFailure)for(e=function(t){n.isDataSourceEnabled(t,r)&&!n.contains(i,t)&&n.safeExecute(function(){return SearchAppWrapper.CortanaApp.queryFormulationView.logProviderFailure(n.providerFailureLogName(t),"NoReturnForTopHit")},"logProviderFailure")},u=0,f=t;u0&&r.safeInstrumentPerf(t,function(t){n.config.perfInstV2&&(t.DataProvidersStarted[i]=r.getOffsettedNow())},"instrumentFetchProviderBegin",null)},r.instrumentFetchesBegin=function(t){r.safeInstrumentPerf(t,function(t){t.DataSourcesFetchBegin=r.getOffsettedNow();n.config.perfInstV2&&(t.DataProviderFetchStart=r.getOffsettedNow())},"instrumentFetchesBegin",null)},r.instrumentFetchesEnd=function(n){r.safeInstrumentPerf(n,function(n){n.DataSourcesFetchEnd=r.getOffsettedNow()},"instrumentFetchesEnd",null)},r.instrumentDataSourceParsed=function(n,t){r.safeInstrumentPerf(n,function(n){var i=r.getOffsettedNow();typeof n.ResponseParsed[t]!="number"?n.ResponseParsed[t]=i:(n.MultipleResponsesParsed[t]||(n.MultipleResponsesParsed[t]=[n.ResponseParsed[t]]),n.MultipleResponsesParsed[t].push(i))},"instrumentDataSourceParsed",t)},r.instrumentItemClickForPreviewPane=function(n,t,i,u,f,e,o,s,h){if(t.getHandoffType()!=999){var c=r.createBaseCustomGPingPayload(f,e);r.addPreviewPaneDataToGPingPayload(c,o,s,h);r.instrumentItemClickAndGPing(c,n,t,i,u,f)}},r.instrumentItemClickForContextMenu=function(n,t,i,u,f,e,o){if(t.getHandoffType()!=999){var s=r.createBaseCustomGPingPayload(f,e);r.addContextMenuDataToGPingPayload(s,o);r.instrumentItemClickAndGPing(s,n,t,i,u,f)}},r.instrumentItemClick=function(n,t,i,u,f,e){var o=t.getHandoffType(),s;o!=999&&(o==998||o==997?r.instrumentLayoutItemSelect(t,i):(s=r.createBaseCustomGPingPayload(f,e),r.instrumentItemClickAndGPing(s,n,t,i,u,f)))},r.instrumentItemClickAndGPing=function(t,i,u,f,e,o){r.sendCustomGPing(t,u.getHValue(),i);var h=r._keystrokesInstrumentationData[f],s=r._keystrokesInstrumentationData[f];s?(h.RenderingStarted||r.updatePageIG(f),_G.IG!=s.ImpressionGuid&&SharedLogHelper.LogError("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)")),r._clientTelemetry&&r._clientTelemetry.logItemClickedMeasure(s.ConversationId,s.RawImpressionGuid,u,o)):SharedLogHelper.LogError("instrumentItemClick","sequenceNumber: "+f+" ConversationID: "+n.Host.getConversationId(),new Error("No instrumentation data found for sequenceNumber"));r.finalizeKeystrokeLog(f,1);e&&e();r._instrumentationProvider.onItemClick();n.config.forceLogFlush?Log2.ForceFlush():Log2.FlushMainQueueDontForce();_w.clickFlushedTime=sb_gt()},r.instrumentLayoutItemSelect=function(n,t){var i={AppNS:n.getAppNS(),K:n.getLayoutKValue()};r.logClientInstEvent("Select","ItemClicked",t,i)},r.instrumentPerfEvent=function(t,i,u){n.config.logClientPerf&&r.safeInstrumentPerf(t,function(n){r._instrumentationProvider.logProfilerMarker(1,0,i,n.RawImpressionGuid,{d:u})},"instrumentPerfEvent")},r.instrumentAggregateFunctionPerf=function(t,i){n.config.logClientPerf&&r._clientTelemetry.logAggregateFunctionPerf(t,i)},r.instrumentDeviceQueryBegin=function(n){r._instrumentationProvider.logProfilerMarker(1,0,"StartDeviceQuery",n,{})},r.createBaseCustomGPingPayload=function(n,t){var i={};switch(n){case 1:i.i="k";i.mk=r.getModifierKeyCodes(t);break;case 3:i.i="t";break;case 4:i.i="p";break;case 5:i.i="n";break;case 6:i.i="b";break;case 0:i.i="x";i.mk=r.getModifierKeyCodes(t);break;default:i.mk=r.getModifierKeyCodes(t)}return i},r.addContextMenuDataToGPingPayload=function(n,t){n.cm=t},r.addPreviewPaneDataToGPingPayload=function(n,t,i,r){t&&(n.pp=t,i&&(n.ppit=i),typeof r=="number"&&(n.rho=r))},r.sendCustomGPing=function(t,i,r){var u=i;n.isEmpty(t)||(u+="&PR="+JSON.stringify(t));n.safeExecute(function(){return _w.si_T(u,null,null,0,r)},"logCustomGPing")},r.getModifierKeyCodes=function(n){if(n){var t=n.altKey?"A":"";if(t+=n.ctrlKey?"C":"",t+=n.shiftKey?"S":"",t)return t}return undefined},r.notifyTopHitPreviewPaneOpenedOrInterrupted=function(t,i){var u=r._keystrokesPerfPingData[t];u&&u.PreviewPanePendingInfo!=null&&(u.PreviewPanePendingInfo.latency=r.getOffsettedNow(),i?u.PreviewPaneOpened=u.PreviewPanePendingInfo:u.PreviewPaneCanceled=u.PreviewPanePendingInfo,u.PreviewPanePendingInfo=null,r.tryInstrumentRenderStopped(t,u));n.config.perfInstV2&&i&&r.safeInstrumentPerf(t,function(n){n.PreviewPaneFinish=r.getOffsettedNow()},"instrumentFetchesEnd",null)},r.previewPaneOpenedOrClosed=function(n,t,i,u,f,e){var s=n?"Select":"Unselect",h=n?"PreviewPaneOpened":"PreviewPaneClosed",o;r.logClientInstEvent(s,h,t,e);n&&r._keystrokesPerfPingData[t]&&r.notifyTopHitPreviewPaneOpenedOrInterrupted(t,!0);n&&r._clientTelemetry&&(o=r._keystrokesInstrumentationData[t],o&&r._clientTelemetry.logPreviewPaneOpenedMeasure(i,u,f))},r.logClientInstEvent=function(n,t,i,u){var e=null,f;i&&(f=r._keystrokesInstrumentationData[i],f&&(e=f.ImpressionGuid));Log2.LogEvent(n,u,t,null,null,e,null,null)},r.safeInstrument=function(n,t,i,u){var f=r._keystrokesInstrumentationData[n];f?t(f):SharedLogHelper.LogError(i,(u?u+" ":"")+" sequenceNumber: "+n,new Error("No instrumentation data found for sequenceNumber"))},r.safeInstrumentPerf=function(t,i,u,f){var e=r._keystrokesPerfPingData[t];e?n.safeExecute(function(){return i(e)},u):SharedLogHelper.LogError(u,(f?f+" ":"")+" sequenceNumber: "+t,new Error("No instrumentation data found for sequenceNumber"))},r.instrumentRenderingStarted=function(n){r.safeInstrument(n,function(t){t.RenderingStarted=!0;r.updatePageIG(n)},"instrumentRenderingStarted")},r.instrumentQueryChangedRequest=function(t,i){var e;delete r._keystrokesInstrumentationData[t-1];n.InstrumentedItem.resetKValues(t);e=r._keystrokesPerfPingData[t];e&&SharedLogHelper.LogError("instrumentQueryChangedRequest","sequenceNumber: "+t,new Error("Duplicate BeginRequest for sequenceNumber"));var f=n.Host.getConversationId(),u=n.Host.getRawImpressionGuid(),o=n.cleanGuid(u),s=n.getCurrentTime(),c={RawImpressionGuid:u,ImpressionGuid:o,ConversationId:f,Query:i,PendingDataSources:{},DataSources:{},RankerExtraInfo:{},DuplicateDS:{},Layout:[],MasterPageImpressionCreated:!1,RenderingStarted:!1,PendingInstrumentedItems:{},PendingSyntheticSuggestions:{},OriginalTimestamp:s},h={RawImpressionGuid:u,ImpressionGuid:o,ConversationId:f,PrefixLength:i.queryToFetch?i.queryToFetch.length:0,SearchHomeRenderEvent:n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,ClientShownEvent:r.getOffsettedNow(r._clientShownTimestamp),RequestBegin:r.getOffsettedNow(s),ResponseReceived:{},MultipleResponsesReceived:{},DataSourcesState:r._searchServiceStatus?{Indexer:r._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?r._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:{}};r._keystrokesInstrumentationData[t]=c;r._keystrokesPerfPingData[t]=h;r._currentRender=0;n.config.perfInstV2&&r._keyDownTimeStamp!=n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE&&(r.safeInstrumentPerf(t,function(n){n.SequenceStart=r._keyDownTimeStamp-r._conversationStartTimestamp},"instrumentKeyDown",null),r._keyDownTimeStamp=n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE);r._clientTelemetry&&r._clientTelemetry.logNewKeystrokeMeasure(f,u,i);r.updatePageIG(t);r.fireKeystrokeTimelineUpdatedHandlers(h);(n.config.enableFuzzyRanking||n.config.enableFuzzyRanking1)&&n.Host.setFRSuggCount(-1);(n.config.enableColdStartRanking||n.config.enableColdStartRanking1)&&(n.Host.setCRCount(-1),n.Host.setNCRCount(-1),n.Host.setFCRCount(-1))},r.setSearchServiceStatus=function(n){r._searchServiceStatus=n},r.instrumentResponseReceived=function(t,i,u,f,e,o){r.safeInstrumentPerf(t,function(t){if(!e){var o=r.getOffsettedNow();typeof t.ResponseReceived[i]!="number"?(t.ResponseReceived[i]=o,n.config.useWhereId&&i=="IFF"):(t.MultipleResponsesReceived[i]||(t.MultipleResponsesReceived[i]=[t.ResponseReceived[i]]),t.MultipleResponsesReceived[i].push(o))}u&&(t.DataSourcesState=t.DataSourcesState||{},t.DataSourcesState[i]=u);f&&(t.ResponseFromCache[i]=f)},"instrumentResponseReceived",i);n.config.perfInstV2&&r.safeInstrumentPerf(t,function(n){o||(n.DataProvidersFinished[i]=r.getOffsettedNow(),n.DataProviderFetchFinish0)for(o=0;o0&&(t.DataSources.duplicates={T:"D.Duplicates",Service:n.InstrumentationCommon.DEFAULT_SERVICE_NAME,Scenario:"Duplicates",AppNS:n.InstrumentationCommon.DEFAULT_APP_NAMESPACE,DS:i})},r.instrumentDuplicate=function(t,i,u){r.safeInstrument(t,function(t){var r=t.DuplicateDS[i.instItem.getHValue()],f;r||(r={T:"D.Duplicate",DS:[{T:"D.DSRef",KRef:i.instItem.getKValue()}]},i.instItem.getAppNS()!=n.InstrumentationCommon.DEFAULT_APP_NAMESPACE&&(r.DS[0].AppNS=i.instItem.getAppNS()),t.DuplicateDS[i.instItem.getHValue()]=r);f={T:"D.DSRef",KRef:u.instItem.getKValue()};u.instItem.getAppNS()!=n.InstrumentationCommon.DEFAULT_APP_NAMESPACE&&(f.AppNS=u.instItem.getAppNS());r.DS.push(f)},"instrumentDuplicate")},r.renderingStopped=function(n){return n.PendingIcons==0&&n.AllDataSourcesProcessed&&n.PreviewPanePendingInfo==null},r.notifyAllDataSourcesProcessed=function(n){r.safeInstrumentPerf(n,function(t){t.AllDataSourcesProcessed=!0;r.tryInstrumentRenderStopped(n,t)},"notifyAllDataSourcesProcessed")},r.notifyIconPending=function(n,t){r.safeInstrumentPerf(n,function(n){n.PendingIcons++},"notifyIconPending",t?"TR":"SUG")},r.notifyIconReadyOrFailed=function(n,t){r.safeInstrumentPerf(n,function(n){n.PendingIcons--},"notifyIconReadyOrFailed",t?"TR":"SUG")},r.notifyPreviewPaneStartRender=function(t){n.config.perfInstV2&&r.safeInstrumentPerf(t,function(n){n.PreviewPaneStart=r.getOffsettedNow()},"previewPaneStart")},r.notifyPreviewPanePending=function(n,t,i){var u=r._keystrokesPerfPingData[n];u&&(u.PreviewPanePendingInfo={previewPaneType:t,suggestionType:i})},r.tryInstrumentRenderStopped=function(t,i){r.renderingStopped(i)&&(r.finalizeKeystrokeLog(t,2),r._instrumentationProvider.logProfilerMarker(1,0,"RenderStopped",r.getRawImpressionGuid(t),{}),r.logMemoryUsageInWSBClient(t,"RenderStoppedMemoryUsage"),n.TestHookUrlParameters&&n.safeFireEvent("RenderStopped"))},r.logMemoryUsageInWSBClient=function(t,i){var u,f,e;SearchAppWrapper.CortanaApp.systemInfo&&(f=SearchAppWrapper.CortanaApp.systemInfo,e="TotalCommitMB:"+f.totalCommitMB+",TotalWorkingSetMB:"+f.totalWorkingSetMB+",SnrVersion:"+n.config.snrVersion+",MsbVersion:"+(typeof BingAtWork=="undefined"?"":(u=BingAtWork.context)===null||u===void 0?void 0:u.midgardVersion),r._instrumentationProvider.logProfilerMarker(1,0,i,r.getRawImpressionGuid(t),e))},r.isLayoutLogged=function(n){return r._keystrokesInstrumentationData[n].MasterPageImpressionCreated},r.finalizeKeystrokeLog=function(t,i){var f,u;(i===void 0&&(i=0),n.config.perfPingAtEndOnly&&i==2)||(r._finalizeKeystrokeHandlers.forEach(function(n){return n(i==0)}),f=r._keystrokesInstrumentationData[t],f&&r.logKeystrokeData(f,t),i!=1&&(u=r._keystrokesPerfPingData[t],u&&(r.logPerfPingEvent(r.createKeystrokePerfPingEvent(t,u)),r._clientTelemetry&&r._clientTelemetry.logDataSourcePerformancesMeasure(u),r.fireKeystrokeTimelineUpdatedHandlers(u))))},r.instrumentZiRendered=function(t,i){i&&(r._instrumentationProvider.logProfilerMarker(1,0,"ZiRendered",r.getRawImpressionGuid(t),{}),r.logMemoryUsageInWSBClient(t,"ZiRenderedMemoryUsage"));n!==undefined&&n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("RenderZeroInput");r.safeInstrumentPerf(t,function(n){n.SearchHomeRenderEvent=r.getOffsettedNow()},"instrumentSearchHomeRender",null)},r.instrumentRenderFinished=function(t,i,u,f,e){var o,s,h;if(n.config.perfInstV2&&(r===null||r===void 0?void 0:r._currentRender)<0)SharedLogHelper.LogError("instrumentRenderFinished","sequenceNumber: "+t,new Error("Invalid current render for sequence number"));else if(n.config.perfInstV2&&r._keystrokesPerfPingData[t]==undefined)SharedLogHelper.LogError("instrumentRenderFinished","sequenceNumber: "+t+" currentRender: "+r._currentRender,new Error("No keystrokesPerfPingData for sequence number"));else if(e||r._keystrokesPerfPingData[t].FirstRenderTime||(r._keystrokesPerfPingData[t].FirstRenderTime=r.getOffsettedNow()),n.config.perfInstV2){if(r._keystrokesPerfPingData[t].RendersCompleted[r._currentRender]=r.getOffsettedNow(),n.Host.getFCRCount()>-1&&(n.config.enableColdStartRanking||n.config.enableColdStartRanking1)&&(r._keystrokesPerfPingData[t].RendersColdRank[r._currentRender]=n.Host.getFCRCount()),n.isAnaheimDataEnabled(!0)||n.isAnaheimDataEnabled(!1)){if(n.AnaheimDataProvider===null||n.AnaheimDataProvider===void 0?void 0:n.AnaheimDataProvider.getANANumberMap){o=n.AnaheimDataProvider.getANANumberMap();for(s in o)r._keystrokesPerfPingData[t].AnaheimDataIndexCount[s]=o[s]}if(n.AnaheimDataParser===null||n.AnaheimDataParser===void 0?void 0:n.AnaheimDataParser.getANANumberMap){o=n.AnaheimDataParser.getANANumberMap();for(s in o)r._keystrokesPerfPingData[t].AnaheimDataIndexCount[s]=o[s]}}r._currentRender++}r.safeInstrumentPerf(t,function(n){var e=r.getOffsettedNow(),o="S"+i.join(",");n.renderGroupFinished[o]?f||(n.renderGroupFinished[o].iconsFinished=e):(i.forEach(function(t){return n.RenderFinished[t]=e}),n.renderGroupFinished[o]={iconsFinished:e,suggestionsFinished:e});r.tryInstrumentRenderStopped(t,n);r._clientTelemetry&&r._clientTelemetry.logGroupsRenderedMeasure(u)},"instrumentRenderFinished",i.join(","));h=r._keystrokesPerfPingData[t];h&&r.fireKeystrokeTimelineUpdatedHandlers(h)},r.instrumentSyntheticInstrumentedItem=function(n,t,i){var u=r._keystrokesInstrumentationData[n];u?u.PendingInstrumentedItems[t]=i:SharedLogHelper.LogError("instrumentSyntheticInstrumentedItem",t,new Error("keystrokesInstrumentationData not found"))},r.instrumentSyntheticSuggestion=function(n,t){var i=r._keystrokesInstrumentationData[n];i?i.PendingSyntheticSuggestions[t.type]=t:SharedLogHelper.LogError("instrumentSyntheticSuggestion",t.type,new Error("Instrumentation synthetic suggestion after flush"))},r.getInstrumentedSyntheticSuggestion=function(n,t){return r._keystrokesInstrumentationData[n].PendingSyntheticSuggestions[t]},r.instrumentDataSource=function(n,t,i,u){r.safeInstrument(n,function(n){var r,f,e;if(u&&u.rankerExtraInfo)for(r in u.rankerExtraInfo)n.RankerExtraInfo[r]=u.rankerExtraInfo[r];f=i||[];e=n.PendingDataSources[t];n.PendingDataSources[t]=e?e.concat(f):f},"instrumentDataSource",t)},r.processPendingDataSources=function(t){var i,s,u,f,h,e,o,c,l;for(i in t.PendingDataSources)if(s=t.PendingDataSources[i],s.length>0){for(u=[],f=0,h=s;f0&&(t.DataSources[i]={T:"D."+i,AppNS:n.InstrumentationCommon.DEFAULT_APP_NAMESPACE,Service:n.InstrumentationCommon.DEFAULT_SERVICE_NAME,Scenario:i,SC:u.length,DS:u})}t.PendingDataSources={}},r.instrumentSnRProviderFetchUrl=function(n,t){r.safeInstrument(n,function(n){n.SnRProviderFetchUrl=t},"instrumentSnRProviderFetchUrl")},r.onConversationStart=function(){if(r._conversationStartTimestamp=n.getCurrentTime(),r._searchServiceStatus=null,r._clientTelemetry){var t=n.Host.getConversationId();r._clientTelemetry.logConversationStartMeasure(t)}r._keystrokesPerfPingData=[];r._currentRender=0},r.getConversationStartTimestamp=function(){return r._conversationStartTimestamp},r.logDataSourceTimeout=function(n,t){r._instrumentationProvider.logDataSourceTimeout(n,t)},r.getPpoFromPpi=function(n){return typeof n.latency=="number"?{L:n.latency,T:n.previewPaneType}:{}},r.createKeystrokePerfPingEvent=function(t,i){var u={I:t,PL:i.PrefixLength,K:i.RequestBegin,F:i.DataSourcesFetchEnd,PPO:r.getPpoFromPpi(i.PreviewPaneOpened),PPC:r.getPpoFromPpi(i.PreviewPaneCanceled),RRT:i.ResponseReceived,RPT:i.ResponseParsed,MRT:i.MultipleResponsesReceived,RFT:i.RenderFinished,TRR:i.TopResultRendered,RS:undefined,PLT:undefined,HLT:undefined,FRT:undefined,IRFT:{},TRIR:[],MPT:i.MultipleResponsesParsed,CS:n.config.perfInstV2?i.ConversationStart:undefined,KS:n.config.perfInstV2?i.SequenceStart:undefined,RB:n.config.perfInstV2?i.RequestBegin:undefined,FS:n.config.perfInstV2?i.DataProviderFetchStart:undefined,FF:n.config.perfInstV2?i.DataProviderFetchFinish:undefined,PST:n.config.perfInstV2&&n.config.enableFetchStartLogging?i.DataProvidersStarted:undefined,PFT:n.config.perfInstV2?i.DataProvidersFinished:undefined,RC:n.config.perfInstV2?i.RendersCompleted:undefined,RCR:n.config.perfInstV2&&(n.config.enableColdStartRanking||n.config.enableColdStartRanking1)?i.RendersColdRank:undefined,PS:n.config.perfInstV2?i.PreviewPaneStart:undefined,PF:n.config.perfInstV2?i.PreviewPaneFinish:undefined,ANA:n.config.perfInstV2&&(n.config.enableAnaheimDataSH||n.config.enableAnaheimDataQF)?i.AnaheimDataIndexCount:undefined},o,h,v,s,c,l,f,e,a;for(e in i.renderGroupFinished)if(o=i.renderGroupFinished[e],o.iconsFinished!=o.suggestionsFinished)if(h=e.substr(1),e.startsWith("T"))u.TRIR.push({T:h,V:o.iconsFinished});else for(v=h.split(","),s=0,c=v;s0&&(u.enrichedClientInfo.FvSug=i.FvSug),i.HuSug&&Object.keys(i.HuSug).length>0&&(u.enrichedClientInfo.HuSug=i.HuSug),u.clientTimestamp=i.OriginalTimestamp,r.logMasterPageImpression(i.ImpressionGuid,u),i.MasterPageImpressionCreated=!0))},r.logPerfPingEvent=function(t){Log2.LogEvent(t.EventType,t.Data,n.InstrumentationCommon.QFPERFPING_EVENT_NAME,null,null,t.ImpressionGuid,null,null);n.ClientTestHooks&&n.ClientTestHooks.DebugLogNoConsole("perfPingEvent",[t])},r.logMasterPageImpression=function(t,i){if(i){if(!t){SharedLogHelper.LogError("logMasterPageImpression",null,new Error("Missing impressionGuid"));return}i.impressionGuid=t;r._instrumentationProvider.logMasterPageImpression(i,n.Host.getConversationId());n.ClientTestHooks&&n.ClientTestHooks.DebugLogNoConsole("masterPageImpression",i,t)}},r.instrumentAppVisibleFinish=function(t){var i=n.getCurrentTime();r._conversationTimeline.AppVisibleStart=t;r._conversationTimeline.AppVisibleFinish=i},r.instrumentAppShownFinish=function(t){var i=n.getCurrentTime();r._conversationTimeline.AppShownStart=t;r._conversationTimeline.AppShownFinish=i},r.instrumentConversationTimelineFinish=function(){var t=_G.ServerIG,i,u;if(!t){SharedLogHelper.LogError("instrumentConversationTimelineFinish","Could not instrument as server IG not known",new Error("Could not instrument initilization finish"));return}r._conversationTimeline.RawImpressionGuid=n.Host.getRawImpressionGuid();r._conversationTimeline.ImpressionGuid=n.cleanGuid(r._conversationTimeline.RawImpressionGuid);r._conversationTimeline.ConversationId=n.Host.getConversationId();i={CID:r._conversationTimeline.ConversationId,ASB:r._conversationTimeline.AppShownStart,ASF:r._conversationTimeline.AppShownFinish,AVB:r._conversationTimeline.AppVisibleStart,AVF:r._conversationTimeline.AppVisibleFinish};u=n.InstrumentationCommon.createPerfPingEvent(t,[i],"ConversationTimeline",r._conversationTimeline.ConversationId);r.logPerfPingEvent(u)},r.instrumentInitializationFinish=function(t){var f=_G.ServerIG,i,u;if(!f){SharedLogHelper.LogError("instrumentInitializationFinish","Could not instrument as server IG not known",new Error("Could not instrument initilization finish"));return}if(i=n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,u=_w.performance,u&&u.timing&&(i=u.timing.navigationStart),!(i<=0)){var e=t.getTime()-i,o=n.getCurrentTime()-i,s=[{BLT:e,ILT:o}],h=n.InstrumentationCommon.createPerfPingEvent(f,s,"Load");r.logPerfPingEvent(h)}},r.getOffsettedNow=function(t){return t===void 0&&(t=n.getCurrentTime()),t-r._conversationStartTimestamp},r.createNonSuggestionsDataSource=function(t,i){var u=[],f,e;for(f in t)u.push(r._instrumentationProvider.createNonSuggestionDataSourceObject(f,t[f]));for(f in i)u.push(r._instrumentationProvider.createDataSourceObject(i[f]));return u.length?(e={T:"D.ContentGroup",AppNS:n.InstrumentationCommon.DEFAULT_APP_NAMESPACE,Service:n.InstrumentationCommon.DEFAULT_SERVICE_NAME,Scenario:"NonSuggestions",SC:u.length,DS:u},[e]):[]},r.createVirtualImpressionURL=function(t,i){var 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},r._clientShownTimestamp=n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,r._conversationStartTimestamp=n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,r._currentRender=0,r._keyDownTimeStamp=n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,r._keystrokesPerfPingData={},r._keystrokesInstrumentationData={},r._keystrokeTimelineUpdatedHandlers=[],r._finalizeKeystrokeHandlers=[],r}();n.InstrumentationHelper=r}(WSB||(WSB={})),function(n){var t="&nclid=",i="&ts=",r="&nclidts=",u="&tsms=",f="&elv=",e="&cc=",o="&setlang=",s="&cvid=",h="&qs=",c="&ao=",l="&wsso=",a=function(){function a(t,i){if(t===void 0&&(t=Date.now),i===void 0&&(i=n.getWindowProtocol()+"//"+n.getWindowHost()),this.getNowTimestamp=t,this._baseUrl=i,n.config.overrideHost){var r=n.getWindowHost();r.startsWith("www.")&&(this._baseUrl=n.getWindowProtocol()+"//"+n.config.overrideHost+r.substring(3))}}return a.prototype.getSearchUrl=function(t,i,r,u,e,o,s,h,a,v){var p,y,w,b,k;return u||(r==="MBV"&&e===21?(u="/work/search?q="+n.encodeQueryParameter(i),v&&(u+="&inithash="+v),o=n.mapOSFormCode("WSBWS0")):(p=this.getVerticalFromHandoffType(e),u=(p?"/"+p:"")+"/search?q="+n.encodeQueryParameter(i))),y=this._baseUrl+u,y+=(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.isWindowsTest)?"&form=MONITR&traffictype=wintest":"&form="+n.encodeQueryParameter(o||n.Host.getFormCode()),a&&(y+=c+"1"),y=this.enrichUrlWithSuggestionType(y,h?"P":r),y=this.enrichUrlWithCvid(y),n.config.suppressPqParameter||(y+="&pq="+n.encodeQueryParameter(t)),w=n.Host.getMSNRefIg(),w&&(y+="&refig="+w),y=this.enrichUrlWithMarketInfo(y),y=this.enrichUrlWithDeviceInfo(y),s||(y=this.enrichUrlWithMuidInfo(y),b=n.Host.getElToken(),b&&this._baseUrl.startsWith("https:")&&(y+=f+n.encodeQueryParameter(b)),y=this.enrichUrlWithSafeSearchInfo(y)),k=n.Host.getSafeSearchSetting(),k&&(y+=l+k),y},a.prototype.getImageSearchUrl=function(){var 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},a.prototype.getVerticalFromHandoffType=function(n){return n===13?"images":n===14?"videos":n===15?"shop":""},a.prototype.enrichUrlWithDeviceInfo=function(t){n.Host.isEducationEnvironment()&&(t+="&DAF0=1");n.Host.isWindowsS()&&(t+="&DAF1=1");var i=n.Host.getPartnerSearchCode();return i&&(t+="&PC="+i),t},a.prototype.enrichUrlWithMarketInfo=function(t){var i=n.Host.getRegion(),r=n.Host.getLanguage();return i&&(t+=e+i),r&&(t+=o+r),t},a.prototype.enrichUrlWithSafeSearchInfo=function(t){return n.Host.getSafeSearchSetting()=="Strict"?t+"&adlt=strict":t},a.prototype.enrichUrlWithMuidInfo=function(f){var e,o,s;return _G.nclid&&(f+=t+n.encodeQueryParameter(_G.nclid),e=this.getNowTimestamp().toString(),f+=i+n.encodeQueryParameter(e),o=e.substring(0,e.length-3),f+=r+n.encodeQueryParameter(o),s=e.substring(e.length-3),f+=u+n.encodeQueryParameter(s)),f},a.prototype.enrichUrlWithCvid=function(t){return t+(s+n.encodeQueryParameter(n.Host.getConversationId()))},a.prototype.enrichUrlWithSuggestionType=function(t,i){return t+(h+n.encodeQueryParameter(i))},a}();n.NavigationHelper=a}(WSB||(WSB={})),function(n){var t=function(){function t(t){var i=this;this._selectableItemsContainer=t;n.Host.bindKeyDown(function(r,u,f){var e=!1;r==9?e=i.selectFirstItemInNextGroup(u&&u.shiftKey):n.isUpOrDownKey(r)&&(e=i.selectNextItem(n.isUpKey(r)));t.onAfterKeyDown(r,u,f,e)})}return t.prototype.selectFirstItemInNextGroup=function(t){var i=this._selectableItemsContainer.getSelectableItemsByGroup(),u;if(i.length==0)return!1;var f=this._selectableItemsContainer.getSelectedItem(),r=i.findIndex(function(t){return n.contains(t,f)}),e=r<0?-1:i[r].findIndex(function(n){return n==f});return(f&&f.onUnselected&&f.onUnselected(),r<0?u=i[0][0]:t&&e>0?u=i[r][0]:t?r>0&&(u=i[r-1][0]):r+1=t){SharedLogHelper.LogError("initiateSequenceNumber",null,new Error("Unexpected sequence number"));return}for(this.resetStateForNewQuery(t,i),this._highPriorityDataSources=[],this._normalPriorityDataSources=[],this._lowPriorityDataSources=[],e=0,o=n.config.enabledDataSources;e0&&(this._bufferingTimer=n.safeSetTimeout(function(){u._bufferingTimer=null;u.processSuggestions(!0)},s,"processSuggestionsBuffering"),n.config.dataSourceTimeLimit&&(this._processingTimeoutTimer=n.safeSetTimeout(function(){u._processingTimeoutTimer=null;var t=__spreadArrays(u._highPriorityDataSources.filter(function(t){return!n.contains(u._arrivedDataSources,t)}),u._normalPriorityDataSources.filter(function(t){return!n.contains(u._arrivedDataSources,t)}),u._lowPriorityDataSources.filter(function(t){return!n.contains(u._arrivedDataSources,t)}));SharedLogHelper.LogError("SuggestionsRenderingManager",t.join(","),new Error("Data provider did not complete before the time limit"));u._processingStopped=!0;u._allDataSourcesArrived=!0;u.processSuggestions(!1);r&&r()},n.config.dataSourceTimeLimit,"processSuggestionsTimeout"))))},t.prototype.getLatencyTimeout=function(){return this._partialQuery.queryToFetch?n.config.latencyTimeout:n.config.latencyTimeoutForZeroInput},t.prototype.queueSuggestions=function(t,i,r,u,f){var e;if(t>this._sequenceNumber){SharedLogHelper.LogError("queueSuggestions",null,new Error("Unexpected sequence number"));return}if(!(t0&&this._bufferingTimer==null,s=this.haveAllDataSourcesArrived(this._highPriorityDataSources),h=s||y,p=this.haveAllDataSourcesCompleted(this._normalPriorityDataSources),c=this.haveAllDataSourcesCompleted(this._highPriorityDataSources),l=c&&p,a,v;t&&n.InstrumentationHelper.logDataSourceTimeout(Object.keys(this._suggestionsQueue),this._partialQuery);var f=t&&!this._renderedThisSequenceNumber,w=function(t,e){var s;if(!t.updated&&i.getDependencies(e).every(function(t){return n.contains(i._arrivedDataSources,t)})){if(o.push(e),i._allProcessedDataSources[e]=!0,t.suggestions.length>0&&(s=i.canHaveSuppressions(e)?t.suggestions.filter(function(n){return!i.isSuppressed(e,n)}):t.suggestions,s.length>0)){r||(r=i._renderedThisSequenceNumber?i._rootViewModel.getSuggestions(!0):[]);var h=i.removeDuplicatesAndAssignIds(s,r,u,e),c=h[0],l=h[1];u=u.concat(c);l&&(f=!0)}t.updated=!0}},e=function(n){var u,t,r;for(u in n)t=n[u],r=i._suggestionsQueue[t],r&&w(r,t)};h&&e(this._highPriorityDataSources);this._bufferingTimer&&l&&(sb_ct(this._bufferingTimer),this._bufferingTimer=null);a=h&&!this._HighPriDoneProcessing;v=a||(this.getLatencyTimeout()>0?this._bufferingTimer==null:s);v&&(e(this._normalPriorityDataSources),e(this._lowPriorityDataSources));this._waitingForMoreResults&&l&&(this._waitingForMoreResults=!1,(!this._renderedThisSequenceNumber||this._rootViewModel.mayNeedFlush()||(r||this._rootViewModel.getSuggestions(!0)).length==0)&&(f=!0));this._partialQuery.showProgressBar&&this._allDataSourcesArrived&&(f=!0);(u.length>0||f)&&(r||(r=this._renderedThisSequenceNumber?this._rootViewModel.getSuggestions(!0):[]),this.addSuggestions(r,u,o,f));this._allDataSourcesArrived&&(this.resetTimers(),n.InstrumentationHelper.notifyAllDataSourcesProcessed(this._sequenceNumber),this._rootViewModel.toggleProgressBar(!1));this._HighPriDoneProcessing=c},t.prototype.getAggregatorResult=function(t,i,r){var e=this.waitingForWebProvider(),f=null,u,o;return n.config.counterFactualLoggingOn&&(f=this._aggregator.rank(i,r,this._extraSignalsMap,this._partialQuery,t,this._sequenceNumber,e,!0)),u=this._aggregator.rank(i,r,this._extraSignalsMap,this._partialQuery,t,this._sequenceNumber,e,!1),o=n.config.counterFactualLoggingOn&&(!this.isSuggestionOrderTheSame(u.topResults,f.topResults)||!this.isSuggestionOrderTheSame(u.suggestionsToAdd,f.suggestionsToAdd)),[u,o]},t.prototype.waitingForWebProvider=function(){var t=this;return n.isBrowserOnline()&&["Web"].concat(this.getDependencies("Web")).some(function(i){return n.isDataSourceEnabled(i,t._partialQuery)&&!t._allProcessedDataSources[i]})},t.prototype.isSuggestionOrderTheSame=function(n,t){var r=function(n){return n.query+"\t"+n.type},i;if(n.length!=t.length)return!1;for(i=0;i=0)return l=i[a],l.needsRefreshAfterDeduping&&(h=!0),n.InstrumentationHelper.instrumentDuplicate(e._sequenceNumber,l,v),"continue";if(a=r.findIndex(function(n){return f._aggregator.mergeDuplicates(f._partialQuery,n,v)}),a>=0){var l=r[a],y=null,p=n.config.msbReplaceDupLocalFiles&&v.type==="MFIL"&&l.type==="FL";return p&&(y=e.replaceSuggestionInList(r,a,v),l=r[a]),l.needsRefreshAfterDeduping&&(l.needsRefreshAfterDeduping=!1,l.previewPaneNeedsRefreshAfterDeduping=!1),n.InstrumentationHelper.instrumentDuplicate(e._sequenceNumber,l,y!==null&&y!==void 0?y:v),"continue"}if(e._aggregator.canHaveDuplicatesWithinDataSource(u,e._partialQuery)&&(a=o.findIndex(function(n){return f._aggregator.mergeDuplicates(f._partialQuery,n,v)}),a>=0))return l=o[a],l.needsRefreshAfterDeduping&&(l.needsRefreshAfterDeduping=!1,l.previewPaneNeedsRefreshAfterDeduping=!1),n.InstrumentationHelper.instrumentDuplicate(e._sequenceNumber,o[a],v),"continue";c(v);o.push(v)},e=this;for(s=0;s0||i>0)&&(t>0&&i>0?(i>t&&(u=t,t=i,i=u),r=n/(t-n+i)):r=Number.MAX_VALUE),r}function s(n,t){var r=n.length,e=t.length,a,v,f,o,i;if(r===0&&e===0)return 1;var h=new Array(r),s=new Array(e),u=0,c=0,l=Math.floor(Math.max(r,e)/2)-1;for(i=0;i1)for(t=1;tr&&(r=i);else if(n)return 1;return r}function d(n){return n&&n.length>0?n.trim().split(" ").length:0}function g(n){var t=new RegExp("^[0-9a-zA-Z ]+$");return n&&t.test(n)?1:0}function nt(n){return n&&n.length>0&&n.charAt(n.length-1)==" "?1:0}function tt(n){return n&&n.length>0&&(n.includes("http://")||n.includes("https://")||n.includes("."))?1:0}function it(t,i,r,u){var o,e,s,h;t.includes("?")&&(r[117]=1,ot(t)&&(r[127]=1));t.replace("///","").replace("//","").includes("/")&&(r[118]=1);t.includes(".")&&(r[119]=1);o=u.cvid+u.privacyNumber+t;r[120]=f(o);e=t.toLocaleLowerCase();(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&&(s=n.normalizeUrl(e,15),h=n.normalizeUrl(i,15).toLocaleLowerCase(),s.startsWith(h)&&(r[187]=1))}function rt(n,i,r,u,e){if(e){r[128]=t(e,i);r[129]=e.length;var o=u.cvid+u.privacyNumber+e;r[130]=f(o)}}function ut(n,i,r){var e=n.toLocaleLowerCase(),s,u,f,h,c;if(r[140]=n.length,s=e.split(" "),r[144]=s.length,i)for(r[141]=t(n,i),r[142]=Math.min(100,o(r[141],i.length,n.length)),u=i.toLocaleLowerCase(),e.includes(u)&&(r[143]=1),e.startsWith(u)&&(r[188]=1),f=0,h=s;f0&&(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 ct(n,t,i){if(i){var r=i[n];r&&(t[281]=r.probability,t[282]=r.weight)}}function lt(n,t,r,u,f,e){if(t){var 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 at(n,t,i){if(t){var 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||SharedLogHelper.LogError("getAthenaGroupKey",null,new Error("Athena key group is empty")),t;case 1:return i||SharedLogHelper.LogError("getAthenaGroupKey",null,new Error("Athena key handoff is empty")),i;case 2:return r||SharedLogHelper.LogError("getAthenaGroupKey",null,new Error("Athena key suggestion type is empty")),i||SharedLogHelper.LogError("getAthenaGroupKey",null,new Error("Athena key handoff is empty")),r+"_"+i;default:return SharedLogHelper.LogError("getAthenaGroupKey",null,new Error("Athena key group type is not set")),""}}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 vt(t){var i={};return t?(n.config.athenaKeyType==2?wt(t,i):(yt(t,i),pt(t,i)),i):i}function yt(t,f){var y=t.Suggestions?t.Suggestions.split("\t"):[],p=t.ProbSugClickGivenPrefs?t.ProbSugClickGivenPrefs.split("\t"):[],w=t.ClicksOnSugGivenPrefs?t.ClicksOnSugGivenPrefs.split("\t"):[],b=t.ProbSugClickGivenBackground?t.ProbSugClickGivenBackground.split("\t"):[],k=t.Loglikelihoods?t.Loglikelihoods.split("\t"):[],a=t.SuggestionGroups?t.SuggestionGroups.split("\t"):[],d=t.ProbSugClickGivenPrefWeeks?t.ProbSugClickGivenPrefWeeks.split("\t"):[],v=t.ProbSugClickGivenPrefWeekends?t.ProbSugClickGivenPrefWeekends.split("\t"):[],g=t.ProbSugClickGivenBackgroundWeeks?t.ProbSugClickGivenBackgroundWeeks.split("\t"):[],it=t.ProbSugClickGivenBackgroundWeekends?t.ProbSugClickGivenBackgroundWeekends.split("\t"):[],nt=t.LoglikelihoodWeeks?t.LoglikelihoodWeeks.split("\t"):[],tt=t.LoglikelihoodWeekends?t.LoglikelihoodWeekends.split("\t"):[],c=n.config.athenaKeyType==0||!t.SuggestionHandOffTypes?[]:t.SuggestionHandOffTypes.split("\t"),s=y.length,l=e(),o;if(u(s,a.length,c.length))for(o=0;oo?a[o]:"",ut=c&&c.length>o?c[o]:"",ft=r(rt,ut,""),h=i(y[o],ft);f[h]={SuggestionGroup:+a[o]};b.length==s&&(f[h].ProbSugClickGivenBackground=Number(b[o]));p.length==s&&(f[h].ProbSugClickGivenPref=Number(p[o]));w.length==s&&(f[h].ClicksOnSugGivenPref=Number(w[o]));k.length==s&&(f[h].Loglikelihood=Number(k[o]));n.config.athenaKeyType!=0&&c.length==s&&(f[h].SuggestionHandOffType=Number(c[o]));d.length!=s||l?v.length==s&&l&&(f[h].ProbSugClickGivenPrefTime=Number(v[o])):f[h].ProbSugClickGivenPrefTime=Number(d[o]);g.length!=s||l?v.length==s&&l&&(f[h].ProbSugClickGivenBackgroundTime=Number(it[o])):f[h].ProbSugClickGivenBackgroundTime=Number(g[o]);nt.length!=s||l?tt.length==s&&l&&(f[h].LoglikelihoodTime=Number(tt[o])):f[h].LoglikelihoodTime=Number(nt[o])}else SharedLogHelper.LogError("parseLLSignals",null,new Error("Length doesn't match"))}function pt(t,f){var a=t.CCRSuggestions?t.CCRSuggestions.split("\t"):[],l=t.CCRSuggestionGroups?t.CCRSuggestionGroups.split("\t"):[],v=t.CCRs?t.CCRs.split("\t"):[],y=t.EventCounts?t.EventCounts.split("\t"):[],c=n.config.athenaKeyType==0||!t.CCRSuggestionHandOffTypes?[]:t.CCRSuggestionHandOffTypes.split("\t"),p=t.CCRsWeek?t.CCRsWeek.split("\t"):[],w=t.CCRsWeekend?t.CCRsWeekend.split("\t"):[],s=a.length,b=e(),o;if(u(s,l.length,c.length))for(o=0;oo?l[o]:"",d=c&&c.length>o?c[o]:"",g=r(k,d,""),h=i(a[o],g);f[h]||(f[h]={SuggestionGroup:Number(l[o])});v.length==s&&(f[h].CCR=Number(v[o]));y.length==s&&(f[h].EventCount=Number(y[o]));n.config.athenaKeyType!=0&&c.length==s&&(f[h].CCRSuggestionHandOffType=Number(c[o]));p.length!=s||b?w.length==s&&b&&(f[h].CCRTime=Number(w[o])):f[h].CCRTime=Number(p[o])}else SharedLogHelper.LogError("parseCCRSignals",null,new Error("Length doesn't match"))}function wt(n,t){var o=n.SugTypes?n.SugTypes.split("\t"):[],s=n.HandOffTypes?n.HandOffTypes.split("\t"):[],h=n.PSGPCRs?n.PSGPCRs.split("\t"):[],c=n.PSGCCRs?n.PSGCCRs.split("\t"):[],l=n.PSGSTRs?n.PSGSTRs.split("\t"):[],a=n.PSGSATCCRs?n.PSGSATCCRs.split("\t"):[],v=n.PSGSATPCRs?n.PSGSATPCRs.split("\t"):[],f=o.length,i;if(u(f,0,s.length))for(i=0;i0&&!n.queryToFetch.includes("c")&&!n.queryToFetch.includes("h")&&!n.queryToFetch.includes("r")&&!n.queryToFetch.includes("m"))?!0:!1},r.prototype.setMRUHintEnabled=function(t,i){var f,r,u;if(n.config.enableMRUHint)for(f=t.queryToFetch.toLocaleLowerCase(),r=0;r0)){for(u=0;uo.minimum&&i.simpleFeatures.topHitScore>r.simpleFeatures.topHitScore+o.penalty&&(r=i,f=u)):n.isSetting(i.type)?(i.simpleFeatures.topHitScore=e(-.42912*i.simpleFeatures.ciGeoMeanScoreNormalized+-.0173*i.simpleFeatures.ciLocalScore+-.1516*i.simpleFeatures.ciMatchScore+.28754),!n.isSetting(r.type)&&i.simpleFeatures.topHitScore>s.minimum&&i.simpleFeatures.topHitScore>r.simpleFeatures.topHitScore+s.penalty&&(r=i,f=u)):n.isFileOrFolder(i.type)?(i.simpleFeatures.topHitScore=e(.99907*i.simpleFeatures.startsWithPrefix+1.1431*i.simpleFeatures.containsPrefix+3.1153*i.simpleFeatures.jaroWinklerScore+-3.9697),r==i&&(i.simpleFeatures.topHitScore=0),!n.isFileOrFolder(r.type)&&i.simpleFeatures.topHitScore>c.minimum&&i.simpleFeatures.topHitScore>r.simpleFeatures.topHitScore+c.penalty&&(r=i,f=u)):n.isWebSuggestion(i)||i.type=="MB"||i.isAnswer?(i.simpleFeatures.topHitScore=e(5.3465*i.simpleFeatures.webConfidence+-5.6972),(!n.isWebSuggestion(r)&&i.simpleFeatures.topHitScore>h.minimum&&i.simpleFeatures.topHitScore>r.simpleFeatures.topHitScore+h.penalty||i.type=="MB"&&n.isWebSuggestion(r))&&(r=i,f=u)):(i.type=="PT"||i.type=="CG")&&(r=i,f=u);f!=0&&(t.unshift(r),t.splice(f+1,1))}},r.prototype.extractSimpleFeatures=function(t){var i=t.featureStore,f=64,r=0,u={mruScore:i[282]||r,sugTypeBucket:10,ciGeoMeanScoreNormalized:Math.floor(i[405]/1e3)||f,ciGlobalScore:i[269]/1e3||f,ciLocalScore:i[270]/1e3||f,ciMatchScore:Math.floor(i[158]/1e3)||0,rank:Math.floor(i[16]/1e3)||128,webScore:this.getSuggestionScoreFromSuggestionLogMeta(t.suggestionLogMeta)||r,webConfidence:i[17]||r,prefixEqualsSuggestion:i[133]||r,startsWithPrefix:i[188]||r,containsPrefix:i[143]||r,jaroWinklerScore:i[421]||r,topHitScore:r};return u.sugTypeBucket=n.isApp(t.type)?0:n.isSetting(t.type)?1:n.isFileOrFolder(t.type)?2:t.type=="MB"?3:n.isWebSuggestion(t)?4:5,t.type=="IBA"&&i[269]<1&&(u.ciGeoMeanScoreNormalized=64),u.ciMatchScore==0&&u.startsWithPrefix==0&&u.sugTypeBucket<=1&&(u.ciMatchScore+=1),u},r.prototype.isColdStartConversation=function(t,i,r){if(i&&i.length>0||r&&r.WebSignalsAvailable||!t.some(function(t){return n.isApp(t.type)||n.isSetting(t.type)}))return n.Host.setFCRCount(0),n.Host.incrementNCRCount(),!1;for(var u=0;ut[u].featureStore[270])return n.Host.setFCRCount(0),n.Host.incrementNCRCount(),!1;return n.config.enableColdStartRanking1||!n.config.enableColdStartRanking?(n.Host.setFCRCount(1),n.Host.incrementCRCount(),!1):(n.Host.setFCRCount(1),n.Host.incrementCRCount(),!0)},r.prototype.orderSuggestions=function(i,r,u,f,e,o,s,h,c,l){var ut=this,y,w,p,b,nt,tt,k,d,g,v,it,rt,a;if(n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().beginMark("WSBRanking.orderSuggestions"),!n.config.bypassRankerOnNoNewSuggestions||i.hasNewSuggestions){if(y=n.safeExecute(function(){return ut.createFeatureStore(i,r,u,f,e,o,s,c,l)},"createFeatureStore"),y=y||r.map(function(){return{}}),p=h?n.config.counterFactualRankerId:n.config.mainRankerId,p?(w=n.safeExecute(function(){return t.suggestionRankingModels[p]},"getRanker"),w||SharedLogHelper.LogError("getRanker",p,new Error("Model not found"))):SharedLogHelper.LogError("getRanker",p,new Error(h?"CounterFactualRankerId not defined ":"MainRankerId not defined")),n.config.enableSimpleRanker){for(a=0;a1&&(n.config.enableFuzzyRanking||n.config.enableFuzzyRanking1)){for(g=r[0].rankingScore,v=0,a=0;a=g){if(n.isApp(r[a].type)||n.isSetting(r[a].type))break;v+=1}if(n.Host.setFRSuggCount(v),v>1){for(it=r.slice(0,v).sort(function(n,t){return t.simpleFeatures.prefixEqualsSuggestion-n.simpleFeatures.prefixEqualsSuggestion||t.simpleFeatures.containsPrefix-n.simpleFeatures.containsPrefix||n.simpleFeatures.ciGlobalScore-t.simpleFeatures.ciGlobalScore}),a=0;a1)for(rt=r.map(function(n,t){return n.type=="MB"?t:undefined}).filter(function(n){return typeof n=="number"}),a=0;ai-1&&(n=i-1);var t=-(n*100+500)-s[n];return s[n]+=1,t},y=function(n){for(var i,r,t=0,u=n;t=0?!o&&e.anaheimRankingSignals&&r<=n.config.anaheimDataTopHitThreshold?h(l):h(r):h(i)},r.prototype.getRankingBucketWithAnaheimAdapter=function(t,i,r){var f=Math.pow(2,-(i/8e3)+2),u;if(t.anaheimRankingSignals){var e=t.anaheimRankingSignals.dateVisited,o=(n.getCurrentTime()-e.getTime())/864e5,s=t.anaheimRankingSignals.visitCount,h=t.anaheimRankingSignals.urlTypedCount,u=.6*Math.exp(-o/14)+.25*(1-Math.exp(-s/6))+.15*(1-Math.exp(-h/2));return Math.floor(r*(1-u))}return t.suggestionLogMeta&&(u=this.getSuggestionScoreFromSuggestionLogMeta(t.suggestionLogMeta),u)?Math.floor((u-i)/f):null},r.prototype.getSuggestionScoreFromSuggestionLogMeta=function(n){var t=";2152:";return n&&n.indexOf(t)>=0?parseInt(n.substring(n.indexOf(t)+6).split(";")[0].slice(1,-1)):NaN},r.prototype.getTopWebSuggestion=function(t){var f,e,i,o,r,u;if(t.length==0)return null;if(n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().beginMark("WSBRanking.getTopWebSuggestion"),f=t[0],e=64e3,t.length>1)for(i=0,o=t;i0&&n.isMsbOnlineSuggestionType(r[0].type)?!0:n.config.bypassFallbackOnMSBTopHit==4&&!i.some(function(t){return 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},r.prototype.getTopHitCandidates=function(t,r,u,f){var p=this,e,c,l,v,y,s,a;if(n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().beginMark("WSBRanking.getTopHitCandidates"),e=r.filter(function(n){return p.allowInTopHit(t,n,f)}),this.bypassFallbackForMSB(t,r,e,f)){var w=n.getMsbTophitSuggestionTypeOrder(),h=[],o=[],b=function(t){return o=f.filter(function(i){return t.indexOf(i.type)>-1&&(!n.config.msbCheckAutoOpenSignal||i.autoOpenPreviewPaneWhenOnTopHit)}),o.length>0?"break":void 0};for(c=0,l=w;c0&&o[0].autoOpenPreviewPaneWhenOnTopHit&&(n.config.bypassFallbackOnMSBTopHit!=3||n.getTextForLexicalFeatures(o[0]).toLowerCase().startsWith(t.queryToFetch.toLowerCase()))&&h.push(o[0]),n.config.bypassFallbackOnMSBTopHit==4&&(e[0].isAnswer||n.isWebSuggestion(e[0]))&&(e[0].isAnswer||this.getFallbackClassifierScore(e[0])>i)&&h.push(e[0]),h.length>0)return n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("WSBRanking.getTopHitCandidates"),h}return this.enableFallbackClassifier(t,e,u)?(e=this.getFallbackClassifierSuggestions(e),n.config.enableGGSupp&&this.isNotChromeIntent(t,e))?(n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("WSBRanking.getTopHitCandidates"),[]):(n.config.demoteWebForApps&&(s=this.getTopAppSuggestion(r),a=s?s.query.toLocaleLowerCase():"",s&&this.allowInTopHit(t,s)&&e.every(function(t){return n.isWebSuggestion(t)})&&(a.startsWith(t.queryToFetch)||a.includes(" "+t.queryToFetch))&&(e=[s])),n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("WSBRanking.getTopHitCandidates"),e):(n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("WSBRanking.getTopHitCandidates"),e)},r.prototype.getFallbackClassifierScore=function(i){var r=n.safeExecute(function(){return t.suggestionRankingModels[n.config.fallbackClassifierId]},"getFallbackClassifier"),u=r?n.safeExecute(function(){return r(i.featureStore)},"calculateFallbackClassifierScore"):0;return n.trimFeatureStoreValue(u)},r.prototype.getFallbackClassifierSuggestions=function(r){if(r=r.filter(function(n){return n.type!="SW"}),r.length>0){var f=0,u=r[0];return u.fbcScore=this.getFallbackClassifierScore(u),f=n.config.enableAppsSettingsFbcScoreThreshold?n.isApp(u.type)||n.isSetting(u.type)?n.config.appsSettingsFbcScoreThreshold:n.isWebSuggestion(u)?i:n.config.nonWebFbcScoreThreshold:n.isWebSuggestion(u)?i:n.config.nonWebFbcScoreThreshold,u.fbcScore>=f?r.slice(0,t.topHitIsMultiEntity(r)?2:1):[]}return[]},r.prototype.enableFallbackClassifier=function(t,i,r){if(r&&n.config.fallbackClassifierId&&i.length>0){var u=i[0];return n.getGroupType(u)==n.GroupType.Cortana?!1:u.isAnswer?!1:!0}return!1},r.prototype.getTopAppSuggestion=function(t){for(var u,i=0,r=t;i.5&&(r=u);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)},r.prototype.createFeatureStore=function(t,i,r,u,f,e,o,s,h){var st=[],nt=0,ht=0,tt=0,ct=t.queryToFetch.toLocaleLowerCase(),bt=function(t){return n.getGroupType(t)},lt=n.getSumMruLaunches(u),at=0,vt={},it,rt,yt,k,ut,v,y,l,p,d,ft,et,w,g,ot,a,c,b,pt,wt;for(u&&(it=n.evaluateGroupLaunches(u),at=it.otherGroupLaunches,vt=it.groupLaunches),rt=n.computeGroupBackpropagatedClicks(t.queryToFetch,h),yt=n.computeSuggestionBackpropagatedClicks(t.queryToFetch,h),k=0,ut=i;knt&&(nt=y.totalLaunches)),v.deviceItem&&v.deviceItem.rankScore>tt&&(tt=v.deviceItem.rankScore));for(l={},n.isWeekend()&&(l[440]=1),l[441]=this.getLocalHourBucket(new Date),p=ct.split(" "),d=0,ft=p;d0&&(w=p[0],l[452]=w.indexOf("c:")>-1||w.indexOf("d:")>-1||w.indexOf("e:")>-1||w.indexOf("f:")>-1?1:0),g=0,ot=i;g0&&(o[103]=c.totalLaunches/f),this.addLastAccessDate(c.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),o[17]=i.highConfidenceMetaSuggestionScore,b=this.getRank(i),typeof b!="undefined"?o[16]=b:o[4]=1,l=i,l.matchedOnlyOnContent&&(o[259]=1),l.matchedOnlyOnAuthor&&(o[273]=1),l.lastModifiedDate&&(o[268]=n.getTimeDiffInDays(l.lastModifiedDate)),l.extensionLC==".lnk"&&(o[272]=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),a=n.getGroupType(i),v=i.query,i.type=="SW"&&(v="SearchTheWeb"),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),h=n.getTextForLexicalFeatures(i),s=h?h.toLocaleLowerCase():null,h||(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&&(i.type!="SW"&&(o[82]=1),o[25]=1),k=o[132]==1,k?o[137]=t.length:(o[137]=h.length,o[134]=n.getEditDistance(t,s),o[135]=Math.min(100,n.computeEditDistanceRatio(o[134],t.length,h.length)),o[136]=n.isWordBoundary(t,h),o[284]=Math.abs(h.length-t.length)),!k&&s){for(s.indexOf(t)>-1&&(o[143]=1),s.substring(0,t.length)===t&&(o[188]=1),nt=s.split(" "),p=0,d=nt;p-1?1:0)),o[1]||i.type!="FL"&&i.type!="FD"&&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))&&(g=i.ciMetaData,this.computeConstraintIndexFeatures(i.deviceItem,o,g),i.ciMatchedQuery=this.getConstraintIndexMatchedQuery(g),o[269]&&o[270]&&(o[405]=Math.sqrt(o[269]*o[270]))),i.signals&&(o[230]=i.signals.DistanceToEntity,o[231]=i.signals.DistanceToEntityPrecision,o[232]=i.signals.RankingScore),o},r.prototype.addLastAccessDate=function(t,i){var r=n.getTimeDiffInDays(t);r!=null?i[9]=r:i[19]=1},r.prototype.setTypeSignal=function(n,t){switch(n.type){case"LDOC":case"FL":t[61]=1;break;case"LI":t[85]=1;break;case"LV":t[86]=1;break;case"MU":t[87]=1;break;case"FD":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"SW":t[59]=1}},r.prototype.setRatios=function(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))},r.prototype.setThresholdRatios=function(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},r.prototype.computeConstraintIndexFeatures=function(n,t,i){var u,o,f,e,s,r;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(u=0,o=i.Parses[0].Entities;u=0&&t<6?i=1:t>=6&&t<12?i=2:t>=12&&t<18?i=3:t>=18&&t<=23&&(i=4),i},r}();t.FastRankRanker=r})(t=n.Ranking||(n.Ranking={}))}(WSB||(WSB={})),function(n){var t=function(){function t(t){var i=this;this._instrumentationProvider=t;n.Host.bindDismissed(function(){return i.flushAggregatedMeasure(!0)});this._keystrokeAggregatedFunctionPerf={}}return t.prototype.onNewKeystroke=function(n,t,i){this.flushAggregatedMeasure();this._aggregatedMeasureFlushed=!1;this._currentLeftPaneSuggestions=null;this._currentRawImpressionGuid=t;this._currentRawClientImpressionGuid=SearchAppWrapper.CortanaApp.impressionId;this._keystrokeAggregatedMeasure={CVID:n};this._keystrokeAggregatedFunctionPerf={};this._currentKeystrokeAggregatedMeasureIsForSearchHome=i},t.prototype.flushAggregatedMeasure=function(t){var f,i,r,e,o,u;if((t||this._currentKeystrokeAggregatedMeasureIsForSearchHome)&&!this._aggregatedMeasureFlushed){if(n.config.logClientPerf){if(f=Object.keys(this._keystrokeAggregatedFunctionPerf),this._keystrokeAggregatedFunctionPerf&&f.length>0){for(i="",r=0,e=f;r1&&this.logProfilerMarker(1,0,"KeystrokeAggregatedMeasure",this._currentRawImpressionGuid,this._currentRawClientImpressionGuid,this._keystrokeAggregatedMeasure);this._aggregatedMeasureFlushed=!0}},t.prototype.logSingleMeasure=function(n,t,i){this.logProfilerMarker(1,0,n,t,SearchAppWrapper.CortanaApp.impressionId||t,i)},t.prototype.logProfilerMarker=function(n,t,i,r,u,f){f&&u!=r&&(f.ServerIG=r);this._instrumentationProvider.logProfilerMarker(n,t,i,u,f)},t.prototype.logAggregate=function(n,t){this._keystrokeAggregatedMeasure[n]=t},t.prototype.logAggregateFunctionPerf=function(n,t){var 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}},t.prototype.getItemLayoutFromSuggestionsList=function(n){var u,e,i,f,r,t;if(this._currentLeftPaneSuggestions){for(u=this._currentLeftPaneSuggestions.topResults,e=this._currentLeftPaneSuggestions.groups,t=0;t=0)){this.setAutoCompletedQuery(r,t.query,i);t.autoCompleteType=o;return}}this._autoCompletedQuery&&(this.reset(),n.Host.setAutoCompleteQueryText(r))}},e.prototype.reset=function(){this._autoCompletedQuery=null;this._fullAutoCompletedQuery=null},e.prototype.fullAutoCompleteOffset=function(n,t){var i=n.startsWith(t);return i?t.length:-1},e.prototype.infixAutoCompleteOffset=function(n,u){var f=n.search("[ .:,\\\\/+_&-]"+u.replace(t,function(n){return i[n]})),e,o;return f>0&&(e=n.substring(0,f+1).match(r)[1],o=e?e.match(/[ .:,\\/+_&-]+/g).length+1:1,o<3)?f+1+u.length:-1},e.prototype.directNavAutoCompleteOffset=function(n,t){var i=t.match(u),r;return i&&(r=i[1],r.length>0&&n.startsWith(i[1]))?r.length:-1},e.prototype.setAutoCompletedQuery=function(t,i,r){var u=t+i.slice(r);n.Host.setAutoCompleteQueryText(u);this._autoCompletedQuery=i;this._fullAutoCompletedQuery=u},e}();n.WSBAutoComplete=e}(WSB||(WSB={})),function(n){var t;(function(t){function o(n){return{fullySuppressedGroups:n.fullySuppressedGroups?n.fullySuppressedGroups.slice(0):[],partiallySuppressedGroups:n.partiallySuppressedGroups?n.partiallySuppressedGroups.slice(0):[],suppressedSuggestions:n.suppressedSuggestions?n.suppressedSuggestions.slice(0):[]}}function s(n){return n.type=="SW"||n.type=="PWL"}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"}var r,u,e;(function(n){n[n.NotDuplicate=0]="NotDuplicate";n[n.NoMetadata=1]="NoMetadata";n[n.MergeMetadata=2]="MergeMetadata"})(r||(r={}));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;e=function(){function t(t,i,r,u,f,e,o,s,h){var c=this;this._navigationHelper=t;this._lightweightStorage=i;this._previousKeystrokeCache=r;this._conversationCache=u;this._ranker=f;this._renderedTopResults=e;this._previewPane=o;this._imageSearchViewModel=s;this._upsellViewModel=h;n.config.enableConversationCache&&this._conversationCache&&n.Host.bindDismissed(function(){c._conversationCache.clean()})}return t.prototype.launchWebSearch=function(t,i,r,u,f){var e=t.queryToFetch;n.Host.launchSearch(e,this._navigationHelper.getSearchUrl(t.fullPartialQuery,e,r,null,u,undefined,undefined,undefined,undefined,f),i)},t.prototype.getProtocol=function(t,i){var u="PWL",r=n.InstrumentationHelper.getInstrumentedSyntheticSuggestion(i,u),f;return r?r:(r=n.createSuggestion(t,null,n.Host.getEdgeIcon,null,u,null,n.InstrumentedItem.getNonSuggestionInstrumentedItem(u,n.SyntheticQSCodesMaps.KValues),1,i,!1,"tp",function(){return n.Host.launchUri(r.url)}),r.notAResult=!0,f=function(t){var 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},f(t),r.updateFromQuery=function(n){return n.isProtocol?(f(n),!0):!1},n.InstrumentationHelper.instrumentSyntheticSuggestion(i,r),r)},t.prototype.getWebSearch=function(t,i,r,u,f,e){var o=this,s=n.contains([13,14],f);return n.getSyntheticSuggestion(t,i,r,u,f,e,s,function(n,t){return o.launchWebSearch(t,n.useRaf,r,f,n.msbVerticalHash)})},t.prototype.getExplorerSearch=function(t,i){var r=n.getSyntheticSuggestion(t,i,"SDFE",{content:"",type:1},2,n.Host.getLocString("SearchInFileExplorer"),!0,function(t,i){return n.Host.launchSearchInFileExplorer(i.queryToFetch)});return n.shouldSetThisPcGroupSource(n.GroupType.Documents,t)&&(r.sourceForGroup=1),r},t.prototype.getOutlookWebAccessSearch=function(t,i){var r=n.AccessTokenManager.getWindowsAccountType()==1;return n.getSyntheticSuggestion(t,i,"OWA",{content:"",type:2},r?8:12,n.Host.getLocString("SearchInOutlookWeb"),!0,function(){return n.Host.launchUri(r?"https://outlook.office.com/owa":"https://outlook.live.com/owa")})},t.prototype.getStoreSearch=function(t,i){return n.getSyntheticSuggestion(t,i,"STS",{content:"",type:2},3,n.Host.getLocString("SearchForAppsInTheStore"),!0,function(t,i){return n.Host.launchStoreSearch(i.queryToFetch)})},t.prototype.getRecourse=function(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.isBingEnabled()?this.getWebSearch(t,i,"SBI",{content:"",type:2},13,n.Host.getLocString("SearchForWebImages")):null;case n.Scope.Videos:return n.isBingEnabled()?this.getWebSearch(t,i,"SBV",{content:"",type:1},14,n.Host.getLocString("SearchForWebVideos")):null;default:return null}},t.prototype.getSyntheticSuggestions=function(t,i){var s=this,h=n.getScopeConfig(t),a=h.webSyntheticEnabled&&h.webSyntheticEnabled(t),v=a?this.getWebSearch(t,i,"SW",n.getSearchSuggestionIcon(),0,n.getWebSuggestionAnnotation(n.msbEnabledForQuery(t))):null,y=t.isProtocol&&n.RuntimeConfig.AllowProtocolSyntheticSuggestions?this.getProtocol(t,i):null,e=this.getRecourse(t,i),r,u,c,f,o,l;if(e&&(e.rankingScore=-Number.MAX_VALUE),r=[],this._imageSearchViewModel&&t.isSearchHomeZI&&t.scope==n.Scope.All&&r.push(this._imageSearchViewModel.getSnipSearchSyntheticSuggestion(t,i)),this._upsellViewModel&&r.push(this._upsellViewModel.getUpsellSyntheticSuggestion(t,i)),u=[],typeof n.isMsbWorkScopeApplicable=="function"&&n.isMsbWorkScopeApplicable()&&typeof n.msbVerticalManager=="object")for(u=n.msbVerticalManager.getSyntheticSuggestions(t,i),c=function(i){var f,r,u,e;if(i&&(i.click=function(){return s.launchWebSearch(t,i.useRaf,i.type,i.handoffType,i.msbVerticalHash)},n.config.msbVerticalEnableChildSuggestions&&i.childSuggestions!=undefined))for(f=function(n){n.click=function(){return s.launchWebSearch(t,n.useRaf,n.type,n.handoffType,n.msbVerticalHash)}},r=0,u=i.childSuggestions;r0&&l&&(l.fullySuppressedGroups||[]).length>0&&(et=[],vt=[],l.fullySuppressedGroups.forEach(function(t){n.contains(n.config.groupsToNeverFullySuppress,t)?et.push(t):vt.push(t)}),et.length>0&&(l=o(l),l.fullySuppressedGroups=vt,(ti=l.partiallySuppressedGroups).push.apply(ti,et))));this._previousKeystrokeCache&&(ui=this._previousKeystrokeCache.getPreviousEventWebSignalsData(f.queryToFetch));var pi=ft?ft.SuggestionEngagementData:null,wi=ft?ft.LookupCompletions:null,bi={cvid:n.Host.getConversationId(),privacyNumber:n.Host.getPrivacyNumber()},a=this.getSyntheticSuggestions(f,s);if(f.scope!=n.Scope.Web&&n.config.enableSearchTheWebMaxSuggestions){var fi=[n.GroupType.SearchSuggestions,n.GroupType.Websites],ei=["ANAH","ANATH"],yt=t.filter(function(t){return t.type!="SW"&&n.contains(fi,n.getGroupType(t))&&!n.contains(ei,t.type)}),oi=r.filter(function(t){return t.type!="SW"&&n.contains(fi,n.getGroupType(t))&&!n.contains(ei,t.type)}),w=n.config.searchTheWebMaxSuggestionsCount;if(n.config.enableProgressiveSearchTheWebMaxSuggestions)switch(f.queryToFetch.length){case 0:case 1:case 2:case 3:break;case 4:w+=1;break;case 5:w+=2;break;case 6:w+=4;break;case 7:w+=6;break;default:w=25}yt.length>=w?(oi.map(function(n){return n.suppressed=!0}),si=0,yt.forEach(function(n){return n.suppressed=si++>=w})):(hi=1,pt=w-yt.length,pt>0&&oi.filter(function(){return hi++>=pt}).map(function(n){return n.suppressed=!0}))}if(r=r.slice(),l&&(l.fullySuppressedGroups&&l.fullySuppressedGroups.length>0&&(this.removePromotedFSUPGroups(r,l.fullySuppressedGroups),r=r.filter(function(t){return!n.contains(l.fullySuppressedGroups,String(ct.getGroupTypeForSuppressions(t)))})),l.suppressedSuggestions&&l.suppressedSuggestions.length>0&&(r=r.filter(function(t){return!n.contains(l.suppressedSuggestions,n.getSuggestionKey(t))}))),n.config.suppressFileFolders&&f.queryToFetch.length0&&r.unshift.apply(r,a.others),a.protocol&&r.unshift(a.protocol),((lt=a.msbVerticals)===null||lt===void 0?void 0:lt.length)>0&&r.unshift.apply(r,a.msbVerticals)),this.ensureUniqueReactKeys(r),tt=e.length==1&&e[0].childSuggestions&&e[0].childSuggestions.some(function(n){return n.displayed}),b=this.getSuggestionsToRank(tt,t,r,a,s),n.config.bypassRankerOnNoNewSuggestions&&r&&r.length&&(f.hasNewSuggestions=!0),it=[],n.config.enableConversationCache&&this._conversationCache&&!n.isL2(f)&&(this._conversationCache.refreshPartialQuery(f.queryToFetch),it=n.config.enableConversationCacheSearchTheWeb?b.filter(function(n){return ct.shouldCacheSuggestion(n,f)&&n.type=="AS"}):b.filter(function(n){return ct.shouldCacheSuggestion(n,f)&&n.type!="SW"}),it.length>0&&f.queryToFetch.length>0)){wt=!1;t.some(function(n){return n.type=="SW"})&&(wt=!0);t=this._conversationCache.retrieveSuggestionsFromCache(!0);for(rt in t)t[rt].sequenceNumber!=s&&(t[rt].sequenceNumber=s,t[rt].instItem=n.InstrumentedItem.createInstrumentedItem(s,t[rt].type));r=it;b=this.getSuggestionsToRank(tt,t,r,a,s);wt&&a.searchTheWeb&&t.push(a.searchTheWeb)}ut=this._ranker.rank(f,b,at,pi,wi,ri,bi,ui,c,a);this._previousKeystrokeCache&&!h&&this._previousKeystrokeCache.updateSpellerTriggerData(f.queryToFetch,b);t.length==0&&a.recourse&&r.push(a.recourse);var y=this.determineTopResults(e,r,ut,a,f,s,tt),bt=t.filter(function(t){return!n.contains(e,t)}),p=this.determineSuggestionsToAddToGroups(ii,bt,r,e,y,a,f,tt,h);if(!n.RuntimeConfig.FlatListWithoutGroups&&ut.mruSuppressions&&ut.mruSuppressions.backPropDataExists)this.applyMRUSuppressions(ut,e,y,p,f);else if(l&&l.partiallySuppressedGroups&&this.canPartiallySuppressGroups(y,p,f))for(ot=0,kt=p;ot=0&&(nt.push(v[t]),v.splice(t,1))},ht=0,gt=f.staticGroupOrder;ht0&&(nt.push.apply(nt,v),v=nt)}else f.forceGroupOnTop&&(ni=f.forceGroupOnTop,d=v.findIndex(function(t){return n.sameGroup(t,ni)}),d>=0&&(v.splice(d,1),v.unshift(ni)),d=v.findIndex(function(t){return n.isTopHitChildGroup(t)}),d>=0&&(vi=v[d],v.splice(d,1),v.unshift(vi)));if(n.RuntimeConfig.FlatListWithoutGroups&&(y=y.concat(p.filter(function(n){return!n.suppressed})),p=[],n.trimList(y,n.RuntimeConfig.MaxSuggestionsWhenFlatList,function(i){return!n.contains(t,i)&&!i.notAResult}),st.length!=0))throw new Error("Can't remove suggestions from groups when there are no groups");return n.config.promoteEdgeOverIE&&this.promoteEdgeOverInternetExplorer(p,y),n.config.transitionIEToEdge&&this.transitionInternetExplorerToEdge(y),n.config.enablePartnerPromotions&&this.promotePartnerSuggestions(p,y,f.queryToFetch),n.config.enableConversationCache&&this._conversationCache&&!n.isL2(f)&&it.length>0&&f.queryToFetch.length>0&&(this._conversationCache.setTopResultCount(y.length),this._conversationCache.setSuggestions(b)),{topResults:y,suggestionsToAdd:p,suggestionsToRemove:st,groupOrder:v}},t.prototype.removePromotedFSUPGroups=function(t,i){var r=function(r){var e=t[t.findIndex(function(n){return n.deviceItem&&n.deviceItem.id==r})],f;e&&(f=u.getGroupTypeForSuppressions(e).toString(),n.contains(i,f)&&n.tryRemove(i,f))},u=this;for(var f in n.config.disableFSUPPartnerAppIds)r(f)},t.prototype.shouldCacheSuggestion=function(t,i){var h=this._conversationCache.isSuggestionCached(t,i),u,f,o,e,s,r;if(h)return this._conversationCache.update(t),!1;for(u=this._conversationCache.retrieveSuggestionsFromCache(!0),f=0,o=u;f50)SharedLogHelper.LogError("shouldCacheSuggestion","We should not cache more than 50 suggestions "+i.queryToFetch);else for(e=0,s=u;e=0&&(t[i].primaryMetadata=n.Host.getLocString("EdgeToIEUpsell"),t[i].classNames.twoLineMax||t[i].classNames.push("twoLineMax"),f="&ciaid=actpermedge&source=windowsSearch",t[i].click=n.config.useCobaltCSS?function(){return n.Host.launchUri("https://go.microsoft.com/fwlink/?linkid=2181241"+f)}:function(){return n.Host.launchUri("https://go.microsoft.com/fwlink/?linkid=2181242"+f)}))},t.prototype.promoteEdgeOverInternetExplorer=function(t,i){var r=i.findIndex(function(t){return t.deviceItem&&t.deviceItem.id==n.InternetExplorerId}),u=t.findIndex(function(t){return 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]))},t.prototype.promotePartnerSuggestions=function(n,t,i){var r=function(r){if(!u[r].enabled)return"continue";var e=t.findIndex(function(n){return n.deviceItem&&n.deviceItem.id==r}),f=n.findIndex(function(n){return 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]))};for(var f in u)r(f)},t.prototype.applyMRUSuppressions=function(t,r,u,f,e){var h,l,s,o;if(this.canPartiallySuppressGroups(u,f,e)){var c={};for(h=0,l=f;h1&&!n.isL2(o))return t;if(n.config.shGAWDx&&(tt=r.filter(function(n){return n.previewPaneType===4}),tt.length>0))return t.push(tt[0]),t;if(n.config.enableAnaheimDataQFAggressive&&(a=r.filter(function(n){return n.type=="ANAH"}).sort(function(n,t){return t.rankingScore-n.rankingScore}),k=r.filter(function(n){return n.type=="PP"||n.type=="ST"}),a.length>0&&!((k===null||k===void 0?void 0:k.length)>0)))return t.push(a[0]),t;if(o.inorganic&&o.queryToFetch){if(t.length>0)return t;if(e.searchTheWeb.query===o.queryToFetch)return t.push(e.searchTheWeb),t}if(l=u.topResults,d=this._previewPane?this._previewPane.getPreviewedSuggestionToForceTopHit():null,d&&this._ranker.allowInTopHit(o,d)&&(v=function(t){return n.isEquivalentForPreviewPanePurposes(o,d,t)},y=l.findIndex(v),y!=0&&(p=void 0,y>0?(p=l[y],l.splice(y,1)):p=t.find(v)||r.find(v)||(e.searchTheWeb?[e.searchTheWeb]:[]).find(v),p&&l.unshift(p))),e.protocol&&e.searchTheWeb&&this._ranker.allowInTopHit(o,e.protocol)&&n.tryRemove(l,e.searchTheWeb),e.searchTheWeb&&(it=l.indexOf(e.searchTheWeb),it>=0&&l.some(function(n){return n!=e.searchTheWeb&&i(n,o)})&&l.splice(it,1)),l.length==0&&(n.config.stickyTopResultsV2&&t.length>0?l.push.apply(l,t):e.protocol&&this._ranker.allowInTopHit(o,e.protocol)?l.push(e.protocol):e.searchTheWeb&&this._ranker.allowInTopHit(o,e.searchTheWeb)?l.push(e.searchTheWeb):e.recourse&&this._ranker.allowInTopHit(o,e.recourse)&&l.push(e.recourse)),g=n.getEffectiveScope(o)==n.Scope.Emails?n.config.maxNumberOfEmailsInTopResult:Math.max(n.config.maxNumberOfTopResults,f(l)?2:0,t.length),n.config.bypassFallbackOnMSBTopHit==4&&l.length>0&&n.isMsbOnlineSuggestionType(l[0].type)&&(g=2),l.length>g&&(l=l.slice(0,g)),n.config.synthWebNoBestMatch&&l.length==1){var ft=[n.GroupType.SearchSuggestions,n.GroupType.Websites],st=r.filter(function(t){return!n.contains(ft,n.getGroupType(t))}),ht=l.filter(function(t){return!n.contains(ft,n.getGroupType(t))});st.length==0&&ht.length==0&&(l=[])}for(et=function(i){var u=t[i];if(!n.contains(l,u)){if(n.config.enableConversationCache&&l.some(function(t){return n.isDuplicate(o,u,t)}))return"continue";u.useRaf&&(u.useRaf=!1);u!=e.searchTheWeb&&r.unshift(u)}},nt=t.length-1;nt>=0;--nt)et(nt);if(l.length==1&&n.safeExecute(function(){return ot.applyAppOverride(l,r)},"applyDeviceInfoOverride"),l.forEach(function(n){return n.suppressed=!1}),rt=n.isL2(o),n.config.stickyTopResultsV2&&l.length==1&&t.length==1&&!rt&&(ut=l[0],w=t[0],ut==w||s(w)||n.config.msbDisableStickyWeb&&n.isWebSuggestion(w)&&n.isMsbOnlineSuggestionType(ut.type)||l.unshift(w)),n.config.stickyTopResultsV2&&t.length==1&&n.config.enableSuperStickySWTopHit){var ct=l.filter(function(n){return n.handoffType==0}),lt=l.filter(function(n){return n.type=="ANAH"}),a=r.filter(function(n){return n.type=="ANAH"}).sort(function(n,t){return t.rankingScore-n.rankingScore});lt.length==0&&a.length>0?l.push(a[0]):e.searchTheWeb&&ct.length==0&&t[0].rankingScore<1&&this._ranker.allowInTopHit(o,e.searchTheWeb)&&l.push(e.searchTheWeb)}return n.config.enableMRUHint&&l.length>0&&this._previousKeystrokeCache&&(b=this._previousKeystrokeCache.getPreviousTopHit(),b&&b.mruHintEnabled&&b.text==l[0].text&&b.type==l[0].type&&(l[0].mruHintEnabled=!0)),n.config.enableCISpeller&&l.length==1&&this._previousKeystrokeCache&&(l[0].type=="PP"||l[0].type=="ST")&&this._previousKeystrokeCache.setPreviousTopHit(rt?null:l[0]),n.config.enableConversationCache&&l.length==2&&n.isDuplicate(o,l[0],l[1])&&l.splice(1,1),n.config.topHitMuse&&l.forEach(function(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},t.prototype.applyAppOverride=function(n,t){var r=["Microsoft.Office.WINWORD.EXE","{6D809377-6AF0-444B-8957-A3773F02200E}\\Windows NT\\Accessories\\wordpad.exe"],u=n[0].deviceItem?n[0].deviceItem.id:null,i;u&&u.startsWith(r[1])&&(i=t.findIndex(function(n){return n.deviceItem&&n.deviceItem.id&&n.deviceItem.id.startsWith(r[0])}),i>=0&&n.splice(0,1,t[i]))},t.prototype.setUseRafFlag=function(t,i,r,u){var f,o,e;if(n.isCortanaEnabledCache&&u==2)for(f=0,o=t;f=0;--v)l.splice(a[v],1);return o.searchTheWeb&&(p=e.indexOf(o.searchTheWeb),p!=-1&&(w=n.removeFirstWhere(l,function(n){return i(n,s)}),w&&(e[p]=w))),y=l.filter(function(t){return n.contains([n.GroupType.SearchSuggestions,n.GroupType.Websites,n.GroupType.LocalPlaces],n.getGroupType(t))}),b=l.filter(n.enforceOriginalOrder),n.config.enableAnaheimRelevance==2&&(y=l.filter(function(t){return n.contains([n.GroupType.Websites,n.GroupType.LocalPlaces],n.getGroupType(t))})),!h&&this.canRenderChildSuggestions(e,c,s)&&this.addChildSuggestions(t,e[0],l),s.queryToFetch&&l.sort(function(n,t){return t.rankingScore-n.rankingScore}),this.insertDefaultSearchTheWeb(s,o,e,r,l,y),l=this.insertSuggestionsToRightPlace(l,b),l=this.insertSuggestionsToRightPlace(l,y),n.config.topHitMuse&&e.forEach(function(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},t.prototype.insertDefaultSearchTheWeb=function(t,r,u,f,e,o){var s,h;r.searchTheWeb&&(t.scope==n.Scope.Web||t.scope==n.Scope.All)&&(s=o.findIndex(function(n){return i(n,t)}),f.some(function(n){return i(n,t)})||u.some(function(n){return i(n,t)})?s!=-1&&(h=o[s],o.splice(s,1),e.splice(e.indexOf(h),1)):s==-1&&(o.unshift(r.searchTheWeb),e.unshift(r.searchTheWeb)))},t.prototype.getGroupOrder=function(t,i,r){var u,o,a,f,v,b,h,y,k,d,g,c,p,s;switch(t.scope){case n.Scope.Web:if(!t.queryToFetch)return[{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}]}u=r.concat(i);u.sort(function(n,t){return t.rankingScore-n.rankingScore});var w=[],l=[],e=[],nt=function(t){if(t.suppressed)l.push(t);else if(w.push(t),n.config.enableStaticGroupRanking){var r=n.getGroupType(t),i={type:r,source:t.sourceForGroup};e.some(function(t){return n.sameGroup(t,i)})||e.push(i)}};for(o=0,a=u;o0&&n.getGroupType(u[0])!=n.GroupType.SearchSuggestions){for(v=[{type:n.GroupType.Apps},{type:n.GroupType.Settings},{type:n.GroupType.Documents,source:1}],n.config.topHitMuse&&(v=[{type:n.GroupType.Apps},{type:n.GroupType.AnaheimDataTopHit},{type:n.GroupType.Settings},{type:n.GroupType.Documents,source:1}]),b=function(t){e.some(function(i){return n.sameGroup(i,t)})&&f.push(t)},h=0,y=v;h0&&Object.keys(n.config.topHitChildGroups).forEach(function(n,f){var e=parseInt(n),o=u.getMaxChildSuggestions(t,i,e),s;o>0&&(s=i.childSuggestions.filter(function(n){return n.groupType==e}).slice(0,o),s.forEach(function(n,t){n.rankingScore=1e4-100*f-t;r.push(n)}))})},t.prototype.getMaxChildSuggestions=function(t,i,r){var u;return i.type==="MBV"?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]},t.prototype.canRenderChildSuggestions=function(t,i){var r,u;if(n.RuntimeConfig.FlatListWithoutGroups||t.length!=1)return!1;if(r=t[0],n.RuntimeConfig.AlwaysWide){var f=r.previewPaneType===1,e=r.handoffType===21,o=r.type==="MPPL"&&!!r.calculateChildSuggestions;if(!f&&!e&&!o)return!1}return i?r.handoffType===21?n.config.msbVerticalEnableChildSuggestions:this._renderedTopResults.topResults.length==1?(u=this._renderedTopResults.topResults[0],u.hasChildSuggestionsDisplayed&&u.query==r.query&&n.getGroupType(u)==n.getGroupType(r)):!1:!0},t.prototype.insertSuggestionsToRightPlace=function(t,i){var r,e,u,f;if(i.length==0)return t;for(r=[],e=i[0],u=0;u=0;t--)i=n[t],r[i.reactKey]?(u=n.splice(t,1),SharedLogHelper.LogError("ensureUniqueReactKeys","Found two suggestions with the same key: "+u[0].reactKey)):r[i.reactKey]=1},t}();t.Aggregator=e})(t=n.Ranking||(n.Ranking={}))}(WSB||(WSB={}));__spreadArrays=this&&this.__spreadArrays||function(){for(var i=0,n=0,r=arguments.length;n>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=f;n.SinglePaneWidth=344;n.PreviewPaneWidth=440;n.DebugWindowWidth=800;n.CobaltPreviewPaneWidth=386;var t,u="aria-selected",e=function(){function f(i){var r=this,e,f;this.lightweightStorage=i;this._performanceWidget=_ge("performanceWidget");this._root=_ge("root");this._windowsTemporaryMessageShown=!1;this._progressBarVisible=!1;this._previewPaneVisible=!1;this._debugWindowVisible=!1;this._suggestionsContainerHeight=0;this._renderingInProgress=!1;this._narratorLaunchHandlers=[];this._viewData={};this._targetElemCache={};e=new MutationObserver(function(n){var t,o,i,f,s,e;if(!r._renderingInProgress){for(t=[],i=0,f=n;iu+i?t.scrollTop=f-i:r0&&t.groups[0].type!=n.GroupType.QuickSearch,u={groups:t.groups,contextMenuHandler:this._contextMenuHandler,clickHandler:this._suggestionClickHandler,openPreviewPaneButton:this.getOpenPreviewPaneButton(),isSearchHome:r,webSuggestionAnnotation:e,deleteMRUButtonCallback:o?function(){return f.deleteMRUButtonCallback()}:null,notifyIconPending:function(t,i){return n.InstrumentationHelper.notifyIconPending(t,i)},notifyIconReadyOrFailed:function(t,i){return n.InstrumentationHelper.notifyIconReadyOrFailed(t,i)}};this.renderReactView("groups",n.View.WindowsGroups,n.config.reactGroups?n.deepCopy(u,["parent"],["deviceItem"]):u)},f.prototype.deleteMRUButtonCallback=function(){sj_evt.fire("clearMRUButtonClicked");n.Host.refreshCurrentPane()},f.prototype.updateFENarratorSuggestionCount=function(t){var i="";this._isFileExplorerOrControlPanel&&t&&(i=n.Host.getLocString("SuggestionCountNarrator",""+t));this.updateNarratorMessageView(i)},f.prototype.updateTopResultsView=function(t){var i,r;this.setQueryBasedCss(t.query);this.setConditionalCss("noSuggestions",t.topResults.length==0&&t.groups.length==0);this._isFileExplorerOrControlPanel&&(i=t.topResults.length,this.updateFENarratorSuggestionCount(i>0?i:null));r={suggestions:t.topResults,contextMenuHandler:this._contextMenuHandler,clickHandler:this._suggestionClickHandler,openPreviewPaneButton:this.getOpenPreviewPaneButton(),isSearchHome:t.query&&t.query.isSearchHomeZI,notifyIconPending:function(t,i){return n.InstrumentationHelper.notifyIconPending(t,i)},notifyIconReadyOrFailed:function(t,i){return n.InstrumentationHelper.notifyIconReadyOrFailed(t,i)}};this.renderReactView("topResults",n.View.WindowsTopResults,n.config.reactGroups?n.deepCopy(r,["parent"],["deviceItem"]):r)},f.prototype.showTemporaryMessage=function(t,i,r,u){var f=this,e;this._windowsTemporaryMessageShown?(this.hideTemporaryMessage(),n.safeSetTimeout(function(){return f.showTemporaryMessage(t)},100,"showTemporaryMessage")):(e={messageText:t,icon:i!==null&&i!==void 0?i:{content:"",type:2},messageClassName:r!==null&&r!==void 0?r:"slideInMessage",clickHandler:function(){f.hideTemporaryMessage();n.Host.setFocusInSearchBox(null,"temporaryMessage")},action:u},this.updateTemporaryMessageView(e),this._windowsTemporaryMessageShown=!0)},f.prototype.hideTemporaryMessage=function(){this._windowsTemporaryMessageShown&&(this.updateTemporaryMessageView(null),this._windowsTemporaryMessageShown=!1)},f.prototype.updateTemporaryMessageView=function(t){this.renderReactView("temporaryMessage",n.View.WindowsMessage,{dataModel:t})},f.prototype.updateDialogBox=function(t){t.isVisible?n.Host.setFocusInWebView("updateDialogBox"):n.Host.setFocusInSearchBox(null,"updateDialogBox: hidden");this.renderReactView("dialogBox",n.View.WindowsDialogBox,{dataModel:t})},f.prototype.updateRewardsFlyout=function(t){this.renderReactView("rewardsFlyoutContainer",n.View.RewardsFlyout,{dataModel:t})},f.prototype.renderAdvancedOptionsMessages=function(t){this.renderReactView("temporaryOption",n.View.AdvancedOptions,n.config.reactGroups?n.deepCopy({advancedOptions:t}):{advancedOptions:t})},f.prototype.updateTopHitHeaderView=function(t){this.renderReactView("topHitHeader",n.View.TopHitHeader,n.config.reactGroups?n.deepCopy({dataModel:t},["parent"]):{dataModel:t})},f.prototype.createFlyout=function(t,i){var r=this;return n.config.enableEducationalFlyout?(this._flyoutController||(this._flyoutController=new n.FlyoutController(this,i),n.Host.bindQueryChangedOrInitialized(function(n){r._flyoutController.onQueryChange(n)})),this._flyoutController.createFlyout(t)):null},f.prototype.renderFlyoutAreaView=function(t){n.shouldShowThreeFingerTap()?t.dismissFlyoutText=n.Host.getLocString("ThreeFingerTapFlyoutButtonDismissMessage"):(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?this._flyout.classList.add("flyoutSinglePane"):this._flyout.classList.remove("flyoutSinglePane");this.renderReactView("flyoutContainer",n.View.Flyout,{dataModel:t});this.showFlyoutAreaView();this.renderReactView("overlayContainer",n.View.Overlay,{dataModel:t});t.overlay&&this.showOverlayAreaView()},f.prototype.showFlyoutAreaView=function(){n.setVisibility(this._flyout,!0);this._flyout.style.animation="none";this._flyout.offsetHeight;this._flyout.style.animation=null},f.prototype.hideFlyoutAreaView=function(){n.setVisibility(this._flyout,!1)},f.prototype.showOverlayAreaView=function(){n.setVisibility(this._flyoutOverlay,!0)},f.prototype.hideOverlayAreaView=function(){n.setVisibility(this._flyoutOverlay,!1)},f.prototype.updateBrandingBarView=function(t){typeof n.View.BrandingBar=="undefined"||typeof n.enableCobaltBranding!="function"||n.enableCobaltBranding()||this.renderReactView("msbBrandingBar",n.View.BrandingBar,{dataModel:t,setToAlignRight:!1})},f.prototype.updateScopesHeaderView=function(t){this.renderReactView("scopesHeader",n.View.ScopesHeader,{dataModel:t})},f.prototype.updateNarratorMessageView=function(t){if(t){var i=_ge("narratorMessageContainer");i.setAttribute("aria-label",t)}this.renderReactView("narratorMessageContainer",n.View.NarratorAnnouncement,{message:t})},f.prototype.updatePreviewErrorMessageView=function(t){this.renderReactView("errorPane",n.View.PreviewErrorMessageContainer,{dataModel:t,icon:{content:"",type:2}})},f.prototype.updatePreviewContainerView=function(t){this.renderReactView("localPane",n.View.WindowsPreviewContainer,{dataModel:t,expanderClickInstrumentation:this._expanderClickInstrumentation,chevronDownIcon:{content:"",type:2}})},f.prototype.updateGoodNewsPreviewContainerView=function(t){this.renderReactView("goodNewsPane",n.View.GoodNewsPreviewContainer,{dataModel:t})},f.prototype.updateMsbPreviewContainerView=function(n){var t=_ge("b_bfb"),i,r;t!=null&&(i=_w.BingAtWork,i&&i.clearMsbContainer&&i.clearMsbContainer(),t.remove());r=_ge("msbPane");n.suggestion?(t=sj_ce("div","b_bfb"),t.classList.add("fbig"),r.appendChild(t),r.classList.add("localPreviewContainer","msbPreviewContainer")):r.classList.remove("localPreviewContainer","msbPreviewContainer")},f.prototype.updateMenuView=function(t){this.renderReactView("menuContainer",n.View.WindowsMenu,{dataModel:t})},f.prototype.updatePopoverView=function(t){this.renderReactView("popoverContainer",n.View.Popover,{dataModel:t})},f.prototype.updateSnipSearchMessageView=function(t){this.renderReactView("messageContainer",n.View.SnipSearchMessage,{dataModel:t})},f.prototype.setProgressIndicatorVisibility=function(t){this._progressBarVisible!=t&&(this._progressBar||(this._progressBar=_ge("b_progress")),n.setVisibility(this._progressBar,t),this._progressBarVisible=t)},f.prototype.setPreviewPaneVisibility=function(t){this._previewPaneVisible!=t&&(t||this.closeSidePanel(1),n.setVisibility(this._previewPane,t),t&&this.openSidePanel(1),this._previewPaneVisible=t)},f.prototype.toggleDebugWindowVisibility=function(){return this.setDebugWindowVisibility(!this._debugWindowVisible),this._debugWindowVisible},f.prototype.updateOptionsWindowView=function(t){this.renderReactView("optionsContainer",n.View.OptionsWindow,{dataModel:t})},f.prototype.updateDynamicSearchView=function(t){this.renderReactView("dynamic-pane",n.View.DSB.DynamicSearchBox,{dataModel:t})},f.prototype.setDebugWindowVisibility=function(t){n.setVisibility(this._debugWindow,t);n.RuntimeConfig.AlwaysWide?this.setConditionalCss("debugWindowOpen",t):t?this.openSidePanel(2):this.closeSidePanel(2);this._debugWindowVisible=t},f.prototype.applyAccentColor=function(){var u=n.Host.getAccentColor(),o,e,f,t;this._lastAccentColor!=u&&(e="accent-style",f=_ge(e),f||(f=_d.createElement("style"),f.setAttribute("id",e),f.type="text/css",o=!0),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,o&&_d.head.appendChild(f),this._lastAccentColor=u)},f.prototype.adjustHeightAsync=function(){n.safeSetTimeout(function(){return n.Host.adjustHeight()},0,"adjustHeightAsync")},f.prototype.bindOnNarratorLaunch=function(n){this._narratorLaunchHandlers.push(n)},f.prototype.render=function(t){var i=this;this._renderingTimer&&sb_ct(this._renderingTimer);this._renderingInProgress=!0;try{n.View.ViewData=this.getViewData();t()}finally{this._renderingTimer=n.safeSetTimeout(function(){i._renderingTimer=null;i._renderingInProgress=!1},0,"BasePage render")}},f.prototype.renderReactView=function(t,i,r){var e=this,u,f;n!==undefined&&n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().beginMark("React Render - "+t);u=this._targetElemCache[t];u||(this._targetElemCache[t]=u=_ge(t));f=r;f.adjustHeight||(f.adjustHeight=function(){return e.adjustHeightAsync()});this.render(function(){return _w.ReactDOM.render(React.createElement(i,r),u)},t);n!==undefined&&n.config.perfLogging&&n.WSBPerformance&&n.WSBPerformance.getInstance().endMark("React Render - "+t)},f.prototype.addViewData=function(n,t){this._viewData[n]=t},f.prototype.getViewData=function(){return this._viewData},f}();n.Page=e}(WSB||(WSB={})),function(n){var t=54e5,i=function(){function i(i){var r=this;this._appCacheInstrumentationHelper=i;this._isReloadSuppressed=!1;this._pendingReload=!1;i.registerSuperFresh();n.Host.hasFallbackHappened()&&(this._isReloadSuppressed=!0,this._lastReloadAfterFallback=n.getCurrentTime());n.Host.bindAppHidden(function(){(r._isReloadSuppressed=r._lastReloadAfterFallback&&n.getCurrentTime()-r._lastReloadAfterFallback=n.config.reloadAfterConversations&&(r._pendingReload=!0),r._pendingReload&&(r.logReloadAttempt(),r.reload()))});sj_be(applicationCache,"updateready",function(){return r.onUpdateReady()});n.Host.bindConversationStart(function(){r._isReloadSuppressed=!0;r.shouldCheckForUpdate()&&n.contains([1,4,5],applicationCache.status)&&n.safeExecute(function(){return applicationCache.update()},"probe for manifest update: "+applicationCache.status)})}return i.prototype.shouldCheckForUpdate=function(){if(!n.isBingEnabled())return!1;return(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.disableAppCache)?!1:!0},i.prototype.onUpdateReady=function(){this.logReloadAttempt();this._isReloadSuppressed?this._pendingReload=!0:this.reload()},i.prototype.reload=function(){n.Host.reloadWebView()},i.prototype.logReloadAttempt=function(){this._appCacheInstrumentationHelper.instrumentSuperFreshUpdate(this._isReloadSuppressed)},i}();n.SuperFreshAppCache=i}(WSB||(WSB={})),function(n){var t,i;(function(t){function u(t,i,r,u,f,e,o,s){var h,v;o===void 0&&(o=1);var y=Date.now(),a=(new Error).stack,c,l=function(n){n.stack&&(a=n.stack+"\n"+a);n.stack=a;c&&f.unregister(c);switch(o){case 1:SharedLogHelper.LogError(t,e,s||n);break;case 2:SharedLogHelper.LogWarning(t,e,s||n)}u&&u(n)};try{h=i();h?(f&&h.cancel&&(c=f.register(function(){return h.cancel()},!1,t+" cancellation")),v=function(i){var u=Date.now()-y;n.InstrumentationHelper.instrumentAggregateFunctionPerf(t,u);c&&f.unregister(c);r&&n.safeExecute(function(){return r(i)},t+" safeChain() completion")},h.done?h.done(v,l):h.then(v,l)):l(new Error("No promise returned"))}catch(p){l(p)}}function r(t,i,r,u){i.completed=!0;i.result=r;i.pendingCallbacks.forEach(function(t){return n.safeExecute(function(){return t(r)},u)});i.pendingCallbacks=null}function f(){i={}}function e(){var n=[];for(var t in i)i[t].completed||n.push(t);n.forEach(function(n){return delete i[n]})}function o(u,f,e,o,s,h,c,l,a){return a===void 0&&(a=1),function(v,y){var w=e(v),p=i[w],b;p||(p={started:!1,completed:!1,result:null,pendingCallbacks:[]},i[w]=p);p.completed?y(p.result):(p.pendingCallbacks.push(y),p.started||(p.started=!0,b=function(){t.safeChain(u,function(){return f(v)},function(n){h&&!h(n)&&delete i[w];r(w,p,o?o(n):n,u)},function(t){n.isCancellation(t)?r(w,p,null,u):l?(l-=1,b()):r(w,p,s,u)},null,c,a)},b()))}}t.safeChain=u;var i={};t.clearGlobalCache=f;t.clearPendingItemsFromCache=e;t.safeChainWithGlobalCaching=o})(t=n.Async||(n.Async={})),function(n){function t(n,t,i){for(var u,f,e={},r=0,o=n;r0?u.reselectParentItem():u.dismiss(!0))})}return r.prototype.showSubMenu=function(t){if(!t.isExpanded){this._selectedItem&&this.select(null,!1);var 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())}},r.prototype.dismissSubMenu=function(t){var u,f,i,e,r;if(this._selectedItem&&this.select(null,!1),t){if(i=this._menuStack.indexOf(t),i<0)return;for(e=this._menuStack.slice(i),r=0;r .contextMenu");f.focus();f.scrollTop=0;n.Host.setFocusInWebView(s)},0,s)}},r.prototype.innerShowContextMenu=function(n,t,i,r,u,f){this.dismiss();var e=this.getContextMenuItems(n,r);e&&e.length>0&&(this._menuItems=e,this._onDismiss=u,this._menuType=0,this._inputType=f,t-=this._root.offsetLeft,i-=this._root.offsetTop,this.showMenu(t,i))},r.prototype.showDropdownMenu=function(t,i,r,u,f){if(this.dismiss(),this._parentElement=i,this._inputType=f,t&&t.length>0){this._menuItems=t;this._onDismiss=u;this._menuType=r;var e=i.offsetLeft,o=i.offsetTop+i.offsetHeight+1;n.isRtl()&&(e+=i.offsetWidth);this.showMenu(e,o)}},r.prototype.showContextMenuOnElement=function(n,t,i,r,u){var f=t.getBoundingClientRect(),e,o;this._inputType=r;e=f.left+t.offsetWidth/2;o=f.top+this._page.getScrollTop()+t.offsetHeight/2;this.showContextMenuOnXY(n,e,o,i,this._inputType,u)},r.prototype.showContextMenuOnXY=function(t,i,r,u,f,e){var s=this,o,h;this._parentElement=null;this._inputType=f;e&&(o=t.childSuggestions.filter(function(n){return n.text===e.text}),o&&o.length&&(t=o[0]));h=n.getVerbsAsync("showContextMenu",t,n.config.rawVerbs,!1,function(e){return n.safeSetTimeout(function(){return s.innerShowContextMenu(n.extendVerbs(e,t,s._page),i,r,function(i,r,u,f){n.InstrumentationHelper.instrumentItemClickForContextMenu(r,t.instItem,t.sequenceNumber,t.instrumentPingBack,u,f,i)},u,f)},0,"showContextMenu handler")},function(){return!0});e||h||(this._page.hideTemporaryMessage(),n.Host.setFocusInSearchBox(null,"noContextMenu"))},r.prototype.getSelectableItems=function(){var n,t;return this._menuItems?(n=[],this._menuStack.length>0?(t=this._menuStack[this._menuStack.length-1],n=t.subItems):n=this._menuItems,n.map(function(n){return n.groupItems?n.groupItems:[n]}).reduce(function(n,t){return n.push.apply(n,t),n},[]).filter(function(n){return n.isSelectable})):[]},r.prototype.getSelectableItemsByGroup=function(){return[]},r.prototype.getSelectedItem=function(){return this._selectedItem},r.prototype.getDataModel=function(){return{items:this._menuItems,showIcons:this._showIcons,clickHandler:this._itemClickHandler,menuType:this._menuType,enterHandler:this._itemEnterHandler,leaveHandler:this._itemLeaveHandler,expandIcon:this.getExpandIcon(),inputType:this._inputType}},r.prototype.getExpandIcon=function(){return{content:n.isRtl()?"":"",type:2}},r.prototype.select=function(n){var t;this._selectedItem&&(t=_ge(this._selectedItem.id),t&&t.blur(),this._selectedItem.selected=!1);this._selectedItem=n;this._selectedItem&&(t=_ge(this._selectedItem.id),t&&t.focus(),this._selectedItem.selected=!0);n&&this.stickParent(n);this._page.updateMenuView(this.getDataModel())},r.prototype.stickParent=function(n){var u=this.getParent(n),f,t,r,i;for(u&&(u.isSticky=!0),f=this.getSiblings(n),t=0,r=f;t=0})},r.prototype.getParent=function(n){for(var r,t=0,i=this._menuStack;t0)return this.reselectParentItem(),!0}else if(n.isUpOrDownKey(t)&&this._selectedItem)return e=this._menuStack.length==0?_qs(".contextMenu"):_ge(this._menuStack[this._menuStack.length-1].id).querySelector(".contextMenu"),e&&this._page.scrollToElement(_ge(this._selectedItem.id),e,e.offsetHeight),!0;return t==13},r.prototype.isMenuVisible=function(){return!!this._menuItems},r.prototype.dismiss=function(t){if(this._menuItems&&(this._menuItems=null,this._selectedItem&&(this._selectedItem.selected=!1,this._selectedItem=null),this._page.updateMenuView(this.getDataModel()),this._menuContainer.classList.remove(i),this._menuContainer.style.width=null,n.setVisibility(this._menuContainer,!1),n.RuntimeConfig.PanelCanResize&&(this._root.style.minHeight="",this.adjustHeight()),this._menuStack=[]),t&&this._parentElement&&this._parentElement.focus(),this._parentElement=null,this._inputType=null,this._onDismiss){var r=this._onDismiss;this._onDismiss=null;r()}},r.prototype.adjustSubMenuPosition=function(i,r){var h,y,d,o;if(this._menuItems){var f=this._menuContainer,p=f.offsetWidth,w=r.offsetHeight,s=r.offsetWidth,b=0,e=window.getComputedStyle(r).paddingTop;e.endsWith("px")&&(e=e.substr(0,e.length-2),b=+e+1);var l=0,k=_qs("#menuContainer .contextMenu").scrollTop,a=n.isRtl(),v=6;for(h=0,y=this._menuStack;hg?t:this._root.offsetWidth-s-t:u+=p-2;c+w>this._root.offsetHeight&&(c=Math.max(this._root.offsetHeight-w,this._root.offsetTop));u-=f.offsetLeft+l;c-=f.offsetTop;r.style.left=u+"px";r.style.top=c+"px";r.style.zIndex=v.toString()}},r.prototype.adjustPosition=function(i,r,u){var e,s;if(this._menuItems){var o=this._menuContainer,f=o.offsetWidth,h=o.offsetHeight;f>this._root.offsetWidth&&(f=this._root.offsetWidth,o.style.width=f+"px");e=i;s=r;n.isRtl()?(e-=f,e<0&&(e=u?t:i)):e+f>this._root.offsetWidth&&(e=u?this._root.offsetWidth-f-t:Math.max(i-f,this._root.offsetLeft));!u&&s+h>this._root.offsetHeight&&(s=Math.max(this._root.offsetHeight-h,this._root.offsetTop));o.style.left=e+"px";o.style.top=s+"px";n.RuntimeConfig.PanelCanResize&&(this._root.style.minHeight=s+h+"px",this.adjustHeight())}},r.prototype.getContextMenuItems=function(t,i){var r=this;return t.map(function(t,u){var f={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 f.isSeparator?f.id="Separator"+u:f.click=function(u,f){i(t.verb,u,f,null);t.executeSync?(n.safeExecute(function(){return t.executeSync()},"verb.executeSync",null,t.verb),r.dismiss()):n.Async.safeChain("verb.executeAsync",function(){return t.executeAsync()},function(){return r.dismiss()},null,null,t.verb)},f})},r}();n.MenuFactory=r}(WSB||(WSB={})),function(n){var t="ConnectedAccounts",i=function(){function i(t){this._storage=t;this._accountsCache={};(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.clearSSOCache)&&this.clear();this.init()}return i.prototype.setToken=function(n,t){this.setTokenInfo(t,n);this.writeToLocalStorage()},i.prototype.findAccount=function(n,t){var i=this._accountsCache[n];return i&&!this.isExpired(i.LastUpdated,t,i.ExpireDateTime)?i:null},i.prototype.clear=function(){this._accountsCache={};this.writeToLocalStorage()},i.prototype.init=function(){this._accountsCache={};var i=this._storage.getItem(t);i&&(this._accountsCache=n.safeExecute(function(){return JSON.parse(i)},"parseConnectedAccountString",{}))},i.prototype.writeToLocalStorage=function(){this._storage.setItem(t,JSON.stringify(this._accountsCache))},i.prototype.isExpired=function(t,i,r){var u,e,f;return i===undefined?!1:(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.forceTokenRefresh)?!0:(u=n.getCurrentTime(),r&&u>r)?!0:(e=6e4,f=Math.floor((u-t)/e),f<0||f>=i)},i.prototype.setTokenInfo=function(t,i){var 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};this._accountsCache[t]=r},i}();n.TokenStore=i}(WSB||(WSB={})),function(n){var i="SelectedAuthAccountId",t="consumers",r="organizations",f=60,u="72f988bf-86f1-41af-91ab-2d7cd011db47",e=function(){function e(n,t){var i=this;this._storage=n;this._tokenStore=t;this._pendingCallbacks={};this._availableMsaAccounts=[];this._availableAadAccounts=[];this._accessTokenAvailableHandlers=[];this._verifyAccountRequired=[];this._accountTypeChangedHandlers=[];this._selectedAccountChangedHandlers=[];SearchAppWrapper.CortanaApp.addEventListener("experiencelaunched",function(){SearchAppWrapper.CortanaApp.experienceId=="NotebookOffline"&&i._tokenStore.clear()})}return e.getWindowsAccountType=function(){return e._windowsAccountType},e.internalSetWindowsAccountType=function(n){e._windowsAccountType=n},e.getWindowsIdentity=function(){return e._windowsIdentity},e.internalSetWindowsIdentity=function(n){e._windowsIdentity=n},e.prototype.authTypeMatchesWindowsAccountType=function(n){var t=e.getWindowsAccountType();return t==4||(n==0?t==2:t==1)},e.prototype.setWindowsAccountType=function(t){var i=e.getWindowsAccountType();e.internalSetWindowsAccountType(t);this.authTypeMatchesWindowsAccountType(1)&&n.isCloudSearchEnabledAadCache||(n.isMsftAccountConnected=!1);t!=i&&this.fireAccountTypeChanged()},e.prototype.getAllSyncingAccounts=function(n,t,i,r,u){var c=SearchAppWrapper.CortanaApp.fileExplorerSuggestionPage.registeredSyncRootInfo,o=[],l,e,s,h,f;for(l in c)f=c[l],typeof f=="string"&&f.includes("@")&&o.push(f);for(o.length==0&&u([]),e={responses:0,accounts:[]},s=0,h=o;s0){if(r&&(n=t.filter(function(n){return n.accountId==r})[0],n))return this.cacheAccount(n),n;n||(n=t.filter(function(n){return n.isDefaultAccount})[0]);n||(n=t[0]);n&&this.setSelectedAccount(n)}return n},e.prototype.setSelectedAccount=function(n){if(this.cacheAccount(n),e.getWindowsAccountType()!=4){var r=this._storage.getItem(i),u=n.accountProviderAuthority==t?2:1;if(r==n.accountId)return;this.setWindowsAccountType(u);this.connectAccounts([n]);this._storage.setItem(i,n.accountId);this.fireSelectedAccountChanged(n)}this._storage.setItem(i,n.accountId)},e.prototype.isMsaAvailable=function(){return this._availableMsaAccounts.length>0},e.prototype.isAadAvailable=function(){return this._availableAadAccounts.length>0},e.prototype.cacheAccount=function(n){n.accountProviderAuthority==t?this._cachedMSA=n:this._cachedAAD=n},e.prototype.cacheAllAccounts=function(n){var i,u,r;for(this._availableMsaAccounts=[],this._availableAadAccounts=[],i=0,u=n;i0&&(o=s.find(function(n){return n.accountUserName.toLocaleLowerCase()==r.toLocaleLowerCase()}));o?(h=t?n.getSubstrateResourceOrScope(i):n.getBingResourceOrScope(i),this.getAccount(i,h,u,f,e,o)):e(null)},e.prototype.getAccount=function(n,t,i,r,u,f){var o=this,s,e;if(!t)throw new Error("Resource or Scope has to be set");if(s=function(n){var t=o._pendingCallbacks[e];o._pendingCallbacks[e]=null;t.forEach(function(t){return t(n)})},!this.authTypeMatchesWindowsAccountType(n)){u(null);return}if(f||(f=this.getCachedAccountInfo(n)),e=t+i+r+(f?f.accountId:""),this._pendingCallbacks[e]){this._pendingCallbacks[e].push(u);return}this._pendingCallbacks[e]=[u];this.authenticate(n,t,i,r,s,f)},e.prototype.authenticate=function(t,i,r,e,o,s){var v=this,a=t+"."+i+(s?"|"+s.accountId:""),h,c,y,p;if(e){var w=r?0:f,b=n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.noAuthCache,l=b?null:this._tokenStore.findAccount(a,w);if(l){t==1&&(n.isMsftAccountConnected=l.RoutingHint&&l.RoutingHint.indexOf(u)>-1);o(l);return}}h=function(){return o(null)};n.isBrowserOnline()?(c=SearchAppWrapper.CortanaApp.authenticationManager.createAuthenticateRequest(),c.accountType="Windows",c.silentMode=e,t==1?c.resource=i:c.scope=i,y=s&&SearchAppWrapper.CortanaApp.authenticationManager.authenticateSearchWebAccountAsync,p=y?function(){return SearchAppWrapper.CortanaApp.authenticationManager.authenticateSearchWebAccountAsync(c,s)}:function(){return SearchAppWrapper.CortanaApp.authenticationManager.authenticateAsync(c)},n.Async.safeChain("authenticateAsyncWAM",p,function(i){var r,f,s,c,l;if(n.TestHookUrlParameters)if(e){if(n.TestHookUrlParameters.ssoAuthFail){h();return}}else if(n.TestHookUrlParameters.uxAuthFail){h();return}if(!i){n.log("WAM returned null");h();return}if(i.token){if(r=i.properties,f=r.UPN||i.userName,!f){n.log("WAM didn't return UPN");h();return}s=void 0;t==0?s="MSA:"+f:(c=r.tid,n.isMsftAccountConnected=c==u,c&&r.OID&&(s="OID:"+r.OID+"@"+c));l={Token:i.token,ExpireDateTime:r.exp?parseInt(r.exp)*1e3-3e5:null,TenantName:r.tenant_display_name||"",RoutingHint:s||f,UserName:f};t==0&&(l.ExpireDateTime=n.getCurrentTime()+n.HourToMs);v._tokenStore.setToken(l,a);o(v._tokenStore.findAccount(a))}else i.errorCode||i.errorMessage?n.log("WAM error "+i.errorCode+": "+i.errorMessage):n.log("WAM returned an empty token"),h()},h)):h()},e.prototype.bindAccessTokenAvailable=function(n){this._accessTokenAvailableHandlers.push(n)},e.prototype.bindVerifyAccountRequired=function(n){this._verifyAccountRequired.push(n)},e.prototype.bindAccountTypesChanged=function(n){this._accountTypeChangedHandlers.push(n)},e.prototype.bindSelectedAccountChanged=function(n){this._selectedAccountChangedHandlers.push(n)},e.prototype.fireAccountTypeChanged=function(){this._accountTypeChangedHandlers.forEach(function(n){return n()})},e.prototype.fireSelectedAccountChanged=function(n){this._selectedAccountChangedHandlers.forEach(function(t){return t(n)})},e.prototype.tryConnect=function(t,i){var u=this,f=t==1?n.isSubstrateO365AccountConnected:n.isSubstrateOutlookAccountConnected,r;f||(r=n.getSubstrateResourceOrScope(t),this.getAccount(t,r,!1,!0,function(i){var f=!!i;t==1?n.isSubstrateO365AccountConnected=f:n.isSubstrateOutlookAccountConnected=f;f?u._accessTokenAvailableHandlers.forEach(function(i){return n.safeExecute(function(){return i(t,r)},"accessTokenAvailable",null,""+t)}):u._verifyAccountRequired.forEach(function(i){return n.safeExecute(function(){return i(t,r)},"accessTokenAvailable",null,""+t)})},i))},e.prototype.updateWindowsAccountType=function(i){for(var h,r,o,f=!1,u=!1,e=0,s=i;e0&&(h=Math.max(u._availableMsaAccounts.findIndex(function(n){return n.isDefaultAccount}),0),o.push(u._availableMsaAccounts[h])),u._availableAadAccounts.length>0&&(h=Math.max(u._availableAadAccounts.findIndex(function(n){return n.isDefaultAccount}),0),o.push(u._availableAadAccounts[h])),!n.config.userProfileButtonEnabled)for(c=0,a=o;c30)this.createCohortProfile();else{for(f=[],n=0;n<30;n++)f.push({date:this._cohortProfile[n].date,count:this._cohortProfile[n].count});for(n=i;n<30;n++)this._cohortProfile[n-i]=f[n];for(n=0,r=30-i;n30)return-1;for(i=0,t=30-n;t<30;t++)i+=this._cohortProfile[t].count;return i},f.prototype.isWWEVisible=function(){if(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.showWWE)return n.config.enableWWENewUsers&&this._lightweightStorage.getItem("wweTourRefreshed")!="1";var t=SearchAppWrapper.CortanaApp,r=t.entryPoint=="19h1wwe"||t.entryPoint=="19h2wwe",u=n.config.enableWWEUpsell&&r,i=n.config.enableWWENewUsers&&this.isWSBNewUser()&&this._lightweightStorage.getItem("wweTourTook")!="1";return this.isWSBNewUser()&&this._lightweightStorage.getItem("newUsersLogged")!="1"&&(n.InstrumentationHelper.logClientInstEvent("Select","newUsers",null),this._lightweightStorage.setItem("newUsersLogged","1")),i&&this._lightweightStorage.getItem("newUsersEnabledLogged")!="1"&&(n.InstrumentationHelper.logClientInstEvent("Select","newUsersEnabled",null),this._lightweightStorage.setItem("newUsersEnabledLogged","1")),(u||i)&&this._lightweightStorage.getItem("wweTourRefreshed")!="1"},f.prototype.isWWEVisibleSinglePane=function(){return this.isWWEVisible()&&!n.RuntimeConfig.AlwaysWide},f.prototype.isTourVisible=function(){var t=new n.LightweightStorage;return t.getItem("wweTourEnabled")=="1"},f.prototype.resetCohortProfileManager=function(){f._singleton=null;this._cohortProfile=[];this._WSBFirstOpenedDate=null},f.prototype.resetWSBFirstOpenedDate=function(){this._WSBFirstOpenedDate=null},f}();n.CohortProfileManager=f}(WSB||(WSB={})),function(n){var t;(function(t){function v(){n.Host.bindAppHidden(function(){SearchAppWrapper.CortanaApp.isBingEnabled&&n.isBrowserOnline()&&n.safeExecute(function(){return ut("asgw",["fp.msedge.net/conf/v1/asgw/fpconfig.min.json"],2e3)},"AFDFootprint.start",null,null)})}function ut(n,t,i){var o;if(n&&n.trim().length!==0&&Number(i)===i&&i%1==0&&!(i<0)){var e=h,v=rt,y=a(),p=f(),s="MonitorID="+n+"&rid="+p+"&w3c="+y+"&prot="+window.location.protocol+"&v="+v+"&DATA=";if(r)l(e,s,i);else{for(o in t)t[o]=e+t[o];u(t,0,c,e,s,i)}}}function l(n,t,i){var o=ft(r,n),s,f,u,e,h;if(o.length!==0){for(s=et(o,n,w),f=[],u=0,e=r.r;u0&&(e<=r.m&&r.m<=y&&r.m&k||r.m===i)&&(c+=r.w,f.push({endpoint:r.e,cumWeight:c,weight:r.w,measurementType:r.m}));for(v=Math.min(n.n,f.length);o.length0){var r=nt/(n/tt);return Math.round(r)}return Math.round(n)}function f(){function n(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return n()+n()+n()+n()+n()+n()+n()+n()}function a(){return window.performance&&window.performance.getEntriesByName?!0:!1}function ht(n,t,i,r){function l(i){var k,p,g,w,nt,d,b,tt;if(f!=null&&clearTimeout(f),s[i]=h!=null?(new Date).getTime()-h:o,i=(v+y)%n.length,e=new Image,v++v-this.flyoutMaxHeight,i=p?"Top":"Bottom");l=u.top+u.height/2;s=r?r.getBoundingClientRect().top:0;switch(i){case"Top":w=v-u.top+this.slackSize;break;case"Bottom":o=u.bottom+this.slackSize-s;break;case"Left":o=Math.max(Math.min(l-e/2-s,y-e),4);break;default:return null}switch(i){case"Top":case"Bottom":a=u.left+u.width/2;h=Math.max(Math.min(a-f/2,y-f),this.slackSize);c=Math.max(Math.min(a-h-this.slackSize,f-this.slackSize),this.slackSize);break;case"Left":k=r?r.getBoundingClientRect().right:0;b=k-u.left+this.slackSize;c=Math.max(Math.min(l-o-s-this.slackSize,e-this.slackSize),this.slackSize)}return{position:i,top:o,bottom:w,left:h,right:b,beakOffset:c}},t.prototype.target=function(n,t){if(!n)return this;var 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},t.prototype.setSticky=function(){return this.sticky=!0,this},t.prototype.isSticky=function(){return this.sticky},t.prototype.show=function(){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},t.prototype.dismissible=function(n,t){return this.dismissIntervalMs=n,this.dismissMessage=t,this},t.prototype.repeat=function(n){return this.repeatMax=n,this},t.prototype.dataModel=function(){var t=this;if(!this.isValid())return null;var n=this.steps[this.currentStep],i=n.message,r=n.title;return{title:r,message:i,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:function(){return t.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:function(i,r){t.buttonClickHandler(i,r);t._controller.instrumentClientEvent("FlyoutSubmit",{id:t.stepHasProperty("id")?n.id:t.id})},showButtonMessage:this.showButtonMessage,buttonMessage:this.buttonMessage,buttonIcon:this.buttonIcon,dismissMessage:this.dismissMessage,dismissClickHandler:function(){t.dismiss();t._controller.instrumentClientEvent("FlyoutDismiss",{id:t.stepHasProperty("id")?n.id:t.id})},id:this.stepHasProperty("id")?n.id:this.id,overlay:this._overlay,isLinkText:this._isLinkText}},t.prototype.setClass=function(n){return this.flyoutClass=n,this},t.prototype.isValid=function(){return this.steps.length>0&&(!isNaN(this.left)||!isNaN(this.right))&&(!isNaN(this.top)||!isNaN(this.bottom))},t.prototype.dismiss=function(){return this._controller.dismissFlyout(this.id),this},t.prototype.shouldBeShown=function(){var t=this._controller.getLastTimeShown(this.id),i=this._controller.getTimesShown(this.id);return(t==0||t+this.dismissIntervalMs<=n.getCurrentTime())&&i0&&(u=this.getSelectedItem(),r=i.indexOf(u),r+=t==39?1:-1,r<0?this.select(i[i.length-1],!1):this.select(i[r%i.length],!1)),!0):t==13},u.prototype.onItemClick=function(n,t){t.button==0&&this.submit(n)},u.prototype.onMouseLeavesParent=function(){this.waitForEnterBeforeDismiss()},u.prototype.waitForEnterBeforeDismiss=function(){var t=this;this.clearDismissTimer();this._dismissTimer=n.safeSetTimeout(function(){t._dismissTimer=null;!t._parentElement||t._parentElement.matches(":hover")||t._popoverContainer.matches(":hover")||t.dismiss()},100,"waitForDismiss")},u.prototype.clearDismissTimer=function(){this._dismissTimer&&(sb_ct(this._dismissTimer),this._dismissTimer=null)},u.prototype.getDataModel=function(n){var t=this;return{text:this._text,items:this._buttons,clickHandler:function(n,i){return t.onItemClick(n,i)},className:this._className,isSideBeak:n}},u.prototype.showPopoverAtSide=function(n,r){var e,s,h;if(this._text){var u=this._popoverContainer,f=u.offsetWidth+1,o=this._root.offsetWidth-2*i;f>o&&(f=o);e=n;s=r-t;e+=t*2;u.style.width=f+"px";u.style.left=e+"px";u.style.top=s+"px";h=_qs(".popover .beak.sidebeak",this._popoverContainer);h.style.top=t*4+"px";this._finishedOpening=!0}},u.prototype.showPopoverAtTop=function(n,r){var f,o,h;if(this._text){var e=this._popoverContainer,u=e.offsetWidth+1,s=this._root.offsetWidth-2*i;u>s&&(u=s);f=0;o=this._root.offsetHeight-r;n-=u/2;o+=t;nthis._root.offsetWidth-i&&(f=this._root.offsetWidth-i-(n+u));e.style.width=u+"px";e.style.left=n+f+"px";e.style.bottom=o+"px";fu/2-t&&(f=u/2-t);h=_qs(".popover .beak",this._popoverContainer);h.style.left="calc(50% - "+f+"px";this._finishedOpening=!0}},u.prototype.showPopoverAt=function(t,i,u,f){var e=this,s,o;n.setVisibility(this._popoverContainer,!0);s=this.getDataModel(f);this._page.updatePopoverView(s);o="renderPopover";n.safeSetTimeout(function(){if(f?e.showPopoverAtSide(t,i):e.showPopoverAtTop(t,i),e._popoverContainer.classList.add(r),u&&e._buttons&&e._buttons.length!=0)e.select(e.getSelectableItems()[0],!1,f);else{var s=e._popoverContainer.firstElementChild;s.focus()}n.Host.setFocusInWebView(o)},0,o)},u}();n.PopoverFactory=u}(WSB||(WSB={})),function(n){function e(n,t){return n<>>32-t}function t(n,t){var i=(n&65535)+(t&65535),r=(n>>16)+(t>>16)+(i>>16);return r<<16|i&65535}function h(n,t,i){return n&t|~n&i}function c(n,t,i){return n&i|t&~i}function l(n,t,i){return n^t^i}function a(n,t,i){return t^(n|~i)}function i(n,i,r,u,f,o,s){return n=t(n,t(t(h(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(c(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(l(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(a(i,r,u),f),s)),t(e(n,o),i)}function v(n){var i=[],r=n.length*8,t;for(i[(n.length>>2)-1]=undefined,t=0;t>5]|=(n.charCodeAt(t/8)&255)<>5]|=128<>>9<<4)+14]=r,i}function o(n){for(var u,t="",i="",r=0;r<=3;r++)u=n>>>r*8&255,i="0"+u.toString(16),t=t+i.substr(i.length-2,2);return t}function y(n){var ht,ct,lt,at,e=1732584193,s=4023233417,h=2562383102,c=271733878,y=7,p=12,w=17,b=22,k=5,d=9,g=14,nt=20,tt=4,it=11,rt=16,ut=23,ft=6,et=10,ot=15,st=21,a,l;for(n=unescape(encodeURIComponent(n)),a=v(n),l=0;l="a"&&r<="f"))return null;for(i+=0,u="",t=0;t<11;t++){var f=i[t*3],e=i[t*3+1],o=i[t*3+2],s=((f>="a"?f.charCodeAt(0)-"a".charCodeAt(0)+10:f.charCodeAt(0)-"0".charCodeAt(0))<<8)+((e>="a"?e.charCodeAt(0)-"a".charCodeAt(0)+10:e.charCodeAt(0)-"0".charCodeAt(0))<<4)+(o>="a"?o.charCodeAt(0)-"a".charCodeAt(0)+10:o.charCodeAt(0)-"0".charCodeAt(0));u=w(u,s)}return u}function w(n,t){return n.concat(s[Math.floor(t/64)]).concat(s[t%64])}var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";n.generateKeyFromDomain=p}(WSB||(WSB={}))