t.maxInput?e.hide():(e.model.fetch(),e.triggered=!0))},hide:function(){var e=this,t=e.elems.saAria;g.removeClass(y.body,e.config.typingClass),e.clearAssist(),e.shown=!1,e.triggered=!1,t&&(g.set(t,"aria-expanded","false"),t.innerHTML="
"+e.config.saAria.closedText+"
"),e.app.notify(I)},clearAssist:function(){this.elems.saTray.innerHTML="",this.items.splice(0,this.items.length),this.assistItem=null},createItem:function(e){var t={idx:e.idx,data:e.origData},n=g.htmlEncode,o=this.config,i=this.app.createElem,r=i(o.saItem,"li");g.set(r,"pos",e.idx);var a=i(o.saTitle,"span");return a.innerHTML=e.t?e.t:o.boldTag&&e.k&&e.q?g.bold(o.boldTag,n(e.k),n(e.q),o.highlight||{}):n(e.k),r.appendChild(a),t.li=r,t.title=a,this.app.notify(L,[t,e]),t},resetQuery:function(){this.elems.sbInput.value=this.origQuery},reset:function(){var e=this,t=e.config,n=e.elems.sbForm;t.resetQuery&&e.resetQuery(),e.hide(),n.action=e.origAction,e.app.notify(S)},sameQuery:function(){return this.elems.sbInput.value==this.lastInput}},J),l.initConfig=function(){return{elems:{sbForm:"sb-form",sbInput:"sb-input",sbSubmit:"sb-search",sbClear:"sb-clr",sbCancel:"sb-cancel",saTray:"sa-tray"},customEvent:{},sa:{css:"sa",attrs:{type:"normal"}},saList:{css:"sa-list",attrs:{role:"listbox"},style:{cursor:"pointer"}},saItem:{css:"sa-item",attrs:{role:"option"}},saTitle:{css:"sa-item-title"},saAria:{shownText:"new suggestions shown",closedText:"Suggestion box closed",css:"sa-aria-live-region",attrs:{"aria-live":"polite"},style:{position:"absolute",left:"-9999px"}},saBE:{host:"",base:"/sugg/gossip/gossip-us-ura/",params:{l:1,bm:3,output:"sd1",nresults:10}},shBE:{host:"",base:"/history"},minInput:0,maxInput:255,boldTag:"{s}",ylc:{_r:2},ylcAssist:{use_case:""},hideOnOutsideClick:!0,noQueryClass:"sa-noQuery",typingClass:"typing"}},b.saFr=(ee.prototype={init:function(e){(this.app=e).on(C,$,this),e.on(M,Z,this),e.on(S,X,this)}},ee),b.ipos=(oe.prototype={init:function(e){(this.app=e).on(A,te,this),e.on(_,ne,this)}},oe),b.ylcEncode=(ae.prototype={init:function(e){(this.app=e).on(M,ie,this),e.on(P,re,this)}},ae),b.saTray=(ce.prototype={init:function(e){(this.app=e).on(E,se,this)}},ce),b.saSubTray=(fe.prototype={init:function(e){var t=this;t.app=e,t.sqpos=t.toleft=0,e.on(x,le,t),e.on(T,ue,t),e.on(k,de,t)}},fe),b.saPCActn=(ve.prototype={init:function(e){var t=this;t.app=e,t.selectedIndex=-1,e.on(w,pe,t),e.on(N,he,t),e.on(j,me,t),e.on(Y,ye,t)}},ve),b.tapClr=(be.prototype={init:function(e){(this.app=e).on(N,ge,this)}},be)}();var $e={"sa-sbx-container":"_yb_pqab1",sa:"_yb_1akny","sub-assist":"_yb_68cp9","no-wrap":"_yb_1u4sp","sa-tray":"_yb_1p2um","sa-tray-list-container":"_yb_1nv94","yui3-highlight":"_yb_5ttlc",lowlight:"_yb_7ecln","list-item-hover":"_yb_1cxc8","related-title":"_yb_1jng3","trending-title":"_yb_xtx9l","sa-fd-actn-cont":"_yb_1siub","suggestion-title":"_yb_12z47","bot-search-item":"_yb_1vzzh","bot-search-item-col":"_yb_wh2n4","bot-search-icon-container":"_yb_1h6h2","bot-search-span":"_yb_e4dd7","bot-search-icon":"_yb_1jt4f"},Ze={boldTag:'{s}',customEvent:{customBtn:"searchBtnClicked",customKeyBoard:"enterKeyPressed",customSelection:"assistSelectionClicked"},elems:{sbForm:"ybar-sf",sbInput:"ybar-sbq",sbSubmit:"ybar-search",sbClear:"ybar-sbq-x",sbCancel:"ybar-search-back-btn"},hightlight:{exact:!0,pattern:"^"},minInput:1,sa:{css:$e["sa-tray"]},saBE:{base:"",host:"",params:{appid:"yfp-t"}},saItem:{css:""},saList:{css:$e["sa-tray-list-container"]},saTitle:{css:"",style:{display:"block"}},plugins:{saFr:{fr:""},saTray:{afterNode:"ybar-sbq",ctn:{css:$e["sa-sbx-container"]},tray:{css:$e.sa+" "+$e.lowlight}},saPCActn:{css:$e["list-item-hover"]},ylcEncode:{disable:!0},saImg:{disable:!0},saEdit:{disable:!0},saPopup:{disable:!0},saSubTray:{disable:!0}}},Xe=function(e,t,n){var o=document.createElement("div");o.className=n["bot-search-item"];var i=document.createElement("div"),r=document.createElement("div");i.className=n["bot-search-item-col"],r.className=n["bot-search-item-col"];var a=document.createElement("div");a.className=n["bot-search-icon-container"];var s=document.createElementNS("http://www.w3.org/2000/svg","svg"),c=document.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("width","20"),s.setAttribute("height","20"),s.setAttribute("viewBox","0 0 24 24"),s.classList.add(n["bot-search-icon"]),c.setAttribute("d","M3.7634,15.837 L6.1814,15.837 C6.5214,17.45 7.0614,18.891 7.7584,20.045 C6.0094,19.118 4.6024,17.637 3.7634,15.837 L3.7634,15.837 Z M2.9144,12.008 C2.9144,11.351 2.9844,10.711 3.1164,10.094 L5.8884,10.094 C5.8264,10.717 5.7864,11.354 5.7864,12.008 C5.7864,12.663 5.8264,13.299 5.8884,13.922 L3.1164,13.922 C2.9844,13.305 2.9144,12.665 2.9144,12.008 L2.9144,12.008 Z M7.7584,3.971 C7.0614,5.125 6.5214,6.566 6.1814,8.179 L3.7634,8.179 C4.6024,6.379 6.0094,4.898 7.7584,3.971 L7.7584,3.971 Z M11.0504,3.142 L11.0504,8.179 L8.1054,8.179 C8.6604,5.664 9.7414,3.771 11.0504,3.142 L11.0504,3.142 Z M12.9654,3.142 C14.2754,3.771 15.3564,5.664 15.9114,8.179 L12.9654,8.179 L12.9654,3.142 Z M20.2524,8.179 L17.8344,8.179 C17.4954,6.566 16.9544,5.126 16.2574,3.971 C18.0064,4.898 19.4144,6.379 20.2524,8.179 L20.2524,8.179 Z M11.0504,20.875 C9.7414,20.245 8.6594,18.352 8.1054,15.837 L10.1354,15.837 C10.2104,15.161 10.3914,14.519 10.6584,13.922 L7.7984,13.922 C7.7354,13.305 7.7004,12.665 7.7004,12.008 C7.7004,11.351 7.7354,10.711 7.7984,10.094 L11.0504,10.094 L11.0504,13.184 C11.5394,12.388 12.1904,11.702 12.9654,11.183 L12.9654,10.094 L20.8994,10.094 C21.0284,10.697 21.0964,11.323 21.0994,11.964 L21.0994,11.964 L21.0994,12.661 C21.0994,13.19 21.5284,13.618 22.0574,13.618 L22.0584,13.618 C22.5874,13.618 23.0164,13.19 23.0164,12.661 L23.0164,11.965 L23.0144,11.965 C22.9904,5.662 17.6704,0.608 11.2724,1.024 C5.8994,1.373 1.4994,5.676 1.0414,11.04 C0.5134,17.228 5.1074,22.463 11.0504,22.975 C11.1664,22.985 11.3274,22.993 11.4844,22.999 C11.8104,23.012 12.1194,22.85 12.2904,22.572 L12.2924,22.569 C12.5734,22.113 12.3964,21.514 11.9124,21.284 L11.0504,20.875 Z M15.9434,18.874 C14.6054,18.874 13.5214,17.79 13.5214,16.452 C13.5214,15.115 14.6054,14.03 15.9434,14.03 C17.2804,14.03 18.3654,15.115 18.3654,16.452 C18.3654,17.79 17.2804,18.874 15.9434,18.874 M21.6354,20.908 L19.4524,18.725 C19.8774,18.07 20.1264,17.291 20.1264,16.452 C20.1264,14.145 18.2584,12.274 15.9514,12.269 L15.9354,12.269 C13.6284,12.274 11.7604,14.145 11.7604,16.452 C11.7604,18.763 13.6324,20.635 15.9434,20.635 C16.7814,20.635 17.5614,20.386 18.2154,19.961 L20.3984,22.144 C20.7404,22.486 21.2934,22.486 21.6354,22.144 C21.9774,21.803 21.9774,21.249 21.6354,20.908"),s.appendChild(c),a.appendChild(s),i.appendChild(a);var l=document.createElement("span"),u=document.createElement("span");u.className=n["bot-search-span"];var d=document.createElement("span"),f=e.split("{query}");return l.textContent=f[0]||"",u.textContent=t,d.textContent=f[1]||"",r.appendChild(l),r.appendChild(u),r.appendChild(d),o.appendChild(i),o.appendChild(r),o},et=function(e){var t=new RegExp("[?&]"+e+"=([^]*)").exec(window.location.search);return t?t[1]:null},tt=function(e,t,n){var o=e.querySelectorAll(t);if(o)for(var i=0;i=0?(i="srch-asst",c=!0,s=t.detail.data.idx+1):i="kybrd":i="botSearchClicked"===t.type?"sitesrch":"icon","homepage"!==n&&"my"!==n||!a&&!c?"smartphone"===o&&(ot(e,o,c),it(e,c)):(nt(e,a,c),ot(e,o,c),it(e,c)),"ngy"===n&&(a||c)&&nt(e,a,c),h(rt(i,"0",s.toString())))},d=function(t){var i=!!document.querySelector(".modal-open"),r=!0,a=(t.detail&&t.detail.data&&t.detail.data.idx||0)+1;"homepage"===n||"my"===n?(nt(e,i,r),ot(e,o,r),it(e,r)):"smartphone"===o&&(ot(e,o,r),it(e,r)),"ngy"===n&&nt(e,i,r),h(rt("srch-asst","0",a.toString()))},f=function(e){if("function"==typeof t.beaconClick&&9!==e.keyCode&&13!==e.keyCode&&1===l){t.saveCurrentTimerValue("search_input_keyboard_input");var n=rt("keystroke","1");l++,t.beaconClick(n.sec,n.slk,n.pValue,n.clickParams)}},p=function(){t.saveCurrentTimerValue("search_input_focus_click")},h=function(n){if("function"==typeof t.beaconClick){t.saveCurrentTimerValue("search_query_submit");var o={pp:{A_utm:t.getPerformanceI13nObject()}};t.beaconClick(n.sec,n.slk,n.pValue,n.clickParams,void 0,(function(){setTimeout((function(){e&&e.submit()}),300)}),o)}else e&&e.submit()};function m(){this.config={botSearch:{action:a,text:c||""},suggestionTitle:{text:s||""}}}function y(e){var t=this.config,n=this.app.view,o=n.elems.sbForm,i=n.elems.sbInput.value,r=at($e,t.suggestionTitle.text),a=Xe(t.botSearch.text,i,$e);a&&(e&&r&&(e.prepend(r),e.appendChild(a)),a.addEventListener("click",(function(){t.botSearch.action&&(o.action=t.botSearch.action),n.hide(),u(new CustomEvent("botSearchClicked"))})))}r&&(r&&(r.addEventListener("enterKeyPressed",u),r.addEventListener("assistSelectionClicked",d),r.addEventListener("searchBtnClicked",u),r.addEventListener("keydown",f),r.addEventListener("click",p)),"homepage"!==n&&"my"!==n&&"ngy"!==n||(nt(e),"homepage"===n&&st(e)),t.saveCurrentTimerValue("search_assist_ready")),m.prototype={init:function(e){this.app=e,e.on("after_update_list",y,this)}},a&&(null===(i=window.YAHOO.SA)||void 0===i||i.add("saBotSearch",m))}(t.searchBox,{beaconClick:Z,saveCurrentTimerValue:ae,getPerformanceI13nObject:se},o,i),window.YAHOO.SA.init(n);else{var a="Search lib not found. SearchAssist failed to initialise";e.logError(a,new Error(a))}},ut={boldTag:'{s}',clearButtonId:"ybar-sbq-x",suppressEmptyQuery:!0,anykey:!0,autofocus:!0,enableYlc:!1,fr2:"sa-gp-ybar",searchBoxId:"ybar-sbq",cssClass:{container:$e["sa-sbx-container"],trayContainer:$e.sa+" "+$e.lowlight,tray:$e["sa-tray"],traySub:$e["sa-tray"]+" "+$e["sub-assist"]+" "+$e["no-wrap"],ul:$e["sa-tray-list-container"],liHighlight:$e["list-item-hover"],li:"",span:"",text:"",aria:"",actionContainer:$e["sa-fd-actn-cont"],relatedSearches:$e["related-title"],trendingNow:$e["trending-title"]}},dt=t(pe),ft=n((function(e){var t=function(e,t){var n=function(){if("Microsoft Internet Explorer"===e.navigator.appName){var t=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(e.navigator.userAgent);return t&&t[1]&&parseFloat(t[1])}return!1}();function o(e,t){e.prototype=Object.create?Object.create(t.prototype):function(e){function t(){}return t.prototype=e,new t}(t.prototype),e.prototype.constructor=e}function i(e){return"function"==typeof e.trim?e.trim():e.replace(/^s+|s+$/gm,"")}function r(e){if(n&&n{s}",annotation:{},cssClass:{container:"sa-sbx-container",trayContainer:"sa lowlight",tray:"sa-tray",traySub:"sa-tray sub-assist no-wrap",ul:"sa-tray-list-container",liHighlight:"list-item-hover",li:"",span:"",text:"",aria:"sa-aria-live-region",actionContainer:"sa-fd-actn-cont",relatedSearches:"related-title",trendingNow:"trending-title"},text:{relatedSearches:"Related Searches",trendingNow:"Trending Now",ariaShown:"new suggestions shown",ariaClosed:"Suggestion box closed"},customEvent:!1,suppressEmptyQuery:!1,enableAnnotation:!1,enableIpos:!0,subAssist:!0,subTrayDelta:5,trayPadding:12,debug:!1,objectName:"SA",anykey:!1,clearBeaconing:!1,enableYlc:!0,autofocus:!1,highlight:{pattern:"",exact:!1},minQueryLength:0,enableTabRender:!0}}return e.YAHOO=e.YAHOO||{},c.prototype={set:function(e,t,n){e.setAttribute(t,n)},get:function(e,t){return e.getAttribute(t)},merge:function e(t,n){for(var o in n)"object"==typeof n[o]&&"object"==typeof t[o]?e(t[o],n[o]):t[o]=n[o]},extend:o,buildUrl:function(e,t){var n=[];for(var o in t)t.hasOwnProperty(o)&&n.push(encodeURIComponent(o)+"="+encodeURIComponent(t[o]));return n.length>0&&(e=e+(-1===e.indexOf("?")?"?":"&")+n.join("&")),e},stopPropagation:function(e){e.returnValue=!1,e.cancelBubble=!0,e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation()},setFocus:function(e){r(e),a(e)},cursorEnd:r,select:function(e,t,o){if(n&&n&]/gim,(function(e){return""+e.charCodeAt(0)+";"}))},ae:function(e,t,n,o){if(o||(o=!1),e.addEventListener)e.addEventListener(t,n,o);else{if(!e.attachEvent)return!1;e.attachEvent("on"+t,n)}},de:function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n);else{if(!e.detachEvent)return!1;e.detachEvent("on"+t,n)}},ts:function(){return Math.round((new Date).getTime()/1e3)},bold:function(e,t,n,o){var i,r,a=(o.pattern?o.pattern:"")+"(&[^;\s]*)?(%needles)";return(i=o.exact?[s(n)]:n.split(/[s|,]+/).filter((function(e){return""!==e})).sort((function(e,t){return t.length-e.length})).map((function(e){return s(e)}))).length?(a=a.replace("%needles",i.join("|")),t=t.replace(new RegExp(a,"gi"),(r=e,function(e,t,n){return t&&!/s/.test(n)?e:r.replace(/{s}/g,n)})),t):t},debug:function(t){this.config.debug&&e.console&&e.console.log&&e.console.log(t)}},o(l,c),l.prototype.init=function(n,o){var i=this;if(this.saModel=o,this.config=n,this.clearButton=this.clearButton||t.getElementById(this.config.clearButtonId),this.searchbox=this.searchbox||t.getElementById(this.config.searchBoxId),!this.searchbox)return!1;this.config.gossipParam.pq=this.searchbox.value;for(var r=this.searchbox;r&&!this.formTag;)r.tagName&&"form"===r.tagName.toLowerCase()&&(this.formTag=r),r=r.parentNode;return!!this.formTag&&(this.container=t.createElement("div"),this.container.className=this.config.cssClass.container,this.trayContainer=t.createElement("div"),this.trayContainer.className=this.config.cssClass.trayContainer,this.container.appendChild(this.trayContainer),this.searchbox.parentNode.insertBefore(this.container,this.searchbox.nextSibling),this.searchbox.setAttribute("role","combobox"),this.searchbox.setAttribute("aria-autocomplete","both"),this.ae(e,"load",(function(){i.aria=t.createElement("div"),i.aria.className=i.config.cssClass.aria,i.set(i.aria,"aria-live","polite"),i.aria.style.position="absolute",i.aria.style.left="-9999px",t.body.appendChild(i.aria)})),!0)},l.prototype.getWidth=function(e,n){var o,i={p:e,t:this.config.boldTag.replace("{s}",this.htmlEncode(e)),idx:0},r=t.createElement("div");r.className=this.config.cssClass.container;var a=t.createElement("div");a.className=this.config.cssClass.trayContainer,r.appendChild(a);var s=t.createElement("div");s.className=this.config.cssClass.traySub,s.style.left="-9999px",a.appendChild(s);var c=t.createElement("ul");c.className=this.config.cssClass.ul,s.appendChild(c);var l=this.createItem(i);n&&((o=t.createElement("span")).innerHTML=n,l.suggestionSpan.appendChild(o)),c.appendChild(l.li),this.searchbox.parentNode.insertBefore(r,this.searchbox.nextSibling);var u=l.suggestionSpan.clientWidth+this.config.subTrayDelta;return r.outerHTML="",u},l.prototype.display=function(n){var o=n.data,i=n.sqpos,r=n.hiddenNeedle,a=this,s={};this.hide(),this.selectedItem=!1,this.tray=t.createElement("div"),this.set(this.tray,"type","normal"),this.tray.className=this.config.cssClass.tray,i&&this.config.subAssist&&(this.tray.className=this.config.cssClass.traySub,this.tray.style.left=this.getWidth(r)+"px"),this.ul=t.createElement("ul"),this.ul.className=this.config.cssClass.ul,this.set(this.ul,"role","listbox"),this.tray.appendChild(this.ul),this.itemList=[],this.config.ylcParam.n_sugg=a.saModel.ylc.n_sugg,o.forEach((function(n){var o;if(n.idx=a.itemList.length,4===n.m&&a.config.text.trendingNow&&!s.trending){var r=t.createElement("span");r.className=a.config.cssClass.trendingNow,r.innerHTML=a.config.text.trendingNow,a.ul.appendChild(r),s.trending=!0}var c=a.createItem(n);!i&&a.config.enableAnnotation&&n.m&&a.config.annotation[n.m]&&n.fd&&(o=a.getItemAnnotation(n,c.suggestionSpan))&&c.suggestionSpan.appendChild(o),a.ul.appendChild(c.li),a.itemList.push(c.li),a.ae(c.li,"mouseenter",(function(e){a.resetHighlight(),c.li.className=a.config.cssClass.li+" "+a.config.cssClass.liHighlight,a.selectedItem=n.idx})),a.ae(c.li,"mouseleave",(function(e){c.li.className=a.config.cssClass.li})),a.ae(c.li,"click",(function(o){var i=a.searchbox.value,r=o.target||o.srcElement;a.saModel.ylc.pos=n.idx+1,a.saModel.ylc.pqstr=i,a.saModel.ylc.pqstrl=i.length,a.saModel.ylc.use_case="",a.formTag.fr2&&(a.formTag.fr2.value=a.config.fr2),a.searchbox.value=n.p,r.tagName&&"a"===r.tagName.toLowerCase()&&(a.searchbox.value=a.get(r,"data"),a.saModel.ylc.use_case=r.innerHTML),a.hide(),a.saModel.addYlc(a.saModel.clickTarget),a.config.customEvent?(a.saModel.addYlk(r),function(n,o,i){var r;"function"==typeof e.CustomEvent?(r=new e.CustomEvent(o,{detail:i}),n.dispatchEvent(r)):"function"==typeof t.createEvent?((r=t.createEvent("CustomEvent")).initCustomEvent(o,!1,!1,i),n.dispatchEvent(r)):(t.attachEvent,document.documentElement[o]=i)}(a.searchbox,"assistSelection",{data:n})):a.suggestionClick(o,n)}))})),this.aria&&(this.set(this.aria,"aria-expanded","true"),this.aria.innerHTML="
"+a.itemList.length+" "+this.config.text.ariaShown+"
"),this.show()},l.prototype.suggestionClick=function(e,t){this.formTag.submit()},l.prototype.show=function(){this.shown=!0,this.resetHighlight(),this.trayContainer.appendChild(this.tray)},l.prototype.hide=function(){this.aria&&(this.set(this.aria,"aria-expanded","false"),this.aria.innerHTML="
"+this.config.text.ariaClosed+"
"),this.shown=!1,this.resetHighlight(),this.trayContainer.innerHTML=""},l.prototype.resetHighlight=function(){!1!==this.selectedItem&&this.itemList.length&&(this.itemList[this.selectedItem].className=this.config.cssClass.li)},l.prototype.resetHightlight=l.prototype.resetHighlight,l.prototype.tab=function(){if(!this.shown||!this.itemList.length)return!1;if(!1!==this.selectedItem)this.searchbox.value=this.get(this.itemList[this.selectedItem],"data"),this.saModel.fetch();else{if(this.searchbox.value===this.get(this.itemList[0],"data"))return this.saModel.unset(),!1;this.searchbox.value=this.get(this.itemList[0],"data"),this.saModel.fetch()}return!0},l.prototype.moveUpDown=function(e){return!(!this.shown||!this.itemList.length)&&(this.resetHighlight(),e?!1===this.selectedItem||this.selectedItem=this.itemList.length-1?this.selectedItem=0:this.selectedItem++,this.itemList[this.selectedItem].className=this.config.cssClass.li+" "+this.config.cssClass.liHighlight,this.searchbox.value=this.get(this.itemList[this.selectedItem],"data"),!0)},l.prototype.createItem=function(e){var n=t.createElement("li"),o=this;if(n.className=this.config.cssClass.li,this.set(n,"pos",e.idx),this.set(n,"role","option"),this.config.formatResult){var i=this.config.ylcVal;i&&(i=i.replace("cposV",e.idx),o.config.ylcParam&&(i=i.replace("t9Val",o.config.ylcParam.n_sugg)),this.set(n,"data-ylk",i)),this.set(n,"data-position",e.idx)}o.set(n,"data",e.p);var r=t.createElement("span");r.className=o.config.cssClass.span,r.style.display="block",n.appendChild(r);var a=t.createElement("span");return a.className=o.config.cssClass.text,a.innerHTML=e.t,r.appendChild(a),{li:n,suggestionSpan:r}},l.prototype.getItemAnnotation=function(e){var n,o,i,r=this.config.annotation[e.m]||{},a=this.config.cssClass,s=e.fd,c="",l="",u=this.searchbox.clientWidth-2*this.config.trayPadding;if(r.subtitle&&s.subtitle){if(l=r.subtitle.replace("{subtitle}",this.htmlEncode(s.subtitle)),!(this.getWidth(e.p,l)'+l+"")>u){l="";break}l&&(c+=''+l+"")}return c&&((n=t.createElement("span")).innerHTML=c),n},o(u,c),u.prototype.unset=function(){this.triggered=!1,this.saView.hide()},u.prototype.jsonp=function(e,n){var o={command:this.saView.searchbox.value,t_stmp:this.ts(),callback:"YAHOO."+this.config.objectName+".cb."+e};this.merge(o,this.config.gossipParam),n&&this.merge(o,n);var i=this.buildUrl(this.config.saBase,o),r=t.getElementsByTagName("head")[0],a=t.createElement("script");this.set(a,"type","text/javascript"),this.set(a,"src",i),r.appendChild(a),this.ae(a,"load",(function(){r.removeChild(a)}))},u.prototype.read=function(e){var t,n=this,o=[],i=e.sqpos,r=e.q=e.q||"",a="";e&&"object"==typeof e.r&&e.r.length>0?(n.config.subAssist&&i&&(r=e.q.substr(i),a=e.q.substr(0,i),e.r.forEach((function(t){n.saView.getWidth(t.k)>n.saView.searchbox.clientWidth&&(i=0,r=e.q,a="")}))),e.r.forEach((function(e){t=n.config.subAssist&&i?e.k.substr(i):e.k,o.push({p:e.k,t:n.bold(n.config.boldTag,n.htmlEncode(t),n.htmlEncode(r),n.config.highlight),fd:e.fd,m:e.m})})),this.ylc.n_sugg=e.r.length,this.ylc.pos=0,this.saView.display({data:o,sqpos:i,hiddenNeedle:a})):(this.ylc.n_sugg=0,this.ylc.pos=0,this.saView.hide()),e&&e.l&&(this.ylc.gprid=e.l.gprid)},u.prototype.fetch=function(){var e,t=this.saView.searchbox,n=this,o=null,r=n.lastValue===n.saView.searchbox.value;if(n.config.suppressEmptyQuery&&""==i(t.value))return n.unset(),!0;if(n.saView.shown&&r)return!0;if(this.config.enableIpos&&!r&&void 0!==n.lastValue&&((e=this.getCursorPosition())===t.value.length&&(e=null),null!==e&&(o={ipos:e})),n.lastValue=n.saView.searchbox.value,this.config.minQueryLength&&this.saView.searchbox.value.lengththis.config.max)return this.unset(),!0;this.triggered=!0,this.callBackIdx++;var a="sacb"+this.callBackIdx;for(var s in n.cbTable)n.cbTable.hasOwnProperty(s)&&(n.cbTable[s]=function(){});this.cbTable[a]=function(e){n.read(e||{}),n.cbTable[a]=function(){}},this.jsonp(a,o)},u.prototype.getCursorPosition=function(){var e,n=this.saView.searchbox,o=null;return"number"==typeof n.selectionStart?o=n.selectionStart:t.selection&&(n.focus(),(e=t.selection.createRange()).moveStart("character",-t.activeElement.value.length),o=e.text.length),o},u.prototype.addYlc=function(e){var t=encodeURIComponent(this.saView.searchbox.value);this.ylc.query=t,this.ylc.qstrl=t.length,this.ylc.t_stmp=this.ts(),this.config.enableYlc&&this.ULT?this.saView.formTag.action=this.ULT.y64_token("ylc",e,this.ylc):this.debug("YLC logging is disabled")},u.prototype.addYlk=function(e){var t=this,n=[];if(["gprid","query","pqstr"].forEach((function(e){e in t.ylc&&n.push(e+":"+t.ylc[e])})),t.config.ylcVal=t.config.ylcVal+";"+n.join(";"),e){var o=t.get(e,"data-ylk")+";"+n.join(";");t.set(e,"data-ylk",o)}},u.prototype.init=function(t){return this.config=t,this.ULT=e.YAHOO.ULT,this.ULT||(this.debug("ULT library is missing. Disabling ylc logging"),this.config.enableYlc=!1),this.ylc={},this.merge(this.ylc,this.config.ylcParam),this.clickTarget=this.config.clkLink?this.config.clkLink:this.saView.formTag.action,this.submitTarget=this.saView.formTag.action,!0},o(d,c),d.prototype.init=function(o){var r=this;r.lastValue=null,this.config=o,this.config.autofocus&&this.setFocus(this.saView.searchbox),!n||n>=9?this.ae(this.saView.searchbox,"input",(function(e){r.saModel.fetch()})):8===n&&this.ae(this.saView.searchbox,"propertychange",(function(e){"value"===e.propertyName&&!1===r.saView.selectedItem&&r.saModel.fetch()})),r.config.anykey&&this.ae(t,"keydown",(function(e){var n=t.activeElement;if(!n.tagName||"input"!==n.tagName.toLowerCase()&&"textarea"!==n.tagName.toLowerCase())return 27===e.keyCode&&!r.saView.shown&&r.saView.searchbox.value.length?(r.select(r.saView.searchbox,0,r.saView.searchbox.value.length),void r.stopPropagation(e)):void(e.keyCode-1?o=i=l:(o=-u.moveStart("character",-l),o+=s.slice(0,o).split("n").length-1,u.compareEndPoints("EndToEnd",d)>-1?i=l:(i=-u.moveEnd("character",-l),i+=s.slice(0,i).split("n").length-1)),a.selectionStart=o,a.selectionEnd=i}r.lastValue!==r.saView.searchbox.value&&!1===r.saView.selectedItem&&r.saModel.fetch()};this.ae(this.saView.searchbox,"focus",(function(e){!r.saModel.triggered&&r.saModel.fetch(),n&&9===n&&!r.ie9_attached&&(r.ae(t,"selectionchange",a),r.ie9_attached=!0)})),this.ae(this.saView.searchbox,"blur",(function(e){n&&9===n&&r.ie9_attached&&(r.de(t,"selectionchange",a),r.ie9_attached=!1)})),this.ae(this.saView.searchbox,"click",(function(e){!r.saModel.triggered&&r.saModel.fetch()}));var s=function(e){if(r.saView.shown){for(var t=e.target?e.target:e.srcElement;t;){if(t===r.saView.formTag)return;t=t.parentNode}r.config.touchOriented&&r.stopPropagation(e),r.saModel.unset()}};return"ontouchstart"in e?(this.config.touchOriented=!0,this.ae(t.body,"touchstart",s,!0)):this.ae(t,"click",s),this.ae(this.saView.formTag,"submit",(function(e){r.saModel.addYlc(r.saModel.submitTarget)})),this.saView.clearButton&&this.ae(this.saView.clearButton,"click",(function(e){if(r.saView.searchbox.value="",r.saModel.triggered=!1,r.setFocus(r.saView.searchbox),r.config.enableYlc&&r.config.clearBeaconing&&r.saModel.ULT){var t={_r:2,actn:"clk",pos:1,sec:"clearsearch",slk:"clear",t1:"hdr",t2:"searchbox",t3:"clear"};r.merge(t,r.config.clrLog),r.saModel.ULT.beacon_click(t)}})),!0},o(f,c),f.prototype.saModelClass=u,f.prototype.saViewClass=l,f.prototype.saControlClass=d,f.prototype.init=function(o){return!(n&&n=200&&i.status=0;--t){e[t]=(i=void 0,(i={fn:(o=e[t]).fn||"",ln:o.ln||"",em:o.em||"",alias:o.alias||"",imageUrl:o.imageUrl,state:o.state,fullName:null,identifier:""}).fullName=function(e,t){for(var n=e+t,o=0;o40959)&&(i19903))return!1}return!0}(i.fn,i.ln)?[i.ln,i.fn].join(""):[i.fn,i.ln].join(" "),i.identifier=i.em||i.alias,i);var n=e[t].state;0!==n&&"0"!==n||e.splice(t,1)[0]}var o,i;return e}(i.users),u=3;if(window.YBAR){var d=window.YBAR.getConfig();(d.bucketConfig.homepage_show_saved_accounts_enabled||d.bucketConfig.show_sign_in_account_menu_enabled)&&(u=2)}for(var f=document.querySelector("."+bt["ybar-user-accounts-list"]),p=function(n){var o=function(e,t,n){var o=n.ybarAccMenuItemTemplate,i=n.crumb;if(o){var r=(t+1).toString(),a=o.getAttribute("data-signedOutState"),s=o.getAttribute("data-done")||"",c=Tt(o),l=c.children&&c.children[0];if(!l&&c.childNodes)for(var u=0;u0){var m=document.querySelector(r+" ."+bt["ybar-sign-out"]),y=m&&m.getAttribute("data-soa"),v=document.querySelector(r+" ."+bt["ybar-sign-out-text"]);if(v&&y&&(v.innerText=y),c&&c.classList.add(bt.show),n){var g=document.querySelector(r+" "+bt["ybar-icon-arrow"]),b=bt["ybar-icon-arrow-up"],_=bt["ybar-icon-arrow-down"],w=bt["ybar-item-hidden"],E=document.querySelectorAll("."+bt["ybar-item-hidden"]);g&&(g.classList.toggle(_),e.addElementListener(g,"click",(function(){for(var e=0;eu){var C=document.querySelector(r+" ."+bt["ybar-see-info"]);C&&C.style&&(C.style.display="block")}Lt(t,e)}else a&&(a.style.display="block")}))}},St=function(e,t){var n=t.ybarAccountContainer,o=t.smartphoneNotifContainer,i=t.notificationMenu,r=t.notifBadge,a=t.dropdownContainer,s=t.ybarNotificationBody,c=t.profNotifBadge,l=t.backButton,u=function(e){(null==e?void 0:e.newCount)&&e.newCount>0&&r&&(r.style.visibility="visible",c&&(c.style.visibility="visible",c.innerText=r.innerText))},d=z(),f=function(){d.refreshPanel().then(u).catch((function(){}))};if(o){f();var p=setInterval((function(){f()}),3e5);e.onDestroy((function(){clearInterval(p)})),e.addElementListener(i,"click",(function(){f(),a&&(a.style.display="block"),n&&(n.style.width="100%",n.scrollTop=0,n.style.overflow="hidden"),function(e){z().resetBadge(),e.notifBadge&&(e.notifBadge.style.visibility="hidden"),e.profNotifBadge&&(e.profNotifBadge.style.visibility="hidden")}(t),Z("ybar","notification","",{slk:"notification",elm:"btn",elmt:"visible"===(null==r?void 0:r.style.visibility)?"new alert":"",sec:"ybar",subsec:"notification",pkgt:"profile-pane",itc:"1"})})),e.addElementListener(l,"click",(function(){a&&(a.style.display="none"),n&&(n.style.width="",n.style.overflow=""),Z("ybar","back-notification","",{slk:"back-notification",elm:"arrow",pkgt:"profile-pane",sec:"ybar",subsec:"notification",itc:"1"})})),s&&e.addElementListener(s,"click",(function(e){(function(e){if("function"==typeof e.composedPath)return e.composedPath();if(e.path)return e.path;for(var t=e.target,n=[];null!==t.parentNode;)n.push(t),t=t.parentNode;return n.push(document,window),n})(e).find((function(e){var t=e;if(t.nodeName&&"a"===t.nodeName.toLowerCase()&&t.classList.contains("yns-link"))return a&&(a.style.display="none"),n&&(n.style.width="",n.dispatchEvent(new CustomEvent("toggle-overlay"))),!0}))}))}},It=!0,Nt=!1,Ot=0,Mt={ybarAccountImage:{selector:"ybar-account-img",size:"64"},ybarCurrentUserProfileImage:{selector:"ybar-current-user-profile-img",size:"128"},ybarUserProfileImage:{selector:"ybar-user-profile-img",size:"128"}},Bt=function(e,t){var n=t.ybarAccountContainer,o=t.ybarAccountMenu,i=t.ybarMobile,r=t.isSmartphone,a=t.ybarMenuManagePub,s=t.arrowWrapper,c=t.downArrow,l=t.upArrow,u=t.otherAccWrapper,f=t.signInAccountMenu,p=t.signInBtn,h=t.ybarModAccount,m=t.yahooPlusImpression,y=function(o){if(n)n.style.removeProperty("display"),"false"===n.getAttribute("data-enabled")&&(n.style.display="none"),Lt(t,e);else{var i=new Error("ybarAccountContainer not Found");d("ERROR:",i)}n&&It&&(It=!1,e.onDestroy((function(){It=!0})),At(e,t,o))},v=function(){var e,t;0===Ot&&(Ot=1,null===(e=null==o?void 0:o.parentNode)||void 0===e||e.removeEventListener("mouseenter",v),null===(t=null==o?void 0:o.parentNode)||void 0===t||t.removeEventListener("focusin",v),setTimeout((function(){ee()}),500))},g=function(){null==n||n.classList.remove("ybarMenuOpen"),null==o||o.setAttribute("aria-expanded","false")},b=function(){if(m&&!m.getAttribute("src")&&m.getAttribute("data-src")){var t=m.getAttribute("data-src")||"";He(t).then((function(e){m.setAttribute("src",e)})),e.onDestroy((function(){m.setAttribute("src","")}))}};if(p&&(Te(e,p,"ybar","sign-in",gt={elm:"signin",subsec:"settings",itc:"2"}),Lt(t,e)),o||i||f){if(i)y(!0);else{if(y(!1),e.addEventListener("close-all-menus",(function(){o&&!Ce(o)?o.checked=!1:f&&f.classList.contains(bt.show)&&f.parentNode&&!Ce(f.parentNode)&&g()})),e.onDestroy((function(){g()})),o){if(o.onchange=function(){e.triggerEvent("close-all-menus")},gt={itc:"2",elm:"menu",elmt:"user-info",subsec:"accounts"},r){var _=document.querySelector("#ybarAccountMenuOpener");_&&_.setAttribute("data-ylk","slk:Settings;elm:btn;sec:ybar;subsec:settings;pkgt:profile-pane;itc:0;tar:login.yahoo.com"),function(){n&&function(e,t,n,o){var i,r,a=e||document.body,s=document.createElement("div");s.classList.add(_t.overlay),s.setAttribute("data-hidden","true"),null===(r=null===(i=a.parentNode)||void 0===i?void 0:i.parentNode)||void 0===r||r.appendChild(s),a.classList.add(_t.animation);var c=document.documentElement,l=!0,u=0,d=function(){l=!l,s.setAttribute("data-hidden",""+l),null==c||c.classList.toggle("ybar-overlay"),document.body.classList.toggle(_t.noscroll,!l),a.classList.toggle(_t[t+"-open"],!l),l?s.scrollTop=0:null==o||o.focus(),0===u&&(u=1,setTimeout((function(){ee()}),300))};n.onDestroy((function(){var e,t;null===(t=null===(e=a.parentNode)||void 0===e?void 0:e.parentNode)||void 0===t||t.removeChild(s),a.classList.remove(_t.animation),l||d()})),n.addElementListener(a,"toggle-overlay",(function(){d()})),n.addElementListener(s,"mousedown",(function(){d()}))}(n,"right",e);var t=document.querySelector("."+bt["ybar-icon-image-wrapper"]);e.addElementListener(t,"click",(function(){null==n||n.dispatchEvent(new CustomEvent("toggle-overlay"))}))}(),e.addElementListener(s,"click",(function(){var e,t;Nt?(null==c||c.classList.remove("hide"),null==l||l.classList.add("hide"),u&&(u.style.height="0")):(null==c||c.classList.add("hide"),null==l||l.classList.remove("hide"),u&&(t=(e=u).scrollHeight,e.style.height=t+"px"));var n="manage-account-open",o={elm:"expand",subsec:"settings",pkgt:"profile-pane",itc:"1"};(Nt=!Nt)||(n="manage-account-close",o.elm="btn"),Z("ybar",n,"",o)})),St(e,t)}else{var w=document.querySelector("#ybarAccountMenu + label");w&&(Te(e,w,"ybar","profile-expand",gt),e.addElementListener(w,"mouseenter",b),e.addElementListener(h,"focus",b)),o&&o.parentNode&&(e.addElementListener(o.parentNode,"mouseenter",v),e.addElementListener(o.parentNode,"focusin",v))}ke("#ybarAccountMenu","#ybarAccountMenu + label",e)}e.addElementListener(n,"focusin",(function(){null==n||n.classList.add("ybarMenuOpen"),null==o||o.setAttribute("aria-expanded","true")})),e.addElementListener(n,"focusout",g),e.addElementListener(a,"click",g)}Object.keys(Mt).forEach((function(e){var t=Mt[e],n=document.querySelector("."+bt[t.selector]);n&&(n.onerror=function(){var e,o,i;e=t.size,i="https://s.yimg.com/wm/modern/images/default_user_profile_pic_"+e+".png",(o=n).onerror=null,o.srcset="",o.src=i})}))}};be("ybar-account-init",(function(e){var t=document.getElementById("ybarAccountContainer"),n={ybarAccountContainer:t,ybarAccountMenu:document.getElementById("ybarAccountMenu"),ybarMobile:document.querySelector("."+bt.mobile+" ."+bt["ybar-account-user-email"]),isSmartphone:document.querySelector("."+bt.smartphone),ybarMenuManagePub:document.getElementById("ybarMenuManagePub"),arrowWrapper:document.getElementById("smartphone-arrow"),downArrow:document.getElementById("down-arrow"),upArrow:document.getElementById("up-arrow"),otherAccWrapper:document.getElementById("otherAccWrapper"),signInAccountMenu:document.querySelector("."+bt["ybar-mod-account"]+" ."+bt["sign-in-menu"]),signInBtn:document.querySelector("."+bt["ybar-mod-account"]+" ."+bt["ybar-login-btn"]),ybarModAccount:document.querySelector("."+bt["ybar-mod-account"]),yahooPlusImpression:t&&t.querySelector("."+bt["ybar-account-yahoo-plus-imp"]),crumb:document.querySelector('input[name="crumb"]'),ybarAccMenuItemTemplate:document.getElementById("ybarAccMenuItemTemplate"),generalSignin:document.getElementById("generalSignin"),inSessionSignin:document.getElementById("inSessionSignin"),smartphoneNotifContainer:document.getElementById("smartphoneNotifContainer"),notificationMenu:document.getElementById("smartphoneNotifMenu"),notifBadge:document.getElementById("notif-badge"),profNotifBadge:document.querySelector("."+bt["prof-notif-badge"]),dropdownContainer:document.getElementById("notifDropdownContainer"),ybarNotificationBody:document.getElementById("ybarNotificationBody"),backButton:document.getElementById("backButton")};Bt(e,n)}));var qt,Pt,Rt={"ybar-mod-mail":"_yb_st984","ybar-mail-preview":"_yb_41f22 _yb_9o6cq","ybar-mail-link":"_yb_w5efe",smartphone:"_yb_1of3n","ybar-mail-icon":"_yb_1myv4","property-homepage":"_yb_1mr74","ybar-unread":"_yb_2lkx1","property-member-center":"_yb_bbjw0","property-help":"_yb_1oabx",mobile:"_yb_tca56",count:"_yb_17hn1","ybar-mail-icon-text":"_yb_1cdy6","ybar-text-wrap":"_yb_19xrv","ybar-text-bold":"_yb_1lgvz","ybar-mail-signin":"_yb_tlgd8","ybar-mail-loading":"_yb_13spm","ybar-mail-signin-link":"_yb_13o01","popover-arrow-off-white":"_yb_1e47m","popover-arrow-purple":"_yb_66jup","popover-body":"_yb_4v8hv _yb_mxofh","ybar-mail-list":"_yb_1onex","ybar-mail-item":"_yb_beojw","ybar-mail-item-link":"_yb_1hc4a","ybar-mail-item-name":"_yb_18bzg","ybar-mail-item-desc":"_yb_4reg6","ybar-mail-item-image":"_yb_1qwc2","ybar-mail-item-unread":"_yb_1a4m4","ybar-mail-bottom-wrapper":"_yb_1th5x","ybar-mail-compose-link":"_yb_19na4","ybar-icon-compose":"_yb_1bvl3","ybar-compose-link-text":"_yb_ycfog","mail-animation":"_yb_pslz3","ybar-mail-item-snippet":"_yb_mnf2a","ybar-mail-item-time":"_yb_13h9x","ybar-mail-viewall":"_yb_609n2","ybar-mod-mail-promo":"_yb_yt4cr","ybar-mod-mail-promo-light":"_yb_etxyw","ybar-mod-mail-promo-inner":"_yb_1ueuj","ybar-mod-mail-promo-lbl":"_yb_12vyp","ybar-mod-mail-promo-logo":"_yb_1qc12","ybar-mod-mail-promo-cta":"_yb_9d3kr","ybar-mod-mail-promo-imp":"_yb_umqci"};!function(e){e[e.COUNT=0]="COUNT",e[e.PREVIEW=1]="PREVIEW"}(qt||(qt={})),function(e){e[e.PENDING=0]="PENDING",e[e.COMPLETE=1]="COMPLETE"}(Pt||(Pt={}));var Vt=new Map,Dt=function(e){var t=Vt.get(e);if(t){if(t.status===Pt.PENDING)return t.promise;var n=Date.now()-12e4;return t.data&&t.lastRequested>n?Promise.resolve(t.data):void 0}},jt=function(e,t){var n={lastRequested:Date.now(),status:Pt.COMPLETE,promise:Promise.resolve(t),data:t};Vt.set(e,n)},Ht=function(e,t){var n={lastRequested:Date.now(),status:Pt.PENDING,promise:t};Vt.set(e,n)},Yt=function(){function e(){}return Object.defineProperty(e.prototype,"wssid",{get:function(){var e,t,n=null===(e=window.YBAR)||void 0===e?void 0:e.wssid;return n||(n=(null===(t=document.querySelector('input[name="mail_wssid"]'))||void 0===t?void 0:t.value)||"",this.wssid=n),n},set:function(e){window.YBAR=window.YBAR||{},window.YBAR.wssid=e||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"appid",{get:function(){var e,t,n=null===(e=window.YBAR)||void 0===e?void 0:e.appid;return n||(n=(null===(t=document.querySelector('input[name="mail_appid"]'))||void 0===t?void 0:t.value)||"",this.appid=n),n},set:function(e){window.YBAR=window.YBAR||{},window.YBAR.appid=e||""},enumerable:!1,configurable:!0}),e.prototype.fetchPreview=function(e,t){var n=(void 0===e?{}:e).maxMessages,o=void 0===n?4:n;return _(this,void 0,void 0,(function(){var e,n,i,r=this;return w(this,(function(a){return e=Dt(qt.PREVIEW),!t&&e?[2,e]:(1,n={data:{responseType:"json",requests:[{id:"GetMailboxId",uri:"/ws/v3/mailboxes/",method:"GET",filters:{select:{mailboxId:"$..mailboxes[?(@.isPrimary==true)].id"}},suppressResponse:!0,requests:[{id:"ListMessages",uri:"/ws/v3/mailboxes/@.id==$(mailboxId)/messages/@.select==q?q=count%3A6+offset%3A0+folderType%3AINBOX+-sort%3Adate",method:"GET"}]}]}},i=this._fetch(n,1,(function(e){var t=r._normalizePreviewResponse(e,{maxMessages:o});return jt(qt.PREVIEW,t),t})),Ht(qt.PREVIEW,i),[2,i])}))}))},e.prototype.fetchCount=function(e){return _(this,void 0,void 0,(function(){var t,n,o,i=this;return w(this,(function(r){return t=Dt(qt.COUNT),!e&&t?[2,t]:(1,n={data:{responseType:"json",requests:[{id:"GetMailboxId",uri:"/ws/v3/mailboxes/",method:"GET",filters:{select:{mailboxId:"$..mailboxes[?(@.isPrimary==true)].id"}},suppressResponse:!0,requests:[{id:"ListDecos",uri:"/ws/v3/mailboxes/@.id==$(mailboxId)/decos",method:"GET"}]}]}},o=this._fetch(n,1,(function(e){var t=i._normalizerCountResponse(e);return jt(qt.COUNT,t),t})),Ht(qt.COUNT,o),[2,o])}))}))},e.prototype._fetch=function(e,t,n){var o,i;return _(this,void 0,void 0,(function(){var r,a,s,c,l,u,f,p,h,m,y,v,g,_,E;return w(this,(function(w){switch(w.label){case 0:if(r=e.data,a=void 0===r?{}:r,s=e.params,c=void 0===s?{}:s,l="EC-4008",u="EC-4003",f=this._getYmreqid(),!this.appid)throw new Error("No appId, user is logged out");p=b({appId:this.appid},c),this.wssid&&(p.wssid=this.wssid),e.params=p,h=[],Object.keys(p).forEach((function(e){var t=p[e];t&&h.push(encodeURIComponent(e)+"="+encodeURIComponent(t))})),m=h.length?"?"+h.join("&"):"",y="https://apis.mail.yahoo.com/ws/v3/batch"+m,w.label=1;case 1:return w.trys.push([1,4,,5]),[4,Ct(y,{method:"POST",body:JSON.stringify(a),credentials:"include",headers:{"Content-Type":"application/json","X-Oath-YmReqId":f}},f)];case 2:return[4,(v=w.sent()).json()];case 3:if(g=w.sent(),v.ok)return[2,n(null===(i=g.result)||void 0===i?void 0:i.responses)];if((_=null===(o=null==g?void 0:g.error)||void 0===o?void 0:o.code)===u)return[2,this._handleWssidApiError(g,e,t,n)];throw _===l?new Error("Session has expired"):new Error("Mail Api Responded with an Error");case 4:throw E=w.sent(),d("JWS: "+E.message,E),E;case 5:return[2]}}))}))},e.prototype._normalizePreviewResponse=function(e,t){var n,o,i,r=this,a=(void 0===t?{}:t).maxMessages,s=void 0===a?4:a;return e?((null===(i=null===(o=null===(n=null==e?void 0:e[0])||void 0===n?void 0:n.response)||void 0===o?void 0:o.result)||void 0===i?void 0:i.messages)||[]).map((function(e){return r._parseRawMessage(e)})).filter((function(e,t){return!!(e&&t0)return n-=1,this.wssid=a,this._fetch(t,n,o);throw new Error("Max retries with invalid WSSID reached")}throw new Error("valid WSSID missing from API Response")},e.prototype._parseRawMessage=function(e){var t,n,o,i,r,a,s=e.id,c=e.snippet,l=e.headers,u=e.flags;return(null==l?void 0:l.date)&&(null===(t=null==l?void 0:l.from)||void 0===t?void 0:t[0])?{from:(null===(o=null===(n=l.from)||void 0===n?void 0:n[0])||void 0===o?void 0:o.name)||"",email:(null===(r=null===(i=l.from)||void 0===i?void 0:i[0])||void 0===r?void 0:r.email)||"",subject:null==l?void 0:l.subject,read:null!==(a=null==u?void 0:u.read)&&void 0!==a&&a,mid:s,date:parseInt(l.date,10)||void 0,snippet:c||""}:null},e.prototype._getYmreqid=function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-xxxx-09xx-xxxxxxxxxx00".replace(new RegExp("x","g"),(function(){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),t.toString(16)}))},e}(),Ut=function(e,t,n){for(var o,i,r=[],a=[],s=0;s0&&function(e){var t=document.createElement("script");t.src=e,t.type="text/javascript",t.async=!0,document.getElementsByTagName("head")[0].appendChild(t)}(c))}),10)}},Ft=function(e){!function(e,t){var n=e.url,o=e.ymreqid,i=e.body;Ct(n,{method:"POST",headers:b({"Content-Type":"application/json"},"string"==typeof o?{"X-Oath-YmReqId":o}:{}),body:void 0!==i?JSON.stringify(i):null,credentials:"include"},o).then((function(e){return e.text().then((function(n){wt({status:e.status,responseText:n,ymreqid:o},t)}))}))}({url:"/fp_ngymtls_ms/_rcv/remote",body:{m_id:"react-wafer-mailpreview",m_mode:"json",ctrl:"MailPreview"}},(function(t,n){t||e(n)}))},Wt=!1,zt=!1,Gt=function(){zt||(zt=!0,Qt({slk:"Mail",elm:"expand",sec:"ybar",subsec:"mailprev",itc:"2"}),setTimeout((function(){zt=!1}),1e3))},Qt=function(e){Z("ybar",(null==e?void 0:e.slk)||"Mail","",e,null)},Kt=function(e,t,n,o){var i,r=Tt(t.ybarMailItemTemplate),a=null===(i=r.children)||void 0===i?void 0:i[0];if(!a&&r.childNodes)for(var s=0;s86400?Math.floor(t/86400)+"d":""}(n.date));var h=a.querySelector("."+Rt["ybar-mail-item-image"]);return h&&h.setAttribute("src","https://data.mail.yahoo.com/xobni/v4/endpoints/smtp:"+encodeURIComponent(n.email)+"/photo?psize=24X24&fallback_url=https%3A%2F%2Fs.yimg.com%2Fdh%2Fap%2Fsocial%2Fprofile%2Fprofile_a24.png&alphatar_photo=true&format=image"),a}},Jt=function(e,t){var n=t.impressionElem;if(n&&!n.getAttribute("src")&&n.getAttribute("data-src")){var o=n.getAttribute("data-src")||"";He(o).then((function(e){n.setAttribute("src",e)})),e.onDestroy((function(){n.setAttribute("src","")}))}},$t=function(e){var t,n;null===(t=e.mailPreview)||void 0===t||t.classList.add("ybarMenuOpen"),null===(n=e.mailLink)||void 0===n||n.setAttribute("aria-expanded","true")},Zt=function(e){var t,n;null===(t=e.mailPreview)||void 0===t||t.classList.remove("ybarMenuOpen"),null===(n=e.mailLink)||void 0===n||n.setAttribute("aria-expanded","false")},Xt=function(e,t,n){var o=t.mailUnread,i=t.mailUnreadSpan,r=t.isFuji2;n.fetchCount().then((function(t){if(o&&t>0){if(o.style.visibility="visible",i){var n=t>999,a=r?"99+":"999+";i.textContent=n?a:t+""}e.onDestroy((function(){o.style.visibility="hidden",i&&(i.textContent="")}))}})).catch((function(){}))},en=function(e,t,n){Wt||(Wt=!0,t.isNextGenYahoo?nn(e,t):tn(e,t,n))},tn=function(e,t,n){n.fetchPreview().then((function(n){var o;if(n&&0!==n.length){var i=document.createElement("ul");i.className=Rt["ybar-mail-list"];for(var r=0;r a"),o=document.querySelector("#ybar-navigation-item-mail > a > span");null!==t&&null!==n&&(new Yt).fetchCount().then((function(t){o&&t>0&&(o.textContent="("+(t>999?"999+":t)+")",e.onDestroy((function(){o.textContent=""})))})).catch((function(){}))},yn=-1,vn=function(e){var t=-1,n=0;if(e.ybarNav){for(var o=window.getComputedStyle(e.ybarNav),i=parseInt(o.width,10)-parseInt(o.paddingLeft,10)-parseInt(o.paddingRight,10),r=0;ri-61&&(r!==e.navItems.length-1||n+a>i||e.moreMenuDropdown&&e.moreMenuDropdown.hasChildNodes()&&ynyn&&-1!==yn)for(var c=yn;c=t;){var u=e.navItems[l].cloneNode(!0),d=u.querySelector("."+e.navigationDropdownListClass);d&&(d.style.display="none"),u.classList.remove(e.dropdownWrapperClass),u.classList.remove(e.ybarNavigationItemClass),u.classList.add(e.navigationDropdownItemClass),e.moreMenuDropdown&&e.moreMenuDropdown.insertBefore(u,e.moreMenuDropdown.firstChild),l--}yn=t}-1!==t&&e.navList&&(e.navList.style.maxWidth=parseInt(n.toString(),10)+"px"),e.moreMenuNavItem&&e.moreMenuDropdown&&e.moreMenuDropdown.hasChildNodes()?(e.moreMenuNavItem.classList.add(e.dropdownWrapperClass),e.moreMenuNavItem.style.visibility="visible"):null!==e.moreMenuNavItem&&(e.moreMenuNavItem.classList.remove(e.dropdownWrapperClass),e.moreMenuNavItem.style.visibility="hidden"),e.moreMenuDropdown&&e.moreMenuDropdown.childElementCount>10?e.moreMenuDropdown.classList.add(e.longListClass):null!==e.moreMenuDropdown&&e.moreMenuDropdown.classList.remove(e.longListClass)}},gn=function(e,t){e.onDestroy((function(){yn=-1,pn=0,t.moreMenuDropdown&&(t.moreMenuDropdown.innerHTML="")}));for(var n=function(n){!function(e){for(var t=0;t