(function(){var c=LIModules.imports("i18n"),l=function(){function e(b){return"function"===typeof b}function g(){h=c&&c.page&&c.page.readsRTL()}var k={left:"right",right:"left",ltr:"rtl",rtl:"ltr"},h;g();return{init:g,flip:function(b,d){var a;h?void 0===d?(a=b,a=e(a)?a():a,!0===a||!1===a||"[object Boolean]"===Object.prototype.toString.call(a)?a=!a:a&&k[a]&&(a=k[a])):a=e(d)?d():d:a=e(b)?b():b;return a},applyWhenRTL:function(b){return this.flip(null,b)},isRtl:function(b){function d(a,b){if(null===a)return!1;
var c=Array.prototype.indexOf;return c&&a.indexOf===c?-1!==a.indexOf(b):Array.prototype.some(a,function(a){return a===b})}if(void 0===b||null===b)return!1;for(var a=0,f,c=b.length,e=" \n\r\t\f\u00a0\u2028\u2029".split("").concat("~!@#$%^\x26*()_+`1234567890-\x3d{}|[]\\:\";'\x3c\x3e?,./".split(""));a<c&&(f=b.charAt(a),d(e,f));a++);return a>=c?!1:"\u0590"<=f&&"\u06ff">=f?!0:!1}}}();LIModules.exports("Bidi",l)})();LI.BidiInput=function(){function b(a){a=$(a.target);var c=h,b=a.attr(e),d;d=$(f).attr(e);var g=a.data("bidiEvent");if(a.val().length)d=a.val(),LI.BidiInput._isRtl(d)&&(c=k);else if(d)c=d;else{a.removeAttr(e);return}if("undefined"===typeof b||b!==c)a.attr(e,c),g&&a.trigger(g,[c])}var e="dir",h="ltr",k="rtl",f="body",l=LIModules.requires("Bidi.isRtl");$(document).ready(function(){$(f).on("input propertychange BidiReset","textarea:not(.no-bidi-input), input:not(.no-bidi-input)",b)});return{_updateDir:b,
_isRtl:l,EVENT_RESET:"BidiReset"}}();(function(){function c(b,a){return b.x(a.get(["categoryName"],!1),a,{block:d},{}).w("\x3cspan").x(a.getPath(!1,["misc","actionType"]),a,{block:e},{}).w('\x3e\x3ca id\x3d"').x(a.get(["sourceID"],!1),a,{block:f},{}).w("item-").f(a.get(["rank"],!1),a,"h").w('" role\x3d"option" href\x3d"').f(a.get(["url"],!1),a,"h").w('" class\x3d"').f(a.get(["type"],!1),a,"h").x(a.get(["sourceID"],!1),a,{block:g},{}).x(a.getPath(!1,["misc","actionType"]),a,{block:h},{}).w('" aria-selected\x3d"false" aria-label\x3d"').f(a.get(["displayName"],
!1),a,"h",["et","s"]).w('" title\x3d"').f(a.get(["displayName"],!1),a,"h",["et","s"]).w('"\x3e').x(a.get(["imageUrl"],!1),a,{"else":k,block:l},{}).w('\x3cspan class\x3d"item-headline').nx(a.get(["subLine"],!1),a,{block:m},{}).w('"\x3e').f(a.get(["headLine"],!1),a,"h",["mk","s"]).x(a.getPath(!1,["misc","degree"]),a,{block:n},{}).w('\x3c/span\x3e\x3cspan class\x3d"item-subline"\x3e').f(a.get(["subLine"],!1),a,"h",["et","s"]).w("\x3c/span\x3e\x3c/a\x3e").x(a.getPath(!1,["misc","actionType"]),a,{block:p},
{}).w("\x3c/span\x3e")}function d(b,a){return b.w('\x3cdiv class\x3d"category').x(a.get(["sourceID"],!1),a,{block:q},{}).w('"\x3e\x3ch3\x3e\x3cstrong\x3e').f(a.get(["categoryName"],!1),a,"h").w("\x3c/strong\x3e\x3c/h3\x3e\x3c/div\x3e")}function q(b,a){return b.w(" ").f(a.get(["sourceID"],!1),a,"h")}function e(b,a){return b.w(' role\x3d"toolbar" aria-labelledby\x3d"').x(a.get(["sourceID"],!1),a,{block:r},{}).w("item-").f(a.get(["rank"],!1),a,"h").w(" ").x(a.get(["sourceID"],!1),a,{block:s},{}).w("action-").f(a.get(["rank"],
!1),a,"h").w('"')}function r(b,a){return b.f(a.get(["sourceID"],!1),a,"h").w("-")}function s(b,a){return b.f(a.get(["sourceID"],!1),a,"h").w("-")}function f(b,a){return b.f(a.get(["sourceID"],!1),a,"h").w("-")}function g(b,a){return b.w(" ").f(a.get(["sourceID"],!1),a,"h")}function h(b,a){return b.w(" has-action")}function k(b,a){return b.w('\x3cspan class\x3d"ghost-image').x(a.get(["suggestionType"],!1),a,{block:t},{}).w('"\x3e\x3c/span\x3e')}function t(b,a){return b.w(" ").f(a.get(["suggestionType"],
!1),a,"h")}function l(b,a){return b.w('\x3cimg src\x3d"').f(a.get(["imageUrl"],!1),a,"h").w('" alt\x3d"').f(a.get(["displayName"],!1),a,"h",["et","s"]).w('"/\x3e')}function m(b,a){return b.w(" no-subline")}function n(b,a){return b.w('\x3cspan class\x3d"separator"\x3e\x26middot;\x3c/span\x3e\x3cspan class\x3d"typeahead-degree"\x3e').f(a.getPath(!1,["misc","degree"]),a,"h",["mk","s"]).w("\x3c/span\x3e")}function p(b,a){return b.w('\x3ca id\x3d"').x(a.get(["sourceID"],!1),a,{block:u},{}).w("action-").f(a.get(["rank"],
!1),a,"h").w('" role\x3d"button" class\x3d"typeahead-action" href\x3d"').f(a.getPath(!1,["misc","actionUrl"]),a,"h").w('" aria-label\x3d"').f(a.getPath(!1,["misc","actionDisplayName"]),a,"h").w(" ").f(a.get(["displayName"],!1),a,"h",["et","s"]).w('"\x3e').f(a.getPath(!1,["misc","actionDisplayName"]),a,"h").w("\x3c/a\x3e")}function u(b,a){return b.f(a.get(["sourceID"],!1),a,"h").w("-")}dust.register("tl/shared/typeahead/complexTypeahead",c);c.__dustBody=!0;d.__dustBody=!0;q.__dustBody=!0;e.__dustBody=
!0;r.__dustBody=!0;s.__dustBody=!0;f.__dustBody=!0;g.__dustBody=!0;h.__dustBody=!0;k.__dustBody=!0;t.__dustBody=!0;l.__dustBody=!0;m.__dustBody=!0;n.__dustBody=!0;p.__dustBody=!0;u.__dustBody=!0;return c})();(function(){dust.register("complexTypeahead",dust.cache["tl/shared/typeahead/complexTypeahead"])})();(function(){function b(b,a){return b.w('\x3cdiv class\x3d"search-history-footer"\x3e\x3cbutton type\x3d"button" class\x3d"clear-history"\x3e').f(a.getPath(!1,["i18n","clearLabel"]),a,"h").w("\x3c/button\x3e\x3cspan\x3e").f(a.getPath(!1,["i18n","clearDescription"]),a,"h").w('\x3c/span\x3e\x3ca class\x3d"search-history-help" href\x3d"').f(a.getPath(!1,["urls","helpCenterUrl"]),a,"h").w('"\x3e\x3cspan\x3e').f(a.getPath(!1,["i18n","clearHelp"]),a,"h").w("\x3c/span\x3e\x3c/a\x3e\x3c/div\x3e")}dust.register("tl/shared/typeahead/searchHistoryFooter",
b);b.__dustBody=!0;return b})();(function(){dust.register("searchHistoryFooter",dust.cache["tl/shared/typeahead/searchHistoryFooter"])})();define("jquery",[],function(){return jQuery});
define("UniversalSearchGhostLabel",["jquery"],function(b){var h=["ghostText"],c=!!("placeholder"in document.createElement("input")),a=function(){};a.prototype.init=function(a){this._elId=a;this._cacheDOMElements();this._attachEventListeners()};a.prototype._cacheDOMElements=function(){this._$el=b("#"+this._elId);this._$form=this._$el.parents("form")};a.prototype._attachEventListeners=function(){c||(this._$form.on("submit",b.proxy(this._clearVal,this)),this._$el.on("focus",b.proxy(this._clearVal,this)),
this._$el.on("blur",b.proxy(this._setValToPlaceholder,this)))};a.prototype._validateData=function(a,f){var b="",c=[],e,d,g;d=0;for(g=f.length;d<g;d++)e=f[d],a.hasOwnProperty(e)||c.push(e);c.length&&(b+="The keys {"+c.join(",")+"} are missing in the vertical dataset.");return b};a.prototype._setGhostLabel=function(a){this._clearVal();this._$el.attr("placeholder",a);this._setValToPlaceholder()};a.prototype._clearVal=c?function(){}:function(){this._$el.hasClass("ghost-label-active")&&(this._$el.removeClass("ghost-label-active"),
this._$el.val(""))};a.prototype._setValToPlaceholder=c?function(){}:function(){""===this._$el.val()&&(this._$el.addClass("ghost-label-active"),this._$el.val(this._$el.attr("placeholder")))};a.prototype.onNewVerticalData=function(a){var b=this._validateData(a,h);if(b)throw Error(b);this._setGhostLabel(a.ghostText)};return new a});define("jquery",[],function(){return jQuery});
define("UniversalSearchForm",["jquery"],function(h){var k=["formAction","formMethod","advancedLinkHref","advancedLinkVisible"],a=function(){};a.prototype.init=function(a){this._elId=a;this._cacheDOMElements();this._attachEventListeners()};a.prototype._cacheDOMElements=function(){this._$el=h("#"+this._elId);this._$mainTextBoxEl=this._$el.find("#main-search-box");this._$advancedLinkEl=this._$el.find("#advanced-search")};a.prototype._attachEventListeners=function(){LI.Events.on("focusInputEvent",this.focus,
this)};a.prototype._validateData=function(a,b){var d="",e=[],f,c,g;c=0;for(g=b.length;c<g;c++)f=b[c],a.hasOwnProperty(f)||e.push(f);e.length&&(d+="The keys {"+e.join(",")+"} are missing in the vertical dataset.");return d};a.prototype._showAdvancedLink=function(){this._$el.removeClass("basic-search")};a.prototype._hideAdvancedLink=function(){this._$el.addClass("basic-search")};a.prototype.focus=function(){this._$mainTextBoxEl.focus()};a.prototype.onNewVerticalData=function(a){var b=this._validateData(a,
k);if(b)throw Error(b);this._$el.attr("method",a.formMethod);this._$el.attr("action",a.formAction);a.advancedLinkVisible?(this._$advancedLinkEl.attr("href",a.advancedLinkHref),this._showAdvancedLink()):this._hideAdvancedLink()};return new a});define("jquery",[],function(){return jQuery});define("WebTracking",[],function(){return WebTracking});
define("UniversalSearchTracking",["jquery","WebTracking"],function(h,b){var k=["trkCode"],a=function(){};a.prototype.init=function(a){this._elId=a;this._cacheDOMElements();this._attachEventListeners();this.webTracking=b};a.prototype._cacheDOMElements=function(){this._$el=h("#"+this._elId)};a.prototype._attachEventListeners=function(){this._$el.off("focus",this._trackNewSearch);this._$el.one("focus",this._trackNewSearch)};a.prototype._trackNewSearch=function(){b.trackUserAction("glhd-srch-init")};
a.prototype._validateData=function(a,f){var b="",d=[],e,c,g;c=0;for(g=f.length;c<g;c++)e=f[c],a.hasOwnProperty(e)||d.push(e);d.length&&(b+="The keys {"+d.join(",")+"} are missing in the vertical dataset.");return b};a.prototype._trackVerticalChange=function(a){b.trackUserAction(a)};a.prototype.onNewVerticalData=function(a){var b=this._validateData(a,k);if(b)throw Error(b);this._trackVerticalChange(a.trkCode);this._attachEventListeners()};return new a});define("jquery",[],function(){return jQuery});
define("TypeaheadNavigator",["jquery"],function(b){var a=function(){};a.prototype.init=function(c,a){null!=a&&"object"===typeof a&&"splice"in a&&"join"in a||(a=[a]);a=a.map(function(a){return".tt-dataset-"+a});this._$dropdown=b(a.join(","));this._$el=b("#"+c);this._currentSelectionType="item";this._$currentSuggestion=b();this._$currentSelection=b();this._dropdownMutationObserver="undefined"!==typeof MutationObserver?new MutationObserver(this._scrollContainer.bind(this)):null};a.prototype.bindKeyEvents=
function(){this._$el.on("keydown",b.proxy(this.onKeyDown,this));if(this._dropdownMutationObserver)this._dropdownMutationObserver.observe(this._$dropdown[0],{childList:!0});else this._$dropdown.on("DOMSubtreeModified",this._scrollContainer.bind(this))};a.prototype.bindMouseEvents=function(){this._$dropdown.on("mouseenter",".item",b.proxy(this.onMouseEnter,this)).on("mouseleave",".item",b.proxy(this.resetSelected,this)).on("mouseenter",".typeahead-action",b.proxy(this.onMouseEnter,this)).on("mouseleave",
".typeahead-action",b.proxy(this.resetSelected,this))};a.prototype.unbindEvents=function(){this._$el.off("keydown",b.proxy(this.onKeyDown,this));this._$dropdown.off("mouseenter",".item",b.proxy(this.onMouseEnter,this)).off("mouseleave",".item",b.proxy(this.resetSelected,this)).off("mouseenter",".typeahead-action",b.proxy(this.onMouseEnter,this)).off("mouseleave",".typeahead-action",b.proxy(this.resetSelected,this));this._dropdownMutationObserver?this._dropdownMutationObserver.disconnect():this._$dropdown.off("DOMSubtreeModified",
b.proxy(this._scrollContainer,this))};a.prototype.resetSelected=function(){this._$dropdown.find(".item.selected").removeClass("selected");this._$dropdown.find(".typeahead-action.selected").removeClass("selected")};a.prototype.onMouseEnter=function(a){a=b(a.currentTarget);this.resetSelected();a.addClass("selected");this._currentSelectionType=!0===a.hasClass("typeahead-action")?"typeahead-action":"item"};a.prototype._toggleColumn=function(){this._$currentSuggestion.find(".item").hasClass("has-action")&&
(this._currentSelectionType="item"===this._currentSelectionType?"typeahead-action":"item")};a.prototype._getCurrentSelection=function(){var a=this._$currentSuggestion.find("."+this._currentSelectionType);a.length||(this._currentSelectionType="item",a=this._$currentSuggestion.find("."+this._currentSelectionType));return a};a.prototype._selectCurrent=function(){var a=this._getCurrentSelection();this.resetSelected();this._getCurrentSelection().addClass("selected");this._$el.attr("aria-activedescendant",
a.attr("id"))};a.prototype._goToCurrentUrl=function(){this._$currentSelection.length&&(document.location.href=this._$currentSelection.attr("href"))};a.prototype._scrollContainer=function(){var a=this._getCurrentSelection().length?this._$currentSuggestion.position().top:0;(a>this._$dropdown.scrollTop()+this._$dropdown.height()||a<this._$dropdown.scrollTop())&&this._$dropdown.scrollTop(a)};a.prototype._preventDefault=function(a){this._$currentSuggestion.length&&a.preventDefault()};a.prototype.onKeyDown=
function(a){var b=a.keyCode;this._$currentSuggestion=this._$dropdown.find(".tt-suggestion.tt-cursor");switch(b){case 37:this._toggleColumn();this._selectCurrent();this._preventDefault(a);break;case 38:this._scrollContainer();this._selectCurrent();break;case 39:this._toggleColumn();this._selectCurrent();this._preventDefault(a);break;case 40:this._scrollContainer();this._selectCurrent();break;case 13:this._preventDefault(a),this._goToCurrentUrl()}this._$currentSelection=this._getCurrentSelection()};
return new a});(function(){var b=LIModules.requires("jQuery"),g=["dataset","bloodhoundEngine","i18nStrings","regionId"],f,a;f=function(h,c){this._$el=h;this._config=c;this._checkMissingConfigs();this._$label=b("#"+this._config.regionId);this._dropdownId="tt-dataset-"+this._config.dataset;this._attachAriaAttributes();this._attachTypeaheadEvents();this._handleResultLength()};a=f.prototype;a.destroy=function(){this._$el.off("typeahead:opened",b.proxy(this._setDropdownAttrs,this)).off("typeahead:cursorchanged",b.proxy(this._setActiveDescendant,
this)).off("typeahead:closed",b.proxy(this._removeActiveDescendant,this)).off("keyup.typeahead",b.proxy(this._resetLabelLength,this));this._$el.attr(this._originalElAriaAttrs);this._$label.attr(this._originalLabelAriaAttrs);this._config.bloodhoundEngine.get=this._originalGetResults};a._checkMissingConfigs=function(){var b=[],c,a,e;this._config.regionId=this._config.regionId||this._config.labelId;a=0;for(e=g.length;a<e;a++)c=g[a],this._config[c]||b.push(c);if(b.length)throw"["+b.join(",")+"] config(s) are missing from the AccessibleTwitterTypeahead module";
};a._attachAriaAttributes=function(){this._originalElAriaAttrs={role:this._$el.attr("role")||null,"aria-owns":this._$el.attr("aria-owns")||null,"aria-autocomplete":this._$el.attr("aria-autocomplete")||null};this._originalLabelAriaAttrs={"aria-live":this._$label.attr("aria-live")||null};this._$el.attr({role:"combobox","aria-owns":"tt-dataset-"+this._config.dataset,"aria-autocomplete":"list"});this._config.labelId&&(this._originalElAriaAttrs["aria-labelledby"]=this._$el.attr("aria-labelledby")||null,
this._$el.attr("aria-labelledby",this._config.labelId));this._$label.is("label")&&this._$el.attr("aria-live","polite");this._$label.attr("aria-live")||this._$label.attr("aria-live","polite")};a._attachTypeaheadEvents=function(){this._$el.on("typeahead:opened",b.proxy(this._setDropdownAttrs,this)).on("typeahead:cursorchanged",b.proxy(this._setActiveDescendant,this)).on("typeahead:closed",b.proxy(this._removeActiveDescendant,this)).on("keyup.typeahead",b.proxy(this._resetLabelLength,this))};a._setDropdownAttrs=
function(){this._$dropdown=this._$dropdown||b("."+this._dropdownId);this._$dropdown.attr({id:this._dropdownId,role:"listbox"})};a._setActiveDescendant=function(a,c){var d=(c.sourceID?c.sourceID+"-":"")+"item-"+c.rank;this._$el.attr("aria-activedescendant",d);this._$dropdown=this._$dropdown||b("#"+this._dropdownId);this._$dropdown.find("[aria-selected\x3dtrue]").attr("aria-selected",!1);b("#"+d).attr("aria-selected",!0)};a._removeActiveDescendant=function(){this._$el.removeAttr("aria-activedescendant");
this._resetRegion()};a._setLabelToLength=function(a){var c="";switch(a?a.length:0){case 0:c=this._config.i18nStrings.zeroResults;break;case 1:c=this._config.i18nStrings.singleResult;break;default:c=this._config.i18nStrings.multipleResults}this._$label.html(b("\x3cspan/\x3e").text(c))};a._handleResultLength=function(){var a=this;this._originalGetResults=this._config.bloodhoundEngine.get;this._config.bloodhoundEngine.get=function(b,d){var e=d;d=function(b){a._setLabelToLength(b);e(b)};a._originalGetResults.call(a._config.bloodhoundEngine,
b,d)}};a._resetRegion=function(){this._$label.text("")};a._resetLabelLength=function(){""===b.trim(this._$el.val())&&this._resetRegion()};LIModules.exports("AccessibleTwitterTypeahead",f)})();define("jquery",[],function(){return jQuery});define("WebTracking",[],function(){return WebTracking});
define("UniversalTypeahead",["jquery","TypeaheadNavigator","WebTracking"],function(f,n,p){var q=LIModules.requires("jSecure"),r=["key"],s=LIModules.requires("readCookie"),t=LIModules.requires("createCookie"),d=function(){};d.prototype.init=function(a,c){this._searchType="";this._elId=a;this._lixTests=c||{};this._userInputValue="";this._guid=(new Date).getTime();this._refTarId="";this._requestCount=0;this._historyLimit=10;this._showSearchHistory=!1;this._currentTypeaheadSelectionType="item";this._cacheDOMElements();
this._getI18nStrings();this._parseConfigs();this._parseLix();this._instantiateTypeahead();this._attachEventListeners();this._toggleClearButton();this._webTracking=p};d.prototype._cacheDOMElements=function(){this._$el=f("#"+this._elId);this._$mainTextBoxEl=this._$el.find("#main-search-box");this._$trkInput=this._$el.find("#main-search-trkInfo");this._$clearButton=this._$el.find("#clear-main-search")};d.prototype._attachEventListeners=function(){var a=this;this._$mainTextBoxEl.on({keydown:f.proxy(this._toggleClearButton,
this),paste:f.proxy(this._toggleClearButton,this),input:f.proxy(this._toggleClearButton,this)}).on({keydown:f.proxy(function(){this._resetWrapperDirection()},this),input:f.proxy(function(){this._resetWrapperDirection()},this)});this._$clearButton.on("click",function(c){c.preventDefault();a._clearSearchBox();a._$mainTextBoxEl.focus()});if(this._localHistoryEnabled||this._remoteHistoryEnabled)this._$mainTextBoxEl.on("focus input change",function(){var c=f(this),b=""===c.val();f(document.activeElement).is(c)&&
(f(".tt-dataset-GLHD_SEARCH_HISTORY").toggle(b),f(".tt-dataset-GLHD").toggle(!b),(a._showSearchHistory=b)&&c.data().ttTypeahead.input.trigger("queryChanged",""))}),this._$el.on("submit",f.proxy(this._beforeSubmit,this)),this._$el.find(".tt-dropdown-menu").on("click",f.proxy(this._clearHistoryClickHandler,this))};d.prototype._clearHistoryClickHandler=function(a){f(a.target).hasClass("clear-history")&&(this._clearHistory(),this._remoteHistoryEnabled&&(this._searchHistorySource.clearRemoteCache(),f.ajax({url:"/voyager/api/search/history?action\x3ddismiss",
method:"POST",beforeSend:function(a){var b=document.cookie.match(/JSESSIONID="([^"]+)"/);a.setRequestHeader("Csrf-Token",b&&b[1]||"")}})),this.reinstantiateTypeahead())};d.prototype._getI18nStrings=function(){this.i18nMap={};this.i18nMap.refine=LI.i18n.get("universal-search-refine");this.i18nMap.suggestion=LI.i18n.get("typeahead2-search-suggestions");this.i18nMap.autocomplete=LI.i18n.get("typeahead2-search-suggestions");this.i18nMap.mynetwork="people"===this._lixTests.networkHeadline?LI.i18n.get("typeahead2-search-people"):
LI.i18n.get("typeahead2-search-connections");this.i18nMap.company=LI.i18n.get("typeahead2-search-companies");this.i18nMap.group=LI.i18n.get("typeahead2-search-groups");this.i18nMap.sitefeature=LI.i18n.get("typeahead2-search-features");this.i18nMap.school=LI.i18n.get("typeahead2-search-schools");this.i18nMap.showcase=LI.i18n.get("typeahead2-search-showcases");this.i18nMap.skill=LI.i18n.get("typeahead2-search-skills");this.i18nMap.connect=LI.i18n.get("typeahead2-connect");this.i18nMap.message=LI.i18n.get("typeahead2-message");
this.i18nMap.inmail=LI.i18n.get("typeahead2-send-inmail");this.i18nMap.post=LI.i18n.get("typeahead2-post");this.i18nMap.follow=LI.i18n.get("typeahead2-follow");this.i18nMap.view=LI.i18n.get("typeahead2-view");this.i18nMap.edit=LI.i18n.get("typeahead2-edit-profile");this.i18nMap.zeroresults=LI.i18n.get("typeahead2-search-input-title-no-results");this.i18nMap.oneresult=LI.i18n.get("typeahead2-search-input-title-singular");this.i18nMap.manyresults=LI.i18n.get("typeahead2-search-input-title-plural");
this.i18nMap.clearLabel=LI.i18n.get("typeahead2-search-clear-history-dismiss");this.i18nMap.clearDescription=LI.i18n.get("typeahead2-search-clear-history-description");this.i18nMap.clearHelp=LI.i18n.get("typeahead2-search-clear-history-help")};d.prototype._parseConfigs=function(){var a=this._$el.data("li-blud"),c=s("wutan"),b=this._$el.data("li-help-center-url");this._encryptionKey=c||a;c||t("wutan",this._encryptionKey,null,"."+document.domain);this._helpCenterUrl=b};d.prototype._parseLix=function(){var a=
this._lixTests.typeaheadDebounceTime,c=this._lixTests.taSearchHistoryLS,b=this._lixTests.taSearchHistoryRS,u=this._lixTests.typeaheadIgnoreCategories;this._debounceTime=parseInt(a&&a.substring(1),10)||200;this._localHistoryEnabled=c;this._remoteHistoryEnabled=b;this._ignoreCategories=u};d.prototype._instantiateTypeahead=function(){var a=this,c={compile:function(a,b){return function(c){c=f.extend({},b,c);var d;dust.render(a,c,function(a,b){d=b});return d}}},b;b=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("displayName"),
queryTokenizer:Bloodhound.tokenizers.whitespace,remote:{url:"/ta/federator?orig\x3dGLHD",rateLimitWait:this._debounceTime,replace:function(b,c){var d={verticalSelector:a._searchType,query:c,tracking:!0};a._$el.addClass("loading");a._userInputValue=a._$mainTextBoxEl.typeahead("val");a._refTarId&&(d.refTarId=a._refTarId);return b=a._addParamsToUrl(b,d)},filter:function(b){a._$el.removeClass("loading");a._setTarID(b);return a._decorateTypeaheadResponse(b)},ajax:{complete:_.bind(this._fuseLimit,this)}},
limit:999});new LI.AccessibleTwitterTypeahead(this._$mainTextBoxEl,{dataset:"GLHD",bloodhoundEngine:b,i18nStrings:{zeroResults:this.i18nMap.zeroresults,singleResult:this.i18nMap.oneresult,multipleResults:this.i18nMap.manyresults},labelId:"main-search-box-label"});b.initialize();b=[{highlight:!1,hint:!1,minLength:0},{name:"GLHD",displayKey:"displayName",source:b.ttAdapter(),templates:{suggestion:c.compile("tl/shared/typeahead/complexTypeahead")}}];(this._localHistoryEnabled||this._remoteHistoryEnabled)&&
this._attachSearchHistorySource(b,c);this._$mainTextBoxEl.typeahead.apply(this._$mainTextBoxEl,b).on("typeahead:selected",function(b,c,d){if(a._localHistoryEnabled||a._remoteHistoryEnabled)"GLHD"===d&&"category"!==c.type?(b=_.pick(c,"sourceID","type","displayName","url","imageUrl","headLine","id"),b.displayName||(b.displayName=q.htmlUnencode(b.headLine.replace(/<[^>]*>/g,""))),"autocomplete"===b.sourceID||"suggestion"===b.sourceID?(b.sourceID="history",b.entityType="queryHistoryName",c.misc&&c.misc.searchAssistType&&
(b.idInfo=c.misc.searchAssistType)):b.entityType="entityHistoryName","suggestion"!==c.sourceID&&(b.headLine=b.displayName),a.addItemToHistory(b)):"GLHD_SEARCH_HISTORY"===d&&a.addItemToHistory(c);a._lixTests.actionsEnabled||(a._$mainTextBoxEl.val(c.rawName),q.redirect(c.url))}).on("typeahead:autocompleted",function(b,c){a._trackAutoComplete(c)}).on("typeahead:cursorchanged",function(){a._$mainTextBoxEl.typeahead("val",a._userInputValue)}).on("typeahead:opened",function(){n.init(a._$mainTextBoxEl.attr("id"),
["GLHD","GLHD_SEARCH_HISTORY"]);n.bindKeyEvents();n.bindMouseEvents()}).on("typeahead:closed",function(){n.unbindEvents()});this._$wrapper=f("#global-search .twitter-typeahead");this._resetWrapperAndInputDirection();this._configureTypeaheadPresentation()};d.prototype._dedupeHistoryItems=function(a){var c=this._searchHistoryFromStorage.length;this._searchHistoryFromStorage=this._searchHistoryFromStorage.filter(function(b){return a.every(function(a){return b.id!==a.id})});c!==this._searchHistoryFromStorage.length&&
this._safeLocalStorage.setItem("GLHD_SEARCH_HISTORY",this._searchHistoryFromStorage);return this._searchHistoryFromStorage.concat(a)};var v={PROFILE_VIEW:"mynetwork",JOB_VIEW:"job",GROUP_VIEW:"group",COMPANY_VIEW:"company",SCHOOL_VIEW:"school",ARTICLE_VIEW:"article"};d.prototype._decorateRemoteHistoryItem=function(a){a.type="item";a.sourceID=v[a.entityType]||"history";a.entityType="history"===a.sourceID?"queryHistoryName":"entityHistoryName";a.headLine=a.displayName;a.imageUrl=a.imageId;a.id="history"===
a.sourceID?a.sourceID+"_"+a.displayName:a.sourceID+"_"+a.id;return a};d.prototype._attachSearchHistorySource=function(a,c){var b=this,d=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("displayName"),queryTokenizer:Bloodhound.tokenizers.whitespace,remote:{url:"/vsearch/shj",filter:function(a){a=a&&a.content&&a.content.voltron_search_history_json&&a.content.voltron_search_history_json.results;a.map(b._decorateRemoteHistoryItem);return b._showSearchHistory?b._dedupeHistoryItems(b._attachSearchHistoryTracking(a)):
[]}},limit:10}),g=function(a,c){var d=[];a||(d=b._attachSearchHistoryTracking(b._searchHistoryFromStorage));c(d)};d.initialize();this._searchHistorySource=d;this._setSafeLocalStorage();this._getCurrentHistory();a.splice(1,0,{name:"GLHD_SEARCH_HISTORY",source:this._remoteHistoryEnabled?d.ttAdapter():g,templates:{suggestion:c.compile("tl/shared/typeahead/complexTypeahead"),footer:c.compile("tl/shared/typeahead/searchHistoryFooter",{i18n:{clearLabel:this.i18nMap.clearLabel,clearDescription:this.i18nMap.clearDescription,
clearHelp:this.i18nMap.clearHelp},urls:{helpCenterUrl:this._helpCenterUrl}})}})};d.prototype.addItemToHistory=function(a){var c;a.id="history"===a.sourceID?a.sourceID+"_"+a.displayName:a.sourceID+"_"+a.id;a.idInfo&&(a.id+="_"+a.idInfo);(c=_.find(this._searchHistoryFromStorage,function(b){return b.id===a.id}))?(this._searchHistoryFromStorage.splice(this._searchHistoryFromStorage.indexOf(c),1),c.url=a.url,this._searchHistoryFromStorage.unshift(c)):(a.headLine=a.headLine||a.displayName,this._searchHistoryFromStorage.unshift(a));
this._safeLocalStorage.setItem("GLHD_SEARCH_HISTORY",this._searchHistoryFromStorage)};d.prototype._setSafeLocalStorage=function(){var a=this._encryptionKey,c=this._remoteHistoryEnabled?"1.0.0":4;this._safeLocalStorage={setItem:function(b,d){var g,f;try{g=sjcl.encrypt(a,JSON.stringify(d)),f=JSON.stringify({version:c,data:g}),window.localStorage.setItem(b,f)}catch(k){}},getItem:function(b){var d,g;try{return(g=JSON.parse(localStorage.getItem(b)))&&g.version===c&&(d=JSON.parse(sjcl.decrypt(a,g.data))),
d}catch(f){return null}}}};d.prototype._getCurrentHistory=function(){(this._searchHistoryFromStorage=(this._searchHistoryFromStorage=this._safeLocalStorage.getItem("GLHD_SEARCH_HISTORY"))?this._searchHistoryFromStorage.slice(0,this._historyLimit):this._searchHistoryFromStorage)||this._clearHistory()};d.prototype._clearHistory=function(){this._searchHistoryFromStorage=[];this._safeLocalStorage.setItem("GLHD_SEARCH_HISTORY",this._searchHistoryFromStorage)};d.prototype._attachSearchHistoryTracking=function(a){a=
a||[];var c,b,d;c=0;for(b=a.length;c<b;c++)d=a[c],d.itemIndex=c,d.url=this._constructItemUrl(d.url,d);return a};d.prototype.reinstantiateTypeahead=function(){this._$mainTextBoxEl.typeahead("destroy");this._instantiateTypeahead();if(this._localHistoryEnabled||this._remoteHistoryEnabled)this._$el.on("submit",f.proxy(this._beforeSubmit,this)),this._$el.find(".tt-dropdown-menu").on("click",f.proxy(this._clearHistoryClickHandler,this))};d.prototype._resetWrapperDirection=function(){this._$wrapper.css("direction",
"ltr")};d.prototype._resetWrapperAndInputDirection=function(){this._resetWrapperDirection();LI&&LI.BidiInput&&this._$mainTextBoxEl.trigger(LI.BidiInput.EVENT_RESET)};d.prototype._configureTypeaheadPresentation=function(){var a="clipped"+(this._lixTests.actionsEnabled?" typeahead-actions":" transparent")+("control"!==this._lixTests.taSuggestionRecolor?" colorful-suggestions":"")+("blue"===this._lixTests.taSuggestionRecolor?" blue-variant":"")+(this._lixTests.taGlyphIcons?" glyph-icons":"");this._$el.find(".tt-dropdown-menu").addClass(a)};
d.prototype._fuseLimit=function(){100<=this._requestCount&&!this._fuseLimitReached?(this._fuseLimitReached=!0,this._debounceTime=200,this.reinstantiateTypeahead()):this._requestCount++};d.prototype._setTarID=function(a){a=a.meta||{};var c=this._$trkInput.val(),c=c?c.split(","):[],b,d;!this._refTarId&&a&&(this._refTarId=a.tarId);a.tarId&&(b="tarId:"+a.tarId,(a=c.some(function(a,c,f){if((d=a.match(/tarId:[0-9]+/g))&&d.length)return f[c]=b,!0}))||c.push(b),this._$trkInput.val(c.join(",")))};d.prototype._decorateTypeaheadResponse=
function(a){var c=a.resultList||[];a=a.meta||{};var b="",d=0,f=0,h=0,k=/authType=(\w+)/,l,m,e;l=0;for(m=c.length;l<m;l++)e=c[l],e.type="item",e._index=l,e.sourceID!==b&&(e.categoryName=this.i18nMap[e.sourceID],f=0,d++),b=e.sourceID,f++,h++,e.categoryIndex=d,e.itemIndex=h,e.itemInCategoryIndex=f,e.misc&&e.misc.actionType&&(e.misc.actionDisplayName=this.i18nMap[e.misc.actionType]),e.rawName=e.rawName||LI.htmlUnencode(e.displayName),this._ignoreCategories&&(delete e.categoryName,delete e.categoryIndex,
delete e.itemInCategoryIndex),""===e.url&&(e.url=this._addParamsToUrl(this._$el.attr("action"),{keywords:e.rawName})),!e.authType&&k.test(e.url)&&(e.authType=k.exec(e.url)[1]),"suggestion"===e.sourceID&&e.misc&&e.misc.verticalType&&(e.suggestionType=e.misc.verticalType.toLowerCase()),e.url=this._constructItemUrl(e.url,e,a),e.misc&&e.misc.actionUrl&&(e.misc.actionUrl=this._constructActionUrl(e.misc.actionUrl,e,a)),!this._lixTests.actionsEnabled&&e.misc&&(delete e.misc.actionType,delete e.misc.actionUrl);
return c};d.prototype._getBaseTrackingParams=function(a,c){var b=[],d={};a.sourceID&&b.push("clickedVertical:"+a.sourceID);a.entityType&&b.push("entityType:"+a.entityType);a.id&&b.push("clickedEntityId:"+a.id);a.authType&&b.push("authType:"+a.authType);"undefined"!==typeof a.categoryIndex&&"undefined"!==typeof a.itemInCategoryIndex&&"undefined"!==typeof a.itemIndex?b.push("idx:"+a.categoryIndex+"-"+a.itemInCategoryIndex+"-"+a.itemIndex):"undefined"!==typeof a.itemIndex&&b.push("idx:"+a.itemIndex);
c&&c.tarId&&b.push("tarId:"+c.tarId);this._userInputValue&&b.push("tas:"+this._userInputValue);d.trk="tyah";d.trkInfo=b.join(",");return d};d.prototype._constructItemUrl=function(a,c,b){c=this._getBaseTrackingParams(c,b);return this._addParamsToUrl(a,c)};d.prototype._constructActionUrl=function(a,c,b){b=this._getBaseTrackingParams(c,b);c.misc&&(b.trk+="_"+c.sourceID+"_action_"+c.misc.actionType,"connect"===c.misc.actionType&&(b.connectionParam="member_desktop_search_search-bar"));return this._addParamsToUrl(a,
b)};d.prototype._beforeSubmit=function(){var a={sourceID:"history",entityType:"queryHistoryName",url:this._$el.attr("action")+"?keywords\x3d"+this._userInputValue,displayName:LI.htmlEncode(this._userInputValue),headLine:LI.htmlEncode(this._userInputValue),type:"item"};a.displayName&&this.addItemToHistory(a)};d.prototype._addParamsToUrl=function(a,c){var b,d,g={},h=[];if(!c)return a;b=a.split("?");d=b[0]+"?";b=b[1]?b[1].split("\x26")||"":"";for(var k=0;k<b.length;k++){var l=b[k].split("\x3d");g[l[0]]=
decodeURIComponent(l[1])}var g=f.extend({},g,c),m;for(m in g)h.push({name:m,value:g[m]});d+=f.param(h);return d=d.replace(/\+/g,"%20")};d.prototype._trackAutoComplete=function(a){p.trackUserAction("search-assist-accept",{input:this._userInputValue,suggestion:a.displayName,guid:this._guid,ts:(new Date).getTime(),prefixLength:this._userInputValue.length})};d.prototype._toggleClearButton=function(){var a=this;setTimeout(function(){a._$mainTextBoxEl.val()?a._$clearButton.addClass("show"):a._$clearButton.removeClass("show")},
50)};d.prototype._clearSearchBox=function(){this._$mainTextBoxEl.typeahead("val","");this._resetWrapperAndInputDirection();this._$clearButton.removeClass("show")};d.prototype._validateData=function(a,c){var b="",d=[],f,h,k;h=0;for(k=c.length;h<k;h++)f=c[h],a.hasOwnProperty(f)||d.push(f);d.length&&(b+="The keys {"+d.join(",")+"} are missing in the vertical dataset.");return b};d.prototype.onTextInputChanged=function(a){this._userInputValue=a};d.prototype.onNewVerticalData=function(a){var c=this._validateData(a,
r);if(c)throw Error(c);this._searchType=a.key};return new d});define("UniversalSearch",["jquery","UniversalTypeahead","UniversalSearchForm","UniversalSearchGhostLabel","UniversalSearchTracking"],function(d,e,h,k,l){var m={mainSearchBoxId:"main-search-box",dropdownName:"universal-search-selector",itemSelectEvent:"itemSelectEvent",updateKeywordsEvent:"universalKeywordsUpdated",updateSearchHistoryWithItem:"updateSearchHistoryWithItem",defaultSelected:"all",verticalSettings:{all:{key:"all",formMethod:"get",advancedLinkVisible:!0,trkCode:"vsrp_all_vertical_selector_item"},
people:{key:"people",formMethod:"get",advancedLinkVisible:!0,trkCode:"vsrp_people_vertical_selector_item"},jobs:{key:"jobs",formMethod:"get",advancedLinkVisible:!0,trkCode:"vsrp_jobs_vertical_selector_item"},companies:{key:"companies",formMethod:"get",advancedLinkVisible:!1,trkCode:"vsrp_companies_vertical_selector_item"},groups:{key:"groups",formMethod:"get",advancedLinkVisible:!1,trkCode:"vsrp_groups_vertical_selector_item"},inbox:{key:"inbox",formMethod:"post",advancedLinkVisible:!1,trkCode:"vsrp_inbox_vertical_selector_item"},
content:{key:"content",formMethod:"get",advancedLinkVisible:!1,trkCode:"vsrp_content_vertical_selector_item"},edu:{key:"edu",formMethod:"get",advancedLinkVisible:!1,trkCode:"vsrp_edu_vertical_selector_item"}}},f,b=function(){};b.prototype.init=function(a,b){var c=this,g=new d.Deferred;this._vertical="";this._modules=[];this._elId=a;this._config=b;this._setup();d(document).ready(function(){c._cacheDOMElements();c._setLixTests();c._areTypeaheadDepsLoaded()?c._afterLoad():(d(window).load(function(){g.resolve()}),
c._$input.one("focus",function(){g.resolve()}))});g.then(function(){!c._areTypeaheadDepsLoaded()&&LI.TwitterTADependencies?d.ajax({url:LI.TwitterTADependencies.scripts[0],dataType:"script",cache:!0,success:function(){c._afterLoad()}}):c._areTypeaheadDepsLoaded()&&c._afterLoad()})};b.prototype._areTypeaheadDepsLoaded=function(){return!(!d.fn.typeahead||!Bloodhound)};b.prototype._setup=function(){this._config=d.extend(!0,{},m,this._config);this._attachEventListeners()};b.prototype._cacheDOMElements=
function(){var a=d("#"+this._elId);this._$input=a.find("#"+this._config.mainSearchBoxId);this._$form=a.is("form")?a:a.find("form")};b.prototype._afterLoad=function(){var a;this._config.lixTests&&this._config.lixTests.noFederated&&(this._config.defaultSelected="people");this._config.lixTests&&(this._config.lixTests.disableJobsAdvanced||this._config.lixTests.voltronJserpMigration)&&(this._config.verticalSettings.jobs.advancedLinkVisible=!1);this._initModules();a=this._$form.find(":selected").val()||
this._config.defaultSelected;this.setCurrentVertical(a)};b.prototype._setLixTests=function(){try{this._config.lixTests=d.parseJSON(this._$form.attr("data-li-lix-tests"))}catch(a){this._config.lixTests=null}};b.prototype._initModules=function(){this._config.lixTests&&(f=this._$form.attr("id"),e.init(f,this._config.lixTests),this._modules.push(e),h.init(f),this._modules.push(h),k.init(this._config.mainSearchBoxId),this._modules.push(k),l.init(this._config.mainSearchBoxId),this._modules.push(l))};b.prototype._attachEventListeners=
function(){LI.Events.on(this._config.itemSelectEvent,this.handleVerticalChangeEvent,this);LI.Events.on(this._config.updateKeywordsEvent,this.setInputText,this);LI.Events.on(this._config.updateSearchHistoryWithItem,this.addItemToSearchHistory,this)};b.prototype._broadcast=function(a){var b=Array.prototype.slice.call(arguments,1);a="on"+a;var c,d,e;d=0;for(e=this._modules.length;d<e;d++)c=this._modules[d],c[a]&&"function"===typeof c[a]&&c[a].apply(c,b)};b.prototype._setVerticalDataAttributes=function(a){var b=
this._config.verticalSettings[a],c;"object"!==typeof b||b.dataAttributesPopulated||(c=this._$form.find('option[value\x3d"'+a+'"]'),b.formAction=c.attr("data-li-search-action"),b.advancedLinkHref=c.attr("data-li-advanced-link"),b.ghostText=c.attr("data-li-ghost-text"),b.dataAttributesPopulated=!0,this._config.verticalSettings[a]=b)};b.prototype.addItemToSearchHistory=function(a){e.addItemToHistory(a);e.reinstantiateTypeahead()};b.prototype.setInputText=function(a){this._$input.val(a);this._broadcast("TextInputChanged",
a)};b.prototype.getCurrentVertical=function(){return this._vertical};b.prototype.setCurrentVertical=function(a){this._vertical=a;this._setVerticalDataAttributes(this._vertical);if(a=this._config.verticalSettings[this._vertical])this._broadcast("NewVerticalData",a);else throw Error("data for the vertical {"+this._vertical+"} does not exist");};b.prototype.handleVerticalChangeEvent=function(a){var b=(a.option||"").value||"";(a.name||"")===this._config.dropdownName&&this._$form&&this._vertical!==b&&
this.setCurrentVertical(b)};return new b});require(["UniversalSearch"],function(d){d.init("global-search",{})});"use strict";function q(a){throw a;}var r=void 0,s=!1;var sjcl={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(a){this.toString=function(){return"CORRUPT: "+this.message};this.message=a},invalid:function(a){this.toString=function(){return"INVALID: "+this.message};this.message=a},bug:function(a){this.toString=function(){return"BUG: "+this.message};this.message=a},notReady:function(a){this.toString=function(){return"NOT READY: "+this.message};this.message=a}}};
sjcl.cipher.aes=function(a){this.j[0][0][0]||this.B();var b,c,d,e,g=this.j[0][4],f=this.j[1];b=a.length;var h=1;4!==b&&(6!==b&&8!==b)&&q(new sjcl.exception.invalid("invalid aes key size"));this.b=[d=a.slice(0),e=[]];for(a=b;a<4*b+28;a++){c=d[a-1];if(0===a%b||8===b&&4===a%b)c=g[c>>>24]<<24^g[c>>16&255]<<16^g[c>>8&255]<<8^g[c&255],0===a%b&&(c=c<<8^c>>>24^h<<24,h=h<<1^283*(h>>7));d[a]=d[a-b]^c}for(b=0;a;b++,a--)c=d[b&3?a:a-4],e[b]=4>=a||4>b?c:f[0][g[c>>>24]]^f[1][g[c>>16&255]]^f[2][g[c>>8&255]]^f[3][g[c&
255]]};
sjcl.cipher.aes.prototype={encrypt:function(a){return w(this,a,0)},decrypt:function(a){return w(this,a,1)},j:[[[],[],[],[],[]],[[],[],[],[],[]]],B:function(){var a=this.j[0],b=this.j[1],c=a[4],d=b[4],e,g,f,h=[],k=[],l,p,m,n;for(e=0;0x100>e;e++)k[(h[e]=e<<1^283*(e>>7))^e]=e;for(g=f=0;!c[g];g^=l||1,f=k[f]||1){m=f^f<<1^f<<2^f<<3^f<<4;m=m>>8^m&255^99;c[g]=m;d[m]=g;p=h[e=h[l=h[g]]];n=0x1010101*p^0x10001*e^0x101*l^0x1010100*g;p=0x101*h[m]^0x1010100*m;for(e=0;4>e;e++)a[e][g]=p=p<<24^p>>>8,b[e][m]=n=n<<24^n>>>8}for(e=
0;5>e;e++)a[e]=a[e].slice(0),b[e]=b[e].slice(0)}};
function w(a,b,c){4!==b.length&&q(new sjcl.exception.invalid("invalid aes block size"));var d=a.b[c],e=b[0]^d[0],g=b[c?3:1]^d[1],f=b[2]^d[2];b=b[c?1:3]^d[3];var h,k,l,p=d.length/4-2,m,n=4,v=[0,0,0,0];h=a.j[c];a=h[0];var t=h[1],u=h[2],y=h[3],z=h[4];for(m=0;m<p;m++)h=a[e>>>24]^t[g>>16&255]^u[f>>8&255]^y[b&255]^d[n],k=a[g>>>24]^t[f>>16&255]^u[b>>8&255]^y[e&255]^d[n+1],l=a[f>>>24]^t[b>>16&255]^u[e>>8&255]^y[g&255]^d[n+2],b=a[b>>>24]^t[e>>16&255]^u[g>>8&255]^y[f&255]^d[n+3],n+=4,e=h,g=k,f=l;for(m=0;4>
m;m++)v[c?3&-m:m]=z[e>>>24]<<24^z[g>>16&255]<<16^z[f>>8&255]<<8^z[b&255]^d[n++],h=e,e=g,g=f,f=b,b=h;return v}
sjcl.bitArray={bitSlice:function(a,b,c){a=sjcl.bitArray.O(a.slice(b/32),32-(b&31)).slice(1);return c===r?a:sjcl.bitArray.clamp(a,c-b)},extract:function(a,b,c){var d=Math.floor(-b-c&31);return((b+c-1^b)&-32?a[b/32|0]<<32-d^a[b/32+1|0]>>>d:a[b/32|0]>>>d)&(1<<c)-1},concat:function(a,b){if(0===a.length||0===b.length)return a.concat(b);var c=a[a.length-1],d=sjcl.bitArray.getPartial(c);return 32===d?a.concat(b):sjcl.bitArray.O(b,d,c|0,a.slice(0,a.length-1))},bitLength:function(a){var b=a.length;return 0===
b?0:32*(b-1)+sjcl.bitArray.getPartial(a[b-1])},clamp:function(a,b){if(32*a.length<b)return a;a=a.slice(0,Math.ceil(b/32));var c=a.length;b&=31;0<c&&b&&(a[c-1]=sjcl.bitArray.partial(b,a[c-1]&2147483648>>b-1,1));return a},partial:function(a,b,c){return 32===a?b:(c?b|0:b<<32-a)+0x10000000000*a},getPartial:function(a){return Math.round(a/0x10000000000)||32},equal:function(a,b){if(sjcl.bitArray.bitLength(a)!==sjcl.bitArray.bitLength(b))return s;var c=0,d;for(d=0;d<a.length;d++)c|=a[d]^b[d];return 0===
c},O:function(a,b,c,d){var e;e=0;for(d===r&&(d=[]);32<=b;b-=32)d.push(c),c=0;if(0===b)return d.concat(a);for(e=0;e<a.length;e++)d.push(c|a[e]>>>b),c=a[e]<<32-b;e=a.length?a[a.length-1]:0;a=sjcl.bitArray.getPartial(e);d.push(sjcl.bitArray.partial(b+a&31,32<b+a?c:d.pop(),1));return d},F:function(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]},byteswapM:function(a){var b,c;for(b=0;b<a.length;++b)c=a[b],a[b]=c>>>24|c>>>8&0xff00|(c&0xff00)<<8|c<<24;return a}};
sjcl.codec.utf8String={fromBits:function(a){var b="",c=sjcl.bitArray.bitLength(a),d,e;for(d=0;d<c/8;d++)0===(d&3)&&(e=a[d/4]),b+=String.fromCharCode(e>>>24),e<<=8;return decodeURIComponent(escape(b))},toBits:function(a){a=unescape(encodeURIComponent(a));var b=[],c,d=0;for(c=0;c<a.length;c++)d=d<<8|a.charCodeAt(c),3===(c&3)&&(b.push(d),d=0);c&3&&b.push(sjcl.bitArray.partial(8*(c&3),d));return b}};
sjcl.codec.base64={H:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fromBits:function(a,b,c){var d="",e=0,g=sjcl.codec.base64.H,f=0,h=sjcl.bitArray.bitLength(a);c&&(g=g.substr(0,62)+"-_");for(c=0;6*d.length<h;)d+=g.charAt((f^a[c]>>>e)>>>26),6>e?(f=a[c]<<6-e,e+=26,c++):(f<<=6,e-=6);for(;d.length&3&&!b;)d+="=";return d},toBits:function(a,b){a=a.replace(/\s|=/g,"");var c=[],d,e=0,g=sjcl.codec.base64.H,f=0,h;b&&(g=g.substr(0,62)+"-_");for(d=0;d<a.length;d++)h=g.indexOf(a.charAt(d)),
0>h&&q(new sjcl.exception.invalid("this isn't base64!")),26<e?(e-=26,c.push(f^h>>>e),f=h<<32-e):(e+=6,f^=h<<32-e);e&56&&c.push(sjcl.bitArray.partial(e&56,f,1));return c}};sjcl.codec.base64url={fromBits:function(a){return sjcl.codec.base64.fromBits(a,1,1)},toBits:function(a){return sjcl.codec.base64.toBits(a,1)}};sjcl.hash.sha256=function(a){this.b[0]||this.B();a?(this.o=a.o.slice(0),this.m=a.m.slice(0),this.g=a.g):this.reset()};sjcl.hash.sha256.hash=function(a){return(new sjcl.hash.sha256).update(a).finalize()};
sjcl.hash.sha256.prototype={blockSize:512,reset:function(){this.o=this.M.slice(0);this.m=[];this.g=0;return this},update:function(a){"string"===typeof a&&(a=sjcl.codec.utf8String.toBits(a));var b,c=this.m=sjcl.bitArray.concat(this.m,a);b=this.g;a=this.g=b+sjcl.bitArray.bitLength(a);for(b=512+b&-512;b<=a;b+=512)x(this,c.splice(0,16));return this},finalize:function(){var a,b=this.m,c=this.o,b=sjcl.bitArray.concat(b,[sjcl.bitArray.partial(1,1)]);for(a=b.length+2;a&15;a++)b.push(0);b.push(Math.floor(this.g/
4294967296));for(b.push(this.g|0);b.length;)x(this,b.splice(0,16));this.reset();return c},M:[],b:[],B:function(){function a(a){return 0x100000000*(a-Math.floor(a))|0}var b=0,c=2,d;a:for(;64>b;c++){for(d=2;d*d<=c;d++)if(0===c%d)continue a;8>b&&(this.M[b]=a(Math.pow(c,0.5)));this.b[b]=a(Math.pow(c,1/3));b++}}};
function x(a,b){var c,d,e,g=b.slice(0),f=a.o,h=a.b,k=f[0],l=f[1],p=f[2],m=f[3],n=f[4],v=f[5],t=f[6],u=f[7];for(c=0;64>c;c++)16>c?d=g[c]:(d=g[c+1&15],e=g[c+14&15],d=g[c&15]=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+g[c&15]+g[c+9&15]|0),d=d+u+(n>>>6^n>>>11^n>>>25^n<<26^n<<21^n<<7)+(t^n&(v^t))+h[c],u=t,t=v,v=n,n=m+d|0,m=p,p=l,l=k,k=d+(l&p^m&(l^p))+(l>>>2^l>>>13^l>>>22^l<<30^l<<19^l<<10)|0;f[0]=f[0]+k|0;f[1]=f[1]+l|0;f[2]=f[2]+p|0;f[3]=f[3]+m|0;f[4]=f[4]+n|0;f[5]=f[5]+v|0;f[6]=
f[6]+t|0;f[7]=f[7]+u|0}
sjcl.mode.ccm={name:"ccm",p:[],listenProgress:function(a){sjcl.mode.ccm.p.push(a)},unListenProgress:function(a){a=sjcl.mode.ccm.p.indexOf(a);-1<a&&sjcl.mode.ccm.p.splice(a,1)},U:function(a){var b=sjcl.mode.ccm.p.slice(),c;for(c=0;c<b.length;c+=1)b[c](a)},encrypt:function(a,b,c,d,e){var g,f=b.slice(0),h=sjcl.bitArray,k=h.bitLength(c)/8,l=h.bitLength(f)/8;e=e||64;d=d||[];7>k&&q(new sjcl.exception.invalid("ccm: iv must be at least 7 bytes"));for(g=2;4>g&&l>>>8*g;g++);g<15-k&&(g=15-k);c=h.clamp(c,8*(15-
g));b=sjcl.mode.ccm.J(a,b,c,d,e,g);f=sjcl.mode.ccm.K(a,f,c,b,e,g);return h.concat(f.data,f.tag)},decrypt:function(a,b,c,d,e){e=e||64;d=d||[];var g=sjcl.bitArray,f=g.bitLength(c)/8,h=g.bitLength(b),k=g.clamp(b,h-e),l=g.bitSlice(b,h-e),h=(h-e)/8;7>f&&q(new sjcl.exception.invalid("ccm: iv must be at least 7 bytes"));for(b=2;4>b&&h>>>8*b;b++);b<15-f&&(b=15-f);c=g.clamp(c,8*(15-b));k=sjcl.mode.ccm.K(a,k,c,l,e,b);a=sjcl.mode.ccm.J(a,k.data,c,d,e,b);g.equal(k.tag,a)||q(new sjcl.exception.corrupt("ccm: tag doesn't match"));
return k.data},aa:function(a,b,c,d,e,g){var f=[],h=sjcl.bitArray,k=h.F;d=[h.partial(8,(b.length?64:0)|d-2<<2|g-1)];d=h.concat(d,c);d[3]|=e;d=a.encrypt(d);if(b.length){c=h.bitLength(b)/8;65279>=c?f=[h.partial(16,c)]:0xffffffff>=c&&(f=h.concat([h.partial(16,65534)],[c]));f=h.concat(f,b);for(b=0;b<f.length;b+=4)d=a.encrypt(k(d,f.slice(b,b+4).concat([0,0,0])))}return d},J:function(a,b,c,d,e,g){var f=sjcl.bitArray,h=f.F;e/=8;(e%2||4>e||16<e)&&q(new sjcl.exception.invalid("ccm: invalid tag length"));(0xffffffff<
d.length||0xffffffff<b.length)&&q(new sjcl.exception.bug("ccm: can't deal with 4GiB or more data"));c=sjcl.mode.ccm.aa(a,d,c,e,f.bitLength(b)/8,g);for(d=0;d<b.length;d+=4)c=a.encrypt(h(c,b.slice(d,d+4).concat([0,0,0])));return f.clamp(c,8*e)},K:function(a,b,c,d,e,g){var f,h=sjcl.bitArray;f=h.F;var k=b.length,l=h.bitLength(b),p=k/50,m=p;c=h.concat([h.partial(8,g-1)],c).concat([0,0,0]).slice(0,4);d=h.bitSlice(f(d,a.encrypt(c)),0,e);if(!k)return{tag:d,data:[]};for(f=0;f<k;f+=4)f>p&&(sjcl.mode.ccm.U(f/
k),p+=m),c[3]++,e=a.encrypt(c),b[f]^=e[0],b[f+1]^=e[1],b[f+2]^=e[2],b[f+3]^=e[3];return{tag:d,data:h.clamp(b,l)}}};sjcl.misc.hmac=function(a,b){this.L=b=b||sjcl.hash.sha256;var c=[[],[]],d,e=b.prototype.blockSize/32;this.l=[new b,new b];a.length>e&&(a=b.hash(a));for(d=0;d<e;d++)c[0][d]=a[d]^909522486,c[1][d]=a[d]^1549556828;this.l[0].update(c[0]);this.l[1].update(c[1]);this.D=new b(this.l[0])};
sjcl.misc.hmac.prototype.encrypt=sjcl.misc.hmac.prototype.mac=function(a){this.P&&q(new sjcl.exception.invalid("encrypt on already updated hmac called!"));this.update(a);return this.digest(a)};sjcl.misc.hmac.prototype.reset=function(){this.D=new this.L(this.l[0]);this.P=s};sjcl.misc.hmac.prototype.update=function(a){this.P=!0;this.D.update(a)};sjcl.misc.hmac.prototype.digest=function(){var a=this.D.finalize(),a=(new this.L(this.l[1])).update(a).finalize();this.reset();return a};
sjcl.misc.pbkdf2=function(a,b,c,d,e){c=c||1E3;(0>d||0>c)&&q(sjcl.exception.invalid("invalid params to pbkdf2"));"string"===typeof a&&(a=sjcl.codec.utf8String.toBits(a));"string"===typeof b&&(b=sjcl.codec.utf8String.toBits(b));e=e||sjcl.misc.hmac;a=new e(a);var g,f,h,k,l=[],p=sjcl.bitArray;for(k=1;32*l.length<(d||1);k++){e=g=a.encrypt(p.concat(b,[k]));for(f=1;f<c;f++){g=a.encrypt(g);for(h=0;h<g.length;h++)e[h]^=g[h]}l=l.concat(e)}d&&(l=p.clamp(l,d));return l};
sjcl.prng=function(a){this.c=[new sjcl.hash.sha256];this.h=[0];this.C=0;this.q={};this.A=0;this.I={};this.N=this.d=this.i=this.W=0;this.b=[0,0,0,0,0,0,0,0];this.f=[0,0,0,0];this.u=r;this.w=a;this.n=s;this.t={progress:{},seeded:{}};this.k=this.V=0;this.r=1;this.s=2;this.R=0x10000;this.G=[0,48,64,96,128,192,0x100,384,512,768,1024];this.S=3E4;this.Q=80};
sjcl.prng.prototype={randomWords:function(a,b){var c=[],d;d=this.isReady(b);var e;d===this.k&&q(new sjcl.exception.notReady("generator isn't seeded"));if(d&this.s){d=!(d&this.r);e=[];var g=0,f;this.N=e[0]=(new Date).valueOf()+this.S;for(f=0;16>f;f++)e.push(0x100000000*Math.random()|0);for(f=0;f<this.c.length&&!(e=e.concat(this.c[f].finalize()),g+=this.h[f],this.h[f]=0,!d&&this.C&1<<f);f++);this.C>=1<<this.c.length&&(this.c.push(new sjcl.hash.sha256),this.h.push(0));this.d-=g;g>this.i&&(this.i=g);this.C++;
this.b=sjcl.hash.sha256.hash(this.b.concat(e));this.u=new sjcl.cipher.aes(this.b);for(d=0;4>d&&!(this.f[d]=this.f[d]+1|0,this.f[d]);d++);}for(d=0;d<a;d+=4)0===(d+1)%this.R&&A(this),e=B(this),c.push(e[0],e[1],e[2],e[3]);A(this);return c.slice(0,a)},setDefaultParanoia:function(a,b){0===a&&"Setting paranoia=0 will ruin your security; use it only for testing"!==b&&q("Setting paranoia=0 will ruin your security; use it only for testing");this.w=a},addEntropy:function(a,b,c){c=c||"user";var d,e,g=(new Date).valueOf(),
f=this.q[c],h=this.isReady(),k=0;d=this.I[c];d===r&&(d=this.I[c]=this.W++);f===r&&(f=this.q[c]=0);this.q[c]=(this.q[c]+1)%this.c.length;switch(typeof a){case "number":b===r&&(b=1);this.c[f].update([d,this.A++,1,b,g,1,a|0]);break;case "object":c=Object.prototype.toString.call(a);if("[object Uint32Array]"===c){e=[];for(c=0;c<a.length;c++)e.push(a[c]);a=e}else{"[object Array]"!==c&&(k=1);for(c=0;c<a.length&&!k;c++)"number"!==typeof a[c]&&(k=1)}if(!k){if(b===r)for(c=b=0;c<a.length;c++)for(e=a[c];0<e;)b++,
e>>>=1;this.c[f].update([d,this.A++,2,b,g,a.length].concat(a))}break;case "string":b===r&&(b=a.length);this.c[f].update([d,this.A++,3,b,g,a.length]);this.c[f].update(a);break;default:k=1}k&&q(new sjcl.exception.bug("random: addEntropy only supports number, array of numbers or string"));this.h[f]+=b;this.d+=b;h===this.k&&(this.isReady()!==this.k&&C("seeded",Math.max(this.i,this.d)),C("progress",this.getProgress()))},isReady:function(a){a=this.G[a!==r?a:this.w];return this.i&&this.i>=a?this.h[0]>this.Q&&
(new Date).valueOf()>this.N?this.s|this.r:this.r:this.d>=a?this.s|this.k:this.k},getProgress:function(a){a=this.G[a?a:this.w];return this.i>=a?1:this.d>a?1:this.d/a},startCollectors:function(){this.n||(this.a={loadTimeCollector:D(this,this.$),mouseCollector:D(this,this.ba),keyboardCollector:D(this,this.Z),accelerometerCollector:D(this,this.T),touchCollector:D(this,this.da)},window.addEventListener?(window.addEventListener("load",this.a.loadTimeCollector,s),window.addEventListener("mousemove",this.a.mouseCollector,
s),window.addEventListener("keypress",this.a.keyboardCollector,s),window.addEventListener("devicemotion",this.a.accelerometerCollector,s),window.addEventListener("touchmove",this.a.touchCollector,s)):document.attachEvent?(document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector)):q(new sjcl.exception.bug("can't attach event")),this.n=!0)},stopCollectors:function(){this.n&&(window.removeEventListener?
(window.removeEventListener("load",this.a.loadTimeCollector,s),window.removeEventListener("mousemove",this.a.mouseCollector,s),window.removeEventListener("keypress",this.a.keyboardCollector,s),window.removeEventListener("devicemotion",this.a.accelerometerCollector,s),window.removeEventListener("touchmove",this.a.touchCollector,s)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",
this.a.keyboardCollector)),this.n=s)},addEventListener:function(a,b){this.t[a][this.V++]=b},removeEventListener:function(a,b){var c,d,e=this.t[a],g=[];for(d in e)e.hasOwnProperty(d)&&e[d]===b&&g.push(d);for(c=0;c<g.length;c++)d=g[c],delete e[d]},Z:function(){E(1)},ba:function(a){var b,c;try{b=a.x||a.clientX||a.offsetX||0,c=a.y||a.clientY||a.offsetY||0}catch(d){c=b=0}0!=b&&0!=c&&sjcl.random.addEntropy([b,c],2,"mouse");E(0)},da:function(a){a=a.touches[0]||a.changedTouches[0];sjcl.random.addEntropy([a.pageX||
a.clientX,a.pageY||a.clientY],1,"touch");E(0)},$:function(){E(2)},T:function(a){a=a.accelerationIncludingGravity.x||a.accelerationIncludingGravity.y||a.accelerationIncludingGravity.z;if(window.orientation){var b=window.orientation;"number"===typeof b&&sjcl.random.addEntropy(b,1,"accelerometer")}a&&sjcl.random.addEntropy(a,2,"accelerometer");E(0)}};function C(a,b){var c,d=sjcl.random.t[a],e=[];for(c in d)d.hasOwnProperty(c)&&e.push(d[c]);for(c=0;c<e.length;c++)e[c](b)}
function E(a){"undefined"!==typeof window&&window.performance&&"function"===typeof window.performance.now?sjcl.random.addEntropy(window.performance.now(),a,"loadtime"):sjcl.random.addEntropy((new Date).valueOf(),a,"loadtime")}function A(a){a.b=B(a).concat(B(a));a.u=new sjcl.cipher.aes(a.b)}function B(a){for(var b=0;4>b&&!(a.f[b]=a.f[b]+1|0,a.f[b]);b++);return a.u.encrypt(a.f)}function D(a,b){return function(){b.apply(a,arguments)}}sjcl.random=new sjcl.prng(6);
a:try{var F,G,H,I;if(I="undefined"!==typeof module){var J;if(J=module.exports){var K;try{K=require("crypto")}catch(L){K=null}J=(G=K)&&G.randomBytes}I=J}if(I)F=G.randomBytes(128),F=new Uint32Array((new Uint8Array(F)).buffer),sjcl.random.addEntropy(F,1024,"crypto['randomBytes']");else if("undefined"!==typeof window&&"undefined"!==typeof Uint32Array){H=new Uint32Array(32);if(window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(H);else if(window.msCrypto&&window.msCrypto.getRandomValues)window.msCrypto.getRandomValues(H);
else break a;sjcl.random.addEntropy(H,1024,"crypto['getRandomValues']")}}catch(M){"undefined"!==typeof window&&window.console&&(console.log("There was an error collecting entropy from the browser:"),console.log(M))}
sjcl.json={defaults:{v:1,iter:1E3,ks:128,ts:64,mode:"ccm",adata:"",cipher:"aes"},Y:function(a,b,c,d){c=c||{};d=d||{};var e=sjcl.json,g=e.e({iv:sjcl.random.randomWords(4,0)},e.defaults),f;e.e(g,c);c=g.adata;"string"===typeof g.salt&&(g.salt=sjcl.codec.base64.toBits(g.salt));"string"===typeof g.iv&&(g.iv=sjcl.codec.base64.toBits(g.iv));(!sjcl.mode[g.mode]||!sjcl.cipher[g.cipher]||"string"===typeof a&&100>=g.iter||64!==g.ts&&96!==g.ts&&128!==g.ts||128!==g.ks&&192!==g.ks&&0x100!==g.ks||2>g.iv.length||4<
g.iv.length)&&q(new sjcl.exception.invalid("json encrypt: invalid parameters"));"string"===typeof a?(f=sjcl.misc.cachedPbkdf2(a,g),a=f.key.slice(0,g.ks/32),g.salt=f.salt):sjcl.ecc&&a instanceof sjcl.ecc.elGamal.publicKey&&(f=a.kem(),g.kemtag=f.tag,a=f.key.slice(0,g.ks/32));"string"===typeof b&&(b=sjcl.codec.utf8String.toBits(b));"string"===typeof c&&(g.adata=c=sjcl.codec.utf8String.toBits(c));f=new sjcl.cipher[g.cipher](a);e.e(d,g);d.key=a;g.ct="ccm"===g.mode&&sjcl.arrayBuffer&&sjcl.arrayBuffer.ccm&&
b instanceof ArrayBuffer?sjcl.arrayBuffer.ccm.encrypt(f,b,g.iv,c,g.ts):sjcl.mode[g.mode].encrypt(f,b,g.iv,c,g.ts);return g},encrypt:function(a,b,c,d){var e=sjcl.json,g=e.Y.apply(e,arguments);return e.encode(g)},X:function(a,b,c,d){c=c||{};d=d||{};var e=sjcl.json;b=e.e(e.e(e.e({},e.defaults),b),c,!0);var g,f;g=b.adata;"string"===typeof b.salt&&(b.salt=sjcl.codec.base64.toBits(b.salt));"string"===typeof b.iv&&(b.iv=sjcl.codec.base64.toBits(b.iv));(!sjcl.mode[b.mode]||!sjcl.cipher[b.cipher]||"string"===
typeof a&&100>=b.iter||64!==b.ts&&96!==b.ts&&128!==b.ts||128!==b.ks&&192!==b.ks&&0x100!==b.ks||!b.iv||2>b.iv.length||4<b.iv.length)&&q(new sjcl.exception.invalid("json decrypt: invalid parameters"));"string"===typeof a?(f=sjcl.misc.cachedPbkdf2(a,b),a=f.key.slice(0,b.ks/32),b.salt=f.salt):sjcl.ecc&&a instanceof sjcl.ecc.elGamal.secretKey&&(a=a.unkem(sjcl.codec.base64.toBits(b.kemtag)).slice(0,b.ks/32));"string"===typeof g&&(g=sjcl.codec.utf8String.toBits(g));f=new sjcl.cipher[b.cipher](a);g="ccm"===
b.mode&&sjcl.arrayBuffer&&sjcl.arrayBuffer.ccm&&b.ct instanceof ArrayBuffer?sjcl.arrayBuffer.ccm.decrypt(f,b.ct,b.iv,b.tag,g,b.ts):sjcl.mode[b.mode].decrypt(f,b.ct,b.iv,g,b.ts);e.e(d,b);d.key=a;return 1===c.raw?g:sjcl.codec.utf8String.fromBits(g)},decrypt:function(a,b,c,d){var e=sjcl.json;return e.X(a,e.decode(b),c,d)},encode:function(a){var b,c="{",d="";for(b in a)if(a.hasOwnProperty(b))switch(b.match(/^[a-z0-9]+$/i)||q(new sjcl.exception.invalid("json encode: invalid property name")),c+=d+'"'+b+
'":',d=",",typeof a[b]){case "number":case "boolean":c+=a[b];break;case "string":c+='"'+escape(a[b])+'"';break;case "object":c+='"'+sjcl.codec.base64.fromBits(a[b],0)+'"';break;default:q(new sjcl.exception.bug("json encode: unsupported type"))}return c+"}"},decode:function(a){a=a.replace(/\s/g,"");a.match(/^\{.*\}$/)||q(new sjcl.exception.invalid("json decode: this isn't json!"));a=a.replace(/^\{|\}$/g,"").split(/,/);var b={},c,d;for(c=0;c<a.length;c++)(d=a[c].match(/^\s*(?:(["']?)([a-z][a-z0-9]*)\1)\s*:\s*(?:(-?\d+)|"([a-z0-9+\/%*_.@=\-]*)"|(true|false))$/i))||
q(new sjcl.exception.invalid("json decode: this isn't json!")),null!=d[3]?b[d[2]]=parseInt(d[3],10):null!=d[4]?b[d[2]]=d[2].match(/^(ct|adata|salt|iv)$/)?sjcl.codec.base64.toBits(d[4]):unescape(d[4]):null!=d[5]&&(b[d[2]]="true"===d[5]);return b},e:function(a,b,c){a===r&&(a={});if(b===r)return a;for(var d in b)b.hasOwnProperty(d)&&(c&&(a[d]!==r&&a[d]!==b[d])&&q(new sjcl.exception.invalid("required parameter overridden")),a[d]=b[d]);return a},fa:function(a,b){var c={},d;for(d in a)a.hasOwnProperty(d)&&
a[d]!==b[d]&&(c[d]=a[d]);return c},ea:function(a,b){var c={},d;for(d=0;d<b.length;d++)a[b[d]]!==r&&(c[b[d]]=a[b[d]]);return c}};sjcl.encrypt=sjcl.json.encrypt;sjcl.decrypt=sjcl.json.decrypt;sjcl.misc.ca={};sjcl.misc.cachedPbkdf2=function(a,b){var c=sjcl.misc.ca,d;b=b||{};d=b.iter||1E3;c=c[a]=c[a]||{};d=c[d]=c[d]||{firstSalt:b.salt&&b.salt.length?b.salt.slice(0):sjcl.random.randomWords(2,0)};c=b.salt===r?d.firstSalt:b.salt;d[c]=d[c]||sjcl.misc.pbkdf2(a,c,b.iter);return{key:d[c].slice(0),salt:c.slice(0)}};

/*
 *  THE "NAV START" | "non-js" file
 *  ----------------------------------------------------------------------------
 *  My purpose in life:
 *  -------------------
 *  I know what you're thinking, "What in the flying F#@! is this," - yeah. I'm
 *  a bit for an odd-ball; my entire purpose in life is to "open" an annonymous
 *  function for the global-nav sandbox.
 *
 *  While I am javascript, technically I'm *not* javascript - because I'm not
 *  a valid js file.  This is why I have the funky .nocheck.js extension.  There's
 *  no way I can EVER pass JSHint.  I also am equally destructive without my
 *  navend counter-part.
 *
 *  I'm included by:              - SCDS remote-nav concat group within remote-nav fizzy embed
 *
 *  File PRE-CONDITIONS:          - SCDS changes to allow .nocheck.js files must be in place.
 *                                - must be the VERY FIRST file called in the sandbox concat group
 *
 *  File POST-CONDITIONS:
 *
 *  CAVEATS/GOTCHAS:
 */
(function (){function remote_nav_eval(g){eval.apply(window,[g])}
var remote_nav=function(){function g(a){this.message=a;this.name="SandboxException"}var b=this;b.CONFIGS={SBX_JSCONTROL_PATTERN:/\bli-control\b/g,SBX_JSCONTROL_TYPE:"linkedin/control",SBX_INITIALIZED_CONTROL_TYPE:"text/javascript+initialized",SBX_ENV_LABEL:"SANDBOX"};b.data={control_registry:[],rawControlCode:[],codeAlreadyEvaled:!1,EXCLUDED_CONTROLS:{UniversalSearch:!0,Typeahead2:!0,StyledDropdown:!0,A11yMenu:!0,QuickHelp2:!0,"kb.shortcuts":!0}};b.debug={enabled:!1,setMode:function(a){var e=/debug_mode=enabled/;
a||(a=e.test(window.location.search));b.debug.enabled=a},sbx_log:function(){b.debug.enabled&&window.console&&window.console.log&&window.console.log(arguments)}};b.events={};b.helpers={_addSandboxControl:function(a,e,d){b.debug.sbx_log("SANDBOX | _addSandboxControl() | started ");var c=document.getElementById(a),f=b.helpers,k=f._getJSControlSibling(c),g=f._checkSBXRegistry(a);b.debug.sbx_log("SANDBOX | _addSandboxControl | is Controls present in the registry? | ",g);c.type===b.CONFIGS.SBX_INITIALIZED_CONTROL_TYPE||
g||b.data.EXCLUDED_CONTROLS[e]?b.data.EXCLUDED_CONTROLS[e]?(b.debug.sbx_log("SANDBOX | _addSandboxControl  | EXCLUDED CONTROL - using LI.Controls.addControl() instead"),window.LI.Controls.addControl(a,e,d)):b.debug.sbx_log("SANDBOX | _addSandboxControl | CONTROL ALREADY DEFINED... IGNORING"):(f._addToSBXRegistry(a,e,k,d),f._addCodeToEvalString(c),f._changeJSControlType(c))},_addToSBXRegistry:function(a,e,d,c){b.data.control_registry.push({id:a,name:e,el:d,config:c});a=b.helpers._checkSBXRegistry(a);
if(!a)throw new g("the control for some reason was NOT added to the registry");return a},_cleanSandbox:function(){b.data.control_registry=[]},_addCodeToEvalString:function(a){if("script"!==a.nodeName.toLowerCase())throw new g("attempting to add non-script innerHTML to the eval string");b.debug.sbx_log("SANDBOX | _addCodeToEvalString | about to push code to array");b.data.rawControlCode.push(a.innerHTML.replace(/LI\.Controls\.addControl/,"window.sandboxControlInit"))},_checkSBXRegistry:function(a){var e,
d=b.data.control_registry,c=d.length;for(e=0;e<c;e++)if(d[e].id===a)return!0;return!1},_getJSControlScripts:function(a){a=a.getElementsByTagName("script");var e=a.length,d=b.helpers._addCodeToEvalString,c=b.CONFIGS.SBX_JSCONTROL_TYPE,f;for(f=0;f<e;f++)a[f].getAttribute("type")===c&&d(a[f])},_getJSControlSibling:function(a){b.debug.sbx_log(a);var e=function(){return"previousElementSibling"in HTMLElement.prototype?function(a){return a.previousElementSibling}:function(a){do a=a.previousSibling;while(a&&
1!==a.nodeType);return a}}();a=e(a);do{if("script"!==a.nodeName.toLowerCase()&&!a.className.match(b.CONFIGS.SBX_JSCONTROL_PATTERN))return a;a=e(a)}while(a);return!1},_changeJSControlType:function(a){a.setAttribute("type",b.CONFIGS.SBX_INITIALIZED_CONTROL_TYPE);a.className="sbx-li-control"}};b.sandbox={initControl:function(){b.debug.sbx_log("SANDBOX | window.sandboxControlInit() called for the following Control script: ",arguments);b.helpers._addSandboxControl.apply(this,arguments)},oldLI:window.LI,
LI:{isSandboxed:!0,assign:function(a,e){for(var d=b.sandbox.LI,c=0,f=a.split("."),g=f.length;c<g;c++)d[f[c]]||(d[f[c]]=c+1===g&&e?e:{},d=d[f[c]]);return d},define:function(a){b.sandbox.LI.assign(a,{})},sandboxFromWindow:function(a,e){b.sandbox.LI.assign(e,a)}}};b.deploy={executeSandbox:function(a){var e=(typeof a).toLowerCase(),d=null;b.debug.setMode();if("object"===e){if(a.containerIDs)for(var e=0,c=a.containerIDs.length;e<c;e++)(d=document.getElementById(a.containerIDs[e]))?b.helpers._getJSControlScripts(d):
b.debug.sbx_log("SANDBOX | WARNING: The DOM element or ID",a," was not found - ignoring")}else"string"===e&&((d=document.getElementById(a))?b.helpers._getJSControlScripts(d):b.debug.sbx_log("SANDBOX | WARNING: The DOM element or ID",a," was not found - ignoring"));b.debug.sbx_log("SANDBOX | evaling code in executeSandbox()");b.data.rawControlCode.push("remote_nav.debug.sbx_log('SANDBOX | LI OBJECT IN EVAL IS: ', LI )");b.data.codeAlreadyEvaled||(a=b.data.rawControlCode.join(";"),b.debug.sbx_log(a),
b.deploy.injectOrEval(a))},injectOrEval:function(a){var e=document.getElementsByTagName("head")[0],d=document.createElement("script"),c=!1;try{d.text=a}catch(f){b.debug.sbx_log("SANDBOX | injectOrEval() | .text not supported,... trying .innerHTML");try{d.innerHTML=a}catch(g){b.debug.sbx_log("SANDBOX | injectOrEval() | cannot use .innerHTML on the script Element, and now the script tag is EMPTY"),c=!0}}if(!c)try{e.appendChild(d),b.debug.sbx_log("SANDBOX | injectOrEval() | SCRIPT TAG INJECTION FINISHED.")}catch(h){b.debug.sbx_log("SANDBOX | injectOrEval() | unable to append script tag to head - falling back on eval()"),
c=!0}c&&(b.debug.sbx_log("SANDBOX | unjectOrEval() | unable to either append the tag or it's empty, using eval()"),remote_nav_eval(a),b.debug.sbx_log("SANDBOX | injectOrEval() | CODE EVAL() [FALLBACK]  FINISHED."));b.data.codeAlreadyEvaled=!0},initSandboxControls:function(){b.debug.sbx_log("SANDBOX | initSandboxControls() | function called.");for(var a=b.data.control_registry.length,e=0,d=null;a--;){var c=b.data.control_registry[e++];if(c&&!c.sbx_isInitialized)if(b.debug.sbx_log("SANDBOX | initSandBoxControls :"+
c.name),b.sandbox.LI[c.name]?(b.debug.sbx_log("SANDBOX | Presence of faceded JSControl: "+typeof LI[c.name]),d=b.sandbox.LI):(b.debug.sbx_log("SANDBOX | JSControl not in sandbox -\x3e punching out to GLOBAL JSControl."),d=window.LI),d[c.name])try{new d[c.name](c.el,c.config),c.sbx_isInitialized=!0}catch(f){b.debug.sbx_log("SANDBOX | We gots problems - ",f)}else b.debug.sbx_log("SANDBOX | WARNING | This Control",c," did not initialize.")}}};b.public_API={initializeControls:b.deploy.initSandboxControls,
setUp:b.deploy.executeSandbox,sandbox:b.sandbox,debug:b.debug};window.LI_JS_TEST&&(b.public_API._test={config:b.config,data:b.data,helpers:b.helpers,deploy:b.deploy});return b.public_API}(),LI=remote_nav.sandbox.LI,LIModules=function(){function g(a,e){var d=a.split(".");a=d.pop();if(d=d.join(".")){var c=LI,f=0,g,h,d=(d.split?d.split("."):d)||[];if(c){for(g=d.length;f<g-1;f++)h=d[f],c=c&&c[h]||{};d=c[d[g-1]]}else d=void 0}d=d||LI;if(e)d[a]=e;else return(c=d[a])||(c=a,c=b[c]||c,c="function"===typeof c?
c():window[c]||void 0),c}var b={jquery:function(){return window.jQuery||window.$},underscore:"_",fiber:"Fiber","li-backbone":"MVC",backbone:"Backbone"};return{imports:function(a){return g(a)},requires:function(a){var b=g(a);if(b)return b;throw Error(a+" was not loaded or could not be found");},exports:function(a,b){g(a,b)},isSandboxed:!0}}();LI.LIModules=LIModules;window.sandboxControlInit=remote_nav.sandbox.initControl;window.remote_nav=remote_nav;window.sandboxedLI=LI;
LI.sandboxFromWindow(window.LI.Events,"Events");LI.sandboxFromWindow(window.LI.i18n,"i18n");LI.sandboxFromWindow(window.LI.show,"show");LI.sandboxFromWindow(window.LI.hide,"hide");LI.sandboxFromWindow(window.LI.Controls,"Controls");LI.sandboxFromWindow(window.LI.htmlEncode,"htmlEncode");LI.sandboxFromWindow(window.LI.domify,"domify");LI.sandboxFromWindow(window.LI.getDataAttribute,"getDataAttribute");LI.sandboxFromWindow(window.LI.asyncRequest,"asyncRequest");
LI.sandboxFromWindow(window.LI.isFullPage,"isFullPage");LI.sandboxFromWindow(window.LI.htmlUnencode,"htmlUnencode");LI.sandboxFromWindow(window.LI.log,"log");LI.sandboxFromWindow(window.LI.BaseControl,"BaseControl");LI.sandboxFromWindow(window.LI.Lego,"Lego");(function(){remote_nav.setUp({containerIDs:["a11y-menu","header"]});remote_nav.initializeControls();remote_nav.debug.sbx_log("REMOTE NAV SANBOX DONE")})();
/*  THE "NAV END" | "no js" file
 *  ----------------------------------------------------------------------------
 *  My purpose in life:
 *  --------------------------
 *  I finish the job of navstart.nocheck.js - closing the anonymous function
 *  scope for the sandbox.  Like navstart.nocheck.js, I'm also not technically
 *  valid javascript, and therefore won't pass JSHint.  We both exist, however,
 *  so that logic modifications to SCDS do not have to be made.
 *
 *  I'm included by:                - remote_nav SCDS concat group
 *
 *  I'm styled by:                  - N/A; JS plumbing/infrastructure
 *
 *  File PRE-CONDITIONS:
 *  File POST-CONDITIONS:
 *  CAVEATS/GOTCHAS:
 */
}());