var __extends,AutoSuggest;(function(n){var t;(function(t){function e(){return new u}function r(){if(i.hostingEnvironment==4)return 7;if(!n.isMiniSerpEnabled())return 0;var r=7;return t.config.allowAnswersToAutoOpenMiniSerp||(r&=-2),t.config.allowDNavToAutoOpenMiniSerp||(r&=-3),t.config.allowWebToAutoOpenMiniSerp||(r&=-5),r}var f=["::{679F85CB-0220-4080-B29B-5540CC05AAB6}","::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"],i=SearchAppWrapper.CortanaApp,u=function(){function u(){this.QfMode=0;this.AlwaysWide=!1;this.SearchBoxOnTop=!1;this.AllowKeyboardNavCycling=!0;this.AllowKeyboardNavOffCanvas=!1;this.FlatListWithoutGroups=!1;this.MaxSuggestionsWhenFlatList=0;this.PreviewPaneAvailable=!1;this.MiniSERPMode=0;this.SearchHomeAvailable=undefined;this.ScopesAvailable=!1;this.FirstSuggestionSelectedByDefault=!0;this.PanelCanResize=!1;this.AllowProtocolSyntheticSuggestions=!0;this.CortanaVersion="";this.HostName=""}return u.prototype.OnAppVisible=function(u){var h,o,s,e;t.isFileExplorerCurrentPathThisPcOrQuickAccess=!1;h=i.textScaleFactor>1.25;try{o=i.isWideSearch}catch(c){}s=o!==!1&&!!u.getFeatureDWORD("WideAtStartupDelta").featureValue;i.hostingEnvironment==3||t.config.forceSettingsAppExperience?(this.PreviewPaneAvailable=!1,this.MiniSERPMode=0,i.hostingEnvironment==3?(e=n.safeExecute(function(){return i.fileExplorerSuggestionPage.currentLocation},"fileExplorerSuggestionPage.currentLocation"),e&&!e.startsWith("::")?this.QfMode=5:t.config.wsbInControlPanel&&e&&e.startsWith("::{26EE0668-A00A-44D7-9371-BEB064C98683}")?this.QfMode=9:n.contains(f,e)?(t.isFileExplorerCurrentPathThisPcOrQuickAccess=!0,this.QfMode=5):this.QfMode=999999):this.QfMode=7,this.AlwaysWide=!1,this.SearchBoxOnTop=!0,this.AllowKeyboardNavCycling=!0,this.AllowKeyboardNavOffCanvas=this.QfMode==5,this.ScopesAvailable=!1,this.FlatListWithoutGroups=!0,this.MaxSuggestionsWhenFlatList=10,this.SearchHomeAvailable=undefined,this.FirstSuggestionSelectedByDefault=this.QfMode!=5,this.AllowProtocolSyntheticSuggestions=!1,this.PanelCanResize=!t.config.forceSettingsAppExperience):i.isCenterScreen?(this.PreviewPaneAvailable=!0,this.MiniSERPMode=r(),this.QfMode=2,this.AlwaysWide=!0,this.SearchBoxOnTop=!0,this.AllowKeyboardNavCycling=!0,this.AllowKeyboardNavOffCanvas=!1,this.ScopesAvailable=t.config.scopesOrderBeginAlwaysWide.length>0,this.FlatListWithoutGroups=!1,this.MaxSuggestionsWhenFlatList=0,this.SearchHomeAvailable=t.config.searchHomeSupported,this.FirstSuggestionSelectedByDefault=!0,this.PanelCanResize=!1,this.AllowProtocolSyntheticSuggestions=!0):i.hostingEnvironment==6||t.config.webDesktopMode?(this.PreviewPaneAvailable=!1,this.MiniSERPMode=0,this.QfMode=10,this.AlwaysWide=!1,this.SearchBoxOnTop=!0,this.AllowKeyboardNavCycling=!0,this.AllowKeyboardNavOffCanvas=!1,this.ScopesAvailable=!1,this.FlatListWithoutGroups=!0,this.MaxSuggestionsWhenFlatList=8,this.SearchHomeAvailable=undefined,this.FirstSuggestionSelectedByDefault=!0,this.PanelCanResize=!1,this.AllowProtocolSyntheticSuggestions=!0):i.hostingEnvironment==5||t.config.forceSantoriniExperience?(this.PreviewPaneAvailable=!1,this.MiniSERPMode=0,this.QfMode=8,this.AlwaysWide=!1,this.SearchBoxOnTop=!0,this.AllowKeyboardNavCycling=!0,this.AllowKeyboardNavOffCanvas=!1,this.ScopesAvailable=!1,this.FlatListWithoutGroups=!1,this.MaxSuggestionsWhenFlatList=0,this.SearchHomeAvailable=t.config.searchHomeSupported,this.FirstSuggestionSelectedByDefault=!0,this.PanelCanResize=!1,this.AllowProtocolSyntheticSuggestions=!0,this.CortanaVersion=n.getWindowUrlParameter("version"),this.HostName=n.getWindowUrlParameter("host")):(s||t.config.alwaysWideBeforeRS5)&&!h?(this.PreviewPaneAvailable=!0,this.MiniSERPMode=r(),this.QfMode=i.hostingEnvironment==4?6:1,this.AlwaysWide=!0,this.SearchBoxOnTop=!1,this.AllowKeyboardNavCycling=!0,this.AllowKeyboardNavOffCanvas=!1,this.ScopesAvailable=this.QfMode!=6&&t.config.scopesOrderBeginAlwaysWide.length>0,this.FlatListWithoutGroups=!1,this.MaxSuggestionsWhenFlatList=0,this.SearchHomeAvailable=t.config.searchHomeSupported,this.FirstSuggestionSelectedByDefault=!0,this.PanelCanResize=!1,this.AllowProtocolSyntheticSuggestions=!0):(this.PreviewPaneAvailable=t.PreviewPane&&!s&&o!==!1,this.MiniSERPMode=this.PreviewPaneAvailable?r():0,this.QfMode=i.hostingEnvironment==4?6:this.PreviewPaneAvailable?0:4,this.AlwaysWide=!1,this.SearchBoxOnTop=!1,this.AllowKeyboardNavCycling=!0,this.AllowKeyboardNavOffCanvas=!1,this.ScopesAvailable=this.QfMode!=6&&t.config.scopesOrderBegin.length>0,this.FlatListWithoutGroups=!1,this.MaxSuggestionsWhenFlatList=0,this.SearchHomeAvailable=t.config.searchHomeSupported,this.FirstSuggestionSelectedByDefault=!0,this.PanelCanResize=!1,this.AllowProtocolSyntheticSuggestions=!0)},u}();t.RuntimeConfig=new u;n.RuntimeConfig=t.RuntimeConfig;t.getConfigForUT=e})(t=n.WSB||(n.WSB={}))})(AutoSuggest||(AutoSuggest={})),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"}(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={}))}(AutoSuggest||(AutoSuggest={})),function(n){function gt(t,i){if(i){var r=d.exec(t);return r&&n.TopLevelDomains[r[1].toLowerCase()]==1}return d.test(t)}function ni(n){return bt.test(n)}function ti(t){for(var i,u=t.substr(1).split("%").map(function(n){return parseInt(n,16)}),r=0;r<u.length;++r)if((i=[u[r],u[r+1]||0,u[r+2]||0,u[r+3]||0],i[0]>=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(nt,i[0]))return!1;return!0}function ii(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("%")&&!ti(n)?n.replace(/%/g,"%25"):n}).join("")}function s(t){var i=t;return t.includes("%")&&(t=n.safeExecute(function(){return ii(t)},"sanitizeUrlEncodings",i,i)),n.safeExecute(function(){return decodeURI(t)},"safeDecodeURI",i,i)}function u(n,t){var r,u,i;if(!n)return null;if(n=n.trim(),n.includes("%")&&h(n))if(n.includes("?")){var e=/([^?]*)(.*)/.exec(n),f=e[1],o=e[2];f=s(f);n=f+o}else n=s(n);return(r=yt.exec(n),!r)?null:(u=r[0].length,t&&u<n.length)?null:(i={length:u,type:0,protocol:r[1]||"",auth:r[2]||"",hostname:r[3]||"",port:r[4]||"",path:r[5]||"",parameters:r[6]||"",unparsedSegment:n.substr(u)},i.auth&&!i.auth.includes(":")&&!i.protocol&&!i.port&&!i.path&&!i.parameters)?null:i.protocol||i.path&&i.path.endsWith("/")?i:pt.test(i.hostname)||gt(i.hostname,t)||y.test(i.hostname)||w.test(i.hostname)?i:(i.type=i.path&&!ni(i.path)?1:2,i)}function ri(n,t){var r=new RegExp("[?&]{1}"+t+"=([^&]+)([\\/\\\\][^?#]*)?([?#].*)?"),i=n.match(r);return i?i[1]:null}function oi(n){return fi.some(function(t){return n.startsWith(t)})||ui.test(n)||n.toLocaleLowerCase().includes(ei)}function si(n,t,i){var e=0,o=0,s=0,r;(t.startsWith("read:")||t.startsWith("ftp:"))&&(t=t.replace(f,""));r=u(t,!0);r&&r.type==0&&(e=hi(i,r),o=ci(i,t,r),s=li(i,r));n.protocolMatchLength=e;n.domainMatchLength=o;n.pathMatchLength=s}function hi(n,t){var i=f.exec(n),r=i?i[1]:n.trim();return t.protocol.startsWith(r)?r.length:0}function ci(t,i,r){var u,f,o,e,s;return y.test(r.hostname)||w.test(r.hostname)?r.hostname.startsWith(t)||i.startsWith(t)?t.length:0:(u=r.hostname.split("."),u.length==1?f=HitHighlightingParser.addMarkers(u[0],t):(u=u.length>2&&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 li(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 ai(n){return n=it(n,!1),wt.test(n)}function tt(n){return f.test(n)}function vi(n){return l.test(n)}function h(n){return at.test(n)}function yi(n){return tt(n)&&!h(n)}function pi(n){var t;return t=typeof n=="string"?n:c(n,!0),t=bi(t),t.trim().replace(/^ht+p(s)?[:;]+[\\\/]*|^\/*/ig,function(n,t){return t?"https://":"http://"})}function it(n,t){return t?n.includes("/")||(n=n.replace(/\\/g,"/")):n.startsWith("//")||n.includes("\\")||(n=n.replace(/\//g,"\\")),n}function wi(n){return n=it(n,!0).replace(/\/+/g,"/"),(n.startsWith("/")?"file:/":"file:///")+n}function bi(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 c(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,r,f,e;return t&1&&(r=rt.exec(i),r&&(i=r[1])),t&2&&(r=ut.exec(i),r&&(i=r[1])),t&4&&(r=ft.exec(i),r&&(i=r[1])),t&8&&(r=l.exec(i),r&&(i=r[1])),t&16&&(r=ki.exec(i),r&&(i=r[1])),t&32&&(f=u(i,!1),f&&(f.protocol=f.protocol.toLocaleLowerCase(),f.hostname=f.hostname.toLocaleLowerCase(),e=c(f),i=i.replace(/^(\s*)(?:[^\s]*)(\s*)$/g,"$1"+e+"$2"))),t&64&&(i=s(i)),i}function di(n){return l.test(n)}function e(n){return ut.test(n)?1:rt.test(n)?2:ft.test(n)?3:0}function gi(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 nr(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 tr(t,r,u){if(i(r,127)!=i(u,127))return!1;var f=e(t.originalQuery);return n.contains([1,2],f)&&!nr(r,u)?!1:!0}function ot(n){var t=u(n,!0),i;return t?(i=st(t),i?t.path.toLocaleLowerCase():null):null}function st(n){var t=n.hostname.split(".");return n.hostname&&t.length>1?t[t.length-1]=="com"&&et.some(function(n){return t[t.length-2]==n}):!0}function ir(t){if(t=="https://www.bing.com/?form=EDGSTP&pc=MESP"||t=="https://www.bing.com/?form=EDGSTP&pc=MESPB")return!0;var i=ot(t);return!!i&&n.contains(n.WebSearchPaths,i)}function rr(n){var t=u(n.replace(/^ftp:/g,"http:"),!0);return(t?t.hostname:null)||""}function ur(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 fr(n){var t,i;return lt.test(n)||f.test(n)?!0:(t=n.replace(kt,"/"),dt.test(t)?t=t.replace(g,"."):t.includes(".")&&(t=t.replace(g,"")),i=u(t,!0),i&&i.type==0)}function er(t,i,r,u){var e,f;if(!t||!i||!r)return"";e=encodeURIComponent(i);f={triggeringMode:"Explicit",intent:r};u&&(f.entityId=u);var s=JSON.stringify(f),h=encodeURIComponent(s),o=n.formatString(t.bfbSearchUrl,[e,h,t.bfbfrmcde]);return _G&&_G.IG?o+"&cvid="+encodeURIComponent(_G.IG):o}function or(n){return n.replace(/[;,/?:@&=+$ ]/g,function(n){return"%"+n.charCodeAt(0).toString(16)})}var r="\\-\\s\\[\\]\\/\\\\!@#$%^&*()+={}:;~`\"'|<,>.。?",ht="(?:[^"+r+"]-*)*[^"+r+"](?:-*[^"+r+"])*",a="(?:[^"+r+"]-*)*[^"+r+"0-9](?:-*[^"+r+"])*",ct="(?:(?:"+ht+"[.。])*"+a+")[.。]?",v="(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])",o="(?:(?:"+v+"\\.){3}"+v+")",y=new RegExp("^"+o+"$"),t="(?:[0-9a-fA-F]{1,4})",p="(?::(?:(?::"+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:"+o+"|)",w=new RegExp("^\\["+p+"\\]$","i"),b="ht+ps?[:;]+[\\\\/]*",lt=new RegExp(b,"i"),k=b+"|/+",at=new RegExp("^("+k+")","i"),vt=ct+"|"+o+"|\\["+p+"\\]",yt=new RegExp("^("+k+")?([^/@#?]*@)?("+vt+")(:(?: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"),pt=/^localhost[.。]?$/,d=new RegExp("[.。]("+a+")[.。]?$","i"),wt=/((^[\\]{2}).+)|(^[a-z]:\\.*)/i,f=/^([a-z0-9\-]+):/i,bt=/\s/,g=/\s+/g,kt=/\s+\/(?!\/)/g,dt=/([^\/]|^)\/(?!\/)/,nt,et;n.WebSearchPaths=["/search","/entityexplore"];nt=[33,39,40,41,42,91,93];n.tryParseUrl=u;n.getQueryStringParam=ri;var ui=/file:\/\/\/[^:\/]+:\/[^\/]+\/[^\/]+\/AppData\//i,fi=["ms-appx:","ms-appx-web:","ms-browser-extension:",],ei="microsoft.microsoftedge_8wekyb3d8bbwe";n.isJunkUrl=oi;n.computeUrlMatchLengths=si;n.isUncOrLocalPath=ai;n.startsWithProtocol=tt;n.startsWithWww=vi;n.isHttpProtocol=h;n.isNonHttpProtocol=yi;n.cleanAndFixUrlProtocol=pi;n.cleanAndFixUncOrLocalPath=wi;n.parsedUrlToString=c;var rt=/^ht+ps:\/*(.*)/i,ut=/^ht+p:\/*(.*)/i,ft=/^\/{2,}(.*)/,l=/^www\.(.*)/i,ki=/^(.*[^:\/])\/+$/;n.normalizeUrl=i;n.hasWww=di;n.getProtocol=e;n.prettyPrintUrl=gi;n.isDuplicateUrl=tr;et=["bing","staging-bing-int","working-bing-int","bing-int","bing-exp"];n.tryGetBingPathLC=ot;n.isBingHost=st;n.isBingSearchUrl=ir;n.getDomain=rr;n.isEmptyUrlPrefix=ur;n.queryLooksLikeUrl=fr;n.buildBfbSearchUrl=er;n.encodeURIComponentForWindowsProtocol=or}(AutoSuggest||(AutoSuggest={})),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.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.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}(AutoSuggest||(AutoSuggest={})),function(n){function pt(){return matchMedia("screen and (-ms-high-contrast)").matches}function wt(){return _w.ClientTestHooks&&ClientTestHooks.isTesthookParamSet("isOffline")?!1:navigator.onLine}function bt(n){return!n.isAnswer&&(n.handoffType==0||n.handoffType==11)}function l(n){return n?n.replace(st,"$1").replace(ht,"$1 "):n}function kt(n){return n?n.replace(/[-{}]/g,"").toLowerCase():null}function dt(n){return!n||Object.keys(n).length===0}function gt(n){return n.canFail}function a(n,t,i,r){var u,e;n&&(n=n.slice(0,t)+f+n.slice(t,n.length));u=i(n);u&&(e=u.indexOf(f),t=e!=-1?e:t,u=u.replace(f,""));r(u,t)}function ni(n){if(!n)return SharedLogHelper.LogError("getInputType",null,new Error("event object is missing")),0;switch(n.pointerType){case"mouse":return 2;case"touch":return 3;case"pen":return 4;default:return 1}}function o(n){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];i.forEach(function(t){return delete n.enabledDataSources[t]})}function v(i){return i&&n.config.bingFetchEnabledRegionsList&&n.config.bingFetchEnabledRegionsList.length>0&&!t(n.config.bingFetchEnabledRegionsList,i.toLowerCase())}function ti(i){return i&&n.config.miniSerpEnabledRegionsList&&n.config.miniSerpEnabledRegionsList.length>0&&!t(n.config.miniSerpEnabledRegionsList,i.toLowerCase())}function ii(t,i){var r=t.queryToFetch&&t.queryToFetch.length<n.config.minQueryLengthForWebProvider||v(i);return r&&(o(t,n.WebDataSource),o(t,n.WebRankingSignalDataSource)),r}function y(t){if(t){t=n.normalizeUrl(t,15);for(var i=1;i<t.length-1;++i)if(lt.includes(t[i]))return!0}return!1}function ri(t,i,r){var u,f;return r||(r=0),a(t,i,function(n){return l(n)},function(n,t){u=n;f=t}),u&&(n.config&&n.config.doNotRemoveSpaceAfterIn&&u.toLocaleLowerCase().endsWith(" in ")||(u=u.trim()),f=Math.min(f,u.length)),{originalQuery:t,originalCursorPosition:i,queryToFetch:u,cursorPosition:f,enabledDataSources:{},equals:function(n){return(u?u.toLowerCase():u)==(n.queryToFetch?n.queryToFetch.toLowerCase():n.queryToFetch)&&r==n.topHitRestriction},isMultiWord:y(u),getCacheKey:function(){return u},topHitRestriction:r}}function p(i,r){return r&&!r.enabledDataSources[i]?!1:t(n.config.enabledDataSources,i)}function w(i,r,u,f){var e=f.enabledDataSources[i];return e?e.suggestionIsEnabled&&!e.suggestionIsEnabled(r,u)?!1:t(n.config.enabledDataSources,i):!1}function t(n,t){return n.indexOf(t)!=-1}function ui(n,t){var i=n.indexOf(t);return i!=-1?(n.splice(i,1),!0):!1}function fi(n,t){var i=n.findIndex(t);return i!=-1?n.splice(i,1)[0]:null}function ei(n,t,i){if(t<100)for(var r=n.length-1;n.length>t&&r>=0;--r)i(n[r])&&n.splice(r,1)}function oi(n,i){return n.filter(function(n){return!t(i,n)})}function si(n,t){if(n.length!=t.length)return!1;for(var i=0;i<n.length;++i)if(n[i]!=t[i])return!1;return!0}function hi(n,t){if(n===t)return!0;if(!n||!t||Object.keys(n).length!=Object.keys(t).length)return!1;for(var i in n)if(n[i]!=t[i])return!1;return!0}function b(){return n.getCurrentDate().getTime()}function r(n){var t=Math.abs(Math.floor(n));return(t<10?"0":"")+t}function ci(){var t=n.getCurrentDate(),i=-t.getTimezoneOffset(),u=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 li(n,t){return n?n.replace(ct,function(n,i){return t[i]}):n}function ai(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 s(n,t,i,r,f,e){return sb_st(function(){return u(n,i,null,r,f,e)},t)}function vi(n){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];u(function(){return sj_evt.fire.apply(sj_evt,[n].concat(i))},n)}function yi(n,t){s(t,1,n)}function h(n,t){var i=[],r=!0,u=function(){for(var u=[],n=0;n<arguments.length;n++)u[n]=arguments[n];r?i.push(u):t.apply(null,u)};n(u);r=!1;i.forEach(function(n){return t.apply(null,n)})}function pi(n,t){e=n&&it()!="ms-appx-web:";k=e&&!v(t);d=e&&!ti(t)}function wi(){return e}function bi(){return k}function ki(){return d}function nr(n){return t(di,n)}function tr(n){return t(tt,n)}function ir(n){return t(g,n)}function rr(n){return t(nt,n)}function ur(n){return t(gi,n)}function fr(n,t){return n==121&&t||n==93}function er(n,t){return n==8||n==46||n==88&&t.ctrlKey}function it(){return _w.location.protocol}function or(){return _w.location.host}function sr(){return _w.location.pathname}function hr(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+n+"=([^&#]*)"),t=i.exec(_w.location.search);return t===null?"":decodeURIComponent(t[1].replace(/\+/g," "))}function cr(){var n=_d.activeElement;return!n||n.id.endsWith("sb_form_q")?_d.body:n}function rt(t){return t&&+t!=n.WindowsApiDefaultDate&&!isNaN(t.getTime())&&t.getFullYear()!=1600}function ut(n){if(!rt(n))return null;var t=n.getTime(),i=b();return Math.abs(i-t)/yt}function lr(n){var t=ut(n);return t!==null&&t>14}function ar(n){return n==="i"?13:n==="v"?14:0}function vr(n){return encodeURIComponent(n).replace(/[!'()*]/g,escape).replace(/%20/g,"+")}var f=String.fromCharCode(57346),st=new RegExp("^\\s*("+f+")?\\s*"),ht=new RegExp("\\s*("+f+")?\\s+","g"),ct=/{([0-9]+)}/g,lt=" -_/\\",at=-2147215328,vt=-2147023673,yt=864e5,i,c,ft,et,ot;n.DebugSourceName="AutoSuggest";SharedLogHelper.RegisterErrorFilter(function(n){var t=n?n.number:null,i=n?n.name:null;return t===vt||t===at||i==="Canceled"});n.isHighContrastEnabled=pt;n.isBrowserOnline=wt;n.isWebSuggestion=bt;n.cleanQuery=l;n.cleanGuid=kt;n.isEmpty=dt;n.canIconFail=gt;n.mantainCursorPositionIn=a;n.getInputType=ni;n.disableDataSources=o;n.disableWebDataSourceIfNeeded=ii;n.isMultiWord=y;n.parseQuery=ri;n.isDataSourceEnabled=p;n.isSuggestionTypeEnabled=w;n.contains=t;n.tryRemove=ui;n.removeFirstWhere=fi;n.trimList=ei;n.except=oi;n.sequenceEqual=si;n.objEquals=hi;n.log=function(){};n.getCurrentDate=function(){return new Date};_w.ClientTestHooks&&(n.log=function(n,t){return ClientTestHooks.ClientLog("- "+n,t)},i=ClientTestHooks.getUrlValue("currentdate",null),i&&(i.includes("-")||i.length!=8||(i=i.substr(0,4)+"-"+i.substr(4,2)+"-"+i.substr(6,2)),n.getCurrentDate=function(){return new Date(i)}));n.getCurrentTime=b;n.getDateWithTimezone=ci;n.fetchWrapper=function(n,t,i){return i()};n.formatString=li;n.isCancellation=ai;n.safeExecute=u;n.safeSetTimeout=s;n.safeFireEvent=vi;n.invokeAsynchronously=yi;n.ensureCallbackIsAsync=h;n.WebDataSource="Web";n.WebRankingSignalDataSource="WRS";n.MRUDataSource="MRU";var e=!0,k=!0,d=!0;n.refreshBingEnabledCache=pi;n.isBingEnabled=wi;n.isWebProviderEnabled=bi;n.isMiniSerpEnabled=ki;var di=[3,16,17,18,19,20,144,145,],g=[38,203,211,],nt=[40,204,212,],tt=g.concat(nt),gi=tt.concat(37,39,36,35);n.isFunctionalKey=nr;n.isUpOrDownKey=tr;n.isUpKey=ir;n.isDownKey=rr;n.isMovingCursorKey=ur;n.isContextMenuKey=fr;n.isDeletionKey=er;n.getWindowProtocol=it;n.getWindowHost=or;n.getWindowPath=sr;n.getWindowUrlParameter=hr;n.getCurrentActiveElement=cr;n.WindowsApiDefaultDate=-116444736e5;n.isValidDate=rt;n.getTimeDiffInDays=ut;n.olderThan2Weeks=lr;n.verticalToHandoffType=ar;c=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=c;ft=function(){function n(){}return n.prototype.getItem=function(n){try{return _w.localStorage?_w.localStorage.getItem(n):undefined}catch(t){return SharedLogHelper.LogError("localStorage",t,new Error("getItem")),undefined}},n.prototype.setItem=function(n,t){try{_w.localStorage&&_w.localStorage.setItem(n,t)}catch(i){SharedLogHelper.LogError("localStorage",i,new Error("setItem"))}},n.prototype.removeItem=function(n){try{return _w.localStorage.removeItem(n)}catch(t){SharedLogHelper.LogError("localStorage",t,new Error("removeItem"))}},n}();n.LightweightStorage=ft;et=function(){function n(){this._sequenceNumber=0}return n.prototype.getSequenceNumber=function(){return this._sequenceNumber},n.prototype.incrementSequenceNumber=function(){this._sequenceNumber++},n}();n.SequenceNumberManager=et;ot=function(){function t(t,i,r,u,f,e,o,s){var h=this;this._host=t;this._suggestionsParsers=i;this._rootViewModel=r;this._suggestionsRenderingManager=u;this._webProviders=f;this._otherProviders=e;this._instrumentationHelper=o;this._sequenceNumberManager=s;n.config.cancellationEnabled&&(this._cancellationManager=new c);t.bindShown(function(){h._lastQuery=null;h._currentQuery=null;h._isPaneDismissed=!1});t.bindDismissed(function(){h.clearFetchTimer();h.finishPreviousQuery(!0);h.finalizeKeystroke(!0);h._isPaneDismissed=!0;h._rootViewModel.onDismiss()});t.bindQueryChangedOrInitialized(function(t,i){return h.onQueryChanged(t,n.config.d,i)});t.bindOnSubmit(function(n,t,i){return h.onSubmit(n,t,i)});t.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(n){var t=this._sequenceNumberManager.getSequenceNumber();t>0&&this._instrumentationHelper.finalizeKeystrokeLog(t);n||this._sequenceNumberManager.incrementSequenceNumber()},t.prototype.onQueryChanged=function(n,t,i){var r=this,u;this.clearFetchTimer();this._currentQuery=n;this._lastQuery&&(!this._lastQuery.equals(this._currentQuery)||i)&&this.cancelPreviousQuery(!1);t<=0?this.fetchForQueryChange(0,!1,i):(u=Date.now(),this._fetchTimer=s(function(){r._fetchTimer=null;r.fetchForQueryChange(Date.now()-u,!1,i)},t,"fetchTimer"))},t.prototype.onSubmit=function(n,t,i){this._fetchTimer&&(this._currentQuery||(this._currentQuery=this._host.getQuery()),this.fetchForQueryChange(0,!0,!1));this._rootViewModel.submit(n,t,this._sequenceNumberManager.getSequenceNumber(),i,this._isPaneDismissed)},t.prototype.cancelPreviousQuery=function(n){this._cancellationManager&&this._cancellationManager.cancelAll(n)},t.prototype.fetchForQueryChange=function(t,i,r){var u=this,e,f,s;if(this.clearFetchTimer(),!r&&this._lastQuery&&this._lastQuery.equals(this._currentQuery))this._rootViewModel.onQueryChanged(this._currentQuery,this._sequenceNumberManager.getSequenceNumber());else if(e=r?this._currentQuery:this._host.getQuery(),e.equals(this._currentQuery)){if(this.finishPreviousQuery(i),this.finalizeKeystroke(!1),this._lastQuery=this._currentQuery,f=this._sequenceNumberManager.getSequenceNumber(),this._instrumentationHelper.instrumentBeginRequest(f,this._currentQuery,t),s=!n.config.enabledDataSources.some(function(n){return p(n,u._currentQuery)}),s)this._rootViewModel.onQueryChanged(this._currentQuery,f);if(this._suggestionsRenderingManager.initiateSequenceNumber(f,this._currentQuery),!s){var o=function(){return!u._isPaneDismissed&&(n.config.d>0?e.equals(u._currentQuery):f==u._sequenceNumberManager.getSequenceNumber())},c=(new Date).getTime(),l=function(n,t,i,r,s,h){return u.onResponseReceived(e,f,n,t,i,o,r,s,c,h)},a=function(t){u._instrumentationHelper.instrumentFetchesBegin(f);n.fetchWrapper(e,o,function(){u._webProviders.forEach(function(n){u.fetchWeb(e,n,f,t,o)});u._otherProviders.forEach(function(n){u.fetch(e,n,f,t,o)})});u._instrumentationHelper.instrumentFetchesEnd(f);u._rootViewModel.onQueryChanged(u._currentQuery,f)};h(a,l)}}},t.prototype.fetchWeb=function(t,i,r,f,e){var c=this,s=n.Service.QueryParams,o=this._host.getCustomUrlParameters(t),h;this._host.shouldRequestEltoken()&&(o[s.RequestElToken]="1");o[s.CursorPosition]=t.cursorPosition.toString();o[s.ConversationId]=this._host.getConversationId();o[s.ImpressionGuid]=this._instrumentationHelper.getImpressionGuid(r);h=this._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(n,t,i,r,u,f,e,o,s,c){var l=this,a,v;f()&&(this._instrumentationHelper.instrumentResponseReceived(t,i,u,e,o),a=function(i,r,e){if(l._instrumentationHelper.instrumentDataSourceParsed(t,i),f())l.onSuggestionsParsed(n,t,i,u,r,e,c)},v=function(u){var e=l._suggestionsParsers[i];e?e.parse(n,t,i,r,f,u,l._cancellationManager):(SharedLogHelper.LogError("onResponseReceived",null,new Error("No parser for data source "+i)),u(i,[],null))},h(v,a))},t.prototype.onSuggestionsParsed=function(n,t,i,r,u,f,e){u=u.filter(function(t){return w(i,t.type,t.handoffType,n)});this._instrumentationHelper.instrumentDataSource(t,i,u,f);this._rootViewModel.onSuggestionsParsed(n,t,i,r,u,f);this._suggestionsRenderingManager.queueSuggestions(t,i,u,f,e)},t}();n.Core=ot;n.encodeQueryParameter=vr}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){function wt(t){return n.contains(at,t)}function bt(t){return n.contains(vt,t)}function kt(t){return n.contains(g,t)}function dt(t){return n.contains(yt,t)}function gt(t){return n.contains(pt,t)}function o(n){return{dataSource:"ODC",requirements:[1,2],conditionalRequirements:function(){return t.isCloudSearchEnabledCache&&(t.windowsAccountType==2||t.windowsAccountType==4)},suggestionIsEnabled:n?function(t){return t==n}:undefined}}function nt(){return n.isDataSourceEnabled("SSUE",null)}function ni(){return n.isDataSourceEnabled("BAW",null)}function tt(n){var i=!t.config.userProfileButtonEnabled||t.windowsAccountType==n;switch(n){case 2:return i&&t.isSubstrateOutlookAccountConnected;case 1:return i&&t.isSubstrateO365AccountConnected;case 4:return i&&t.isSubstrateO365AccountConnected&&t.isSubstrateOutlookAccountConnected;default:return!1}}function ti(n){var i=e.authenticationManager.getAllSearchWebAccountsAsync;return i?!0:t.windowsAccountType==n}function r(n,i,r,u){return{dataSource:n,requirements:[1],conditionalRequirements:function(n){return t.isCloudSearchEnabledCache&&(!u||u())&&(r||n&&n.queryToFetch&&n.queryToFetch.length>=t.config.minLengthFor3SonL1)&&ti(i)&&tt(i)}}}function a(n){return{dataSource:"BAW",requirements:[1,2],conditionalRequirements:function(i){return t.isCloudSearchEnabledCache&&(n||i&&i.queryToFetch&&i.queryToFetch.length>=t.config.bawminqlen)&&(t.windowsAccountType==1||t.windowsAccountType==4)}}}function v(n){return{dataSource:"MSBS",requirements:[1,2],conditionalRequirements:function(i){return t.isCloudSearchEnabledCache&&(n||i&&i.queryToFetch&&i.queryToFetch.length>=t.config.bfbminqlens)&&(t.windowsAccountType==1||t.windowsAccountType==4)}}}function y(n){return{dataSource:"MSBC",requirements:[1,2],conditionalRequirements:function(i){return t.isCloudSearchEnabledCache&&(n||i&&i.queryToFetch&&i.queryToFetch.length>=t.config.bfbminqlenc)&&(t.windowsAccountType==1||t.windowsAccountType==4)}}}function s(){return!t.isCloudSearchEnabledCache||t.windowsAccountType==3||t.windowsAccountType==0||!nt()?!1:!tt(t.windowsAccountType)}function it(){return t.windowsAccountType==2||t.windowsAccountType==4}function ii(){t.ScopeConfig[i.All].getEmptyZIMessages=function(r){return u(r,i.All,t.config.useNewEmptyQueryMessages?"EmptyAllMessage":"EmptyScopeMessage",n.isBingEnabled()?"EmptyAllSubMessage":"EmptyAllSubMessageNoWeb",ut(r,!0))};t.RuntimeConfig.QfMode==6?(t.ScopeConfig[i.All].icon={type:1,content:"&#xE721"},t.ScopeConfig[i.All].getEmptyZIMessages=function(n){return u(n,i.Web,"EmptyLockscreenMessage","EmptyLockscreenSubMessage")}):t.RuntimeConfig.QfMode==8?(t.ScopeConfig[i.All_Santorini].icon=t.getSearchSuggestionIcon(),t.ScopeConfig[i.All_Santorini].enabledDataSourcesForZeroInput=[{dataSource:"QSCH",groupType:t.GroupType.QuickSearch,suggestionGroupToggler:h(t.GroupType.QuickSearch)},{dataSource:"MPP"},{dataSource:"MST"},{dataSource:"MFF"},{dataSource:"MRS"},{dataSource:n.MRUDataSource},],t.ScopeConfig[i.All_Santorini].staticGroupOrderForZeroInput=function(){return[t.GroupType.SearchSuggestions,t.GroupType.Settings,t.GroupType.Documents,t.GroupType.Apps,t.GroupType.QuickSearch]}):t.RuntimeConfig.SearchHomeAvailable==1&&t.RuntimeConfig.QfMode!=7?(t.ScopeConfig[i.All].icon=t.getSearchSuggestionIcon(),t.ScopeConfig[i.All].enabledDataSourcesForZeroInput=[{dataSource:"TOPP",groupType:t.GroupType.TopApps,suggestionGroupToggler:h(t.GroupType.TopApps),conditionalRequirements:function(){return!(t.shouldEnableTopSites(t.getCurrentLanguage())||t.isWWEVisibleSinglePane())}},{dataSource:"TOPS",groupType:t.GroupType.TopApps,suggestionGroupToggler:h(t.GroupType.TopApps),requirements:[2],conditionalRequirements:function(){return t.shouldEnableTopSites(t.getCurrentLanguage())&&!t.isWWEVisibleSinglePane()}},{dataSource:"BW",groupType:t.GroupType.TopApps,suggestionGroupToggler:h(t.GroupType.TopApps),conditionalRequirements:function(){return t.shouldEnableWeatherTile(t.getCurrentLanguage())&&!t.isWWEVisibleSinglePane()}},{dataSource:"AFC",groupType:t.GroupType.ActivityFeedSuggestions,suggestionGroupToggler:h(t.GroupType.ActivityFeedSuggestions),conditionalRequirements:function(){return!(t.isWWEVisibile()||t.isWPBVisibile())}},{dataSource:"WWE",groupType:t.GroupType.WelcomeExperience,conditionalRequirements:function(){return t.isWWEVisibile()}},{dataSource:"WPB",groupType:t.GroupType.PromoBanner,conditionalRequirements:function(){return t.isWPBVisibile()}},{dataSource:"QSCH",groupType:t.GroupType.QuickSearch,suggestionGroupToggler:h(t.GroupType.QuickSearch),conditionalRequirements:function(){return!(t.canShowSearchHomeUpsell()||t.isWWEVisibleSinglePane())}}],t.ScopeConfig[i.All].staticGroupOrderForZeroInput=function(){return[t.GroupType.TopApps,t.GroupType.ActivityFeedSuggestions,t.GroupType.WelcomeExperience,t.GroupType.PromoBanner,t.GroupType.QuickSearch,]},t.config.enableEdgeUpsellSearchHome2&&(t.ScopeConfig[i.All].staticGroupOrderForZeroInput=function(){return[t.GroupType.TopApps,t.GroupType.Upsell,t.GroupType.ActivityFeedSuggestions,t.GroupType.PromoBanner,t.GroupType.QuickSearch,]}),t.ScopeConfig[i.AppsSettings].enabledDataSourcesForZeroInput=t.ScopeConfig[i.All].enabledDataSourcesForZeroInput,t.ScopeConfig[i.AppsSettings].staticGroupOrderForZeroInput=t.ScopeConfig[i.All].staticGroupOrderForZeroInput):t.ScopeConfig[i.All].enabledDataSourcesForZeroInput=[]}function rt(){t.ScopeConfig={};t.ScopeConfig[i.All_FileExplorer]={icon:null,prefixesLocString:null,enabledDataSources:[{dataSource:"FEH"},{dataSource:"IFF"},{dataSource:"MDOC",conditionalRequirements:function(){return t.config.useL2ProvidersInFileExplorer}},{dataSource:"MPHO",conditionalRequirements:function(){return t.config.useL2ProvidersInFileExplorer}},{dataSource:"MVID",conditionalRequirements:function(){return t.config.useL2ProvidersInFileExplorer}},{dataSource:"ODC",requirements:[1,2],conditionalRequirements:function(){return t.config.cloudSearchInFileExplorer&&(t.isFileExplorerCurrentPathThisPcOrQuickAccess||!!e.fileExplorerSuggestionPage.currentSyncRootAccount)}},{dataSource:"SSUE",requirements:[1,2],conditionalRequirements:function(){return t.config.cloudSearchInFileExplorer&&(t.isFileExplorerCurrentPathThisPcOrQuickAccess||!!e.fileExplorerSuggestionPage.currentSyncRootAccount)}},{dataSource:"SSEE",requirements:[1,2],conditionalRequirements:function(){return t.config.cloudSearchInFileExplorer&&(t.isFileExplorerCurrentPathThisPcOrQuickAccess||!!e.fileExplorerSuggestionPage.currentSyncRootAccount)}},],enabledDataSourcesForZeroInput:[{dataSource:"FEH"},],getEmptyZIMessages:null};t.ScopeConfig[i.All_Lockscreen]={icon:null,prefixesLocString:null,enabledDataSources:[{dataSource:n.WebDataSource,requirements:[1,2]},],enabledDataSourcesForZeroInput:[{dataSource:"LSQS"}],webSyntheticEnabled:function(t){return t.queryToFetch&&n.isBingEnabled()},getEmptyZIMessages:null};t.ScopeConfig[i.All_SettingsApp]={icon:null,prefixesLocString:null,enabledDataSources:[{dataSource:"ST"},{dataSource:"MST"},],enabledDataSourcesForZeroInput:[],getEmptyZIMessages:null};t.ScopeConfig[i.All_ControlPanel]={icon:{content:"&#xE713",type:2},prefixesLocString:"ScopeSettings",enabledDataSources:[{dataSource:n.WebDataSource,suggestionIsEnabled:function(){return!1},requirements:[1,2]},{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MST"},{dataSource:"ST"},{dataSource:"QS",requirements:[1,2]}],enabledDataSourcesForZeroInput:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MST"},],getEmptyZIMessages:null};t.ScopeConfig[i.All_Santorini]={icon:{content:"&#xE782",type:2,needsAccentColor:!0},prefixesLocString:"ScopeAll",enabledDataSources:[{dataSource:"PP"},{dataSource:"ST"},{dataSource:"FL"},{dataSource:"LM"},{dataSource:"IFF"},{dataSource:"LDIC"},{dataSource:"CG"},{dataSource:n.MRUDataSource},{dataSource:"MPP"},{dataSource:"MST"},{dataSource:"MFF"},{dataSource:n.WebDataSource,requirements:[1,2]},{dataSource:"OSTMA",requirements:[1,2]},{dataSource:"QS",requirements:[1,2]},{dataSource:"WRS",requirements:[1,2]},o(),r("SSUE",1,!1),],enabledDataSourcesForZeroInput:[],webSyntheticEnabled:function(t){return t.queryToFetch&&n.isBingEnabled()},getEmptyZIMessages:null,showUpsellOnSuggestionsList:t.config.accountVerificationInAllScope?function(){return s()}:undefined};t.ScopeConfig[i.All_WebDesktop]={icon:{content:"&#xE782",type:2,needsAccentColor:!0},prefixesLocString:"ScopeAll",enabledDataSources:[{dataSource:n.WebDataSource,requirements:[1,2]},{dataSource:"WRS",requirements:[1,2]},],enabledDataSourcesForZeroInput:[],webSyntheticEnabled:function(t){return t.queryToFetch&&n.isBingEnabled()},getEmptyZIMessages:null,showUpsellOnSuggestionsList:undefined};t.ScopeConfig[i.All]={icon:{content:"&#xE782",type:2,needsAccentColor:!0},prefixesLocString:"ScopeAll",enabledDataSources:[{dataSource:"PP"},{dataSource:"ST"},{dataSource:"FL"},{dataSource:"LM"},{dataSource:"IFF"},{dataSource:"LDIC"},{dataSource:"CG"},{dataSource:n.MRUDataSource},{dataSource:"MPP"},{dataSource:"MST"},{dataSource:"MFF"},{dataSource:n.WebDataSource,requirements:[1,2]},{dataSource:"OSTMA",requirements:[1,2]},{dataSource:"QS",requirements:[1,2]},{dataSource:"WRS",requirements:[1,2]},r("SSUE",1,!1),a(!1),v(!1),y(!1)],enabledDataSourcesForZeroInput:[],webSyntheticEnabled:function(t){return t.queryToFetch&&n.isBingEnabled()},getEmptyZIMessages:null,showUpsellOnSuggestionsList:t.config.accountVerificationInAllScope?function(){return s()}:undefined};t.ScopeConfig[i.Apps]={icon:{content:"&#xEB3B",type:2},prefixesLocString:"ScopeApps",enabledDataSources:[{dataSource:n.WebDataSource,suggestionIsEnabled:function(){return!1},requirements:[1,2]},{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MPP"},{dataSource:"PP",suggestionIsEnabled:function(n){return n=="PP"}},{dataSource:"OSTMA",requirements:[1,2]},{dataSource:"IBA"},],enabledDataSourcesForZeroInput:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"TOPP",conditionalRequirements:function(n){return n.isSearchHomeZI}},{dataSource:"MPP"},n.contains(t.config.enabledDataSources,"LRA")?{dataSource:"LRA"}:{dataSource:"PP",suggestionIsEnabled:function(n){return n=="PP"}}],staticGroupOrderForZeroInput:function(n){return n.isSearchHomeZI?[t.GroupType.TopApps,t.GroupType.Apps]:undefined},getEmptyZIMessages:function(n){return u(n,i.Apps,t.config.useNewEmptyQueryMessages?"EmptyScopeMessageNew":"EmptyScopeMessage","EmptyScopeSubMessage","EmptyScopeSearchLocation_PC")}};t.ScopeConfig[i.Settings]={icon:{content:"&#xE713",type:2},prefixesLocString:"ScopeSettings",enabledDataSources:[{dataSource:n.WebDataSource,suggestionIsEnabled:function(){return!1},requirements:[1,2]},{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MST"},{dataSource:"ST"},{dataSource:"QS",requirements:[1,2]}],enabledDataSourcesForZeroInput:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MST"},],getEmptyZIMessages:function(n){return u(n,i.Settings,t.config.useNewEmptyQueryMessages?"EmptyScopeMessageNew":"EmptyScopeMessage","EmptySettingsSubMessage")}};t.ScopeConfig[i.Photos]={icon:{content:"&#xEB9F",type:2},prefixesLocString:"ScopePhotos",enabledDataSources:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="LI"}},{dataSource:"MPHO",suggestionIsEnabled:function(n){return n=="LI"}},o("LI"),],enabledDataSourcesForZeroInput:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="LI"}},],getEmptyZIMessages:function(n){return f(n,i.Photos,!0)}};t.ScopeConfig[i.Videos]={icon:{content:"&#xE714",type:1},prefixesLocString:"ScopeVideos",enabledDataSources:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="LV"}},{dataSource:"MVID",suggestionIsEnabled:function(n){return n=="LV"}},o("LV"),],enabledDataSourcesForZeroInput:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="LV"}},],getEmptyZIMessages:function(n){return f(n,i.Videos,!0)}};t.ScopeConfig[i.Music]={icon:{content:"&#xE8D6",type:2},prefixesLocString:"ScopeMusic",enabledDataSources:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="MU"}},{dataSource:"MMUS",suggestionIsEnabled:function(n){return n=="MU"}},o("MU"),],enabledDataSourcesForZeroInput:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="MU"}},],getEmptyZIMessages:function(n){return f(n,i.Music,!1)}};t.ScopeConfig[i.Documents]={icon:{content:"&#xE7C3",type:2},prefixesLocString:"ScopeDocuments",enabledDataSources:[{dataSource:n.MRUDataSource,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}},o("FL"),{dataSource:"PP",suggestionIsEnabled:function(n){return n=="LDOC"}},r("SSUE",1,!0),r("SSEE",1,!0),],enabledDataSourcesForZeroInput:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="FL"}},r("SSEE",1,!0,function(){return!!t.config.zeroInputCloudDocs}),],showUpsellOnSuggestionsList:function(){return s()},getEmptyZIMessages:function(n){return f(n,i.Documents,!1)}};t.ScopeConfig[i.Folders]={icon:{content:"&#xE838",type:2},prefixesLocString:"ScopeFolders",enabledDataSources:[{dataSource:n.MRUDataSource,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:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="FD"}},],getEmptyZIMessages:function(n){return f(n,i.Folders,!1)}};t.ScopeConfig[i.Web]={icon:{content:"&#xE774",type:1},prefixesLocString:"ScopeWeb",enabledDataSources:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(n,t){return t==1}},{dataSource:n.WebDataSource,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}},a(!0),{dataSource:"WRS",requirements:[1,2]},v(!0),y(!0)],enabledDataSourcesForZeroInput:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(n,t){return t==1}},{dataSource:n.WebDataSource,requirements:[1,2],conditionalRequirements:function(){return it()}},],webSyntheticEnabled:function(t){return t.queryToFetch&&n.isBingEnabled()},getEmptyZIMessages:function(n){return u(n,i.Web,t.config.useNewEmptyQueryMessages?"EmptyWebMessage":"EmptyScopeMessageWeb","EmptyWebSubMessage")}};t.ScopeConfig[i.PathCompletion]={icon:{content:"&#xE782",type:2,needsAccentColor:!0},scopeNameLocString:t.config.pathCompletionReplacesAll?"PathCompletionScopeName":null,prefixesLocString:null,enabledDataSources:[{dataSource:"PT"},{dataSource:"CG"},],enabledDataSourcesForZeroInput:[],getEmptyZIMessages:null};t.ScopeConfig[i.Emails]={icon:{content:"&#xE715",type:2},prefixesLocString:"ScopeEmails",enabledDataSources:[r("SSEE",1,!0),r("SSEC",2,!0),],enabledDataSourcesForZeroInput:[],showUpsellOnSuggestionsList:function(){return s()},getEmptyZIMessages:function(n){return u(n,i.Emails,t.config.useNewEmptyQueryMessages?"EmptyScopeMessageNew":"EmptyScopeMessage","EmptyEmailSubMessage")}};t.ScopeConfig[i.People]={icon:{content:"&#xE716",type:2},prefixesLocString:"ScopePeople",enabledDataSources:[r("SSUE",1,!0,function(){return!t.config.ssPeopleOff}),r("SSUC",2,!0),a(!0),v(!0),y(!0),],enabledDataSourcesForZeroInput:[r("SSUE",1,!0,function(){return!t.config.ssPeopleOff}),r("SSUC",2,!0),],showUpsellOnSuggestionsList:function(){return s()},getEmptyZIMessages:function(n){return u(n,i.People,t.config.useNewEmptyQueryMessages?"EmptyScopeMessageNew":"EmptyScopeMessage","EmptyPeopleSubMessage")}};t.ScopeConfig[i.PeopleEmail]={icon:{content:"&#xE716",type:2},prefixes:["People","people","email","Email"],prefixesLocString:null,enabledDataSources:t.ScopeConfig[i.People].enabledDataSources.concat(t.ScopeConfig[i.Emails].enabledDataSources),enabledDataSourcesForZeroInput:t.ScopeConfig[i.People].enabledDataSourcesForZeroInput,showUpsellOnSuggestionsList:function(){return s()},getEmptyZIMessages:function(n){return u(n,i.PeopleEmail,t.config.useNewEmptyQueryMessages?"EmptyScopeMessageNew":"EmptyScopeMessage","EmptyPeopleSubMessage")}};t.ScopeConfig[i.AppsSettings]={icon:{content:"&#xEB3B",type:2},prefixes:["Apps/Settings","apps","app","settings","setting"],prefixesLocString:null,enabledDataSources:t.ScopeConfig[i.Apps].enabledDataSources.concat(t.ScopeConfig[i.Settings].enabledDataSources).filter(function(t){return!n.contains(["OSTMA","QS",n.WebDataSource],t.dataSource)}),enabledDataSourcesForZeroInput:t.ScopeConfig[i.Apps].enabledDataSourcesForZeroInput.concat(t.ScopeConfig[i.Settings].enabledDataSourcesForZeroInput).filter(function(t){return!n.contains(["OSTMA","QS",n.WebDataSource],t.dataSource)}),getEmptyZIMessages:function(n){return f(n,i.AppsSettings,!1)}};t.ScopeConfig[i.FilesFolders]={icon:{content:"&#xE7C3",type:2},prefixes:["Files/Folders","documents","document","docs","doc","files","file","music","image","images","photo","photos","picture","pictures","video","videos"],prefixesLocString:null,enabledDataSources:t.ScopeConfig[i.Documents].enabledDataSources.concat(t.ScopeConfig[i.Folders].enabledDataSources,t.ScopeConfig[i.Photos].enabledDataSources,t.ScopeConfig[i.Music].enabledDataSources,t.ScopeConfig[i.Videos].enabledDataSources),enabledDataSourcesForZeroInput:t.ScopeConfig[i.Documents].enabledDataSourcesForZeroInput.concat(t.ScopeConfig[i.Folders].enabledDataSourcesForZeroInput,t.ScopeConfig[i.Photos].enabledDataSourcesForZeroInput,t.ScopeConfig[i.Music].enabledDataSourcesForZeroInput,t.ScopeConfig[i.Videos].enabledDataSourcesForZeroInput),getEmptyZIMessages:function(n){return f(n,i.FilesFolders,!1)}};t.ScopeConfig[i.AllFiles]={icon:{content:"&#xE7C3",type:2},prefixes:["Files","documents","document","docs","doc","files","file","music","image","images","photo","photos","picture","pictures","video","videos"],prefixesLocString:null,enabledDataSources:t.ScopeConfig[i.Documents].enabledDataSources.concat(t.ScopeConfig[i.Folders].enabledDataSources,t.ScopeConfig[i.Photos].enabledDataSources,t.ScopeConfig[i.Music].enabledDataSources,t.ScopeConfig[i.Videos].enabledDataSources),enabledDataSourcesForZeroInput:t.ScopeConfig[i.Documents].enabledDataSourcesForZeroInput.concat(t.ScopeConfig[i.Folders].enabledDataSourcesForZeroInput,t.ScopeConfig[i.Photos].enabledDataSourcesForZeroInput,t.ScopeConfig[i.Music].enabledDataSourcesForZeroInput,t.ScopeConfig[i.Videos].enabledDataSourcesForZeroInput),getEmptyZIMessages:function(n){return f(n,i.AllFiles,!1)}};for(var h in t.ScopeConfig)t.ScopeConfig[h].enabledDataSources=t.ScopeConfig[h].enabledDataSources.filter(function(i){return n.contains(t.config.enabledDataSources,i.dataSource)}),t.ScopeConfig[h].enabledDataSourcesForZeroInput=t.ScopeConfig[h].enabledDataSourcesForZeroInput.filter(function(i){return n.contains(t.config.enabledDataSources,i.dataSource)})}function ri(){c=null}function ut(t,i){var f=t.getConnectedAccountInfo(0),e=t.getConnectedAccountInfo(1),r=!!(f||e),u=i&&n.isBingEnabled();return r&&u?"EmptyScopeSearchLocation_PCCloudAndWeb":r?"EmptyScopeSearchLocation_PCAndCloud":u?"EmptyScopeSearchLocation_PCAndWeb":"EmptyScopeSearchLocation_PC"}function f(n,i,r){return u(n,i,t.config.useNewEmptyQueryMessages?"EmptyScopeMessageNew":"EmptyScopeMessage","EmptyScopeSubMessage",ut(n,r))}function u(n,i,r,u,f){var e=ft(t.ScopeConfig[i],n).toLocaleLowerCase(),o=f?n.getLocString(f):"",s=n.getLocString(r,e,o),h=t.config.useNewEmptyQueryMessages||t.RuntimeConfig.QfMode==6?n.getLocString(u,e,o):"";return[s,h]}function ui(n){var f=function(n){return HitHighlightingParser.removeDiacritics(n.toLocaleLowerCase().trim())},r,u;if(c={},t.RuntimeConfig.ScopesAvailable){r=function(r){var e=parseInt(r),u=t.ScopeConfig[e],o,s;e!=i.All&&l(e,u)&&(!u.prefixes&&u.prefixesLocString&&(o=n.getLocString(u.prefixesLocString),s=n.getEnUsLocString(u.prefixesLocString),u.prefixes=et(o,s)),u.prefixes&&u.prefixes.forEach(function(n){return c[f(n)]=e}))};for(u in t.ScopeConfig)r(u)}}function ft(n,t){if(n.scopeNameLocString)return t.getLocString(n.scopeNameLocString);if(n.prefixes)return n.prefixes[0].trim();if(n.prefixesLocString){var i=et(t.getLocString(n.prefixesLocString));return i[0].trim()}return""}function et(n,t){var i=n;return t&&(i+=","+t),i.search(d)>-1&&(i=i.replace(d,",")),i.split(",")}function l(r,u){var c=t.RuntimeConfig.AlwaysWide?t.config.enabledScopesAlwaysWide:t.config.enabledScopes,f,s,e,o,h;if(!n.contains(c,i[r])||r==i.Web&&!n.isBingEnabled())return!1;if(u.showUpsellOnSuggestionsList&&u.showUpsellOnSuggestionsList())return!0;for(f=t.config.enabledDataSources.filter(function(t){return t!=n.MRUDataSource}),n.isBingEnabled()&&r!=i.Web&&(f=f.filter(function(t){return t!=n.WebDataSource})),s=function(n){ht(n,null)||(f=f.filter(function(t){return t!=n.dataSource}))},e=0,o=u.enabledDataSources;e<o.length;e++)h=o[e],s(h);return u.enabledDataSources.some(function(t){return n.contains(f,t.dataSource)})?!0:!1}function ot(n){switch(t.RuntimeConfig.QfMode){case 5:return t.ScopeConfig[i.All_FileExplorer];case 6:return t.ScopeConfig[i.All_Lockscreen];case 7:return t.ScopeConfig[i.All_SettingsApp];case 9:return t.ScopeConfig[i.All_ControlPanel];case 8:return t.ScopeConfig[i.All_Santorini];case 10:return t.ScopeConfig[i.All_WebDesktop];default:return t.ScopeConfig[w(n)]}}function fi(r,u,f,e,o){var c,a,k,v,y,p,h,b;o||(o={});var d=o.topHitRestriction,g=o.forceGroupOnTop,nt=o.overrideAction,tt=o.overrideActionHandlerAsync,it=o.inorganic,rt=o.serpURLParams,s=n.parseQuery(r,u,d);if(s.fullPartialQuery=s.queryToFetch,s.scope=l(i.All,t.ScopeConfig[i.All])?i.All:i.AppsSettings,s.forceGroupOnTop=g,s.overrideAction=nt,s.overrideActionHandlerAsync=tt,s.inorganic=it,s.serpURLParams=rt,si(s,e))s.taskFrame=e,s.isFormulatedQuery=!0,c=t.ScopeConfig[w(s)];else{for(s.fullPartialQuery&&(ei(s),f&&s.scope!=f.scope&&(s.isFormulatedQuery=!0)),s.isSearchHomeZI=!s.queryToFetch&&(t.RuntimeConfig.SearchHomeAvailable==1||t.RuntimeConfig.SearchHomeAvailable==2&&s.scope!=i.All),(s.scope==i.All||s.scope==i.Web)&&(a=n.tryParseUrl(s.queryToFetch,!0),a&&a.type==0?(s.isProtocol=!0,s.fixedUrl=n.cleanAndFixUrlProtocol(a)):st.test(s.queryToFetch)&&(s.isProtocol=!0,s.fixedUrl=n.cleanAndFixUrlProtocol(s.queryToFetch))),c=ot(s),k=s.queryToFetch?c.enabledDataSources:c.enabledDataSourcesForZeroInput,s.availableDataSources={},v=0,y=k;v<y.length;v++)h=y[v],n.contains(t.config.enabledDataSources,h.dataSource)&&(s.availableDataSources[h.dataSource]=h);s.enabledDataSources={};for(p in s.availableDataSources)h=s.availableDataSources[p],h.suggestionGroupToggler&&h.suggestionGroupToggler.isHidden()||(s.enabledDataSources[p]=h);b=s.queryToFetch?c.staticGroupOrder:c.staticGroupOrderForZeroInput;b&&(s.staticGroupOrder=b(s))}return oi(s,c),s.showProgressBar=t.isL2(s)&&t.config.dataSourcesWithProgressBar.some(function(n){return!!s.enabledDataSources[n]}),s.equals=function(n){return(s.queryToFetch?s.queryToFetch.toLowerCase():s.queryToFetch)==(n.queryToFetch?n.queryToFetch.toLowerCase():n.queryToFetch)&&n.scope==s.scope&&(n.taskFrame?n.taskFrame.raw:"")==(s.taskFrame?s.taskFrame.raw:"")&&n.topHitRestriction==s.topHitRestriction},s.getCacheKey=function(){return s.cursorPosition+s.queryToFetch.toLocaleLowerCase()+s.scope+t.regionCache},s}function ei(r){var e,h,o,u,s;if(t.RuntimeConfig.ScopesAvailable){if(e=n.isDataSourceEnabled("PT",null),h=e&&p.test(r.fullPartialQuery),h){r.canBePathCompletion=!0;r.scope=i.PathCompletion;return}if(o=HitHighlightingParser.removeDiacritics(r.originalQuery),u=o.match(/^(([^:：]+)[:：]\s*)(.*)/)||t.config.forwardSlashScopes&&o.match(/(\/(\w+)\s*)(.*)/),u){var l=u[1],f=u[2],a=u[3];(f=f.toLocaleLowerCase(),s=f.trim(),n.contains(Object.keys(c),s))&&(r.queryToFetch=a,r.cursorPosition=Math.max(0,r.originalCursorPosition-l.length),n.mantainCursorPositionIn(r.queryToFetch,r.cursorPosition,n.cleanQuery,function(n,t){r.queryToFetch=n;r.cursorPosition=t}),r.scope=c[s],r.scopePrefix=f,r.isMultiWord=n.isMultiWord(r.queryToFetch),r.canBePathCompletion=e&&p.test(r.queryToFetch))}}}function ht(i,r){for(var e,u=0,f=i.requirements||[];u<f.length;u++){e=f[u];switch(e){case 1:if(t.config.disableOfflineRequest&&!n.isBrowserOnline())return!1;break;case 2:if(!n.isBingEnabled())return!1}}return i.conditionalRequirements&&!i.conditionalRequirements(r)?!1:!0}function oi(i,r){var c=t.RuntimeConfig.QfMode==5&&i.fullPartialQuery.search(":")>=0,h,u,f,o,s;if(c){i.enabledDataSources={};return}for(n.disableWebDataSourceIfNeeded(i,t.getMarketForBingAvailability()),h=i.queryToFetch?r.enabledDataSources:r.enabledDataSourcesForZeroInput,u=0,f=h;u<f.length;u++)o=f[u],ht(o,i)||n.disableDataSources(i,o.dataSource);i.queryToFetch||(s=e.queryFormulationView.searchHistory,s&&s.isDeviceHistoryEnabled||n.disableDataSources(i,"PP","LRA","FL","LM","IFF"));t.TweakSearch&&t.TweakSearch.disableDataSourcesBasedOnTweakSearch(i)}function si(i,r){var u,h,o,f,s,e;if(r&&(u=r.scope,h=t.ScopeConfig[r.scope],l(u,t.ScopeConfig[u])&&(o=t.ScopeConfig[u].enabledDataSources.filter(function(n){return ai(n.dataSource,r)}),o.length>0))){for(f=0,s=o;f<s.length;f++)e=s[f],n.contains(t.config.enabledDataSources,e.dataSource)&&(i.enabledDataSources[e.dataSource]=e);return h}return null}function hi(t){var r=n.safeExecute(function(){return JSON.parse(t)},"parseTaskFrame"),u;return r&&(u=ci(r),u!=i.All)?{raw:t,parsed:r,scope:u}:null}function ci(n){switch(n.Uri){case ct:var r=n,t=r.FileType;if(t&&t.Value){if(t.Value=="Picture")return i.Photos;if(t.Value=="Video")return i.Videos}return i.Documents;case lt:return i.Emails}return i.All}function w(n){return n?n.taskFrame?n.taskFrame.scope:n.scope:undefined}function li(n){var e,t,o,s,h,u,c,r,f,l;if(n.taskFrame&&(e=n.taskFrame.parsed,e))if(n.taskFrame.scope==i.Emails){if(t=e,o=t.Subject,o&&o.Value)return o.Value;if(r=t.Body,r&&r.Value)return r.Value;if(s=t.From&&t.From.length>0?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 ai(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"MDOC":case"MPHO":case"MVID":return r!="onedrive"&&r!="sharepoint";case"SSEE":return r!="thispc"&&r!="onedrive";default:return!1}}function vi(n){b=n}function h(i){var r=""+i,u=function(){var n=b.getItem(k)||"";return n.split(",")},f=function(n){var t=n.join(",");b.setItem(k,t)};return{isHidden:t.config.enableSearchHomeCustomization?function(){return n.safeExecute(function(){return u().some(function(n){return n==r})},"GroupToggler.isHidden")}:function(){return!1},toggle:function(t){n.safeExecute(function(){var n=u(),i;t&&n.every(function(n){return n!=r})?(n.push(r),f(n)):t||(i=n.findIndex(function(n){return n==r}),i>-1&&(n.splice(i,1),f(n)))},"GroupToggler.toggle")}}}var e=SearchAppWrapper.CortanaApp,i,c,st,p,ct,lt,b,k;(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.Files=7]="Files";n[n.Folders=8]="Folders";n[n.Web=9]="Web";n[n.PathCompletion=10]="PathCompletion";n[n.Emails=11]="Emails";n[n.People=13]="People";n[n.AppsSettings=14]="AppsSettings";n[n.FilesFolders=15]="FilesFolders";n[n.AllFiles=16]="AllFiles";n[n.PeopleEmail=17]="PeopleEmail";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.All_Santorini=1004]="All_Santorini";n[n.All_WebDesktop=1005]="All_WebDesktop"})(i=t.Scope||(t.Scope={}));var d=/،/g,at=["PP","QP","IBA","TOPL"],vt=["ST","QS","SSTS"],g=["LI","LV","MU"],yt=["FL","LDOC","FD"].concat(g),pt=[i.Documents,i.Folders,i.Photos,i.Videos,i.Music];t.isApp=wt;t.isSetting=bt;t.isMedia=kt;t.isFileOrFolder=dt;t.isFileOrFolderScope=gt;t.substrateProvidersEnabled=nt;t.bingAtWorkProviderEnabled=ni;t.searchHistoryAllowed=it;t.setZeroInputDataSourcesForL1=ii;t.populateScopeConfig=rt;rt();t.cleanScopePrefixes=ri;t.initScopePrefixes=ui;t.getScopeDisplayName=ft;t.isScopeEnabled=l;t.getScopeConfig=ot;t.isMobileCache=e.isMobile||navigator.userAgent.toLowerCase().includes("xbox one")||navigator.userAgent.toLowerCase().includes("hololens");t.windowsAccountType=0;st=/^ht+ps?[;:]+|^www[.。]|^\/+/;p=/^[a-z]:\\|^%[^%]+%\\|^\\/i;t.parseQuery=fi;t.parseTaskFrame=hi;ct="action://FindMyStuff/FindDocument";lt="action://FindMyStuff/FindMessage";t.getEffectiveScope=w;t.getEffectiveQuery=li;k="HiddenSuggestionGroups";t.initQueryParser=vi})(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){function lt(n,t){return n.type==t.type&&n.source==t.source}function vt(n){switch(n){case"PP":return"Apps";case"ST":return"Settings";case"FL":return"Files";case"LM":return"Media";default:return null}}function yt(n){switch(n){case"FL":case"LM":case"IFF":case"MFF":case"PT":case"CG":case"MDOC":case"MFOL":case"MPHO":case"MVID":case"MMUS":case"FEH":case"AFC":case"LDIC":return!0;case"OSTMA":case"QS":case"BW":case"PP":case"LRA":case"ST":case"MPP":case"MST":case"IBA":case"THST":case"TOPP":case"QSCH":case"LSQS":case"TOPS":case"WWE":case"WPB":return!1}throw new Error("New local data source "+n+" needs to be explicity classified as potentially containing PII or not");}function pt(n){var t=o(n);return n.deviceItem&&n.handoffType==2?t+"\t"+n.deviceItem.id:t+"\t"+n.query}function v(n){switch(n.type){case"BKS":case"ML":case"MB":case"OS":case"RI":case"HS":return!0}switch(n.handoffType){case 1:case 17:case 13:case 16:case 0:case 11:case 14:return!0}return!1}function y(n){switch(n){case"MFF":case"FL":case"LM":case"IFF":case"MDOC":case"MPHO":case"MVID":case"MMUS":case"MFOL":return!0;default:return!1}}function wt(n,i){if(!t.IndexerQueryGenerator)return!1;if(t.RuntimeConfig.QfMode==5)return!0;switch(n){case"IBA":case"MDOC":case"MPHO":case"MVID":case"MMUS":case"MFOL":return!0;case"IFF":return tt(i)||!t.config.minLengthForIBAonL1||i.queryToFetch.length>=t.config.minLengthForIBAonL1;default:return!1}}function bt(n){return SearchAppWrapper.CortanaApp.hostingEnvironment==4?!0:t.RuntimeConfig.MiniSERPMode==0||n.previewPaneType!=1?!1:n.isAnswer?(t.RuntimeConfig.MiniSERPMode&1)!=0:n.type=="MD"?(t.RuntimeConfig.MiniSERPMode&2)!=0:(t.RuntimeConfig.MiniSERPMode&4)!=4?!1:n.query.length>=t.config.minPrefixLengthForMiniSerp}function kt(n){return y(n)||n=="IBA"}function dt(n){return n&&(n.tagName.toLowerCase()=="body"||n.tagName.toLowerCase()=="iframe"||n.className&&n.classList.contains("suggestion"))}function gt(n){return n.kind=="Modern Setting"}function p(n){return t.isApp(n.type)?n.deviceItem:null}function ni(n){var t=p(n);return t?t.packageFamilyName:null}function ti(n){return t.isFileOrFolder(n.type)?n.deviceItem:null}function w(){return!0}function ii(n){return!!n.suggestions}function ri(n){return w(n.type)?n.deviceItem:null}function ui(n){return n.type=="CG"?n.deviceItem:null}function fi(n){return n.type=="PT"?n.deviceItem:null}function ei(n){return n&&n.classList.contains("scopeTile")}function o(n){if(typeof n.staticGroupType=="number")return n.staticGroupType;if(t.RuntimeConfig.QfMode==8&&v(n))return i.SearchSuggestions;if(t.config.newFilesScope2&&(n.type=="FL"||n.type=="FD"||n.type=="MU"||n.type=="LI"||n.type=="LV"))return i.Documents;switch(n.type){case"TOPL":return i.TopApps}if(t.isApp(n.type))return i.Apps;if(h(n))return n.groupType;if(t.isSetting(n.type))return i.Settings;switch(n.type){case"CG":return i.Command;case"PT":return i.PathCompletion;case"LI":return i.Photos;case"LV":return i.Videos;case"MU":return i.Music;case"FL":case"LDOC":case"SDFE":return i.Documents;case"FD":return i.Folders;case"OLE":case"OWA":return i.Emails;case"PPL":return i.People;case"BKS":return i.Bookmarks;case"ELA":return i.LocalPlaces;case"FEH":return i.LocalSearchHistory;case"SNSC":case"RSSG":return i.QuickSearch;case"LSQS":return i.LockscreenQuickSearch;default:switch(n.handoffType){case 3:return i.Store;case 5:case 4:return i.Cortana;case 10:return n.htmlContent?i.SearchSuggestions:i.Cortana;case 0:case 13:case 14:return i.SearchSuggestions;case 1:return i.Websites;case 18:return i.ActivityFeedSuggestions}throw new Error("Unexpected handoff type: "+n.handoffType);}}function oi(n){return n.click&&!n.instItem}function s(n){switch(n){case i.JumpListTasks:case i.JumpListPinned:case i.JumpListRecent:case i.JumpListFrequent:case i.JumpListCustom:return!0;default:return!1}}function b(t){return t.notAResult&&!n.contains(["SW","PWL","SSTS"],t.type)}function si(n){return t.config.recourseOnlyInGroups&&n.suggestions.every(function(n){return b(n)})}function hi(n){var t=n.type;return s(t)||t==i.Related||t==i.Contact}function ci(n){if(s(n))return i.Apps;if(n==i.Related)return i.SearchSuggestions;if(n==i.Contact)return i.People;throw new Error("Not a top hit child group: "+n);}function h(n){return!!n.parent}function li(n){return n.type=="JL"}function k(n){switch(n){case i.Apps:case i.Store:return t.Scope.Apps;case i.Settings:return t.Scope.Settings;case i.Documents:return t.Scope.Documents;case i.Folders:return t.Scope.Folders;case i.Photos:return t.Scope.Photos;case i.Videos:return t.Scope.Videos;case i.Music:return t.Scope.Music;case i.LocalPlaces:case i.SearchSuggestions:case i.Websites:case i.Bookmarks:return t.Scope.Web;case i.Emails:return t.Scope.Emails;case i.People:return t.Scope.People}return t.Scope.All}function ai(n){if(t.RuntimeConfig.QfMode==8&&n==1)return 32;switch(n){case 0:case 6:case 7:case 8:return 32;case 1:return 16;case 2:return t.IconSize_GridLayout_Scaled;case 3:return 24;case 4:return 64;case 5:return 200}throw new Error("Unsupported image size: "+n);}function vi(n,t,i){if(n&&n.type==0&&rt(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 yi(){var n=t.uiLanguageCache.toLocaleLowerCase();return d[n]||n}function g(n,t,i,r,u,f,e,o,s,h,c,l,a){var v={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};return v.previewPaneType=fr(n,v,a),v}function pi(t,i,r,u,f,e,o,s,h){var c=t.getInstrumentedSyntheticSuggestion(r,u),v,l;return c?c:(v=i.scope,c=g(i,null,null,f,u,null,n.InstrumentedItem.getNonSuggestionInstrumentedItem(u,a.KValues),e,r,!1,u),c.notAResult=!0,c.primaryMetadata=o,s&&(c.additionalInfoText=" - "+c.primaryMetadata),l=function(n){c.query=n.queryToFetch;c.text=HitHighlightingParser.addMarkers(n.queryToFetch);c.narratorText=nt(c);c.click=function(){return h(c,n)}},l(i),c.updateFromQuery=function(n){return!n.isProtocol&&n.scope==v&&n.queryToFetch?(l(n),!0):!1},t.instrumentSyntheticSuggestion(r,c),c)}function nt(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 tt(n){return n.scope!=t.Scope.All||!!n.taskFrame}function it(n){return typeof n=="string"?n=="LI"||n=="LV":n==i.Photos||n==i.Videos}function rt(n){return it(n)||n=="PPL"}function wi(n){return!t.config.disableMediaGridLayout&&!t.RuntimeConfig.AlwaysWide&&it(n)}function bi(n,i){var f,u,e,r;if(!n||!t.RuntimeConfig.ScopesAvailable)return null;if(i.scope==t.Scope.All){if(f=[],n.ISUPN&&n.ISUPG)if(u=n.ISUPN.split("\t"),e=n.ISUPG.split("\t"),u.length==e.length)for(r=0;r<u.length;r++)f.push(e[r]+"\t"+u[r]);else SharedLogHelper.LogError("parseWebSuppressionSignals",null,new Error("parsedNames.length != parsedGroups.length"));return{fullySuppressedGroups:n.FSUP?n.FSUP.split("\t"):null,partiallySuppressedGroups:n.PSUP?n.PSUP.split("\t"):null,suppressedSuggestions:f}}return null}function ki(t){return r||(r=_d.createElement("span")),n.safeExecute(function(){return r.innerHTML=t,r.innerText},t,"decodeHtml")}function di(n,t){return{matchType:n,matchedText:t}}function ft(n){return n.replace(ut,"\\$&")}function gi(n,t){if(t){var u=n.includes(HitHighlightingParser.startMarker),e=u?n:HitHighlightingParser.addMarkers(n,t),f=HitHighlightingParser.split(e).find(function(n){return n.highlighted});if(f){var r=u?HitHighlightingParser.removeMarkers(n):n,o=new RegExp("((?:\\\\[^\\\\]+)?\\\\[^\\\\]+)?\\\\"+ft(f.text)+".*","i"),i=o.exec(r);if(i&&i[0])return{matchType:c.Location,matchedText:r.startsWith(i[0])?r:String.fromCharCode(8230)+i[0]}}}return null}function nr(n,t){if(t){var r=n.includes(HitHighlightingParser.startMarker),o=r?n:HitHighlightingParser.addMarkers(n,t),u=HitHighlightingParser.split(o).find(function(n){return n.highlighted});if(u){var f=r?HitHighlightingParser.removeMarkers(n):n,s=new RegExp("(?:\\S+\\s){0,3}\\b"+ft(u.text)+"\\S*(?:\\s\\S+){0,5}","i"),i=s.exec(f),e=void 0;return i&&i[0]&&(e={matchType:c.Content,matchedText:i[0]}),[f,e]}}return[null,null]}function tr(n,t){return n&&t&&HitHighlightingParser.addMarkers(n,t).includes(HitHighlightingParser.startMarker)}function ir(n){return n==t.Scope.Emails}function rr(n){return n.isAnswer&&(n.handoffType==13||n.handoffType==14||n.handoffType==0&&(!!n.additionalInfoText||!!n.secondaryIcon))}function ur(n){if(h(n))return!1;switch(n.handoffType){case 0:case 13:case 14:case 5:case 10:case 4:return!0;case 3:return n.type=="STS";case 2:return n.type=="SDFE";case 8:case 12:return n.type=="OWA";default:return!1}}function fr(r,u,f){var e=undefined,s;if(!t.RuntimeConfig.PreviewPaneAvailable||r.isSearchHomeZI)return e;if(s=function(){return n.isBingEnabled()&&n.contains([0,13,14],u.handoffType)&&!u.htmlContent?1:e},f)return s();switch(o(u)){case i.Store:return(t.RuntimeConfig.AlwaysWide||t.config.enableLocalPreviewPaneInSingleColumn)&&u.type!="STS"?2:e;case i.Apps:case i.Cortana:case i.Command:case i.Documents:case i.Folders:case i.Music:case i.PathCompletion:case i.Emails:case i.Photos:case i.Settings:case i.Videos:return t.RuntimeConfig.AlwaysWide||t.config.enableLocalPreviewPaneInSingleColumn?2:e;case i.People:return u.handoffType==0?1:u.handoffType==1?e:u.handoffType==17?3:t.RuntimeConfig.AlwaysWide||t.config.enableLocalPreviewPaneInSingleColumn?2:e;case i.Bookmarks:return u.handoffType==17?3:s();case i.Websites:return n.isBingEnabled()&&u.type!="LURL"?1:e;default:return s()}}function er(){return t.RuntimeConfig.QfMode==2?null:t.regionCache}function or(n,t,i){var r=i.previewPaneType,u,f;return r?(u=t.previewPaneType,f=r==1&&u==1,t.query.toLocaleLowerCase()==i.query.toLocaleLowerCase()&&(!f&&r==u||f&&t.handoffType==i.handoffType)):!1}function sr(n){return n==null}function hr(r,u){return r==i.Documents&&t.isSubstrateO365AccountConnected||t.isFileOrFolderScope(k(r))&&n.isDataSourceEnabled("ODC",u)}function cr(n,t){switch(n){case 2:return"OneDrive";case 3:return t.getLocString("OneDriveForBusiness");case 4:return"SharePoint";case 1:return t.getLocString("ThisPC");case 5:return t.getLocString("MsbPeopleGroups");case 6:return t.getLocString("MsbPeopleContacts")}return null}function lr(n){if(st())switch(n){case 37:return 39;case 39:return 37}return n}function ar(){return{content:"&#xE721",type:2}}function vr(n,t){return n.getLocString(t?"SearchWorkAndWeb":"SearchTheWeb")}function yr(n){return n.getLocString("Websites")}function pr(n,t){return n.getLocString(t?"SeeWorkAndWebResults":"SeeWebResults")}function wr(t){return n.isDataSourceEnabled("MSBC",t)}function br(n,t){var i="b_hide";n&&(t?n.classList.remove(i):n.classList.add(i))}function st(){return ThresholdUtilities.isRightToLeftLanguage(t.uiLanguageCache)}function kr(){u={}}function ht(t){var i=u[t],r;return typeof i=="undefined"&&(r=SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch,r.getFolderPathFromKnownFolderIdGuid?(i=n.safeExecute(function(){return r.getFolderPathFromKnownFolderIdGuid(t)},"getPathFromFolderID","",t),i=i.toLocaleLowerCase()):i="",u[t]=i),i}function dr(){f={}}function gr(n){var t,i;return n.startsWith("{")?(t=f[n],t||(i=n.match(ct),t=i?ht(i[1])+i[2]:n,f[n]=t),t):n}function nu(n){return n.startsWith("file:")&&(n=n.slice(5)),n.replace(/\//g,"\\")}function tu(n){return t.config.enforceOriginalOrderForTypes[n.type]||t.config.enforceOriginalOrderForTypes[n.type+"|"+n.handoffType]}function iu(n){switch(n){case 2:return 0;case 1:return 1;default:throw new Error("Not a logged in account: "+n);}}function ru(n){return n==1?"https://substrate.office.com":"https://substrate.office.com/SubstrateSearch-Internal.ReadWrite"}function uu(n){return n==1?"https://www.bing.com/cortana":"service::cortana.bing.com::mbi_ssl"}function fu(){return!1}function eu(n){return t.TweakSearch&&t.TweakSearch.isTweakSearchEnabled()?t.config[n]:undefined}function ou(){return t.config.skipSelectedScope&&t.RuntimeConfig.AlwaysWide}function su(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hu(){return(t.config.enableEdgeUpsellSearchHome||t.config.enableEdgeUpsellSearchHome2||t.config.enableEdgeUpsellSearchHomeBanner)&&t.RuntimeConfig.PreviewPaneAvailable&&!t.upsellDismissed&&(t.config.forceEdgeUpsell||e())}function cu(){return(t.config.enableEdgeUpsellBottom||t.config.enableEdgeUpsellTop)&&!t.upsellDismissed&&(t.config.forceEdgeUpsell||e())}function lu(i){return t.config.enableTopSites&&n.isBingEnabled()&&t.config.supportedRecommendedSitesMarkets[i.toLowerCase()]&&(t.config.skipWinVersionCheck||e())}function au(i){return(t.config.supportedQuickAnswersMarkets[i]||t.config.quickAnswerIcon||t.config.quickAnswerWeb)&&t.RuntimeConfig.PreviewPaneAvailable&&t.RuntimeConfig.QfMode!=0&&n.isBingEnabled()&&n.isBrowserOnline()||t.RuntimeConfig.QfMode==8}function vu(i){return t.RuntimeConfig.PreviewPaneAvailable&&(t.RuntimeConfig.QfMode===1||t.RuntimeConfig.QfMode===2)&&t.config.trendingSearch&&t.config.supportedTrendingSearchesMarkets[i.toLowerCase()]&&n.isBingEnabled()&&n.isBrowserOnline()}function yu(n){return t.config.enableSnipSearchV2&&(t.config.enableSnipSearchInternational||t.regionCache.toLowerCase()=="us"&&t.uiLanguageCache.toLowerCase()=="en-us")&&n.isBitmapInClipboardSupported()}function pu(i){return t.config.liveTiles&&t.config.liveTiles.weather&&t.RuntimeConfig.PreviewPaneAvailable&&t.RuntimeConfig.QfMode===1&&t.config.weatherTileMarkets[i.toLowerCase()]&&n.isBrowserOnline()}function e(){return(t.windowsAccountType==2||t.windowsAccountType==3)&&[4,27,].indexOf(t.config.osSKU)==-1}function l(){return t.config.enableWWEUpsell&&(SearchAppWrapper.CortanaApp.entryPoint=="19h1wwe"||SearchAppWrapper.CortanaApp.entryPoint=="19h2wwe")}function wu(){return l()&&!t.RuntimeConfig.PreviewPaneAvailable}function bu(){var i=new n.LightweightStorage;return t.config.enableWSBPromo&&!l()&&!i.getItem("PromoCovidDismissed")&&t.RuntimeConfig.AlwaysWide}var i,a,at,d,r,c,ut,et,ot,u,f,ct;(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.PromoBanner=41]="PromoBanner";n[n.GroupHeader=104]="GroupHeader"})(i=t.GroupType||(t.GroupType={}));t.sameGroup=lt,function(n){n.KValues=function(){var n={};return n.GPT=108,n.GT=109,n.GW=110,n.SW=114,n.PWL=115,n.STS=116,n.SBI=117,n.SBV=118,n.SDSC=119,n.SDIO=120,n.IMIO=121,n.COFA=122,n.COOA=124,n.SDFE=126,n.OWA=128,n.OMCS=129,n.OMIO=130,n.OMCN=131,n.OMCD=132,n.OMAC=133,n.OMSC=134,n.OMVA=135,n.SSTS=136,n.AFOT=137,n.SNSC=138,n.RWBD=139,n.RWBN=140,n.ADS=141,n.EUP=142,n.EUD=143,n.WPB=144,n}();n.HandoffsForNonSuggestions=function(){var n={};return n.GPT=2,n.GT=3,n.GW=0,n.SDSC=2,n.SDIO=2,n.IMIO=2,n.COFA=2,n.COOA=2,n}();n.GroupsForNonSuggestions=function(){var n={};return n.GPT=i.GroupHeader,n.GT=i.GroupHeader,n.GW=i.GroupHeader,n.SDSC=i.Settings,n.SDIO=i.Settings,n.IMIO=i.Settings,n.COFA=i.Settings,n.COOA=i.Settings,n}()}(a=t.SyntheticQSCodesMaps||(t.SyntheticQSCodesMaps={})),function(n){n[n.Open=1]="Open";n[n.RunAs=2]="RunAs";n[n.RunAsUser=3]="RunAsUser";n[n.OpenInBrowser=4]="OpenInBrowser";n[n.OpenFileLocation=5]="OpenFileLocation";n[n.OpenContaining=6]="OpenContaining";n[n.TabletMode_OpenNewWindow=7]="TabletMode_OpenNewWindow";n[n.PinToStartScreen=8]="PinToStartScreen";n[n.StartUnpin=9]="StartUnpin";n[n.TaskbarUnpin=10]="TaskbarUnpin";n[n.StartPin=11]="StartPin";n[n.TaskbarPin=12]="TaskbarPin";n[n.Manage=13]="Manage";n[n.ConnectNetworkDrive=14]="ConnectNetworkDrive";n[n.DisconnectNetworkDrive=15]="DisconnectNetworkDrive";n[n.Uninstall=16]="Uninstall";n[n["Tile.Uninstall"]=17]="Tile.Uninstall";n[n.ItemProperties=18]="ItemProperties";n[n.Settings=19]="Settings";n[n.Review=20]="Review";n[n.Share=21]="Share";n[n.S_Open=1e3]="S_Open";n[n.S_Install=1001]="S_Install";n[n.S_CopyFullPath=1002]="S_CopyFullPath";n[n.S_SendEmail=1003]="S_SendEmail";n[n.S_SendInstantMessage=1004]="S_SendInstantMessage";n[n.S_CopyPersonDetails=1005]="S_CopyPersonDetails";n[n.S_OpenFileLocationInBrowser=1006]="S_OpenFileLocationInBrowser";n[n.S_OpenInOutlookWeb=1007]="S_OpenInOutlookWeb";n[n.S_LaunchOutlookNative=1008]="S_LaunchOutlookNative";n[n.S_OpenInBrowser=1009]="S_OpenInBrowser"}(at=t.JumplistActionItemType||(t.JumplistActionItemType={}));t.GroupHeaderQSCodes=function(){var n={};return n[i.PathCompletion]="GPT",n[i.Store]="GT",n[i.SearchSuggestions]="GW",n[i.ActivityFeedSuggestions]="AFOT",n[i.TopApps]="ADS",n[i.WelcomeExperience]="WWE",n[i.PromoBanner]="WPB",n[i.Upsell]="EUD",n}();t.providerFailureLogName=vt;t.localDataSourceMayContainPII=yt;t.getSuggestionKey=pt;t.MRUDatabaseName="mruWithIndex";t.isSantoriniWeb=v;t.isFileOrFolderLocalDataSource=y;t.supportsShortcuts=wt;t.shouldOpenMiniSerp=bt;t.isIndexerBasedDataSource=kt;t.isBodyOrSuggestion=dt;t.isModernSetting=gt;t.getAppItem=p;t.getAppPfn=ni;t.getFileItem=ti;t.isItemWithFileMetadata=w;t.isGroup=ii;t.getItemWithFileMetadata=ri;t.getCommandLineItem=ui;t.getPathCompletionItem=fi;t.isScopeTile=ei;t.getGroupType=o;t.canGoToL2=oi;t.isJumpListGroup=s;t.isRecourse=b;t.useMoreSearchOptionsHeader=si;t.isTopHitChildGroup=hi;t.getParentSuggestionGroupType=ci;t.isChildSuggestion=h;t.isJumpListSuggestion=li;t.getScope=k;t.IconSize_GridLayout=92;t.IconSize_GridLayout_Medium=68;t.IconSize_GridLayout_Scaled=130;t.getImageSizeValue=ai;t.populateImageRatio=vi;d={"zh-hans-cn":"zh-cn","zh-hans-sg":"zh-cn","zh-hant-hk":"zh-hk","zh-hant-tw":"zh-tw",ko:"ko-kr",ja:"ja-jp",nb:"nb-no"};t.getCurrentLanguage=yi;t.createSuggestion=g;t.getSyntheticSuggestion=pi;t.getNarratorText=nt;t.isL2=tt;t.iconIsThumbnail=rt;t.displayedInGridLayout=wi;t.parseWebSuppressionSignals=bi;t.decodeHtml=ki,function(n){n[n.Author=1]="Author";n[n.LastModifiedBy=2]="LastModifiedBy";n[n.Content=3]="Content";n[n.Tags=4]="Tags";n[n.Album=5]="Album";n[n.Artist=6]="Artist";n[n.Genre=7]="Genre";n[n.Location=8]="Location"}(c=t.MatchType||(t.MatchType={}));t.createMatch=di;ut=/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g;t.tryGetLocationMatch=gi;t.tryGetTextContentMatch=nr;t.matchesOnPropertyHH=tr;t.uses3lineTemplate=ir;t.isLightAnswer=rr;t.hasReverseHighlighting=ur;t.getMarketForBingAvailability=er;t.isEquivalentForPreviewPanePurposes=or;t.isNullOrUndefined=sr;et=function(){function t(n,t){this.callback=n;this.counter=0;this.expired=!1;this.isBlocked=t}return t.prototype.check=function(n){this.expired||this.isBlocked||!n&&this.counter!=0||(this.callback(),this.expired=!0)},t.prototype.increase=function(){++this.counter;this.check(!1)},t.prototype.decrease=function(){if(this.counter==0)throw new Error("already zero");--this.counter;this.check(!1)},t.prototype.unblock=function(t){var i=this;if(!this.isBlocked)throw new Error("already unblocked");if(typeof t=="number"&&t<0)throw new Error("invalid timeout");this.isBlocked=!1;this.check(t===0);typeof t!="number"||this.expired||n.safeSetTimeout(function(){return i.check(!0)},t,"Semaphore.unblock")},t}();t.Semaphore=et;ot=function(){function n(n,t,i){this.verb=n.verb;this.displayName=n.displayName;this.executeSync=n.executeSync?function(){return i(function(){return n.executeSync()})}:function(){return i(function(){return n.executeAsync()})};this.isDefault=n.isDefault;this.icon=t;this.getIcon=n.getIcon}return n}();t.DeviceItemVerbWrapper=ot;t.shouldSetThisPcGroupSource=hr;t.getGroupSourceDisplayName=cr;t.IndexingOptionsSettingId="Classic_{87d66a43-7b11-4a28-9811-c86ee395acf7}";t.EdgeAppIds=["MSEdge","Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge"];t.getRtlAdjustedKey=lr;t.getSearchSuggestionIcon=ar;t.getWebSuggestionsGroupHeader=vr;t.getWebsitesGroupHeader=yr;t.getWebSuggestionAnnotation=pr;t.msbEnabledForQuery=wr;t.setVisibility=br;t.isRtl=st;t.FOLDERID_Profile="{5E6C858F-0E22-4760-9AFE-EA3317B67173}";t.FOLDERID_SkyDrive="{A52BBA46-E9E1-435f-B3D9-28DAA648C0F6}";t.FOLDERID_System="{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}";t.FOLDERID_SystemX86="{D65231B0-B2F1-4857-A4CE-A8E7C6EA7D27}";u={};t.clearFolderCaches=kr;t.getKnownFolderPathLC=ht;f={};t.clearPathExpansionCache=dr;ct=/^\{([a-z0-9-]{36})\}(.*)/i;t.resolveKnownFolderGUIDsInPath=gr;t.indexerFilePathToRegularPath=nu;t.enforceOriginalOrder=tu;t.accountTypeToAuthType=iu;t.getSubstrateResourceOrScope=ru;t.getBingResourceOrScope=uu;t.isSmallerAnswersUX=fu;t.getTweakedSetting=eu;t.shouldSkipSelectedScope=ou;t.escapeRegExp=su;t.canShowSearchHomeUpsell=hu;t.canShowQFUpsell=cu;t.shouldEnableTopSites=lu;t.shouldEnableQuickSearches=au;t.shouldEnableTrendingSearches=vu;t.shouldEnableSnipSearch=yu;t.shouldEnableWeatherTile=pu;t.isConsumerWindowsSKU=e;t.isWWEVisibile=l;t.isWWEVisibleSinglePane=wu;t.isWPBVisibile=bu})(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t,i,r;(function(n){n.checking="checking";n.downloading="downloading";n.error="error";n.noUpdate="noupdate";n.obsolete="obsolete";n.updateReady="updateready"})(t||(t={}));i=[t.checking,t.downloading,t.error,t.noUpdate,t.obsolete,t.updateReady];r=function(){function r(n,t,i){i===void 0&&(i=Date.now);this._autoSuggestHost=n;this._instrumentationHelper=t;this.getNowTimestamp=i;this._appCacheEventIndex=1;this._superFreshEnabled=!1;this._appCache=_w.applicationCache;this.subscribeForEvents()}return r.prototype.instrumentSuperFreshUpdate=function(n){this._appCacheTimeline||(this._appCacheTimeline=this.createAppCacheTimelineObject());this._appCacheTimeline.SuperFreshUpdateData.T=this.getNowTimestamp();this._appCacheTimeline.SuperFreshUpdateData.S=n;this.sendAppCacheEvents()},r.prototype.registerSuperFresh=function(){this._superFreshEnabled=!0},r.prototype.subscribeForEvents=function(){var n=this;i.forEach(function(t,i){return sj_be(n._appCache,t,function(){return n.handleAppCacheEvent(t,i)})})},r.prototype.handleAppCacheEvent=function(n,i){n!=t.checking&&this._appCacheTimeline||(this._appCacheTimeline=this.createAppCacheTimelineObject());this._appCacheTimeline.AppCacheEvents[i]=this.getNowTimestamp();switch(n){case t.obsolete:SharedLogHelper.LogWarning("handleAppCacheEvent",null,"AppCache marked as obsolete and will be deleted");this.sendAppCacheEvents();break;case t.error:case t.noUpdate:this.sendAppCacheEvents();break;case t.updateReady:this._superFreshEnabled||this.sendAppCacheEvents()}},r.prototype.sendAppCacheEvents=function(){var f=_G.ServerIG,t,r,u,i;if(!f){SharedLogHelper.LogError("sendAppCacheEvents","Could not instrument as server IG not known",new Error("Could not instrument app cache event"));return}(t=this._appCacheTimeline,t)&&(r=t.AppCacheEvents,u=[{I:t.EventIndex,E:r,S:t.SuperFreshUpdateData,ABT:this._instrumentationHelper.getConversationStartTimestamp()}],r[2]&&(u[0].OL=navigator.onLine),i=n.InstrumentationCommon.createPerfPingEvent(f,u,"AppCache",this._autoSuggestHost.getConversationId()),Log2.LogEvent(i.EventType,i.Data,n.InstrumentationCommon.QFPERFPING_EVENT_NAME,null,null,i.ImpressionGuid,null,null),this._appCacheTimeline=this.createAppCacheTimelineObject())},r.prototype.createAppCacheTimelineObject=function(){var n={EventIndex:this._appCacheEventIndex,AppCacheEvents:{},SuperFreshUpdateData:{T:undefined,S:undefined}};return this._appCacheEventIndex++,n},r}();n.AppCacheInstrumentationHelper=r}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var u=["PP","ST","FL","LM"],i=SearchAppWrapper.CortanaApp,r=i.queryFormulationView,f=function(){function f(n){var i=this;this._host=n;this._startupPerfLogged=!1;t.config.logTimeToFocus&&(n.bindConversationStart(function(){return i._startupPerfLogged=!1}),n.bindQueryChangedOrInitialized(function(n){return i.logClientPerfMetric(n)}));ThresholdUtilities.getCortanaHeaders(function(n){n&&(i._windowsFlights=n["X-BM-WindowsFlights"])})}return f.prototype.logProfilerMarker=function(t,r,u,f,e){e||(e={});n.safeExecute(function(){t==1?i.logMeasure("Bing_QF_"+u,r,"QF",JSON.stringify(e),f):i.logVerboseTrace("Bing_QF_"+u,r,"QF",JSON.stringify(e),f)},"logProfilerMarker")},f.prototype.getEnrichedClientInfo=function(n){var u={},f,e;return u.entryPoint=i.entryPoint,u.previousExperience=r.previousExperience,u.qfMode=""+t.RuntimeConfig.QfMode,u.isSearchHome=n.isSearchHomeZI?1:undefined,u.region=t.regionCache||undefined,u.lang=t.uiLanguageCache||undefined,f=this._host.getFeatureDWORD("WideAtStartupDelta"),f.validFeature&&typeof f.featureValue=="number"&&(u.WideAtStartupDelta=f.featureValue),n&&n.scope!=t.Scope.All&&(u.scope=t.Scope[n.scope]),e=r.searchHistory,u.deviceHistoryEnabled=e&&e.isDeviceHistoryEnabled?1:0,t.windowsAccountType!=0&&(u.windowsAccount=t.windowsAccountType.toString()),t.isSubstrateO365AccountConnected&&(u.o365Connected=1),t.isSubstrateOutlookAccountConnected&&(u.outlookConnected=1),this._host.hasFallbackHappened()&&(u.fallback=1),this._host.isClientLocationAvailable()&&(u.clientLocationAvailable=1),this._host.isInputPanelVisible()&&(u.isInputPaneVisible=1),t.isMobileCache||(i.appsUseLightTheme===!1&&(u.darkMode=1),i.colorPrevalenceEnabled&&(u.colorPrevalence=1),i.isSearchBoxInTaskbar&&(u.searchBoxInTaskbar=1),i.taskbarOrientation&&(u.taskbarOrientation=i.taskbarOrientation)),t.config.snrVersion&&(u.snrVersion=t.config.snrVersion),t.config.osSKU&&(u.osSKU=t.config.osSKU),u.ciVersion=t.ConstraintIndex.currentCIVersion,u.defaultBrowser=this._host.getDefaultBrowser().toString(),this._windowsFlights&&(u.windowsFlights=this._windowsFlights),u},f.prototype.getSuggestionsPageName=function(){return"Page.SmartSearch.AS.Suggestions"},f.prototype.getApplicationName=function(){return"SmartSearch"},f.prototype.getRankerModelId=function(){return t.config.mainRankerId},f.prototype.createNonSuggestionDataSourceObject=function(n,i){return{T:"D.Url",K:i.getKValue(),Val:n,Ho:t.SyntheticQSCodesMaps.HandoffsForNonSuggestions[n],Gr:t.SyntheticQSCodesMaps.GroupsForNonSuggestions[n],NR:1,Properties:i.getProperties()}},f.prototype.createDataSourceObject=function(i){var f=this,e=i.mayContainPII&&!t.config.th,r={T:"D.Url",K:i.instItem.getKValue(),Q:e?undefined:i.query,MQ:i.ciMatchedQuery?i.ciMatchedQuery:undefined,Val:i.type,Ho:i.handoffType,Ans:i.isAnswer?1:undefined,Gr:t.getGroupType(i),HC:i.hc?1:undefined,RAF:i.useRaf?1:undefined,HS:i.fromHistory?1:undefined,F:i.features.length>0?i.features.join(","):undefined,AC:i.autoCompleteType?i.autoCompleteType:undefined,HCMS:i.highConfidenceMetaSuggestionScore,HCS:i.highConfidenceSuggestionScore,LM:i.suggestionLogMeta,Uri:i.actionUri,Src:i.source,Sg:i.segments,NR:i.notAResult?1:undefined},u;return i.deviceItem?r.DeviceSignals=n.safeExecute(function(){return f.buildDeviceItemDataSource(e,i)},"buildDeviceItemDataSource"):t.isJumpListSuggestion(i)&&(r.DeviceSignals=n.safeExecute(function(){return f.buildJumpListItemDataSource(i)},"buildJumpListItemDataSource")),t.config.th&&(u=i,u.path&&(r.path=u.path),u.targetPathLC&&(r.targetPath=u.targetPathLC)),r.RankerSignals=this.buildRankerOutputDataSource(i),r},f.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}},f.prototype.buildJumpListItemDataSource=function(i){var u=i.jumpListItem,r={Rank:u.usagePoints||undefined,LAD:n.isValidDate(u.lastAccessed)?u.lastAccessed.toJSON():undefined};if(t.config.th)r.path=u.path,r.description=i.tooltip;else if(!r.Rank&&!r.LAD)return undefined;return r},f.prototype.buildDeviceItemDataSource=function(i,r){var e=r.deviceItem,u={Rank:e.rankScore},f,s,h,o;if(e.propertyHits&&e.propertyHits.length>0&&(u.PHits=e.propertyHits.join(",")),i||(u.Id=e.id,u.DName!=r.query&&(u.DName=e.displayName)),t.config.th&&(u.kind=e.kind),t.isSetting(r.type))return u.MDN=t.isModernSetting(e)?1:0,u;if(f=t.getAppItem(r),f)return u.LAD=n.isValidDate(f.lastAccessed)?f.lastAccessed.toJSON():undefined,u.AppLnch=f.totalLaunches,u.Args=f.launchArguments?1:0,u.MDN=f.isImmersive?1:0,u.Ext=f.extension,t.config.th&&(u.CDT=n.isValidDate(f.createdDate)?f.createdDate.toJSON():undefined,u.LMD=n.isValidDate(f.lastModifiedDate)?f.lastModifiedDate.toJSON():undefined,u.launchArguments=f.launchArguments,u.filePath=f.filePath),u;if(s=t.getItemWithFileMetadata(r),s){if(u.Ext=s.extension,t.config.th&&(u.itemTypeDisplayName=s.itemTypeDisplayName),h=t.getCommandLineItem(r),h)return t.config.th&&(u.launchArguments=h.launchArguments,u.encodedPath=h.encodedPath),u;t.getPathCompletionItem(r)||(o=r.deviceItem,u.CDT=n.isValidDate(o.createdDate)?o.createdDate.toJSON():undefined,u.LMD=n.isValidDate(o.lastModifiedDate)?o.lastModifiedDate.toJSON():undefined,u.Ext=o.extension?o.extension:"")}return u},f.prototype.logMasterPageImpression=function(t){n.safeExecute(function(){return ThresholdInst.LogPageImpression(t,null,t.enrichedClientInfo)},"logMasterImpressionForClient")},f.prototype.logDataSourceTimeout=function(i,f){var s,e,o,h;if(r.logProviderFailure)for(s=function(u){n.isDataSourceEnabled(u,f)&&!n.contains(i,u)&&n.safeExecute(function(){return r.logProviderFailure(t.providerFailureLogName(u),"NoReturnForTopHit")},"logProviderFailure")},e=0,o=u;e<o.length;e++)h=o[e],s(h)},f.prototype.onItemClick=function(){r.resetConversationIdNextTimeQFIsShown&&r.resetConversationIdNextTimeQFIsShown()},f.prototype.logClientPerfMetric=function(){if(!this._startupPerfLogged&&i.isCenterScreen){this._startupPerfLogged=!0;var f=n.cleanGuid(this._host.getRawImpressionGuid()),r=this.getClientPerfMetric(39),u=this.getClientPerfMetric(38),t=u-r;(t<=0||r==n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE||u==n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE)&&(t=n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE);Log2.LogEvent("ClientPerf",{TTF:t.toString()},"SearchBoxFocused",null,null,f,null,null)}},f.prototype.getClientPerfMetric=function(t){var r=n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,u=i.proactiveView?i.proactiveView.perfMetrics:null;if(u)try{r=u.lookup(t).getTime();r=r<=0?n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE:r}catch(f){}return r},f}();t.WSBInstrumentationProvider=f})(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t="/QF_KEYSTROKE_VIRTUAL_URL?",i="autosuggest",r=function(){function r(t,i,r){var u=this;this._host=t;this._instrumentationProvider=i;this._clientTelemetry=r;this._conversationStartTimestamp=n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE;this._firstRenderOccurred=!1;this._keystrokesPerfPingData={};this._keystrokesInstrumentationData={};this._finalizeKeystrokeHandlers=[];ClientInstConfig.queueDumpInterval=n.config.logQueueDumpInterval;_w.ClTrCo.SharedClickSuppressed=!0;t.bindConversationStart(function(){return u.onConversationStart()})}return r.prototype.bindFinalizeKeystroke=function(n){this._finalizeKeystrokeHandlers.push(n)},r.prototype.getImpressionGuid=function(n){var t=this._keystrokesInstrumentationData[n];if(t&&t.ImpressionGuid)return t.ImpressionGuid;throw"getImpressionGuid(): No IG for sequence "+n;},r.prototype.updateSuggestionsList=function(n,t){this._clientTelemetry&&this._clientTelemetry.updateSuggestionsList(n,t)},r.prototype.instrumentFetchesBegin=function(n){var t=this;this.safeInstrumentPerf(n,function(n){n.DataSourcesFetchBegin=t.getOffsetedNow()},"instrumentFetchesBegin",null)},r.prototype.instrumentFetchesEnd=function(n){var t=this;this.safeInstrumentPerf(n,function(n){n.DataSourcesFetchEnd=t.getOffsetedNow()},"instrumentFetchesEnd",null)},r.prototype.instrumentDataSourceParsed=function(n,t){var i=this;this.safeInstrumentPerf(n,function(n){n.ResponseParsed[t]=i.getOffsetedNow()},"instrumentDataSourceParsed",t)},r.prototype.instrumentItemClickForPreviewPane=function(n,t,i,r,u,f,e,o,s){var h=this.createBaseCustomGPingPayload(u,f);this.addPreviewPaneDataToGPingPayload(h,e,o,s);this.instrumentItemClickAndGPing(h,n,t,i,r,u)},r.prototype.instrumentItemClickForContextMenu=function(n,t,i,r,u,f,e){var o=this.createBaseCustomGPingPayload(u,f);this.addContextMenuDataToGPingPayload(o,e);this.instrumentItemClickAndGPing(o,n,t,i,r,u)},r.prototype.instrumentItemClick=function(n,t,i,r,u,f){if(t.getHandoffType()==999)this.instrumentLayoutItemSelect(t,i);else{var e=this.createBaseCustomGPingPayload(u,f);this.instrumentItemClickAndGPing(e,n,t,i,r,u)}},r.prototype.instrumentItemClickAndGPing=function(t,i,r,u,f,e){this.sendCustomGPing(t,r.getHValue(),i);var s=this._keystrokesInstrumentationData[u],o=this._keystrokesInstrumentationData[u];o?(s.RenderingStarted||this.updatePageIG(u),_G.IG!=o.ImpressionGuid&&SharedLogHelper.LogError("instrumentItemClick","IG ("+o.ImpressionGuid+") for sequenceNumber "+u+" 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)")),this._clientTelemetry&&this._clientTelemetry.logItemClickedMeasure(o.ConversationId,o.RawImpressionGuid,r,e)):SharedLogHelper.LogError("instrumentItemClick","sequenceNumber: "+u+" ConversationID: "+this._host.getConversationId(),new Error("No instrumentation data found for sequenceNumber"));this.finalizeKeystrokeLog(u,1);f&&f();this._instrumentationProvider.onItemClick();n.config.forceLogFlush?Log2.ForceFlush():Log2.FlushMainQueueDontForce();_w.clickFlushedTime=sb_gt()},r.prototype.instrumentLayoutItemSelect=function(n,t){var i={AppNS:n.getAppNS(),K:n.getLayoutKValue()};this.logClientInstEvent("Select","ItemClicked",t,i)},r.prototype.createBaseCustomGPingPayload=function(n,t){var i={};switch(n){case 1:i.i="k";i.mk=this.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=this.getModifierKeyCodes(t);break;default:i.mk=this.getModifierKeyCodes(t)}return i},r.prototype.addContextMenuDataToGPingPayload=function(n,t){n.cm=t},r.prototype.addPreviewPaneDataToGPingPayload=function(n,t,i,r){t&&(n.pp=t,i&&(n.ppit=i),typeof r=="number"&&(n.rho=r))},r.prototype.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.prototype.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.prototype.previewPaneOpenedOrClosed=function(n,t,i,r,u,f){var o=this,s=n?"Select":"Unselect",h=n?"PreviewPaneOpened":"PreviewPaneClosed",e;this.logClientInstEvent(s,h,t,f);n&&(this.safeInstrumentPerf(t,function(n){n.PreviewPaneOpened={L:o.getOffsetedNow(),T:r}},"instrumentPreviewPaneOpened",null),this.notifyPreviewPanePending(t,!1));n&&this._clientTelemetry&&(e=this._keystrokesInstrumentationData[t],e&&this._clientTelemetry.logPreviewPaneOpenedMeasure(i,r,u))},r.prototype.logClientInstEvent=function(n,t,i,r){var f=null,u;i&&(u=this._keystrokesInstrumentationData[i],u&&(f=u.ImpressionGuid));Log2.LogEvent(n,r,t,null,null,f,null,null)},r.prototype.safeInstrument=function(n,t,i,r){var u=this._keystrokesInstrumentationData[n];u?t(u):SharedLogHelper.LogError(i,(r?r+" ":"")+" sequenceNumber: "+n,new Error("No instrumentation data found for sequenceNumber"))},r.prototype.safeInstrumentPerf=function(n,t,i,r){var u=this._keystrokesPerfPingData[n];u?t(u):SharedLogHelper.LogError(i,(r?r+" ":"")+" sequenceNumber: "+n,new Error("No instrumentation data found for sequenceNumber"))},r.prototype.instrumentRenderingStarted=function(n){var t=this;this.safeInstrument(n,function(i){i.RenderingStarted=!0;t.updatePageIG(n)},"instrumentRenderingStarted")},r.prototype.instrumentBeginRequest=function(t,i,r){var e;delete this._keystrokesInstrumentationData[t-1];n.InstrumentedItem.resetKValues(t);e=this._keystrokesPerfPingData[t];e&&SharedLogHelper.LogError("instrumentBeginRequest","sequenceNumber: "+t,new Error("Duplicate BeginRequest for sequenceNumber"));var f=this._host.getConversationId(),u=this._host.getRawImpressionGuid(),o=n.cleanGuid(u),s=n.getCurrentTime()-r,h={RawImpressionGuid:u,ImpressionGuid:o,ConversationId:f,Query:i,PendingDataSources:{},DataSources:{},RankerExtraInfo:{},DuplicateDS:{},Layout:[],MasterPageImpressionCreated:!1,RenderingStarted:!1,PendingInstrumentedItems:{},PendingSyntheticSuggestions:{},OriginalTimestamp:s},c={RawImpressionGuid:u,ImpressionGuid:o,ConversationId:f,PrefixLength:i.queryToFetch?i.queryToFetch.length:0,RequestBegin:this.getOffsetedNow(s),ResponseReceived:{},MultipleResponsesReceived:{},DataSourcesState:this._searchServiceStatus?{Indexer:this._searchServiceStatus}:undefined,RenderFinished:{},AllDataSourcesProcessed:!1,PendingIcons:0,PreviewPanePending:!1,TopResultRendered:[],IconsRetrieved:{},ResponseFromCache:{},DataSourcesFetchBegin:0,DataSourcesFetchEnd:0,ResponseParsed:{},PreviewPaneOpened:{}};this._keystrokesInstrumentationData[t]=h;this._keystrokesPerfPingData[t]=c;this._clientTelemetry&&this._clientTelemetry.logNewKeystrokeMeasure(f,u,i)},r.prototype.setSearchServiceStatus=function(n){this._searchServiceStatus=n},r.prototype.instrumentResponseReceived=function(t,i,r,u,f){var e=this;this.safeInstrumentPerf(t,function(t){if(!f){var o=e.getOffsetedNow();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))}r&&(t.DataSourcesState=t.DataSourcesState||{},t.DataSourcesState[i]=r);u&&(t.ResponseFromCache[i]=u)},"instrumentResponseReceived",i)},r.prototype.instrumentTopResultRendered=function(t,i){var r=this;this.safeInstrumentPerf(t,function(u){var f=r.getOffsetedNow(),e;u.TopResultRendered.push({V:f,T:i.join(",")});r.tryInstrumentRenderStopped(t,u);r._clientTelemetry&&(e=f-r._keystrokesPerfPingData[t].RequestBegin,r._clientTelemetry.logTopResultsRenderedMeasure(u.RawImpressionGuid,i,e));n.config.th&&n.safeFireEvent("TopResultRendered")},"instrumentTopResultRendered")},r.prototype.instrumentRenderedLocalSuggestion=function(n,t){var r=this._keystrokesInstrumentationData[n],u,f,i;if(r){for(u={},f={},i=0;i<t.length;i++)t[i].type=="FV"?u[i]="TBD":t[i].type=="HU"&&(f[i]="TBD");r.FvSug=u;r.HuSug=f}},r.prototype.instrumentAggregatorCall=function(t,i){var r=this;this.safeInstrument(t,function(t){var e={fastRankModelId:r._instrumentationProvider.getRankerModelId()},f,u;for(f in t.RankerExtraInfo)e[f]=t.RankerExtraInfo[f];t.RankerExtraInfo={};u={T:"D.Aggregator",Service:n.InstrumentationCommon.DEFAULT_SERVICE_NAME,Scenario:"Aggregator",AppNS:n.InstrumentationCommon.DEFAULT_APP_NAMESPACE,DS:[],rankerModelIds:e};n.config.counterFactualLoggingOn&&(u.counterFactualDiff=u.counterFactualDiff||i);t.DataSources.aggregator=u},"instrumentAggregatorCall")},r.prototype.addDuplicatesDataSource=function(t){var i=Object.keys(t.DuplicateDS).map(function(n){return t.DuplicateDS[n]});i.length>0&&(t.DataSources.duplicates={T:"D.Duplicates",Service:n.InstrumentationCommon.DEFAULT_SERVICE_NAME,Scenario:"Duplicates",AppNS:n.InstrumentationCommon.DEFAULT_APP_NAMESPACE,DS:i})},r.prototype.instrumentDuplicate=function(t,i,r){this.safeInstrument(t,function(t){var u=t.DuplicateDS[i.instItem.getHValue()],f;u||(u={T:"D.Duplicate",DS:[{T:"D.DSRef",KRef:i.instItem.getKValue()}]},i.instItem.getAppNS()!=n.InstrumentationCommon.DEFAULT_APP_NAMESPACE&&(u.DS[0].AppNS=i.instItem.getAppNS()),t.DuplicateDS[i.instItem.getHValue()]=u);f={T:"D.DSRef",KRef:r.instItem.getKValue()};r.instItem.getAppNS()!=n.InstrumentationCommon.DEFAULT_APP_NAMESPACE&&(f.AppNS=r.instItem.getAppNS());u.DS.push(f)},"instrumentDuplicate")},r.prototype.renderingStopped=function(n){return n.PendingIcons==0&&n.AllDataSourcesProcessed},r.prototype.notifyAllDataSourcesProcessed=function(n){var t=this;this.safeInstrumentPerf(n,function(i){i.AllDataSourcesProcessed=!0;t.tryInstrumentRenderStopped(n,i)},"notifyAllDataSourcesProcessed")},r.prototype.notifyIconPending=function(t,i,r,u){var f=this;this.safeInstrumentPerf(t,function(t){var e=r+(i?"T":"S");t.IconsRetrieved[e]||(t.IconsRetrieved[e]={B:f.getOffsetedNow(),E:n.InstrumentationCommon.QFPERFPING_INVALID_MEASURE,T:u},t.PendingIcons++)},"notifyIconPending",i?"TR":"SUG")},r.prototype.notifyIconReady=function(n,t,i){var r=this;this.safeInstrumentPerf(n,function(n){var u=i+(t?"T":"S");n.IconsRetrieved[u]?n.IconsRetrieved[u].E=r.getOffsetedNow():SharedLogHelper.LogError("notifyIconReady",null,new Error("Instrumenting unseen icon"));n.PendingIcons--},"notifyIconReady",t?"TR":"SUG")},r.prototype.notifyPreviewPanePending=function(n,t){this._keystrokesPerfPingData[n].PreviewPanePending=t},r.prototype.tryInstrumentRenderStopped=function(t,i){this.renderingStopped(i)&&(i.PreviewPanePending||this.finalizeKeystrokeLog(t,2),n.config.th&&n.safeFireEvent("RenderStopped"))},r.prototype.isLayoutLogged=function(n){return this._keystrokesInstrumentationData[n].MasterPageImpressionCreated},r.prototype.finalizeKeystrokeLog=function(n,t){var r,i;t===void 0&&(t=0);this._finalizeKeystrokeHandlers.forEach(function(n){return n(t==0)});r=this._keystrokesInstrumentationData[n];r&&this.logKeystrokeData(r,n);t!=1&&(i=this._keystrokesPerfPingData[n],i&&(this.logPerfPingEvent(this.createKeystrokePerfPingEvent(n,i)),this._clientTelemetry&&this._clientTelemetry.logDataSourcePerformancesMeasure(i)))},r.prototype.instrumentZiRendered=function(n){this._instrumentationProvider.logProfilerMarker(1,0,"ZiRendered",this.getImpressionGuid(n),{})},r.prototype.instrumentRenderFinished=function(n,t,i,r){var u=this;!this._firstRenderOccurred&&r&&(this._firstRenderOccurred=!0,this._instrumentationProvider.logProfilerMarker(1,0,"FirstRender",this.getImpressionGuid(n),{}));this.safeInstrumentPerf(n,function(r){var f=u.getOffsetedNow();t.forEach(function(n){return r.RenderFinished[n]=f});u.tryInstrumentRenderStopped(n,r);u._clientTelemetry&&u._clientTelemetry.logGroupsRenderedMeasure(i)},"instrumentRenderFinished",t.join(","))},r.prototype.instrumentSyntheticInstrumentedItem=function(n,t,i){var r=this._keystrokesInstrumentationData[n];r?r.PendingInstrumentedItems[t]=i:SharedLogHelper.LogError("instrumentSyntheticInstrumentedItem",t,new Error("keystrokesInstrumentationData not found"))},r.prototype.instrumentSyntheticSuggestion=function(n,t){var i=this._keystrokesInstrumentationData[n];i?i.PendingSyntheticSuggestions[t.type]=t:SharedLogHelper.LogError("instrumentSyntheticSuggestion",t.type,new Error("Instrumentation synthetic suggestion after flush"))},r.prototype.getInstrumentedSyntheticSuggestion=function(n,t){return this._keystrokesInstrumentationData[n].PendingSyntheticSuggestions[t]},r.prototype.instrumentDataSource=function(n,t,i,r){this.safeInstrument(n,function(n){var u,f,e;if(r&&r.rankerExtraInfo)for(u in r.rankerExtraInfo)n.RankerExtraInfo[u]=r.rankerExtraInfo[u];f=i||[];e=n.PendingDataSources[t];n.PendingDataSources[t]=e?e.concat(f):f},"instrumentDataSource",t)},r.prototype.processPendingDataSources=function(t){var i,f,r,u,e,o;for(i in t.PendingDataSources)if(f=t.PendingDataSources[i],f.length>0){for(r=[],u=0,e=f;u<e.length;u++)o=e[u],r.push(this._instrumentationProvider.createDataSourceObject(o));i=="Web"&&(i="WebAS");r.length>0&&(t.DataSources[i]={T:"D."+i,AppNS:n.InstrumentationCommon.DEFAULT_APP_NAMESPACE,Service:n.InstrumentationCommon.DEFAULT_SERVICE_NAME,Scenario:i,SC:r.length,DS:r})}t.PendingDataSources={}},r.prototype.instrumentSnRProviderFetchUrl=function(n,t){this.safeInstrument(n,function(n){n.SnRProviderFetchUrl=t},"instrumentSnRProviderFetchUrl")},r.prototype.onConversationStart=function(){if(this._conversationStartTimestamp=n.getCurrentTime(),this._searchServiceStatus=null,this._firstRenderOccurred=!1,this._clientTelemetry){var t=this._host.getConversationId();this._clientTelemetry.logConversationStartMeasure(t,this._conversationStartTimestamp)}this._keystrokesPerfPingData=[]},r.prototype.getConversationStartTimestamp=function(){return this._conversationStartTimestamp},r.prototype.logDataSourceTimeout=function(n,t){this._instrumentationProvider.logDataSourceTimeout(n,t)},r.prototype.createKeystrokePerfPingEvent=function(t,i){var u={I:t,PL:i.PrefixLength,K:i.RequestBegin,F:i.DataSourcesFetchEnd,PPO:i.PreviewPaneOpened,RRT:i.ResponseReceived,RPT:i.ResponseParsed,MRT:i.MultipleResponsesReceived,RFT:i.RenderFinished,TRR:i.TopResultRendered,RS:undefined,IRT:i.IconsRetrieved},r,f,e,o,s;if(this.renderingStopped(i)){for(r=0,f=0,e=u.TRR;f<e.length;f++)o=e[f],r=Math.max(r,o.V);for(s in u.RFT)r=Math.max(r,u.RFT[s]);r&&(u.RS=r)}return n.InstrumentationCommon.createPerfPingEvent(i.ImpressionGuid,[u],"Keystroke",i.ConversationId,i.DataSourcesState,i.ResponseFromCache)},r.prototype.updatePageIG=function(n){_G.IG=this.getImpressionGuid(n)},r.prototype.createMasterPageImpression=function(t,r,u,f,e){var c=this,h={dataSources:e||[],layoutNodes:[],pageName:t,rawQuery:f?f.queryToFetch:"",isQuery:!1,impressionUrl:this.createVirtualImpressionURL(r,u),appName:this._instrumentationProvider.getApplicationName(),enrichedClientInfo:{FDPartnerEntry:i,nclid:_G.nclid,isOffline:n.isBrowserOnline()?0:1,webRequested:u?1:0}},o=n.safeExecute(function(){return c._instrumentationProvider.getEnrichedClientInfo(f)},"getEnrichedClientInfo"),s;if(o)for(s in o)h.enrichedClientInfo[s]=o[s];return h},r.prototype.logKeystrokeData=function(i){var u,f,r;(this.processPendingDataSources(i),n.config.th&&this.addDuplicatesDataSource(i),u=Object.keys(i.DataSources).map(function(n){return i.DataSources[n]}).concat(this.createNonSuggestionsDataSource(i.PendingInstrumentedItems,i.PendingSyntheticSuggestions)),i.DataSources={},i.PendingSyntheticSuggestions={},i.PendingInstrumentedItems={},u.length==0&&i.MasterPageImpressionCreated)||(i.RenderingStarted&&(f=DsLManager.CreateLayoutNode(_d.body,n.InstrumentationCommon.DEFAULT_APP_NAMESPACE,!1,!0,i.MasterPageImpressionCreated)),i.MasterPageImpressionCreated?Log2.LogEvent("ClientInst",null,null,u,f,i.ImpressionGuid,null,null):(r=this.createMasterPageImpression(this._instrumentationProvider.getSuggestionsPageName(),t,i.SnRProviderFetchUrl?i.SnRProviderFetchUrl.substring(i.SnRProviderFetchUrl.indexOf("?")+1):"",i.Query,u),f&&(r.layoutNodes=f),i.FvSug&&Object.keys(i.FvSug).length>0&&(r.enrichedClientInfo.FvSug=i.FvSug),i.HuSug&&Object.keys(i.HuSug).length>0&&(r.enrichedClientInfo.HuSug=i.HuSug),r.clientTimestamp=i.OriginalTimestamp,this.logMasterPageImpression(i.ImpressionGuid,r),i.MasterPageImpressionCreated=!0))},r.prototype.logPerfPingEvent=function(t){Log2.LogEvent(t.EventType,t.Data,n.InstrumentationCommon.QFPERFPING_EVENT_NAME,null,null,t.ImpressionGuid,null,null);n.config.th&&ClientTestHooks.DebugLogNoConsole("perfPingEvent",[t])},r.prototype.logMasterPageImpression=function(t,i){if(i){if(!t){SharedLogHelper.LogError("logMasterPageImpression",null,new Error("Missing impressionGuid"));return}i.impressionGuid=t;this._instrumentationProvider.logMasterPageImpression(i,this._host.getConversationId());n.config.th&&ClientTestHooks.DebugLogNoConsole("masterPageImpression",i,t)}},r.prototype.instrumentInitializationFinish=function(t){var u=_G.ServerIG,i,r;if(!u){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,r=_w.performance,r&&r.timing&&(i=r.timing.navigationStart),!(i<=0)){var f=t.getTime()-i,e=n.getCurrentTime()-i,o=[{BLT:f,ILT:e}],s=n.InstrumentationCommon.createPerfPingEvent(u,o,"Load");this.logPerfPingEvent(s)}},r.prototype.getOffsetedNow=function(t){return t===void 0&&(t=n.getCurrentTime()),t-this._conversationStartTimestamp},r.prototype.createNonSuggestionsDataSource=function(t,i){var r=[],u,f;for(u in t)r.push(this._instrumentationProvider.createNonSuggestionDataSourceObject(u,t[u]));for(u in i)r.push(this._instrumentationProvider.createDataSourceObject(i[u]));return r.length?(f={T:"D.ContentGroup",AppNS:n.InstrumentationCommon.DEFAULT_APP_NAMESPACE,Service:n.InstrumentationCommon.DEFAULT_SERVICE_NAME,Scenario:"NonSuggestions",SC:r.length,DS:r},[f]):[]},r.prototype.createVirtualImpressionURL=function(t,i){var r=n.getWindowProtocol()+"//"+n.getWindowHost()+t;return r+=i?i:n.Service.QueryParams.ConversationId+"="+n.encodeQueryParameter(this._host.getConversationId()),_G.ServerIG&&(r+="&ASInitIG="+n.encodeQueryParameter(_G.ServerIG)),r},r}();n.InstrumentationHelper=r}(AutoSuggest||(AutoSuggest={})),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,r,u){if(r===void 0&&(r=Date.now),u===void 0&&(u=n.getWindowProtocol()+"//"+n.getWindowHost()),this._host=t,this._searchPreCacheHandler=i,this.getNowTimestamp=r,this._baseUrl=u,n.config.overrideHost){var f=n.getWindowHost();f.startsWith("www.")&&(this._baseUrl=n.getWindowProtocol()+"//"+n.config.overrideHost+f.substring(3))}}return a.prototype.getSearchUrl=function(t,i,r,u,e,o,s,h,a){var b=e===13?"images":e===14?"videos":"",v,y,p,w;return u||(u=(b?"/"+b:"")+"/search?q="+n.encodeQueryParameter(i)),v=this._baseUrl+u,v+=n.config.th&&ClientTestHooks.isTesthookParamSet("isWindowsTest")?"&form=MONITR&traffictype=wintest":"&form="+n.encodeQueryParameter(o||this._host.getFormCode()),a&&(v+=c+"1"),v=this.enrichUrlWithSuggestionType(v,h?"P":r),v=this.enrichUrlWithCvid(v),n.config.suppressPqParameter||(v+="&pq="+n.encodeQueryParameter(t)),y=this._host.getMSNRefIg(),y&&(v+="&refig="+y),v=this.enrichUrlWithMarketInfo(v),v=this.enrichUrlWithDeviceInfo(v),s||(v=this.enrichUrlWithMuidInfo(v),p=this._host.getElToken(),p&&this._baseUrl.startsWith("https:")&&(v+=f+n.encodeQueryParameter(p)),v=this.enrichUrlWithSafeSearchInfo(v),this._searchPreCacheHandler&&(v=this._searchPreCacheHandler.attempPreCacheAndEnrichUrl(v))),w=this._host.getSafeSearchSetting(),w&&(v+=l+w),v},a.prototype.getImageSearchUrl=function(t){var i=this._baseUrl;return i+=t?"/images/detail/upload?FORM=SBIWSB":"/images/search?view=detailv2&iss=sbiupload",n.config.th&&ClientTestHooks.isTesthookParamSet("isWindowsTest")&&(i+="&isWindowsTest=1&traffictype=Test"),i},a.prototype.enrichUrlWithDeviceInfo=function(n){this._host.isEducationEnvironment()&&(n+="&DAF0=1");this._host.isWindowsS()&&(n+="&DAF1=1");var t=this._host.getPartnerSearchCode();return t&&(n+="&PC="+t),n},a.prototype.enrichUrlWithMarketInfo=function(n){var t=this._host.getRegion(),i=this._host.getLanguage();return t&&(n+=e+t),i&&(n+=o+i),n},a.prototype.enrichUrlWithSafeSearchInfo=function(n){return this._host.getSafeSearchSetting()=="Strict"?n+"&adlt=strict":n},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(this._host.getConversationId()))},a.prototype.enrichUrlWithSuggestionType=function(t,i){return t+(h+n.encodeQueryParameter(i))},a}();n.NavigationHelper=a}(AutoSuggest||(AutoSuggest={})),function(n){var t=function(){function t(t,i){var r=this;this.host=t;this._selectableItemsContainer=i;t.bindKeyDown(function(t,u,f){var e=!1;t==9?e=r.selectFirstItemInNextGroup(u&&u.shiftKey):n.isUpOrDownKey(t)&&(e=r.selectNextItem(n.isUpKey(t)));i.onAfterKeyDown(t,u,f,e)})}return t.prototype.selectFirstItemInNextGroup=function(t){var i=this._selectableItemsContainer.getSelectableItemsByGroup();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}),u;return(r<0?u=i[0][0]:t&&e>0?u=i[r][0]:t?r>0&&(u=i[r-1][0]):r+1<i.length&&(u=i[r+1][0]),u)?(this._selectableItemsContainer.select(u,!0),!0):!1},t.prototype.selectNextItem=function(t){var i=this._selectableItemsContainer.getSelectableItems(),e;if(i.length==0)return!1;var u=this._selectableItemsContainer.getSelectedItem(),r=u?i.indexOf(u):-1,f=t?r==0:r==i.length-1;return f&&n.RuntimeConfig.AllowKeyboardNavOffCanvas?(this._selectableItemsContainer.select(null,!0),!0):f&&!n.RuntimeConfig.AllowKeyboardNavCycling?!1:(e=t?r<=0?i.length-1:r-1:(r+1)%i.length,this._selectableItemsContainer.select(i[e],!0),!0)},t}();n.KeyboardEvtHandler=t}(AutoSuggest||(AutoSuggest={})),function(n){var t=function(){function t(n,t,i,r){this._host=n;this._instrumentationHelper=t;this._aggregator=i;this._rootViewModel=r;this._lastUsedId=-1;this._sequenceNumber=-1;this._suggestionsQueue={};this._dataSourcesCompleted={}}return t.prototype.initiateSequenceNumber=function(t,i){var o=this,u,f,r,s,e;if(this._sequenceNumber>=t){SharedLogHelper.LogError("initiateSequenceNumber",null,new Error("Unexpected sequence number"));return}for(this.resetStateForNewQuery(t,i),this._highPriorityDataSources=[],this._normalPriorityDataSources=[],this._lowPriorityDataSources=[],u=0,f=n.config.enabledDataSources;u<f.length;u++)r=f[u],s=i.enabledDataSources[r],s&&(n.config.lowPriorityDataSources[r]?this._lowPriorityDataSources.push(r):n.config.highPriorityDataSources[r]?this._highPriorityDataSources.push(r):this._normalPriorityDataSources.push(r));this._highPriorityDataSources.length==0&&this._normalPriorityDataSources.length==0&&this._lowPriorityDataSources.length==0?this.processSuggestions(!1):(e=this.getLatencyTimeout(),e>0&&(this._bufferingTimer=n.safeSetTimeout(function(){o._bufferingTimer=null;o.processSuggestions(!0)},e,"processSuggestionsBuffering")))},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(!(t<this._sequenceNumber)){if(this._dataSourcesCompleted[i]){SharedLogHelper.LogError("queueSuggestions",i,new Error("Data source already completed"));return}if(!n.contains(this._highPriorityDataSources,i)&&!n.contains(this._normalPriorityDataSources,i)&&!n.contains(this._lowPriorityDataSources,i)){SharedLogHelper.LogError("queueSuggestions",i,new Error("Unexpected data source"));return}this._suggestionsQueue[i]&&!this._suggestionsQueue[i].updated?(e=this._suggestionsQueue[i].suggestions).push.apply(e,r):this._suggestionsQueue[i]={suggestions:r,updated:!1};this._dataSourcesCompleted[i]=!f;u&&(this._extraSignalsMap[i]=u);f||this._arrivedDataSources.push(i);this._allDataSourcesArrived=this._arrivedDataSources.length==this._highPriorityDataSources.length+this._normalPriorityDataSources.length+this._lowPriorityDataSources.length;this._processingStopped||this._instrumentationHelper.isLayoutLogged(this._sequenceNumber)?this._allDataSourcesArrived&&this._instrumentationHelper.notifyAllDataSourcesProcessed(this._sequenceNumber):this.processSuggestions(!1)}},t.prototype.resetTimers=function(){this._bufferingTimer&&(sb_ct(this._bufferingTimer),this._bufferingTimer=null)},t.prototype.resetStateForNewQuery=function(t,i){this._arrivedDataSources=[];this._allProcessedDataSources={};this._sequenceNumber=t;this._partialQuery=i;this._suggestionsQueue={};this._dataSourcesCompleted={};this._extraSignalsMap={};this._renderedThisSequenceNumber=!1;this._waitingForMoreResults=!0;this._processingStopped=!1;this._allDataSourcesArrived=n.isEmpty(i.enabledDataSources);this.resetTimers()},t.prototype.getDependencies=function(t){var i=this;return this._host.dataSourceDependencies(t).filter(function(t){return n.isDataSourceEnabled(t,i._partialQuery)})},t.prototype.haveAllDataSourcesArrived=function(n){var t=this;return n.every(function(n){return!!t._suggestionsQueue[n]})},t.prototype.haveAllDataSourcesCompleted=function(n){var t=this;return n.every(function(n){return!!t._dataSourcesCompleted[n]})},t.prototype.processSuggestions=function(t){var i=this,u=[],o=[],r,l=this.getLatencyTimeout()>0&&this._bufferingTimer==null,s=this.haveAllDataSourcesArrived(this._highPriorityDataSources),a=s||l,v=this.haveAllDataSourcesCompleted(this._normalPriorityDataSources),y=this.haveAllDataSourcesCompleted(this._highPriorityDataSources),h=y&&v,c;t&&this._instrumentationHelper.logDataSourceTimeout(Object.keys(this._suggestionsQueue),this._partialQuery);var f=t&&!this._renderedThisSequenceNumber,p=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)}):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&&p(r,t)};a&&e(this._highPriorityDataSources);this._bufferingTimer&&h&&(sb_ct(this._bufferingTimer),this._bufferingTimer=null);c=this.getLatencyTimeout()>0?this._bufferingTimer==null:s;c&&(e(this._normalPriorityDataSources),e(this._lowPriorityDataSources));this._waitingForMoreResults&&h&&(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._instrumentationHelper.notifyAllDataSourcesProcessed(this._sequenceNumber)},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()&&[n.WebDataSource].concat(this.getDependencies(n.WebDataSource)).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<n.length;i++)if(r(n[i])!=r(t[i]))return!1;return!0},t.prototype.addSuggestions=function(t,i,r,u){var e=this,o=this._renderedThisSequenceNumber?this._rootViewModel.getCurrentTopResults():[],v=n.safeExecute(function(){return e.getAggregatorResult(o,t,i)},"getAggregatorResults",[null,!1]),f=v[0],p=v[1],s,h,l,c,a,y;for(f||(f={topResults:o,suggestionsToAdd:i,suggestionsToRemove:[],groupOrder:[]}),this._instrumentationHelper.instrumentAggregatorCall(this._sequenceNumber,p),i=f.suggestionsToAdd,s=f.suggestionsToRemove,h=0,l=f.topResults;h<l.length;h++)c=l[h],n.contains(t,c)&&!n.contains(o,c)&&s.push(c);(u||i.length!=0||s.length!=0||!n.sequenceEqual(o,f.topResults))&&(a=!this._renderedThisSequenceNumber,a&&(this._renderedThisSequenceNumber=!0,this._instrumentationHelper.instrumentRenderingStarted(this._sequenceNumber)),y=n.safeExecute(function(){return e._rootViewModel.update(a,f.topResults,e._waitingForMoreResults,e._sequenceNumber,i,s,r,f.groupOrder,e._allDataSourcesArrived,e._extraSignalsMap)},"rootViewModel.update",0,null,function(t){n.WSB&&n.WSB.fallbackToPrepopulatedBundle&&n.WSB.fallbackToPrepopulatedBundle(t)}),y==0&&(this._processingStopped=!0,this.resetTimers()))},t.prototype.removeDuplicatesAndAssignIds=function(n,t,i,r){var f=this,h=function(n){n.id||(n.id="id_"+ ++f._lastUsedId)},s=!1,o;if(this._aggregator.canHaveDuplicates(r,this._partialQuery)){var e=[],c=function(o){var a=n[o],l=t.findIndex(function(n){return f._aggregator.mergeDuplicates(f._partialQuery,n,a)}),c;if(l>=0)return c=t[l],c.needsRefreshAfterDeduping&&(s=!0),u._instrumentationHelper.instrumentDuplicate(u._sequenceNumber,c,a),"continue";if(l=i.findIndex(function(n){return f._aggregator.mergeDuplicates(f._partialQuery,n,a)}),l>=0)return c=i[l],c.needsRefreshAfterDeduping&&(c.needsRefreshAfterDeduping=!1),u._instrumentationHelper.instrumentDuplicate(u._sequenceNumber,c,a),"continue";if(u._aggregator.canHaveDuplicatesWithinDataSource(r,u._partialQuery)&&(l=e.findIndex(function(n){return f._aggregator.mergeDuplicates(f._partialQuery,n,a)}),l>=0))return c=e[l],c.needsRefreshAfterDeduping&&(c.needsRefreshAfterDeduping=!1),u._instrumentationHelper.instrumentDuplicate(u._sequenceNumber,e[l],a),"continue";h(a);e.push(a)},u=this;for(o=0;o<n.length;++o)c(o);return[e,s]}return n.forEach(function(n){return h(n)}),[n,s]},t.prototype.canHaveSuppressions=function(t){return n.config.suppressDataSources[t]||n.config.dataSourcesWithSuppressedTypes[t]},t.prototype.isSuppressed=function(t,i){return n.config.suppressDataSources[t]||n.config.suppressTypes[i.type]},t}();n.SuggestionsRenderingManager=t}(AutoSuggest||(AutoSuggest={})),function(n){function y(n){return n.handoffType==1?n.query:HitHighlightingParser.removeMarkers(n.text)}function f(n){var t,i;if(n.length==0)return 0;for(t=0,i=0;i<n.length;i++)t=(t<<5)-t+n.charCodeAt(i)|0;return t}function t(n,t){var u,i,r;if(!n)return t.length;if(!t)return n.length;for(u=[],i=0;i<=t.length;i++)u[i]=[i];for(r=0;r<=n.length;r++)u[0][r]=r;for(i=1;i<=t.length;i++)for(r=1;r<=n.length;r++)u[i][r]=t.charAt(i-1)==n.charAt(r-1)?u[i-1][r-1]:Math.min(u[i-1][r-1]+1,Math.min(u[i][r-1]+1,u[i-1][r]+1));return u[t.length][n.length]}function p(n,i){return n&&(n=n.toLocaleLowerCase()),i&&(i=i.toLocaleLowerCase()),t(n,i)}function o(n,t,i){var r=0,u;return(t>0||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;i<r;i++)for(a=Math.max(0,i-l),v=Math.min(e,i+l+1),f=a;f<=v;f++)if(!s[f]&&n[i]==t[f]){h[i]=!0;s[f]=!0;u++;break}if(u===0)return 0;for(o=0,i=0;i<r;i++)if(h[i]){while(!s[o])o++;n[i]!=t[o]&&c++;o++}return(u/r+u/e+(u-c/2)/u)/3}function w(n,t){var i=s(n,t),r,u;return i<1?i:(r=.1,u=h(n,t),i+u*r*(1-i))}function h(n,t){for(var i=0;i<4;i++)if(n[i]!=t[i])return i;return++i}function b(n,t){return!n||!t?0:n.length+1<=t.length&&t[n.length]==" "?1:n.length==t.length?1:0}function k(n){var r=0,i=1,t;if(n&&n.length>1)for(t=1;t<n.length;t++)n.charAt(t)==n.charAt(t-1)?i++:i=1,i>r&&(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;f<h.length;f++)if(c=h[f],c==u){r[145]=1;break}}function ot(n){var t=et.find(function(t){return n.startsWith(t)});return n=t?n.substr(t.length):n,ft.some(function(t){return n.startsWith(t)})}function st(n){var i=0,r,t;if(n)for(r in n)t=n[r],t&&t.prefixLaunchCount&&(i+=t.prefixLaunchCount);return i}function ht(t,i,r,u){if(r){var f=r[t];f&&(i[47]=f.prefixLaunchCount,i[49]=f.lastLaunchTime,i[101]=u,u>0&&(i[100]=f.prefixLaunchCount/u),f.previewPaneLaunchCount&&f.lastPreviewPaneLaunchTime&&(i[301]=f.previewPaneLaunchCount,f.lastPreviewPaneLaunchTime==f.lastLaunchTime&&(i[302]=1),i[303]=n.getCurrentTime()-f.lastPreviewPaneLaunchTime))}}function 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;o<s;o++){var rt=a&&a.length>o?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;o<s;o++){var k=l&&l.length>o?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;i<f;i++){var y=o[i],p=s[i],e=r("",p,y);t[e]={};h.length==f&&(t[e].PSGPCR=Number(h[i]));c.length==f&&(t[e].PSGCCR=Number(c[i]));l.length==f&&(t[e].PSGSTR=Number(l[i]));a.length==f&&(t[e].PSGSATCCR=Number(a[i]));v.length==f&&(t[e].PSGSATPCR=Number(v[i]))}else SharedLogHelper.LogError("parseGroupEngagementSignals",null,new Error("Length doesn't match"))}function bt(n,t){var r={},f,s,o,i;if(t){var h=0,v=0,u={};for(f=0,s=t;f<s.length;f++){var y=s[f],e=y.key,p=y.value;u[e]={lexicalSimilarity:0,groupClickCounts:{},groupWeight:{}};v+=c(u,e,n);o=a(p);u[e].groupClickCounts=o.groupLaunches;for(i in u[e].groupClickCounts)r[i]||(r[i]={probability:0,weight:0}),r[i].probability+=o.groupHits[i],h+=o.groupHits[i]}l(r,u,v,h)}return r}function kt(n,t){var r={},f,o,i;if(t){var h=0,a=0,u={};for(f=0,o=t;f<o.length;f++){var v=o[f],s=v.key,e=v.value;u[s]={lexicalSimilarity:0,groupClickCounts:{},groupWeight:{}};a+=c(u,s,n);for(i in e)e[i]&&e[i].prefixLaunchCount&&(r[i]||(r[i]={probability:0,weight:0}),u[s].groupClickCounts[i]=e[i].prefixLaunchCount,r[i].probability++,h++)}l(r,u,a,h)}return r}function c(n,t,i){var r=t.length-i.length,u=r/t.length;return n[t].lexicalSimilarity=1-u,n[t].lexicalSimilarity}function l(n,t,i,r){var o=0,s,e,f,u;for(e in t){f=t[e];f.lexicalSimilarity/=i;for(u in f.groupClickCounts)s=f.groupClickCounts[u],f.groupWeight[u]=s*f.lexicalSimilarity,o+=f.groupWeight[u]}for(u in n)n[u].probability/=r;for(e in t){f=t[e];for(u in f.groupClickCounts)n[u]||(n[u]={probability:0,weight:0}),f.groupWeight[u]/=o,n[u].weight+=f.groupWeight[u]}}function a(n){var u=function(n,t,i){return n[t]=n[t]?n[t]+i:i},r={groupLaunches:{},groupHits:{},otherGroupLaunches:0},f,t,i;for(f in n)(t=n[f],t&&t.prefixLaunchCount)&&(i=t.groupType,i||i===0?(u(r.groupLaunches,i,t.prefixLaunchCount),u(r.groupHits,i,1)):r.otherGroupLaunches+=t.prefixLaunchCount);return r}function dt(n,t,i,r){if(r){var f=i(t),u=r[f];u&&(n[266]=u.probability,n[267]=u.weight)}}function e(t){var i=t?t.getDay():n.getCurrentDate().getDay(),r=i==6||i==0;return n.config.invertIsWeekend?!r:r}function gt(n){for(var t in n)n[t]?n[t]=v(Number(n[t])):delete n[t]}function v(n){return Number(n.toFixed(5))}function ni(n,t){n.featureStore||(n.featureStore={});n.featureStore[t]=1}n.getTextForLexicalFeatures=y;n.stringHashCode=f;n.getEditDistance=t;n.getEditDistanceIgnoreCase=p;n.computeEditDistanceRatio=o;n.computeJaroSimilarity=s;n.computeJaroWinklerSimilarity=w;n.computeJaroWinklerPrefixOverLapCount=h;n.isWordBoundary=b;n.countMaxContiguousRepeatedChars=k;n.getNumberOfWords=d;n.containsOnlyDigitsLettersOrSpaces=g;n.endsWithSpace=nt;n.prefixIsLikeUrl=tt;n.computeUrlFeatures=it;n.computeDomainFeatures=rt;n.computeTitleFeatures=ut;var ft=["www.bing.","cn.bing.","www.google.","www.yandex.","www.baidu.","www.yahoo.",],et=["http://","https://",];n.getSumMruLaunches=st;n.setMRUSignal=ht;n.setMRUBackPropSignal=ct;n.setEngagementSignals=lt;n.setSuggestionGroupEngagementSignals=at;n.getEngagementSignalKey=i;n.getAthenaGroupKey=r;n.checkAthenaGroupLength=u;n.parseWebEngagementSignals=vt;n.computeGroupBackpropagatedClicks=bt;n.computeSuggestionBackpropagatedClicks=kt;n.evaluateGroupLaunches=a;n.setMRUGroupBackpropClicks=dt;n.isWeekend=e;n.removeUndefinedAndZeroAndTrimValues=gt;n.trimFeatureStoreValue=v;n.setFlagInFeatureStore=ni}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var i;(function(i){function r(n){return n.isSearchHomeZI}i.suggestionRankingModels={};var u=function(){function u(){}return u.prototype.rank=function(n,i,u,f,e,o,s,h,c,l){var a,v,y,p;return r(n)?{topResults:[],mruSuppressions:null}:n.scope==t.Scope.PathCompletion?this.rankPathCompletion(i):(a=t.isL2(n)?null:{mruGroupRatios:null,maxGroupCCR:null,maxGroupProbSugClickGivenPref:null,mruGroupBackpropWeights:null,mruGroupBackpropRatios:null},v=i.slice(),t.config.disableWebRankingSignals&&(o=null,u=null,h=null),this.orderSuggestions(n,i,u,f,o,s,h,c,a,e),this.setMRUHintEnabled(n,i),this.setGroupSuppressionSignals(a,i),y=this.getTopHitCandidates(n,i,l.searchTheWeb,v),p=this.createMulticlassClassifierTopHitSuggestionList(y),{topResults:p,mruSuppressions:a})},u.prototype.isNotChromeIntent=function(n,t){var r="google chrome",i;return t.length==0?!1:(i=t.filter(function(n){return n.query.toLocaleLowerCase()==r&&n.type=="PP"}),i.length>0&&!n.queryToFetch.includes("c")&&!n.queryToFetch.includes("h")&&!n.queryToFetch.includes("r")&&!n.queryToFetch.includes("m"))?!0:!1},u.prototype.setMRUHintEnabled=function(n,i){var f,r,u;if(t.config.enableMRUHint)for(f=n.queryToFetch.toLocaleLowerCase(),r=0;r<i.length;r++)u=i[r].featureStore,u[281]&&u[282]&&(t.config.enableMRUHint!=1&&i[r].text.toLocaleLowerCase().startsWith(f)||(i[r].mruHintEnabled=!0))},u.prototype.rankPathCompletion=function(n){var t=n.find(function(n){return n.type=="CG"})||n[0];return{topResults:t?[t]:[],mruSuppressions:null}},u.prototype.swapHighConfidenceTopHit=function(i){var s={minimum:0,penalty:.1},h={minimum:.08,penalty:.05},c={minimum:.01,penalty:.05},l={minimum:.45,penalty:.9},o=function(n){var t=-5;return(n-t)/(8-t)},u=i[0],e=0,f,r;if(!(i.length<=1)&&!(u.simpleFeatures.mruScore>0)){for(f=0;f<i.length;f++)r=i[f],t.isApp(r.type)?(r.simpleFeatures.topHitScore=o(-.45052*r.simpleFeatures.ciGeoMeanScoreNormalized+.15451*r.simpleFeatures.ciGlobalScore+-.34223*r.simpleFeatures.ciLocalScore+-.18174*r.simpleFeatures.ciMatchScore+3.9928),!t.isApp(u.type)&&r.simpleFeatures.topHitScore>s.minimum&&r.simpleFeatures.topHitScore>u.simpleFeatures.topHitScore+s.penalty&&(u=r,e=f)):t.isSetting(r.type)?(r.simpleFeatures.topHitScore=o(-.42912*r.simpleFeatures.ciGeoMeanScoreNormalized+-.0173*r.simpleFeatures.ciLocalScore+-.1516*r.simpleFeatures.ciMatchScore+.28754),!t.isSetting(u.type)&&r.simpleFeatures.topHitScore>h.minimum&&r.simpleFeatures.topHitScore>u.simpleFeatures.topHitScore+h.penalty&&(u=r,e=f)):t.isFileOrFolder(r.type)?(r.simpleFeatures.topHitScore=o(.99907*r.simpleFeatures.startsWithPrefix+1.1431*r.simpleFeatures.containsPrefix+3.1153*r.simpleFeatures.jaroWinklerScore+-3.9697),u==r&&(r.simpleFeatures.topHitScore=0),!t.isFileOrFolder(u.type)&&r.simpleFeatures.topHitScore>l.minimum&&r.simpleFeatures.topHitScore>u.simpleFeatures.topHitScore+l.penalty&&(u=r,e=f)):n.isWebSuggestion(r)||r.type=="MB"||r.isAnswer?(r.simpleFeatures.topHitScore=o(5.3465*r.simpleFeatures.webConfidence+-5.6972),(!n.isWebSuggestion(u)&&r.simpleFeatures.topHitScore>c.minimum&&r.simpleFeatures.topHitScore>u.simpleFeatures.topHitScore+c.penalty||r.type=="MB"&&n.isWebSuggestion(u))&&(u=r,e=f)):(r.type=="PT"||r.type=="CG")&&(u=r,e=f);e!=0&&(i.unshift(u),i.splice(e+1,1))}},u.prototype.extractSimpleFeatures=function(i){var r=i.featureStore,e=64,u=0,f={mruScore:r[282]||u,sugTypeBucket:10,ciGeoMeanScoreNormalized:Math.floor(r[405]/1e3)||e,ciGlobalScore:r[269]/1e3||e,ciLocalScore:r[270]/1e3||e,ciMatchScore:Math.floor(r[158]/1e3)||0,rank:Math.floor(r[16]/1e3)||128,webScore:this.getSuggestionScoreFromSuggestionLogMeta(i.suggestionLogMeta)||u,webConfidence:r[17]||u,prefixEqualsSuggestion:r[133]||u,startsWithPrefix:r[188]||u,containsPrefix:r[143]||u,jaroWinklerScore:r[421]||u,topHitScore:u};return f.sugTypeBucket=t.isApp(i.type)?0:t.isSetting(i.type)?1:t.isFileOrFolder(i.type)?2:i.type=="MB"?3:n.isWebSuggestion(i)?4:5,i.type=="IBA"&&r[269]<1&&(f.ciGeoMeanScoreNormalized=64),f.ciMatchScore==0&&f.startsWithPrefix==0&&f.sugTypeBucket<=1&&(f.ciMatchScore+=1),f},u.prototype.orderSuggestions=function(r,u,f,e,o,s,h,c,l,a){var nt=this,p=n.safeExecute(function(){return nt.createFeatureStore(r,u,f,e,o,s,h,l,a)},"createFeatureStore"),w,y,k,d,b,g,v;if(p=p||u.map(function(){return{}}),y=c?t.config.counterFactualRankerId:t.config.mainRankerId,y?(w=n.safeExecute(function(){return i.suggestionRankingModels[y]},"getRanker"),w||SharedLogHelper.LogError("getRanker",y,new Error("Model not found"))):SharedLogHelper.LogError("getRanker",y,new Error(c?"CounterFactualRankerId not defined ":"MainRankerId not defined")),t.config.enableSimpleRanker){for(v=0;v<u.length;v++)k=p[v],u[v].featureStore=k,u[v].simpleFeatures=this.extractSimpleFeatures(u[v]);for(t.config.enableMatchQueryDemotions?u.sort(function(n,t){return t.simpleFeatures.mruScore-n.simpleFeatures.mruScore||n.simpleFeatures.sugTypeBucket-t.simpleFeatures.sugTypeBucket||Math.floor(n.simpleFeatures.ciMatchScore/10)-Math.floor(t.simpleFeatures.ciMatchScore/10)||n.simpleFeatures.ciGeoMeanScoreNormalized-t.simpleFeatures.ciGeoMeanScoreNormalized||n.simpleFeatures.rank-t.simpleFeatures.rank||t.simpleFeatures.prefixEqualsSuggestion-n.simpleFeatures.prefixEqualsSuggestion||t.simpleFeatures.startsWithPrefix-n.simpleFeatures.startsWithPrefix||t.simpleFeatures.containsPrefix-n.simpleFeatures.containsPrefix||t.simpleFeatures.jaroWinklerScore-n.simpleFeatures.jaroWinklerScore}):u.sort(function(n,t){return t.simpleFeatures.mruScore-n.simpleFeatures.mruScore||n.simpleFeatures.sugTypeBucket-t.simpleFeatures.sugTypeBucket||n.simpleFeatures.ciGeoMeanScoreNormalized-t.simpleFeatures.ciGeoMeanScoreNormalized||n.simpleFeatures.ciMatchScore-t.simpleFeatures.ciMatchScore||n.simpleFeatures.rank-t.simpleFeatures.rank||t.simpleFeatures.prefixEqualsSuggestion-n.simpleFeatures.prefixEqualsSuggestion||t.simpleFeatures.startsWithPrefix-n.simpleFeatures.startsWithPrefix||t.simpleFeatures.containsPrefix-n.simpleFeatures.containsPrefix||t.simpleFeatures.jaroWinklerScore-n.simpleFeatures.jaroWinklerScore}),v=0;v<u.length;v++)u[v].rankingScore=-v;this.swapHighConfidenceTopHit(u)}else if(w)for(d=function(t){var i=p[t],r=n.safeExecute(function(){return w(i)},"calculateRankingScore");u[t].rankingScore=n.trimFeatureStoreValue(r);u[t].featureStore=i},v=0;v<u.length;v++)d(v);if(b=u.filter(function(n){return n.type=="MB"}),t.config.enableSimpleRanker||u.sort(function(n,t){return t.rankingScore-n.rankingScore}),b.length>1)for(g=u.map(function(n,t){return n.type=="MB"?t:undefined}).filter(function(n){return typeof n=="number"}),v=0;v<b.length;++v)u[g[v]]=b[v]},u.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},u.prototype.getTopWebSuggestion=function(n){var u,f,t,e,i,r;if(n.length==0)return null;if(u=n[0],f=64e3,n.length>1)for(t=0,e=n;t<e.length;t++)i=e[t],i.suggestionLogMeta&&(r=this.getSuggestionScoreFromSuggestionLogMeta(i.suggestionLogMeta),!isNaN(r)&&r<f&&(f=r,u=i));return u},u.prototype.bypassFallbackForMBS=function(i,r,u){return(t.config.bypassFallbackOnMSBTopHit==2||t.config.bypassFallbackOnMSBTopHit==3)&&r.every(function(t){return n.isWebSuggestion(t)||t.handoffType==17||t.isAnswer})?!0:(t.config.bypassFallbackOnMSBTopHit==1||t.config.bypassFallbackOnMSBTopHit==4)&&!r.some(function(n){return t.isApp(n.type)||t.isSetting(n.type)})&&u.length>0&&(u[0].type=="PPL"||u[0].type=="BKS")?!0:t.config.bypassFallbackOnMSBTopHit==4&&!r.some(function(n){return t.isApp(n.type)||t.isSetting(n.type)})&&u.length>1&&(u[0].isAnswer||n.isWebSuggestion(u[0]))&&(u[1].type=="PPL"||u[1].type=="BKS"||u.length>2&&u[0].isAnswer&&u[1].isAnswer&&(u[2].type=="PPL"||u[2].type=="BKS"))?!0:!1},u.prototype.getTopHitCandidates=function(i,r,u,f){var l=this,e=r.filter(function(n){return l.allowInTopHit(i,n,f)}),h,o,c,s;return this.bypassFallbackForMBS(i,r,e,f)?(h=[],o=f.filter(function(n){return n.type=="PPL"}),o.length==0&&(o=f.filter(function(n){return n.type=="BKS"})),o.length>0&&o[0].autoOpenPreviewPaneWhenOnTopHit&&(t.config.bypassFallbackOnMSBTopHit!=3||n.getTextForLexicalFeatures(o[0]).toLowerCase().startsWith(i.queryToFetch.toLowerCase()))&&h.push(o[0]),t.config.bypassFallbackOnMSBTopHit==4&&(e[0].isAnswer||n.isWebSuggestion(e[0]))&&(e[0].isAnswer||this.getFallbackClassifierScore(e[0])>t.config.webFbcScoreThreshold)&&h.push(e[0]),h):this.enableFallbackClassifier(i,e,u)?t.config.disableTopHitSyntheticWeb&&i.queryToFetch.length>=t.config.minPrefixDisableTopHitSW&&e.every(function(t){return n.isWebSuggestion(t)})&&(c=e.filter(function(n){return n.type!="SW"}),c.length>0&&(s=this.getTopWebSuggestion(c),s.type!="SC"&&s.type!="RI"&&s.type!="OS"))?[s]:(e=this.getFallbackClassifierSuggestions(e),t.config.enableGGSupp&&this.isNotChromeIntent(i,e))?[]:e:e},u.prototype.getFallbackClassifierScore=function(r){var u=n.safeExecute(function(){return i.suggestionRankingModels[t.config.fallbackClassifierId]},"getFallbackClassifier"),f=u?n.safeExecute(function(){return u(r.featureStore)},"calculateFallbackClassifierScore"):0;return n.trimFeatureStoreValue(f)},u.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=t.config.enableAppsSettingsFbcScoreThreshold?t.isApp(u.type)||t.isSetting(u.type)?t.config.appsSettingsFbcScoreThreshold:n.isWebSuggestion(u)?t.config.webFbcScoreThreshold:t.config.nonWebFbcScoreThreshold:n.isWebSuggestion(u)?t.config.webFbcScoreThreshold:t.config.nonWebFbcScoreThreshold,u.fbcScore>=f?r.slice(0,i.topHitIsMultiEntity(r)?2:1):[]}return[]},u.prototype.enableFallbackClassifier=function(i,r,u){if((t.config.enableFBMinQryLength==0||i.queryToFetch.length>=t.config.enableFBMinQryLength)&&u&&t.config.fallbackClassifierId&&r.length>0){var f=r[0];return t.getGroupType(f)==t.GroupType.Cortana?!1:f.isAnswer?f.autoOpenPreviewPaneWhenOnTopHit&&t.config.applyFallbackClassifierToAutoOpenAnswers||f.type=="MB"&&t.config.applyFallbackClassifierToEntities:t.config.enableLimitedFallback&&i.queryToFetch.length>=t.config.minPrefixLengthLimitedFallback&&!n.isWebSuggestion(f)?!1:!0}return!1},u.prototype.allowInTopHit=function(i,r,u){var h=!u||u.length==1,o,e,s,f;if(t.RuntimeConfig.QfMode==8||!t.config.topHitAllowedForGridLayoutL2&&(i.scope==t.Scope.Photos||i.scope==t.Scope.Videos)||i.topHitRestriction==1&&r.query.toLocaleLowerCase()!=i.queryToFetch.toLocaleLowerCase()&&(n.contains(r.features,"ForcePrefixOnTop")||r.features.push("ForcePrefixOnTop"),t.config.forceTypedQueryOnTop))return!1;if(t.isRecourse(r))return t.config.recourseOnlyInGroups?!1:h;if(t.isMobileCache)switch(r.handoffType){case 2:case 3:return!1;case 1:if(!i.queryToFetch.includes("."))return!1}o=t.getGroupType(r);switch(o){case t.GroupType.Store:return r.hc;case t.GroupType.Command:return r.hc||h;case t.GroupType.LocalPlaces:return t.config.topHitAllowedForLocal}if(t.getScope(o)==t.Scope.Emails&&!r.hc)return!1;if(t.enforceOriginalOrder(r)&&u)for(e=0,s=u;e<s.length;e++){if(f=s[e],f==r)break;if(f.type==r.type&&f.handoffType==r.handoffType&&f.sourceForGroup==r.sourceForGroup)return!1}return t.RuntimeConfig.AlwaysWide&&!r.previewPaneType?!1:!0},u.prototype.createMulticlassClassifierTopHitSuggestionList=function(n){for(var r=0,u=0;u<Math.min(n.length,t.config.maxNumberOfTopResults);u++)n[u].rankingScore!==undefined&&n[u].rankingScore>.5&&(r=u);return r==0&&i.topHitIsMultiEntity(n)&&(r=1),t.config.bypassFallbackOnMSBTopHit==4&&n.length>0&&(n[0].type=="PPL"||n[0].type=="BKS")&&(r=1),n.slice(0,r+1)},u.prototype.createFeatureStore=function(i,r,u,f,e,o,s,h,c){var ht=[],tt=0,ct=0,it=0,lt=i.queryToFetch.toLocaleLowerCase(),kt=function(n){return t.getGroupType(n)},at=n.getSumMruLaunches(f),vt=0,yt={},rt,ut,pt,d,ft,y,p,a,w,g,et,ot,b,nt,st,v,l,k,wt,bt;for(f&&(rt=n.evaluateGroupLaunches(f),vt=rt.otherGroupLaunches,yt=rt.groupLaunches),ut=n.computeGroupBackpropagatedClicks(i.queryToFetch,c),pt=n.computeSuggestionBackpropagatedClicks(i.queryToFetch,c),d=0,ft=r;d<ft.length;d++)y=ft[d],y.handoffType==2&&(p=t.getAppItem(y),p&&(ct+=p.totalLaunches,p.totalLaunches>tt&&(tt=p.totalLaunches)),y.deviceItem&&y.deviceItem.rankScore>it&&(it=y.deviceItem.rankScore));for(a={},n.isWeekend()&&(a[440]=1),a[441]=this.getLocalHourBucket(new Date),w=lt.split(" "),g=0,et=w;g<et.length;g++){if(ot=et[g],ot=="install"){a[451]=1;break}if(ot=="uninstall"){a[450]=1;break}}for(w&&w.length>0&&(b=w[0],a[452]=b.indexOf("c:")>-1||b.indexOf("d:")>-1||b.indexOf("e:")>-1||b.indexOf("f:")>-1?1:0),nt=0,st=r;nt<st.length;nt++)v=st[nt],l=this.getSuggestionFeatureStore(lt,v,e,u,ct,s),l[13]=tt,l[7]=it,l[60]=t.isMobileCache?1:0,u&&u.WebSignalsAvailable&&(l[93]=1),n.setMRUSignal(t.getSuggestionKey(v),l,f,at),this.setMRUGroupLaunchRatios(l,v,at,yt,vt,h),n.setMRUBackPropSignal(t.getSuggestionKey(v),l,pt),ut&&n.setMRUGroupBackpropClicks(l,v,kt,ut),k=n.getTextForLexicalFeatures(v),k&&(v.handoffType==1&&(n.computeUrlFeatures(k,i.queryToFetch,l,o),wt=n.getDomain(k),n.computeDomainFeatures(v,i.queryToFetch,l,o,wt,e)),t.isFileOrFolder(v.type)&&(bt=o.cvid+o.privacyNumber+k,l[131]=n.stringHashCode(bt))),a&&(l[440]=a[440],l[441]=a[441],l[451]=a[451],l[450]=a[450],l[452]=a[452]),n.removeUndefinedAndZeroAndTrimValues(l),ht.push(l);return ht},u.prototype.setGroupSuppressionSignals=function(n,i){var f,e,u;if(n)for(n.maxGroupCCR={},n.maxGroupProbSugClickGivenPref={},n.mruGroupBackpropRatios={},n.mruGroupBackpropWeights={},f=0,e=i;f<e.length;f++)if(u=e[f],u.featureStore){var r=t.getGroupType(u),o=u.featureStore[94]||0,s=u.featureStore[0]||0;n.maxGroupCCR[r]=n.maxGroupCCR[r]?Math.max(n.maxGroupCCR[r],o):o;n.maxGroupProbSugClickGivenPref[r]=n.maxGroupProbSugClickGivenPref[r]?Math.max(n.maxGroupProbSugClickGivenPref[r],s):s;n.mruGroupBackpropRatios[r]=u.featureStore[266];n.mruGroupBackpropWeights[r]=u.featureStore[267];(n.mruGroupBackpropWeights[r]||n.mruGroupBackpropRatios[r])&&(n.backPropDataExists=!0)}},u.prototype.setMRUGroupLaunchRatios=function(n,i,r,u,f,e){var s,o;if(r){e&&(e.mruGroupRatios={});n[186]=f/r;for(s in u){o=u[s]/r;t.getGroupType(i)==Number(s)&&(n[271]=o);e&&(e.mruGroupRatios[s]=o);switch(Number(s)){case t.GroupType.Apps:n[169]=o;break;case t.GroupType.Settings:n[170]=o;break;case t.GroupType.Cortana:n[171]=o;break;case t.GroupType.Command:n[172]=o;break;case t.GroupType.Photos:n[173]=o;break;case t.GroupType.Videos:n[174]=o;break;case t.GroupType.Music:n[175]=o;break;case t.GroupType.Documents:n[176]=o;break;case t.GroupType.Folders:n[177]=o;break;case t.GroupType.Emails:n[178]=o;break;case t.GroupType.Store:n[179]=o;break;case t.GroupType.SearchSuggestions:n[262]=o;n[180]=u[t.GroupType.Websites]?(u[t.GroupType.Websites]+u[s])/r:o;break;case t.GroupType.Websites:n[263]=o;n[180]=u[t.GroupType.SearchSuggestions]?(u[t.GroupType.SearchSuggestions]+u[s])/r:o;break;case t.GroupType.PathCompletion:n[181]=o;break;case t.GroupType.People:n[184]=o;break;case t.GroupType.Bookmarks:n[260]=o;break;case t.GroupType.LocalPlaces:n[261]=o}}}},u.prototype.getRank=function(n){if(n.deviceItem&&typeof n.deviceItem.rankScore!="undefined")return n.deviceItem.rankScore;var i=t.isJumpListSuggestion(n)?n.jumpListItem.usagePoints:undefined;return typeof i!="undefined"?i:undefined},u.prototype.getSuggestionFeatureStore=function(i,r,u,f,e,o){var s={},l,k,a,v,y,p,c,h,d,tt,w,g,it,b,nt;if(this.setTypeSignal(r,s),l=t.getAppItem(r),l?(s[2]=l.totalLaunches,s[92]=l.launchArguments?1:0,e>0&&(s[103]=l.totalLaunches/e),this.addLastAccessDate(l.lastAccessed,s)):this.addLastAccessDate(t.isJumpListSuggestion(r)?r.jumpListItem.lastAccessed:null,s),s[99]=r.confidence,s[150]=r.source,s[283]=r.pinnedToTaskbar?1:undefined,r.hc&&(s[189]=1),s[17]=r.highConfidenceMetaSuggestionScore,k=this.getRank(r),typeof k!="undefined"?s[16]=k:s[4]=1,a=r,a.matchedOnlyOnContent&&(s[259]=1),a.matchedOnlyOnAuthor&&(s[273]=1),a.lastModifiedDate&&(s[268]=n.getTimeDiffInDays(a.lastModifiedDate)),a.extensionLC==".lnk"&&(s[272]=1),s[23]=r.prefetchConfidenceScore,s[264]=f&&f.ProbNextKS!==undefined?f.ProbNextKS:1,s[296]=f&&f.ProbNextKSV2!==undefined?f.ProbNextKSV2:1,this.setThresholdRatios(s,f),this.setRatios(s,f),v=t.getGroupType(r),y=r.query,r.type=="SW"&&(y="SearchTheWeb"),p=n.getAthenaGroupKey(String(v),String(r.handoffType),r.type),n.setEngagementSignals(s,u,p,y,!1,!1),n.setEngagementSignals(s,o,p,y,!1,!0),o&&!u&&n.setEngagementSignals(s,o,p,y,!1,!1),s[10]=i.length,(r.isAnswer||v==t.GroupType.Cortana)&&(s[11]=1),c=n.getTextForLexicalFeatures(r),h=c?c.toLocaleLowerCase():null,c||(s[132]=1),h==i&&(s[133]=1),r.handoffType==2&&(s[8]=1,t.isSetting(r.type)&&(s[64]=1),t.isApp(r.type)&&(s[83]=1)),v==t.GroupType.SearchSuggestions&&(r.type!="SW"&&(s[82]=1),s[25]=1),d=s[132]==1,d?s[137]=i.length:(s[137]=c.length,s[134]=n.getEditDistance(i,h),s[135]=Math.min(100,n.computeEditDistanceRatio(s[134],i.length,c.length)),s[136]=n.isWordBoundary(i,c),s[284]=Math.abs(c.length-i.length)),!d&&h){for(h.indexOf(i)>-1&&(s[143]=1),h.substring(0,i.length)===i&&(s[188]=1),tt=h.split(" "),w=0,g=tt;w<g.length;w++)if(it=g[w],it==i){s[145]=1;break}s[420]=n.computeJaroSimilarity(i,h);s[421]=n.computeJaroWinklerSimilarity(i,h)}return s[1]==1&&r.deviceItem&&(b=t.getAppItem(r),b.extension&&(s[400]=b.extension===".exe"?1:0,s[401]=b.extension===".appref-ms"?1:0),h&&(s[402]=h.indexOf("install")>-1?1:0)),s[1]||r.type!="FL"&&r.type!="FD"&&r.type!="ST"||(s[403]=1),(r.type=="QP"||r.type=="QS"||r.type=="SC"||r.type=="OS")&&(s[404]=1),s[8]==1&&(s[27]=s[133]),(r.isAnswer||v==t.GroupType.Cortana)&&(s[55]=s[133]),(r.type=="HS"||r.fromHistory)&&(s[121]=1),s[41]=s[83]==1?s[40]:s[64]==1?s[39]:s[11]==1?s[32]:s[89]==1?s[54]:s[85]==1?s[30]:s[86]==1?s[53]:s[87]==1?s[52]:s[61]==1?s[31]:s[88]==1?s[51]:s[63]==1?s[35]:s[82]==1?s[29]:s[90]==1?s[50]:s[59]==1?s[34]:s[37],(t.isSetting(r.type)||t.isApp(r.type))&&(nt=r.ciMetaData,this.computeConstraintIndexFeatures(r.deviceItem,s,nt),r.ciMatchedQuery=this.getConstraintIndexMatchedQuery(nt),s[269]&&s[270]&&(s[405]=Math.sqrt(s[269]*s[270]))),r.signals&&(s[230]=r.signals.DistanceToEntity,s[231]=r.signals.DistanceToEntityPrecision,s[232]=r.signals.RankingScore),s},u.prototype.addLastAccessDate=function(t,i){var r=n.getTimeDiffInDays(t);r!=null?i[9]=r:i[19]=1},u.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}},u.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))},u.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},u.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<o.length;u++)if(f=o[u],t[159]=f.EntityScore,f.Attributes)for(e=0,s=f.Attributes;e<s.length;e++)r=s[e],r.Name=="gscore"?t[269]=Number(r.Value):r.Name=="lscore"&&(t[270]=Number(r.Value))}},u.prototype.getConstraintIndexMatchedQuery=function(n){return!n||n.MatchScore==0?null:n.Query},u.prototype.getLocalHourBucket=function(n){var t=n.getHours(),i=1;return t>=0&&t<6?i=1:t>=6&&t<12?i=2:t>=12&&t<18?i=3:t>=18&&t<=23&&(i=4),i},u}();i.FastRankRanker=u})(i=t.Ranking||(t.Ranking={}))})(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var i=function(){function t(n,t){var i=this;this._instrumentationProvider=t;n.bindDismissed(function(){return i.flushAggregatedMeasure(!0)})}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._currentKeystrokeAggregatedMeasureIsForSearchHome=i},t.prototype.flushAggregatedMeasure=function(n){(n||this._currentKeystrokeAggregatedMeasureIsForSearchHome)&&!this._aggregatedMeasureFlushed&&this._keystrokeAggregatedMeasure&&Object.keys(this._keystrokeAggregatedMeasure).length>1&&(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){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.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<u.length;++t)if(u[t].instItem==n)return{IsInTopResult:!0,GroupType:undefined,PositionInGroup:t};for(i=0,f=e;i<f.length;i++)for(r=f[i],t=0;t<r.suggestions.length;++t)if(r.suggestions[t].instItem==n)return{IsInTopResult:undefined,GroupType:r.typeWithSource.type,PositionInGroup:t}}return undefined},t.prototype.updateSuggestionsList=function(n,t){this._currentLeftPaneSuggestions={topResults:n,groups:t}},t.prototype.logDataSourcePerformancesMeasure=function(n){var t=n.RequestBegin,i=Object.keys(n.ResponseReceived).map(function(i){return{Name:i,ResponseReceivedTime:n.ResponseReceived[i]-t,RenderedTime:n.RenderFinished[i]-t,Status:n.DataSourcesState&&n.DataSourcesState[i]}}),r=n.TopResultRendered.map(function(n){return{Type:n.T,Time:n.V-t}}),u={DataSources:i,TopResultRendered:r};this.logAggregate("DataSourcePerformancesMeasure",u)},t.prototype.logNewKeystrokeMeasure=function(t,i,r){this.onNewKeystroke(t,i,r.isSearchHomeZI);var u={ScopeInQuery:r.scopePrefix,Scope:r.scope,IsSearchHome:r.isSearchHomeZI};u.CIVersion=n.WSB.ConstraintIndex.currentCIVersion;this.logAggregate("NewKeystrokeMeasure",u)},t.prototype.logTopResultsRenderedMeasure=function(t,i){this._instrumentationProvider.logProfilerMarker(1,0,"topResultRendered",t,{CI:n.WSB.ConstraintIndex.currentCIVersion});var r={SuggestionTypes:i};this.logAggregate("TopResultsRenderedMeasure",r)},t.prototype.logGroupsRenderedMeasure=function(n){var t={GroupTypes:n};this.logAggregate("GroupsRenderedMeasure",t)},t.prototype.logPreviewPaneOpenedMeasure=function(n,t,i){var r={ParentType:n.getQsCode(),PreviewPaneType:t,ParentLayoutInfo:this.getItemLayoutFromSuggestionsList(n),AutoOpened:i||undefined};this.logAggregate("LastPreviewPaneOpened",r)},t.prototype.logConversationStartMeasure=function(n,t){var i={CVID:n,StartTime:t};this.logSingleMeasure("ConversationStartMeasure",n,i)},t.prototype.logItemClickedMeasure=function(n,t,i,r){var u={CVID:n,ItemType:i.getQsCode(),InputType:r,LayoutInfo:this.getItemLayoutFromSuggestionsList(i)};this.flushAggregatedMeasure(!0);this.logSingleMeasure("ItemClickedMeasure",t,u)},t}();t.WindowsTelemetry=i})(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var i=/[+.\\*?\[\]()]/g,r={".":"\\.","+":"\\+","*":"\\*","\\":"\\\\","?":"\\?","[":"\\[","]":"\\]","(":"\\(",")":"\\)"},u=/^(?:https?:\/\/)?(.*)/,f=/^(?:(?:https?:\/\/(?:www\.)?)|(?:www\.))(.*)/,e=/^\s+/,o=function(){function o(t){var i=this;this._host=t;t.bindKeyDown(function(t){n.isUpOrDownKey(t)&&i.reset()});t.bindQueryChangedOrInitialized(function(n){i._currentQuery=n;!i._fullAutoCompletedQuery||i._fullAutoCompletedQuery.startsWith(n.originalQuery)||n.originalQuery.startsWith(i._fullAutoCompletedQuery)||i.reset()})}return o.prototype.apply=function(n){var r,o,i;if(n.query!=this._autoCompletedQuery){if(r=this._currentQuery.originalQuery,this._host.setAutoCompleteQueryText(""),(!t.config.disableGhosting||n.type=="PT")&&this._currentQuery.originalCursorPosition===r.length){var s=this._currentQuery.scopePrefix?this._currentQuery.scopePrefix.length+1:0,u=r.substr(s).replace(e,"").toLowerCase(),f=n.query.toLowerCase();if(u!==f&&(o=1,i=this.fullAutoCompleteOffset(f,u),i<0&&(t.config.allowInfixGhosting||n.url)&&(i=this.infixAutoCompleteOffset(f,u),o=2),i<0&&(i=this.directNavAutoCompleteOffset(f,u)),i>=0)){this.setAutoCompletedQuery(r,n.query,i);n.autoCompleteType=o;return}}this._autoCompletedQuery&&(this.reset(),this._host.setAutoCompleteQueryText(r))}},o.prototype.reset=function(){this._autoCompletedQuery=null;this._fullAutoCompletedQuery=null},o.prototype.fullAutoCompleteOffset=function(n,t){var i=n.startsWith(t);return i?t.length:-1},o.prototype.infixAutoCompleteOffset=function(n,t){var f=n.search("[ .:,\\\\/+_&-]"+t.replace(i,function(n){return r[n]})),e,o;return f>0&&(e=n.substring(0,f+1).match(u)[1],o=e?e.match(/[ .:,\\/+_&-]+/g).length+1:1,o<3)?f+1+t.length:-1},o.prototype.directNavAutoCompleteOffset=function(n,t){var i=t.match(f),r;return i&&(r=i[1],r.length>0&&n.startsWith(i[1]))?r.length:-1},o.prototype.setAutoCompletedQuery=function(n,t,i){var r=n+t.slice(i);this._host.setAutoCompleteQueryText(r);this._autoCompletedQuery=t;this._fullAutoCompletedQuery=r},o}();t.WSBAutoComplete=o})(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var i;(function(i){function o(n,i){var r,u;return i?(r=t.getKnownFolderPathLC(t.FOLDERID_SkyDrive),r?r+="\\":r="\\onedrive\\",u=n.indexOf(r),u>=0&&(n=n.substr(u+r.length))):n.startsWith("onedrive:\\")&&(n=n.substr(10)),n}function s(n,i,r){var u,f,o,e;return i?(u=t.getKnownFolderPathLC(t.FOLDERID_Profile)+"\\onedrive - ",f=n.indexOf(u),f>=0&&(o=n.indexOf("\\",f+u.length),n=n.substr(o+1))):t.windowsIdentity&&n.startsWith("onedrive for business:\\")&&r&&(e=t.windowsIdentity.indexOf("@"),e!=-1&&r.toLocaleLowerCase().indexOf("personal/"+t.windowsIdentity.substr(0,e))>0&&(n=n.substr(23))),n}function a(n){return{fullySuppressedGroups:n.fullySuppressedGroups?n.fullySuppressedGroups.slice(0):[],partiallySuppressedGroups:n.partiallySuppressedGroups?n.partiallySuppressedGroups.slice(0):[],suppressedSuggestions:n.suppressedSuggestions?n.suppressedSuggestions.slice(0):[]}}function h(n,i,r){var f="",e,o,u,s;return r?(e=t.getKnownFolderPathLC(t.FOLDERID_Profile)+"\\"+t.SubstrateTenantName.toLocaleLowerCase()+"\\",o=i.indexOf(e),o>=0&&(u=o+e.length,s=i.indexOf(" - ",u),f=i.substr(u,s-u).toLocaleLowerCase(),i=i.substr(s+3))):i.startsWith("sharepoint:\\")&&(i=i.substr(12),f=n.siteTitle.toLocaleLowerCase()),[i,f]}function v(n){return n.type=="SW"||n.type=="PWL"}function u(n,t){return!n.suppressed&&n.handoffType==0&&!n.htmlContent&&n.query.toLocaleLowerCase()==t.queryToFetch.toLocaleLowerCase()}function c(n){return n.length>=2&&n[0].type=="MB"&&n[1].type=="MB"}var f={"Microsoft.Windows.ControlPanel":"ControlPanel","Microsoft.AutoGenerated.{923DD477-5846-686B-A659-0FCCD73851A8}":"Classic_{E9C71548-B580-43B2-ACDB-1BA924002754}","{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\\dfrgui.exe":"Classic_{7D13A5DB-6081-48BD-8EA3-A9D7FE67A335}","{6D809377-6AF0-444B-8957-A3773F02200E}\\Windows Defender\\MSASCui.exe":"NameSpace_Classic_{D8559EB9-20C0-410E-BEDA-7ED416AECC2A}","{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\\cleanmgr.exe":"Classic_{AACA901F-E74F-4894-B074-F55059532853}","Microsoft.AutoGenerated.{BB044BFD-25B7-2FAA-22A8-6371A93E0456}":"Classic_{45FDB5DF-1457-4A41-A824-7AD9C75767BC}","Microsoft.Windows.PCSettings.DefaultApps":"AAA_SettingsPageAppsDefaults"},e={"NameSpace_Classic_{F942C606-0914-47AB-BE56-1321B8035096}":"Classic_{232A1851-808C-4B44-A92A-38E862989CE5",AAA_Proxy_Automatic_Config_Group:"AAA_SettingsPageNetworkProxy",AAA_Settings_DeveloperModeGroup:"AAA_SettingsPageRestoreDeveloperOptions",AAA_SystemSettings_Users_PicturePassword:"AAA_SettingsGroupPicturePassword"},r,l;(function(n){n[n.NotDuplicate=0]="NotDuplicate";n[n.NoMetadata=1]="NoMetadata";n[n.MergeMetadata=2]="MergeMetadata"})(r||(r={}));i.isWebSuggestionForPrefix=u;i.topHitIsMultiEntity=c;l=function(){function i(n,t,i,r,u,f,e,o,s){this._host=n;this._instrumentationHelper=t;this._navigationHelper=i;this._previousKeystrokeCache=r;this._ranker=u;this._renderedTopResults=f;this._previewPane=e;this._imageSearchViewModel=o;this._upsellViewModel=s}return i.prototype.launchWebSearch=function(n,t,i,r){var u=n.queryToFetch;this._host.launchSearch(u,this._navigationHelper.getSearchUrl(n.fullPartialQuery,u,i,null,r),t)},i.prototype.getProtocol=function(i,r){var o=this,f="PWL",u=this._instrumentationHelper.getInstrumentedSyntheticSuggestion(r,f),e;return u?u:(u=t.createSuggestion(i,null,this._host.getEdgeIcon,null,f,null,n.InstrumentedItem.getNonSuggestionInstrumentedItem(f,t.SyntheticQSCodesMaps.KValues),1,r,!1,"tp",function(){return o._host.launchUri(u.url)}),u.notAResult=!0,e=function(i){var r=n.prettyPrintUrl(i.fixedUrl,i.queryToFetch,!0);u.url=i.fixedUrl;u.tooltip=i.fixedUrl;u.query=r;u.text=HitHighlightingParser.addMarkers(r);u.narratorText=t.getNarratorText(u,o._host.getLocString("DirectNavSuggestion"))},e(i),u.updateFromQuery=function(n){return n.isProtocol?(e(n),!0):!1},this._instrumentationHelper.instrumentSyntheticSuggestion(r,u),u)},i.prototype.getWebSearch=function(i,r,u,f,e,o){var s=this,h=n.contains([13,14],e);return t.getSyntheticSuggestion(this._instrumentationHelper,i,r,u,f,e,o,h,function(n,t){return s.launchWebSearch(t,n.useRaf,u,e)})},i.prototype.getExplorerSearch=function(n,i){var u=this,r=t.getSyntheticSuggestion(this._instrumentationHelper,n,i,"SDFE",{content:"&#xEC50",type:1},2,this._host.getLocString("SearchInFileExplorer"),!0,function(n,t){return u._host.launchSearchInFileExplorer(t.queryToFetch)});return t.shouldSetThisPcGroupSource(t.GroupType.Documents,n)&&(r.sourceForGroup=1),r},i.prototype.getOutlookWebAccessSearch=function(n,i){var u=this,r=t.windowsAccountType==1;return t.getSyntheticSuggestion(this._instrumentationHelper,n,i,"OWA",{content:"&#xE715",type:2},r?8:12,this._host.getLocString("SearchInOutlookWeb"),!0,function(){return u._host.launchUri(r?"https://outlook.office.com/owa":"https://outlook.live.com/owa")})},i.prototype.getStoreSearch=function(n,i){var r=this;return t.getSyntheticSuggestion(this._instrumentationHelper,n,i,"STS",{content:"&#xEA96",type:2},3,this._host.getLocString("SearchForAppsInTheStore"),!0,function(n,t){return r._host.launchStoreSearch(t.queryToFetch)})},i.prototype.getRecourse=function(i,r){if(!i.queryToFetch||i.taskFrame)return null;switch(t.getEffectiveScope(i)){case t.Scope.Apps:return n.isBingEnabled()?this.getStoreSearch(i,r):null;case t.Scope.Documents:return this.getExplorerSearch(i,r);case t.Scope.Emails:return t.ScopeConfig[t.Scope.Emails].showUpsellOnSuggestionsList()?null:this.getOutlookWebAccessSearch(i,r);case t.Scope.Photos:return n.isBingEnabled()?this.getWebSearch(i,r,"SBI",{content:"&#xEB9F",type:2},13,this._host.getLocString("SearchForWebImages")):null;case t.Scope.Videos:return n.isBingEnabled()?this.getWebSearch(i,r,"SBV",{content:"&#xE714",type:1},14,this._host.getLocString("SearchForWebVideos")):null;default:return null}},i.prototype.getSyntheticSuggestions=function(i,r){var o=t.getScopeConfig(i),s=o.webSyntheticEnabled&&o.webSyntheticEnabled(i),h=s?this.getWebSearch(i,r,"SW",t.getSearchSuggestionIcon(),0,t.getWebSuggestionAnnotation(this._host,t.msbEnabledForQuery(i))):null,c=i.isProtocol&&t.RuntimeConfig.AllowProtocolSyntheticSuggestions?this.getProtocol(i,r):null,f=this.getRecourse(i,r),u,e;return f&&(f.rankingScore=-Number.MAX_VALUE),u=[],this._imageSearchViewModel&&n.isDataSourceEnabled("QSCH",i)&&u.push(this._imageSearchViewModel.getSnipSearchSyntheticSuggestion(i,r)),this._upsellViewModel&&u.push(this._upsellViewModel.getUpsellSyntheticSuggestion(i,r)),t.TweakSearch&&(e=t.TweakSearch.getTweakSearchSuggestion(i,r),e&&u.push(e)),{protocol:c,searchTheWeb:h,recourse:f,others:u.filter(function(n){return!!n})}},i.prototype.canHaveDuplicates=function(i,r){switch(i){case n.WebDataSource:case n.MRUDataSource:case"OSTMA":case"BAW":case"MSBS":case"MSBC":case"QS":case"PP":case"IBA":case"LRA":case"ST":case"FL":case"LM":case"IFF":case"LDIC":case"CG":case"PT":case"MPP":case"MST":case"MFF":case"MRS":case"ODC":case"MDOC":case"MFOL":case"MPHO":case"MVID":case"MMUS":case"SSUE":case"SSUC":return!0;case"FEH":case"AFC":case"TOPP":case"QSCH":case"LSQS":case"TOPS":case"WWE":case"WPB":case"BW":return!1;case"SSEE":return r.scope==t.Scope.Documents||r.scope==t.Scope.Emails||t.RuntimeConfig.QfMode==5;case"SSEC":return r.scope==t.Scope.Emails}throw new Error("New data source "+i+" needs to be explicity classified as needed deduping with other data sources or not");},i.prototype.canHaveDuplicatesWithinDataSource=function(i,r){switch(i){case"MPP":case"MST":case n.MRUDataSource:return!0;case"SSEE":case"SSEC":return r.scope==t.Scope.Emails}return t.supportsShortcuts(i,r)},i.prototype.isDuplicate=function(i,u,c){var v,y,l,a,nt,tt,it,rt,g,p,w,ut,ft,k,d;if(this.isMsbDuplicate(u,c)||n.contains([5,4],u.handoffType)&&n.contains([5,4],c.handoffType)&&u.actionUri==c.actionUri&&u.query.toLocaleLowerCase()==c.query.toLocaleLowerCase()||u.handoffType==10&&c.handoffType==10&&u.type==c.type&&!u.htmlContent&&!c.htmlContent&&u.query.toLocaleLowerCase()==c.query.toLocaleLowerCase()||u.type!="PWL"&&u.handoffType==1&&c.handoffType==1&&n.isDuplicateUrl(i,u.url,c.url)||(v=t.getAppItem(u),y=t.getAppItem(c),l=v?v.filePath:u.path,l&&(l=l.toLocaleLowerCase()),a=y?y.filePath:c.path,a&&(a=a.toLocaleLowerCase()),nt=t.getAppPfn(u),tt=t.getAppPfn(c),nt&&tt&&nt.toLocaleLowerCase()==tt.toLocaleLowerCase()))return r.NoMetadata;if(it=t.getCommandLineItem(u),rt=t.getCommandLineItem(c),it&&y||rt&&v){var et=l||a,b=it||rt,ot=b.encodedPath;return et&&ot&&et==ot.toLocaleLowerCase()?(g=v||y,!b.launchArguments||(g.launchArguments||"").toLocaleLowerCase()==b.launchArguments.toLocaleLowerCase()||!g.launchArguments&&b.launchArguments&&g.displayName.toLocaleLowerCase().startsWith(b.displayName.toLocaleLowerCase())?r.NoMetadata:r.NotDuplicate):r.NotDuplicate}if(u.deviceItem&&c.deviceItem){if(p=u.deviceItem.id||"",w=c.deviceItem.id||"",p.toLocaleLowerCase()==w.toLocaleLowerCase())return l&&!v&&a&&!y?r.MergeMetadata:r.NoMetadata;if(v){if(t.isSetting(c.type)&&f[p]==w)return r.NoMetadata}else if(t.isSetting(u.type)&&(y&&f[w]==p||t.isSetting(c.type)&&(e[p]==w||e[w]==p)))return r.NoMetadata}if(this.isIcoShortcutDuplicate(u,c)||this.isIcoShortcutDuplicate(c,u))return r.NoMetadata;if(l&&a){if(l==a)return r.MergeMetadata;if(!v&&!y)if(u.handoffType==c.handoffType){if(u.handoffType==8&&u.url==c.url)return r.MergeMetadata}else{if((l=o(l,u.handoffType!=7),a=o(a,c.handoffType!=7),l==a)||(ut=u.handoffType!=8,ft=c.handoffType!=8,l=s(l,ut,u.url),a=s(a,ft,c.url),l==a))return r.MergeMetadata;if(t.SubstrateTenantName){var st=h(u,l,ut),ht=st[0],at=st[1],ct=h(c,a,ft),lt=ct[0],vt=ct[1];if(at==vt&&(lt.endsWith(ht)||ht.endsWith(lt)))return r.MergeMetadata}}if(k=u.targetPathLC,d=c.targetPathLC,v&&c.type=="IBA"&&(l=t.resolveKnownFolderGUIDsInPath(l)),y&&u.type=="IBA"&&(a=t.resolveKnownFolderGUIDsInPath(a)),(k&&d&&k==d||k&&k==a||d&&l==d||l==a)&&(!v||!y||(v.launchArguments||"").toLocaleLowerCase()==(y.launchArguments||"").toLocaleLowerCase()))return r.NoMetadata}return this.isCortanaSettingDuplicate(u,c)||this.isCortanaSettingDuplicate(c,u)?r.NoMetadata:u.type==="PPL"&&c.type==="PPL"&&u.uniqueName&&c.uniqueName&&u.uniqueName.toLocaleLowerCase()===c.uniqueName.toLocaleLowerCase()?r.NoMetadata:u.type==="OLE"&&c.type==="OLE"&&u.internetMessageId===c.internetMessageId?r.NoMetadata:u.type==="BKS"&&c.type==="BKS"&&u.url&&c.url&&u.url===c.url?r.NoMetadata:r.NotDuplicate},i.prototype.mergeDuplicates=function(i,u,f){var e=this.isDuplicate(i,u,f);return e?(e==r.MergeMetadata&&t.enrichMetadataFromDuplicate(i,u,f,this._host),u.duplicates=u.duplicates||[],n.contains(u.duplicates,f)||(u.duplicates.push(f),u.needsRefreshAfterDeduping=!0),!0):!1},i.prototype.isIcoShortcutDuplicate=function(n,i){return n.targetPathLC&&t.isApp(n.type)&&t.isApp(i.type)&&n.targetPathLC.includes("\\installer\\")&&n.targetPathLC.endsWith(".ico")&&n.text==i.text},i.prototype.isCortanaSettingDuplicate=function(n,t){return n.handoffType==5&&n.actionUri=="ms-cortana://navigate/Settings"&&t.deviceItem&&t.deviceItem.id=="CortanaSettings"},i.prototype.isMsbDuplicate=function(n,t){return n.msbDomain!=null&&n.msbDomain===t.msbDomain&&n.msbId!=null&&n.msbId===t.msbId},i.prototype.rank=function(i,r,f,e,o,s,h,c){var ti=this,yt,p,tt,ot,bt,rt,ct,d,lt,ut,v,g,dt,ft,at,gt,vt,k,ni;t.isL2(e)&&(h=!1);p=null;n.isDataSourceEnabled("WRS",e)&&(p=f.WRS);p||(p=f[n.WebDataSource]);var et=p?p.rankingSignals:null,ii=p?p.webTopResultRoutingType:1,nt=f[n.MRUDataSource],pt=null,l=null,wt=null;et&&(et.WebSignalsAvailable=!0,pt=p.engagementSignals,l=p.suppressedGroups,(t.config.groupsToNeverFullySuppress||[]).length>0&&l&&(l.fullySuppressedGroups||[]).length>0&&(tt=[],ot=[],l.fullySuppressedGroups.forEach(function(i){n.contains(t.config.groupsToNeverFullySuppress,i)?tt.push(i):ot.push(i)}),tt.length>0&&(l=a(l),l.fullySuppressedGroups=ot,(yt=l.partiallySuppressedGroups).push.apply(yt,tt))));this._previousKeystrokeCache&&(wt=this._previousKeystrokeCache.getPreviousEventWebSignalsData(e.queryToFetch));var ri=nt?nt.SuggestionEngagementData:null,ui=nt?nt.LookupCompletions:null,fi={cvid:this._host.getConversationId(),privacyNumber:this._host.getPrivacyNumber()},y=this.getSyntheticSuggestions(e,s);r=r.slice();l&&(l.fullySuppressedGroups&&l.fullySuppressedGroups.length>0&&(r=r.filter(function(t){return!n.contains(l.fullySuppressedGroups,String(ti.getGroupTypeForSuppressions(t)))})),t.config.honorSuppressedSuggestions&&l.suppressedSuggestions&&l.suppressedSuggestions.length>0&&(r=r.filter(function(i){return!n.contains(l.suppressedSuggestions,t.getSuggestionKey(i))})));t.config.suppressFileFolders&&e.queryToFetch.length<t.config.maxPrefixLengthForSupp&&e.scope==t.Scope.All&&(bt=[t.GroupType.Documents,t.GroupType.Folders],r=r.filter(function(i){return!n.contains(bt,t.getGroupType(i))}));i.length==0&&(y.others.length>0&&r.unshift.apply(r,y.others),y.protocol&&r.unshift(y.protocol));var st=o.length==1&&o[0].childSuggestions&&o[0].childSuggestions.some(function(n){return n.displayed}),kt=this.getSuggestionsToRank(st,i,r,y,s),it=this._ranker.rank(e,kt,et,ri,ui,pt,fi,wt,c,y);this._previousKeystrokeCache&&!h&&this._previousKeystrokeCache.updateSpellerTriggerData(e.queryToFetch,kt);i.length==0&&y.recourse&&r.push(y.recourse);var w=this.determineTopResults(o,r,it,y,e,s,st),ht=i.filter(function(t){return!n.contains(o,t)}),b=this.determineSuggestionsToAddToGroups(ht,r,o,w,y,e,st,h);if(!t.RuntimeConfig.FlatListWithoutGroups&&it.mruSuppressions&&it.mruSuppressions.backPropDataExists)this.applyMRUSuppressions(it,o,w,b,e);else if(l&&l.partiallySuppressedGroups&&this.canPartiallySuppressGroups(w,b))for(rt=0,ct=b;rt<ct.length;rt++)d=ct[rt],u(d,e)||(lt=this.getGroupTypeForSuppressions(d),this.canBePartiallySuppressed(d,lt)&&n.contains(l.partiallySuppressedGroups,String(lt))&&(n.contains(o,d)||(d.suppressed=!0)));if(ut=[],this.removeProtocolIfDuplicate(e,y,w,ht,b,ut),this.setUseRafFlag(w,b,e,ii),v=this.getGroupOrder(e,b,ht),e.staticGroupOrder){for(g=[],dt=function(n){var t=v.findIndex(function(t){return t.type==n});t>=0&&(g.push(v[t]),v.splice(t,1))},ft=0,at=e.staticGroupOrder;ft<at.length;ft++)gt=at[ft],dt(gt);g.length>0&&(g.push.apply(g,v),v=g)}else e.forceGroupOnTop&&(vt=e.forceGroupOnTop,k=v.findIndex(function(n){return t.sameGroup(n,vt)}),k>=0&&(v.splice(k,1),v.unshift(vt)),k=v.findIndex(function(n){return t.isTopHitChildGroup(n)}),k>=0&&(ni=v[k],v.splice(k,1),v.unshift(ni)));if(t.RuntimeConfig.FlatListWithoutGroups&&(w=w.concat(b.filter(function(n){return!n.suppressed})),b=[],n.trimList(w,t.RuntimeConfig.MaxSuggestionsWhenFlatList,function(t){return!n.contains(i,t)&&!t.notAResult}),ut.length!=0))throw new Error("Can't remove suggestions from groups when there are no groups");return{topResults:w,suggestionsToAdd:b,suggestionsToRemove:ut,groupOrder:v}},i.prototype.applyMRUSuppressions=function(i,r,f,e,o){var c,l,a,h,s;if(this.canPartiallySuppressGroups(f,e))for(c={},l=0,a=e;l<a.length;l++)if(h=a[l],!u(h,o)&&(s=t.getGroupType(h),this.canBePartiallySuppressed(h,s))){if(!c[s]){var v=i.mruSuppressions.maxGroupCCR?i.mruSuppressions.maxGroupCCR[s]||0:0,y=i.mruSuppressions.maxGroupProbSugClickGivenPref?i.mruSuppressions.maxGroupProbSugClickGivenPref[s]||0:0,p=i.mruSuppressions.mruGroupRatios?i.mruSuppressions.mruGroupRatios[s]||0:0,w=i.mruSuppressions.mruGroupBackpropRatios?i.mruSuppressions.mruGroupBackpropRatios[s]||0:0,b=i.mruSuppressions.mruGroupBackpropWeights?i.mruSuppressions.mruGroupBackpropWeights[s]||0:0,k=t.config.wtMaxGroupCCR*v+t.config.wtMaxGroupProbSugClickGivenPref*y+t.config.wtMruGroupRatio*p+t.config.wtMruGroupBackpropRatio*w+t.config.wtMruGroupBackpropWeight*b+t.config.wtLRBias,d=1/(1+Math.exp(-k));c[s]=n.trimFeatureStoreValue(d)}h.mruSuppressionScore=c[s];h.mruSuppressionScore<t.config.lRModelCutOff&&(n.contains(r,h)||(h.suppressed=!0))}},i.prototype.allowedInGroups=function(n){return n.isAnswer?n.allowedInGroups:!0},i.prototype.getGroupTypeForSuppressions=function(n){var i=t.getGroupType(n);return i==t.GroupType.LocalPlaces?t.GroupType.SearchSuggestions:i},i.prototype.canBePartiallySuppressed=function(n,i){return t.getScope(i)!=t.Scope.All},i.prototype.canPartiallySuppressGroups=function(n,i){return t.RuntimeConfig.ScopesAvailable?n.every(function(n){return t.getGroupType(n)==t.GroupType.SearchSuggestions})&&i.every(function(n){return t.getGroupType(n)==t.GroupType.SearchSuggestions})?!1:!0:!1},i.prototype.isProtocolDuplicate=function(t,i,r){return t==r?!1:t.type=="MD"?!0:t.handoffType==1&&n.isDuplicateUrl(i,t.url,r.url)},i.prototype.removeProtocolIfDuplicate=function(t,i,r,u,f,e){var h=this,o,s;i.protocol&&(o=function(n){return!n.suppressed&&h.isProtocolDuplicate(n,t,i.protocol)},(r.some(o)||u.some(o)||f.some(o))&&(n.tryRemove(r,i.protocol)?r.length||(s=n.removeFirstWhere(u,o)||n.removeFirstWhere(f,o),r.push(s)):n.tryRemove(f,i.protocol)||n.contains(u,i.protocol)&&e.push(i.protocol),i.protocol=null))},i.prototype.getSuggestionsToRank=function(i,r,u,f){i&&(r=r.filter(function(n){return!t.isChildSuggestion(n)}));f.recourse&&(r=r.filter(function(n){return n!=f.recourse}));var e=r.concat(u);return f.searchTheWeb&&!n.contains(r,f.searchTheWeb)&&e.push(f.searchTheWeb),e},i.prototype.determineTopResults=function(i,r,f,e,o,s,h){var et=this,l,d,p,w,b,it,g,nt,y,k,ut,tt,ft,a;if(h||!o.queryToFetch||t.config.stickyTopResultsV2&&i.length>1&&!t.isL2(o))return i;if(l=t.config.forceVoiceFlowOnTopHit?[]:f.topResults,d=this._previewPane?this._previewPane.getPreviewedSuggestionToForceTopHit():null,d&&this._ranker.allowInTopHit(o,d)&&(p=function(n){return t.isEquivalentForPreviewPanePurposes(o,d,n)},w=l.findIndex(p),w!=0&&(b=void 0,w>0?(b=l[w],l.splice(w,1)):b=i.find(p)||r.find(p)||(e.searchTheWeb?[e.searchTheWeb]:[]).find(p),b&&l.unshift(b))),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&&u(n,o)})&&l.splice(it,1)),l.length==0&&(t.config.stickyTopResultsV2&&i.length>0?l.push.apply(l,i):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=t.getEffectiveScope(o)==t.Scope.Emails?t.config.maxNumberOfEmailsInTopResult:Math.max(t.config.maxNumberOfTopResults,c(l)?2:0,i.length),t.config.bypassFallbackOnMSBTopHit==4&&l.length>0&&(l[0].type=="PPL"||l[0].type=="BKS")&&(g=2),l.length>g&&(l=l.slice(0,g)),t.config.synthWebNoBestMatch&&l.length==1){var rt=[t.GroupType.SearchSuggestions,t.GroupType.Websites],ot=r.filter(function(i){return!n.contains(rt,t.getGroupType(i))}),st=l.filter(function(i){return!n.contains(rt,t.getGroupType(i))});ot.length==0&&st.length==0&&(l=[])}for(nt=i.length-1;nt>=0;--nt)y=i[nt],n.contains(l,y)||(y.useRaf&&(y.useRaf=!1),y!=e.searchTheWeb&&r.unshift(y));return l.length==1&&n.safeExecute(function(){return et.applyAppOverride(l,r)},"applyDeviceInfoOverride"),l.forEach(function(n){return n.suppressed=!1}),k=t.isL2(o),t.config.stickyTopResultsV2&&l.length==1&&i.length==1&&!k&&(ut=l[0],tt=i[0],ut==tt||v(tt)||l.unshift(tt)),t.config.stickyConversation&&l.length==1&&this._previousKeystrokeCache&&(a=this._previousKeystrokeCache.getPreviousTopHit(),ft=a?a.ciMatchedQuery||a.query.toLocaleLowerCase():"",a&&!k&&o.queryToFetch.length>t.config.stickyConversationMinPrefixLength&&(a.type=="PP"||a.type=="ST")&&ft.startsWith(o.queryToFetch.toLocaleLowerCase())&&!(a.query.toLocaleLowerCase()==l[0].query.toLocaleLowerCase()&&a.type==l[0].type)&&this._previousKeystrokeCache.getPreviousQuery().length<o.queryToFetch.length&&(a.sequenceNumber=s,a.instItem=n.InstrumentedItem.createInstrumentedItem(s,a.type),l[0]=a),this._previousKeystrokeCache.setPreviousTopHit(k?null:l[0]),this._previousKeystrokeCache.setPreviousQuery(o.queryToFetch.toLocaleLowerCase())),t.config.enableMRUHint&&l.length>0&&this._previousKeystrokeCache&&(a=this._previousKeystrokeCache.getPreviousTopHit(),a&&a.mruHintEnabled&&a.text==l[0].text&&a.type==l[0].type&&(l[0].mruHintEnabled=!0)),t.config.enableCISpeller&&l.length==1&&this._previousKeystrokeCache&&(l[0].type=="PP"||l[0].type=="ST")&&this._previousKeystrokeCache.setPreviousTopHit(k?null:l[0]),l},i.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]))},i.prototype.setUseRafFlag=function(n,i,r,u){var e,s,o,h,f;if(t.isCortanaEnabledCache)if(u==2||t.config.forceVoiceFlowOnTopHit)for(e=0,s=n;e<s.length;e++)f=s[e],f.handoffType!=0||f.isAnswer||(f.useRaf=!0);else for(o=0,h=n;o<h.length;o++)f=h[o],f.handoffType==0&&!f.isAnswer&&this._host.matchesVcd(f.query)&&(f.useRaf=!0)},i.prototype.determineSuggestionsToAddToGroups=function(i,r,f,e,o,s,h,c){var k=this,l=r.filter(function(t){return!n.contains(e,t)}),w=[],a,v,y,p,b;for(t.RuntimeConfig.FlatListWithoutGroups||l.forEach(function(n,i){k.allowedInGroups(n)||(t.getScope(t.getGroupType(n))==t.Scope.All?w.push(i):n.suppressed=!0)}),a=w.length-1;a>=0;--a)l.splice(a,1);return o.searchTheWeb&&(v=e.indexOf(o.searchTheWeb),v!=-1&&(y=n.removeFirstWhere(l,function(n){return u(n,s)}),y&&(e[v]=y))),p=l.filter(function(i){return n.contains([t.GroupType.SearchSuggestions,t.GroupType.Websites,t.GroupType.LocalPlaces],t.getGroupType(i))}),b=l.filter(t.enforceOriginalOrder),!h&&this.canRenderChildSuggestions(e,c,s)&&this.addChildSuggestions(e[0],l),s.queryToFetch&&l.sort(function(n,t){return t.rankingScore-n.rankingScore}),this.insertDefaultSearchTheWeb(s,o,e,i,l,p),l=this.insertSuggestionsToRightPlace(l,b),this.insertSuggestionsToRightPlace(l,p)},i.prototype.insertDefaultSearchTheWeb=function(n,i,r,f,e,o){var s,h;i.searchTheWeb&&(n.scope==t.Scope.Web||n.scope==t.Scope.All)&&(s=o.findIndex(function(t){return u(t,n)}),f.some(function(t){return u(t,n)})||r.some(function(t){return u(t,n)})?s!=-1&&(h=o[s],o.splice(s,1),e.splice(e.indexOf(h),1)):s==-1&&(o.unshift(i.searchTheWeb),e.unshift(i.searchTheWeb)))},i.prototype.getGroupOrder=function(n,i,r){var f,o,a,u,w,b,h,v,k,d,c,y,s;switch(n.scope){case t.Scope.Web:if(!n.queryToFetch)return[{type:t.GroupType.Websites},{type:t.GroupType.SearchSuggestions}];break;case t.Scope.Apps:return[{type:t.GroupType.Apps},{type:t.GroupType.Store}];case t.Scope.Photos:return[{type:t.GroupType.Photos},{type:t.GroupType.SearchSuggestions}];case t.Scope.Videos:return[{type:t.GroupType.Videos},{type:t.GroupType.SearchSuggestions}];case t.Scope.PeopleEmail:return[{type:t.GroupType.People},{type:t.GroupType.Emails}]}f=r.concat(i);f.sort(function(n,t){return t.rankingScore-n.rankingScore});var p=[],l=[],e=[],g=function(n){if(n.suppressed)l.push(n);else if(p.push(n),t.config.enableStaticGroupRanking){var r=t.getGroupType(n),i={type:r,source:n.sourceForGroup};e.some(function(n){return t.sameGroup(n,i)})||e.push(i)}};for(o=0,a=f;o<a.length;o++)s=a[o],g(s);if(l.length!=0&&(f=p.concat(l)),u=[],t.config.enableStaticGroupRanking&&f.length>0&&t.getGroupType(f[0])!=t.GroupType.SearchSuggestions){for(w=[{type:t.GroupType.Apps},{type:t.GroupType.Settings},{type:t.GroupType.Documents,source:1}],b=function(n){e.some(function(i){return t.sameGroup(i,n)})&&u.push(n)},h=0,v=w;h<v.length;h++)k=v[h],b(k);t.RuntimeConfig.QfMode!=8&&e.some(function(n){return t.sameGroup(n,{type:t.GroupType.SearchSuggestions})})&&u.push({type:t.GroupType.SearchSuggestions})}for(d=function(n){var r=t.getGroupType(n),i={type:r,source:n.sourceForGroup};u.some(function(n){return t.sameGroup(n,i)})||(t.RuntimeConfig.QfMode==8&&i.type==t.GroupType.SearchSuggestions?u.unshift(i):t.config.enableStaticGroupRanking&&t.isTopHitChildGroup(i)?u.unshift(i):u.push(i))},c=0,y=f;c<y.length;c++)s=y[c],d(s);return u},i.prototype.addChildSuggestions=function(i,r){i.calculateChildSuggestions&&i.calculateChildSuggestions();i.childSuggestions&&i.childSuggestions.length>0&&Object.keys(t.config.topHitChildGroups).forEach(function(u,f){var e=parseInt(u),o=n.contains(t.config.suppressedTopHitChildGroups,e)?0:t.config.topHitChildGroups[u],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)}))})},i.prototype.canRenderChildSuggestions=function(n,i){var r,u;return t.RuntimeConfig.FlatListWithoutGroups?!1:n.length!=1?!1:(r=n[0],t.RuntimeConfig.AlwaysWide&&r.previewPaneType!=1)?!1:i?this._renderedTopResults.topResults.length==1?(u=this._renderedTopResults.topResults[0],u.hasChildSuggestionsDisplayed&&u.query==r.query&&t.getGroupType(u)==t.getGroupType(r)):!1:!0},i.prototype.insertSuggestionsToRightPlace=function(t,i){var r,e,u,f;if(i.length==0)return t;for(r=[],e=i[0],u=0;u<t.length;u++)f=t[u],f==e?r=r.concat(i):n.contains(i,f)||r.push(f);return r},i}();i.Aggregator=l})(i=t.Ranking||(t.Ranking={}))})(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t=function(){function t(n,t,i,r){var u=this;this._instrumentationHelper=t;this._sequenceNumberReader=i;this._page=r;this._itemLaunchEventHandlers=[];this.groups=[];this.topResults=[];this._lastUpdatedSequenceNumber=-1;this._topResultsRenderingDisabled=!1;this._groupRenderingDisabled=!1;n.bindShown(function(){u._selectedItem=null})}return t.prototype.onDismiss=function(){this.topResults=[];this.renderTopResults(!0);this.groups=[];this.renderGroups(!0);this._partialQuery=null;this._lastUpdatedSequenceNumber=-1},t.prototype.bindItemLaunch=function(n){this._itemLaunchEventHandlers.push(n)},t.prototype.onSuggestionLaunch=function(n,t,i){this._itemLaunchEventHandlers.forEach(function(r){return r(n,t,i)})},t.prototype.onQueryChanged=function(n){this._partialQuery=n},t.prototype.getCurrentTopResults=function(){return this.topResults.slice(0)},t.prototype.getTopResultsWhichFitInCanvas=function(n){return n},t.prototype.resetAriaSelected=function(n){n&&this._page.render(function(){var t=_ge(n.id);t&&(t.setAttribute("aria-selected","false"),t.setAttribute("aria-selected","true"))})},t.prototype.updateTopResults=function(t,i,r,u,f,e){var s=this,a,o,h,y;t!=(u!=this._lastUpdatedSequenceNumber)&&SharedLogHelper.LogError("updateTopResult",t+" != (sequenceNumber "+u+" != lastUpdateSequenceNumber "+this._lastUpdatedSequenceNumber+")",new Error("Precondition failed"));this._lastUpdatedSequenceNumber=u;t&&(this.groups=[],this.onGroupsCleared());a=this._selectedItem;o=this.topResults;i=this.getTopResultsWhichFitInCanvas(i);h=!n.sequenceEqual(i,o)||o.some(function(n){return n.needsRefreshAfterDeduping});h&&(this.topResults=i.slice(0));var c=!1,l=h?i.length:0,v=function(){c&&l==0&&(n.config.enableLocalInstrumentation&&s._instrumentationHelper.instrumentRenderedLocalSuggestion(u,i),s._instrumentationHelper.instrumentTopResultRendered(u,i.map(function(n){return n.type})),c=!1)};return h?(this.renderTopResultsAfter(function(){for(var h,i=0,c=s.topResults;i<c.length;i++)h=c[i],h.needsRefreshAfterDeduping=!1,n.contains(o,h)?l-=1:s.setupIcon(u,h,!0,function(){l-=1;v()});s.onBeforeRenderTopResults(t,o,f,r,e)}),c=!0):(y=this.onBeforeRenderTopResults(t,o,f,r,e),y==0&&(this.renderTopResults(),c=!0)),this._selectedItem&&(a!=this._selectedItem||t)&&n.contains(this.topResults,this._selectedItem)&&this.resetAriaSelected(this._selectedItem),[h,v]},t.prototype.setupIcon=function(n,t,i,r){r()},t.prototype.renderGroups=function(n){this._groupRenderingDisabled||(this._page.updateGroupsView({query:this._contentQuery,topResults:this.topResults,groups:this.groups},n),this._instrumentationHelper.updateSuggestionsList(this.topResults,this.groups))},t.prototype.renderGroupsAfter=function(n){var t=this._groupRenderingDisabled;this._groupRenderingDisabled=!0;try{n()}finally{this._groupRenderingDisabled=t;this.renderGroups()}},t.prototype.renderTopResults=function(n){this._topResultsRenderingDisabled||(this._page.updateTopResultsView({query:this._contentQuery,topResults:this.topResults,groups:this.groups},n),this._instrumentationHelper.updateSuggestionsList(this.topResults,this.groups))},t.prototype.renderTopResultsAfter=function(n){var u=this._topResultsRenderingDisabled,t,i,r;this._topResultsRenderingDisabled=!0;try{n()}finally{for(this._topResultsRenderingDisabled=u,this.renderTopResults(),t=0,i=this.topResults;t<i.length;t++)r=i[t],r.executeScript&&r.executeScript()}},t}();n.BaseRootViewModel=t}(AutoSuggest||(AutoSuggest={})),function(n){function r(t,i){t(n.getCurrentTime(),n.getInputType(i),i)}var t="aria-selected",i;n.invokeClickHandler=r;i=function(){function i(i){var r=this,u;this._host=i;this._renderingInProgress=!1;this._narratorLaunchHandlers=[];this._viewData={};this._targetElemCache={};u=new MutationObserver(function(n){var i,o,u,f,s,e;if(!r._renderingInProgress){for(i=[],u=0,f=n;u<f.length;u++)s=f[u],e=s.target,o=e.id,i.push(e.getAttribute(t)=="true"?1:0);(i.length==1&&i[0]==0||i.length==2&&i[0]^i[1])&&r._narratorLaunchHandlers.forEach(function(n){return n(o)})}});u.observe(document,{subtree:!0,attributes:!0,attributeFilter:[t]});n.View.getLocString=function(n){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];return i.getLocString.apply(i,[n].concat(r))};this.addViewData("TestHooksEnabled",n.config.th)}return i.prototype.adjustHeightAsync=function(){var t=this;n.safeSetTimeout(function(){return t._host.adjustHeight()},0,"adjustHeightAsync")},i.prototype.bindOnNarratorLaunch=function(n){this._narratorLaunchHandlers.push(n)},i.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")}},i.prototype.renderReactView=function(n,t,i){var f=this,r=this._targetElemCache[n],u;r||(this._targetElemCache[n]=r=_ge(n));u=i;u.adjustHeight||(u.adjustHeight=function(){return f.adjustHeightAsync()});this.render(function(){return _w.ReactDOM.render(React.createElement(t,i),r)},n)},i.prototype.addViewData=function(n,t){this._viewData[n]=t},i.prototype.getViewData=function(){return this._viewData},i}();n.BasePage=i}(AutoSuggest||(AutoSuggest={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){function r(n,t){var i=parseInt(n.substr(1),16),r=i>>16&255,u=i>>8&255,f=i&255;return"rgba("+r+","+u+","+f+","+t+")"}function s(n,t){var i=parseInt(n.substr(1),16),r=Math.max(0,(i>>16)-t),u=Math.max(0,(i>>8&255)-t),f=Math.max(0,(i&255)-t);return"#"+String("000000"+(f|u<<8|r<<16).toString(16)).slice(-6)}function u(n,t){var i=parseInt(n.substr(1),16),r=Math.max(0,(i>>16)*t),u=Math.max(0,(i>>8&255)*t),f=Math.max(0,(i&255)*t);return"#"+String("000000"+(f|u<<8|r<<16).toString(16)).slice(-6)}var e="slideInMessage",o="indexingMessage",i,f;t.SinglePaneWidth=344;t.PreviewPaneWidth=440;t.DebugWindowWidth=800;f=function(f){function h(r){var u=f.call(this,r)||this,e;return u.host=r,u._root=_ge("root"),u._windowsTemporaryMessageShown=!1,u._windowsIndexingMessageShown=!1,u._progressBarVisible=!1,u._previewPaneVisible=!1,u._debugWindowVisible=!1,u._suggestionsContainerHeight=0,u._immersiveSearchHeightExpandedInThisConversation=!1,i=SearchAppWrapper.CortanaApp,u._windowsTemporaryMessageWrapper=_ge("temporaryMessageWrapper"),u._windowsIndexingMessageWrapper=_ge("temporaryMessageWrapper"),u._qfContainer=_ge("qfContainer"),u._previewContainer=_ge("previewContainer"),u._flyout=_ge("flyoutContainer"),r.bindAppVisible(function(){var f=i.width,e=i.height;f&&e?u.setDimensions(f,e):ThresholdUtilities.getCortanaHeaders(function(n){if(n){var t=n["X-BM-DeviceDimensionsLogical"].split("x"),i=t[0],r=t[1];u.setDimensions(parseInt(i),r)}});u._isFileExplorerOrControlPanel=t.RuntimeConfig.QfMode==5||t.RuntimeConfig.QfMode==9;t.RuntimeConfig.PreviewPaneAvailable&&(u.initPreviewPane(),t.setVisibility(u._previewPane,t.RuntimeConfig.AlwaysWide),!t.RuntimeConfig.AlwaysWide&&r.hasFallbackHappened()&&i.resetToDefaultSize());u.initDebugWindow();u.setConditionalCss("wideByDefault",t.RuntimeConfig.AlwaysWide||t.RuntimeConfig.QfMode==2);u.setConditionalCss("centerScreen",t.RuntimeConfig.QfMode==2);u.setConditionalCss("settingsApp",t.RuntimeConfig.QfMode==7);u.setConditionalCss("santorini",t.RuntimeConfig.QfMode==8);u.setConditionalCss("lockscreen",t.RuntimeConfig.QfMode==6);u.setConditionalCss("fileExplorer",u._isFileExplorerOrControlPanel);u.setConditionalCss("panelCanResize",t.RuntimeConfig.PanelCanResize);u.setConditionalCss("flatListWithoutGroups",t.RuntimeConfig.FlatListWithoutGroups);u.setConditionalCss("searchBoxOnTop",t.RuntimeConfig.SearchBoxOnTop);u.setConditionalCss("noScopes",!t.RuntimeConfig.ScopesAvailable);u.setConditionalCss("searchHomeTrendingSearches",t.config.trendingSearch&&t.RuntimeConfig.PreviewPaneAvailable);u.setConditionalCss("searchHomeTwoCols",t.config.searchHomeTwoCols&&t.RuntimeConfig.AlwaysWide);u.setConditionalCss("noPPOpenedArrow",t.config.noPPOpenedArrow);u.setConditionalCss("whitePreview",t.config.whitePreview);u.setConditionalCss("searchHomeQuickAnswer",t.shouldEnableQuickSearches(r.getLanguage().toLowerCase()));u.setConditionalCss("webDisabled",!n.isMiniSerpEnabled());u.setConditionalCss("snipSearchEnabled",t.shouldEnableSnipSearch(r));u.setConditionalCss("tightPwiloUX",t.config.tightPwiloUX);u.setConditionalCss("pwiloMetadataDisabled",t.config.pwiloMetadataDisabled);u.setConditionalCss("edgeUpsellEnabled",t.config.enableEdgeUpsell);u.setConditionalCss("edgeUpsellBottom",t.config.enableEdgeUpsellBottom);u.setConditionalCss("edgeUpsellSearchHomeBanner",t.config.enableEdgeUpsellSearchHomeBanner);u.setConditionalCss("trendingSearchTwoRows",t.shouldEnableTrendingSearches(r.getLanguage().toLowerCase())&&t.config.trendingSearchTwoRows);t.config.optimizeStartupRendering||u.setQueryBasedCss(null)}),r.bindBootstrapDone(function(){var n=_ge("preBootstrapPane");n&&(t.setVisibility(n,!1),n.remove())}),r.bindShown(function(){if(t.config.isThemeAware&&i.theme){var n=i.theme.startsWith("000000");u.setThemeBasedCss(n)}u.setConditionalCss("snipSearch",i.entryPoint=="WNSSBS"&&t.config.enableSnipSearchV2);t.config.optimizeStartupRendering||t.setVisibility(u._root,!0)}),r.bindAppHidden(function(){u._openPreviewPaneButtonCache=undefined;u.markWebViewExpandedState(!1);t.setVisibility(u._previewPane,!1);t.config.optimizeStartupRendering&&u.setConditionalCss("dismissed",!0)}),r.bindQueryChangedOrInitialized(function(n){n.fullPartialQuery&&u.ensureWebViewHeightExpanded();u._isFileExplorerOrControlPanel&&u.updateFENarratorSuggestionCount(null);t.config.optimizeStartupRendering&&u.setConditionalCss("dismissed",!1)}),r.bindSearchBoxClick(function(){return u.ensureWebViewHeightExpanded()}),r.bindKeyDown(function(n){n==40&&u.ensureWebViewHeightExpanded()}),e=function(){t.RuntimeConfig.AlwaysWide||(u._previewPaneVisible=!1,t.setVisibility(u._previewPane,!1));u.setDebugWindowVisibility(!1)},r.bindDismissed(function(){u.resetSuggestionsContainerHeight();e();t.config.optimizeStartupRendering&&u.setQueryBasedCss(null)}),r.bindAccentColorAndThemeRefreshed(function(n,t){u.applyAccentColor();u.setThemeBasedCss(t)}),t.config.alwaysWideBeforeRS5&&i.addEventListener("openanimationcompleted",function(){u.ensureWebViewWidthExpanded()}),i.addEventListener("resettingtodefaultsize",function(){e()}),sj_be(sj_b,"contextmenu",function(n){for(var t=n.target;t;){if(t.classList.contains("allowcontextmenu"))break;t=t.parentElement}t||sj_pd(n)}),u}return __extends(h,f),h.prototype.setConditionalCss=function(n,t){t?this._root.classList.add(n):this._root.classList.remove(n)},h.prototype.setQueryBasedCss=function(n){t.RuntimeConfig.QfMode==8?this.setConditionalCss("zeroInputSantorini",n?n.isSearchHomeZI:t.RuntimeConfig.SearchHomeAvailable==1):this.setConditionalCss("zeroInput19H1",n?n.isSearchHomeZI:t.RuntimeConfig.SearchHomeAvailable==1)},h.prototype.setThemeBasedCss=function(n){t.config.isThemeAware?(t.RuntimeConfig.QfMode==7&&(n=n&&i.appsUseLightTheme===!1),this._isFileExplorerOrControlPanel&&i.fileExplorerSuggestionPage&&(n=i.fileExplorerSuggestionPage.useDarkTheme),this.setConditionalCss("darkThemeBeta",t.config.darkModeWSB&&n),this.setConditionalCss("darkTheme19H1",n),this.setConditionalCss("lightTheme19H1",!n)):t.config.searchHomeSupported&&(this.setConditionalCss("lightTheme19H1",!0),this.setConditionalCss("lightThemeRS5",!0))},h.prototype.initPreviewPane=function(){var n=i.textScaleFactor||1,f=t.PreviewPaneWidth/n,r,u;this._previewPane||(this._previewPane=_ge("qfPreviewPane"),this._previewPane.classList.remove("transitionOn"));t.RuntimeConfig.QfMode==2?(r=470,u=r/n,this._previewPane.style.minWidth=u+"px"):this._previewPane.style.minWidth=f+"px"},h.prototype.initDebugWindow=function(){this._debugWindow||(this._debugWindow=_ge("qfDebugPane"),this._debugWindow&&(this._debugWindow.style.flexBasis=t.DebugWindowWidth+"px"))},h.prototype.setDimensions=function(n,i){if(t.isMobileCache&&i&&(this._root.style.height=i+"px"),!this._previewPaneVisible&&!this._debugWindowVisible){this.onPaneWidthSet(n);this._originalPaneWidth=n}},h.prototype.ensureWebViewWidthExpanded=function(){var n=t.SinglePaneWidth+t.PreviewPaneWidth;t.RuntimeConfig.QfMode==1&&i.width<n&&(i.setPaneWidth(n),this.setDimensions(n,null))},h.prototype.ensureWebViewHeightExpanded=function(){if(t.RuntimeConfig.QfMode==2&&!this._immersiveSearchHeightExpandedInThisConversation){var n=i.height;i.setCenterScreenAcrylicBackgroundHeight(n+12);i.setWebViewHeight(n);this.markWebViewExpandedState(!0)}},h.prototype.markWebViewExpandedState=function(n){this._immersiveSearchHeightExpandedInThisConversation=n;this.setConditionalCss("webViewExpanded",n)},h.prototype.getScrollTop=function(){return this._qfContainer.scrollTop},h.prototype.scrollToTop=function(){this._qfContainer.scrollTop=0;_d.body.scrollTop=0},h.prototype.scrollTo=function(n){var r=_ge(n.id),i;this.scrollToElement(r,this._qfContainer,this._qfContainer.offsetHeight);i=window.innerHeight;t.isMobileCache&&_d.body.scrollHeight>i&&this.scrollToElement(r,_d.body,i)},h.prototype.scrollToElement=function(n,t,i){var u=t.scrollTop,r=n.offsetTop-t.offsetTop,f=r+n.offsetHeight;f>u+i?t.scrollTop=f-i:r<u&&(t.scrollTop=r)},h.prototype.getSuggestionsContainerHeight=function(){return t.RuntimeConfig.QfMode==2&&!this._immersiveSearchHeightExpandedInThisConversation?i.height:(this._suggestionsContainerHeight||this.calculateSuggestionsContainerHeight(),this._suggestionsContainerHeight)},h.prototype.getSuggestionsContainerWidth=function(){return t.config.th?i.width:_w.innerWidth},h.prototype.resetSuggestionsContainerHeight=function(){this._suggestionsContainerHeight=0},h.prototype.calculateSuggestionsContainerHeight=function(){var n=_ge("root").clientHeight,t;n<440&&(n=440);t=_ge("temporaryMessage");n-=t.offsetHeight;this._suggestionsContainerHeight=n},h.prototype.getPanelWidthFor=function(n){var i=this._originalPaneWidth;return i+=n&1?t.PreviewPaneWidth:0,i+(n&2?t.DebugWindowWidth:0)},h.prototype.getPanelState=function(){switch(i.width-this._originalPaneWidth){case 0:return 0;case t.PreviewPaneWidth:return 1;case t.DebugWindowWidth:return 2;case t.PreviewPaneWidth+t.DebugWindowWidth:return 3;default:return 0}},h.prototype.openSidePanel=function(n){var t=this.getPanelState(),u,r;if(t==0&&this.setDimensions(i.width,null),!(t&n)){u=t|n;r=this.getPanelWidthFor(u);i.setPaneWidth(r);this.onPaneWidthSet(r)}},h.prototype.closeSidePanel=function(n){var u=this.getPanelState(),f,r;if(u&n){f=u&~n;r=this.getPanelWidthFor(f);r!=this._originalPaneWidth||t.config.alwaysWideBeforeRS5?i.setPaneWidth(r):i.resetToDefaultSize();this.onPaneWidthSet(r)}},h.prototype.onPaneWidthSet=function(t){n.safeFireEvent("CortanaPaneWidthSet",t)},h.prototype.getOpenPreviewPaneButton=function(){if(!t.RuntimeConfig.PreviewPaneAvailable)return null;if(!this._openPreviewPaneButtonCache){var n=t.isRtl(),i=n?"&#xE96F":"&#xE970";t.config.chevronMed&&(i=n?"&#xE973":"&#xE974");this._openPreviewPaneButtonCache={defaultIcon:{content:i,type:2},openedIcon:{content:n?"&#xE72B":"&#xE72A",type:2},clickHandler:this._openPreviewPaneClickHandler}}return this._openPreviewPaneButtonCache},h.prototype.setContextMenuHandler=function(n){this._contextMenuHandler=n},h.prototype.setSuggestionClickHandler=function(n){this._suggestionClickHandler=n},h.prototype.setOpenPreviewPaneClickHandler=function(n){this._openPreviewPaneClickHandler=n},h.prototype.setExpanderClickInstrumentation=function(n){this._expanderClickInstrumentation=n},h.prototype.updateGroupsView=function(i,r){if(t.config.th&&ClientTestHooks.isTesthookParamSet("forceRenderingCrashOnSecondConversation")&&this._host.getPaneCloseCount())throw new Error("Simulated exception");t.config.optimizeStartupRendering&&r||this.setQueryBasedCss(i.query);this.setConditionalCss("noSuggestions",i.topResults.length==0&&i.groups.length==0);var u=i.query&&i.query.isSearchHomeZI,f=u?null:" - "+t.getWebSuggestionAnnotation(this._host,t.msbEnabledForQuery(i.query));this.renderReactView("groups",n.View.WindowsGroups,{groups:i.groups,contextMenuHandler:this._contextMenuHandler,clickHandler:this._suggestionClickHandler,openPreviewPaneButton:this.getOpenPreviewPaneButton(),webSuggestionAnnotation:f})},h.prototype.updateFENarratorSuggestionCount=function(t){var i="";this._isFileExplorerOrControlPanel&&t&&(i=this.host.getLocString("SuggestionCountNarrator",""+t));this.renderReactView("narratorMessageContainer",n.View.FileExplorerNarratorAnnouncement,{message:i})},h.prototype.updateTopResultsView=function(i,r){if(t.config.optimizeStartupRendering&&r||this.setQueryBasedCss(i.query),this.setConditionalCss("noSuggestions",i.topResults.length==0&&i.groups.length==0),this._isFileExplorerOrControlPanel){var u=i.topResults.length;this.updateFENarratorSuggestionCount(u>0?u:null)}this.renderReactView("topResults",n.View.WindowsTopResults,{suggestions:i.topResults,contextMenuHandler:this._contextMenuHandler,clickHandler:this._suggestionClickHandler,openPreviewPaneButton:this.getOpenPreviewPaneButton()})},h.prototype.showTemporaryMessage=function(i){var r=this,u;this._windowsTemporaryMessageShown?(this.hideTemporaryMessage(),n.safeSetTimeout(function(){return r.showTemporaryMessage(i)},100,"showTemporaryMessage")):(u={messageText:i,clickHandler:function(){r.hideTemporaryMessage();r._host.setFocusInSearchBox(null,"temporaryMessage")}},this.updateTemporaryMessageView(u),this._windowsTemporaryMessageShown=!0,t.setVisibility(this._windowsTemporaryMessageWrapper,!0))},h.prototype.hideTemporaryMessage=function(){this._windowsTemporaryMessageShown&&(this.updateTemporaryMessageView(null),this._windowsTemporaryMessageShown=!1,t.setVisibility(this._windowsTemporaryMessageWrapper,!1))},h.prototype.updateTemporaryMessageView=function(t){this.renderReactView("temporaryMessage",n.View.WindowsMessage,{dataModel:t,icon:{content:"&#xE946",type:2},messageClassName:e})},h.prototype.updateIndexingMessageView=function(i){var r=!!i;this._windowsIndexingMessageShown!=r&&(this.renderReactView("temporaryMessage",n.View.WindowsMessage,{dataModel:i,icon:i&&i.messageText==this._host.getLocString("WindowsIndexingInProgressMessage")?{content:"&#xE895",type:2}:null,messageClassName:o}),this._windowsIndexingMessageShown=r,t.setVisibility(this._windowsIndexingMessageWrapper,r),this.resetSuggestionsContainerHeight())},h.prototype.updateDialogBox=function(t){t.isVisible?this._host.setFocusInWebView("updateDialogBox"):this._host.setFocusInSearchBox(null,"updateDialogBox: hidden");this.renderReactView("dialogBox",n.View.WindowsDialogBox,{dataModel:t})},h.prototype.updateTopHitHeaderView=function(t){this.renderReactView("topHitHeader",n.View.TopHitHeader,{dataModel:t})},h.prototype.createFlyout=function(n,i,r,u){var f=this;return(r===void 0&&(r=null),u===void 0&&(u=null),!t.config.EnableEducationalFlyout)?null:(this._flyoutController||(this._flyoutController=new t.FlyoutController(this,i,r,u),this.host.bindQueryChangedOrInitialized(function(n){f._flyoutController.onQueryChange(n)})),this._flyoutController.createFlyout(n))},h.prototype.renderFlyoutAreaView=function(i){i.acknowledgeFlyoutText=this.host.getLocString("AcknowledgeFlyoutText");i.nextFlyoutText=this.host.getLocString("NextFlyoutText");i.stepCounterText=this.host.getLocString("FlyoutStepCounterFormat",i.currentStep.toString(),i.nbSteps.toString());i.dismissFlyoutText=this.host.getLocString("DismissFlyout");this._flyoutController.setQuery(this._host.getQuery());t.RuntimeConfig.QfMode===0||t.RuntimeConfig.QfMode===4?this._flyout.classList.add("flyoutSinglePane"):this._flyout.classList.remove("flyoutSinglePane");this.renderReactView("flyoutContainer",n.View.Flyout,{dataModel:i});this.showFlyoutAreaView()},h.prototype.showFlyoutAreaView=function(){t.setVisibility(this._flyout,!0);this._flyout.style.animation="none";this._flyout.offsetHeight;this._flyout.style.animation=null},h.prototype.hideFlyoutAreaView=function(){t.setVisibility(this._flyout,!1)},h.prototype.updateScopesHeaderView=function(t){this.renderReactView("scopesHeader",n.View.ScopesHeader,{dataModel:t})},h.prototype.updatePreviewErrorMessageView=function(t){t?this._previewContainer.classList.add("errorMessageContainer"):this._previewContainer.classList.remove("errorMessageContainer");this.renderReactView("previewContainer",n.View.PreviewErrorMessageContainer,{dataModel:t,icon:{content:"&#xF303",type:2}})},h.prototype.updatePreviewContainerView=function(t){t?this._previewContainer.classList.add("localPreviewContainer"):this._previewContainer.classList.remove("localPreviewContainer");this.renderReactView("previewContainer",n.View.WindowsPreviewContainer,{dataModel:t,expanderClickInstrumentation:this._expanderClickInstrumentation,chevronDownIcon:{content:"&#xE70D",type:2},cortanaInfoIcon:{content:"&#xE946",type:2}})},h.prototype.updateMsbPreviewContainerView=function(n){this._previewContainer.innerHTML="";var t=sj_ce("div","b_bfb");t.classList.add("fbig");this._previewContainer.appendChild(t);n.suggestion?this._previewContainer.classList.add("localPreviewContainer","msbPreviewContainer"):this._previewContainer.classList.remove("localPreviewContainer","msbPreviewContainer")},h.prototype.updateMenuView=function(t){this.renderReactView("menuContainer",n.View.WindowsMenu,{dataModel:t})},h.prototype.updateSnipSearchMessageView=function(t){this.renderReactView("messageContainer",n.View.SnipSearchMessage,{dataModel:t})},h.prototype.setProgressIndicatorVisibility=function(n){this._progressBarVisible!=n&&(this._progressBar||(this._progressBar=_ge("b_progress")),t.setVisibility(this._progressBar,n),this._progressBarVisible=n)},h.prototype.setPreviewPaneVisibility=function(n){this._previewPaneVisible!=n&&(n||this.closeSidePanel(1),t.setVisibility(this._previewPane,n),n&&this.openSidePanel(1),this._previewPaneVisible=n)},h.prototype.toggleDebugWindowVisibility=function(){return this.setDebugWindowVisibility(!this._debugWindowVisible),this._debugWindowVisible},h.prototype.setDebugWindowVisibility=function(n){t.setVisibility(this._debugWindow,n);t.RuntimeConfig.AlwaysWide?this.setConditionalCss("debugWindowOpen",n):n?this.openSidePanel(2):this.closeSidePanel(2);this._debugWindowVisible=n},h.prototype.applyAccentColor=function(){var i=this._host.getAccentColor(),o,e,f,t;this._lastAccentColor!=i&&(e="accent-style",f=_ge(e),f||(f=_d.createElement("style"),f.setAttribute("id",e),f.type="text/css",o=!0),t=".icon svg { fill: {0} }",t+=".gridLayout .suggestion.sa_hv, .gridLayout .suggestion.sa_hv:hover { border-color: {1}; }",t+=".toggleSwitch input:checked + label::before { background-color: {0}; border-color: {0}; }",n.isHighContrastEnabled()||(t+=".accentColor, .accentColor:visited { color: {0}; }",t+=".sa_hv, .sa_hv.selectable:active, .sa_hv.selectable:hover, .sa_hv .openPreviewPaneBtn:active, #root.zeroInput19H1 .selectable.sa_hv, #root.zeroInput19H1 .selectable.sa_hv:hover { background-color: {1}; }",t+=".sa_hv.suggestion:hover { background-color: {3}; }",t+=".darkThemeBeta .sa_hv.suggestion:hover { background-color: {4}; }",t+=".sa_hv.withOpenPreviewPaneBtn:not(.previewPaneOpened) .openPreviewPaneBtn:hover { background-color: {2}; }",t+=".sa_hv.withOpenPreviewPaneBtn:not(.previewPaneOpened) .suggDetailsContainer:hover { background-color: {2}; }",t+="#footer { background-color: {8}; }",t+="#footer:hover { background-color: {9}; }",t+="#footer:active { background-color: {10}; }",t+=".edgeUpsell .additionalCalloutText { color: {15} }",t+=".zeroInput19H1 .edgeUpsell .additionalCalloutText { background: {0} }",t+=".zeroInput19H1 .edgeUpsell .additionalCalloutText:hover, .edgeUpsell .additionalCalloutText:active { background: {12} }",t+=":not(.groupContainer).topHitConnectedToGroup:not(.sa_hv):not(.previewPaneOpened) { background: {2}; }",t+="#root:not(.wideByDefault) .selectedScope { background-color: {3}; }",t+="#root:not(.wideByDefault) .selectedScope:hover { background-color: {4}; }",t+="#root:not(.wideByDefault) .selectedScope:active { background-color: {5}; }",t+="#root.wideByDefault .selectedScope { border-color: {0}; }",t+="#startMenu .icon { background-color: {5}; }",t+=".accentButtonBackground { background-color: {6}; }",t+=".accentButtonBackground:focus { background-color: {1}; }",t+=".scopeOptions input[type='button'], .topOptions input[type='button'] { background-color: {12}; border-color: {12} }",t+=".scopeOptions input[type='button']:hover, .topOptions input[type='button']:hover { border-color: {3} }",t+=".expanderContainer.selectedExpander .expanderInnerCircle, .expanderContainer:hover .expanderInnerCircle { background-color: {1}; border-color: {11} }",t+="#previewContainer .expanderContainer.selectedExpander .divider, #previewContainer .expanderContainer:hover .divider { border-color: {1} }",t+=".zeroInput19H1 .secondaryText.selectable { color: {12} }",t+=".zeroInput19H1.darkTheme19H1 .secondaryText.selectable,.darkThemeBeta .accentColor, .darkThemeBeta .accentColor:visited, .zeroInput19H1.darkTheme19H1 .promoLink .icon { color: {13} }",t+=".santorini .selectable, .santorini .appsGroup .selectable { border-color: transparent }",t+=".santorini .sa_hv.selectable, .santorini .appsGroup .sa_hv.selectable  { border-color: {0} }",t+="circle.radial { stroke: {0} }",t+="#dialog_overlay.wsbModal input.colored { background-color: {12}; }",t+="#dialog_overlay.wsbModal input.colored:hover {background-color: {15}}",t+=".zeroInput19H1.darkTheme19H1 #dialog_overlay.wsbModal input.colored { background-color: {16}; }",t+=".zeroInput19H1.darkTheme19H1 #dialog_overlay.wsbModal input.colored:hover {background-color: {13}}",t+=".flyoutButton { background-color: {0}; }"),f.innerHTML=n.formatString(t,[i,r(i,.3),r(i,.1),r(i,.4),r(i,.6),r(i,.7),r(i,.15),s(i,35),u(i,.65),u(i,.8),u(i,.9),r(i,0),this._host.getAccentColor(1),this._host.getAccentColor(-2),r(i,.2),this._host.getAccentColor(2),this._host.getAccentColor(-1),]),o&&_d.head.appendChild(f),this._lastAccentColor=i)},h}(n.BasePage);t.Page=f})(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t=54e5,i=function(){function i(i,r){var u=this;this._host=i;this._appCacheInstrumentationHelper=r;this._isReloadSuppressed=!1;this._pendingReload=!1;r.registerSuperFresh();i.hasFallbackHappened()&&(this._isReloadSuppressed=!0,this._lastReloadAfterFallback=n.getCurrentTime());i.bindAppHidden(function(){(u._isReloadSuppressed=u._lastReloadAfterFallback&&n.getCurrentTime()-u._lastReloadAfterFallback<t,u._isReloadSuppressed)||(!u._pendingReload&&n.config.reloadAfterConversations&&i.getPaneCloseCount()>=n.config.reloadAfterConversations&&(u._pendingReload=!0),u._pendingReload&&(u.logReloadAttempt(),u.reload()))});sj_be(applicationCache,"updateready",function(){return u.onUpdateReady()});i.bindConversationStart(function(){u._isReloadSuppressed=!0;u.shouldCheckForUpdate()&&n.contains([1,4,5],applicationCache.status)&&n.safeExecute(function(){return applicationCache.update()},"probe for manifest update")})}return i.prototype.shouldCheckForUpdate=function(){if(!n.isBingEnabled())return!1;return n.config.th&&ClientTestHooks.isTesthookParamSet("disableAppCache")?!1:!0},i.prototype.onUpdateReady=function(){this.logReloadAttempt();this._isReloadSuppressed?this._pendingReload=!0:this.reload()},i.prototype.reload=function(){this._host.reloadWebView()},i.prototype.logReloadAttempt=function(){this._appCacheInstrumentationHelper.instrumentSuperFreshUpdate(this._isReloadSuppressed)},i}();n.SuperFreshAppCache=i}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var i,r;(function(t){function u(t,i,r,u,f,e,o,s){var c,l=function(n){c&&f.unregister(c);o&&o==n.number||SharedLogHelper.LogError(t,e,s||n);u&&u(n)},h,a;try{h=i();h?(f&&h.cancel&&(c=f.register(function(){return h.cancel()},!1,t+" cancellation")),a=function(i){c&&f.unregister(c);r&&n.safeExecute(function(){return r(i)},t+" completion")},h.done?h.done(a,l):h.then(a,l)):l(new Error("No promise returned"))}catch(v){l(v)}}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){return function(a,v){var p=e(a),y=i[p],w;y||(y={started:!1,completed:!1,result:null,pendingCallbacks:[]},i[p]=y);y.completed?v(y.result):(y.pendingCallbacks.push(v),y.started||(y.started=!0,w=function(){t.safeChain(u,function(){return f(a)},function(n){h&&!h(n)&&delete i[p];r(p,y,o?o(n):n,u)},function(t){n.isCancellation(t)?r(p,y,null,u):l?(l-=1,w()):r(p,y,s,u)},null,c)},w()))}}t.safeChain=u;var i={};t.clearGlobalCache=f;t.clearPendingItemsFromCache=e;t.safeChainWithGlobalCaching=o})(i=t.Promise||(t.Promise={})),function(n){function t(n,t,i){for(var u,f,e={},r=0,o=n;r<o.length;r++)u=o[r],f=t[u],f&&(e[u]=i(f));return e}function i(n){for(var t in n)if(n[t])return!1;return!0}n.map=t;n.isEmpty=i}(r=t.Map||(t.Map={}))})(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var r="show",i=10,u=function(){function u(i,r,u,f,e){var o=this;this._host=i;this._page=r;this._instHelper=u;this._showIcons=f;this.adjustHeight=e;this._root=_ge("root");this._menuStack=[];this._menuContainer=_ge("menuContainer");this._itemClickHandler=function(t,i){i.button==0&&t.click&&t.click(n.getCurrentTime(),n.getInputType(i))};this._itemEnterHandler=function(t){t.isSelectable&&!t.isExpanded&&(t.subItems&&(o._hoverTimer&&sb_ct(o._hoverTimer),o._hoverTimer=n.safeSetTimeout(function(){o._hoverTimer=0;var n=_ge(t.id);t&&!t.isExpanded&&n&&n.matches(":hover")&&o.showSubMenu(t)},500,"menu item mouse enter")),o.stickParent(t))};this._itemLeaveHandler=function(t){t.isExpanded&&!t.isSticky&&n.safeSetTimeout(function(){var n=_ge(t.id);t&&!t.isSticky&&n&&!n.matches(":hover")&&(t.subItems.some(function(n){return n==o._selectedItem})&&o.select(null,!1),o.dismissSubMenu(t))},450,"menu item mouse leave")};sj_be(_d.body,"mouseup",function(n){o._menuContainer.contains(n.target)||o.dismiss()});t.config.th||sj_be(_w,"blur",function(){return o.dismiss()});sj_evt.bind("ajax.threshold.pageStart",function(){return o.dismiss()});i.bindKeyEscape(function(n){o.isMenuVisible()&&(n.handled=!0,o._menuStack.length>0?o.reselectParentItem():o.dismiss(!0))})}return u.prototype.showSubMenu=function(n){if(!n.isExpanded){this._selectedItem&&this.select(null,!1);var i=_ge(n.id),r=i.querySelector(".contextMenu");n.isExpanded=!0;t.setVisibility(r,!0);this.adjustSubMenuPosition(i,r);this._menuStack.push(n);this._page.updateMenuView(this.getDataModel())}},u.prototype.dismissSubMenu=function(n){var u,f,i,e,r;if(this._selectedItem&&this.select(null,!1),n){if(i=this._menuStack.indexOf(n),i<0)return;for(e=this._menuStack.slice(i),r=0;r<e.length;++r)this.dismissSubMenu()}else n=this._menuStack.pop(),u=_ge(n.id),f=u.querySelector(".contextMenu"),n.isExpanded=!1,n.isSticky=!1,t.setVisibility(f,!1);this._page.updateMenuView(this.getDataModel())},u.prototype.showMenu=function(i,u){var f=this,o,c,e,s,l,h;if(this._menuItems.length){for(t.setVisibility(this._menuContainer,!0),o=this.getDataModel(),this._page.updateMenuView(o),c=function(n){n.getIcon&&n.getIcon(1,function(t){n.icon=t;f._page.updateMenuView(f.getDataModel())})},e=0,s=this._menuItems;e<s.length;e++)l=s[e],c(l);h="renderContextMenu";n.safeSetTimeout(function(){f.adjustPosition(i,u,o.menuType!=0);f._menuContainer.classList.add(r);var n=_qs("#menuContainer > .contextMenu");n.focus();n.scrollTop=0;f._host.setFocusInWebView(h)},0,h)}},u.prototype.innerShowContextMenu=function(n,t,i,r,u){this.dismiss();var f=this.getContextMenuItems(n,r);f&&f.length>0&&(this._menuItems=f,this._onDismiss=u,this._menuType=0,t-=this._root.offsetLeft,i-=this._root.offsetTop,this.showMenu(t,i))},u.prototype.showDropdownMenu=function(n,i,r,u){if(this.dismiss(),this._parentElement=i,n&&n.length>0){this._menuItems=n;this._onDismiss=u;this._menuType=r;var f=i.offsetLeft,e=i.offsetTop+i.offsetHeight+1;t.isRtl()&&(f+=i.offsetWidth);this.showMenu(f,e)}},u.prototype.showContextMenuOnElement=function(n,t,i,r){var u=t.getBoundingClientRect(),f=u.left+t.offsetWidth/2,e=u.top+this._page.getScrollTop()+t.offsetHeight/2;this.showContextMenuOnXY(n,f,e,i,r)},u.prototype.showContextMenuOnXY=function(i,r,u,f,e){var o=this,s,h;this._parentElement=null;e&&(s=i.childSuggestions.filter(function(n){return n.text===e.text}),s&&s.length&&(i=s[0]));h=t.getVerbsAsync("showContextMenu",i,t.config.rawVerbs,!1,function(e){return n.safeSetTimeout(function(){return o.innerShowContextMenu(t.extendVerbs(e,i,o._page,o._host),r,u,function(n,t,r,u){o._instHelper.instrumentItemClickForContextMenu(t,i.instItem,i.sequenceNumber,i.instrumentPingBack,r,u,n)},f)},0,"showContextMenu handler")},function(){return!0});e||h||(this._page.hideTemporaryMessage(),this._host.setFocusInSearchBox(null,"noContextMenu"))},u.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})):[]},u.prototype.getSelectableItemsByGroup=function(){return[]},u.prototype.getSelectedItem=function(){return this._selectedItem},u.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()}},u.prototype.getExpandIcon=function(){return{content:t.isRtl()?"&#xE76B":"&#xE76C",type:2}},u.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())},u.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<r.length;t++)i=r[t],i.isSticky&&(i.isSticky=!1,this._itemLeaveHandler(i,null))},u.prototype.isItemInMenuOrMenuGroup=function(n,t){return t.some(function(t){return t==n||t.groupItems&&t.groupItems.indexOf(n)>=0})},u.prototype.getParent=function(n){for(var r,t=0,i=this._menuStack;t<i.length;t++)if(r=i[t],this.isItemInMenuOrMenuGroup(n,r.subItems))return r;if(this.isItemInMenuOrMenuGroup(n,this._menuItems))return null;throw new Error("Item: '"+n.id+"' was not found");},u.prototype.getSiblings=function(n,t){t===void 0&&(t=!1);var i=this.getParent(n),r=i?i.subItems:this._menuItems;return r.map(function(n){return n.groupItems?n.groupItems:[n]}).reduce(function(n,t){return n.push.apply(n,t),n},[]).filter(function(i){return i.isSelectable&&(t||i!=n)})},u.prototype.selectSubItem=function(n,t){this.showSubMenu(n);this.select(t,!1)},u.prototype.reselectParentItem=function(){var n=this._menuStack[this._menuStack.length-1];this.dismissSubMenu();this.select(n,!1)},u.prototype.onAfterKeyDown=function(i,r,u,f){var e,s,o;if((u||f)&&!n.isUpOrDownKey(i))return!1;if(i=t.getRtlAdjustedKey(i),i==39||i==13){if(e=this._selectedItem,e&&e.subItems&&e.subItems[0]&&(s=e.subItems.filter(function(n){return n.isSelectable})[0],s))return this.selectSubItem(e,s),!0}else if(i==37){if(this._menuStack.length>0)return this.reselectParentItem(),!0}else if(n.isUpOrDownKey(i)&&this._selectedItem)return o=this._menuStack.length==0?_qs(".contextMenu"):_ge(this._menuStack[this._menuStack.length-1].id).querySelector(".contextMenu"),o&&this._page.scrollToElement(_ge(this._selectedItem.id),o,o.offsetHeight),!0;return i==13},u.prototype.isMenuVisible=function(){return!!this._menuItems},u.prototype.dismiss=function(n){if(this._menuItems&&(this._menuItems=null,this._selectedItem&&(this._selectedItem.selected=!1,this._selectedItem=null),this._page.updateMenuView(this.getDataModel()),this._menuContainer.classList.remove(r),this._menuContainer.style.width=null,t.setVisibility(this._menuContainer,!1),t.RuntimeConfig.PanelCanResize&&(this._root.style.minHeight="",this.adjustHeight()),this._menuStack=[]),n&&this._parentElement&&this._parentElement.focus(),this._parentElement=null,this._onDismiss){var i=this._onDismiss;this._onDismiss=null;i()}},u.prototype.adjustSubMenuPosition=function(n,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=t.isRtl(),v=6;for(h=0,y=this._menuStack;h<y.length;h++)d=y[h],o=_ge(d.id).querySelector(".contextMenu"),v=+o.style.zIndex,l+=o.offsetLeft,k+=o.scrollTop,a=o.offsetLeft<0;++v;var u=f.offsetLeft+l+n.offsetLeft,c=f.offsetTop+n.offsetTop-k-b,g=this._root.offsetWidth-(u+p),nt=u,tt=s<g,it=s<nt;(a||!tt)&&it?u-=s:a&&it||!tt?u=nt>g?i:this._root.offsetWidth-s-i: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()}},u.prototype.adjustPosition=function(n,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=n;s=r;t.isRtl()?(e-=f,e<0&&(e=u?i:n)):e+f>this._root.offsetWidth&&(e=u?this._root.offsetWidth-f-i:Math.max(n-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";t.RuntimeConfig.PanelCanResize&&(this._root.style.minHeight=s+h+"px",this.adjustHeight())}},u.prototype.getContextMenuItems=function(i,r){var u=this;return i.map(function(i){var f={id:encodeURIComponent(i.verb),text:i.displayName,isSeparator:!i.verb,selected:!1,isDefault:i.isDefault,icon:i.icon,getIcon:i.getIcon,click:undefined,title:undefined,cssClass:undefined,isSelectable:!!i.verb};return f.isSeparator||(f.click=function(f,e){r(i.verb,f,e,null);i.executeSync?(n.safeExecute(function(){return i.executeSync()},"verb.executeSync",null,i.verb),u.dismiss()):t.Promise.safeChain("verb.executeAsync",function(){return i.executeAsync()},function(){return u.dismiss()},null,null,i.verb)}),f})},u}();t.MenuFactory=u})(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t="ConnectedAccounts",i=function(){function i(t){this._storage=t;this._accountsCache={};n.config.th&&ClientTestHooks.isTesthookParamSet("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 f,u,e,o;return i===undefined?!1:n.config.th&&(f=ClientTestHooks.isTesthookParamSet("forceTokenRefresh"),f)?!0:(u=n.getCurrentTime(),r&&u>r)?!0:(e=6e4,o=Math.floor((u-t)/e),o>=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}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var i=SearchAppWrapper.CortanaApp,r="SelectedAuthAccountId",u=60,f=function(){function f(n,t){var r=this;this._storage=n;this._tokenStore=t;this._pendingCallbacks={};this._availableMsaAccounts=[];this._availableAadAccounts=[];this._accessTokenAvailableHandlers=[];this._verifyAccountRequired=[];this._accountTypeChangedHandlers=[];this._selectedAccountChangedHandlers=[];i.addEventListener("experiencelaunched",function(){i.experienceId=="NotebookOffline"&&r._tokenStore.clear()})}return f.prototype.authTypeMatchesWindowsAccountType=function(n){return t.windowsAccountType==4||(n==0?t.windowsAccountType==2:t.windowsAccountType==1)},f.prototype.setWindowsAccountType=function(n,i){var r=t.windowsAccountType;t.windowsAccountType=n;i&&t.windowsAccountType!=r&&this.fireAccountTypeChanged()},f.prototype.clearCachedAccountInfo=function(){this._cachedAAD=null;this._cachedMSA=null},f.prototype.getAllSyncingAccounts=function(n,t,r,u,f){var l=i.fileExplorerSuggestionPage.registeredSyncRootInfo,s=[],a,o,h,c,e;for(a in l)e=l[a],typeof e=="string"&&e.includes("@")&&s.push(e);for(s.length==0&&f([]),o={responses:0,accounts:[]},h=0,c=s;h<c.length;h++)e=c[h],this.getAccountByUserName(n,t,e,r,u,function(n){++o.responses;n&&n.Token&&o.accounts.push(n);o.responses==s.length&&f(o.accounts)})},f.prototype.getAllAvailableAccounts=function(n){return n==0?this._availableMsaAccounts.slice(0):this._availableAadAccounts.slice(0)},f.prototype.getCachedAccountInfo=function(n){if(!this.authTypeMatchesWindowsAccountType(n))return null;switch(n){case 1:return this._cachedAAD;case 0:return this._cachedMSA;default:return null}},f.prototype.getSelectedAccountInfo=function(){if(t.windowsAccountType==2&&this._cachedMSA)return this._cachedMSA;if(t.windowsAccountType==1&&this._cachedAAD)return this._cachedAAD;var u=this._storage.getItem(r),n,i=this._availableAadAccounts.concat(this._availableMsaAccounts);return i.length>0&&(u&&(n=i.filter(function(n){return n.accountId==u})[0]),n||(n=i.filter(function(n){return n.isDefaultAccount})[0]),n||(n=i[0]),n&&this.setSelectedAccount(n)),n},f.prototype.setSelectedAccount=function(n){if(this.cacheAccount(n),t.windowsAccountType!=4){var i=n.accountProviderAuthority=="consumers"?2:1;this.setWindowsAccountType(i,!0)}this._storage.setItem(r,n.accountId);this.fireSelectedAccountChangedHandlers(n)},f.prototype.isMsaAvailable=function(){return this._availableMsaAccounts.length>0},f.prototype.isAadAvailable=function(){return this._availableAadAccounts.length>0},f.prototype.cacheAccount=function(n){n.accountProviderAuthority=="consumers"?this._cachedMSA=n:this._cachedAAD=n},f.prototype.cacheAllAccounts=function(n){var t,r,i;for(this._availableMsaAccounts=[],this._availableAadAccounts=[],t=0,r=n;t<r.length;t++)i=r[t],i.accountProviderAuthority=="consumers"?this._availableMsaAccounts.push(i):this._availableAadAccounts.push(i)},f.prototype.getAccountByUserName=function(n,i,r,u,f,e){var o,s=i==0?this._availableMsaAccounts:this._availableAadAccounts,h;s.length>0&&(o=s.find(function(n){return n.accountUserName.toLocaleLowerCase()==r.toLocaleLowerCase()}));o?(h=n?t.getSubstrateResourceOrScope(i):t.getBingResourceOrScope(i),this.getAccount(i,h,u,f,e,o)):e(null)},f.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)},f.prototype.authenticate=function(r,f,e,o,s,h){var a=this,v=r+"."+f+(h?"|"+h.accountId:""),c,l,p,w;if(o){var b=e?0:u,k=t.config.th&&ClientTestHooks.isTesthookParamSet("noAuthCache"),y=k?null:this._tokenStore.findAccount(v,b);if(y){s(y);return}}c=function(){return s(null)};n.isBrowserOnline()?(l=i.authenticationManager.createAuthenticateRequest(),l.accountType="Windows",l.silentMode=o,r==1?l.resource=f:l.scope=f,p=h&&i.authenticationManager.authenticateSearchWebAccountAsync,w=p?function(){return i.authenticationManager.authenticateSearchWebAccountAsync(l,h)}:function(){return i.authenticationManager.authenticateAsync(l)},t.Promise.safeChain("authenticateAsyncWAM",w,function(i){var u,e,l,y;if(t.config.th)if(o){if(ClientTestHooks.isTesthookParamSet("ssoAuthFail")){c();return}}else if(ClientTestHooks.isTesthookParamSet("uxAuthFail")){c();return}if(!i){n.log("WAM returned null");c();return}if(t.RuntimeConfig.QfMode==8&&(r==1||f=="service::cortana.bing.com::mbi_ssl")&&o&&i.status==3){n.log("WAM indicates UserInteractionRequired");a.authenticate(r,f,!0,!1,s,h);return}if(i.token){if(u=i.properties,e=u.UPN||i.userName,!e){n.log("WAM didn't return UPN");c();return}l=void 0;r==0?l="MSA:"+e:u.OID&&u.tid&&(l="OID:"+u.OID+"@"+u.tid);y={Token:i.token,ExpireDateTime:u.exp?parseInt(u.exp)*1e3-3e5:null,TenantName:u.tenant_display_name||"",RoutingHint:l||e,UserName:e};r==0&&(y.ExpireDateTime=n.getCurrentTime()+36e5);a._tokenStore.setToken(y,v);s(a._tokenStore.findAccount(v))}else i.errorCode||i.errorMessage?n.log("WAM error "+i.errorCode+": "+i.errorMessage):n.log("WAM returned an empty token"),c()},c)):c()},f.prototype.bindAccessTokenAvailable=function(n){this._accessTokenAvailableHandlers.push(n)},f.prototype.bindVerifyAccountRequired=function(n){this._verifyAccountRequired.push(n)},f.prototype.bindAccountTypesChanged=function(n){this._accountTypeChangedHandlers.push(n)},f.prototype.bindSelectedAccountChanged=function(n){this._selectedAccountChangedHandlers.push(n)},f.prototype.fireAccountTypeChanged=function(){this._accountTypeChangedHandlers.forEach(function(n){return n()})},f.prototype.fireSelectedAccountChangedHandlers=function(n){this._selectedAccountChangedHandlers.forEach(function(t){return t(n)})},f.prototype.tryConnect=function(i,r){var f=this,e=i==1?t.isSubstrateO365AccountConnected:t.isSubstrateOutlookAccountConnected,u;e||(u=t.getSubstrateResourceOrScope(i),this.getAccount(i,u,!1,!0,function(r){var e=!!r;i==1?t.isSubstrateO365AccountConnected=e:t.isSubstrateOutlookAccountConnected=e;e?f._accessTokenAvailableHandlers.forEach(function(t){return n.safeExecute(function(){return t(i,u)},"accessTokenAvailable",null,""+i)}):f._verifyAccountRequired.forEach(function(t){return n.safeExecute(function(){return t(i,u)},"accessTokenAvailable",null,""+i)})},r))},f.prototype.updateWindowsAccountType=function(n){for(var o,i,s,r=!1,u=!1,f=0,e=n;f<e.length;f++)o=e[f],o.accountProviderAuthority=="consumers"?r=t.isCloudSearchEnabledMsaCache:u=t.isCloudSearchEnabledAadCache;i=3;t.config.userProfileButtonEnabled?(s=this.getSelectedAccountInfo(),i=s.accountProviderAuthority=="consumers"?2:1):r&&u?i=4:u?i=1:r&&(i=2);this.setWindowsAccountType(i,!0)},f.prototype.connectAccounts=function(n,i){var u,f,r;for(t.isSubstrateO365AccountConnected=!1,t.isSubstrateOutlookAccountConnected=!1,u=0,f=n;u<f.length;u++)r=f[u],r.accountProviderAuthority=="consumers"&&t.isCloudSearchEnabledMsaCache?this.tryConnect(0,r,i):r.accountProviderAuthority=="organizations"&&t.isCloudSearchEnabledAadCache&&this.tryConnect(1,r,i)},f.prototype.enumerateAccountAuthority=function(n,r){var u=this;t.Promise.safeChain("enumerateAccountAuthorityAsync",function(){return i.authenticationManager.enumerateAccountAuthorityAsync()},function(i){var f,e;if(t.windowsAccountType==0){f=3;switch(i.Windows){case"consumers":f=2;break;case"organizations":f=1}u.setWindowsAccountType(f,!0);t.windowsAccountType!=3&&(e=t.accountTypeToAuthType(t.windowsAccountType),u.getAccount(e,t.getBingResourceOrScope(e),!1,!0,function(n){return t.windowsIdentity=n&&n.UserName?n.UserName:""}))}t.isCloudSearchEnabledCache&&t.substrateProvidersEnabled()&&(t.windowsAccountType==1?u.tryConnect(1,null,n):t.windowsAccountType==2&&u.tryConnect(0,null,n));r()})},f.prototype.enumerateMultiAccountAuthority=function(n,r){var u=this;if(!i.authenticationManager.getAllSearchWebAccountsAsync){this.enumerateAccountAuthority(n,r);return}this.clearCachedAccountInfo();this.setWindowsAccountType(3,!1);t.Promise.safeChain("getAllSearchWebAccountsAsync",function(){return i.authenticationManager.getAllSearchWebAccountsAsync()},function(i){var f,o,s,c,v,l,h,a,e;if(u.cacheAllAccounts(i),f=[],u._availableMsaAccounts.length>0&&(o=Math.max(u._availableMsaAccounts.findIndex(function(n){return n.isDefaultAccount}),0),f.push(u._availableMsaAccounts[o])),u._availableAadAccounts.length>0&&(o=Math.max(u._availableAadAccounts.findIndex(function(n){return n.isDefaultAccount}),0),f.push(u._availableAadAccounts[o])),!t.config.userProfileButtonEnabled)for(s=0,c=f;s<c.length;s++)e=c[s],u.cacheAccount(e);if(v=t.windowsAccountType,u.updateWindowsAccountType(f),t.windowsAccountType!=v)for(l=function(n,i){u.getAccount(n,t.getBingResourceOrScope(n),!1,!0,function(n){return t.windowsIdentity=n&&n.UserName?n.UserName:""},i)},h=0,a=f;h<a.length;h++)e=a[h],e.accountProviderAuthority=="consumers"&&t.isCloudSearchEnabledMsaCache?l(0,e):e.accountProviderAuthority=="organizations"&&t.isCloudSearchEnabledAadCache&&l(1,e);t.isCloudSearchEnabledCache&&t.substrateProvidersEnabled()&&u.connectAccounts(f,n);r()})},f.prototype.promptAutheticateDialog=function(i,r,u,f){var e=this,o=function(o){var s=!!o;i==1?t.isSubstrateO365AccountConnected=s:t.isSubstrateOutlookAccountConnected=s;s?(u(),e._accessTokenAvailableHandlers.forEach(function(t){return n.safeExecute(function(){return t(i,r)},"promptAccessTokenAvailable",null,""+i)})):(f(),e._verifyAccountRequired.forEach(function(t){return n.safeExecute(function(){return t(i,r)},"promptAccessTokenAvailable",null,""+i)}))};this.getAccount(i,r,!1,!1,o)},f}();t.AccessTokenManager=f})(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var i;(function(i){function y(t){t.bindAppHidden(function(){SearchAppWrapper.CortanaApp.isBingEnabled&&n.isBrowserOnline()&&n.safeExecute(function(){return ft("asgw",["fp.msedge.net/conf/v1/asgw/fpconfig.min.json"],2e3)},"AFDFootprint.start",null,null)})}function ft(n,t,i){var o;if(n&&n.trim().length!==0&&Number(i)===i&&i%1==0&&!(i<0)){var r=c,h=ut,y=v(),p=e(),s="MonitorID="+n+"&rid="+p+"&w3c="+y+"&prot="+window.location.protocol+"&v="+h+"&DATA=";if(u)a(r,s,i);else{for(o in t)t[o]=r+t[o];f(t,0,l,r,s,i)}}}function a(n,t,i){var o=et(u,n),s,f,r,e,h;if(o.length!==0){for(s=ot(o,n,b),f=[],r=0,e=u.r;r<e.length;r++)h=e[r],f.push(n+h+"?"+t);ct(s,d,i,f)}}function f(n,i,r,e,o,s){var l=r!==rt?0:1,h=n[i],v=SearchAppWrapper.CortanaApp.createStringMap(),c=SearchAppWrapper.CortanaApp.createStringMap();c["Content-Type"]="application/json";t.Promise.safeChain("fetchAFDUrl",function(){return SearchAppWrapper.CortanaApp.makeHttpRequestAsync(l,h,v,"",c)},function(c){c.statusCode===200&&e!=null&&o!=null&&s!=null&&t.Promise.safeChain("readAFDResponse",function(){return c.readAsStringAsync()},function(n){u=JSON.parse(n);a(e,o,s)},function(){++i<n.length&&f(n,i,r,e,o,s)},null,h)},function(){++i<n.length&&f(n,i,r,e,o,s)},null,h,null,"makeHttpRequestAsync failed")}function et(n,t){var e=[],l,a,i,v,y,u,s,b;if(!n||!n.e)return e;var k=t.toLowerCase()===w?h:o,d=n.e,f=[],c=0;for(l=0,a=d;l<a.length;l++)i=a[l],i.w>0&&(o<=i.m&&i.m<=p&&i.m&k||i.m===r)&&(c+=i.w,f.push({endpoint:i.e,cumWeight:c,weight:i.w,measurementType:i.m}));for(v=Math.min(n.n,f.length);e.length<v;){y=Math.floor(Math.random()*c);u=null;for(s in f)u==null?y<f[s].cumWeight&&(u=f[s],delete f[s]):f[s].cumWeight-=u.weight;c-=u.weight;b=u.measurementType&r?nt:g;e.push({id:u.endpoint,testImage:b,measurementType:u.measurementType})}return e.sort(function(n,t){return n.measurementType-t.measurementType}),e}function ot(n,t,i){for(var f,p,d,a=[],v=0,w=n;v<w.length;v++){var y=w[v],l=y.measurementType,b=y.testImage,u=y.id,s=t+u;u.indexOf(".")===-1?s+=".clo.footprintdns.com":u.charAt(0)==="*"&&(f=u.substring(2),p=e(),s=t+p+"."+f,u=f==="clo.footprintdns.com"||f==="nrb.footprintdns.com"||f==="azr.footprintdns.com"?p:f);s+=k;var g=s+i+"?"+e(),nt=l===r?t===c?o:h:l,tt=l!==r;a.push({url:g,requestID:u,object:i,conn:"cold",measurementType:nt,report:tt});d=s+b+"?"+e();a.push({url:d,requestID:u,object:b,conn:"warm",measurementType:l,report:!0})}return a}function st(n,t){for(var r=[],i=0;i<t.length;i++)if(t[i].report){var f=n[i],u=t[i].measurementType,e=ht(f,u);r.push({RequestID:t[i].requestID,Object:t[i].object,Conn:t[i].conn,Result:e,T:u})}return JSON.stringify(r)}function ht(n,t){if(n===s)return n;if(t===r&&n>0){var i=tt/(n/it);return Math.round(i)}return Math.round(n)}function e(){function n(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return n()+n()+n()+n()+n()+n()+n()+n()}function v(){return window.performance&&window.performance.getEntriesByName?!0:!1}function ct(n,t,i,r){function c(i){var k,p,g,w,nt,d,b,tt;if(u!=null&&clearTimeout(u),o[i]=h!=null?(new Date).getTime()-h:s,i=(a+y)%n.length,e=new Image,a++<n.length)h=(new Date).getTime(),e.onload=function(){c(i)},k=function(){e.onload=null;e.onerror=null;h=null;c(i)},u=setTimeout(function(){k()},t),e.onerror=function(){u!=null&&clearTimeout(u);u=null;k()},e.src=n[i].url;else if(r!=null&&r.length!==0){if(v())for(p=0;p<n.length;p++)g=n[p].url,w=window.performance.getEntriesByName(g),o[p]!==s&&w&&w[0]&&(o[p]=w[0].duration);for(nt=st(o,n),d=[],b=0;b<r.length;b++)tt=r[b]+nt,d.push(tt);f(d,0,l,null,null,null)}}var h=null,u=null,o=[],a=0,e,y=0;setTimeout(function(){c(0)},i)}i.init=y;var u,o=1,h=2,p=3,r=8,w="http://",c="https://",b="trans.gif",k="/apc/",d=5e3,g="trans.gif",nt="100k.gif",tt=822.128,it=1e3,l="GET",rt="POST",s=-1,ut="20180228"})(i=t.AFDFootprint||(t.AFDFootprint={}))})(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={}));1