var __extends,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.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"}(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=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&&u2&&n.SecondLevelDomains[u[u.length-2]]?u.splice(0,u.length-2):u.splice(0,u.length-1),o=u.join("."),f=HitHighlightingParser.addMarkers(o,t)),e=f.indexOf(HitHighlightingParser.startMarker),e==-1)?0:t.includes(".")?(t.endsWith("/")&&(t=t.substr(0,t.length-1)),r.hostname.includes(t)?t.length:0):(s=f.indexOf(HitHighlightingParser.endMarker),s-e-1)}function 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)}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}(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){this._kValue=n;this._handOffType=t}return n.createInstrumentedItem=function(t){return new n(n.generateKValue(t))},n.getNonSuggestionInstrumentedItem=function(t,i,r){return new n(i[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.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 lt(){return matchMedia("screen and (-ms-high-contrast)").matches}function at(){return navigator.onLine}function vt(n){return!n.isAnswer&&(n.handoffType==0||n.handoffType==11)}function c(n){return n?n.replace(ut,"$1").replace(ft,"$1 "):n}function yt(n){return n?n.replace(/[-{}]/g,"").toLowerCase():null}function pt(n){return!n||Object.keys(n).length===0}function l(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 wt(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;t0&&!t(n.config.bingEnabledRegionsList,i.toLowerCase())}function bt(t,i){var r=t.queryToFetch&&t.queryToFetch.lengtht&&r>=0;--r)i(n[r])&&n.splice(r,1)}function ti(n,i){return n.filter(function(n){return!t(i,n)})}function ii(n,t){if(n.length!=t.length)return!1;for(var i=0;i=0?"+":"-";return t.getFullYear()+"-"+r(t.getMonth()+1)+"-"+r(t.getDate())+"T"+r(t.getHours())+":"+r(t.getMinutes())+":"+r(t.getSeconds())+"."+r(t.getMilliseconds())+u+r(i/60)+":"+r(i%60)}function fi(n,t){return n?n.replace(et,function(n,i){return t[i]}):n}function ei(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(),i}}function oi(n){for(var i=[],t=1;t14}function nr(n){return n==="i"?13:n==="v"?14:0}function tr(n){return encodeURIComponent(n).replace(/[!'()*]/g,escape).replace(/%20/g,"+")}var f=String.fromCharCode(57346),ut=new RegExp("^\\s*("+f+")?\\s*"),ft=new RegExp("\\s*("+f+")?\\s+","g"),et=/{([0-9]+)}/g,ot=" -_/\\",st=-2147215328,ht=-2147023673,ct=864e5,i,e,h,tt,it,rt;n.DebugSourceName="AutoSuggest";SharedLogHelper.RegisterErrorFilter(function(n){var t=n?n.number:null,i=n?n.name:null;return t===ht||t===st||i==="Canceled"});n.isHighContrastEnabled=lt;n.isBrowserOnline=at;n.isWebSuggestion=vt;n.cleanQuery=c;n.cleanGuid=yt;n.isEmpty=pt;n.mantainCursorPositionIn=l;n.getInputType=wt;n.disableDataSources=o;n.disableWebDataSourceIfNeeded=bt;n.isMultiWord=v;n.parseQuery=kt;n.isDataSourceEnabled=y;n.isSuggestionTypeEnabled=p;n.contains=t;n.tryRemove=dt;n.removeFirstWhere=gt;n.trimList=ni;n.except=ti;n.sequenceEqual=ii;n.objEquals=ri;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=w;n.getDateWithTimezone=ui;n.fetchWrapper=function(n,t,i){return i()};n.formatString=fi;n.isCancellation=ei;n.safeExecute=u;n.safeFireEvent=oi;n.ensureCallbackIsAsync=s;n.WebDataSource="Web";n.WebRankingSignalDataSource="WRS";n.MRUDataSource="MRU";e=!0;n.refreshBingEnabledCache=si;n.isBingEnabled=hi;var b=[38,203,211,],k=[40,204,212,],d=b.concat(k),ci=d.concat(37,39,36,35);n.isUpOrDownKey=li;n.isUpKey=ai;n.isDownKey=vi;n.isMovingCursorKey=yi;n.isContextMenuKey=pi;n.isDeletionKey=wi;n.getWindowProtocol=bi;n.getWindowHost=ki;n.getCurrentActiveElement=di;n.WindowsApiDefaultDate=-116444736e5;n.isValidDate=g;n.getTimeDiffInDays=nt;n.olderThan2Weeks=gi;n.verticalToHandoffType=nr;h=function(){function n(){this._cancellations={};this._lastId=0}return n.prototype.register=function(n,t,i){var r=++this._lastId;return this._cancellations[r]={action:n,skipOnDismissAndLaunch:t,where:i},r},n.prototype.unregister=function(n){delete this._cancellations[n]},n.prototype.cancelAll=function(n){var t=function(t){var r=i._cancellations[t];r.skipOnDismissAndLaunch&&n||u(function(){return r.action()},r.where)},i=this;for(var r in this._cancellations)t(r);this._cancellations={}},n}();n.CancellationManager=h;tt=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=tt;it=function(){function n(){this._sequenceNumber=0}return n.prototype.getSequenceNumber=function(){return this._sequenceNumber},n.prototype.incrementSequenceNumber=function(){this._sequenceNumber++},n}();n.SequenceNumberManager=it;rt=function(){function t(t,i,r,u,f,e,o,s){var c=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 h);t.bindShown(function(){c._lastQuery=null;c._currentQuery=null;c._isPaneDismissed=!1});t.bindDismissed(function(){c.clearFetchTimer();c.finishPreviousQuery(!0);c.finalizeKeystroke(!0);c._isPaneDismissed=!0});t.bindQueryChangedOrInitialized(function(t,i){return c.onQueryChanged(t,n.config.d,i)});t.bindOnSubmit(function(n,t,i){return c.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,f;this.clearFetchTimer();this._currentQuery=n;this._lastQuery&&(!this._lastQuery.equals(this._currentQuery)||i)&&this.cancelPreviousQuery(!1);t<=0?this.fetchForQueryChange(0,!1,i):(f=Date.now(),this._fetchTimer=sb_st(function(){r._fetchTimer=null;u(function(){return r.fetchForQueryChange(Date.now()-f,!1,i)},"fetchTimer")},t))},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,h;if(this.clearFetchTimer(),this._lastQuery&&this._lastQuery.equals(this._currentQuery)&&!r)this._rootViewModel.onQueryChanged(this._currentQuery,this._sequenceNumberManager.getSequenceNumber());else if(e=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),h=!n.config.enabledDataSources.some(function(n){return y(n,u._currentQuery)}),h)this._rootViewModel.onQueryChanged(this._currentQuery,f);if(this._suggestionsRenderingManager.initiateSequenceNumber(f,this._currentQuery),!h){var o=function(){return!u._isPaneDismissed&&(n.config.d>0?e.equals(u._currentQuery):f==u._sequenceNumberManager.getSequenceNumber())},c=function(n,t,i,r,s){return u.onResponseReceived(e,f,n,t,i,o,r,s)},l=function(t){n.fetchWrapper(e,o,function(){u._webProviders.forEach(function(n){return u.fetchWeb(e,n,f,t,o)});u._otherProviders.forEach(function(n){return u.fetch(e,n,f,t,o)})});u._rootViewModel.onQueryChanged(u._currentQuery,f)};s(l,c)}}},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();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){var h=this,c,l;f()&&(this._instrumentationHelper.instrumentResponseReceived(t,i,u,e,o),c=function(i,r,e){if(f())h.onSuggestionsParsed(n,t,i,u,r,e)},l=function(u){var e=h._suggestionsParsers[i];e?e.parse(n,t,i,r,f,u,h._cancellationManager):(SharedLogHelper.LogError("onResponseReceived",null,new Error("No parser for data source "+i)),u(i,[],null))},s(l,c))},t.prototype.onSuggestionsParsed=function(n,t,i,r,u,f){u=u.filter(function(t){return p(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)},t}();n.Core=rt;n.encodeQueryParameter=tr}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){function ct(t){return n.contains(et,t)}function lt(t){return n.contains(ot,t)}function at(t){return n.contains(y,t)}function vt(t){return n.contains(st,t)}function yt(t){return n.contains(ht,t)}function r(n,i){return{dataSource:n,requirementLevel:function(){return t.config.cortanaCapabilitiesAvailable&&!o()?3:1},conditionalRequirements:function(){if(!t.isCloudSearchEnabledCache)return!1;var n=o()?t.getAccountTypeForCloudContent():t.isCortanaPersonalized?t.cortanaAccountType:t.windowsAccountType;return n==2},suggestionIsEnabled:i?function(n){return n==i}:undefined}}function o(){return t.config.wamSupported&&n.isDataSourceEnabled("SSUE",null)}function pt(){return t.config.wamSupported&&n.isDataSourceEnabled("BAW",null)}function p(n){return n==1?t.isSubstrateO365AccountConnected:t.isSubstrateOutlookAccountConnected}function u(n,i,r,u){return u===void 0&&(u=!0),{dataSource:n,requirementLevel:function(){return 0},conditionalRequirements:function(n){return t.config.wamSupported&&t.isCloudSearchEnabledCache&&u&&(t.qfMode!=3||i==1)&&(r||n&&n.queryToFetch&&n.queryToFetch.length>=t.config.minLengthFor3SonL1)&&t.getAccountTypeForCloudContent()==i&&p(i)}}}function w(n){return{dataSource:"BAW",requirementLevel:function(){return 1},conditionalRequirements:function(i){return t.config.wamSupported&&t.isCloudSearchEnabledCache&&(n||i&&i.queryToFetch&&i.queryToFetch.length>=t.config.bawminqlen)&&t.getAccountTypeForCloudContent()==1}}}function s(n){return{dataSource:"B4B",requirementLevel:function(){return 1},conditionalRequirements:function(i){return t.config.wamSupported&&(n||i&&i.queryToFetch&&i.queryToFetch.length>=t.config.bfbminqlen)&&t.getAccountTypeForCloudContent()==1}}}function h(n){if(n===void 0&&(n=!0),!n||!t.isCloudSearchEnabledCache||!o())return!1;var i=t.getAccountTypeForCloudContent();return i==3||i==0?!1:!p(i)}function b(){return n.contains(t.config.enabledDataSources,"EBH")&&(t.qfMode==3||t.config.enableEdgeBrowsingHistory)}function f(){return{dataSource:"EBH",requiredCortanaCapabilities:function(){return t.qfMode==3?[]:["BrowsingHistory"]},conditionalRequirements:function(t){return b()&&(!t||!t.queryToFetch||n.normalizeUrl(t.queryToFetch,31).length>=3)}}}function k(){return t.config.historySettingsPresent?t.cortanaAccountType==3?t.windowsAccountType==2:t.cortanaAccountType!=2?!1:t.config.windowsAuthForOMA&&nt()!=1?!1:!0:!1}function c(){return{dataSource:n.WebDataSource,requirementLevel:function(){return 1},conditionalRequirements:function(){return k()}}}function wt(r){t.ScopeConfig[i.All].enabledDataSourcesForZeroInput=r?[{dataSource:n.MRUDataSource},{dataSource:"MPP"},{dataSource:"MST"},{dataSource:"MFF"},c(),f(),]:[]}function d(){t.ScopeConfig={};t.ScopeConfig[i.All]={icon:{content:"",type:2,needsAccentColor:!0},prefixesLocString:"ScopeAll",enabledDataSources:[{dataSource:"PP"},{dataSource:"ST"},{dataSource:"FL"},{dataSource:"LM"},{dataSource:"IFF"},{dataSource:"CG"},{dataSource:"PBI",requirementLevel:function(){return 2},conditionalRequirements:function(n){return n&&n.queryToFetch&&n.queryToFetch.length>=6&&n.queryToFetch.trim().includes(" ")}},{dataSource:n.MRUDataSource},{dataSource:"MPP"},{dataSource:"MST"},{dataSource:"MFF"},{dataSource:n.WebDataSource,requirementLevel:function(){return 1}},{dataSource:"OSTMA",requirementLevel:function(){return 1}},{dataSource:"QS",requirementLevel:function(){return 1}},f(),r("ODC"),u("SSUE",1,!1),u("SSUC",2,!1),w(!1),{dataSource:"WRS",requirementLevel:function(){return 1}},s(!1),],enabledDataSourcesForZeroInput:[]};t.ScopeConfig[i.Apps]={icon:{content:"",type:2},prefixesLocString:"ScopeApps",enabledDataSources:[{dataSource:n.WebDataSource,suggestionIsEnabled:function(){return!1},requirementLevel:function(){return 1}},{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MPP"},{dataSource:"PP",suggestionIsEnabled:function(n){return n=="PP"}},{dataSource:"OSTMA",requirementLevel:function(){return 1}},{dataSource:"IBA",conditionalRequirements:function(){return t.qfMode!=3}},],enabledDataSourcesForZeroInput:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MPP"},n.contains(t.config.enabledDataSources,"LRA")?{dataSource:"LRA"}:{dataSource:"PP",suggestionIsEnabled:function(n){return n=="PP"}}]};t.ScopeConfig[i.Settings]={icon:{content:"",type:2},prefixesLocString:"ScopeSettings",enabledDataSources:[{dataSource:n.WebDataSource,suggestionIsEnabled:function(){return!1},requirementLevel:function(){return 1}},{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MST"},{dataSource:"ST"},{dataSource:"QS",requirementLevel:function(){return 1}}],enabledDataSourcesForZeroInput:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MST"},]};t.ScopeConfig[i.Photos]={icon:{content:"",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"}},r("ODC","LI"),r("MODC","LI"),],enabledDataSourcesForZeroInput:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="LI"}},]};t.ScopeConfig[i.Videos]={icon:{content:"",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"}},r("ODC","LV"),r("MODC","LV"),],enabledDataSourcesForZeroInput:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="LV"}},]};t.ScopeConfig[i.Music]={icon:{content:"",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"}},r("ODC","MU"),r("MODC","MU"),],enabledDataSourcesForZeroInput:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="MU"}},]};t.ScopeConfig[i.Documents]={icon:{content:"",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}},r("ODC","FL"),r("MODC","FL"),{dataSource:"PP",suggestionIsEnabled:function(n){return n=="LDOC"}},u("SSUE",1,!0),u("SSEE",1,!0,!t.config.useSRR),],enabledDataSourcesForZeroInput:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="FL"}},u("SSEE",1,!0,!!t.config.zeroInputCloudDocs),],showUpsellOnSuggestionsList:function(){return h(t.getAccountTypeForCloudContent()==1)}};t.ScopeConfig[i.Folders]={icon:{content:"",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"}},r("ODC","FD"),r("MODC","FD"),],enabledDataSourcesForZeroInput:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(){return!1}},{dataSource:"MFF",suggestionIsEnabled:function(n){return n=="FD"}},]};t.ScopeConfig[i.Web]={icon:{content:"",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)},requirementLevel:function(){return 1}},{dataSource:"PP",suggestionIsEnabled:function(n,t){return t==1}},f(),w(!0),{dataSource:"WRS",requirementLevel:function(){return 1}},s(!0),],enabledDataSourcesForZeroInput:[{dataSource:n.MRUDataSource,suggestionIsEnabled:function(n,t){return t==1}},c(),f(),]};t.ScopeConfig[i.PathCompletion]={icon:{content:"",type:2,needsAccentColor:!0},prefixesLocString:"",enabledDataSources:[{dataSource:"PT"},{dataSource:"CG"},],enabledDataSourcesForZeroInput:[]};t.ScopeConfig[i.Emails]={icon:{content:"",type:2},prefixesLocString:"ScopeEmails",enabledDataSources:[u("SSEE",1,!0),u("SSEC",2,!0),],enabledDataSourcesForZeroInput:[],showUpsellOnSuggestionsList:function(){return h()}};t.ScopeConfig[i.People]={icon:{content:"",type:2},prefixesLocString:"ScopePeople",enabledDataSources:[u("SSUE",1,!0),u("SSUC",2,!0),s(!0),],enabledDataSourcesForZeroInput:[],showUpsellOnSuggestionsList:function(){return h()}};for(var e in t.ScopeConfig)t.ScopeConfig[e].enabledDataSources=t.ScopeConfig[e].enabledDataSources.filter(function(i){return n.contains(t.config.enabledDataSources,i.dataSource)}),t.ScopeConfig[e].enabledDataSourcesForZeroInput=t.ScopeConfig[e].enabledDataSourcesForZeroInput.filter(function(i){return n.contains(t.config.enabledDataSources,i.dataSource)})}function bt(){e=null}function kt(n,r){var u,f;if(e={},t.scopesAvailable){u=function(u){var f=parseInt(u),o=t.ScopeConfig[f];if(f!=i.All&&o.prefixesLocString&&l(f,o)){var s=HitHighlightingParser.removeDiacritics(n(o.prefixesLocString).toLocaleLowerCase()),h=HitHighlightingParser.removeDiacritics(r(o.prefixesLocString).toLocaleLowerCase()),c=g(s,h);c.forEach(function(n){return e[n.trim()]=f})}};for(f in t.ScopeConfig)u(f)}}function dt(n,t){if(!n.prefixesLocString)return"";var i=g(t.getLocString(n.prefixesLocString));return i[0].trim()}function g(n,t){var i=n;return t&&(i+=","+t),i.search(v)>-1&&(i=i.replace(v,",")),i.split(",")}function l(r,u){var f,s,e,o,h;if(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){rt(n,null)||(f=f.filter(function(t){return t!=n.dataSource}))},e=0,o=u.enabledDataSources;e0&&u<3&&(u=3),!t.isCortanaPersonalized&&u>=3)?!1:!t.isCortanaEnabledCache&&u>=2?!1:!n.isBingEnabled()&&u>=1?!1:i.requiredCortanaCapabilities&&!i.requiredCortanaCapabilities().every(function(i){return n.contains(t.availableCortanaCapabilities,i)})?!1:i.conditionalRequirements&&!i.conditionalRequirements(r)?!1:!0}function ti(i){var o,r,u,f,e;for(n.disableWebDataSourceIfNeeded(i,t.getMarketForBingAvailability()),o=i.queryToFetch?t.ScopeConfig[a(i)].enabledDataSources:t.ScopeConfig[a(i)].enabledDataSourcesForZeroInput,r=0,u=o;r0))){for(i.taskFrame=r,f=0,s=o;f0?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 ei(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"MODC":return r!="thispc"&&r!="sharepoint";case"SSEE":return r!="thispc"&&r!="onedrive";default:return!1}}function oi(n){return n&&n.originalQuery?t.flatListWithoutGroups:t.flatListWithoutGroupsZeroInput}var i,e,tt,it,ut,ft;(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"})(i=t.Scope||(t.Scope={}));var v=/،/g,et=["PP","QP","IBA"],ot=["ST","QS"],y=["LI","LV","MU"],st=["FL","LDOC","FD"].concat(y),ht=[i.Documents,i.Folders,i.Photos,i.Videos,i.Music];t.isApp=ct;t.isSetting=lt;t.isMedia=at;t.isFileOrFolder=vt;t.isFileOrFolderScope=yt;t.substrateProvidersEnabled=o;t.bingAtWorkProviderEnabled=pt;t.edgeBrowsingHistoryAvailable=b;t.edgeBrowsingHistoryDS=f;t.searchHistoryAllowed=k;t.webZeroInput=c;t.setZeroInputDataSourcesForL1=wt;t.populateScopeConfig=d;d();t.cleanScopePrefixes=bt;t.scopeListRequiresUpdate=!1;t.initScopePrefixes=kt;t.getScopeDisplayName=dt;t.isScopeEnabled=l;t.qfMode=0;t.alwaysWide=!1;t.searchBoxOnTop=!1;t.flatListWithoutGroups=!1;t.flatListWithoutGroupsZeroInput=!1;t.maxSuggestionsWhenFlatList=0;t.previewPaneAvailable=!1;t.zeroInputAvailable=!1;t.scopesAvailable=!1;t.isMobileCache=SearchAppWrapper.CortanaApp.isMobile||navigator.userAgent.toLowerCase().includes("xbox one")||navigator.userAgent.toLowerCase().includes("hololens");t.isAndromedaCache=(SearchAppWrapper.CortanaApp.deviceInfo||"").toLocaleUpperCase().includes("WCOS; ANDR");t.windowsAccountType=0;t.cortanaAccountType=0;t.getWindowsAndCortanaAccountIdentityDiff=nt;tt=/^ht+ps?[;:]+|^www[.。]|^\/+/;it=/^[a-z]:\\|^%[^%]+%\\|^\\/i;t.parseQuery=gt;t.parseTaskFrame=ri;ut="action://FindMyStuff/FindDocument";ft="action://FindMyStuff/FindMessage";t.getEffectiveScope=a;t.getEffectiveQuery=fi;t.shouldRenderFlatListWithoutGroups=oi})(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){function et(n,t){return n.type==t.type&&n.source==t.source}function st(n){switch(n){case"PP":return"Apps";case"ST":return"Settings";case"FL":return"Files";case"LM":return"Media";default:return null}}function ht(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"EBH":return!0;case"OSTMA":case"QS":case"PP":case"LRA":case"ST":case"PBI":case"MPP":case"MST":case"IBA":return!1}throw new Error("New local data source "+n+" needs to be explicity classified as potentially containing PII or not");}function ct(n){var t=e(n);return n.deviceItem&&n.handoffType==2?t+"\t"+n.deviceItem.id:t+"\t"+n.query}function l(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 lt(n,i){if(!t.IndexerQueryGenerator)return!1;switch(n){case"IBA":case"MDOC":case"MPHO":case"MVID":case"MMUS":case"MFOL":return!0;case"IFF":return t.qfMode!=3&&!t.isAndromedaCache&&(k(i)||!t.config.minLengthForIBAonL1||i.queryToFetch.length>=t.config.minLengthForIBAonL1);default:return!1}}function at(n){return l(n)||n=="IBA"||n=="EBH"}function vt(n){return n&&(n.tagName.toLowerCase()=="body"||n.tagName.toLowerCase()=="iframe"||n.className&&n.classList.contains("suggestion"))}function yt(n){return n.kind=="Modern Setting"}function a(n){return t.isApp(n.type)?n.deviceItem:null}function pt(n){var i=a(n),t;return i?i.packageFamilyName:(t=n,t.packageFamilyName)?t.packageFamilyName:null}function wt(n){return t.isFileOrFolder(n.type)?n.deviceItem:null}function v(n){switch(n){case"PBI":case"EBH":return!1}return!0}function bt(n){return v(n.type)?n.deviceItem:null}function kt(n){return n.type=="CG"?n.deviceItem:null}function dt(n){return n.type=="PT"?n.deviceItem:null}function gt(n){return n.type=="PBI"?n.deviceItem:null}function y(n){return n.type=="EBH"?n.deviceItem:null}function ni(n){return n&&n.classList.contains("scopeTile")}function ti(n){return n&&(n.id==="optInYesBtn"||n.id==="optInNoBtn")}function e(n){if(t.isApp(n.type))return i.Apps;if(s(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"PBI":return i.PowerBi;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"EBH":return i.EdgeHistory;case"BKS":return i.Bookmarks;case"ELA":return i.LocalPlaces;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}throw new Error("Unexpected handoff type: "+n.handoffType);}}function ii(n){return n.click&&!n.instItem}function o(n){switch(n){case i.JumpListTasks:case i.JumpListPinned:case i.JumpListRecent:case i.JumpListFrequent:case i.JumpListCustom:return!0;default:return!1}}function p(n){return n.notAResult&&n.type!="SW"&&n.type!="PWL"}function ri(n){return t.config.recourseOnlyInGroups&&n.suggestions.every(function(n){return p(n)})}function ui(n){var t=n.type;return o(t)||t==i.Related||t==i.Contact}function fi(n){if(o(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 s(n){return!!n.parent}function ei(n){return n.type=="JL"}function w(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.EdgeHistory: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 oi(n){switch(n){case 0:return t.IconSize_TopResult;case 1:return t.IconSize_Suggestion;case 2:return t.IconSize_GridLayout_Scaled;case 3:return t.IconSize_StartMenu;case 4:return t.IconSize_Preview}throw new Error("Unsupported image size: "+n);}function si(n,t,i){if(n&&n.type==0&&g(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 hi(){var n=t.uiLanguageCache.toLocaleLowerCase();return b[n]||n}function ci(n,t,i,r,u,f,e,o,s,h,c){return{text:n,getIcon:t,icon:i,type:r,query:u,ciMatchedQuery:null,id:h,click:c,handoffType:e,instItem:f,isAnswer:!1,htmlContent:null,classNames:[],selected:!1,featureStore:undefined,sequenceNumber:o,getMruData:function(){return null},template:0,mayContainPII:s,features:[]}}function li(n,t){if(n.htmlContent)return null;var i=y(n)?[n.primaryMetadata||n.text]:[n.text],r=n.receivedDate;return r&&i.push(r),t?i.push(t):(n.primaryMetadata&&i.push(n.primaryMetadata),n.template==1&&n.secondaryMetadata&&i.push(n.secondaryMetadata)),HitHighlightingParser.removeMarkers(i.join(", "))}function k(n){return n.scope!=t.Scope.All||!!n.taskFrame}function d(n){return typeof n=="string"?n=="LI"||n=="LV":n==i.Photos||n==i.Videos}function g(n){return d(n)||n=="PPL"}function ai(n){return!t.alwaysWide&&t.qfMode!=3&&d(n)}function vi(n,i){var f,u,e,r;if(!n||!t.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;r0?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;e0&&(t.DataSources.duplicates={T:"D.Duplicates",Service:n.InstrumentationCommon.DEFAULT_SERVICE_NAME,Scenario:"Duplicates",AppNS:n.InstrumentationCommon.DEFAULT_APP_NAMESPACE,DS:i})},u.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);i.duplicates=i.duplicates||[];i.duplicates.push(r)},"instrumentDuplicate")},u.prototype.renderingStopped=function(n){return n.PendingIcons==0&&n.AllDataSourcesProcessed},u.prototype.notifyAllDataSourcesProcessed=function(n){var t=this;this.safeInstrumentPerf(n,function(i){i.AllDataSourcesProcessed=!0;t.tryInstrumentRenderStopped(n,i)},"notifyAllDataSourcesProcessed")},u.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")},u.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")},u.prototype.tryInstrumentRenderStopped=function(t,i){this.renderingStopped(i)&&(this.finalizeKeystrokeLog(t,2),n.config.th&&n.safeFireEvent("RenderStopped"))},u.prototype.isLayoutLogged=function(n){return this._keystrokesInstrumentationData[n].MasterPageImpressionCreated},u.prototype.finalizeKeystrokeLog=function(n,t){var i,r;t===void 0&&(t=0);i=this._keystrokesInstrumentationData[n];i&&this.logKeystrokeData(i,n);t!=1&&(r=this._keystrokesPerfPingData[n],r&&(this.logPerfPingEvent(this.createKeystrokePerfPingEvent(n,r)),delete this._keystrokesPerfPingData[n]))},u.prototype.instrumentRenderFinished=function(i,r){var u=this;this.safeInstrumentPerf(i,function(f){var e=u.getOffsetedNow();r.forEach(function(n){return f.RenderFinished[n]=e});t&&(u.logProfilerMarker(0,0,"groupsRendered",f),n.log(r.toString()));u.tryInstrumentRenderStopped(i,f)},"instrumentRenderFinished",r.join(","))},u.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"))},u.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"))},u.prototype.getInstrumentedSyntheticSuggestion=function(n,t){return this._keystrokesInstrumentationData[n].PendingSyntheticSuggestions[t]},u.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)},u.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;u0&&(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={}},u.prototype.instrumentSnRProviderFetchUrl=function(n,t){this.safeInstrument(n,function(n){n.SnRProviderFetchUrl=t},"instrumentSnRProviderFetchUrl")},u.prototype.onConversationStart=function(){this._conversationStartTimestamp=n.getCurrentTime();this._searchServiceStatus=null},u.prototype.getConversationStartTimestamp=function(){return this._conversationStartTimestamp},u.prototype.logDataSourceTimeout=function(i,r){t&&n.log("timeout");this._clientInstrumentationProvider.logDataSourceTimeout(i,r)},u.prototype.logProfilerMarker=function(i,r,u,f,e){if(t&&r!=2){var o=this.getOffsetedNow();n.log(u+" "+(o-f.RequestBegin))}this._clientInstrumentationProvider.logProfilerMarker(i,r,u,f.RawImpressionGuid,e)},u.prototype.createKeystrokePerfPingEvent=function(t,i){var u={I:t,PL:i.PrefixLength,K:i.RequestBegin,RRT:i.ResponseReceived,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=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;u0&&(this._bufferingTimer=sb_st(function(){return n.safeExecute(function(){o._bufferingTimer=null;o.processSuggestions(!0)},"processSuggestionsBuffering")},e)))},t.prototype.getLatencyTimeout=function(){return this._partialQuery.queryToFetch?n.config.latencyTimeout:n.config.latencyTimeoutForZeroInput},t.prototype.queueSuggestions=function(t,i,r,u){if(t>this._sequenceNumber){SharedLogHelper.LogError("queueSuggestions",null,new Error("Unexpected sequence number"));return}if(!(t0&&this._bufferingTimer==null,a=this.haveAllDataSources(this._normalPriorityDataSources),e=this.haveAllDataSources(this._highPriorityDataSources),v=e||l,h=e&&a,c;t&&this._instrumentationHelper.logDataSourceTimeout(Object.keys(this._suggestionsQueue),this._partialQuery);var f=t&&!this._renderedThisSequenceNumber,y=function(t,e){var o;if(!t.updated&&i.getDependencies(e).every(function(t){return n.contains(i._arrivedDataSources,t)})){if(s.push(e),i._allProcessedDataSources.push(e),t.suggestions.length>0&&(o=i.canHaveSuppressions(e)?t.suggestions.filter(function(n){return!i.isSuppressed(e,n,t.suggestions)}):t.suggestions,o.length>0)){r||(r=i._renderedThisSequenceNumber?i._rootViewModel.getSuggestions(!0):[]);var h=i.removeDuplicatesAndAssignIds(o,r,u,e),c=h[0],l=h[1];u=u.concat(c);l&&(f=!0)}t.updated=!0}},o=function(n){var u,t,r;for(u in n)t=n[u],r=i._suggestionsQueue[t],r&&y(r,t)};v&&o(this._highPriorityDataSources);this._bufferingTimer&&h&&(sb_ct(this._bufferingTimer),this._bufferingTimer=null);c=this.getLatencyTimeout()>0?this._bufferingTimer==null:e;c&&(o(this._normalPriorityDataSources),o(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,s,f));this._allDataSourcesArrived&&this._instrumentationHelper.notifyAllDataSourcesProcessed(this._sequenceNumber)},t.prototype.getAggregatorResult=function(t,i,r){var e=this.waitingForWebProvider(this._allProcessedDataSources),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(t){var i=this;return n.isBrowserOnline()&&[n.WebDataSource].concat(this.getDependencies(n.WebDataSource)).some(function(r){return n.isDataSourceEnabled(r,i._partialQuery)&&!n.contains(t,r)})},t.prototype.isSuggestionOrderTheSame=function(n,t){var r=function(n){return n.query+"\t"+n.type},i;if(n.length!=t.length)return!1;for(i=0;i=0)return c=t[a],c.needsRefreshAfterDeduping&&(s=!0),u._aggregator.copyMruSignals(r,c,l),u._instrumentationHelper.instrumentDuplicate(u._sequenceNumber,c,l),"continue";if(a=i.findIndex(function(n){return f._aggregator.isDuplicate(f._partialQuery,n,l)}),a>=0)return c=i[a],c.needsRefreshAfterDeduping&&(c.needsRefreshAfterDeduping=!1),u._aggregator.copyMruSignals(r,c,l),u._instrumentationHelper.instrumentDuplicate(u._sequenceNumber,c,l),"continue";if(u._aggregator.canHaveDuplicatesWithinDataSource(r,u._partialQuery)&&(a=e.findIndex(function(n){return f._aggregator.isDuplicate(f._partialQuery,n,l)}),a>=0))return c=e[a],c.needsRefreshAfterDeduping&&(c.needsRefreshAfterDeduping=!1),u._aggregator.copyMruSignals(r,c,l),u._instrumentationHelper.instrumentDuplicate(u._sequenceNumber,e[a],l),"continue";h(l);e.push(l)},u=this;for(o=0;o0||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 y(n,t){return!n||!t?0:n.length+1<=t.length&&t[n.length]==" "?1:n.length==t.length?1:0}function p(n){var r=0,i=1,t;if(n&&n.length>1)for(t=1;tr&&(r=i);else if(n)return 1;return r}function w(n){return n&&n.length>0?n.trim().split(" ").length:0}function b(n){var t=new RegExp("^[0-9a-zA-Z ]+$");return n&&t.test(n)?1:0}function k(n){return n&&n.length>0&&n.charAt(n.length-1)==" "?1:0}function d(n){return n&&n.length>0&&(n.includes("http://")||n.includes("https://")||n.includes("."))?1:0}function g(t,i,r,u){var o,e,s,h;t.includes("?")&&(r[117]=1,ut(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 nt(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 tt(n,i,r){var e=n.toLocaleLowerCase(),s,u,f,h,c;if(r[140]=n.length,s=e.split(" "),r[144]=s.length,i)for(r[141]=t(n,i),r[142]=Math.min(100,o(r[141],i.length,n.length)),u=i.toLocaleLowerCase(),e.includes(u)&&(r[143]=1),e.startsWith(u)&&(r[188]=1),f=0,h=s;f0&&(i[100]=f.prefixLaunchCount/u),f.previewPaneLaunchCount&&f.lastPreviewPaneLaunchTime&&(i[301]=f.previewPaneLaunchCount,f.lastPreviewPaneLaunchTime==f.lastLaunchTime&&(i[302]=1),i[303]=n.getCurrentTime()-f.lastPreviewPaneLaunchTime))}}function ot(n,t,i){if(i){var r=i[n];r&&(t[281]=r.probability,t[282]=r.weight)}}function st(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 ht(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 ct(t){var i={};return t?(n.config.athenaKeyType==2?vt(t,i):(lt(t,i),at(t,i)),i):i}function lt(t,f){var y=t.Suggestions?t.Suggestions.split("\t"):[],p=t.ProbSugClickGivenPrefs?t.ProbSugClickGivenPrefs.split("\t"):[],w=t.ClicksOnSugGivenPrefs?t.ClicksOnSugGivenPrefs.split("\t"):[],b=t.ProbSugClickGivenBackground?t.ProbSugClickGivenBackground.split("\t"):[],k=t.Loglikelihoods?t.Loglikelihoods.split("\t"):[],a=t.SuggestionGroups?t.SuggestionGroups.split("\t"):[],d=t.ProbSugClickGivenPrefWeeks?t.ProbSugClickGivenPrefWeeks.split("\t"):[],v=t.ProbSugClickGivenPrefWeekends?t.ProbSugClickGivenPrefWeekends.split("\t"):[],g=t.ProbSugClickGivenBackgroundWeeks?t.ProbSugClickGivenBackgroundWeeks.split("\t"):[],it=t.ProbSugClickGivenBackgroundWeekends?t.ProbSugClickGivenBackgroundWeekends.split("\t"):[],nt=t.LoglikelihoodWeeks?t.LoglikelihoodWeeks.split("\t"):[],tt=t.LoglikelihoodWeekends?t.LoglikelihoodWeekends.split("\t"):[],c=n.config.athenaKeyType==0||!t.SuggestionHandOffTypes?[]:t.SuggestionHandOffTypes.split("\t"),s=y.length,l=e(),o;if(u(s,a.length,c.length))for(o=0;oo?a[o]:"",ut=c&&c.length>o?c[o]:"",ft=r(rt,ut,""),h=i(y[o],ft);f[h]={SuggestionGroup:+a[o]};b.length==s&&(f[h].ProbSugClickGivenBackground=Number(b[o]));p.length==s&&(f[h].ProbSugClickGivenPref=Number(p[o]));w.length==s&&(f[h].ClicksOnSugGivenPref=Number(w[o]));k.length==s&&(f[h].Loglikelihood=Number(k[o]));n.config.athenaKeyType!=0&&c.length==s&&(f[h].SuggestionHandOffType=Number(c[o]));d.length!=s||l?v.length==s&&l&&(f[h].ProbSugClickGivenPrefTime=Number(v[o])):f[h].ProbSugClickGivenPrefTime=Number(d[o]);g.length!=s||l?v.length==s&&l&&(f[h].ProbSugClickGivenBackgroundTime=Number(it[o])):f[h].ProbSugClickGivenBackgroundTime=Number(g[o]);nt.length!=s||l?tt.length==s&&l&&(f[h].LoglikelihoodTime=Number(tt[o])):f[h].LoglikelihoodTime=Number(nt[o])}else SharedLogHelper.LogError("parseLLSignals",null,new Error("Length doesn't match"))}function at(t,f){var a=t.CCRSuggestions?t.CCRSuggestions.split("\t"):[],l=t.CCRSuggestionGroups?t.CCRSuggestionGroups.split("\t"):[],v=t.CCRs?t.CCRs.split("\t"):[],y=t.EventCounts?t.EventCounts.split("\t"):[],c=n.config.athenaKeyType==0||!t.CCRSuggestionHandOffTypes?[]:t.CCRSuggestionHandOffTypes.split("\t"),p=t.CCRsWeek?t.CCRsWeek.split("\t"):[],w=t.CCRsWeekend?t.CCRsWeekend.split("\t"):[],s=a.length,b=e(),o;if(u(s,l.length,c.length))for(o=0;oo?l[o]:"",d=c&&c.length>o?c[o]:"",g=r(k,d,""),h=i(a[o],g);f[h]||(f[h]={SuggestionGroup:Number(l[o])});v.length==s&&(f[h].CCR=Number(v[o]));y.length==s&&(f[h].EventCount=Number(y[o]));n.config.athenaKeyType!=0&&c.length==s&&(f[h].CCRSuggestionHandOffType=Number(c[o]));p.length!=s||b?w.length==s&&b&&(f[h].CCRTime=Number(w[o])):f[h].CCRTime=Number(p[o])}else SharedLogHelper.LogError("parseCCRSignals",null,new Error("Length doesn't match"))}function vt(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;i1)for(d=u.map(function(n,t){return n.type=="MB"?t:undefined}).filter(function(n){return typeof n=="number"}),v=0;v0)?(u=r[0],u.fbcScore=this.getFallbackClassifierScore(u),f=n.isWebSuggestion(u)?t.config.webFbcScoreThreshold:t.qfMode==3?t.config.nonWebFbcScoreThresholdTabShell:t.config.nonWebFbcScoreThreshold,u.fbcScore>=f?r.slice(0,i.topHitIsMultiEntity(r)?2:1):[]):[]},r.prototype.enableFallbackClassifier=function(n,i,r){if((t.config.enableFBMinQryLength==0||n.queryToFetch.length>=t.config.enableFBMinQryLength)&&r&&t.config.fallbackClassifierId&&i.length>0){var u=i[0];return t.getGroupType(u)==t.GroupType.Cortana?!1:u.isAnswer?u.autoOpenPreviewPaneWhenOnTopHit&&t.config.applyFallbackClassifierToAutoOpenAnswers||u.type=="MB"&&t.config.applyFallbackClassifierToEntities:!0}return!1},r.prototype.allowInTopHit=function(i,r,u){var h=!u||u.length==1,o,e,s,f;if(!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.PowerBi: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.5&&(u=r);return u==0&&i.topHitIsMultiEntity(n)&&(u=1),n.slice(0,u+1)},r.prototype.createFeatureStore=function(i,r,u,f,e,o,s,h,c){var rt=[],k=0,ut=0,d=0,lt=i.queryToFetch.toLocaleLowerCase(),at=function(n){return t.getGroupType(n)},ft=n.getSumMruLaunches(f),et=0,ot={},g,nt,st,w,tt,v,y,b,it,a,l,p,ht,ct;for(f&&(g=n.evaluateGroupLaunches(f),et=g.otherGroupLaunches,ot=g.groupLaunches),nt=n.computeGroupBackpropagatedClicks(i.queryToFetch,c),st=n.computeSuggestionBackpropagatedClicks(i.queryToFetch,c),w=0,tt=r;wk&&(k=y.totalLaunches)),v.deviceItem&&v.deviceItem.rankScore>d&&(d=v.deviceItem.rankScore));for(b=0,it=r;b0&&(s[103]=c.totalLaunches/e),this.addLastAccessDate(c.lastAccessed,s)):this.addLastAccessDate(t.isJumpListSuggestion(r)?r.jumpListItem.lastAccessed:null,s),a=t.getBrowsingHistoryItem(r),a&&(a.visitCount&&(s[138]=a.visitCount),this.addLastAccessDate(a.dateVisited,s)),s[96]=r.catalogScore,s[97]=r.avgRating,s[98]=r.ratingCount,s[99]=r.confidence,s[150]=r.source,s[283]=r.pinnedToTaskbar?1:undefined,r.hc&&(s[189]=1),s[17]=r.highConfidenceMetaSuggestionScore,w=this.getRank(r),typeof w!="undefined"?s[16]=w:s[4]=1,l=r,l.matchedOnlyOnContent&&(s[259]=1),l.matchedOnlyOnAuthor&&(s[273]=1),l.lastModifiedDate&&(s[268]=n.getTimeDiffInDays(l.lastModifiedDate)),l.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),h=n.getTextForLexicalFeatures(r),b=h?h.toLocaleLowerCase():null,h||(s[132]=1),b==i&&(s[133]=1),r.handoffType==2&&(r.type!="PBI"&&(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]=h.length,s[134]=n.getEditDistance(i,b),s[135]=Math.min(100,n.computeEditDistanceRatio(s[134],i.length,h.length)),s[136]=n.isWordBoundary(i,h),s[284]=Math.abs(h.length-i.length)),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))&&(k=r.ciMetaData,this.computeConstraintIndexFeatures(r.deviceItem,s,k),r.ciMatchedQuery=this.getConstraintIndexMatchedQuery(k)),r.signals&&(s[230]=r.signals.DistanceToEntity,s[231]=r.signals.DistanceToEntityPrecision,s[232]=r.signals.RankingScore),s},r.prototype.addLastAccessDate=function(t,i){var r=n.getTimeDiffInDays(t);r!=null?i[9]=r:i[19]=1},r.prototype.setTypeSignal=function(n,t){switch(n.type){case"LDOC":case"FL":t[61]=1;break;case"LI":t[85]=1;break;case"LV":t[86]=1;break;case"MU":t[87]=1;break;case"FD":t[88]=1;break;case"CG":t[89]=1;break;case"PT":t[90]=1;break;case"PP":case"IBA":t[1]=1;break;case"ML":case"MD":t[21]=1;break;case"CS":t[63]=1;break;case"SW":t[59]=1}},r.prototype.setRatios=function(n,t){t&&t.AppsRatio!==undefined&&(n[26]=t.AppsRatio,t.SettingsRatio&&(n[5]=t.SettingsRatio),t.StoreRatio&&(n[57]=t.StoreRatio),t.PrefixProbability&&(n[12]=t.PrefixProbability),t.FilesRatio&&(n[24]=t.FilesRatio),t.WebRatio&&(n[18]=t.WebRatio),t.PhotosVideosMusicRatio&&(n[28]=t.PhotosVideosMusicRatio),t.ContactsRatio&&(n[56]=t.ContactsRatio),t.LocalProtocolRatio&&(n[91]=t.LocalProtocolRatio))},r.prototype.setThresholdRatios=function(n,t){t&&t.ThApps!==undefined?(n[40]=t.ThApps,t.ThStore&&(n[35]=t.ThStore),t.ThSetting&&(n[39]=t.ThSetting),t.ThCortAns&&(n[32]=t.ThCortAns),t.ThPrefixCount&&(n[38]=t.ThPrefixCount),t.ThWeb&&(n[29]=t.ThWeb),t.ThSearchTheWeb&&(n[34]=t.ThSearchTheWeb),t.ThOther&&(n[37]=t.ThOther),t.ThFile&&(n[31]=t.ThFile),t.ThFolder&&(n[51]=t.ThFolder),t.ThPath&&(n[50]=t.ThPath),t.ThEmail&&(n[33]=t.ThEmail),t.ThCommAns&&(n[54]=t.ThCommAns),t.ThPhotoAns&&(n[30]=t.ThPhotoAns),t.ThVideoAns&&(n[53]=t.ThVideoAns),t.ThMusicAns&&(n[52]=t.ThMusicAns),t.ThDNav&&(n[147]=t.ThDNav)):n[42]=1},r.prototype.computeConstraintIndexFeatures=function(n,t,i){var u,o,f,e,s,r;if(n&&n.rawIndexResponse){if(!i)return;if(t[157]=i.GrammarScore,t[158]=i.MatchScore,i.Parses&&i.Parses.length>0&&i.Parses[0].Entities&&i.Parses[0].Entities.length>0)for(u=0,o=i.Parses[0].Entities;u=0)){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 e(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 o(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 l(n){return{fullySuppressedGroups:n.fullySuppressedGroups?n.fullySuppressedGroups.slice(0):[],partiallySuppressedGroups:n.partiallySuppressedGroups?n.partiallySuppressedGroups.slice(0):[],suppressedSuggestions:n.suppressedSuggestions?n.suppressedSuggestions.slice(0):[]}}function s(n,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 a(n){return n.type=="SW"||n.type=="PWL"}function r(n,i){return!n.suppressed&&n.handoffType==0&&(!n.htmlContent||t.qfMode==3)&&n.query.toLocaleLowerCase()==i.queryToFetch.toLocaleLowerCase()}function h(n){return n.length>=2&&n[0].type=="MB"&&n[1].type=="MB"}var u={"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"},f={"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"},c;i.isWebSuggestionForPrefix=r;i.topHitIsMultiEntity=h;c=function(){function i(n,t,i,r,u,f,e){this._host=n;this._instrumentationHelper=t;this._navigationHelper=i;this._previousKeystrokeCache=r;this._ranker=u;this._renderedTopResults=f;this._previewPane=e}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 s=this,f="PWL",u=this._instrumentationHelper.getInstrumentedSyntheticSuggestion(r,f),e,o;return u?u:(e=t.qfMode!=3,u=t.createSuggestion(null,e?this._host.getEdgeIcon:null,e?null:{type:1,content:""},f,null,n.InstrumentedItem.getNonSuggestionInstrumentedItem(f,t.SyntheticQSCodesMaps.KValues),1,r,!1,"tp",function(){return s._host.launchUrl(u.url)}),u.notAResult=!0,o=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,s._host.getLocString("DirectNavSuggestion"))},o(i),u.updateFromQuery=function(n){return n.isProtocol?(o(n),!0):!1},this._instrumentationHelper.instrumentSyntheticSuggestion(r,u),u)},i.prototype.getSearchSuggestion=function(i,r,u,f,e,o,s,h){var c=this._instrumentationHelper.getInstrumentedSyntheticSuggestion(r,u),a,l;return c?c:(a=i.scope,c=t.createSuggestion(null,null,f,u,null,n.InstrumentedItem.getNonSuggestionInstrumentedItem(u,t.SyntheticQSCodesMaps.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=t.getNarratorText(c);c.click=function(){return h(c,n)}},l(i),c.updateFromQuery=function(n){return!n.isProtocol&&n.scope==a&&n.queryToFetch?(l(n),!0):!1},this._instrumentationHelper.instrumentSyntheticSuggestion(r,c),c)},i.prototype.getWebSearch=function(t,i,r,u,f,e){var o=this,s=n.contains([13,14],f);return this.getSearchSuggestion(t,i,r,u,f,e,s,function(n,t){return o.launchWebSearch(t,n.useRaf,r,f)})},i.prototype.getExplorerSearch=function(n,i){var u=this,r=this.getSearchSuggestion(n,i,"SDFE",{content:"",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.getAccountTypeForCloudContent()==1;return this.getSearchSuggestion(n,i,"OWA",{content:"",type:2},r?8:12,this._host.getLocString("SearchInOutlookWeb"),!0,function(){return u._host.launchUrl(r?"https://outlook.office.com/owa":"https://outlook.live.com/owa")})},i.prototype.getStoreSearch=function(n,t){var i=this;return this.getSearchSuggestion(n,t,"STS",{content:"",type:2},3,this._host.getLocString("SearchForAppsInTheStore"),!0,function(n,t){return i._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:"",type:2},13,this._host.getLocString("SearchForWebImages")):null;case t.Scope.Videos:return n.isBingEnabled()?this.getWebSearch(i,r,"SBV",{content:"",type:1},14,this._host.getLocString("SearchForWebVideos")):null;default:return null}},i.prototype.getSyntheticSuggestions=function(i,r){var f=i.queryToFetch&&n.isSuggestionTypeEnabled(n.WebDataSource,"SW",0,i)?this.getWebSearch(i,r,"SW",t.getSearchSuggestionIcon(),0,t.getWebSuggestionAnnotation(this._host)):null,e=i.isProtocol?this.getProtocol(i,r):null,u=this.getRecourse(i,r);return u&&(u.rankingScore=-Number.MAX_VALUE),{protocol:e,searchTheWeb:f,recourse:u}},i.prototype.canHaveDuplicates=function(i,r){switch(i){case n.WebDataSource:case n.MRUDataSource:case"OSTMA":case"BAW":case"B4B":case"QS":case"PP":case"IBA":case"LRA":case"ST":case"FL":case"LM":case"IFF":case"CG":case"PT":case"MPP":case"MST":case"MFF":case"ODC":case"MODC":case"MDOC":case"MFOL":case"MPHO":case"MVID":case"MMUS":case"EBH":case"SSUE":case"SSUC":return!0;case"PBI":return!1;case"SSEE":return r.scope==t.Scope.Documents||r.scope==t.Scope.Emails;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,r,h){var a,v,c,l,g,nt,tt,it,d,y,p,rt,ut,b,k;if(n.contains([5,4],r.handoffType)&&n.contains([5,4],h.handoffType)&&r.actionUri==h.actionUri&&r.query.toLocaleLowerCase()==h.query.toLocaleLowerCase()||r.handoffType==10&&h.handoffType==10&&r.type==h.type&&!r.htmlContent&&!h.htmlContent&&r.query.toLocaleLowerCase()==h.query.toLocaleLowerCase()||r.type!="PWL"&&r.handoffType==1&&h.handoffType==1&&n.isDuplicateUrl(i,r.url,h.url)||(a=t.getAppItem(r),v=t.getAppItem(h),c=a?a.filePath:r.path,c&&(c=c.toLocaleLowerCase()),l=v?v.filePath:h.path,l&&(l=l.toLocaleLowerCase()),g=t.getAppPfn(r),nt=t.getAppPfn(h),g&&nt&&g.toLocaleLowerCase()==nt.toLocaleLowerCase()))return!0;if(tt=t.getCommandLineItem(r),it=t.getCommandLineItem(h),tt&&v||it&&a){var ft=c||l,w=tt||it,et=w.encodedPath;return ft&&et&&ft==et.toLocaleLowerCase()?(d=a||v,!w.launchArguments||(d.launchArguments||"").toLocaleLowerCase()==w.launchArguments.toLocaleLowerCase()||!d.launchArguments&&w.launchArguments&&d.displayName.toLocaleLowerCase().startsWith(w.displayName.toLocaleLowerCase())):!1}if(r.deviceItem&&h.deviceItem){if(y=r.deviceItem.id||"",p=h.deviceItem.id||"",y.toLocaleLowerCase()==p.toLocaleLowerCase())return c&&!a&&l&&!v&&t.enrichMetadataFromDuplicate(i,r,h,this._host),!0;if(a){if(t.isSetting(h.type)&&u[y]==p)return!0}else if(t.isSetting(r.type)&&(v&&u[p]==y||t.isSetting(h.type)&&(f[y]==p||f[p]==y)))return!0}if(this.isIcoShortcutDuplicate(r,h)||this.isIcoShortcutDuplicate(h,r))return!0;if(c&&l){if(c==l)return t.enrichMetadataFromDuplicate(i,r,h,this._host),!0;if(!a&&!v)if(r.handoffType==h.handoffType){if(r.handoffType==8&&r.url==h.url)return t.enrichMetadataFromDuplicate(i,r,h,this._host),!0}else{if((c=e(c,r.handoffType!=7),l=e(l,h.handoffType!=7),c==l)||(rt=r.handoffType!=8,ut=h.handoffType!=8,c=o(c,rt,r.url),l=o(l,ut,h.url),c==l))return t.enrichMetadataFromDuplicate(i,r,h,this._host),!0;if(t.SubstrateTenantName){var ot=s(r,c,rt),st=ot[0],lt=ot[1],ht=s(h,l,ut),ct=ht[0],at=ht[1];if(lt==at&&(ct.endsWith(st)||st.endsWith(ct)))return t.enrichMetadataFromDuplicate(i,r,h,this._host),!0}}if(b=r.targetPathLC,k=h.targetPathLC,a&&h.type=="IBA"&&(c=t.resolveKnownFolderGUIDsInPath(c)),v&&r.type=="IBA"&&(l=t.resolveKnownFolderGUIDsInPath(l)),(b&&k&&b==k||b&&b==l||k&&c==k||c==l)&&(!a||!v||(a.launchArguments||"").toLocaleLowerCase()==(v.launchArguments||"").toLocaleLowerCase()))return!0}return this.isCortanaSettingDuplicate(r,h)||this.isCortanaSettingDuplicate(h,r)?!0:r.type==="PPL"&&h.type==="PPL"&&r.uniqueName&&h.uniqueName&&r.uniqueName.toLocaleLowerCase()===h.uniqueName.toLocaleLowerCase()?!0:r.type==="OLE"&&h.type==="OLE"&&r.internetMessageId===h.internetMessageId?!0:r.type==="BKS"&&h.type==="BKS"&&r.url&&h.url&&r.url===h.url?!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.copyMruSignals=function(i,r,u){t.qfMode==3&&(i==n.MRUDataSource||i=="MPP"||i=="MST"||i=="MFF")&&(r.hasMruData=u.hasMruData)},i.prototype.rank=function(i,u,f,e,o,s,h,c){var at,bt=this,y,nt,et,it,ht,ct,rt,b,ut,d,wt,lt,k;t.isL2(e)&&(h=!1);y=null;n.isDataSourceEnabled("WRS",e)&&(y=f.WRS);y||(y=f[n.WebDataSource]);var ft=y?y.rankingSignals:null,kt=y?y.webTopResultRoutingType:1,g=f[n.MRUDataSource],vt=null,a=null,yt=null;ft&&(ft.WebSignalsAvailable=!0,vt=y.engagementSignals,a=y.suppressedGroups,(t.config.groupsToNeverFullySuppress||[]).length>0&&a&&(a.fullySuppressedGroups||[]).length>0&&(nt=[],et=[],a.fullySuppressedGroups.forEach(function(i){n.contains(t.config.groupsToNeverFullySuppress,i)?nt.push(i):et.push(i)}),nt.length>0&&(a=l(a),a.fullySuppressedGroups=et,(at=a.partiallySuppressedGroups).push.apply(at,nt))));this._previousKeystrokeCache&&(yt=this._previousKeystrokeCache.getPreviousEventWebSignalsData(e.queryToFetch));var dt=g?g.SuggestionEngagementData:null,gt=g?g.LookupCompletions:null,ni={cvid:this._host.getConversationId(),privacyNumber:this._host.getPrivacyNumber()},p=this.getSyntheticSuggestions(e,s);u=u.slice();a&&(a.fullySuppressedGroups&&a.fullySuppressedGroups.length>0&&(u=u.filter(function(t){return!n.contains(a.fullySuppressedGroups,String(bt.getGroupTypeForSuppressions(t)))})),a.suppressedSuggestions&&a.suppressedSuggestions.length>0&&(u=u.filter(function(i){return!n.contains(a.suppressedSuggestions,t.getSuggestionKey(i))})));i.length==0&&p.protocol&&u.unshift(p.protocol);var ot=o.length==1&&o[0].childSuggestions&&o[0].childSuggestions.some(function(n){return n.displayed}),pt=this.getSuggestionsToRank(ot,i,u,p,s),tt=this._ranker.rank(e,pt,ft,dt,gt,vt,ni,yt,c,p);this._previousKeystrokeCache&&!h&&this._previousKeystrokeCache.updateSpellerTriggerData(e.queryToFetch,pt);i.length==0&&p.recourse&&u.push(p.recourse);var v=this.determineTopResults(o,u,tt,p,e,s,ot),st=i.filter(function(t){return!n.contains(o,t)}),w=this.determineSuggestionsToAddToGroups(st,u,o,v,p,e,ot,h);if(tt.mruSuppressions&&tt.mruSuppressions.backPropDataExists&&!t.shouldRenderFlatListWithoutGroups(e))this.applyMRUSuppressions(tt,o,v,w,e);else if(a&&a.partiallySuppressedGroups&&this.canPartiallySuppressGroups(v,w))for(it=0,ht=w;it=0&&(b.splice(d,1),b.unshift(ut)),d=b.findIndex(function(n){return t.isTopHitChildGroup(n)}),d>=0&&(wt=b[d],b.splice(d,1),b.unshift(wt))),t.shouldRenderFlatListWithoutGroups(e)&&(v=v.concat(w.filter(function(n){return!n.suppressed})),w=[],t.qfMode==3&&v.length>0&&v[0].handoffType!=0&&v[0].handoffType!=1&&v[0].handoffType!=10&&!v[0].hasMruData&&(lt=v.findIndex(function(n){return n.handoffType==0||n.handoffType==1||n.handoffType==10}),lt>0&&(k=v.splice(lt,1),v.unshift(k[0]))),n.trimList(v,t.maxSuggestionsWhenFlatList,function(t){return!n.contains(i,t)&&!t.notAResult}),rt.length!=0))throw new Error("Can't remove suggestions from groups when there are no groups");return{topResults:v,suggestionsToAdd:w,suggestionsToRemove:rt,groupOrder:b}},i.prototype.applyMRUSuppressions=function(i,u,f,e,o){var c,l,a,h,s;if(this.canPartiallySuppressGroups(f,e))for(c={},l=0,a=e;l1&&!t.isL2(o))return i;for(l=t.config.forceVoiceFlowOnTopHit?[]:f.topResults,b=this._previewPane?this._previewPane.getPreviewedSuggestionToForceTopHit():null,b&&this._ranker.allowInTopHit(o,b)&&(y=function(n){return t.isEquivalentForPreviewPanePurposes(o,b,n)},p=l.findIndex(y),p!=0&&(w=void 0,p>0?(w=l[p],l.splice(p,1)):w=i.find(y)||u.find(y)||(e.searchTheWeb?[e.searchTheWeb]:[]).find(y),w&&l.unshift(w))),e.protocol&&e.searchTheWeb&&this._ranker.allowInTopHit(o,e.protocol)&&n.tryRemove(l,e.searchTheWeb),e.searchTheWeb&&(g=l.indexOf(e.searchTheWeb),g>=0&&l.some(function(n){return n!=e.searchTheWeb&&r(n,o)})&&l.splice(g,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)),nt=t.getEffectiveScope(o)==t.Scope.Emails?t.config.maxNumberOfEmailsInTopResult:Math.max(t.config.maxNumberOfTopResults,h(l)?2:0,i.length),l.length>nt&&(l=l.slice(0,nt)),k=i.length-1;k>=0;--k)v=i[k],n.contains(l,v)||(v.useRaf&&(v.useRaf=!1),v!=e.searchTheWeb&&u.unshift(v));return l.length==1&&n.safeExecute(function(){return it.applyAppOverride(l,u)},"applyDeviceInfoOverride"),l.forEach(function(n){return n.suppressed=!1}),t.config.stickyTopResultsV2&&l.length==1&&i.length==1&&!t.isL2(o)&&(tt=l[0],d=i[0],tt==d||a(d)||l.unshift(d)),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=0;--a)l.splice(a,1);return o.searchTheWeb&&(v=e.indexOf(o.searchTheWeb),v!=-1&&(y=n.removeFirstWhere(l,function(n){return r(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,u,f,e,o){var s,h;i.searchTheWeb&&(n.scope==t.Scope.Web||n.scope==t.Scope.All)&&(s=o.findIndex(function(t){return r(t,n)}),f.some(function(t){return r(t,n)})||u.some(function(t){return r(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,c,e,o,l,s,v,h,a,u;switch(n.scope){case t.Scope.Web:if(!n.queryToFetch)return[{type:t.GroupType.EdgeHistory},{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}]}for(f=r.concat(i),f.sort(function(n,t){return t.rankingScore-n.rankingScore}),c=[],e=[],o=0,l=f;o0&&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,r){var u,f;return t.shouldRenderFlatListWithoutGroups(r)?!1:n.length!=1?!1:(u=n[0],t.alwaysWide&&t.supportsPreview(u)!=1)?!1:i?this._renderedTopResults.topResults.length==1?(f=this._renderedTopResults.topResults[0],f.hasChildSuggestionsDisplayed&&f.query==u.query&&t.getGroupType(f)==t.getGroupType(u)):!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;ui&&this.scrollToElement(r,_d.body,i)},f.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=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(!1)},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;r0},r.prototype.dismiss=function(){this._contextMenuItems&&(this._contextMenuItems=null,this._selectedItem=null,this._page.updateContextMenuView([],this._showIcons,this._itemClickHandler),this._contextMenuContainer.classList.remove(i),t.setVisibility(this._contextMenuContainer,!1),this._root.style.minHeight="",this.adjustHeight());this._onDismiss&&(this._onDismiss(),this._onDismiss=null)},r.prototype.getMargin=function(){return this._margin==null&&(this._margin=parseInt(getComputedStyle(this._contextMenuContainer.firstElementChild).getPropertyValue("margin-left"))||0),this._margin},r.prototype.adjustPosition=function(n,t){if(this._contextMenuItems){var r=this._contextMenuContainer,i=r.parentElement,f=this.getMargin(),u=r.offsetWidth;u>i.offsetWidth&&(u=i.offsetWidth,r.style.width=u+"px");var e=r.offsetHeight,s=n+u>i.offsetWidth?Math.max(n-u+f,i.offsetLeft):n-f,o=t+e>i.offsetHeight?Math.max(i.offsetHeight-e,i.offsetTop):t-f;r.style.left=s+"px";r.style.top=o+"px";this._root.style.minHeight=o+e+"px";this.adjustHeight()}},r.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};return f.isSeparator||(f.click=function(f,e,o){r(i.verb,f,e,o);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})},r}();t.ContextMenu=r})(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=60,u=function(){function u(n){var t=this;this._tokenStore=n;this._pendingCallbacks={};i.addEventListener("experiencelaunched",function(){i.experienceId=="NotebookOffline"&&t._tokenStore.clear()})}return u.prototype.getAccount=function(n,i,r,u,f,e){var s=this,o,h;if(!t.config.wamSupported)throw new Error("getAccount can be called only in RS3+");if(!i)throw new Error("Resource or Scope has to be set");if(o=i+r+u+e,this._pendingCallbacks[o]){this._pendingCallbacks[o].push(f);return}this._pendingCallbacks[o]=[f];h=function(n){var t=s._pendingCallbacks[o];s._pendingCallbacks[o]=null;t.forEach(function(t){return t(n)})};this.authenticate(n,i,r,u,e,h)},u.prototype.authenticate=function(u,f,e,o,s,h){var v=this,p=e?0:r,a=f+s,y=this._tokenStore.findAccount(a,p),c,l;o&&y?h(y):(c=function(){return h(null)},n.isBrowserOnline()?(l=i.authenticationManager.createAuthenticateRequest(),l.accountType=s,l.silentMode=o,u==1?l.resource=f:l.scope=f,t.Promise.safeChain("authenticateAsyncWAM",function(){return i.authenticationManager.authenticateAsync(l)},function(i){var l;if(t.config.th&&(f=="https://outlook.office.com/autosuggest"||f=="https://substrate.office.com"||f=="https://substrate.office.com/SubstrateSearch-Internal.ReadWrite"))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(i.token){var r=void 0,e=i.properties,s=e.UPN||i.userName;if(u==1?r=s:i.accountId&&(r=i.accountId+"@84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa"),!r||!s){n.log("WAM didn't return UPN");c();return}l={Token:i.token,ExpireDateTime:e.exp?parseInt(e.exp)*1e3-3e5:null,TenantName:e.tenant_display_name||"",RoutingHint:r,UserName:s};u==0&&(l.ExpireDateTime=n.getCurrentTime()+36e5);v._tokenStore.setToken(l,a);h(v._tokenStore.findAccount(a))}else i.errorCode||i.errorMessage?n.log("WAM error "+i.errorCode+": "+i.errorMessage):n.log("WAM returned an empty token"),c()},c)):c())},u}();t.AccessTokenManager=u})(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;r0&&(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.length0){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++