webpackJsonp(["main"],{"./actions.js":function(e,t,i){function n(){c>=u&&(o(),c=0)}function o(){r.enabled&&r("e2e.gc","GC started.");var e=(new Date).getTime(),t=[];for(var i in l){var n=l[i];e-n.startTime>h&&(t.push(n),delete l[i])}r.enabled&&r("e2e.gc","Collected actions:",t)}function s(e){if(e.mustReport){if(delete e.mustReport,r.enabled){var t=e.endTime-e.startTime,i=e.serverTime/1e3;r("e2e.reportActionData","Metric:",t,"Server time:",i,"Details:",e)}d.log("action_data",{data:e})}}var a=i("./shared/util.js"),r=i("./shared/log.js").log,d=i("./shared/logging.js"),l={},c=0,u=100,h=6e5;t.startAction=function(e){if(null===e||"undefined"==typeof e)throw new Error("This method expects an object describing the action.");return e.startTime=(new Date).getTime(),e.id=(1e3*e.startTime+Math.floor(1e3*Math.random())).toString(36),l[e.id]=e,r.enabled&&r("e2e.startAction",e),c++,n(),e},t.startOrUpdateAction=function(e,i){return e&&l[e]?t.updateAction(e,i):t.startAction(i)},t.getAction=function(e){return l[e];
},t.updateAction=function(e,t){if(void 0===t)throw new Error("This method expects an object describing the update.");var i=l[e];return void 0===i?null:a.extend(i,t)},t.finishAction=function(e,t){var i=l[e];return void 0===i?null:(t&&a.extend(i,t),i.endTime=(new Date).getTime(),delete l[e],r.enabled&&r("e2e.finishAction",i),s(i),i)}},"./app/view/activation/facebook.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/onload.js"),s=i("./shared/facebook.js");t.FacebookPageLikeButton=n.extend({onLoad:function(){var e=this;o.execAfterLoadDelayed(function(){s.onInit(function(){window.FB.XFBML.parse(e.$id("@button").get(0)),window.FB.Event.subscribe("edge.create",function(){e.serverCall("page_liked").liveMutate().send()}),window.FB.Event.subscribe("edge.remove",function(){e.serverCall("page_unliked").liveMutate().send()})})})}}),t.FacebookPageLikePrompt=n.extend({hide:function(){this.$id("@fb_page_like_prompt").addClass("hidden")}}),t.FacebookPageLikePromptDismiss=n.extend({
onLoad:function(){this.$id("@dismiss").click(this.dismiss.bind(this))},dismiss:function(e){return e.preventDefault(),this.parent().hide(),this.serverCall("dismiss").liveMutate().send(),!1}}),t.FacebookConnect=n.extend({onLoad:function(){var e=this;this.$id("@dismiss").click(function(){return e.serverCall("dismiss_facebook_connect").liveMutate().success(function(){e.$id("@facebook_connect").fadeOut(300)}).send(),!1})}})},"./app/view/activation/progress.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.ProgressBar=n.extend({onLoad:function(){var e=this;0===e.getMaxWidth()?setTimeout(function(){e.initialize()},1):e.initialize(),this.handleEvent(o.Types.ACTIVATION_PROGRESS_BAR_STEP,function(t){t.payload.step&&e.update(t.payload.step)})},getMaxWidth:function(){return this.$id("@progress_bar_wrapper").width()},initialize:function(){this.$id("@progress_bar").css({width:this.getWidth()})},getWidth:function(){var e=this.getMaxWidth(),t=this.curr/this.total*e;
return Math.min(e,t)},update:function(e){this.curr=e,this.$id("@progress_bar").animate({width:this.getWidth()})}}),t.ProgressBarBeacon=n.extend({onLoad:function(){this.emitEvent({type:o.Types.ACTIVATION_PROGRESS_BAR_STEP,payload:{step:this.curr}})}})},"./app/view/activation/twitter.js":function(e,t,i){var n=i("./app/view/share/connect.js").SocialConnector,o=i("./shared/core/component.js").Component;t.TwitterConnect=o.extend({onLoad:function(){var e=this;this.$id("@twitter_disconnect_button").click(function(){return e.serverCall("twitter_disconnect").liveMutate().send(),!1}),this.$id("@dismiss").click(function(){return e.serverCall("dismiss_twitter_connect").liveMutate().success(function(){e.$id("@twitter_connect").fadeOut(300)}).send(),!1})}}),t.TwitterConnectButton=n.extend({onLoad:function(){var e=this;this.$id("@twitter_connect_button").click(function(){e.serverCall("on_connect_button_press").send(),e.connectTwitter()})}})},"./app/view/admin.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./tooltip.js"),s=i("./view/inline_editor.js").InlineEditor,a=i("./unified_view/modal.js").ModalBase,r=i("./view/modal.js").Base,d=i("./view/dialog.js"),l=i("./w2.dialog.js"),c=i("./shared/window_manager.js"),u=i("./shared/keystrokes.js"),h=i("./settings-webpack.js").interface_strings;
t.AdminLogItemView=n.extend({onLoad:function(){var e=this;this.$id("@view").click(function(t){e.$id("@details").toggleClass("hidden"),t.preventDefault()}),this.$id("@item").hover(function(){e.$id("@item").addClass("hover"),e.$id("@buttons").removeClass("hidden")},function(){e.$id("@item").removeClass("hover"),e.$id("@buttons").addClass("hidden")}),o.attach(this.$id("@remove"),this.hide_title),this.$id("@remove").click(function(t){l.createDialog(e).title(e.hide_title).cancel(null,h.cancel).ok(function(){e.serverCall("hide_log_item").send()},e.hide_title).html(e.hide_message),t.preventDefault()})}}),t.AdminMode=n.extend({toggle:function(){this.serverCall("toggle").liveMutate().send()},onLoad:function(){function e(e){t.toggle(),e.preventDefault()}var t=this;t.$id("@toggle").click(e),t.listen&&u.on([81,49,81,49],e)}}),t.AdminModeListener=n.extend({toggle:function(){this.serverCall("toggle").liveMutate().send()},onLoad:function(e){function t(){i.toggle(),e.preventDefault()}var i=this;u.on([81,49,81,49],t);
}}),t.NicknameInlineEditor=s.extend({onLoad:function(){this._super.apply(this,arguments),"#editname"==c.getHash().substr(0,9)&&this.toggle_editor()}}),t.RemoveInboxMessagesLink=n.extend({onLoad:function(){var e=this;this.$id("@delete").click(function(t){t.preventDefault(),e.createModal("remove_inbox_messages_modal").onSubmit(function(){e.serverCall("delete_messages").liveMutate().send()}).show()})}}),t.AdminRemoveUserPhoto=n.extend({onLoad:function(e){var t=this;this.$id("@remove_photo_link").click(function(e){e.preventDefault(),t.createModal("remove_user_photo_modal").kwargs({uid:t.uid}).show()})}}),t.FlagNameLink=n.extend({onLoad:function(){var e=this;this.$id("@show_flag_name_modal").click(function(t){t.preventDefault(),e.createModal("flag_modal").kwargs({uid:e.uid,resolved:e.resolved}).show()})}}),t.ResolveNameLink=n.extend({onLoad:function(){var e=this;this.$id("@show_resolve_name_modal").click(function(t){t.preventDefault(),e.createModal("verify_modal").kwargs({uid:e.uid}).show()});
}}),t.RemoveUserPhotoModal=a.extend({onSubmit:function(){var e=this._super.bind(this);this.serverCall("remove_photo").kwargs({comment:this.$id("@comment").val()}).liveMutate().success(function(){e()}).send()}}),t.ResolveNameModal=a.extend({onSubmit:function(){var e=this._super.bind(this);this.serverCall("resolve_name").kwargs({reason:this.$id("@reason").val()}).liveMutate().success(function(){e()}).send()}}),t.FlagNameModal=a.extend({onSubmit:function(){var e=this._super.bind(this);this.serverCall("flag_name").kwargs({reason:this.$id("@reason").val()}).liveMutate().success(function(){e()}).send()}}),t.BanRemoveLink=n.extend({onLoad:function(){var e=this;e.$id("@ban_remove_link").click(function(t){t.preventDefault(),e.serverCall("ad_admin_uids").kwargs({uids:e.uids_to_ban_remove}).success(function(t){if(0==t.length)e.createModal("ban_remove_modal").kwargs({location:e.location,uids_to_ban_remove:e.uids_to_ban_remove,use_safe_ban:e.use_safe_ban}).show();else{var i="Some of these users (uids: "+t+") are admins on ";
i+="Quora ad accounts. If these users ",i+="should be banned, please first edit block the users, and email ",i+="ad-admin-bans@quora.com with a link to the users' profile pages ",i+="and whois pages to discuss next steps for the ban.",l.createDialog(e).title("Banning an ad admin").cancel(function(){e.createModal("ban_remove_modal").kwargs({location:e.location,uids_to_ban_remove:e.uids_to_ban_remove,use_safe_ban:e.use_safe_ban,force_ban_ad_admin:!0}).show()},"Ban anyway").ok(null).html(i)}}).send()})}}),t.BanRemoveModal=r.extend({onLoad:function(){this._super.apply(this,arguments),this.child("editor").focus()},onSubmit:function(){var e=this,t=e.child("editor");if(t.isOnlyWhiteSpace())return e.$id("@required_comment_warning").removeClass("hidden"),void t.focus();var i=t.serialize(),n=this.$id("@revert_edits").is(":checked"),o=this.$id("@mark_as_verified_spammer").is(":checked"),s=this.$id("@remove_votes").is(":checked"),a=function(t){return e.$id("@"+t).prop("checked")};return e.serverCall("ban_remove_all_users").kwargs({
comment:i,revert_edits:n,mark_as_verified_spammer:o,remove_votes:s,uids_to_ban_remove:e.uids_to_ban_remove.filter(a)}).liveMutate().success(function(){e._closeModal()}).send(),!1}}),t.SendMessageLinkBase=n.extend({onLoad:function(){var e=this;this.$id("@modal_link").on("click",function(t){t.preventDefault(),e.createModal("load_inner").kwargs({recipient_uid:e.recipient_uid}).show()})}}),t.SendMessageModalBase=a.extend({onSubmit:function(){var e=this._super.bind(this),t=this.child("editor").serialize();this.serverCall("submit").kwargs({msg:t}).liveMutate().success(function(){e()}).send()}}),t.BanUserDialog=d.AddCommentDialog.extend({getPars:function(){var e=this._super.apply(this,arguments);return e&&(e.removeMessages=this.$id("@checkbox").prop("checked")),e}}),t.AdminMessageDialog=d.Dialog.extend({onLoad:function(){this._super.apply(this,arguments),this.editor=this.child("editor"),this.editor.focus()},getPars:function(){return this.editor.isOnlyWhiteSpace()?!1:{msg:this.editor.serialize()
}}}),t.BanUserLink=d.DialogLink.extend({click:function(){var e=this;e.serverCall("attempt_ban_user").except("ad_admin_blocked",function(){var t="This user is an admin on a Quora ad account. If the user ";t+="should be banned, please first edit block this user, and email ",t+="ad-admin-bans@quora.com with a link to the user's profile page ",t+="and whois page to discuss next steps for the ban.",l.createDialog(e).title("Banning an ad admin").cancel(function(){e.options.force_ban_ad_admin=!0,l.createDialog(e).load("get_dialog",{kwargs:{ty:e.type,object_id:e.object_id,options:e.options}})},"Ban anyway").ok(null).html(t)}).success(function(){l.createDialog(e).load("get_dialog",{kwargs:{ty:e.type,object_id:e.object_id,options:e.options}})}).send()}})},"./app/view/ads.js":function(e,t,i){var n=i("./shared/action_log.js").ActionableComponent,o=i("./shared/jquery.js"),s=i("./shared/events/index.js"),a=i("./unified_view/toggle.js"),r=i("./view/fixable2.js"),d=i("./shared/ads_impression_logging.js"),l=i("./shared/core/component.js").Component;
t.TextAd=n.extend({onLoad:function(){this._super.apply(this,arguments),this.handleOnLoad()},registerWithImpressionsLogger:function(){d.registerAd(this)},handleOnLoad:function(){var e=this;o(document).ready(function(){setTimeout(function(){(0===e.$id("@wrapper").width()||0===e.$id("@wrapper").height())&&e.serverCall("log_blocked_impression").send()},100)}),this.handleEvent(s.Types.AD_REPORTED,function(t){t.payload.adId==e.adId&&(e.$id("@content_wrapper").addClass("hidden"),e.$id("@reported_msg").removeClass("hidden"))}),this.$id("@undo").click(function(t){t.preventDefault(),e.serverCall("remove_feedback").kwargs({ad_id:e.adId,impression_hash:e.impressionHash}).send(),e.unHideAd()})},unHideAd:function(){this.$id("@content_wrapper").removeClass("hidden"),this.$id("@reported_msg").addClass("hidden")},actionCallback:function(){this._super.apply(this,arguments),this.serverCall("flush_action_log").send()}}),t.AdLink=l.extend({onLoad:function(){var e=this;e._super.apply(this,arguments);var t=e.$id("@link");
t.on("mousedown",function(){t.attr("href",e.redirect_url)})}}),t.FeedInlineExpandAdToggle=a.ToggleBase.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.handleEvent(s.Types.FEED_ANSWER_INLINE_EXPAND,function(t){t.payload.aid==e.aid&&e.triggerSwitch()})}}),t.AdsDebugToggle=l.extend({onLoad:function(){this._state=!1,this.setupKeyboardShortcut()},toggle:function(){var e,t=this,i=document.getElementsByClassName("ads_debug_info");if(t._state)for(t._state=!1,e=0;e<i.length;e++)i[e].style.display="none";else for(t._state=!0,e=0;e<i.length;e++)i[e].style.display="block"},setupKeyboardShortcut:function(){i("./shared/keystrokes.js").on([65,68,83,65,68,83],this.toggle.bind(this))}}),t.RelatedQuestionsAdWrapper=l.extend({onLoad:function(){var e=this,t=o(document);e.handleEvent(s.Types.RELATED_QUESTIONS_EXPAND,function(i){var n=i.payload.elem;r.makeFixable(e.$id("@ad"),{scroll_dep:!0,min_scroll_callback:function(){return n.height()+70},max_scroll_callback:function(){return t.height();
}})})}})},"./app/view/ama.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./view/fixable2.js"),a=i("./view/selector.js").WithServerCallMessageMixin;t.AMAAddQuestionSelector=a.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.questionMarkInserted=!1;var t=e.$id("@logged_out_ama_ask");t&&t.on("click",this.triggerSignupWall.bind(this))},triggerSignupWall:function(){this.serverCall("trigger_signup_wall").send()},resultsServerCallHandler:function(){this._super.apply(this,arguments),this.$input.focus()},createNewQuestion:function(){var e=this;e.hasPendingServerCall()||e.makeServerCall(e.serverCall("create_new_question").kwargs({input_text:e.query}).liveMutate())},pickExistingQuestion:function(e){var t=this;t.hasPendingServerCall()||t.makeServerCall(t.serverCall("pick_existing_question").kwargs({qid:e}).liveMutate())},maybeInsertQuestionMark:function(){return"?"===this.query&&this.questionMarkInserted?(this.setQuery(""),void(this.questionMarkInserted=!1)):this.query?void(this.questionMarkInserted||null===this.query.match(/[?]$/)&&(this.questionMarkInserted=!0,
this.setQuery(this.query+"?"))):void(this.questionMarkInserted=!1)},queryDidChange:function(){this._super.apply(this,arguments),this.maybeInsertQuestionMark()},resultWasSelected:function(e){switch(e.ty){case"question":this.pickExistingQuestion(e.data.qid);break;case"create_question":this.createNewQuestion()}},updateServerMessage:function(e,t){if(e)this.setQuery("");else if(t&&t.message)return this.$id("@server_message_title").text(t.message.title),t.message.note&&this.$id("@server_message_note").text(t.message.note),!0;return!1}}),t.AMACoverBar=n.extend({onLoad:function(){this.$id("@question_button").on("click",function(){var e=o(".AMAQuestionAddHeader").offset().top;o("html,body").animate({scrollTop:e-80},"slow"),o(".AMAQuestionAddHeader").find(".selector_input").focus(),o(".AMAQuestionAddHeader").find(".selector_input").addClass("highlighted"),setTimeout(function(){o(".AMAQuestionAddHeader").find(".selector_input").removeClass("highlighted")},750)})}}),t.AmaSessionRightCol=n.extend({onLoad:function(){
var e=this.$id("@ticker").get(0);if(e||(e=this.$id("@upcoming").get(0)),e){var t=16;s.makeFixable(e,{scroll_dep:!0,height_dep:!0,extra_top_spacing:t})}}}),t.AMAWriterStats=n.extend({onLoad:function(){var e=this.$id("@writer_stats").get(0);e&&s.makeFixable(e,{scroll_dep:!0,extra_top_spacing:110})}}),t.AMAMetricGraph=n.extend({onLoad:function(){var e=new Rickshaw.Graph({element:this.$id("@rsgraph").get(0),series:[{color:"steelblue",data:this.series_data}],width:150,height:40,interpolation:"basis",renderer:"line"});e.render()}}),t.FinishSessionButton=n.extend({onLoad:function(){this.$id("@finish_session_button").on("click",this.finishSessionConfirm.bind(this))},finishSessionConfirm:function(){this.createModal("finish_session_confirm").onSubmit(this.finishSession.bind(this)).show()},finishSession:function(){this.serverCall("finish_session").kwargs({ama_id:this.ama_id}).success(this.redirectToSessionPage.bind(this)).sendOnlyOnce()},redirectToSessionPage:function(){window.location.replace(this.redirect_url);
}})},"./app/view/ama/self_serve.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.StartSessionModalLink=n.extend({onLoad:function(){this.$id("@start_session_modal_link").on("click",this.openSessionModal.bind(this))},openSessionModal:function(){this.createModal("open_session_modal").show()}}),t.QuestionA2ARow=n.extend({onLoad:function(){this.$id("@request_button").on("click",this.addRequest.bind(this))},addRequest:function(){this.serverCall("add_request").liveMutate().send(),this.$id("@unrequested_state").addClass("hidden"),this.$id("@requested_state").removeClass("hidden")}})},"./app/view/answer.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/views.js").viewsLogger,s=i("./shared/events/index.js");t.AnswerHeader=n.extend({onLoad:function(){var e=this;this.handleEvent(s.Types.ANSWER_VOTE_STATE,function(t){if(t.payload.aid==e.aid){var i="upvoted"==t.payload.state;e.$id("@credibility_fact_no_vote").toggleClass("hidden",i),e.$id("@credibility_fact_upvoted").toggleClass("hidden",!i);
}})}}),t.ToggledAnswerHeader=n.extend({onLoad:function(){var e=this;this.toggled=!1,this.handleEvent(s.Types.INLINE_EDITOR_STATE,function(t){t.payload.contentType==e.contentType&&t.payload.oid==e.oid&&("cancel"==t.payload.state?e.performCancel():"edit"==t.payload.state?e.updateState(!0):"submit"==t.payload.state?e.updateState(!1):"submitted"==t.payload.state?e.updateState(!1):"toggle"==t.payload.state&&e.updateState(!e.toggled))})},updateState:function(e){setTimeout(this._updateState.bind(this,e),0)},_updateState:function(e){this.toggled=e,this.toggled?this.performEdit():this.performCancel()},performEdit:function(){this.$id("@read_mode_header").addClass("hidden"),this.$id("@edit_mode_header").removeClass("hidden")},performCancel:function(){this.$id("@read_mode_header").removeClass("hidden"),this.$id("@edit_mode_header").addClass("hidden")}}),t.AnswerListItem=n.extend({onLoad:function(){o.addComponentToTrack(this);var e=this;e.answerFeedbackLoaded=!1,e.handleEvent(s.Types.ANSWER_VOTE_STATE,function(t){
t.payload.aid==e.aid&&("downvoted"==t.payload.state?e.showAnswerDownvoteFeedback():e.hideAnswerDownvoteFeedback())})},showAnswerDownvoteFeedback:function(){var e=this;e.$id("@item").addClass("hidden"),e.$id("@answer_feedback").removeClass("hidden"),e.answerFeedbackLoaded===!1&&e.serverCall("load_downvote_feedback").contentFor(e.$id("@answer_feedback")).success(function(){e.answerFeedbackLoaded=!0}).send()},hideAnswerDownvoteFeedback:function(){this.$id("@item").removeClass("hidden"),this.$id("@answer_feedback").addClass("hidden")}})},"./app/view/answer_wiki.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./view/inline_editor.js").InlineEditor;t.CreateAnswerWikiInlineEditor=o.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.$id("@inline_editor_cancel").click(function(){return e.hideEditor(),!1})},trigger_request:function(){return this._super.apply(this,arguments),this.isEditorEmpty()&&this.hideEditor(),!1},hideEditor:function(){this.toggle_editor(),n("#answer_wiki").addClass("hidden");
},_get_kwargs:function(){return{qid:this.id,input:this.get_value()}}}),t.AnswerWikiInlineEditor=o.extend({_get_kwargs:function(){var e="";this.has_comment&&!this.child("comment_editor").isOnlyWhiteSpace()&&(e=this.child("comment_editor").serialize());var t,i=this.$id("@notif");return t=i&&i.prop("checked")?1:0,{qid:this.id,input:this.get_value(),sugg_exists:this.sugg_exists,comment:e,notif:t}}})},"./app/view/ask.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./shared/window_manager.js"),s=i("./view/selector.js").WithServerCallMessageMixin;t.AskSelector=s.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.questionMarkInserted=!1,e.$headerNav=e.parent().$id("@nav"),e.$contentWrapper=n(".ContentWrapper"),e.$id("@ask_button").click(function(t){e.addQuestion()}),e.$input.focus(function(t){e.$headerNav.fadeTo(400,.4)}),e.$input.blur(function(t){e.$headerNav.fadeTo(400,1),e.$contentWrapper.fadeTo(400,1)}),e.$input.val().length>0&&(e.$input.focus(),e.updateResults())},addQuestion:function(){
var e=this;e.hasPendingServerCall()||e.makeServerCall(e.serverCall("add_question").kwargs({input_text:e.query}))},maybeInsertQuestionMark:function(){return"?"===this.query&&this.questionMarkInserted?(this.setQuery(""),void(this.questionMarkInserted=!1)):this.query?void(this.questionMarkInserted||null===this.query.match(/[?]$/)&&(this.questionMarkInserted=!0,this.setQuery(this.query+"?"))):void(this.questionMarkInserted=!1)},queryDidChange:function(){this._super.apply(this,arguments),this.maybeInsertQuestionMark()},resultsDidChange:function(){var e=this.child("results").numResults>0?.4:1;this.$contentWrapper.fadeTo(400,e)},resultWasSelected:function(e){switch(e.ty){case"question":o.navigateTo(e.data.url);break;case"ask_question":this.addQuestion()}},updateServerMessage:function(e,t){if(e)t.url&&o.navigateTo(t.url);else if(t&&t.message)return this.$id("@server_message_title").text(t.message.title),t.message.note&&this.$id("@server_message_note").text(t.message.note),!0;return!1}})},"./app/view/board.js":function(e,t,i){
var n=i("./shared/core/component.js").Component,o=i("./shared/cookies.js");t.BoardNameLink=n.extend({onLoad:function(e){var t=this;this.$id("@link").mousedown(function(){o.setQfeedLog(t,"BoardClickthrough"),o.setQueryLog(t,"BoardClickthrough")})}})},"./app/view/board/blog.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js");t.CreateBlog=n.extend({onLoad:function(){var e=this;this.submitted=!1,this.$id("@name").focus(),this.$id("@fake_editor").click(function(){return e.$id("@fake_editor_row").hide(),e.$id("@editor_row").show(),e.child("editor").focus(),!1}),this.$id("@create").click(function(){var t=o.trim(e.$id("@name").val()),i=e.child("subdomain").getInput().val();if(t?e.$id("@name").removeClass("input_validation_error"):(e.$id("@name").addClass("input_validation_error"),e.$id("@name").focus()),i?e.child("subdomain").getInput().removeClass("input_validation_error"):(e.child("subdomain").getInput().addClass("input_validation_error"),t&&e.child("subdomain").getInput().focus()),
i&&t&&e.child("subdomain").urlIsOK&&!e.submitted){e.$id("@create").addClass("submit_button_disabled"),e.submitted=!0;var n=e.child("editor").serialize();e.disable(),e.serverCall("create").kwargs({name:t,description:n,url:i,topics:""}).success(function(e){e&&(document.location=e)}).liveMutate().send()}return!1})},disable:function(){this.child("editor").disable()}})},"./app/view/board/create_box.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./settings-webpack.js"),s=i("./w2.dialog.js").Dialog,a=i("./shared/facebook.js"),r=i("./view/inline_editor.js").InlineEditor,d=i("./view/selector.js").MultiSelector;t.BoardCreatePostBox=n.extend({onLoad:function(){var e=this.child("title_box"),t=this.child("editor");e.whenOnLoaded(function(){e.setMeaningfulChangeCallback(function(){t.save_draft(!1)})}),t.whenOnLoaded(function(){t.setTitleBox(e)})}}),t.BoardCreatePostTitleBox=n.extend({onLoad:function(){this.editor=this.child("title_editor");var e=this;this.$id("@fake_editor").click(function(){
return e.toggle_editor(),!1})},isOnlyWhiteSpace:function(){return this.editor.isOnlyWhiteSpace()},disableEditor:function(){this.editor.disable()},clearEditor:function(){this.editor.clear()},serialize:function(){return this.editor.serialize()},setMeaningfulChangeCallback:function(e){this.editor.setMeaningfulChangeCallback(e)},toggle_editor:function(){this.$id("@fake_editor_row").hide(),this.$id("@editor_row").show(),this.$id("@editor_row .qtext_editor_content").focus()},titleRequired:function(){this.$id("@title_required").show()},titleRequiredReset:function(){this.$id("@title_required").hide()}}),t.CreateBoardPostEditor=r.extend({onLoad:function(){var e=this;if(this._super.apply(this,arguments),this.$id("@remove_via").click(function(){return e.$id("@via_text").hide(),e.$id("@via").remove(),!1}),this.seenUrls={},this.$id("@fake_editor").click(this.showEditor.bind(this)),this.saved_seen_urls)for(var t=0;t<this.saved_seen_urls.length;t++)this.seenUrls[this.saved_seen_urls[t]]=!0;this.titleBox=null;
var i=this.child("topic_selector");i&&i.whenOnSavedResultsChanged(function(t){e._topics=t})},setTitleBox:function(e){this.titleBox=e},showEditor:function(){this.$id("@content").show(),this.editor.focus()},submitHandler:function(){var e=this;this.input_button_obj.click(function(){if(!e.editor.isOnlyWhiteSpace()||null!==e.preview||e.id){if(e.titleBox){if(e.titleBox.titleRequiredReset(),e.titleBox.isOnlyWhiteSpace())return e.titleBox.toggle_editor(),e.titleBox.titleRequired(),!1;e.titleBox.disableEditor()}e.editor.disable(),e.trigger_request()}return!1})},removeUrl:function(){this.$id("@preview_url").html(""),this.$id("@preview_url_section, #@link_editor_buttons").hide(),this.$id("@remove_url").hide(),this.preview=null,this.editor.focus()},reset:function(){this.titleBox&&this.titleBox.clearEditor(),this.editor.enable(),this.editor.clear(!0),this.$id("@preview_url_section, #@link_editor_buttons").hide(),this.$id("@remove_url").hide(),this.seenUrls={},this.removeUrl(),this.draft_space&&(this.draft_space.draft_id=null);
},cancelEditor:function(){this.canSaveDraft()&&null!==this.draft_space.draft_id&&this.save_draft(!1),this.closeDialog()},reportSuccess:function(){},ajax_callback:function(e){if(this.redirect_on_post&&e)document.location=e;else{if(this.is_dialog)return this.reportSuccess(),void this.closeDialog();this.reset()}},closeDialog:function(){s.dialogFor(this).close_()},getBid:function(){return this.bid?this.bid:null},getBoardName:function(){return null},getVia:function(){return this.$id("@via")?this.$id("@via").val():null},getIsSubmission:function(){return this.is_submission},setIsSubmission:function(e){this.is_submission=e},getLinkURL:function(){var e=this.getLinkPreview();return e?e.url:null},getLinkPreview:function(){return this.preview?this.child("link_editor").getPreviewLinkInfo():null},getTitle:function(){return this.titleBox?this.titleBox.serialize():null},getSeenUrlsAsArray:function(){var e=[];for(var t in this.seenUrls)e.push(t);return e},getLoggedAction:function(){return"PostAdd"},canSaveDraft:function(){
return this.draft_space&&!this.save_draft_disabled},enableSaveDraft:function(){this.save_draft_disabled=!1},disableSaveDraft:function(){this.save_draft_disabled=!0},onClearDraft:function(){this.reset()},save_draft:function(e){var t=this;if(this.canSaveDraft()){this.disableSaveDraft();var i=e?"save_draft":"save_draft_auto",n=this._get_kwargs();n.window_id=o.windowId,n.target=this.target,n.url=this.url,n.seen_urls=this.getSeenUrlsAsArray();var s=this.serverCall(i).kwargs(n).success(function(e){t.enableSaveDraft(),t.draft_space&&t.draft_space.draft_id!=e&&(t.draft_space.draft_id=e),t.updateSavedState(n.description)}).error(this.enableSaveDraft.bind(this));e&&s.liveMutate(),s.send()}},_get_kwargs:function(){return{draft_space:this.draft_space,bid:this.getBid(),object_id:this.id,name:this.getBoardName(),description:this.get_value(),title:this.getTitle(),link_url:this.getLinkURL(),preview:this.getLinkPreview(),via:this.getVia(),topics:this._topics||[],is_submission:this.getIsSubmission(),fb_uid:a.getFbUid(),
fb_access_token:a.getAccessToken(),fb_expires:a.getExpiresIn()}}}),t.BoardTopicMultiSelector=d.extend({whenOnSavedResultsChanged:function(e){this._onSavedResultsChanged=e},onSavedResultsChanged:function(){this._onSavedResultsChanged&&this._onSavedResultsChanged(this.saved_results)}})},"./app/view/board/follow_invite.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./w2.dialog.js"),s=i("./settings-webpack.js").interface_strings;t.FollowInviteEmailButton=n.extend({onLoad:function(){var e=this;this.$id("@invite").click(function(){return e.setEmailTo(e.email),!1})},setEmailTo:function(e){var t=this;this._dialog=o.createDialog(this).title(null).cancel(null,s.cancel).ok(function(i){var n=i.dialogComponent,o=n.getMessage(),s=n.getSubject(),a=n.name;t.serverCall("invite_to_follow").kwargs({name:a,email:e,msg:o,subject:s}).liveMutate().success(function(){t._dialog.close_()}).send()},this.invite_text).load("invite_dialog",{kwargs:{email:e}})}}),t.InviteToFollowDialogContents=n.extend({
onLoad:function(){this.child("msg").focus()},getMessage:function(){return this.child("msg").serialize()},getSubject:function(){return this.child("subject").serialize()}})},"./app/view/board/item.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/cookies.js"),s=i("./app/view/board/view_tracker.js"),a=i("./view/inline_editor.js").InlineEditor,r=i("./shared/views.js").viewsLogger;t.BoardItemTimestamp=n.extend({onLoad:function(e){var t=this;t.$id("@link").mousedown(function(){o.setQfeedLog(t,"BoardItemClickthrough"),o.setQueryLog(t,"BoardItemClickthrough")})}}),t.BoardItemTitle=n.extend({onLoad:function(e){var t=this;t.$id("@link").mousedown(function(){o.setQfeedLog(t,"BoardItemClickthrough"),o.setQueryLog(t,"BoardItemClickthrough")})}}),t.LinkBoardItemView=n.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.$id("@edit").click(function(){return e.showEditor(),!1}),e.$id("@item").hover(function(t){e.$id("@item").addClass("hover")},function(t){
e.$id("@item").removeClass("hover")})},showEditor:function(){this.child("description").child("editor").toggle_editor()}}),t.LinkBoardItemDescriptionInlineEditor=a.extend({_get_kwargs:function(){return{input:this.get_value(),preview:this.child("link_editor").getPreviewLinkInfo()}}}),t.BoardListItem=n.extend({onLoad:function(){s.instance&&s.instance.addBoardItem(this.cid,this.board_item_id)},onUnload:function(){s.instance&&s.instance.removeBoardItem(this.cid,this.board_item_id)}}),t.BoardItem=n.extend({onLoad:function(){r.addComponentToTrack(this)}})},"./app/view/board/settings.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./view/selector.js").Selector;t.BlogSubdomainInput=n.extend({onLoad:function(){var e=this;this.urlIsOK=!1,this.$id("@url").on("keyup",function(t){e.checkURL()}),this.$id("@update").click(function(){return e.updateURL(),!1})},checkURL:function(){var e=this,t=this.$id("@url").val();this.serverCall("check_url").kwargs({url:t}).success(function(t){
t===!0?e.urlAvailable():t===!1?e.urlNotAvailable():e.urlEmpty()}).error(this.urlNotAvailable.bind(this)).send()},getInput:function(){return this.$id("@url")},urlEmpty:function(){this.urlAvailable(),this.urlIsOK=!1,this.bid&&this.$id("@button").addClass("hidden")},urlAvailable:function(){this.urlIsOK=!0,this.$id("@domain_unavailable").addClass("hidden"),this.$id("@url").removeClass("input_validation_error"),this.bid&&this.$id("@button").removeClass("hidden")},urlNotAvailable:function(){this.urlIsOK=!1,this.$id("@domain_unavailable").removeClass("hidden"),this.$id("@url").addClass("input_validation_error"),this.bid&&this.$id("@button").addClass("hidden")},updateURL:function(){var e=this.$id("@url").val();return e&&this.serverCall("register_choice").kwargs({url:e}).success(function(){window.location.reload(!0)}).liveMutate().send(),!1}}),t.BoardParticipantSelector=o.extend({resultWasSelected:function(e){var t=this;this.serverCall("add").kwargs({bid:this.metadata.bid,target_uid:e.data.uid}).success(function(){
t.setQuery(""),t.focus()}).liveMutate().send()}})},"./app/view/board/submission.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./w2.dialog.js"),s=i("./settings-webpack.js").interface_strings;t.RejectSubmission=n.extend({onLoad:function(){var e=this;this.$id("@link").click(function(){return e._dialog=o.createDialog(e).title(e.title).cancel(null,s.cancel).ok(function(t){var i=t.dialogComponent,n=i.child("comment").serialize();e.serverCall("reject").kwargs({comment:n}).liveMutate().send()},e.button_text).load("comment_dialog"),!1})}}),t.SubmissionView=n.extend({onLoad:function(e){var t=this;this.$id("@item").hover(function(e){t.$id("@delete").show(),t.$id("@item").addClass("hover")},function(e){t.$id("@delete").hide(),t.$id("@item").removeClass("hover")}),this.$id("@update_accept").click(function(){return t.request("update_accept"),!1}),this.$id("@update").click(function(){return t.request("update"),!1}),this.$id("@edit").click(function(){return t.toggle(),!1}),this.$id("@cancel").click(function(){
return t.toggle(),!1})},getNewPreview:function(){return null},request:function(e){var t=this.child("description").serialize(),i=this.child("title").serialize(),n=this.getNewPreview();this.serverCall(e).kwargs({new_description:t,new_title:i,new_preview:n}).liveMutate().send()},toggle:function(){this.$id("@editor").toggleClass("hidden"),this.$id("@content").toggle()}}),t.RejectSubmissionDialogContents=n.extend({onLoad:function(){var e=this;this.$id("@link").click(function(){return e.$id("@comment").toggle(),e.child("comment").focus(),!1})}})},"./app/view/board/view_tracker.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/core/component.js"),s=i("./shared/jquery.js"),a=i("./shared/viewport.js");t.instance=null,t.BoardItemViewTracker=n.extend({init:function(){t.instance=this,this.all_board_item_ids={},this.reported_board_item_ids={},this.last_report_time=+new Date,this.rate_limit_ms=3e3},onLoad:function(){var e=this.report.bind(this);document.addEventListener("mousemove",e),
document.addEventListener("keypress",e),document.addEventListener("scroll",e)},addBoardItem:function(e,t){this.all_board_item_ids[e]=t},removeBoardItem:function(e,t){delete this.all_board_item_ids[e]},isBoardItemVisible:function(e){var t=o._domids[e];if(!t)return!1;var i=document.getElementById(t);if(!i)return!1;var n=s(i);return a.isElementInViewport(n.children("div:first").get(0))?!1:n.is(":visible")?!0:!1},report:function(){var e=+new Date;if(!(e<this.last_report_time+this.rate_limit_ms)){this.last_report_time=e;var t=[];for(var i in this.all_board_item_ids){var n=this.all_board_item_ids[i];void 0===this.reported_board_item_ids[n]&&this.isBoardItemVisible(i)&&(t.push(n),this.reported_board_item_ids[n]=!0)}t.length>0&&this.serverCall("report").kwargs({board_item_ids:t}).send()}}})},"./app/view/bug_report.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./view/modal.js").Base,a=i("./view/upload.js");t.BugReportModalLink=n.extend({onLoad:function(){
var e=this;this.$id("@send_feedback").on("click",function(t){t.preventDefault(),e.createModal("load_inner").show()})}}),t.BugReportModal=s.extend({onLoad:function(){var e=this;this.child("upload_form").success(this.uploadSuccess.bind(this)).failure(this.uploadFailure.bind(this)),this.$id("@editor").focus(),this.$id("@close_button").click(function(){e._closeModal()}),this.$id("@cancel_button").click(function(){e._closeModal()}),this.$id("@submit_button").click(function(t){t.preventDefault();var i=e.$id("@editor").val().trim(),n=e.$id("@photo_key").val();return e.serverCall("submit_feedback").kwargs({target:e.target,msg:i,photo_key:n}).success(function(){i&&e._closeModal()}).sendOnlyOnce(),!1})},uploadSuccess:function(e){this.$id("@photo_key").val(e.photo_key),this.serverCall("upload").kwargs({photo_key:e.photo_key,target:this.target}).contentFor(this.$id("@iframe")).send()},uploadFailure:function(){o(".drop_zone").removeClass("drag_and_hover"),this.child("upload_form").hideSpinner();var e=this.child("upload_form").$id("@file");
if(e){var t=e.get(0).files;0!==t.length&&(e.get(0).value=null)}}}),t.BugReportMain=a.UploadDialogContents.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.$id("@submit_report").click(function(t){t.preventDefault(),e.$id("@submit_report").prop("disabled",!0);var i,n=e.$id("@subject").val(),s=e.$id("@description").val(),a=e.$id("@photo_key").val(),r=e.$id("@project").val(),d=e.$id("@priorities").val();return i=r===e.$id("@queue_project").val()?o.map(e.$id("@select_queues input:checked"),function(e){return e.value}):null,e.serverCall("submit_report").kwargs({target:e.target,subject:n,description:s,photo_key:a,project:r,priority:d,queue_types:i}).success(function(e){window.location.reload()}).sendOnlyOnce(),!1}),this.$id("@project").change(function(t){var i=e.$id("@select_queues");o(this).val()===e.$id("@queue_project").val()?i.show():i.hide()})},uploadSuccess:function(e){this.$id("@photo_key").val(e.photo_key),this.serverCall("upload").kwargs({photo_key:e.photo_key,
target:this.target}).contentFor(this.$id("@upload_screenshot")).send()}}),t.BugReportTableCell=n.extend({onLoad:function(){var e=this;this.$id("@delete_report").click(function(t){return e.serverCall("delete_report").kwargs({report_id:e.report_id}).success(function(e){window.location.reload()}).send(),!1})}})},"./app/view/comment.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/logging.js");t.CommentLink=n.extend({onLoad:function(){var e=this,t=e.$id("@view_comment_link");e.hasCheckedTriggeringModal=!1,t.on("click",function(t){o.log("comments_toggled",{comment_type:e.comment_type,object_id:e.object_id})})},maybeTriggerModal:function(){var e=this;e.is_logged_in&&("board_item_id"===e.type||e.hasCheckedTriggeringModal||(e.hasCheckedTriggeringModal=!0,e.serverCall("should_trigger_warning_modal").success(function(t){t&&e.triggerModal()}).send()))},triggerModal:function(){this.createModal("load_modal").show(),this.serverCall("mark_education_modal_seen").send()}
})},"./app/view/common.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./view/inline_editor.js"),s=i("./shared/events/index.js"),a=o.InlineEditor;t.SuggestedEditSaveButton=n.extend({onLoad:function(){var e=this;this.$id("@accept").click(function(){return e.serverCall("publish_edit").liveMutate().send(),!1})}}),t.Content=n.extend({onLoad:function(){this.$content=this.$id("@content"),this.$editor=this.$id("@editor"),this.bindEditorCallbacks(),this.editorFetched=this.editor_loaded,this.editorLoaded=this.editor_loaded},toggle:function(e){this.emitEvent({type:s.Types.QTEXT_EXPANDABLE_STATE,payload:{content_type:this.content_type,oid:this.oid}});var t=this.$content.hasClass("hidden");null!=e&&(t=e),t?this.showContent():this.showEditor()},showContent:function(){this.$content.removeClass("hidden"),this.$editor.addClass("hidden")},showEditor:function(){return this.editorLoaded?(this.$content.addClass("hidden"),void this.$editor.removeClass("hidden")):(this.$id("@loading").removeClass("hidden"),
void this.fetchEditor())},fetchEditor:function(){var e=this;this.editorFetched||(this.editorFetched=!0,this.serverCall("editor_component").contentFor(this.$editor).success(function(){e.$id("@loading").addClass("hidden"),e.editorLoaded=!0,e.emitEvent(s.helpers.inlineEditorEdit(e.content_type,e.oid)),e.showEditor()}).send())},bindEditorCallbacks:function(){var e=this;this.handleEvent(s.Types.INLINE_EDITOR_STATE,function(t){t.payload.contentType==e.content_type&&t.payload.oid==e.oid&&("edit"==t.payload.state?e.toggle(!1):"cancel"==t.payload.state?e.toggle(!0):"submitted"==t.payload.state?e.toggle(!0):"toggle"==t.payload.state&&e.toggle())})}});var r=t.SuggestedEditsEditor=a.extend({onLoad:function(){this._super.apply(this,arguments),this.disclaimer_update="",this.answer_attribution_update="";var e=this;this.setToggleCallback(function(){if(e.parent()){var t=e.parent();t.toggleButtons&&t.toggleButtons(),t.$id("@disclaimer").toggle(),t.$id("@nfr").toggle(),t.$id("@answer_attribution").toggle();
}e.editorShown&&e.editor.fixEditorButtons()}),e.child("editor").setEditorReadyCallback(function(){e.original_input=e.get_value()})},submitHandler:function(){var e=this;this.input_button_obj.click(function(t){e.trigger_request(),t.preventDefault()})},okToSubmitRequest:function(){return this.editor.hasChanged(this.original_input)||this.always_submit||""!==this.disclaimer_update||""!==this.answer_attribution_update?this._super.apply(this,arguments):!1},_get_kwargs:function(){var e="";return this.has_comment&&!this.child("comment_editor").isOnlyWhiteSpace()&&(e=this.child("comment_editor").serialize()),{object_id:this.id,input:this.get_value(),sugg_exists:this.sugg_exists,notif:this.$id("@notif").prop("checked")?1:0,comment:e,disclaimer_update:this.disclaimer_update,answer_attribution_update:this.answer_attribution_update,share_values:{}}}});t.AnswerEditor=r.extend({onLoad:function(){this._super.apply(this,arguments),this.answerShareForm=this.child("answer_share_form"),this.editorShare=this.answerShareForm&&this.answerShareForm.child("editor_share");
},_get_kwargs:function(){var e=this._super();return this.editorShare&&(e.share_values=this.editorShare.getValues()),e}}),t.PostEditor=r.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.handleEvent(s.Types.POST_DISCLAIMER,function(t){t.payload.pid==e.id&&(e.disclaimer_update=t.payload.state)})}}),t.FeedStoryItem=n.extend({onLoad:function(){var e=this;this.$id("@item").hover(function(){e.$id("@item").addClass("hover")},function(){e.$id("@item").removeClass("hover")}),this.handleEvent(s.Types.QUESTION_CANT_ANSWER_STATE,function(t){if(t.payload.qid==e.qid){var i="passed"==t.payload.state;e.$id("@item").toggleClass("cant_answer",i)}})},getHash:function(){return this.hash}})},"./app/view/components.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/cookies.js"),s=i("./w2.dialog.js"),a=i("./shared/jquery.js"),r=i("./settings-webpack.js").interface_strings,d=i("./shared/action_log.js");t.TruncatedQText=n.extend({onLoad:function(e){this.$more=this.$id("@more_link");
var t=this.$more.attr("href");t&&"#"!=t&&this.$id("@truncated").on("click",function(e){e.preventDefault(),window.open(t,"_blank")})}}),t.TruncatePhraseList=n.extend({onLoad:function(){var e=this;e.$id("@view_all_link").click(function(){return e.$id("@partial_phrases").addClass("hidden"),e.$id("@all_phrases").removeClass("hidden"),!1})}});var l=function(e){return"A"==e.target.nodeName||a(e.target).hasClass("qtext_embed")};t.QtextTruncate=n.extend({init:function(){this._super.apply(this,arguments),this.callback=null},onLoad:function(e){var t=this;(t.show_more&&t.was_truncated||t.$id("@more_link").length>0)&&(t.$id("@text_snip").click(function(e){return l(e)?void 0:t.onClick()}),t.$id("@more_link").click(function(){return t.onClick()}))},onClick:function(){var e=this;return e.viewMore(),e.callback&&e.callback(),!1},setCallback:function(e){this.callback=e},viewMore:function(){this.$id("@text_snip").addClass("hidden"),this.$id("@full_text").removeClass("hidden")}}),t.SimpleUserRequest=n.extend({
onLoad:function(){var e=this;this.$id("@link").click(function(t){e.onClick(),t.preventDefault()})},onClick:function(){this.upvote&&(o.setQfeedLog(this,"BoardItemUpvote"),o.setQueryLog(this,"BoardItemUpvote"),o.setTlog({type:"BoardItemUpvote",board_item_id:this.board_item_id}),d.logSecondaryAction("BoardItemUpvote",{type:"board_item",board_item_id:this.board_item_id})),this.downvote&&(o.setQfeedLog(this,"BoardItemDownvote"),o.setTlog({type:"BoardItemVoteDown",board_item_id:this.board_item_id})),(this.board_follow_button||this.board_request_follow_button)&&(o.setQfeedLog(this,"BoardFollow"),o.setQueryLog(this,"BoardFollow"),o.setTlog({type:"BoardFollow",bid:this.bid}),d.logSecondaryAction("BoardFollow",{type:"board",bid:this.bid})),this.serverCall("request").liveMutate().send()}}),t.SimpleUserRequestConfirm=n.extend({onLoad:function(){var e=this;this.$id("@link").click(function(){return e._dialog=s.createDialog(e).title(e.title).cancel(null,r.cancel).ok(function(){e.serverCall("request").liveMutate().send();
},e.button_text).html(e.confirm_text),!1})}}),t.OrderItemButtons=n.extend({onLoad:function(){var e=this;this.$id("@up").click(function(){return e.serverCall("move_up").liveMutate().send(),!1}),this.$id("@down").click(function(){return e.serverCall("move_down").liveMutate().send(),!1})}}),t.QuestionFooter=n.extend({onLoad:function(){var e=this;e.$id("@link").mousedown(function(){o.setQfeedLog(e,"QuestionAnswersClickthrough"),o.setQueryLog(e,"QuestionAnswersClickthrough")})}})},"./app/view/contact_importer.js":function(e,t,i){function n(e,t){var i=!1;return s.each(t,function(t,n){return n.test(e)?void(i=!0):void 0}),i}var o=i("./settings-webpack.js"),s=i("./shared/jquery.js"),a=i("./shared/events/index.js"),r=i("./shared/google_.js"),d=i("./shared/core/component.js").Component,l=[/@yahoo\.(ca|cn|co\.id|co\.in|co\.jp|co\.kr|co\.nz|co\.uk|com|com\.ar|com\.au|com\.br|com\.cn|com\.hk|com\.mx|com\.my|com\.ph|com\.sg|com\.tr|com\.tw|com\.vn|de|dk|es|fr|gr|ie|it|no|pl|se)$/,/@ymail\.com$/,/@rocketmail\.com$/],c=[/@gmail\.com$/,/@googlemail\.com$/],u=t.ImportContactsForm=d.extend({
isGoogleAppsEmail:!1,shouldLogImpression:!0,onLoad:function(){var e=this;this.isGoogleAppsEmail=this.is_google_apps_email,this.prevEmail=this.getEmail(),s("input[type=submit]").focus(),this.$id("@email").on("keyup",function(){e.prevEmail!=e.getEmail()&&(e.prevEmail=e.getEmail(),e.validateEmail())}),s("input[type=submit]").on("click",function(){return e.onSubmit()}),this.shouldLogImpression&&this.serverCall("log_impression").kwargs({email:this.getEmail()}).send(),s(document).on("oauth_approved",function(t,i){e.updateAndSubmitForm(i.service,i.accessToken)}),s(document).on("oauth_rejected",function(t,i){e.onOAuthRejected(i.service)})},submitForm:function(){this.$id("@contact_importer_form").submit()},updateAndSubmitForm:function(e,t){this.$id("@service").val(e),this.$id("@access_token").val(t),this.$id("@spinner").show(),this.submitForm()},onOAuthRejected:function(e){},onSubmit:function(){return this.openOAuthDialog(this.getEmail())?!1:!0},getEmail:function(){return s.trim(this.$id("@email").val());
},lastTimeoutId:null,validateEmail:function(){var e=this.getEmail();if(!e)return this.onOAuthEmailEntered("empty"),!1;this.lastTimeoutId&&(clearTimeout(this.lastTimeoutId),this.lastTimeoutId=null);var t=n(e,l),i=n(e,c);this.isGoogleAppsEmail=!1,this.isGoogleAppsDomainCheckQueued=!1,t?this.onOAuthEmailEntered("yahoo"):i?this.onOAuthEmailEntered("gmail"):(this.onUnknownDomainEntered(),this.lastTimeoutId=setTimeout(this.checkGoogleAppsDomain.bind(this),500))},onOAuthEmailEntered:function(e){},onUnknownEmailDomainEntered:function(){},isCheckingGoogleAppsDomain:!1,isGoogleAppsDomainCheckQueued:!1,checkGoogleAppsDomain:function(){if(this.isCheckingGoogleAppsDomain)return void(this.isGoogleAppsDomainCheckQueued=!0);this.isCheckingGoogleAppsDomain=!0;var e=this.getEmail(),t=this;this.serverCall("is_google_apps_domain").kwargs({email:e}).success(function(i){i&&(t.isGoogleAppsEmail=!0),t.onCheckGoogleAppsDomainResponse(e,i),t.isCheckingGoogleAppsDomain=!1,t.isGoogleAppsDomainCheckQueued&&(t.isGoogleAppsDomainCheckQueued=!1,
t.checkGoogleAppsDomain())}).send()},onCheckGoogleAppsDomainResponse:function(e,t){},logOAuthAttempt:function(e){this.serverCall("log_contact_importer_oauth_attempt").kwargs({email:e}).send()},onGoogleOAuthCallback:function(e){if(e&&void 0===e.error){var t="google",i=e.access_token;this.updateAndSubmitForm(t,i)}else this.onOAuthRejected()},openOAuthDialog:function(e){var t=this;return n(e,l)?(t.logOAuthAttempt(e),window.open("/oauth/yahoo","_BLANK","height=400,width=800"),!0):n(e,c)||t.isGoogleAppsEmail?(t.logOAuthAttempt(e),r.onInit(function(){var e={callback:t.onGoogleOAuthCallback.bind(t),clientid:o.googleClientId,cookiepolicy:o.googleCookiePolicy,scope:t.scopes};t.prompt_ota_install&&(e.apppackagename=o.androidAppPackageName),window.gapi.auth.signIn(e)}),!0):!1},getEmailDomain:function(e){return n(e,l)?"yahoo":n(e,c)||this.isGoogleAppsEmail?"google":"other"}}),h=u.extend({onLoad:function(){this._super.apply(this,arguments),this.$id("@contact_importer_form").submit(this.onFormSubmit.bind(this));
},onFormSubmit:function(){return!this.child("submit").$id("@import_contacts").is(":disabled")},unsupportedMessageTimeoutId:null,clearUnsupportedMessageTimeout:function(){this.unsupportedMessageTimeoutId&&(clearTimeout(this.unsupportedMessageTimeoutId),this.unsupportedMessageTimeoutId=null)},onOAuthEmailEntered:function(e){this.$id("@spinner").hide(),this.$id("@email_import_error").hide(),this.$id("@unsupported_domain").hide(),this.$id("@form_error").hide(),this.enableSubmitButton(!0),this.clearUnsupportedMessageTimeout()},onUnknownDomainEntered:function(){this.$id("@spinner").show(),this.$id("@email_import_error").hide(),this.$id("@form_error").hide(),this.enableSubmitButton(!1),this.clearUnsupportedMessageTimeout()},onUnsupportedDomainEntered:function(){this.$id("@spinner").hide(),this.$id("@unsupported_domain").show(),this.$id("@email_import_error").show(),this.enableSubmitButton(!1)},onCheckGoogleAppsDomainResponse:function(e,t){if(this.getEmail()==e)if(t)this.$id("@spinner").hide(),
this.$id("@unsupported_domain").hide(),this.enableSubmitButton(!0);else{var i=this;this.unsupportedMessageTimeoutId=setTimeout(function(){i.onUnsupportedDomainEntered()},500)}},enableSubmitButton:function(e){e?this.child("submit").$id("@import_contacts").attr("disabled",!1).removeClass("submit_button_disabled").addClass("follow_button"):this.child("submit").$id("@import_contacts").prop("disabled",!0).addClass("submit_button_disabled").removeClass("follow_button")}});t.NuxDialogImportContactsForm=h.extend({shouldLogImpression:!1,onLoad:function(){var e=this;e._super.apply(e,arguments),e.$id("@change_email_link").click(function(){return e.$id("@default_email_container").hide(),e.$id("@change_email_container").show(),!1}),"other"==e.getEmailDomain(e.getEmail())&&e.onUnsupportedDomainEntered(),e.$id("@skip").click(function(){return e.serverCall("record_step").kwargs({step_name:"skip_oauth_dialog"}).success(function(){e.emitEvent({type:a.Types.NUX_DIALOG_SKIP_NEXT_STEP,payload:{}})}).send(),
!1})},onOAuthRejected:function(e){this.serverCall("record_step").kwargs({step_name:"reject_oauth"}).send()},onSubmit:function(){var e=this._super.apply(this,arguments),t=!e;return t?this.serverCall("record_step").kwargs({step_name:"open_oauth",props:{domain:this.getEmailDomain(this.getEmail())}}).send():this.serverCall("record_step").kwargs({step_name:"invalid_import_domain"}).send(),e},submitForm:function(){var e=this.$id("@service").val(),t=this.$id("@access_token").val();return this.importContacts(this.getEmail(),e,t),!1},importContacts:function(e,t,i){var n=this;n.$id("@alt_spinner").show(),n.serverCall("import_contacts").kwargs({email:e,service:t,access_token:i}).liveMutate().success(function(){n.emitEvent({type:a.Types.NUX_DIALOG_NEXT_STEP,payload:{}})}).sendOnlyOnce()}})},"./app/view/draft.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./w2.dialog.js"),s=i("./shared/window_manager.js");t.ClearDraft=n.extend({onLoad:function(){var e=this;this.$id("@clear_draft").click(function(){
return o.createDialog(e).title(e.clear_draft_title).cancel().ok(function(){e.clearDraft()},e.clear_draft_title).text(e.clear_draft_message),!1})},clearDraft:function(){this.serverCall("clear_draft").liveMutate().success(function(){s.reload()}).send()}})},"./app/view/embed.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./tooltip.js"),a=i("./view/modal.js").Base,r=i("./truncate.js").truncate,d=i("./shared/views.js").viewsLogger;t.EmbedModalLink=n.extend({onLoad:function(){var e=this;this.$id("@modal_link").on("click",function(t){t.preventDefault(),e.createModal("load_inner").kwargs({aid:e.aid}).show()}),s.attach(this.$id("@embed_disabled"),this.embed_disabled_text)}}),t.EmbedModal=a.extend({onLoad:function(){this._super.apply(this,arguments),this.selectAllOnFocus(this.$id("@code_area")),this.$id("@checkbox").on("click",this.toggleFullAnswer.bind(this))},selectAllOnFocus:function(e){e.focus(function(){var e=o(this);e.select(),window.setTimeout(function(){
e.select()},1),e.mouseup(function(){return e.off("mouseup"),!1})})},toggleFullAnswer:function(){this.$id("@full_answer").is(":checked")?(this.$id("@truncated_preview").addClass("hidden"),this.$id("@full_preview").removeClass("hidden"),this.$id("@code_area").val(this.full_answer_code)):(this.$id("@truncated_preview").removeClass("hidden"),this.$id("@full_preview").addClass("hidden"),this.$id("@code_area").val(this.truncated_answer_code))}}),t.AnswerEmbedAnswer=n.extend({onLoad:function(){d.addComponentToTrack(this),d.logViews(),this.embedly&&(r(this.$id("@question_text").get(0),{lineHeight:"24",lines:3}),r(this.$id("@answer_header").get(0),{lines:1}))}})},"./app/view/error.js":function(e,t,i){var n=i("./webnode2.js"),o=i("./shared/core/component.js").Component,s=i("./shared/w2.context.js").CaptchaInput;t.CaptchaForm=o.extend({contextConstructor:function(){return s},onLoad:function(){n.Error.shown=!0,n.Error.hide();var e=this;e.captchaContext=e.getContext(s),e.captchaContext.on("isCaptchaFilled",function(t,i){
if(i){var n=e.captchaContext.get("captchaResponse");e.serverCall("verify_captcha").kwargs({captcha_response:n}).success(function(e){e.response&&window.location.reload(!0)}).send()}})}})},"./app/view/feed.js":function(e,t,i){var n=i("./shared/core/component.js"),o=i("./shared/jquery.js"),s=i("./shared/core/component.js").Component,a=i("./view/fixable2.js"),r=i("./truncate.js").truncate,d=i("./shared/window_manager.js"),l=i("./shared/cookies.js"),c=i("./shared/events/index.js"),u=i("./shared/log.js").log,h=i("./shared/logging.js"),p=i("./shared/viewport.js"),f=i("./shared/views.js").viewsLogger,_=i("./gating-webpack.js"),m=i("./shared/action_log.js").ActionableComponent,g=i("./shared/fx.js");t.UniversalPageFeed=i("./view/paged_list.js").PagedList.extend({init:function(e){this._super.apply(this,arguments),this.pageLoadTime=+new Date,this.viewerUid=e.uid,this.hashPosition={},this.initiallyVisible={},this.firstQueryID=0,this.offset=0,this.firstElement=0,this.needsRefresh=!1,this.num_prefeed_stories=e.num_prefeed_stories,
this.bundle_position=e.bundle_position,this.hashImpressions={},this.lastCheckTime=0,this.lastRevealTime=0,this.visibleStorySelectors=[],this.impressionData=[],this.dontLogImpressions=e.dont_log_imp,this.maxImpPos=-1;var t=this;this.handleEvent(c.Types.FEED_IMPRESSIONS_DISABLED,function(e){t.dontLogImpressions=e.payload.disabled}),this.setDvar("feed_story_hash",null),this.setDvar("feed_story_position",null),this.setDvar("feed_story_inner_position",null),this.setDvar("feed_story_initial",null),this.setDvar("feed_ty",e.feed_ty),this.setDvar("feed_page",e.feed_page),this.setDvar("page_data",e.page_data),this.setDvar("focus_ty",e.focus_ty),this.setDvar("bundle_position",e.bundle_position)},onLoad:function(e){u("feed.UniversalPageFeed.onLoad","start"),this._super.apply(this,arguments);var t=this;if(!this.debug){this.recordImpressions(!0),setInterval(this.recordImpressions.bind(this,!1),t.rate_limiter_ms+500);var i=this.recordImpressions.bind(this,!1,!1);this._mousemove_handler=i,this._keypress_handler=i,
this._scroll_handler=i,document.addEventListener("mousemove",this._mousemove_handler),document.addEventListener("keypress",this._keypress_handler),document.addEventListener("scroll",this._scroll_handler)}},onFeedBottomIndicatorClicked:function(){window.location.reload()},onUnload:function(){document.removeEventListener("mousemove",this._mousemove_handler),document.removeEventListener("keypress",this._keypress_handler),document.removeEventListener("scroll",this._scroll_handler),document.removeEventListener("scroll",this._pfPrefetchScrollHandler)},revealStories:function(){setTimeout(function(){o(".reveal_story").removeClass("reveal_story")},1500)},bottomIndicatorIsVisible:function(){var e=o(".FeedBottomIndicator");return e&&p.isElementInViewport(e.get(0))},updatePositions:function(e){var t,i,o,s,a=this.children(),r=!1;if(!e){for(s=this.offset,t=0;t<a.length;t++)if(o=a[t],o.getDvar&&o.getDvar("feed_story_hash")==this.firstElement){var d=this.orderedVisibleChildren();for(i=0;i<d.length;i++)d[i]==n.getLiveDomId(o.cid)&&(this.offset=i);
}this.offset!=s&&(r=!0)}var l,c,u=this.orderedVisibleChildren();for(this.firstQueryID=0,i=0;i<u.length;i++){l=document.getElementById(u[i]),o=n.getComponentFromElement(l),c=o.$id("@item"),this.firstQueryID<=0&&!c.hasClass("preloaded_pf")&&(this.firstQueryID=o.query_id);var h=i-this.offset+this.num_prefeed_stories,p=o.getHash();this.hashPosition[p]=h}if(e)for(i=0;i<a.length;i++)n.getLiveDomId(a[i].cid)==u[0]&&(this.firstElement=a[i].getDvar("feed_story_hash"));return r},addImpression:function(e,t){var i=e.getHash();this.hashImpressions[i]=!0,this.impressionData.push({hash:i,initially_visible:this.initiallyVisible.hasOwnProperty(i),position:t,bundle_position:this.bundle_position})},recordImpressions:function(e){if(!this.debug){var t=this,i=+new Date,o=e||this.needsRefresh;if(this.needsRefresh=!1,!(!o&&i<this.lastCheckTime+this.rate_limiter_ms||i<this.lastRevealTime+3e3)){this.lastCheckTime=i,u("feed.UniversalPageFeed.recordImpressions","started, called with",e);var s,a,r=this.children();for(o=this.updatePositions(e)||o,
a=0;a<r.length;a++)if(s=r[a],s.getHash&&s.validForLoggingImpression(o)){var d=s.isVisible(),l=s.getHash(),c=this.hashPosition[l];u("feed.UniversalPageFeed.recordImpressions","    firstQueryID:",this.firstQueryID,"    comp.query_id:",s.query_id,"    domid:",n._domids[s.cid],"    inViewport:",d,"    position:",c,"    bundle_position:",this.bundle_position,"    hash:",l),this.hashImpressions[l]||!o&&!d||(u("feed.UniversalPageFeed.recordImpressions","check to see if should reset dvars/record impression"),o&&(s.setDvar("feed_story_position",c),s.setDvar("feed_story_initial",!0)),d&&(u("feed.UniversalPageFeed.recordImpressions","impression recorded"),e&&(t.initiallyVisible[s.getHash()]=!0),this.addImpression(s,c)))}if(this.impressionData.length>0&&this.viewerUid&&i-this.pageLoadTime>=this.wait_until_log_impression_ms){var p=this.impressionData;if(!this.dontLogImpressions){var f={uid:this.__js_init.uid,focus_ty:this.__js_init.focus_ty,feed_ty:this.__js_init.feed_ty,feed_page:this.__js_init.feed_page,
page_data:this.__js_init.page_data};u("feed.UniversalPageFeed.recordImpressions","server call"),h.log("feed_impression",{request_data:p,__js_data__:f}),u("feed.UniversalPageFeed.recordImpressions","server call sent")}for(var m=0;m<this.visibleStorySelectors.length;m++)this.visibleStorySelectors[m].addClass("seen");if(this.visibleStorySelectors=[],this.impressionData=[],_.qfeed_log_impression_debug)for(var g in p)console.log("feed_impression:",JSON.stringify(p[g],null,2))}u("feed.UniversalPageFeed.recordImpressions","end")}}}}),t.DigestFeed=t.UniversalPageFeed.extend({onPagingDone:function(){this._super.apply(this,arguments),this.emitEvent({type:c.Types.FEED_PAGING_DONE,payload:{}})}}),t.FeedMain=i("./app/view/home.js").HomeMain.extend({onLoad:function(){this._super.apply(this,arguments)}}),t.PinnedFeedMain=i("./app/view/home.js").HomeMain.extend({onLoad:function(){this._super.apply(this,arguments),this.removeQpUrlParam()},removeQpUrlParam:function(){var e=d.getURL(),t=e.indexOf("?qp_story=");
-1!=t&&(d.replaceURL(e.substring(0,t)),this.child("pinned_feed").$id("@topic_feed").removeClass("invisible"))}}),t.ExpandableLink=s.extend({onLoad:function(){var e=this;this.$id("@show").click(function(){return e.$id("@inner_tree").removeClass("hidden"),e.$id("@show").addClass("hidden"),!1}),this.$id("@hide").click(function(){return e.$id("@inner_tree").addClass("hidden"),e.$id("@show").removeClass("hidden"),!1})}}),t.ContentPageFeedStoryItemBase=s.extend({onLoad:function(){var e=this,t="";this.$id("@item .truncated_q_text a.more_link").html(t).removeClass("more_link").removeAttr("id").addClass("read_more").attr("href",this.target_url),this.$id("@item a.lil_button.rate_up").removeAttr("id").attr("href",this.target_url),this.$id("@item .answer_content").css({cursor:"pointer"}),this.$id("@item_overlay").mousedown(function(){return e.serverCall("on_item_click").send(),!1})}}),t.QuestionNumberAnswers=s.extend({onLoad:function(e){var t=this;this.$id("@link").mousedown(function(){l.setQfeedLog(t,"QuestionClickthrough"),
l.setQueryLog(t,"QuestionClickthrough")})}}),t.HomepageFeedStoryItem=s.extend({init:function(){function e(){t.alreadySent||(t.alreadySent=!0,l.setMessage("vtc",[t.hash,t.view_tracking_key]),t.allowServerCall&&t.serverCall("dummy_call_nonlivedepped").send())}this._super.apply(this,arguments),this.setDvar("feed_story_hash",this.hash);var t=this;if(t.allowServerCall=!0,t.alreadySent=!1,this.parent().needsRefresh=!0,this.$id("@item").mousedown(e),o("a",this.$id("@item")).mousedown(function(i){t.allowServerCall=i.target.pathname==window.location.pathname,e()}),this.scroll_to_story){var i=this.$id("@item").offset().top;i-=d.headerOffset+20,window.scroll(0,i),g.highlight(this.$id("@item"),2e3)}t.is_suggestion_story&&this.handleEvent(c.Types.CAROUSEL_DISMISS_ALL,function(e){e.payload.story_oid==t.oid&&t.$id("@item").fadeOut(300,function(){o(this).hide()})})},onLoad:function(){var e=this;e.questionFeedbackLoaded=!1,e.answerFeedbackLoaded=!1,f.addComponentToTrack(e),this.handleEvent(c.Types.ANSWER_VOTE_STATE,function(t){
if(t.payload.aid==e.aid){var i="downvoted"==t.payload.state;i?e.showAnswerDownvoteFeedback():e.hideDownvoteFeedback("answer")}}),e.handleEvent(c.Types.QUESTION_VOTE_STATE,function(t){t.payload.qid==e.qid&&("downvoted"==t.payload.state?e.showQuestionDownvoteFeedback():e.hideDownvoteFeedback("question"))}),e.handleEvent(c.Types.QUESTION_CANT_ANSWER_STATE,function(t){if(t.payload.qid==e.qid){var i="passed"==t.payload.state;e.$id("@item").toggleClass("cant_answer",i)}})},scrollFeedbackToViewport:function(){var e=this.$id("@feed_item").offset().top;o(window).scrollTop()>e&&o("html, body").animate({scrollTop:e-80},1e3)},showAnswerDownvoteFeedback:function(){var e=this;e.scrollFeedbackToViewport(),e.$id("@feed_item").addClass("hidden"),e.$id("@answer_feedback").removeClass("hidden"),e.answerFeedbackLoaded===!1&&e.serverCall("load_downvote_feedback").kwargs({feedback_type:"answer"}).contentFor(e.$id("@answer_feedback")).success(function(){e.answerFeedbackLoaded=!0}).send()},showQuestionDownvoteFeedback:function(){
var e=this;e.scrollFeedbackToViewport(),e.$id("@feed_item").addClass("hidden"),e.$id("@question_feedback").removeClass("hidden"),e.questionFeedbackLoaded===!1&&e.serverCall("load_downvote_feedback").kwargs({feedback_type:"question"}).contentFor(e.$id("@question_feedback")).success(function(){e.questionFeedbackLoaded=!0}).send()},hideDownvoteFeedback:function(e){this.$id("@feed_item").removeClass("hidden"),"question"==e?this.$id("@question_feedback").addClass("hidden"):"answer"==e&&this.$id("@answer_feedback").addClass("hidden")},getHash:function(){return this.hash},isVisible:function(){var e=o("#"+n.getLiveParent(this.cid));if(!e.is(":visible"))return!1;var t=this.$id("@item");return!t.hasClass("hidden")&&p.isElementInViewport(e.get(0))},validForLoggingImpression:function(e){var t=n.getLiveParent(this.cid);if(!t)return!1;var i=o("#"+t);return e||i.is(":visible")?!0:!1}}),t.FeedBottomIndicator=s.extend({onLoad:function(){var e=this;this.$id("@feed_bottom").click(function(){e.parent().onFeedBottomIndicatorClicked();
})}}),t.InlineFollowSuggestionCard=m.extend({onLoad:function(){this._super.apply(this,arguments),this.setDvar("feed_story_inner_position",this.inner_position)}}),t.PinnedTopicHeader=s.extend({onLoad:function(){var e=this,t=e.$id("@topic_header"),i=t.height();t.length&&!t.hasClass("sticky_off")&&(a.makeFixable(t,{scroll_dep:!0,min_height:i,min_scroll:i+20}),t[0].addEventListener("w2.fixable.fixed",function(){t.css({top:o(".SiteHeader").outerHeight()})}))}}),t.AMASuggestionCard=m.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.$id("@ama_suggestion_card").on("click",function(){return l.setQfeedLog(e,"AMAClickthrough"),e.createModal("open_modal").kwargs({host_uid:e.host_uid}).show(),!1}),e.is_group_ama?r(e.$id("@ama_suggestion_card .group_name").get(0),{lines:1}):(r(e.$id("@ama_suggestion_card .name").get(0),{lines:1}),r(e.$id("@ama_suggestion_card .sig").get(0),{lines:2}))}}),t.QuestionAnswerVerboseDesktop=s.extend({onLoad:function(){var e=this;e.handleEvent(c.Types.FEED_ANSWER_INLINE_EXPAND,function(t){
if(t.payload.aid==e.aid){var i=e.$id("@content");i.addClass("expanded_feed_content"),i.addClass("expanded_q_text")}})}})},"./app/view/feed/ama.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/views.js").viewsLogger;t.AMAFeedItem=n.extend({onLoad:function(){o.addComponentToTrack(this)}}),t.AMAListItem=n.extend({onLoad:function(){var e=this;e.$id("@item_button").click(function(){e.is_following||e.serverCall("show_pmsg").liveMutate().send(),e.is_following=!e.is_following})}})},"./app/view/feed/answer.js":function(e,t,i){var n=i("./app/view/feed/question.js");t.EditableQuestionAnswerStory=n.QuestionStoryEditable.extend({getEditor:function(){return this.$id("@question_answer_story_editable")},getStory:function(){return this.$id("@answer_story")}})},"./app/view/feed/modal.js":function(e,t,i){var n,o=i("./view/modal.js").ToggleModal,s=i("./unified_view/toggle.js").ToggleBase,a=i("./shared/events/index.js"),r=i("./unified_view/button/write_answer.js").WriteAnswer,d=i("./shared/client_tracker.js"),l=i("./shared/cookies.js"),c=i("./shared/window_manager.js"),u=i("./shared/logging.js"),h=i("./shared/beforeunload.js"),p=i("./w2.modal.js");
n=c.getURL(),h.registerHandler(function(){f(n)});var f=function(e){try{c.replaceURL(e)}catch(t){}},_=p.ModalBase.extend({_onCloseCallBack:null,_onContentVisibleCallBack:null,onCloseCallBack:function(e){return this._onCloseCallBack=e,this},close:function(){this._super.apply(this,arguments),this._onCloseCallBack&&this._onCloseCallBack()},onContentVisibleCallBack:function(e){this._onContentVisibleCallBack=e},onContentVisible:function(){this._super.apply(this,arguments),this._onContentVisibleCallBack&&this._onContentVisibleCallBack()}}),m=t.StoryItemToggleModal=o.extend({initModal:function(){this._modal=new _(this,{kwargs:{serialized_args:this.serialized_args},closeOnScroll:this.close_on_scroll,showFixedCloseButton:!0,customOverlayClass:"feed_desktop_modal"}).onCloseCallBack(this.closeModal.bind(this));var e=this;this.handleEvent(a.Types.QUESTION_EDITING_STATE,function(t){("Answer"==e.obj_type&&t.payload.qid==e.qid||"Question"==e.obj_type&&t.payload.qid==e.obj_id)&&("edit"==t.payload.state?e._disableOpen=!0:("request"==t.payload.state||"cancel"==t.payload.state)&&(e._disableOpen=!1));
})},showModal:function(){this._disableOpen||(this._super.apply(this,arguments),this.emitEvent({type:a.Types.FEED_IMPRESSIONS_DISABLED,payload:{disabled:!0}}),this.qfeed_primary_action&&(d.track(this.qfeed_primary_action,null,this),l.setQfeedLog(this,this.qfeed_primary_action)),f(this.story_url),this._logAction("open"))},closeModal:function(){this.emitEvent({type:a.Types.FEED_IMPRESSIONS_DISABLED,payload:{disabled:!1}}),f(n),this._logAction("close")},handleClick:function(e){e.preventDefault(),this.$inlineElem.addClass("read_item"),0!==e.button||e.ctrlKey||e.metaKey||e.shiftKey?window.open(this.story_url,"_blank"):this.onModalClick()},onModalClick:function(){this.showModal()},_logAction:function(e){u.log("web_modal_reading_time",{action:e,time:Date.now(),object_type:this.obj_type,object_id:this.obj_id,page_type:this.page_type})}});t.AnswerStoryToggleModal=m.extend({onModalClick:function(){this._modal.onContentVisibleCallBack(this.emitModalContentVisibleEvent.bind(this)),this._super.apply(this,arguments);
},emitModalContentVisibleEvent:function(){this.emitEvent({type:a.Types.ANSWER_MODAL_CONTENT_VISIBLE,scope:a.scope.GLOBAL,payload:{aid:this.obj_id}})}}),t.AnswerFooterToggle=s.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.handleEvent(a.Types.ANSWER_MODAL_CONTENT_VISIBLE,function(t){t.payload.aid==e.aid&&e.triggerSwitch()})}}),t.WriteAnswerButton=r.extend({onClick:function(){new _(this,{kwargs:{qid:this.qid,serialized_dvars:this.serialized_dvars},showFixedCloseButton:!0,customOverlayClass:"feed_desktop_modal"}).load("load_modal")}})},"./app/view/feed/question.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js"),s=i("./shared/util.js").firstScrollingParent,a=i("./shared/jquery.js");t.QuestionStoryEditable=n.extend({onLoad:function(){this.$editorElem=this.getEditor(),this.$storyElem=this.getStory(),this.$hoverElem=this.$storyElem.closest(".hover_highlight");var e=this;this.handleEvent(o.Types.QUESTION_EDITING_STATE,function(t){
t.payload.qid==e.qid&&("edit"==t.payload.state?e.openEditor():"request"==t.payload.state?e.closeEditor():"cancel"==t.payload.state&&e.closeEditor())}),this.editor_fetched=!1},getEditor:function(){return this.$id("@question_story_editable")},getStory:function(){return this.$id("@question_story")},loadEditor:function(){this.editor_fetched=!0,this.serverCall("load_editor").contentFor(this.$editorElem).send()},openEditor:function(){var e=s(this.$storyElem.get(0));e!==document.body&&a(e).scrollTop(0),this.$storyElem.addClass("hidden"),this.$editorElem.removeClass("hidden"),this.$hoverElem&&this.$hoverElem.removeClass("hover_highlight"),this.editor_fetched||this.loadEditor()},closeEditor:function(){this.$editorElem.addClass("hidden"),this.$storyElem.removeClass("hidden"),this.$hoverElem&&this.$hoverElem.addClass("hover_highlight")}}),t.QuestionStoryEditableToggled=n.extend({onLoad:function(){this.$id("@feed_question_update").on("click",this.updateQuestion.bind(this)),this.$id("@feed_question_cancel").on("click",this.closeEditor.bind(this));
},updateQuestion:function(){this.emitEvent({type:o.Types.QUESTION_EDITING_STATE,payload:{qid:this.qid,state:"request"}})},closeEditor:function(){this.emitEvent({type:o.Types.QUESTION_EDITING_STATE,payload:{qid:this.qid,state:"cancel"}})}})},"./app/view/funnel.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.FunnelState=n.extend({onLoad:function(){var e=this;e.$id("@show_unstarted").click(function(){e.$id("@unstarted").show(),e.$id("@show_unstarted").hide()}),e.$id("@refresh").click(function(){window.location.reload()})}}),t.ResetFunnelLink=n.extend({onLoad:function(){var e=this;e.$id("@reset").click(function(){e.serverCall("reset_funnel").success(function(){window.location.reload()}).send()})}}),t.ActivateFunnelLink=n.extend({onLoad:function(){var e=this;e.$id("@activate").click(function(){e.serverCall("activate_funnel").liveMutate().send()})}})},"./app/view/google_.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.GoogleConnectCallbackPage=n.extend({
onLoad:function(){window.close()}})},"./app/view/growl.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=!1;t.GrowlBase=n.extend({onLoad:function(e){var t=this;this.growl=this.$id("@growl"),this.age_sec<(e?1.5:15)&&(this.show(!e),t.hideAfter(t.visible_sec),document.hasFocus()||o(window).one("focus",function(){s&&(clearTimeout(t.hideTimer),t.hideAfter(t.visible_sec))})),this.growl.mouseover(function(e){t.growl.hasClass("fade_out")||(clearTimeout(t.hideTimer),t.growl.removeClass("fade_out"),t.customMouseOver())}),this.growl.mouseout(function(e){t.hideAfter(1)})},show:function(e){var t=this;s&&(e=!1),s=!0,e&&this.growl.addClass("fade_in"),this.growl.removeClass("fade_out").removeClass("hidden"),e&&setTimeout(function(){t.growl.removeClass("fade_in")},200)},hideAfter:function(e){this.hideTimer=setTimeout(this.hide.bind(this),1e3*e)},hide:function(){var e=this;this.growl.addClass("fade_out"),setTimeout(function(){e.growl.hasClass("fade_out")&&(e.growl.addClass("hidden").removeClass("fade_out"),
s=!1)},1250)},customMouseOver:function(){}})},"./app/view/home.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./view/fixable2.js"),a=i("./unified_view/toggle.js"),r=i("./shared/events/index.js"),d=i("./shared/viewport.js"),l=i("./shared/window_manager.js"),c=i("./shared/logging.js");t.HomeMain=n.extend({onLoad:function(){var e=this.$id("@left_col_inner"),t=this.$id("@left_col");if(t.length>0&&e.length>0){var i=30,n=990;s.makeFixable(e,{scroll_dep:!0,min_height:t.outerHeight()+t.offset().top,min_width:n,extra_top_spacing:i})}}}),t.HomeFeed=n.extend({onLoad:function(){var e=this,t=l.getURL();(-1!=t.indexOf("?qp_story=")||-1!=t.indexOf("?digest_story=")||-1!=t.indexOf("?ask_question="))&&(l.replaceURL("/"),o("#feed_visibility_wrapper").removeClass("invisible")),this.handleEvent(r.Types.FEED_PAGING_DONE,function(){e.child("home_main_feed").triggerSwitch()})}}),t.ContentPageFeed=a.ToggleBase.extend({onLoad:function(){this._super.apply(this,arguments),
setTimeout(this.recordImpression.bind(this),0)},recordImpression:function(){d.isElementInViewport(this.$id("@wrapper").get(0))?c.log("funnel_impression",{impression_type:"qp_feed_impression"}):setTimeout(this.recordImpression.bind(this),200)}})},"./app/view/layout.js":function(e,t,i){function n(e,t){a.each(window.YT.players,function(i,n){n.playerId==t&&(n.state=e.data,n.state==window.YT.PlayerState.PLAYING&&n.onReady&&(n.onReady(n),n.onReady=null))}),e.data==window.YT.PlayerState.PLAYING&&o(t)}function o(e){window.YT&&window.YT.players&&a.each(window.YT.players,function(t,i){i.playerId!=e&&i.player&&a("#"+i.playerId).length&&i.player.pauseVideo()})}var s=i("./shared/core/component.js").Component,a=i("./shared/jquery.js"),r=i("./shared/youtube.js"),d=i("./w2.livenode.js"),l=i("./view/livenode.js").addContentPadding,c=i("./shared/keystrokes.js"),u=i("./shared/keyboard_event_handler.js");t.QTextImageEnlarger=s.extend({onLoad:function(){var e=this;a(document).on("click",".qtext_image",function(t){
e.openModal(t)}),a(document).on("click",".photo_modal_bg, .photo_modal_close",function(){for(var t in e.masters)e.hideModal(e.masters[t])})},getContainer:function(e,t){var i=this;return i.masters={},i.masters[e]||(i.masters[e]=a("<div>").addClass("photo_modal_container").append(a("<div>").addClass("photo_modal_bg")).append(a("<div>").addClass("photo_modal_close")).append(a("<img>").addClass("photo_modal_img").attr("src",e)).append(a("<img>").addClass("photo_modal_img_large").attr("src",t)))},openModal:function(e){function t(){S&&E&&(m.find(".photo_modal_img_large").css("visibility","visible"),m.find(".photo_modal_img").css("visibility","hidden"))}var i=this,n=a(e.target),o=n.attr("src"),s=n.attr("master_src"),r=n.hasClass("zoomable_in"),d=n.parents(".truncated_q_text").length>0,l=n.hasClass("qtext_image_large"),c=d&&!l;if(r&&s&&!c){var h=parseInt(n.attr("master_w")),p=parseInt(n.attr("master_h")),f=a(window).width(),_=a(window).height(),m=i.getContainer(o,s),g=!1;p>3*_&&p/h>3&&(g=!0),h>f&&(p*=(f-40)/h,
h=f-40),p>_&&(h*=(_-40)/p,p=_-40);var v=n.offset().left,w=n.offset().top-a(window).scrollTop(),b=Math.round((f-n.width())/2-v),y=Math.round((_-n.height())/2-w),C=h/n.width();m.find(".photo_modal_img").css("left",v).css("top",w).css("width",n.width()).css("height",n.height()),g&&m.find(".photo_modal_img").css("visibility","hidden"),m.appendTo("body"),n.css("visibility","hidden");var k=a(document).scrollTop();a("body").css({position:"fixed",width:"100%",top:-k});var x=m.find(".photo_modal_close").outerWidth();g?m.find(".photo_modal_close").css("left",(f+parseInt(n.attr("master_w")))/2-x).css("top",(_-p)/2):m.find(".photo_modal_close").css("left",(f+h)/2-x).css("top",(_-p)/2),i.handler=function(e){27==e.keyCode&&(e.preventDefault(),i.hideModal(m))},u.push(i.handler),setTimeout(function(){m.find(".photo_modal_bg, .photo_modal_close").addClass("active"),g?m.find(".photo_modal_bg").css("height",20+parseInt(n.attr("master_h"))):m.find(".photo_modal_img").css("transform","translate3d("+b+"px,"+y+"px,0) scale("+C+")").css("-moz-transform","translate3d("+b+"px,"+y+"px,0) scale("+C+")").css("-ms-transform","translate3d("+b+"px,"+y+"px,0) scale("+C+")").css("-o-transform","translate3d("+b+"px,"+y+"px,0) scale("+C+")").css("-webkit-transform","translate3d("+b+"px,"+y+"px,0) scale("+C+")");
},1);var S=!1,E=!1;setTimeout(function(){E=!0,t()},333),g&&m.css("position","fixed").css("overflow","scroll"),m.find(".photo_modal_img_large").on("load",function(){a(this).css("top",(_-p)/2),g?a(this).css("position","relative").css("left",(f-n.attr("master_w"))/2):a(this).css("left",(f-h)/2).css("width",h).css("height",p),S=!0,t()})}},hideModal:function(e){u.remove(this.handler),e.find(".photo_modal_bg, .photo_modal_close").removeClass("active"),e.find(".photo_modal_img_large").remove(),e.find(".photo_modal_img").css("visibility","visible"),e.find(".photo_modal_img").css("-webkit-transform","translate3d(0,0,0) scale(1)"),e.find(".photo_modal_img").css("-moz-transform","translate3d(0,0,0) scale(1)"),e.find(".photo_modal_img").css("-ms-transform","translate3d(0,0,0) scale(1)"),e.find(".photo_modal_img").css("-o-transform","translate3d(0,0,0) scale(1)"),e.find(".photo_modal_img").css("ms-transform","translate3d(0,0,0) scale(1)"),setTimeout(function(){a(".qtext_image").css("visibility","visible");
var t=Math.abs(parseInt(a("body").css("top")));a("body").css({position:"",width:"",top:""}),t&&a(document).scrollTop(t),e.remove()},333)}}),t.QTextGIFPlayer=s.extend({onLoad:function(e){e&&a(document).click(function(e){var t=a(e.target).parent("[gif-embedded]");if(t){var i=t.attr("gif-embedded"),n=t.attr("background-url");if("false"==t.attr("is-playing")){var o=new Image;o.onload=function(){t.children(".qtext_image").attr("src",i),t.children(".gif_embed_noclick").css("visibility","hidden"),t.attr("is-playing","true")},o.src=i}else t.children(".qtext_image").attr("src",n),t.children(".gif_embed_noclick").css("visibility","visible"),t.attr("is-playing","false")}})}}),t.QTextEmbedEnlarger=s.extend({onLoad:function(e){var t=this;e&&a(document).click(function(e){var i,n=a(e.target);n.attr("data-embed")?i=n.attr("data-embed"):(n=n.parent(),i=n&&n.attr("data-embed")),i&&n.hasClass("thumbnail")&&t.loadEmbed(n,i)})},loadEmbed:function(e,t){window.YT||(window.YT={},window.YT.players=[],window.YT.next_id=0);
var i=this;r.onInit(function(){if(!window.YT.Player)return void setTimeout(i.loadEmbed.bind(i,e,t),100);if(e.hasClass("thumbnail")){e.append(t).removeClass("thumbnail");var s="YTPlayer-"+window.YT.next_id++;e.find(":first-child").attr("id",s);var a=new window.YT.Player(s,{events:{onStateChange:function(e){return n(e,s)}}});window.YT.players.push({player:a,playerId:s,state:-1}),o(s)}})}}),t.GridGuide=s.extend({onLoad:function(){this.setupKeyboardShortcut()},toggle:function(){this.$id("@grid-guide").is(":visible")?this.$id("@grid-guide").fadeOut(150):this.$id("@grid-guide").fadeIn(150)},setupKeyboardShortcut:function(){c.on([71,82,73,68],this.toggle.bind(this))}}),t.BrowserWarning=s.extend({onLoad:function(){l()}}),t.LogoutNavElement=s.extend({onLoad:function(){var e=this;this.$id("@logout_link").click(function(){return e.$id("@logout_form").submit(),d.stopLiveUpdates(),!1})}})},"./app/view/link.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.NewLinkEditor=n.extend({
onLoad:function(){var e=this;this.$id("@link_no_image").click(function(){return e.clearAllSelected(),e.setDisplayType("link_no_image"),e.$id("@link_no_image").addClass("selected"),!1}),this.$id("@link_small_image").click(function(){return e.clearAllSelected(),e.setDisplayType("link_small_image"),e.$id("@link_small_image").addClass("selected"),!1}),this.$id("@link_large_image").click(function(){return e.clearAllSelected(),e.setDisplayType("link_large_image"),e.$id("@link_large_image").addClass("selected"),!1}),this.$id("@remove_url").click(function(){return e.parent().removeUrl(),!1})},clearAllSelected:function(){this.$id("@link_no_image").removeClass("selected"),this.$id("@link_small_image").removeClass("selected"),this.$id("@link_large_image").removeClass("selected")},getPreviewLinkInfo:function(){return this.child("preview").getLinkInfo()},setDisplayType:function(e){var t;t="link_no_image"==e?1:"link_small_image"==e?2:3,this.child("preview").setDisplayType(e,t)}}),t.LinkVideo=n.extend({
onLoad:function(){var e=this;this.$id("@video_wrapper").click(function(){e.parent().playVideo(),e.$id("@video_wrapper .qtext_embed.thumbnail").css("width","100%").css("height","272px")})}}),t.LinkImageEditor=n.extend({onLoad:function(){var e=this;this.index=0,this.$id("@next_photo").click(function(t){return e.cycle_photo(1),!1}),this.$id("@prev_photo").click(function(t){return e.cycle_photo(e.keys_and_sources.length-1),!1}),this.$id("@link").click(function(){e.serverCall("track").send()})},get_image_keys:function(){if(this.keys_and_sources!={}){for(var e=[],t=this.index,i=0,n=this.keys_and_sources.length;n>i;i++,t=(t+1)%n)e.push(this.keys_and_sources[t][0]);return e}return[]},cycle_photo:function(e){var t=this.index;this.index=(t+e)%this.keys_and_sources.length,this.$id("@img").attr("src",this.keys_and_sources[this.index][1])}}),t.LinkTitle=n.extend({onLoad:function(){var e=this;this.$id("@link").click(function(){e.serverCall("track").send()})},getValue:function(){return this.child("editor").get_value();
}}),t.Link=n.extend({getLinkInfo:function(){this.link_info.title=this.child("title").getValue(),this.link_info.snippet=this.child("snippet").child("editor").get_value();var e=this.child("media");return e.editable&&(this.link_info.image_keys=e.get_image_keys()),this.link_info},setDisplayType:function(e,t){this.$id("@link_wrapper").removeClass().addClass(e),this.link_info.display_type=t},playVideo:function(){var e=2;this.link_info.display_type==e&&(this.$id("@image_col").css("float","left"),this.$id("@info_col").css("float","left"),this.$id("@image_col").css("width","100%"),this.$id("@image_and_info").css("display","block"))}})},"./app/view/linkedin_.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.LinkedinCallbackPage=n.extend({onLoad:function(){if(window.opener){var e=window.opener.require("shared/jquery");e(window.opener.document).trigger("linkedin_oauth_approved",this.liUid),window.close()}}})},"./app/view/login.js":function(e,t,i){var n=i("./shared/core/component.js").Component;
t.LogoutAllSessionsButton=n.extend({onLoad:function(){var e=this;e.$id("@logout").click(function(t){return e.serverCall("logout_all_sessions").liveMutate().send(),!1})}})},"./app/view/manage.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/dom.js"),s=i("./shared/jquery.js"),a=i("./view/modal.js").Base,r=i("./shared/events/index.js"),d=r.GlobalProxy;t.FeedControlModal=a.extend({onLoad:function(){var e=this;e._super.apply(this,arguments);var t=e.$id("@organize"),i=e.$id("@discover"),n=s("#__w2_modal_overlay_"),o=e.child("feed_control_container").$id("@organize"),a=e.child("feed_control_container").$id("@discover");t.click(function(){t.addClass("selected"),o.removeClass("hidden"),i.removeClass("selected"),a.addClass("hidden")}),i.click(function(){i.addClass("selected"),a.removeClass("hidden"),t.removeClass("selected"),o.addClass("hidden")}),n.on("mousedown",function(t){t.target!=this||e._isScrollBarClicked(t)||e.maybeRefreshFeed()}),e.serverCall("maybe_complete_zapdos").send(),
this._updatedItems={},this.handleEvent(r.Types.FEED_CONTROL_UPDATE,function(t){var i=t.payload.contentRowCid;e._updatedItems[i]?delete e._updatedItems[i]:e._updatedItems[i]=!0})},_isScrollBarClicked:function(e){var t=o.getScrollbarWidth();return window.innerWidth-e.clientX<t?!0:!1},onClose:function(){this.maybeTriggerRefreshFeedButton()},onSubmit:function(){this.maybeTriggerRefreshFeedButton()},onCancel:function(){this.maybeTriggerRefreshFeedButton()},maybeTriggerRefreshFeedButton:function(){this._closeModal(),Object.keys(this._updatedItems).length>0&&d.dispatch({type:r.Types.DISCOVER_TOOL_CONFIRMED,payload:{}})},refreshFeed:function(){var e=this,t=s("#feed_control_update_feed_screen"),i=5500;t.removeClass("hidden"),e.serverCall("refresh_feed").success(function(){setTimeout(t.addClass("hidden"),i)}).error(function(){setTimeout(t.addClass("hidden"),i)}).liveMutate().send()}}),t.FeedControlModalLink=n.extend({onLoad:function(){var e=this;this.$id("@create_modal_link").on("click",function(){
return e.createModal("load_inner").kwargs({default_tab:e.default_tab}).webOnlyOptions({closeOnBackgroundClick:!1}).show(),!1})}}),t.FeedControlContent=n.extend({onLoad:function(){var e=this;e.feed_control_contents={};for(var t in e.content_ids){var i=e.content_ids[t],n="@"+i;e.feed_control_contents[i]={js_id:n,scroll_position:0}}for(var o in e.feed_control_contents){var s=e.feed_control_contents[o],a=e._createOnLinkClicked(o),r=e.child("filter_section").$id(s.js_id);r.click(a.bind(this))}},_createOnLinkClicked:function(e){var t=this;return function(){var i=t.feed_control_contents[t.active_id],n=t.child("filter_section").$id(i.js_id),o=t.$id(i.js_id);i.scroll_position=o.parent().scrollTop(),n.removeClass("selected"),o.addClass("hidden");var s=t.feed_control_contents[e],a=t.child("filter_section").$id(s.js_id),r=t.$id(s.js_id);a.addClass("selected"),r.removeClass("hidden"),r.parent().scrollTop(s.scroll_position),t.active_id=e}}}),t.FeedControlContentRow=n.extend({onLoad:function(){var e=this;
this.$id("@item_button").on("click",function(){e.emitEvent({type:r.Types.FEED_CONTROL_UPDATE,payload:{contentRowCid:e.cid}})})}}),t.FeedControlsPopover=n.extend({hide:function(){this.$id("@popover").addClass("hidden")}}),t.DismissFeedControlsPopoverLink=n.extend({onLoad:function(){var e=this;this.$id("@dismiss_link").on("click",function(){e.parent().hide()})}}),t.DiscoverInlineFeedCallToAction=n.extend({onLoad:function(){var e=this;e.serverCall("log_impression").send(),this.$id("@dismiss_link").on("click",function(){e.serverCall("dismiss").send(),e.$id("@main_card").addClass("hidden")})}})},"./app/view/messages.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./view/modal.js").Base;t.MessagesMain=n.extend({onLoad:function(){var e=this;e.resizeMessages(),o(window).resize(e.resizeMessages.bind(e)),setTimeout(function(){e.show_old_anon_content_email_modal&&e.createModal("load_inner").show()},20)},resizeMessages:function(){var e=this.$id("@threads"),t=o(window).height(),i=e.offset().top;
e.height(t-i)}}),t.MessagesThreadDetail=t.MessagesMain.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.scrollMessageThreadToHeight(),e.$id("@thread").on("DOMNodeInserted",function(t){t.preventDefault();var i=t.target;o(i.children).is(".ThreadMessage")&&setTimeout(function(){e.scrollMessageThreadToHeight()},10)}),e.isShowingMoreMessages=!1,e.$id("@show").click(function(){e.showMoreClicked()})},scrollMessageThreadToHeight:function(e){e=e||0;var t=this.$id("@thread")[0].scrollHeight-e;o(".thread_list").scrollTop(t)},showMoreClicked:function(){var e=this;this.isShowingMoreMessages=!0,this.serverCall("get_message_count").kwargs({thread_id:this.threadId}).success(function(t){e.messageCount=t,e.showMoreMessages()}).send()},showMoreMessages:function(){var e=this,t=this.$id("@thread")[0].scrollHeight,i=45;this.shownCount*=2,this.shownCount>this.messageCount&&(this.reachedLastMessage=!0,this.shownCount=this.messageCount),this.serverCall("show_messages").kwargs({thread_id:this.threadId,
count:this.shownCount}).contentFor(this.$id("@thread")).success(function(){e.reachedLastMessage&&(e.$id("@more").hide(),t+=i),e.scrollMessageThreadToHeight(t),e.isShowingMoreMessages=!1}).send()}}),t.ComposeMessageModalLink=n.extend({onLoad:function(){var e=this;this.$id("@create_modal_link").on("click",function(t){t.preventDefault(),e.createModal("load_inner").kwargs({to_uid:e.to_uid}).webOnlyOptions({closeOnBackgroundClick:!1}).show()})}}),t.ComposeMessageModal=s.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.$id("@change_person").on("click",function(t){e.change(),t.preventDefault()}),this.load()},load:function(){this.object_id&&this.setTo(this.object_id)},getData:function(){return this.$id("@compose_message_to_uid").val()&&(this.object_id=this.$id("@compose_message_to_uid").val()),!this.object_id||this.child("editor").isOnlyWhiteSpace()?!1:{to_uid:this.object_id,msg:this.child("editor").serialize()}},onSubmit:function(){if(!this.submitDisabled){var e=this,t=e.getData();
t!==!1&&this.serverCall("submit_message").kwargs(t).success(function(){e._closeModal()}).send()}},change:function(){this.child("people_selector").setQuery(""),this.$id("@pick_people").removeClass("hidden"),this.$id("@picked_person").addClass("hidden"),this.$id("@to_name").html(""),this.child("people_selector").focus(),this.disableSubmit()},setTo:function(e){isNaN(parseInt(e))||(this.$id("@pick_people").addClass("hidden"),this.$id("@picked_person").removeClass("hidden"),this.$id("@compose_message_to_uid").val(e),this.getName(e),this.enableSubmit())},getName:function(e){var t=this;this.serverCall("get_name").kwargs({to_uid:e}).contentFor(this.$id("@to_name")).success(function(){t.child("editor").focus()}).send()}}),t.HideMessagesModalLink=n.extend({onLoad:function(){var e=this;this.$id("@create_dialog_link").on("click",function(t){t.preventDefault(),e.createModal("load_inner").kwargs({thread_id:e.thread_id}).show()})}}),t.HideMessagesModal=s.extend({onSubmit:function(){if(!this.submitDisabled){
var e=this;this.serverCall("hide_thread").liveMutate().success(function(){e._closeModal(),window.location="/messages"}).send()}}}),t.MarkUnreadModalLink=n.extend({onLoad:function(){var e=this;this.$id("@create_dialog_link").on("click",function(t){t.preventDefault(),e.createModal("load_inner").kwargs({thread_id:e.thread_id}).show()})}}),t.MarkUnreadModal=s.extend({onSubmit:function(){if(!this.submitDisabled){var e=this;this.serverCall("mark_thread_as_unread").liveMutate().success(function(){e._closeModal(),window.location="/messages"}).send()}}})},"./app/view/moderation/appeal.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./view/modal.js").Base;t.AppealLink=n.extend({onLoad:function(){var e=this;this.$id("@show_appeal_modal").click(function(){return e.showAppealModal(),!1})},showAppealModal:function(){this.createModal("appeal_modal").kwargs({oid:this.oid,transition_id:this.transition_id}).show()}}),t.AppealModal=s.extend({onLoad:function(){
this._super.apply(this,arguments),this.$id("@submit_button").addClass("submit_button_disabled");var e=this.$id("@policy_checkbox"),t=this;e.click(function(e){e.currentTarget.checked?t.$id("@appeal_details").removeClass("hidden"):(t.$id("@appeal_details").addClass("hidden"),t.$id("@submit_button").addClass("submit_button_disabled"))}),t.$id("@appeal_type").change(function(){t.$id("@submit_button").removeClass("submit_button_disabled")});var i=this.$id("@answer_tag_details_link"),n=this.$id("@answer_tag_details_content");i.click(function(e){n.hasClass("hidden")?(n.removeClass("hidden"),i.text(t.collapse_details)):(n.addClass("hidden"),i.text(t.show_details))})},onSubmit:function(){this.appeal()},appeal:function(){var e=this.child("appeal_comment").serialize(),t=o("input:radio:checked").val(),i={comment:e,appeal_type:t};this.serverCall("send_appeal").liveMutate().kwargs(i).success(this._closeModal()).send()}})},"./app/view/moderation/flag.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./view/modal.js").Base,a=i("./shared/events/index.js");
t.AddModerationFlag=n.extend({onLoad:function(){var e=this;e.$id("@show_flag_dialog").on("click",function(t){e.in_menu||(t.preventDefault(),t.stopPropagation()),e.one_click_report?e.serverCall("one_click_report").liveMutate().send():e.showFlagDialog()})},showFlagDialog:function(){this.createModal("flag_modal").kwargs({targets:this.targets}).show()}}),t.AddFlagModal=s.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.$id("@show_more_reasons a").click(function(){return e.$id("@show_more_reasons").toggleClass("hidden"),e.$id("@more_reasons").toggleClass("hidden"),!1}),this.$id("@report_row").on("click","input.flag_input",function(t){e.$id("@report").prop("disabled",!1).removeClass("submit_button_disabled"),e.$id("@comment").removeClass("hidden"),e.child("comment").focus(),e.$id("@required_comment_warning").addClass("hidden"),e.$id("@required_report_reason_warning").addClass("hidden");var i=parseInt(o(t.target).eq(0).val(),10),n=parseInt(e.other_reason_id,10),s=parseInt(e.factually_incorrect_reason_id,10);
i==n||i==s?e.$id("@optional_label").addClass("hidden"):e.$id("@optional_label").removeClass("hidden")})},onSubmit:function(){this.report()},report:function(){var e=this,t={flag_reason:this.getFlagReason(),comment:this.child("comment").serialize()};this.flag_info=t;var i=t.flag_reason==this.other_reason_id||t.flag_reason==this.factually_incorrect_reason_id;t.flag_reason?i&&this.child("comment").isOnlyWhiteSpace()?this.$id("@required_comment_warning").removeClass("hidden"):null!==t.flag_reason&&this.serverCall("flag_object").kwargs(t).liveMutate().success(function(t){e._closeModal(),t&&"/"==t[0]?window.location=t:e.shouldAddDownvote()&&e.addDownvote()}).send():this.$id("@required_report_reason_warning").removeClass("hidden")},shouldAddDownvote:function(){for(var e=0;e<this.skip_downvote_flag_reason_ids.length;++e)if(this.flag_info.flag_reason==this.skip_downvote_flag_reason_ids[e])return!1;return!0},addDownvote:function(){var e=this.targets[0];"answer"===e.type?this.emitEvent(a.helpers.addAnswerDownvote(e.aid)):"question"===e.type&&this.emitEvent(a.helpers.addQuestionDownvote(e.qid));
},getFlagReason:function(){return this.$id("@report_row input.flag_input").filter(":checked").val()}}),t.NeedsImprovementButton=n.extend({onLoad:function(){var e=this;e.$id("@add_ni_button").on("click",function(){e.serverCall("add_topic").kwargs({}).liveMutate().send()})}}),t.DismissLink=n.extend({onLoad:function(){var e=this;this.$id("@dismiss").click(function(t){e.dismiss(),t.preventDefault()})},dismiss:function(){this.serverCall("dismiss").liveMutate().send()}}),t.TargetAndReports=n.extend({onLoad:function(){var e=this;this.$id("@toggle").click(function(t){e.toggleComments(),t.preventDefault()})},toggleComments:function(){this.$id("@reports").toggleClass("hidden")}}),t.LockLink=n.extend({onLoad:function(){var e=this;e.$id("@lock_link").click(function(t){return t.preventDefault(),o(this).hasClass("unlocked")?(e.serverCall("lock_answer").liveMutate().send(),o(this).removeClass("unlocked")):(e.serverCall("unlock_answer").liveMutate().send(),o(this).addClass("unlocked")),!1})}})},"./app/view/navigation.js":function(e,t,i){
var n=i("./view/fixable2.js"),o=i("./view/hover_menu.js").HoverMenu,s=i("./view/editable_list.js").EditableList;t.SettingsNavListContents=s.extend({onLoad:function(){this._super.apply(this,arguments),n.makeFixable(this.$id("@wrapper"),{min_width:990})}}),t.HomeNavList=s.extend({setEditLink:function(){this.editLink=this.child("hover_menu").$id("@link")}}),t.HomeNavListHoverMenu=o.extend({isInvalidCloseTarget:function(e){var t=this.$id("@menu"),i=this._super.apply(this,arguments);return i||e.parents().filter(t).length>0||e.hasClass("HomeNavListItem")||e.hasClass("remove_link")?!0:(this.shown&&this.parent().toggleEdit(),!1)},doShow:function(){this._super.apply(this,arguments);var e=this.child("selector");e&&e.focus()}})},"./app/view/network/selector.js":function(e,t,i){var n=i("./shared/events/index.js"),o=i("./view/selector.js").Selector;t.InvitePeopleSelector=o.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.$input.focus(),e.$id("@clear").on("click",function(){e.setQuery("");
})},resultWasSelected:function(e){this.emitEvent({type:n.Types.NETWORK_INVITE_USER,payload:{uid:e.data.uid,email:e.data.email}})},queryDidChange:function(){var e=this;e.$input.val().length>0?e.$id("@clear").removeClass("hidden"):e.$id("@clear").addClass("hidden")}})},"./app/view/notifications.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./view/fixable2.js"),s=i("./shared/events/index.js"),a=i("./shared/jquery.js");t.NotificationsMain=n.extend({onLoad:function(){o.makeFixable(this.$id("@notifs_nav"),{min_width:990})}}),t.NotificationsClearButton=n.extend({onLoad:function(){var e=this;this.$id("@clear").on("click",function(t){t.preventDefault();var i=a(".js_notif_dropdown .js_notif_item").length;e.serverCall("mark_as_seen").liveMutate().kwargs({limit:i}).success(function(t){t||e.emitEvent({type:s.Types.NOTIFS_HIDE_DROPDOWN,payload:{}})}).send()})}}),t.MarkAllAsReadLink=n.extend({onLoad:function(){this.$id("@link").on("click",this.markAllRead.bind(this))},markAllRead:function(e){
e.preventDefault(),this.emitEvent({type:s.Types.NOTIFS_MARK_ALL_READ,payload:{},scope:s.scope.GLOBAL}),this.$id("@link").toggleClass("hidden"),this.serverCall("request").liveMutate().send()}})},"./app/view/notifications/base.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./shared/events/index.js"),s=i("./shared/action_log.js").ActionableComponent;t.NotifBase=s.extend({onLoad:function(){this._super.apply(this,arguments),this.handleEvent(o.Types.NOTIFS_MARK_ALL_READ,this.removeUnseen.bind(this));var e=this;this.$id("@bad_notif").on("click",function(t){e.markAsIrrelevant()}),this.$id("@notif a").on("click",function(t){"#"==n(this).attr("href")&&t.preventDefault(),e.$id("@notif").hasClass("unseen")&&e.markAsSeen()}),this.actionBar&&this.$id("@content_toggle").on("click",function(t){t.preventDefault(),e.$id("@notif_content").removeClass("hidden"),e.$id("@content_toggle").addClass("hidden")})},removeUnseen:function(){this.$id("@notif").removeClass("unseen")},markAsSeen:function(){var e=this;
this.removeUnseen(),this.serverCall("mark_as_seen").liveMutate().success(function(t){t||e.emitEvent({type:o.Types.NOTIFS_HIDE_DROPDOWN,payload:{}})}).send()},removeMarkAsIrrelevant:function(){this.$id("@bad_notif").addClass("hidden")},markAsIrrelevant:function(e){this.removeMarkAsIrrelevant(),this.serverCall("mark_as_irrelevant").liveMutate().send()}})},"./app/view/notifications/header.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/window_manager.js");t.TitleNotificationsCount=n.extend({onLoad:function(e){e||this.setTitle()},setTitle:function(){var e=o.getTitle(),t=e,i="";(this.notif_count||this.inbox_count)&&(i+="(",this.notif_count&&(i+=this.notif_count),this.inbox_count&&(i+="/"+this.inbox_count),i+=") "),t=e.replace(/^\(((\d+)?\/)?\d+\) |/,i),e!=t&&o.setTitle(t)}})},"./app/view/nux.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.HeaderProgressBar=n.extend({onLoad:function(){this.$id("@progress_bar").css({
width:this.getWidth()});var e=this;this.handleEvent(o.Types.NUX_PROGRESS_BAR_STEP,function(t){var i=t.payload.step||this.curr;e.update(i)})},getWidth:function(){var e=this.$id("@progress_bar_wrapper"),t=parseInt(e.css("min-width"),10),i=parseInt(e.css("width"),10),n=this.curr/this.total*i;return Math.min(i,Math.max(n,t))},update:function(e){this.curr=e,this.$id("@progress_bar").animate({width:this.getWidth()})}}),t.HeaderProgressBarBeacon=n.extend({onLoad:function(){this.emitEvent({type:o.Types.NUX_PROGRESS_BAR_STEP,payload:{step:this.curr}})}})},"./app/view/nux/dialog.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./shared/events/index.js"),a=i("./shared/window_manager.js"),r=i("./w2.dialog.js").Dialog,d=i("./shared/viewport.js"),l=i("./shared/logging.js");t.ModalNuxDialogCloseIndicator=n.extend({onLoad:function(){this.emitEvent({type:s.Types.NUX_DIALOG_CLOSE,payload:{}}),this.emitEvent({type:s.Types.FEED_IMPRESSIONS_DISABLED,payload:{
disabled:!1}})}}),t.ModalNuxDialog=n.extend({onLoad:function(e){this.lastStep=null,this.emitEvent({type:s.Types.FEED_IMPRESSIONS_DISABLED,payload:{disabled:!0}}),d.setPageScroll(!1),this.handleEvent(s.Types.NUX_DIALOG_CLOSE,this.hide.bind(this)),this.handleEvent(s.Types.NUX_DIALOG_FINISH,this.nuxFinish.bind(this)),e&&l.log("nux_dialog_impression",{}),o(window).height()<600&&o(".dialog .dialog_wrapper").css("position","static")},hide:function(){this.$id("@modal_nux_wrapper").hide(),d.setPageScroll(!0)},nuxFinish:function(){var e=this;this.serverCall("finish_add_question").success(function(t){var i=t;i?a.navigateTo(i):e.hide()}).send()}}),t.InternalModalNuxDialogRenderer=t.ModalNuxDialog.extend({onLoad:function(e){var t=this;this.curr_step=this.step_num,o("body").keydown(function(e){37==e.keyCode&&t.curr_step>0?t.changeStep(t.curr_step,--t.curr_step):39==e.keyCode&&t.curr_step<t.num_steps-1&&t.changeStep(t.curr_step,++t.curr_step)}),this.$id("@modal_nux_wrapper .step_name").click(function(){
if(!o(this).hasClass("curr_step")){var e=parseInt(o(this).attr("id"));t.changeStep(t.curr_step,e),t.curr_step=e}})},changeStep:function(e,t){this.$id("@modal_nux_wrapper .dialog_wrapper.step_"+e).parent().addClass("hidden"),this.$id("@modal_nux_wrapper .step_name.step_name_"+e).removeClass("curr_step"),this.$id("@modal_nux_wrapper .dialog_wrapper.step_"+t).parent().removeClass("hidden"),this.$id("@modal_nux_wrapper .step_name.step_name_"+t).addClass("curr_step")}}),t.NuxDialogStep=n.extend({onLoad:function(){this.serverCall("record_step").kwargs({step_name:this.step_name+"_impr"}).send(),this.handleEvent(s.Types.NUX_DIALOG_SKIP_NEXT_STEP,this.skipNextStep.bind(this)),this.handleEvent(s.Types.NUX_DIALOG_NEXT_STEP,this.gotoNextStep.bind(this)),this.handleEvent(s.Types.NUX_DIALOG_STANDALONE_DONE,this.standaloneRefreshFeed.bind(this))},gotoStep:function(e){this.emitEvent({type:s.Types.NUX_PROGRESS_BAR_STEP,payload:{step:e}}),this.serverCall("goto_step").kwargs({step_num:e}).liveMutate().send();
},closeDialogAndGoToStep:function(e){e>this.num_steps&&this.closeDialog(),this.gotoStep(e)},closeDialog:function(){this.emitEvent({type:s.Types.NUX_DIALOG_FINISH,payload:{}})},gotoNextStep:function(){this.closeDialogAndGoToStep(this.step_num+1)},skipNextStep:function(){var e=this.step_num+2;e<=this.num_steps?this.emitEvent({type:s.Types.NUX_PROGRESS_BAR_STEP,payload:{step:this.step_num+1}}):this.emitEvent({type:s.Types.NUX_DIALOG_FINISH,payload:{}}),this.serverCall("skip_step").kwargs({step_num:this.step_num+1}).liveMutate().send()},stepUrl:function(e){return"#step="+e},standaloneRefreshFeed:function(){this.serverCall("standalone_refresh_feed").liveMutate().send(),r.dialogFor(this).close_()}}),t.NuxDialogRefreshFeedStep=t.NuxDialogStep.extend({onLoad:function(){this._super.apply(this,arguments),this.num_attempt=0,this.MAX_ATTEMPT=3,this.initial_time_wait=3e3,this.maybeGoToNextStep()},maybeGoToNextStep:function(){var e=this.initial_time_wait*(this.num_attempt+1);"internal_page"!=this.page_context&&setTimeout(this.shouldShowFeed.bind(this),e);
},shouldShowFeed:function(){var e=this;e.num_attempt+=1,e.num_attempt>e.MAX_ATTEMPT?e.gotoNextStep():e.serverCall("should_show_feed").success(function(t){t?e.gotoNextStep():e.maybeGoToNextStep()}).error(function(){e.serverCall("log_error"),e.gotoNextStep()}).send()},gotoStep:function(e){var t=this;this.serverCall("goto_step").kwargs({step_num:e,num_attempt:t.num_attempt}).success(function(){return t.emitEvent({type:s.Types.HOME_MULTIFEED_REFRESH,payload:{}}),!1}).error(function(){return t.emitEvent({type:s.Types.HOME_MULTIFEED_REFRESH,payload:{}}),!1}).send()}});var c=t.NuxDialogContinueButton=n.extend({onLoad:function(){this.$id("@next").on("click",this.onClick.bind(this))},finishStep:function(){this.$id("@next").hasClass("submit_button_disabled")||(this.standalone?this.emitEvent({type:s.Types.NUX_DIALOG_STANDALONE_DONE,payload:{}}):this.emitEvent({type:s.Types.NUX_DIALOG_NEXT_STEP,payload:{}}))},onClick:function(){return this.finishStep(),!1}});t.NuxDialogInferredFriendsContinueButton=c.extend({
onLoad:function(){this._super.apply(this,arguments),this.fuid_map={};for(var e=0;e<this.unchecked_fuids.length;++e)this.fuid_map[this.unchecked_fuids[e]]=!1;for(var t=0;t<this.checked_fuids.length;++t)this.fuid_map[this.checked_fuids[t]]=!0;var i=this;this.handleEvent(s.Types.NUX_DIALOG_FRIENDS_UPDATE,function(e){e.payload.addFriend?i.add(e.payload.addFriend):e.payload.removeFriend?i.remove(e.payload.removeFriend):e.payload.addAll?i.addAll():e.payload.removeAll&&i.removeAll()})},onClick:function(e){e.preventDefault(),this.serverCall("button_clicked").kwargs({fuid_map:this.fuid_map,prechecked_fuids:this.checked_fuids}).success(this.finishStep.bind(this)).error(this.finishStep.bind(this)).send()},add:function(e){this.fuid_map[e]=!0},remove:function(e){this.fuid_map[e]=!1},addAll:function(){for(var e in this.fuid_map)this.add(e)},removeAll:function(){for(var e in this.fuid_map)this.remove(e)}}),t.NewNuxDialogSkipButton=c.extend({onClick:function(e){e.preventDefault(),this.serverCall("button_clicked").success(this.finishStep.bind(this)).error(this.finishStep.bind(this)).send();
}}),t.NuxDialogFollowMinimumTopicsContinueButton=c.extend({onLoad:function(){this._super.apply(this,arguments),this.tids={};var e=this;this.handleEvent(s.Types.TOPICS_GRID_ADD,function(t){t.payload.tid&&(e.tids[t.payload.tid]=!0,e.num_followed+=1,e.updateButton(e.num_followed))}),this.handleEvent(s.Types.TOPICS_GRID_REMOVE,function(t){t.payload.tid&&(delete e.tids[t.payload.tid],e.num_followed-=1,e.updateButton(e.num_followed))})},onClick:function(e){if(e.preventDefault(),this.$id("@next").hasClass("submit_button_disabled"))return!1;var t=Object.keys(this.tids).map(function(e){return parseInt(e,10)});this.serverCall("button_clicked").kwargs({tids:t}).liveMutate().success(this.finishStep.bind(this)).error(this.finishStep.bind(this)).send()},updateButton:function(e){var t=this.min_interests-e;t>=1?this.$id("@next").addClass("submit_button_disabled").text(this.num_topics_texts[t]):this.$id("@next").removeClass("submit_button_disabled").text(this.button_continue_text)}}),t.DynamicTopicGrid=n.extend({
onLoad:function(){var e=this;this.handleEvent(s.Types.TOPICS_GRID_ADD,function(t){t.payload.tid&&e.addTopic(t.payload.tid)}),this.handleEvent(s.Types.TOPICS_GRID_REMOVE,function(t){t.payload.tid&&e.removeTopic(t.payload.tid)}),this.handleEvent(s.Types.TOPICS_GRID_UPDATE_SHOWN,function(t){if(t.payload.newSuggestions)for(var i=0;i<t.payload.newSuggestions.length;i++)e.topicSuggestions.push(t.payload.newSuggestions[i])})},addTopic:function(e){this.followedTids.push(e)},addRow:function(e){this.$id("@more").append('<span class="new_items"></span>');var t=this.$id("@more").children(".new_items").last();this.serverCall("load_row").kwargs({tid:e}).contentFor(t).sendOnlyOnce()},getFollowingCount:function(){return this.followedTids.length},removeTopic:function(e){var t=this.followedTids.indexOf(e);-1!=t&&this.followedTids.splice(t,1)}}),t.DynamicInterestsGrid=t.DynamicTopicGrid.extend({addTopic:function(e){this._super.apply(this,arguments),this.addRow(e),this.serverCall("follow_topic").kwargs({tid:e
}).send()},removeTopic:function(e){this._super.apply(this,arguments),this.serverCall("unfollow_topic").kwargs({tid:e}).send()}}),t.InterestsGridItems=n.extend({onLoad:function(){this.emitEvent({type:s.Types.TOPICS_GRID_UPDATE_SHOWN,payload:{newSuggestions:this.new_suggestions}})}}),t.ExpertiseTopicListItemRemoveButton=n.extend({onLoad:function(){this.$id("@expertise-remove-button").click(this.dismiss.bind(this))},dismiss:function(e){return e.preventDefault(),this.serverCall("remove_expertise_topic").kwargs({tid:this.tid}).liveMutate().send(),!1}}),t.NuxDialogFollowExpertiseContinueButton=t.NuxDialogFollowMinimumTopicsContinueButton.extend({onClick:function(e){e.preventDefault(),this.serverCall("button_clicked").liveMutate().success(this.finishStep.bind(this)).error(this.finishStep.bind(this)).send()}}),t.LanguageListItem=n.extend({onLoad:function(){var e=this;e.$item=e.$id("@language_item"),e.$item.on("click",function(){e.$item.toggleClass("selected")})}})},"./app/view/nux/existing_user.js":function(e,t,i){
var n=i("./shared/core/component.js").Component;t.ExistingUserNuxSidebar=n.extend({onLoad:function(){this.serverCall("track_impression").send()}}),t.ExistingUserNuxButton=n.extend({onLoad:function(){this.$id("@existing-user-nux").click(this.initate.bind(this))},initate:function(e){return e.preventDefault(),this.serverCall("start_existing_user_nux").liveMutate().send(),!1}}),t.ExistingUserNuxDismiss=n.extend({onLoad:function(){this.$id("@existing-user-nux-dismiss").click(this.dismiss.bind(this))},dismiss:function(e){return e.preventDefault(),this.serverCall("dismiss_existing_user_nux").liveMutate().send(),!1}})},"./app/view/nux/find_friends.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./w2.dialog.js").Dialog,s=i("./facebook.js"),a=i("./shared/facebook.js"),r=i("./shared/events/index.js"),d=i("./view/paged_list.js").PagedList;t.FacebookFindFriendsButton=s.FacebookConnectButton.extend({onLoad:function(){this._super.apply(this,arguments),this.$id("@facebook_follow_button").on("click",this.onClick.bind(this));
},onClick:function(){return a.isLoaded()&&(this.serverCall("button_clicked").send(),this.connect()),!1},onLogin:function(e){this.showLoading(),this._super.apply(this,arguments)},closeDialog:function(){this.standalone&&(o.dialogFor(this).close_(),this.parent()&&this.parent().standaloneRefreshFeed())},_onLogin:function(e){var t=this.serverCall("connect_facebook").kwargs({fb_access_token:e.accessToken,fb_uid:e.userID,expires:e.expiresIn});this.live_mutate&&t.liveMutate(),t.success(this.closeDialog.bind(this)).error(this.closeDialog.bind(this)).send()},onLoginFailed:function(){this.serverCall("record_connect_failure").send()},showLoading:function(){this.$id("@normal_text").hide(),this.$id("@loading_text").show(),this.$id("@row").addClass("complete")}}),t.FacebookFindFriendsAndContinueButton=t.FacebookFindFriendsButton.extend({onLoginFailed:function(){this.standalone?o.dialogFor(this).close_():this.serverCall("login_failed").liveMutate().send(),this.serverCall("record_connect_failure").send();
}}),t.PowerUserFacebookFindFriendsAndContinueButton=t.FacebookFindFriendsAndContinueButton.extend({onLoginFailed:function(){o.dialogFor(this).close_(),this.serverCall("record_connect_failure").send()},_onLogin:function(e){this.serverCall("connect_facebook").kwargs({fb_access_token:e.accessToken,fb_uid:e.userID,expires:e.expiresIn}).error(this.closeDialog.bind(this)).send()},closeDialog:function(){o.dialogFor(this).close_()}}),t.FriendFollowIndicatorLink=n.extend({onLoad:function(){this.$toggle=this.$id("@toggle"),this.$toggle.on("click",this.onClick.bind(this)),this.isSelected=this.$toggle.hasClass("selected");var e=this;this.handleEvent(r.Types.NUX_DIALOG_FRIENDS_UPDATE,function(t){t.payload.addAll?e.toggleSelection(!0):t.payload.removeAll&&e.toggleSelection(!1)})},toggleSelection:function(e){this.isSelected=e,this.$toggle.toggleClass("selected",e),this.$toggle.toggleClass("unselected",!e)},onClick:function(){this.toggleSelection(!this.isSelected),this.isSelected?this.emitEvent({type:r.Types.NUX_DIALOG_FRIENDS_UPDATE,
payload:{addFriend:this.fuid}}):this.emitEvent({type:r.Types.NUX_DIALOG_FRIENDS_UPDATE,payload:{removeFriend:this.fuid}})}}),t.FriendToggleCheckbox=n.extend({onLoad:function(){this.checkbox=this.$id("@friend_row").find(":checkbox"),this.checkbox.on("change",this.onChange.bind(this));var e=this;this.$id("@friend_row").on("click",function(){e.onChange()}),this.handleEvent(r.Types.NUX_DIALOG_FRIENDS_UPDATE,function(t){t.payload.addAll?e.toggleChecked(!0):t.payload.removeAll&&e.toggleChecked(!1)})},toggleChecked:function(e){this.checkbox.prop("checked",e)},onChange:function(){this.checkbox.prop("checked")?this.emitEvent({type:r.Types.NUX_DIALOG_FRIENDS_UPDATE,payload:{addFriend:this.fuid}}):this.emitEvent({type:r.Types.NUX_DIALOG_FRIENDS_UPDATE,payload:{removeFriend:this.fuid}})}}),t.UnfollowedInferredFriendsToggleLink=n.extend({onLoad:function(){this.$id("@add").on("click",this.onAddClick.bind(this)),this.$id("@remove").on("click",this.onRemoveClick.bind(this));var e=this;this.handleEvent(r.Types.NUX_DIALOG_FRIENDS_UPDATE,function(t){
t.payload.updateAll&&e.updateFriendsList()})},changeAll:function(e){this.emitEvent({type:r.Types.NUX_DIALOG_FRIENDS_UPDATE,payload:{addAll:e,removeAll:!e}})},updateFriendsList:function(){this.action&&this.changeAll("add_all"==this.action)},onAddClick:function(){this.action="add_all",this.changeAll(!0),this.$id("@add").hide(),this.$id("@remove").show(),this.serverCall("button_clicked").kwargs({button_name:this.action}).send()},onRemoveClick:function(){this.action="remove_all",this.changeAll(!1),this.$id("@add").show(),this.$id("@remove").hide(),this.serverCall("button_clicked").kwargs({button_name:this.action}).send()}}),t.InferredFriendsList=d.extend({onUpdate:function(e){this._super.apply(this,arguments),this.emitEvent({type:r.Types.NUX_DIALOG_FRIENDS_UPDATE,payload:{updateAll:!0}})}})},"./app/view/oauth.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.OauthCallbackPage=n.extend({onLoad:function(){if(window.opener){var e=window.opener.require("shared/jquery");this.access_token?e(window.opener.document).trigger("oauth_approved",{
service:this.service,accessToken:this.access_token}):e(window.opener.document).trigger("oauth_rejected",{service:this.service}),window.close()}else this.$id("@me").text("access token: "+JSON.stringify(this.access_token))}})},"./app/view/payment/receivable.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./unified_view/modal.js").ModalBase;t.PaymentSettings=n.extend({onLoad:function(){var e=this,t=e.$id("@change_default"),i=t.find("input:radio");e.$id("@edit").click(function(t){t.preventDefault(),e.createModal("load_edit_card_modal").show()}),i.change(function(){e.serverCall("update_default_card").kwargs({index:i.index(t.find(":checked"))}).send()})}}),t.EditCardModal=o.extend({onSubmit:function(){var e=this,t=e._super;e.child("add_card_form").submit(function(){t.apply(e,arguments)})}}),t.DeleteCardLink=n.extend({onLoad:function(){var e=this;e.$id("@create_modal_link").on("click",function(t){t.preventDefault(),e.createModal("load_inner").show()})}}),t.DeleteCardConfirmationModal=o.extend({
onSubmit:function(){this.serverCall("delete_card").liveMutate().send(),this.close()}}),t.CannotDeleteCardModal=o.extend({onSubmit:function(){this.close()}})},"./app/view/people_selector.js":function(e,t,i){var n=i("./view/selector.js").Selector,o=i("./view/selector.js").MultiSelector;t.LegacyPeopleSelector=n.extend({resultWasSelected:function(e){this.parent().setTo(e.data.uid),this.setQuery(""),this.$input.blur()}}),t.PeopleAndSocialContactsMultiSelector=o.extend({whenOnSavedResultsChanged:function(e){this._onSavedResultsChanged=e},onSavedResultsChanged:function(){this._onSavedResultsChanged&&this._onSavedResultsChanged(this.saved_results)}})},"./app/view/photo.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./w2.dialog.js"),s=i("./shared/jquery.js"),a=i("./shared/errors.js"),r=i("./shared/window_manager.js");t.EditPhotoDialogLink=n.extend({onLoad:function(){var e=this;this.$id("@open_edit_photo").click(function(){return e.editPhoto(),!1}),e.prompt_add_photo&&e.editPhoto();
},editPhoto:function(){var e=this;this._dialog||(this._dialog=o.createDialog(this,{showXButton:!0,closeOnClickOut:!0,width:550}).title(this.dialog_title).load("set_dialog_contents").close(function(){e._dialog=null}))}}),t.InlineEditPhotoChoice=n.extend({onLoad:function(){var e=this;this.$id("@choices").on("click",".choose_pic",function(t){var i=s(t.target).attr("choice");return e.serverCall("choose_photo").kwargs({choice:i}).success(function(){e.next_url?r.navigateTo(e.next_url):o.Dialog.dialogFor(e).close_()}).send(),e.$id("@choices").text(e.setting_text),!1})}}),t.InlineUploadPhotoWeb=n.extend({onLoad:function(){this.$id("@download").on("click",this.onClick.bind(this)),this.$id("@url").on("input",this.onChange.bind(this)),this.downloading=!1},onChange:function(){var e=this.$id("@url").val();this.$id("@download").toggleClass("hidden",!e)},onClick:function(){if(!this.downloading){var e=this.$id("@url").val();if(e){this.downloading=!0;var t=new Image;t.onload=this.downloadImage.bind(this,e),
t.onerror=this.downloadImageError.bind(this),t.src=e}}},downloadImageError:function(){this.downloading=!1,alert(this.invalid_image_text),this.$id("@url").val("")},downloadImage:function(e){if(!this._contentForTarget)return void a.logJsError("InlineUploadPhotoWeb","contentFor target not set.");var t=this;this.serverCall("download").kwargs({target_id:this.target_id,target:this.target,url:e}).contentFor(this._contentForTarget).liveMutate().except("image_error",function(e){alert(e.message),o.Dialog.dialogFor(t).close_()}).except("thumbs_already_set",function(){o.Dialog.dialogFor(t).close_()}).success(this.onShowPhotoChoice.bind(this)).send()},focus:function(){this.$id("@url").focus()},setContentForTarget:function(e){this._contentForTarget=e},setShowPhotoChoiceCallback:function(e){this._showPhotoChoice=e},onShowPhotoChoice:function(){this._showPhotoChoice&&this._showPhotoChoice()}})},"./app/view/pmsg/pmsg.js":function(e,t,i){var n=i("./view/pmsg.js");t.FlagConfirmationPmsg=n.PMsg.extend({onLoad:function(){
var e=this;this._super.apply(this,arguments),this.$id("@undo").click(function(t){return e.undo(),!1})},undo:function(){this.serverCall("undo").liveMutate().send()}})},"./app/view/post.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.PostSuggestedEditDiscardButtonInline=n.extend({onLoad:function(){var e=this;this.$id("@submit").click(function(t){e.serverCall("discard_suggested_edit").kwargs({pid:e.pid}).liveMutate().send(),t.preventDefault()})}})},"./app/view/query/filters.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./view/fixable2.js"),s=i("./view/selector.js").Selector;t.SearchFilters=n.extend({onLoad:function(){var e=this;o.makeFixable(e.$id("@sidebar_filters"),{min_height:e.$id("@sidebar_filters").outerHeight()+e.$id("@sidebar_filters").offset().top,min_width:990})}}),t.SearchFilterAuthorSelector=s.extend({resultWasSelected:function(e){this.parent().addFilterToKey(e.data.uid)}}),t.SearchFilterTopicSelector=s.extend({resultWasSelected:function(e){
this.parent().addFilterToKey(e.data.topic_routing_name)}})},"./app/view/query/query.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./w2.dialog.js"),a=i("./shared/viewport.js"),r=i("./shared/action_log.js");t.QueryResult=r.ActionableComponent.extend({onLoad:function(){this._super.apply(this,arguments),this.setDvar("query_id",this.query_id),this.setDvar("index",this.index);var e="_blank";this.compact&&(e="_parent"),this.$id('@title a[href!="#"]').attr("target",e),this.$id('@content a[href!="#"]').attr("target",e),this.checkHighlight(),this.unseen.bound||(document.addEventListener("scroll",this.recordPrivateViews.bind(this)),setTimeout(this.recordPrivateViews.bind(this),400),this.unseen.bound=!0),this.unseen.items[this.cid]=this,this.view_item=[this.type,this.object_id]},navigateToObject:function(){var e=this.$id("@title a").attr("href");window.open(e,"_parent")},checkHighlight:function(){var e=this.$id("@title").get(0),t=this.$id("@content").get(0);
(null==e||null==t||(e.innerHTML+t.innerHTML).indexOf("matched_term")<0)&&this.serverCall("log_highlight_error").send()},unseen:{bound:!1,items:{},lastCheckTime:0,rateLimit:500},recordPrivateViews:function(){var e=+new Date;if(!(e<this.unseen.lastCheckTime+this.unseen.rateLimit)){this.unseen.lastCheckTime=e;var t=[],i=[];for(var n in this.unseen.items){var o=this.unseen.items[n];a.isElementInViewport(o.$id("@item").get(0))&&(t.push(o),i.push(o.view_item),delete this.unseen.items[n])}t.length>0&&t[0].serverCall("log_private_views").kwargs({view_items:i}).send()}}}),t.QueryResultRankingMetadata=n.extend({onLoad:function(){var e=this;this.$id("@metadata").click(function(){var t=e.$id("@metadata").parent().hasClass("expanded");o(".metadata").parent().removeClass("expanded"),t||e.$id("@metadata").parent().addClass("expanded")})}}),t.QueryResults=n.extend({onLoad:function(){var e=this;this.$id("@create_topic_link").click(function(){return s.createDialog(e).load("create_topic_dialog"),!1})}})},
"./app/view/question.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./view/dialog.js"),s=i("./w2.dialog.js"),a=i("./tooltip.js"),r=i("./shared/jquery.js"),d=i("./shared/debounce.js").debounce,l=i("./shared/events/index.js"),c=i("./shared/cookies.js"),u=i("./shared/window_manager.js"),h=i("./shared/views.js").viewsLogger,p=i("./view/inline_editor.js").InlineEditor,f=i("./shared/scroll_animation_handler.js"),_=i("./view/fixable2.js"),m=i("./shared/logging.js"),g=i("./shared/action_log.js").ActionableComponent,v=i("./unified_view/toggle.js"),w=l.Types,b=1500,y=t.NewGridQuestionPage=n.extend({onLoad:function(){var e=this;e.handleEvent(w.QUESTION_DELETE_STATE_CHANGE,function(t){t.payload.qid==e.qid&&u.reload()})}});t.QuestionMain=y.extend({onLoad:function(e){if(this._super.apply(this,arguments),e&&this.record_impression&&setTimeout(function(){m.log("funnel_impression",{impression_type:"question_page_impression"})},1e3),null!=this.child("ad")){var t=this.$id("@right_col_fixable"),i=r(document),n=53,o=this.$id("@actions").height()+n;
_.makeFixable(t,{scroll_dep:!0,min_scroll_callback:function(){return o},max_scroll_callback:function(){return i.height()-b}}),this.handleEvent(w.RELATED_QUESTIONS_EXPAND,function(e){_.removeFixable(t)})}}}),t.QuestionLink=n.extend({onLoad:function(){var e=this;this.$id("@link").mousedown(function(){c.setQfeedLog(e,"QuestionClickthrough"),c.setQueryLog(e,"QuestionClickthrough")})}}),t.RelatedQuestions=v.ToggleBase.extend({switchEnd:function(){this._super.apply(this,arguments),this.emitEvent({type:l.Types.RELATED_QUESTIONS_EXPAND,payload:{elem:this.$switchShow}})}}),t.RelatedQuestionsList=n.extend({onLoad:function(){var e=this,t=!1,i=300;if(this.recordStep(["rq_impression","rq_impression_repeated"]),!this.inline&&!this.is_expanded&&!this.show_ad){var n=e.$id("@related_questions_list").get(0),o=r(".layout_2col_side").height()+r(".SiteHeader").height()+10;if(o-i>r(window).height()&&(t=!0),t){var s=r(n).find(".related_question").slice(8);n&&_.makeFixable(n,{scroll_dep:!0,min_scroll_callback:function(){
return o},min_height:0,footer:r(".first_content_page_feed").get(0)}),f.add(window,function(){window.scrollY>o?s.addClass("hidden"):s.removeClass("hidden")})}else{var a=16,d=r(".SiteHeader").height()+a,l=r(n).offset().top,c=l-d;n&&_.makeFixable(n,{scroll_dep:!0,min_height:o,min_scroll:c,extra_bottom_spacing:80,footer:r(".first_content_page_feed").get(0)})}}},recordStep:function(e){m.log("related_question_steps",{steps:e})}}),t.RelatedQuestionLink=g.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.$id("@actionable").on("mousedown",function(){e.recordStep("related_question_click")})},recordStep:function(e){this.serverCall("record_step").kwargs({step_name:e}).send()}}),t.QuestionArea=n.extend({onLoad:function(){this._super.apply(this,arguments),this._detailsOverLimit=!1,this._textOverLimit=!1;var e=this;this.handleEvent(l.Types.QUESTION_EDITING_STATE,function(t){t.payload.qid==e.qid&&("edit"==t.payload.state?e.editLinkClicked():"cancel"==t.payload.state?e.cancelLinkClicked():"text_limit"==t.payload.state?e._textOverLimit=t.payload.is_over:"details_limit"==t.payload.state&&(e._detailsOverLimit=t.payload.is_over));
}),e.$id("@question_update").click(function(t){t.preventDefault(),e.emitEvent({type:l.Types.QUESTION_EDITING_STATE,payload:{qid:e.qid,state:"request"}}),e.$id("@form_button_container").addClass("hidden"),e.block_details_edit&&e.$id("@details_container").removeClass("hidden")}),e.$id("@question_cancel").click(function(t){t.preventDefault(),e.emitEvent({type:l.Types.QUESTION_EDITING_STATE,payload:{qid:e.qid,state:"trigger_cancel"}}),e.$id("@form_button_container").addClass("hidden"),e.block_details_edit&&e.$id("@details_container").removeClass("hidden")})},editLinkClicked:function(){this.$id("@form_button_container").removeClass("hidden"),this.block_details_edit&&this.$id("@details_container").addClass("hidden")},cancelLinkClicked:function(){this.$id("@form_button_container").addClass("hidden"),this.block_details_edit&&this.$id("@details_container").removeClass("hidden")},updateButton:function(){this.$id("@question_update").toggleClass("disabled",this._textOverLimit||this._detailsOverLimit),
this.block_details_edit&&this.$id("@details_container").removeClass("hidden")}});var C=p.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.handleEvent(l.Types.QUESTION_EDITING_STATE,function(t){t.payload.qid==e.id&&("edit"==t.payload.state?e.editorShown||e.toggle_editor():"cancel"==t.payload.state?e.editorShown&&e.toggle_editor():"request"==t.payload.state?e.trigger_request():"trigger_cancel"==t.payload.state&&e.trigger_cancel())})},onEditLinkClick:function(){this.emitEvent({type:l.Types.QUESTION_EDITING_STATE,payload:{qid:this.id,state:"edit"}})},cancelEditor:function(){this._super.apply(this,arguments),this.emitEvent({type:l.Types.QUESTION_EDITING_STATE,payload:{qid:this.id,state:"cancel"}})}});t.QuestionTextInlineEditor=C.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.editor.setLengthChangeCallback(function(t){e.emitEvent({type:l.Types.QUESTION_EDITING_STATE,payload:{qid:e.id,state:"text_limit",is_over:t}})})}}),t.FeedQuestionTextInlineEditor=t.QuestionTextInlineEditor.extend({
toggle_editor:function(){}}),t.QuestionDetailsInlineEditor=C.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.editor.setLengthChangeCallback(function(t){e.emitEvent({type:l.Types.QUESTION_EDITING_STATE,payload:{qid:e.id,state:"details_limit",is_over:t}})})}}),t.FeedQuestionDetailsInlineEditor=t.QuestionDetailsInlineEditor.extend({toggle_editor:function(){}}),t.QuestionDeleteUndeleteLink=n.extend({onLoad:function(){var e=this;this.$id("@undelete_question_link").click(function(){return s.createDialog(e).title(e.undelete_title).cancel().ok(function(){e._request("undelete_question")}).text(e.undelete_content),!1})},_request:function(e){var t=this;this.serverCall(e).kwargs({qid:this.qid}).success(function(){t.emitEvent(l.helpers.changeQuestionDeletionState(t.qid))}).liveMutate().send()}}),t.QuestionDeleteDialog=o.AddCommentDialog.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),e.setSuccessCallback(function(){e.emitEvent(l.helpers.changeQuestionDeletionState(e.object_id));
})},getPars:function(){return this.comment_required&&this.editor.isOnlyWhiteSpace()?!1:{comment:this.editor.serialize(),review:this.review}}}),t.AnswerActions=n.extend({}),t.AnswerPermaLink=n.extend({onLoad:function(){var e=this;this.$id("@link").mousedown(function(){c.setQfeedLog(e,"AnswerClickthrough"),c.setQueryLog(e,"AnswerClickthrough")}),this.tooltip&&a.attach(this.$id("@link"),this.tooltip)}}),t.AnswerUndeleteBanner=n.extend({onLoad:function(){var e=this;e.$id("@answer_undelete").on("click",function(t){e.createModal("load_answer_undelete_modal").onSubmit(function(){e.serverCall("unremove_answer").kwargs({aid:e.aid}).liveMutate().send()}).show()})}}),t.AnswerPageViewMoreLink=n.extend({onLoad:function(){var e=this;this.$id("@link").mousedown(function(){c.setQfeedLog(e,"QuestionClickthrough"),c.setQueryLog(e,"QuestionClickthrough")})}}),t.CreateAnswerWikiLink=n.extend({onLoad:function(){this.$id("@create_answer_wiki").click(function(e){r("#answer_wiki").toggleClass("hidden"),e.preventDefault();
})}}),t.AnswerListDiv=n.extend({onLoad:function(){this.header_height=r(".SiteHeader").outerHeight(),this.offset=15,this.$id("@answers_anchor").css("top","-"+this.header_height+"px"),"#answers"==window.location.hash&&r(window).scrollTop(this.$id("@answers_anchor").offset().top)},show:function(){this.$id("@collapsed").show()}}),t.QuestionAnswerMain=n.extend({onLoad:function(e){e&&setTimeout(function(){m.log("funnel_impression",{impression_type:"answer_page_impression"})},1e3),this.recordStep("share_impression")},recordStep:function(e){this.serverCall("record_step").kwargs({step_name:e}).send()}});var k=y;t.QuestionAnswerPageMain=k.extend({onLoad:function(e){var t=this;this._super.apply(this,arguments),t.prompt_topic_bio?t.createModal("credentials_modal").kwargs({aid:t.aid}).show():t.prompt_share_answer&&t.createModal("share_answer_modal").kwargs({aid:t.aid}).show(),e&&setTimeout(function(){m.log("funnel_impression",{impression_type:"answer_page_impression"})},1e3),this.recordStep("share_impression");
},recordStep:function(e){this.serverCall("record_step").kwargs({step_name:e}).send()}}),t.AnswerPagedListItem=n.extend({onLoad:function(){if(h.addComponentToTrack(this),this.shouldTriggerSignupToast){var e=50;r(document).on("scroll",d(this.signupToastScrollTrigger.bind(this),e))}},signupToastScrollTrigger:function(){var e=this;this.signUpToastTriggered||this.shouldShowToast()&&(e.emitEvent({type:l.Types.SIGNUP_TOAST_SHOW,payload:{}}),this.signUpToastTriggered=!0)},shouldShowToast:function(){var e=this;return r(window).scrollTop()>e.scrollThreshold}})},"./app/view/question/add_answer.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./w2.dialog.js"),a=i("./view/inline_editor.js").InlineEditor,r=i("./shared/cookies.js"),d=i("./shared/window_manager.js"),l=i("./view/modal.js").Base,c=i("./settings-webpack.js"),u=c.interface_strings,h=i("./shared/facebook.js"),p=i("./app/view/share.js").showShareAction;t.AnswerAdd=n.extend({onLoad:function(){
var e=this;e.$id("@toggle_zen").click(function(){e.toggleZen()}),e.$id("@answer_add").find(".submit_button").click(function(){e.$id("@answer_add").hasClass("is_zen")&&e.toggleZen()});var t=this.child("editor_section").child("editor");t.whenOnLoaded(t.focusEditorInputWhenReady.bind(t))},toggleZen:function(){function e(e){27==e.keyCode&&t.toggleZen()}var t=this;t.$id("@answer_add").hasClass("is_zen")?(t.serverCall("zen_mode_exited").send(),o(document).off("keyup",e)):(t.serverCall("zen_mode_entered").send(),o(document).keyup(e)),o("body").toggleClass("zen_mode"),t.$id("@answer_add").toggleClass("is_zen"),t.$id("@zen_bg").toggleClass("hidden")}});var f=t.AnswerEditor=a.extend({onLoad:function(){this.editor=this.child("editor"),this.answerShareForm=this.child("answer_share_form"),this.editorShare=this.answerShareForm&&this.answerShareForm.child("editor_share");var e=this;this.editor.prevent_load_drop_zone=!0,this._super.apply(this,arguments),this.disclaimer_update="",this.editor.setFocusCallback(function(){
e.focusEditor()}),this.editor.isInteractive()||this.focusEditor(),this.updated_question_modal_shown=!1},focusEditor:function(){this.editor.support_drag_and_drop_upload&&(this.dragAndDropFormLoaded||(this.dragAndDropFormLoaded=!0,this.editor.loadDragAndDropForm()))},focusEditorInputWhenReady:function(){var e=this;this.editor.setEditorReadyCallback(function(){e.editor.hideFakeEditor()})},showShareWarningDialog:function(){var e,t=this,i=this.editorShare.getValues();i.tw?e=i.fb?this.share_warning_texts.tw_fb:this.share_warning_texts.tw:i.fb&&(e=this.share_warning_texts.fb),this.editorShare.serverCall("warning_dialog_shown").send(),s.createDialog(this.editorShare).title(this.share_warning_dialog_title).cancel(null,u.cancel).ok(function(){t.shouldShowShareWarningDialog=!1,t.input_button_obj.click()},this.share_warning_dialog_ok).html(e)},showAnonAnswerWarningDialog:function(){var e=this;e.createModal("anon_answer_warning").onSubmit(function(){e.shouldShowAnonAnswerWarningDialog=!1,e.serverCall("accept_anon_answer_warning").send(),
e.input_button_obj.click()}).show()},submitHandler:function(){var e=this;this.input_button_obj.click(function(t){if(e.getEditor()&&e.isEditorEmpty())return!1;var i={};e.editorShare&&(i=e.editorShare.getValues());var n=(i.tw||i.fb)&&e.shouldShowShareWarningDialog;return n?(e.showShareWarningDialog(),!1):e.shouldShowAnonAnswerWarningDialog?(e.showAnonAnswerWarningDialog(),!1):(e.trigger_request(),void t.preventDefault())})},invokeEditServerCall:function(e){var t={};if(this.editorShare&&(t=this.editorShare.getValues()),t.fb&&!h.hasPermission("publish_actions")){var i=this._super,n=this;h.requestPermissions("publish_actions",function(){i.call(n,e)})}else this._super.call(this,e)},ajax_callback:function(e){return e.ans_url&&d.navigateTo(e.ans_url),e&&e.show_updated_question_modal?(this.save_draft(!0),this.createModal("load_changed_modal").kwargs({submit_id:this.input_button_obj.attr("id"),qid:e.qid}).show(),this.updated_question_modal_shown=!0,void(this.locked=!1)):(e.share_data&&e.share_data.autoShowShareDialog&&p(e.share_data),
d.sameDomainURL(e.url)&&d.navigateTo(e.url),this._super.apply(this,arguments))},tlog_data:function(){return{type:"AddAnswer"}},getLoggedAction:function(){return"AnswerAdd"},logSaveDraft:function(){r.setTlog({type:"QuestionSaveDraft",qid:this.id})},_get_kwargs:function(){var e={id:this.id,input:this.get_value(),disclaimer_update:this.disclaimer_update,fb_uid:h.getFbUid(),fb_access_token:h.getAccessToken(),fb_expires:h.getExpiresIn(),updated_question_modal_shown:this.updated_question_modal_shown,redirect_to_answer_page:this.redirect_to_answer_page};return this.editorShare&&(e.share_values=this.editorShare.getValues()),e},getSaveDraftKwargs:function(){var e=this._super.apply(this,arguments);return e}});t.AnswerInFeedEditor=f.extend({trigger_request:function(){r.setQfeedLog(this,"AddAnswer"),this._super.apply(this,arguments)},logSaveDraft:function(){r.setQfeedLog(this,"QuestionSaveDraft")},ajax_callback:function(e){this.$id("@inline_editor_form").parents(".answer_editor").addClass("hidden"),
this._super.apply(this,arguments)}}),t.AnswerDraftPageEditor=f.extend({onLoad:function(){this._super.apply(this,arguments),this.should_toggle_on_submit=!1,this.editor=this.child("editor"),this.editor.focus()},trigger_request:function(){r.setQfeedLog(this,"AddAnswer"),this._super.apply(this,arguments)},logSaveDraft:function(){r.setQfeedLog(this,"QuestionSaveDraft")}}),t.AnswerEditorMetadataItem=n.extend({onLoad:function(){var e=this,t=this.$id("@toggle");t.click(function(){return e.$id("@item").toggleClass("ghosted"),t.text()===e.show_text?(e.showItem(),t.text(e.hide_text)):(e.hideItem(),t.text(e.show_text)),!1})},showItem:function(){return!1},hideItem:function(){return!1}}),t.ChangedQuestionModal=l.extend({onSubmit:function(){var e=this;this._closeModal(),o("#"+e.submit_id).click()},onCancel:function(){o(".answer_editor").removeClass("hidden"),this._closeModal()},onClose:function(){o(".answer_editor").removeClass("hidden"),this._closeModal()}})},"./app/view/question/answer_tag.js":function(e,t,i){
var n=i("./shared/core/component.js").Component,o=i("./tooltip.js"),s=i("./w2.dialog.js"),a=s.Dialog;t.AnswerTagAdminActions=n.extend({onLoad:function(){this.enabled||this.$id("@tag_options").addClass("hidden")}}),t.AnswerTagOption=n.extend({onLoad:function(){var e=this;this.$id("@select_tag").click(function(){return e._dialog=s.createDialog(e).title(e.dialog_title).load("add_tag_dialog"),!1})}}),t.AnswerSoftCollapseMenuListItem=n.extend({onLoad:function(){var e=this;e.$id("@toggle_soft_collapse").on("click",function(t){t.preventDefault(),e.serverCall("toggle_soft_collapse").send()})}}),t.AddTagDialog=n.extend({onLoad:function(){var e=this;this.$id("@cancel").click(function(){return a.dialogFor(e).close_(),!1}),this.$id("@add_tag").click(function(){var t=null;if(e.should_show_editor){var i=e.child("editor");t=i.serialize()}var n=e.$id("@locked").is(":checked");return e.serverCall("add_tag").kwargs({comment:t,lock:n}).liveMutate().success(function(){a.dialogFor(e).close_()}).send(),!1})}
}),t.AnswerTag=n.extend({onLoad:function(){var e=this;this.$id("@show_comment").click(function(){return e.$id("@comment").removeClass("hidden"),e.$id("@show_comment").addClass("hidden"),!1}),o.attach(this.$id("@remove"),this.remove_short_text),this.$id("@remove").click(function(){return e._dialog=s.createDialog(e).title(e.remove_text).cancel().ok(function(){var t=arguments[0].dialogComponent,i=t.child("editor").serialize();e.serverCall("remove_tag").kwargs({comment:i}).liveMutate().send()},e.remove_short_text).load("remove_tag_dialog"),!1})}}),t.SoftenAnswerTag=n.extend({onLoad:function(){var e=this;this.$id("@remove").click(function(){return e._dialog=s.createDialog(e).title(e.remove_text).cancel().ok(function(){var t=arguments[0].dialogComponent,i=t.child("editor").serialize();e.serverCall("remove_tag").kwargs({comment:i}).liveMutate().send()},e.remove_short_text).load("remove_tag_dialog"),!1})}}),t.AnswerCollapsedTag=n.extend({onLoad:function(){var e=this;this.$id("@show_comment").click(function(t){
t.preventDefault(),e.$id("@comment").removeClass("hidden"),e.$id("@show_comment").addClass("hidden")})}})},"./app/view/question/cant_answer.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/cookies.js"),s=i("./shared/events/index.js"),a=i("./unified_view/modal.js").ModalBase,r=i("./shared/perf.js"),d=t.CantAnswerLink=n.extend({onLoad:function(){var e=this,t=this.$id("@cant_answer");t.on("click",function(){return e._userPerceivedAction=r.startUserPerceived({vcon:e.__vcon,method:"mark_as_cant_answer"}),o.setQfeedLog(e,"QuestionPass"),e.emitEvent(s.helpers.addQuestionCantAnswer(e.id)),e._userPerceivedAction&&(r.finishAction(e._userPerceivedAction),e._userPerceivedAction=null),e.cantAnswer(),!1})},cantAnswer:function(){return this.serverCall("mark_as_cant_answer").disableDefaultUserPerceivedLogging().liveMutate({optimisticUpdate:!0}).send(),!1}});t.AMACantAnswerLink=d.extend({onLoad:function(){var e=this;this.$id("@cant_answer").on("click",function(){return e.cantAnswer(),
!1})}}),t.A2ACantAnswerLink=n.extend({onLoad:function(){var e=this;this.$id("@cant_answer").on("click",function(){return e._userPerceivedAction=r.startUserPerceived({vcon:e.__vcon,method:"decline"}),e.emitEvent(s.helpers.addQuestionCantAnswer(e.id)),e._userPerceivedAction&&(r.finishAction(e._userPerceivedAction),e._userPerceivedAction=null),e.decline(),!1})},decline:function(){return this.serverCall("decline").disableDefaultUserPerceivedLogging().liveMutate({optimisticUpdate:!0}).send(),!1}}),t.A2ACantAnswerReasonLink=n.extend({onLoad:function(){var e=this;this.$id("@a2a_cant_answer").on("click",function(){return e.allow_reason&&e.createModal("decline_modal").show(),!1})}}),t.A2ACantAnswerReasonModal=a.extend({onLoad:function(){this._super.apply(this),this.reason=this.child("editor")},onSubmit:function(){this.serverCall("attach_decline_reason").kwargs({reason:this.reason.serialize()}).liveMutate().send(),this.close()}}),t.UndoCantAnswerLink=n.extend({onLoad:function(){var e=this;this.$id("@undo_cant_answer").on("click",function(){
return e.emitEvent(s.helpers.removeQuestionCantAnswer(e.id)),e.undoCantAnswer(),!1})},undoCantAnswer:function(){return this.serverCall("undo_mark_as_cant_answer").liveMutate().send(),!1}})},"./app/view/question/lookup_bar.js":function(e,t,i){var n=i("./webnode2.js"),o=i("./shared/core/component.js").Component,s=i("./shared/core/webnode.js"),a=i("./shared/jquery.js"),r=i("./view/selector.js").WithServerCallMessageMixin,d=i("./shared/window_manager.js"),l=i("./shared/events/index.js"),c=i("./shared/debounce.js").debounce,u=i("./shared/dom.js"),h=i("./shared/siteuri.js").URI,p=i("./shared/cookies.js"),f=i("./third_party/autosize.js"),_=i("./app/view/site_header/logged_in.js").LoggedInSiteHeaderContext,m=i("./unified_view/question/ask_question.js").AskQuestionButton,g=null;t.LookupBarSelector=r.extend({onLoad:function(){var e=this;g=e,this._super.apply(this,arguments),e.context=e.getContext(_),e.logged_in&&e.context.set("question_query_empty",this.isQueryEmpty()),this.$results_wrapper=this.$id("@results_wrapper"),
this.$results_container.removeClass("hidden"),e.displayedRevision=0,e.currentRevision=0,e.currentOutstandingRequests=0,e.lastIssuedQuery=null,e.lastSeenQuery=null,e.serverCallTimeout=250,e.lastRevisionNeedsUpdate=!1,e.cache={},e.cacheSize=0,e.focused=!0,e.shouldSimScroll=!0,e.$wrapper=e.$id("@wrapper"),e.shouldHighlightOnFocus=!e.should_autofocus,e.editingQuestionDetails=!1,e.targetType=null,e.targetOid=null,e.adding_followup=!1,a(document).mousedown(function(t){e.$wrapper.is(t.target)||0!==e.$wrapper.has(t.target).length||a(t.target).closest(".SiteHeader.search_focused")[0]||a(t.target).closest(".ClearQuestionDetailsConfirmationModal")[0]?e.$id("@details_wrapper").has(t.target).length>0?e.showResults(!1):(e.shouldSimScroll=!1,e.focused=!0,0!==e.query.trim().length?e.hasResults?e.showResults(!0):e._setQuery(e.$input.val()):e.showResults(!1)):(e.focused=!1,e.setHighlight(!1),e.showResults(!1),"forced"===e.askMode&&(e.isQueryEmpty()?(e.setAskMode(!1),e.setQuery("")):e.askMode=!0))}),e.$input.click(function(){
if(e.shouldHighlightOnFocus||e.setHighlight(!0),e._queryIsPunctation(e.query)&&"forced"===e.askMode){var t=e.opening_question_punctuation.length;e.$input[0].setSelectionRange(t,t)}}),e.askMode=!1,e.showingInterstitial=!1,e.source=null,e.currentSession=0,this.handleEvent(l.Types.LOOKUP_BAR_ASK_QUESTION,function(t){e.ask(t.payload.isPrivate)}),this.handleEvent(l.Types.LOOKUP_BAR_QUESTION_DETAILS_STATE,function(t){"focused"==t.payload.state?e.showResults(!1):"shown"==t.payload.state?(e.$id("@details_wrapper").removeClass("hidden"),e.editingQuestionDetails=!0):"hidden"==t.payload.state&&(e.$id("@details_wrapper").addClass("hidden"),e.editingQuestionDetails=!1,e.$input.focus())}),e.debouncedUpdate=c(function(){e.lastIssuedQuery!=e.lastSeenQuery?(e.query=e.lastSeenQuery,e.lastIssuedQuery=null,e.updateResults()):e.lastIssuedQuery=null},e.serverCallTimeout)},inputFocusHandler:function(){this._super.apply(this,arguments),this.shouldHighlightOnFocus&&(this.setHighlight(!0),this.isQueryEmpty()||!this.hasResults||this.editingQuestionDetails||this.showResults(!0));
},inputBlurHandler:function(){if(this._super.apply(this,arguments),this.logged_in){var e=this;document.activeElement.id==e.$input.attr("id")||e.focused||(e.setHighlight(!1),e.shouldHighlightOnFocus=!0)}},handleEscKey:function(){this._super.apply(this,arguments),this.logged_in&&this.setHighlight(!1)},capitalize:function(e){return e?e=e.charAt(0).toUpperCase()+e.slice(1):e},setInputVal:function(e,t){var i=this.$input[0].selectionStart,n=this.$input[0].selectionEnd;t&&(i+=t,n+=t),this.$input.val(e),e.length>0&&this.$input[0].setSelectionRange(i,n)},_queryIsPunctation:function(e){return e===this.opening_question_punctuation+this.closing_question_punctuation||e===this.opening_question_punctuation&&e.length>0||e===this.closing_question_punctuation&&e.length>0},_setQuery:function(e,t){var i=this.capitalize(e);if(t||this.askMode&&i!==e){var n="";(e||t)&&-1==e.indexOf(this.opening_question_punctuation)&&(n=this.opening_question_punctuation);var o="";(e||t)&&-1==e.indexOf(this.closing_question_punctuation)&&(o=this.closing_question_punctuation),
e=n+i+o,this.setInputVal(e,n.length)}else this.askMode&&"forced"!==this.askMode&&this._queryIsPunctation(e)&&(e="",this.setInputVal(e));if(this.length_limit&&this.logged_in){var s=e.length>this.length_limit;this.context.set("question_title_over_limit",s)}this._super.apply(this,[e])},addToCache:function(e,t){if(e in this.cache||this.cacheSize++,this.cache[e]=t,this.cacheSize>this.max_cache_size){var i=this.currentRevision+1,n=null;for(var o in this.cache)this.cache[o][1]<i&&(i=this.cache[o][1],n=o);this.cacheSize--,delete this.cache[n]}},updateResults:function(){var e=this,t={is_exp:e.ask_bar_js_delay,is_mobile:!1};i("./shared/logging.js").log("ask_bar_keystroke_count",t),""===e.query&&e.setAskingTarget(null,null);var n=e.query.trim();if(e.lastSeenQuery=n,"forced"===e.askMode&&(e._queryIsPunctation(n)||""===n))return void e.showInterstitial("ask_question");var o={query:e.query},s=e.getExtraKwargs();for(var a in s)o[a]=s[a];var r=e.currentRevision;if(e.lastRevisionNeedsUpdate=!1,0===n.length)e.displayedRevision=r,
e.setAskMode(!1),e.showResults(!1),e.currentSession++;else if(c in e.cache)e.currentOutstandingRequests++,e.resultsServerCallHandler(r,e.cache[c][0],this.showingInterstitial);else{var d=3;if(e.currentOutstandingRequests<d){o.parent_cid=e.cid,o.selector_id=e.selector_id;var l=e.showingInterstitial,c=JSON.stringify(o);if(e.ask_bar_js_delay&&null!==e.lastIssuedQuery)return;var u=Date.now();e.lastIssuedQuery=e.query,e.currentOutstandingRequests++,e.ask_bar_js_delay&&this.debouncedUpdate(),e.serverCall("results_content_for").kwargs(o).sendJsData(e.shouldSendJSData).success(function(t){var i=Date.now()-u;e.resultsServerCallHandler(r,t,c,l,i)}).except(function(){var t=Date.now()-u;e.resultsServerCallHandler(r,null,c,l,t)}).error(function(){var t=Date.now()-u;e.resultsServerCallHandler(r,null,c,l,t)}).send()}else e.lastRevisionNeedsUpdate=!0}},getExtraKwargs:function(){return{ask_mode:this.askMode,current_session:this.currentSession}},resultsServerCallHandler:function(e,t,o,a,r){if(void 0===r&&(r=0),
0!=r){var d={time_delta:r,is_mobile:!1};i("./shared/logging.js").log("ask_bar_server_call_speed",d)}return this.currentOutstandingRequests--,this.hasResults=!0,e<=this.displayedRevision?void 0:(this.ask_bar_js_delay&&r<=this.serverCallTimeout&&(this.lastIssuedQuery=null),a&&(this.showingInterstitial=!1,this.$id("@ask_mode_interstitial").addClass("hidden"),this.$id("@results").removeClass("hidden")),null!==t&&(n.forgetContents(this.$results),s.setContent(this.$results,t),this.displayedRevision=e,this.addToCache(o,[t,e])),this.showResults(!0),this.lastRevisionNeedsUpdate?(this.lastIssuedQuery=null,void this.updateResults()):void(this.ask_bar_js_delay&&(this.lastSeenQuery!=this.lastIssuedQuery?(this.lastIssuedQuery=null,this.query=this.lastSeenQuery,this.updateResults()):(this.lastIssuedQuery=null,this.debouncedUpdate.cancel()))))},queryDidChange:function(){this.currentRevision++,this.logged_in&&(this.context.set("question_query_empty",this.isQueryEmpty()),this.context.set("force_enable_button",!0)),
this._super.apply(this,arguments),this.is_textarea&&!this.hasAutoSized&&(f(this.$input),this.hasAutoSized=!0)},isQueryEmpty:function(){return""===this.query.trim()||this._queryIsPunctation(this.query.trim())},showResults:function(e){var t=this;e&&t.focused&&!t.isQueryEmpty()?(t.$results_wrapper.removeClass("fade_out"),t.setHighlight(!0)):u.addAnimationClass(t.$results_wrapper,"fade_out",function(){})},resultWasSelected:function(e,t){var i=this,n=this.child("results").child(e.data.cname);n&&(n.processAction(e.data.action_mousedown),"search"===e.ty?i.goToSearch(t):(-1!==e.data.qid&&p.setMessage("look",[e.data.qid,!0]),i.query.length<140&&p.setCookie("qsu-q",JSON.stringify(i.query),{expires:1}),-1!==e.data.qid&&i.targetType?i.adding_followup||(i.adding_followup=!0,i.serverCall("add_followup").kwargs({qid:e.data.qid,target_type:i.targetType,target_oid:i.targetOid}).success(function(e){t?window.open(e):window.location.href=e,i.adding_followup=!1}).error(function(){i.adding_followup=!1}).send()):t?window.open(e.data.url):window.location.href=e.data.url));
},hideInterstitials:function(){this.showingInterstitial=!1,this.$id("@ask_mode_interstitial").addClass("hidden"),this.$id("@results").removeClass("hidden")},showInterstitial:function(e){this.hideInterstitials(),this.showingInterstitial=!0,this.$id("@ask_mode_interstitial").removeClass("hidden"),this.$id("@results").addClass("hidden");var t=this.interstitials[e][0],i=this.interstitials[e][1];this.$id("@interstitial_title").text(t),this.$id("@interstitial_text").text(i)},setHighlight:function(e,t){var i=this.parent().parent().$id("@body_blur");if(e){i.addClass("lookup_bar_modal_overlay"),i.removeClass("closing"),this.logged_in&&this.context.set("force_enable_button",!0),this.emitEvent({type:l.Types.SITE_HEADER_SEARCH_FOCUSED,payload:{focused:!0}});var n=this.$input.outerWidth();this.$results_wrapper.width(n-2),this.focused=!0}else u.addAnimationClass(i,"closing",function(){i.hasClass("lookup_bar_modal_overlay")&&i.removeClass("lookup_bar_modal_overlay")}),this.emitEvent({type:l.Types.SITE_HEADER_SEARCH_FOCUSED,
payload:{focused:!1}}),this.focused=!1;this.nextHighlightCallback&&this.nextHighlightCallback(),this.nextHighlightCallback=t},setAskMode:function(e,t){this.askMode=e,(this.query.trim()||e)&&this._setQuery(this.query.trim(),!0),e&&(this.$input.focus(),t?this.showInterstitial(t):this.query.trim().length>=10&&this.query.split(" ").length>=3?this.showInterstitial("good"):this.showInterstitial("bad"),this.logMiscAction("LookupBarSetAskModeClickthrough"),this.lastRevisionNeedsUpdate=!1,this.focused=!0,this.showResults(!0))},logMiscAction:function(e){var t=this.child("results");if(t){var i=t.child("search");i&&i.processAction(e)}},submit:function(e){this.logged_in?this.should_go_to_search_on_enter?(this.logMiscAction("LookupBarPressEnterSearch"),this.goToSearch(e)):this.logMiscAction("LookupBarPressEnterNothing"):(this.logMiscAction("LookupBarPressEnterSearch"),this.goToSearch(e))},goToSearch:function(e){if(this.query.trim()){var t=h("/search?q="+encodeURIComponent(this.query).replace(/%20/g,"+")+this.keepFilters);
e?window.open(t.unicode()):window.location.href=t.unicode()}},ask:function(e){var t=this;if(!t.hasPendingServerCall()){this.context.set("force_enable_button",!1);var i=t.getQuestionDetails();t.makeServerCall(t.serverCall("add_question").kwargs({input_text:t.query,is_anon:e,question_details:i,source:t.source,target_type:t.targetType,target_oid:t.targetOid}))}},getQuestionDetails:function(){var e=this.child("question_details");return e?e.serialize():""},setSource:function(e){var t=this;t.source=e},updateServerMessage:function(e,t){var i=this;return e?(t.url&&(i.logMiscAction("LookupBarAddQuestionSuccess"),d.navigateTo(t.url)),!1):"confirm_email"===t.type?(i.createModal("email_confirmation_dialog_contents").onSubmit(function(){i.serverCall("resend_email_confirmation").send()}).show(),!1):(i.logMiscAction("LookupBarAddQuestionFail"),i.context.set("force_enable_button",!0),i.$input.focus(),t&&t.message?(this.$id("@server_message_title").text(t.message.title),t.message.note&&this.$id("@server_message_note").text(t.message.note),
!0):!1)},setAskingTarget:function(e,t){this.targetType=e,this.targetOid=t,this.emitEvent({type:l.Types.LOOKUP_BAR_SET_ASKING_TARGET,payload:{isCleared:null==this.targetType}})}}),t.LookupBarSiteHeaderAddQuestion=o.extend({onLoad:function(){var e=this;e.$askButton=e.$id("@submit_question"),e.context=e.getContext(_),e.context.on("question_details_over_limit",function(t,i){e.enableButton(!i)}),e.context.on("question_title_over_limit",function(t,i){e.enableButton(!i)}),e.context.on("force_enable_button",function(t,i){e.enableButton(i)}),e.$askButton.click(function(t){t.preventDefault(),e.emitEvent({type:l.Types.LOOKUP_BAR_ASK_QUESTION,payload:{isPrivate:e.getIsPrivate()}})}),e.$id("@add_details").click(function(t){t.preventDefault(),e.showQuestionDetailsEditor(!0)}),e.$id("@remove_details").click(function(t){t.preventDefault(),e.context.get("question_details_is_empty")?e.showQuestionDetailsEditor(!1):e.createModal("load_clear_confirmation").onSubmit(function(){e.showQuestionDetailsEditor(!1);
}).show()}),this.handleEvent(l.Types.LOOKUP_BAR_SET_ASKING_TARGET,function(t){t.payload.isCleared?e.$id("@anon_checkbox").prop("disabled",!1):(e.$id("@anon_checkbox").prop("checked",!1),e.$id("@anon_checkbox").prop("disabled",!0))})},showQuestionDetailsEditor:function(e){this.emitEvent({type:l.Types.LOOKUP_BAR_QUESTION_DETAILS_STATE,payload:{state:e?"shown":"hidden"}}),e?(this.$id("@add_details").addClass("hidden"),this.$id("@remove_details").removeClass("hidden"),this.emitEvent({type:l.Types.LOOKUP_BAR_QUESTION_DETAILS_STATE,payload:{state:"focused"}})):(this.$id("@remove_details").addClass("hidden"),this.$id("@add_details").removeClass("hidden"))},getIsPrivate:function(){return this.$id("@anon_checkbox").prop("checked")||!1},enableButton:function(e){this.context.get("question_title_over_limit")||this.context.get("question_details_over_limit")?this.$askButton.addClass("fake_disabled"):this.context.get("question_query_empty")?this.$askButton.addClass("disabled"):e?(this.$askButton.removeClass("disabled"),
this.$askButton.removeClass("fake_disabled")):this.$askButton.addClass("disabled")}});var v=[];t.AddQuestionLookupBarButton=o.extend({setAllEnabled:function(e){v.forEach(function(t){t.setEnabled(e)})},setEnabled:function(e){e?this.$id("@dialog_link").removeClass("disabled"):this.$id("@dialog_link").addClass("disabled")},onLoad:function(){var e=this;v.push(e),this.$id("@dialog_link").click(function(){var t=g;t.setAskingTarget(e.targetType,e.targetOid);var i="button";return i=e.source?"answer":"ask_question",t.setAskMode("forced",i),e.setAllEnabled(!1),t.setHighlight(!0,function(){e.setAllEnabled(!0)}),t.setSource(e.source),e.serverCall("log_click").kwargs({source:e.source}).send(),!1})}}),t.LookupBarAskQuestionModalButton=m.extend({onClick:function(){var e=g.query;g.setHighlight(!1),this.showModal(e)}})},"./app/view/question/lookup_bar_details.js":function(e,t,i){var n=i("./unified_view/qtext2/editor.js").Editor,o=i("./shared/events/index.js"),s=i("./app/view/site_header/logged_in.js").LoggedInSiteHeaderContext;
t.AskBarDetails=n.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.context=e.getContext(s),e.setLengthChangeCallback(function(t){e.context.set("question_details_over_limit",t),e.context.set("question_details_is_empty",e.isOnlyWhiteSpace())}),this.handleEvent(o.Types.LOOKUP_BAR_QUESTION_DETAILS_STATE,function(t){"focused"==t.payload.state?e.focus():"hidden"==t.payload.state&&(e.clear(),e.context.set("question_details_is_empty",!0))})}})},"./app/view/question/merge/_merge.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js");t.QuestionMergeCandidates=n.extend({onLoad:function(){var e=this;e.$insertionEl=e.$id("@insert_candidate"),e.$showAllLinkEl=e.$id("@show_all_link"),e.$showAllLinkEl.click(function(t){t.preventDefault(),e.$id("@candidates .candidate").removeClass("hidden"),e.$showAllLinkEl.addClass("hidden")})},selectQID:function(e){var t,i=this;t=this.improvedFlow?i.$id("@candidates input[type=radio][value="+e+"]"):i.$id("@candidates input[type=checkbox][value="+e+"]"),
t.length?t.map(function(){var e=o(this),t=o("label[for='"+e.attr("id")+"']");e.prop("checked",!0),e.change(),o(this).parent().insertAfter(i.$insertionEl),t.removeClass("hidden")}):i.serverCall("get_checkbox_content").kwargs({qid:e}).contentFor(i.$insertionEl).success(function(){i.$id("@candidates input[type=radio][value="+e+"]").prop("checked",!0),i.$id("@candidates input[type=radio][value="+e+"]").change(),i.$insertionEl.children().map(function(){o(this).insertAfter(i.$insertionEl)})}).send()},getSelectedQIDs:function(){var e,t=[];return e=this.improvedFlow?"@candidates input[type=radio]:checked:not(:disabled)":"@candidates input[type=checkbox]:checked:not(:disabled)",this.$id(e).map(function(){t.push(parseInt(this.value))}),t}}),t.QuestionMergeCanonicalPicker=n.extend({onLoad:function(){var e=this;e.$radios=e.$id("@picker input[type=radio]"),e.$radios.change(function(t){e.$radios.map(function(){var e=o(this),t=o("label[for='"+e.attr("id")+"']");t.toggleClass("selected",e.is(":checked")),
t.toggleClass("not_selected",!e.is(":checked"))})})},getSelectedQID:function(){var e=this.$id("@picker input[type=radio]:checked");return e?parseInt(e.val()):void 0}}),t.OriginallyAnsweredBanner=n.extend({onLoad:function(){var e=this;e.$id("@remove").click(function(t){t.preventDefault(),e.serverCall("remove_banner").liveMutate().send()})}})},"./app/view/question/merge/modal.js":function(e,t,i){var n=i("./shared/window_manager.js"),o=i("./view/modal.js"),s=i("./shared/util.js");t._QuestionMergeModal=o.MultiStep.extend({onSubmitSuccess:function(e,t,i,o){var s=this,a=25e3,r=1e3;return this.improvedFlow?void n.navigateTo(e):void(a>o?setTimeout(function(){s.serverCall("answer_has_moved").kwargs({qids:t,canonical_qid:i,time_so_far:o+r}).success(function(o){o?s.onSubmitSuccess(e,t,i,o):n.navigateTo(e)}).send()},r):(s.serverCall("log_timeout_before_answers_moved").kwargs({time_taken:o+r}).send(),n.navigateTo(e)))},getCallBacks:function(){var e=this;return{QuestionMergeModalSelectorStep:{getStepData:function(){
var t=e.data_cache[e.key],i=e.child("candidates").getSelectedQIDs();return i.push(t.qid),s.extend(t,{selectedQIDs:i})},onSubmit:function(){e.child("candidates").getSelectedQIDs().length&&e._loadNext()}},QuestionMergeModalMultipleLockedStep:{isLastStep:!0,onSubmit:function(){e.disableSubmit();var t=e.data_cache.QuestionMergeModalSelectorStep,i=t.selectedQIDs;e.serverCall("submit").kwargs({qids:i}).success(function(){e._closeModal()}).send()}},QuestionMergeModalCanonicalStep:{isLastStep:!0,onSubmit:function(){var t=e.child("picker").getSelectedQID(),i=e.data_cache.QuestionMergeModalSelectorStep;if(t){e.disableSubmit();var n=i.selectedQIDs;e.serverCall("submit").kwargs({qids:n,canonical_qid:t}).success(function(i){e.onSubmitSuccess(i.url,n,t,0)}).liveMutate().send()}}}}}})},"./app/view/question/merge/selector.js":function(e,t,i){var n=i("./view/selector.js").Selector;t.QuestionMergeESSelector=n.extend({resultWasSelected:function(e){var t=this;t.parent().child("candidates").selectQID(e.data.qid),
t.setQuery("")},getExtraKwargs:function(){return{ignore_qids:this.parent().child("candidates").getSelectedQIDs()}}})},"./app/view/question/not_helpful.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.CollapseAnswerLink=n.extend({onLoad:function(){var e=this;this.$id("@undo_not_collapsible").click(function(t){return e.serverCall("undo_not_collapsible").kwargs({aid:e.aid}).liveMutate().send(),!1}),this.$id("@make_uncollapsible").click(function(t){return e.serverCall("make_uncollapsible").kwargs({aid:e.aid}).liveMutate().send(),!1})}})},"./app/view/question/question_add.js":function(e,t,i){var n=i("./app/view/topic_selector.js").TopicSelector,o=i("./shared/events/index.js");t.AddQuestionTopicTempSelector=n.extend({addIgnoreOid:function(e){e&&this.ignore_tids.push(e)},maybeAddTopic:function(e,t){t&&-1==this.ignore_tids.indexOf(e)&&(this.addIgnoreOid(e),this.emitEvent({type:o.Types.QUESTION_TOPIC_SELECTION_ADD,payload:{editor:this.getDvar("_questionTopicsEditor"),name:t}
}))},topicWasSelected:function(e,t){this.maybeAddTopic(e,t),this.setQuery(""),this.blur()},createTopicWasSelected:function(e){this.maybeAddTopic(null,e),this.setQuery(""),this.blur()}})},"./app/view/question/suggested_answer.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.AnswerSuggestedEditDiscardButtonInline=n.extend({onLoad:function(){var e=this;this.$id("@submit").click(function(){return e.serverCall("discard_suggested_edit").kwargs({aid:e.aid}).liveMutate().send(),!1})}})},"./app/view/question/wanted_answer.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./view/modal.js").Base,a=i("./shared/events/index.js"),r=i("./shared/action_log.js").ActionableComponent,d=i("./view/selector.js").Selector,l=i("./shared/cookies.js");t.A2AFiltersListContentItem=n.extend({onLoad:function(){var e=this;e.$id("@filter_item").click(function(t){var i=t.currentTarget;o(".A2AFiltersListContentItem").removeClass("nav_item_selected"),o(i).addClass("nav_item_selected");
var n=e.parent().parent().parent().$id("@suggestions_list"),s=e.parent().parent();s.is_editing||(n.addClass("working"),e.serverCall("filtered_list").kwargs({tid:e.tid}).contentFor(n).success(function(){n.removeClass("working")}).send())})}}),t.WantedAnswerSelector=d.extend({onLoad:function(){this._super.apply(this,arguments),this.ignore_uid_select={}},resultWasSelected:function(e,t,i){var n=e.data.uid;if(!this.ignore_uid_select[n]){this.ignore_uid_select[n]=!0,this.updateResultItem(i),l.setQfeedLog(this,"AskToAnswer"),l.setTlog({type:"AskToAnswer",qid:this.qid});var o=function(){delete this.ignore_uid_select[n],this.revertSelectedRow(i)}.bind(this);this.serverCall("ask_to_answer").liveMutate().kwargs({to_uid:n}).success(function(e){"failed"===e.result&&o()}).error(o).send()}},resultsDidChange:function(){this.ignore_uid_select={}},updateResultItem:function(e){e.find(".name_sig").addClass("hidden"),e.find(".name_sig.is_active").removeClass("hidden"),e.find(".request_button").addClass("is_active");
},revertSelectedRow:function(e){e.find(".name_sig.hidden").removeClass("hidden"),e.find(".name_sig.is_active").addClass("hidden"),e.find(".request_button").removeClass("is_active")}}),t.WantedAnswerSuggestions=n.extend({onLoad:function(){this.child("selector").focus()},a2aHeaderCountClicked:function(){this.$id("@a2a_suggestions").hide(),this.$id("@outstanding_requests").show()},a2aHeaderTitleClicked:function(){this.$id("@a2a_suggestions").show(),this.$id("@outstanding_requests").hide()}}),t.AskToAnswerModal=s.extend({a2aHeaderCountClicked:function(){var e=this.child("wanted_answer_suggestions");e.$id("@a2a_suggestions").addClass("hidden"),e.$id("@outstanding_requests").removeClass("hidden")},a2aHeaderTitleClicked:function(){var e=this.child("wanted_answer_suggestions");e.$id("@a2a_suggestions").removeClass("hidden"),e.$id("@outstanding_requests").addClass("hidden")}}),t.AskToAnswerHeader=n.extend({onLoad:function(){var e=this;this.$id("@title_link").click(function(t){return e.titleClicked(),
!1}),this.$id("@count_link").click(function(t){return e.countClicked(),!1})},countClicked:function(){this.$id("@count").toggleClass("hidden"),this.$id("@count_link").toggleClass("hidden"),this.$id("@title").toggleClass("hidden"),this.$id("@title_link").toggleClass("hidden"),this.parent().$id("@a2a_suggestions").toggleClass("hidden"),this.parent().$id("@asked_users").toggleClass("hidden"),this.parent().a2aHeaderCountClicked()},titleClicked:function(){this.$id("@count").toggleClass("hidden"),this.$id("@count_link").toggleClass("hidden"),this.$id("@title").toggleClass("hidden"),this.$id("@title_link").toggleClass("hidden"),this.$id("@asked_users").toggleClass("hidden"),this.parent().$id("@a2a_suggestions").toggleClass("hidden"),this.parent().$id("@asked_users").toggleClass("hidden"),this.parent().a2aHeaderTitleClicked()}}),t.AskToAnswerModalLink=n.extend({onLoad:function(){var e=this;this.$id("@create_modal_link").on("click",function(t){t.preventDefault(),e.loadModal()}),e.should_open_modal&&e.loadModal();
},loadModal:function(){this.createModal("load_inner").kwargs({qid:this.qid,a2a_type:this.a2a_type}).show()}}),t.AskedBy=n.extend({onLoad:function(){var e=this;this.$id("@modal_link").on("click",function(){return e.createModal("load_inner").kwargs({qid:e.qid,to_uid:e.to_uid}).show(),!1})}}),t.AnswerAttributionSection=n.extend({onLoad:function(){var e=this;this.$id("@modal_link").on("click",function(){return e.createModal("load_inner").kwargs({aid:e.aid,qid:e.qid}).show(),!1})}}),t.WantedAnswerWithCreditQuestionListItem=r.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.handleEvent(a.Types.QUESTION_CANT_ANSWER_STATE,function(t){if(t.payload.qid==e.qid){var i="passed"==t.payload.state;e.$id("@item").toggleClass("cant_answer",i)}})}})},"./app/view/quora_meets_bagel.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.QMBPage=n.extend({onLoad:function(){var e=this;e.$id("@container").on("click",".qmb_button",function(t){var i=t.target.id;return e.serverCall("take_qmb_action").kwargs({
which_action:i}).success(function(){window.location.reload()}).send(),!1})}})},"./app/view/reading_list.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.MarkAsReadButton=n.extend({onLoad:function(){var e=this;e.$id("@read_later").click(function(t){return t.preventDefault(),e.serverCall("unmark_as_read_later").liveMutate().send(),!1})}}),t.ReadLaterSort=n.extend({onLoad:function(){var e=this,t=e.$id("@new"),i=e.$id("@old");t.click(function(){e.emitEvent({type:o.Types.READING_LIST_VIEW_STATE,payload:{reverse:!1}}),t.removeClass("inactive"),t.addClass("active"),i.removeClass("active"),i.addClass("inactive")}),i.click(function(){e.emitEvent({type:o.Types.READING_LIST_VIEW_STATE,payload:{reverse:!0}}),t.addClass("inactive"),t.removeClass("active"),i.addClass("active"),i.removeClass("inactive")})}}),t.ReadingListContents=n.extend({onLoad:function(){var e=this;this.handleEvent(o.Types.READING_LIST_VIEW_STATE,function(t){"reverse"in t.payload&&e.showSpinner();
})},showSpinner:function(){this.$id("@spinner").removeClass("hidden")}}),t.ReadingListMain=n.extend({onLoad:function(){this.emitEvent({type:o.Types.READING_LIST_VIEW_STATE,payload:{reverse:this.reverse_order}});var e=this;this.handleEvent(o.Types.READING_LIST_VIEW_STATE,function(t){"reverse"in t.payload&&e.updateResults(t.payload.reverse)})},updateURL:function(e){var t="";e&&(t+="&order=desc"),t.length>0&&(t="?"+t.substring(1)),window.history.pushState(null,null,"/bookmarked_answers"+t)},updateResults:function(e){this.updateURL(e);var t=this.$id("@read_later_list");this.$id("@spinner").removeClass("hidden"),t.css("opacity",.5),this.serverCall("load_reading_list").contentFor(t).kwargs({reverse_order:e}).success(function(){t.css("opacity",1)}).send()}})},"./app/view/settings.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./view/inline_editor.js").InlineEditor,s=i("./shared/events/index.js"),a=i("./app/view/share/connect.js").SocialConnector,r=i("./shared/facebook.js"),d=i("./shared/window_manager.js"),l=i("./w2.modal.js"),c=i("./w2.dialog.js"),u=c.Dialog,h=i("./shared/core/rpc.js"),p=i("./view/modal.js").Base,f=i("./shared/fx.js");
t.CallbackModal=p.extend({onSubmit:function(){this._super.apply(this,arguments),l.Modal.modalFor(this).executeOnSubmitCallBack()}}),t.SettingsAccountEmailOption=n.extend({onLoad:function(){var e=this;this.$id("@add_another_email_link").click(function(t){return e.$id("@add_another_email_row").toggleClass("hidden"),e.$id("@add_email_input_row").toggleClass("hidden"),e.$id("@new_email").focus(),!1}),this.$id("@add_another_email").click(function(){var t=e.$id("@new_email").val();return t?(e.serverCall("add_email").kwargs({email:t}).liveMutate().send(),!1):!1})}}),t.FindFacebookFriendsModalLink=n.extend({onLoad:function(){var e=this;this.$id("@link").on("click",function(){e.createModal("find_facebook_friends_modal").show()})}});var _=t.SettingsOption=n.extend({onLoad:function(e){var t=this;if(this.$id("@view_option_link").click(function(){return t.serverCall("check_reauth").success(function(){t.expandOption()}).send(),!1}),this.auto_open_url_hash&&e&&d.getHash().substr(0,30)=="#"+this.auto_open_url_hash){
this.expandOption();var i=this.$id("@option_content").css("background-color","#E0E0E0");f.highlight(i,1500)}},expandOption:function(){this.$id("@view_option").toggleClass("hidden"),this.$id("@option_content").toggleClass("hidden")}});t.AdultSettingsOptionToggle=n.extend({onLoad:function(){var e=this;this.$id("@no_adult_content").click(function(){return e.serverCall("no_adult_content").liveMutate().send(),!1}),this.$id("@allow_adult_content").click(function(){return e.serverCall("allow_adult_content").liveMutate().send(),!1})}}),t.UserDisclaimerDialogEditor=o.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.$id("@inline_editor_cancel").click(function(){return l.Modal.modalFor(e).close(),!1}),this.$id("@inline_editor_submit").click(function(){return l.Modal.modalFor(e).close(),!1})}}),t.ChangePasswordOption=_.extend({onLoad:function(){this._super.apply(this,arguments),this.clear_passwords=function(){this.$id("@new_password").val(""),this.$id("@confirm_password").val("");
};var e=this;this.$id("@change_password_submit").click(function(){return e.$id("@new_password").val()!==e.$id("@confirm_password").val()?(e.$id("@password_and_confirmation_mismatch").removeClass("hidden"),e.$id("@password_changed").addClass("hidden"),!1):(e.$id("@change_password_error").addClass("hidden"),e.$id("@password_and_confirmation_mismatch").addClass("hidden"),h.rpc("/settings/change_password_POST").kwargs({new_password:e.$id("@new_password").val()}).success(function(t){var i=t[0],n=t[1];e.clear_passwords(),i?e.$id("@password_changed").removeClass("hidden"):(e.$id("@password_changed").addClass("hidden"),e.$id("@change_password_error").removeClass("hidden"),e.$id("@change_password_error").text(n))}).send(),!1)})}}),t.RemoveDisclaimerOption=_.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.$id("@remove_disclaimer_submit").click(function(){return e.serverCall("remove_disclaimer").send(),!1})}}),t.BlogConnectDialogContents=n.extend({onLoad:function(){var e=this;
this.$id("@form input").on("focus",function(){e.$id("@blog_not_supported").hide()}),this.$id("@form input").on("keydown",function(t){13==t.keyCode&&e.submitForm()}),this.$id("@url").on("blur",function(){e.$id("@wordpress_login_help").hide();var t=e.$id("@url").val();t.match("wordpress")&&e.$id("@wordpress_login_help").show()}),this.$id("@close").on("click",function(){return u.dialogFor(e).close_(),!1}),this.$id("@connect").click(this.submitForm.bind(this))},submitForm:function(){var e=this,t=this.$id("@url").val(),i=this.$id("@uname").val(),n=this.$id("@pwd").val();t&&i&&n&&this.serverCall("validate_blog").kwargs({url:t,name:i,pwd:n}).liveMutate().success(function(t){var i=t[0],n=t[1];i?(e.emitEvent({type:s.Types.WORDPRESS_CONNECT_SUCCESS,payload:{}}),u.dialogFor(e).close_()):e.$id("@blog_not_supported").show().text(n)}).send()}}),t.WordpressConnect=n.extend({onLoad:function(){this._super.apply(this,arguments),this.$id("@wordpress_connect_button").on("click",this.connectWordpress.bind(this)),
this.$id("@wordpress_disconnect_button").on("click",this.disconnectWordpress.bind(this))},connectWordpress:function(){this._dialog=c.createDialog(this).title(this.dialog_title).close(null).load("set_dialog_contents")},disconnectWordpress:function(){this.serverCall("wordpress_disconnect").liveMutate().send()}}),t.GoogleConnect=n.extend({onLoad:function(){var e=this;this.$id("@google_disconnect_button").click(function(){return e.serverCall("disconnect_google").liveMutate().send(),!1})}}),t.LinkedinConnect=n.extend({onLoad:function(){var e=this;this.$id("@linkedin_disconnect_button").click(function(){return e.serverCall("disconnect_linkedin").liveMutate().send(),!1})}}),t.LinkedinConnectButton=a.extend({onLoad:function(){var e=this;this.$id("@linkedin_connect_button").on("click",function(){e.connectLinkedin()})}}),t.LinkedinPublicProfileLink=n.extend({onLoad:function(){var e=this;this.serverCall("get_profile_info").kwargs({li_uid:this.liUid}).success(function(t){null===t?e.$id("@linkedin_link").text("").attr("href","#"):e.$id("@linkedin_link").text(t.first_name+" "+t.last_name).attr("href",t.url);
}).send()}}),t.ConfirmEmailModal=p.extend({onSubmit:function(){var e=this;e.serverCall("resend_email_confirmation").success(function(){e._closeModal()}).liveMutate().send()}}),t.RemoveEmailModal=p.extend({onSubmit:function(){var e=this;e.serverCall("remove_email").success(function(){e._closeModal()}).liveMutate().send()}}),t.EmailAddressRow=n.extend({onLoad:function(){var e=this;this.$id("@confirm_email").click(function(){return e.createModal("load_inner_confirm_email").kwargs({email:e.email}).show(),!1}),this.$id("@make_primary").click(function(){return e._serverCallHelper("set_primary_email")}),this.$id("@delete_email_icon").click(function(){return e.createModal("load_inner_remove_email").kwargs({email:e.email}).show(),!1})},_serverCallHelper:function(e){return this.serverCall(e).kwargs({email:this.email}).liveMutate().send(),!1}}),t.ResetPassword=n.extend({onLoad:function(){var e=this;this.$id("@reset_email_submit").click(function(t){var i=e.$id("@email_input").val();return i?(e.emailRequest("/settings/send_reset_password_email_POST",i),
!1):!1}),this.$id("@reset_password_form_tag").submit(function(t){var i=e.$id("@reset_password_code").val(),n=e.$id("@new_password").val(),o=e.$id("@confirm_password").val(),s=e.$id("@password_confirmation_mismatch");return e.$id("@reset_password_error").addClass("hidden"),n!==o?(s.removeClass("hidden"),!1):(s.addClass("hidden"),n?(e.passwordRequest("/settings/reset_password_POST",i,n),!1):!1)}),d.replaceURL("/settings/reset_password")},emailRequest:function(e,t){var i=this;return h.rpc(e).kwargs({email:t}).success(function(e){i.$id("@email_input").val(""),i.$id("@reset_email_conf").removeClass("hidden"),i.$id("@reset_email_form").addClass("hidden")}).send(),!1},passwordRequest:function(e,t,i){var n=this;return h.rpc(e).kwargs({code:t,new_password:i}).success(function(e){var t=e[0],i=e[1];t?d.navigateTo("/?__pmsg__=password_changed"):(n.$id("@reset_password_error").removeClass("hidden"),n.$id("@reset_password_error").text(i))}).send(),!1}}),t.MutedRowToggle=n.extend({onLoad:function(){var e=this;
this.$id("@unmute").click(function(){e.serverCall("unmute").kwargs({oid:e.oid}).liveMutate().send()}),this.$id("@mute").click(function(){e.serverCall("mute").kwargs({oid:e.oid}).liveMutate().send()})}}),t.FacebookAccountConnectedTo=n.extend({onLoad:function(){this.$id("@facebook_disconnect_button").on("click",this.disconnect.bind(this))},disconnect:function(){return this.serverCall("disconnect_facebook").liveMutate().success(function(){r.onInit(function(){window.FB.getLoginStatus(function(){},!0)})}).send(),!1}}),t.OptionLinkBase=n.extend({onLoad:function(){this.$id("@enable").on("click",this.onClickEnable.bind(this)),this.$id("@disable").on("click",this.onClickDisable.bind(this)),this.$id("@hide").on("click",this.onClickHide.bind(this))},onClickEnable:function(){return this.serverCall("toggle_option").kwargs({enabled:!0}).liveMutate().send(),!1},onClickDisable:function(){return this.serverCall("toggle_option").kwargs({enabled:!1}).liveMutate().send(),!1},onClickHide:function(){return this.serverCall("hide").liveMutate().send(),
!1}})},"./app/view/share.js":function(e,t,i){var n,o=i("./shared/core/component.js").Component,s=i("./shared/twitter.js"),a=i("./shared/facebook.js"),r=i("./shared/cookies.js"),d=i("./tooltip.js"),l=t.ShareAction=o.extend({onLoad:function(){var e=this;e.$id("@share").on("click",function(t){t.preventDefault(),e.createModal("load_modal").kwargs({serialized_share:e.serialized_share,default_tab:e.default_tab,class_name:e.class_name,calling_class:e.calling_class}).show()})}});t.AutoShowShareAction=l.extend({onLoad:function(){n=this},show:function(e){this.__js_init=e,setTimeout(this.showDialog.bind(this),1500)}}),t.showShareAction=function(e){n&&n.show(e)},t.CopyToClipboardShareLink=o.extend({onLoad:function(){var e=this,t=this.$id("@copy_link");this.tooltip=d.attach(t,this.copy_url,{attach_to_body:!0}),t.click(function(t){t.stopPropagation();var i=document.createElement("textarea");document.body.appendChild(i),i.value=e.copy_url,i.select();var n=document.execCommand("copy");i.remove(),n?e.tooltip.updateText(e.copy_message_success).render().updateText(e.copy_url):(e.$id("@copy_link").addClass("completed"),
e.tooltip.updateText(e.copy_message_fail).render())})}}),t.TwitterNetworkShare=o.extend({onLoad:function(){var e=this;s.onInit(function(){window.twttr.events.bind("tweet",function(t){e.isTweeted(t)&&(r.setQfeedLog(e,"ShareTwitter"),r.setTlog({type:"ShareTwitter"}),e.serverCall("record_tweet").send())})})},isTweeted:function(e){var t=this,i=String(e.target.id),n=String(t.cid);return i.indexOf(n)>-1}}),t.FacebookNetworkShare=o.extend({onLoad:function(){a.load(),this.$id("@share").on("click",this.onClick.bind(this))},onClick:function(){var e=this;return e.is_debugging_mode&&(console.log(e.share_url),console.log(e.target)),window.FB.ui({method:"feed",display:"popup",link:e.share_url},function(t){t&&t.post_id&&(r.setQfeedLog(e,"ShareFacebook"),r.setTlog({type:"ShareFacebook"}),e.serverCall("record_facebook_share").send())}),!1}}),t.FacebookConnectedToDifferentAccount=o.extend({onLoad:function(){a.load(),this.$id("@fb_logout").on("click",this.onClickFbLogout.bind(this)),this.$id("@settings").on("click",this.onClickSettings.bind(this));
},show:function(){var e=this;window.FB.api("/me",function(t){t.name&&(e.$id("@fb_unknown_login").hide(),e.$id("@fb_logged_in_name").text(t.name),e.$id("@fb_logged_in_link").show(),e.$id("@fb_logged_in_link").attr("href",t.link))}),this.$id("@fb_different_account").show()},onClickFbLogout:function(){var e=this;return window.FB.logout(function(t){e.$id("@fb_different_account").hide()}),!1},onClickSettings:function(){this.$id("@fb_different_account").hide()}})},"./app/view/share/connect.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./shared/siteuri.js").URI,a=t.socialConnectorBase={connectLinkedin:function(e){var t=this;o(document).one("linkedin_oauth_approved."+t.cid,function(i,n){t.serverCall("connect_linkedin").kwargs({li_uid:n}).liveMutate().send(),e&&e()});var i=s("/linkedin_/oauth_window");window.open(i.unicode(),"_BLANK","height=365,width=600")},connectTwitter:function(e){var t=this;o(document).one("twitter_oauth_approved."+t.cid,function(i,n){
var o=n.accessToken,s=n.userData;t.serverCall("connect_twitter").kwargs({access_token_key:o.key,screen_name:s.twitter_screen_name,tw_uid:s.twitter_uid,"protected":s["protected"]}).liveMutate().send(),e&&e()});var i=s("/twitter/oauth_window");window.open(i.unicode(),"_BLANK","height=558,width=800")},connectTumblr:function(e){var t=this;o(document).one("tumblr_oauth_approved."+t.cid,function(i,n){t.serverCall("connect_tumblr").kwargs({url:n}).liveMutate().success(function(i){"OK"!=i?alert(t.tumlbr_failure_message):e&&e()}).send()}),window.open("/tumblr_/oauth_window","_BLANK","height=500,width=600")}};t.SocialConnector=n.extend(a)},"./app/view/share/form.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./app/view/share/connect.js").SocialConnector,s=i("./tooltip.js"),a=i("./facebook.js"),r={_state:{},get:function(e){return this._state[e]},set:function(e,t){this._state[e]=t}},d=o.extend({contextProperty:null,onLoad:function(){var e=this;if(this.list_item=this.$id("@share_checkbox_list_item"),
this.checkbox=this.$id("@checkbox"),this.action_link=this.$id("@action_link"),this.message_preview=this.$id("@message_preview"),this.message_preview_text=this.$id("@message_preview_text"),this.label_clickable=this.$id("@label_clickable"),!this.is_disabled){var t=r.get(this.contextProperty);this.list_item.toggleClass("is_not_checked",!t),this.checkbox.prop("checked",t)}this.checkbox.on("change",function(){var t=e.isChecked();return t&&e.needs_action?(e.remedyDisabled(),void e.checkbox.prop("checked",!1)):(e.logCheckboxChangedJS(t),e.list_item.toggleClass("is_not_checked",!t),void r.set(e.contextProperty,t))}),this.label_clickable.on("click",function(){e.checkbox.click()}),this.action_link.on("click",function(){return e.is_disabled?e.remedyDisabled():e.editText(),!1})},logCheckboxChangedJS:function(e){this.serverCall("log_checkbox_changed_js").kwargs({is_checked:e,share_info:this.share_info}).send()},isChecked:function(){return this.checkbox.prop("checked")},remedyDisabled:function(){},beginEditingText:function(){}
}),l=d.extend({contextProperty:"shareToTwitter",remedyDisabled:function(){this.connectTwitter()}});t.ShareCheckboxTwitterCompact=l.extend({onLoad:function(){this._super.apply(this,arguments),s.attach(this.list_item,this.default_text)},remedyDisabled:function(){var e=this;this.connectTwitter(function(){e.checkbox.prop("checked",!0)})}}),t.ShareCheckboxFacebook=d.extend({contextProperty:"shareToFacebook",remedyDisabled:function(){var e=this;a.maybePromptToPublish(e.fbUid,function(t,i,n){e.serverCall("connect_facebook").kwargs({fb_uid:t,access_token:i,expires_secs:n}).liveMutate().send()},function(){e.child("fb_different_account").show()})}}),t.ShareForm=n.extend({getValues:function(){var e=this.child("checkbox_fb"),t=this.child("checkbox_tw");return{fb:e&&e.isChecked(),tw:t&&t.isChecked()}}}),t.ShareFormMessageEditor=n.extend({onLoad:function(){this.$editor=this.$id("@editor"),this.focus()},focus:function(){this.$editor.focus()},isOnlyWhiteSpace:function(){return""===this.$editor.val().trim();
},getText:function(){return this.$editor.val()}})},"./app/view/share/modal.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./w2.modal.js"),s=i("./app/view/share/connect.js").socialConnectorBase,a=i("./view/modal.js").Base,r=i("./shared/window_manager.js"),d=i("./shared/action_log.js"),l=i("./shared/cookies.js");t.ShareFormModal=a.extend(n.extend({},s,{onLoad:function(){var e=this;e.results=[],e.shortURLCopyField=e.$id("@short_url_copy_field"),e.linkedinCheckbox=e.$id("@linkedin_checkbox"),e.linkedinConnectLink=e.$id("@linkedin_connect_link"),e.boardCheckbox=e.$id("@board_checkbox"),e.boardSelectorContainer=e.$id("@board_selector_container"),e.boardSelector=e.child("board_selector"),e.sendCheckbox=e.$id("@send_checkbox"),e.multiSelectorContainer=e.$id("@multi_selector_container"),e.child("selector").whenOnSavedResultsChanged(function(t){e.updateResults(t)}),"function"==typeof window.history.pushState&&(r.isParamInURL("share")||window.history.pushState(null,"",r.addParamToURL(""+window.location,"share","1"))),
e.isChecked(e.boardCheckbox)&&e.boardSelectorContainer.show(),e.isChecked(e.sendCheckbox)&&e.multiSelectorContainer.show(),e.linkedinCheckbox.click(function(){return e.isChecked(e.linkedinCheckbox)?e.liUid?void e.enableSubmit():(e.connectLinkedin(e.checkLinkedin.bind(e)),!1):void e.disableSubmitIfNecessary()}),e.linkedinConnectLink.click(function(){return e.connectLinkedin(e.checkLinkedin.bind(e)),!1}),e.sendCheckbox.click(function(){return e.isChecked(e.sendCheckbox)?void e.multiSelectorContainer.removeClass("hidden"):(e.multiSelectorContainer.addClass("hidden"),void e.disableSubmitIfNecessary())}),e.shortURLCopyField.click(function(){n(this).select()}),this._super.apply(this,arguments),e.disableSubmitIfNecessary()},onClose:function(){return this._closeModal(),this.originalUrl&&"function"==typeof window.history.pushState&&window.history.pushState(null,"",this.originalUrl),!1},onSubmit:function(){var e=this;e.boardSelector&&e.boardSelector.selected_board?(e.boardInfo.bid=e.boardSelector.selected_board.bid,
e.boardInfo.name=e.boardSelector.selected_board.name,e.boardInfo.is_submission=e.boardSelector.selected_board.is_submission):e.isChecked(e.boardCheckbox)&&e.boardCheckbox.click();var t=e.checkboxValues();if(t.send=e.isChecked(e.sendCheckbox),!e.atLeastOneChecked(t))return e.disableSubmit(),!1;var i=o.Modal.openerFor(e);for(var n in t)if(t[n]===!0){var s="Share"+n[0].toUpperCase()+n.slice(1);l.setQfeedLog(i,s),l.setTlog({type:s})}l.setQueryLog(i,"BoardPost"),d.logSecondaryAction("Share",e.share_target),e.disableSubmit(),e.serverCall("dialog_submit_controller").kwargs({checkboxes:t,message:e.child("message_editor").getText(),board_info:e.boardInfo,send_recipients:e.results}).success(function(t){e._closeModal()}).error(function(){e._closeModal()}).liveMutate().send()},regexUrl:/((?:https?:\/\/)?[a-zA-Z0-9](?:[-a-zA-Z0-9]*\.)+[a-zA-Z]{2,}(?:\/[^\/\s]+)*\/?)(?:\s|$)/gi,tweetLength:function(e){if(!e)return 0;var t=e.length,i=[];return e.replace(this.regexUrl,function(e,t){i.push(t)}),t-=i.join("").length,
n.each(i,function(e,i){t+=i.match(/https:/)?23:22}),t+=23},checkboxValues:function(){var e=this,t={};return n.each(e.shareChannels,function(){t[this]=e.isChecked(e.$id("@"+this+"_checkbox"))}),t},atLeastOneChecked:function(e){var t=!1;return n.each(e,function(e,i){t=t||i}),t},uncheckAll:function(){var e=this;n.each(e.shareChannels,function(){e.$id("@"+this+"_checkbox").prop("checked",!1)}),e.disableSubmit()},disableSubmitIfNecessary:function(){var e=this.checkboxValues();this.atLeastOneChecked(e)||0!==this.results.length||this.disableSubmit()},checkLinkedin:function(){var e=this;e.linkedinCheckbox.prop("checked",!0),e.linkedinCheckbox.prop("disabled",!1),e.linkedinConnectLink.hide(),e.liUid=!0,e.enableSubmit()},updateResults:function(e){this.results=e,this.results.length>0||this.atLeastOneChecked(this.checkboxValues())?this.enableSubmit():this.disableSubmit()},isChecked:function(e){return e.prop("checked")}}))},"./app/view/signup_validation.js":function(e,t,i){var n=i("./input_validate.js").InputValidator,o=i("./unified_view/signup/_signup.js").SignupContext;
t.SignupValidator=n.extend({onLoad:function(){this._super.apply(this,arguments),this.signupContext=this.getContext(o),this.signupContext.get("validators")[this.id]=this}})},"./app/view/site_header.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.NonMemberSiteHeaderBase=n.extend({onLoad:function(){var e=this;this.handleEvent(o.Types.SITE_HEADER_SEARCH_FOCUSED,function(t){e.$id("@header").toggleClass("search_focused",t.payload.focused)})}})},"./app/view/site_header/logged_in.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./view/hover_menu.js"),a=i("./shared/events/index.js"),r=i("./shared/cookies.js"),d=i("./shared/w2.context.js");t.LoggedInSiteHeaderContext=d.Context.extend({initialProperties:function(){return{question_query_empty:!0,question_title_over_limit:!1,question_details_over_limit:!1,question_details_is_empty:!0,force_enable_button:null}}}),t.LoggedInSiteHeader=n.extend({contextConstructor:function(){
return t.LoggedInSiteHeaderContext},onLoad:function(){var e=this;this.handleEvent(a.Types.SITE_HEADER_SEARCH_FOCUSED,function(t){e.$id("@header").toggleClass("search_focused",t.payload.focused)})}}),t.FeedNavBadge=n.extend({onLoad:function(){var e=this;e.should_growl&&e.serverCall("send_growl").send()}}),t.NotifsNavBadge=n.extend({onLoad:function(){var e=this;this.handleEvent(a.Types.NOTIFS_CLEAR_BADGE,function(t){e.$id("@badge").addClass("hidden")})}}),t.NotifsNavItemBase=s.HoverMenu.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.handleEvent(a.Types.NOTIFS_HIDE_DROPDOWN,function(){e.cancelHover=!0,e.doHide()})},isInvalidCloseTarget:function(e){var t=this.$id("@link"),i=".SiteHeaderHoverMenuContents";return e.is(t)||e.parents(t).is(t)||e.is(i)||0!==e.parents(i).length?!0:!1},doShow:function(){this.emitEvent({type:a.Types.NOTIFS_CLEAR_BADGE,scope:a.scope.GLOBAL,payload:{}}),this.serverCall("clear_badge").send(),this._super.apply(this,arguments)}}),t.NotifsHoverMenuContents=n.extend({
onLoad:function(){this.$id("@dropdown").on("DOMMouseScroll mousewheel",function(e){var t=this.scrollTop,i=this.scrollHeight,n="DOMMouseScroll"==e.type?4*e.originalEvent.detail:e.originalEvent.deltaY,s=0>n;!s&&n>i-o(this).height()-t?(o(this).scrollTop(i),e.preventDefault()):s&&-n>t&&(o(this).scrollTop(0),e.preventDefault())})}}),t.MobileSiteLink=n.extend({onLoad:function(){this.$id("@mobile_link").click(function(){return r.setCookie("m","1"),window.location.reload(!0),!1})}})},"./app/view/site_header/logged_out.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.LoggedOutSiteHeader=n.extend({onLoad:function(){var e=this;this.handleEvent(o.Types.SITE_HEADER_SEARCH_FOCUSED,function(t){e.$id("@header").toggleClass("search_focused",t.payload.focused)}),e.$id("@signup").click(function(){return e.serverCall("show_signup_wall_if_not_logged_in").liveMutate().send(),!1}),e.$id("@login").click(function(){return window.loginIntent=!0,e.serverCall("show_signup_wall_if_not_logged_in").liveMutate().send(),
!1})}})},"./app/view/static.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js");t.JobsMain=n.extend({onLoad:function(){var e=this;o(".expand_link").click(function(t){t.preventDefault();var i=o(this).attr("id").split("_").pop();e.$id("@expand_"+i).toggleClass("hidden"),o(this).toggleClass("active_section")}),o.easing.easeOutExpo=function(e){return 1-Math.pow(1-e,6)},o(".jobs_listing_button").click(function(t){t.preventDefault();var i=e.$id("@careers");i.length&&o("html, body").animate({scrollTop:i.offset().top-100},2500,"easeOutExpo")})}}),t.AdvertisingMain=n.extend({onLoad:function(){}}),t.FeedbackTopicSelector=n.extend({onLoad:function(){var e=this;if(e.$id("@topic_selector").on("change",function(t){t.preventDefault();var i=parseInt(o(this).val());e.changeSelectorWithVal(i)}),window.location.search){var t=e.findGetParameter("option");e.$id("@topic_selector option").each(function(){t==o(this).val()&&(e.changeSelectorWithVal(parseInt(t)),e.$id("@topic_selector").val(t));
})}},findGetParameter:function(e){var t=null,i=[];return window.location.search.substr(1).split("&").forEach(function(n){i=n.split("="),i[0]===e&&(t=decodeURIComponent(i[1]))}),t},changeSelectorWithVal:function(e){var t=this;t.serverCall("choose_selector").kwargs({feedback_type:e}).contentFor(t.$id("@faq_selector")).send(),i("./shared/logging.js").log("feedback_topic_selector",{feedback_type:e,is_mobile:!1})}}),t.SuggestedFAQ=n.extend({onLoad:function(){var e=this;e.$id("@need_help_button").on("click",function(){o(this).hide(),e.$id("@general_form").removeClass("hidden")})}}),t.GeneralForm=n.extend({onLoad:function(){var e=this;e.logged_in=this.logged_in,e.clicked=!1,this.child("upload_form").success(this.uploadSuccess.bind(this)).failure(this.uploadFailure.bind(this)),e.$id("@submit_button").on("click",function(t){if(!e.clicked){e.clicked=!0,t.preventDefault(),e.$id("@submit_button").addClass("disabled");var i=e.$id("@name").val(),n=e.$id("@email").val(),o=e.$id("@profile").val(),s=e.$id("@photo_key").val(),a=e.$id("@editor").val(),r=e.$id("@appeal_selector").val(),d=e.$id("@appeal_content").val(),l=document.referrer;
e.serverCall("submit_feedback").kwargs({feedback_type:e.feedback_type,msg:a,referrer:l,name:i,email:n,profile:o,photo_key:s,target:e.target,appeal:r,appeal_content:d}).success(function(t){t&&t.redirect?setTimeout(function(){window.location.href="/"},2e3):(e.clicked=!1,e.$id("@submit_button").removeClass("disabled"))}).liveMutate().send()}})},uploadSuccess:function(e){this.$id("@photo_key").val(e.photo_key),this.serverCall("upload").kwargs({photo_key:e.photo_key,target:this.target}).contentFor(this.$id("@iframe")).send()},uploadFailure:function(){o(".drop_zone").removeClass("drag_and_hover"),this.child("drag_and_drop_form").$id("@form_title").removeClass("drag_and_hover"),this.child("upload_form").hideSpinner()}}),t.JobListingMain=n.extend({onLoad:function(){this.$id("@apply_button").on("click",this.onClickApplyNow.bind(this))},onClickApplyNow:function(){var e=this;if(e.pixel_action)qp&&qp("track",e.pixel_action),window.location.href=e.apply_url;else if(e.pixel_url){var t=new XMLHttpRequest;
t.onreadystatechange=function(){window.location.href=e.apply_url},t.open("GET",e.pixel_url,!0),t.send(null)}else window.location.href=e.apply_url;return!1}})},"./app/view/suggestions.js":function(e,t,i){var n=i("./shared/action_log.js");t.FollowSuggestionCard=n.ActionableComponent.extend({onLoad:function(){this._super.apply(this,arguments);var e=this,t=!1,i=e.$id("@actionable").parent();i.mouseleave(function(){t===!0&&(i.fadeOut(),e.serverCall("follow").liveMutate().send())}),e.$id("@follow").on("click",function(i){i.preventDefault(),e.$id("@follow").toggle(),e.$id("@unfollow").toggle(),t=!0}),e.$id("@unfollow").on("click",function(i){i.preventDefault(),e.$id("@follow").toggle(),e.$id("@unfollow").toggle(),t=!1})}})},"./app/view/survey/question_page.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js");t.Survey=n.extend({onLoad:function(){var e=this;e.bindSurveyDismissHandler(),e.bindSurveySubmitHandler(),e.serverCall("show_card").send()},bindSurveySubmitHandler:function(){
var e=this;this.$id("@submit_form").on("click",function(){var t=e.$id("@survey_form").find("input[type='radio']:checked").val(),i=o(this).parents(".Survey"),n=e.$id("@response_input").val();"undefined"!=typeof t&&e.serverCall("submit_survey").kwargs({selected_option:t,response_text:n}).success(function(){e.$id("@survey_wrapper").addClass("hidden"),e.$id("@feedback").removeClass("hidden"),i.hide()}).send()})},bindSurveyDismissHandler:function(){var e=this;this.$id("@dismiss").on("click",function(){e.$id("@survey").fadeOut(800),e.serverCall("dismiss_survey").send()})}})},"./app/view/thanks.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.ThanksLink=n.extend({onLoad:function(){var e=this;this.$id("@thanks_link").click(function(){return e.serverCall("send_thanks").liveMutate().send(),!1})}})},"./app/view/thread.js":function(e,t,i){var n=i("./view/inline_editor.js").InlineEditor;t.ThreadMessageInlineEditor=n.extend({ajax_callback:function(e){null!==e&&this.editor.clear(),
this._latestSavedState=null}})},"./app/view/threaded_comments.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./settings-webpack.js"),s=i("./shared/debounce.js").debounce,a=i("./shared/w2.context.js"),r=i("./shared/events/index.js"),d=i("./shared/logging.js"),l=a.Context.extend({initialProperties:function(){return{expanded:!1,visible:!0,showReplyBox:!1}}});t.TCommentListWrapper=n.extend({onLoad:function(){this.tcommentContext=this.getContext(l),this.isSingleFeedComment()&&(this.actionBarContext=this.getContext(a.ActionBar)),this.moreLink=this.$id("@comment_list_more_link"),this.collapsedLink=this.$id("@collapsed_link"),this.isMoreLinkActive=!0,this.isFirstExpand=!0,this.offset=this.initial_limit,this.moreLink&&this.moreLink.on("click",this.handleMoreLinkClick.bind(this)),this.tcommentContext&&this.tcommentContext.on("expanded",this.handleVisible.bind(this)),this.isSingleFeedComment()&&this.actionBarContext&&this.actionBarContext.set("pageFeedCommentsLink",this.moreLink);
var e=this.is_root||this.tcommentContext&&this.tcommentContext.get("expanded");this.handleVisible(null,e)},isSingleFeedComment:function(){return this.is_root&&1==this.initial_limit&&this.feed_comment_id},handleMoreLinkClick:function(e){e.stopPropagation(),e.preventDefault(),this.isMoreLinkActive&&(this.isMoreLinkActive=!1,this.pageComment())},handleVisible:function(e,t){this.$id("@comment_list_wrapper").toggleClass("hidden",!t),t&&this.lazy_load_children&&this.loadChildren()},pageComment:function(){var e=this;this.moreLink.addClass("hidden"),this.isFirstExpand&&this.isSingleFeedComment()&&d.log("comments_toggled",{comment_type:"answer",object_id:this.object_id}),this.serverCall("page_comment").kwargs({object_id:this.object_id,reply_to_id:this.reply_to_id,level:this.level,offset:this.offset,limit:this.getNextPageLimit(),feed_comment_id:this.feed_comment_id}).success(function(){e.moreLink.removeClass("hidden"),e.isMoreLinkActive=!0,e.offset=e.getNextPageLimit(),(null===e.offset||e.offset>=e.num_children)&&(e.moreLink.addClass("hidden"),
e.collapsedLink.removeClass("hidden")),e.isFirstExpand&&e.isSingleFeedComment()&&e.actionBarContext&&(e.actionBarContext.set("feedCommentsPaged",!0),e.actionBarContext.set("showComments",!0)),e.isFirstExpand=!1}).error(function(){e.moreLink.removeClass("hidden"),e.isMoreLinkActive=!1}).contentFor(this.$id("@comment_list_first_level_placeholder_"+this.offset)).sendOnlyOnce()},getNextPageLimit:function(){return this.isFirstExpand?this.offset+this.offsetStep:this.offset+this.nextOffsetStep},loadChildren:function(){this.lazy_load_children&&(this.lazy_load_children=!1,this.serverCall("load_child_list").kwargs({object_id:this.object_id,reply_to_id:this.reply_to_id,level:this.level}).contentFor(this.$id("@comment_list_placeholder")).send())}}),t.TComment=n.extend({contextConstructor:function(){return l},parentComment:function(){return this.parent().parent().parent()},onLoad:function(){this.tcommentContext=this.getContext(l),this.tcommentContext.on("expanded",this.handleExpand.bind(this)),this.tcommentContext.on("visible",this.handleVisible.bind(this)),
this.tcommentContext.set("expanded",this.force_expanded),this.tcommentContext.set("visible",!0)},handleExpand:function(e,t){this.$id("@comment_inner").toggleClass("expanded",t)},handleVisible:function(e,t){this.$id("@comment").toggleClass("hidden",!t)}}),t.TCommentReplyBox=n.extend({onLoad:function(){var e=this;this.isSubmittingComment=!1,this.editor=this.child("editor"),this.editor&&this.editor.setMeaningfulChangeCallback(s(this.save_draft.bind(this),1e3,{maxWait:6e4})),this.tcommentContext=this.getContext(l),this.tcommentContext.on("showReplyBox",function(t,i){e.$id("@reply_box").toggleClass("hidden",!i),i&&e.maybeFocusEditor()}),this.$id("@add_comment_link").on("click",function(t){t.preventDefault(),e.addComment()}),this.tcommentContext.set("showReplyBox",!1),this.$id("@reply_box").on("focusout",function(){e.editor.isEmpty()&&(e.tcommentContext.set("showReplyBox",!1),e.emitEvent({type:r.Types.COMMENT_REPLY_FOCUS,payload:{comment_id:e.reply_to_id,comment_type:e.comment_type}}))})},maybeFocusEditor:function(){
var e=this;setTimeout(function(){e.editor&&e.editor.focus()},0)},addComment:function(){var e=this;if(this.tcommentContext.set("showReplyBox",!1),!this.editor.isOnlyWhiteSpace()){var t=this.editor.serialize();this.isSubmittingComment=!0,this.serverCall("add_comment").kwargs({oid:this.object_id,comment:t,reply_to_id:this.reply_to_id}).success(function(t){e.tcommentContext.set("expanded",!0),e.editor.clear(),e.isSubmittingComment=!1,e.$id("@reply_box").blur()}).error(function(){e.isSubmittingComment=!1}).liveMutate().sendOnlyOnce()}},save_draft:function(){this.isSubmittingComment||this.serverCall("save_draft").kwargs({content:this.editor.serialize(),window_id:o.windowId,draft_space:this.draft_space}).send()}}),t.TCommentAddRoot=n.extend({onLoad:function(){var e=this;this.editor=this.child("editor"),this.editor&&this.editor.setMeaningfulChangeCallback(s(this.save_draft.bind(this),1e3,{maxWait:6e4})),this.isSubmittingComment=!1,this.$addRootLink=this.$id("@add_root_link"),this.$addRootLink.on("click",function(t){
t.preventDefault(),e.addComment()})},addComment:function(){var e=this;this.editor.isOnlyWhiteSpace()||(this.isSubmittingComment=!0,this.serverCall("add_comment").kwargs({oid:this.object_id,comment:this.editor.serialize()}).success(function(t){e.editor.clear(),e.isSubmittingComment=!1,e.emitEvent({type:r.Types.COMMENT_ADD,payload:{object_id:e.object_id,comment_type:e.comment_type}})}).error(function(){e.isSubmittingComment=!1}).liveMutate().sendOnlyOnce())},save_draft:function(){this.isSubmittingComment||this.serverCall("save_draft").kwargs({content:this.editor.serialize(),window_id:o.windowId,draft_space:this.draft_space}).send()}}),t.AnswerTCommentAddRoot=t.TCommentAddRoot.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.editor=e.child("editor"),e.editor&&e.editor.setFocusCallback(function(){e.$addRootLink.removeClass("hidden")})}}),t.TCommentRepliesCollapsed=n.extend({onLoad:function(){var e=this;this.tcommentContext=this.getContext(l),this.tcommentContext.on("expanded",function(t,i){
e.setHidden(i)}),this.$id("@show_child_link").on("click",function(t){t.preventDefault(),e.tcommentContext.set("expanded",!0)}),this.setHidden(this.tcommentContext.get("expanded"))},setHidden:function(e){this.$id("@show_child_link_wrapper").toggleClass("hidden",e)}}),t.AnswerTCommentRepliesCollapsedInFeed=t.TCommentRepliesCollapsed.extend({onLoad:function(){var e=this;e.actionBarContext=e.getContext(a.ActionBar),e.$id("@show_child_link").on("click",function(t){e.actionBarContext&&e.actionBarContext.set("feedCommentExpanded",!0),e.serverCall("load_feed_comments").kwargs({object_id:e.object_id,comment_id:e.id}).contentFor(e.$id("@show_child_link_wrapper")).success(function(){e.$id("@show_child_link_wrapper").addClass("background")}).send(),t.preventDefault()})}}),t.TCommentWhoVoted=n.extend({onLoad:function(){var e=this;this.$id("@modal_link").click(function(t){t.preventDefault(),e.createModal("load_inner").kwargs({object_id:e.object_id,comment_id:e.comment_id}).show()})}}),t.DeleteCommentButton=n.extend({
onLoad:function(){var e=this;this.$id("@delete").click(function(t){return e.deleteComment(),!1})},deleteComment:function(){this.serverCall("delete").liveMutate().send()}}),t.CommentReply=n.extend({onLoad:function(){var e=this;this.tcommentContext=this.getContext(l),this.$id("@show_reply_box_link").focus(this.startEditing.bind(this)),this.$id("@show_reply_box_link").on("click",function(t){t.preventDefault(),e.startEditing()}),this.handleEvent(r.Types.COMMENT_REPLY_FOCUS,function(t){t.payload.comment_id==e.comment_id&&t.payload.comment_type==e.comment_type&&e.$id("@show_reply_box_link").toggleClass("hidden")})},startEditing:function(){this.tcommentContext.set("showReplyBox",!0),this.emitEvent({type:r.Types.COMMENT_REPLY_FOCUS,payload:{comment_id:this.comment_id,comment_type:this.comment_type}})}})},"./app/view/threaded_comments/featured.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./unified_view/toggle.js"),s=i("./shared/events/index.js"),a=i("./shared/logging.js");
t.FeedInlineAnswerAutoExpandedCommentsToggle=o.ToggleBase.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.handleEvent(s.Types.FEED_ANSWER_INLINE_EXPAND,function(t){t.payload.aid==e.aid&&e.triggerSwitch()})}}),t.WebExpandedFeaturedComments=n.extend({onLoad:function(){var e=this;this.has_fetched_all_comments=!1,e.handleEvent(s.Types.ANSWER_COMMENT_SORT_ALL,function(t){t.payload.aid==e.aid&&e.toggleCommentList("all")}),e.handleEvent(s.Types.COMMENT_ADD,function(t){t.payload.object_id==e.aid&&"answer"==t.payload.comment_type&&e.toggleCommentList("featured")}),e.$id("@toggle_featured").click(function(t){t.preventDefault(),e.toggleCommentList("featured")}),e.$id("@toggle_all").click(function(t){t.preventDefault(),e.toggleCommentList("all")}),e.logHeight()},logHeight:function(){var e=this;e.aid%100===0&&setTimeout(function(){var t=e.$id("@expanded_comments").height();if(0!==t){var i={aid:e.aid,height:t};a.log("comment_auto_expanded_height",i)}},500)},fetchAllComments:function(){
var e=this;e.has_fetched_all_comments=!0,e.serverCall("fetch_all_comments").kwargs({aid:e.aid,feed_comment_id:e.feed_comment_id}).contentFor(e.$id("@container_all")).sendOnlyOnce()},toggleAllComments:function(){this.$id("@container_featured").addClass("hidden"),this.$id("@container_all").removeClass("hidden"),this.$id("@toggle_featured").removeClass("is_selected"),this.$id("@toggle_all").addClass("is_selected"),this.has_fetched_all_comments||this.fetchAllComments()},toggleFeaturedComments:function(){this.$id("@container_featured").removeClass("hidden"),this.$id("@container_all").addClass("hidden"),this.$id("@toggle_all").removeClass("is_selected"),this.$id("@toggle_featured").addClass("is_selected")},toggleCommentList:function(e){var t=this;"featured"==e?this.toggleFeaturedComments():this.toggleAllComments();var i={comment_type:"answer",object_id:t.aid,to_sort:e};a.log("answer_comments_toggle_featured",i,{scribeOnly:!0})}})},"./app/view/toast.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");
t.SignupToastWrapper=n.extend({onLoad:function(){var e=this;e.handleEvent(o.Types.SIGNUP_TOAST_SHOW,function(t){e.$id("@toast").addClass("show_toast"),e.$id("@toast").removeClass("hide_toast")}),e.$id("@toast_dismiss").on("click",function(){e.$id("@toast").addClass("hidden")})}})},"./app/view/topic.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/cookies.js"),s=i("./w2.dialog.js"),a=i("./view/dialog.js"),r=i("./tooltip.js"),d=i("./shared/w2.context.js"),l=i("./shared/action_log.js"),c=i("./settings-webpack.js").interface_strings;t.TopicAliases=n.extend({onLoad:function(){var e=this,t=this.addAliasSubmit.bind(this);this.$id("@topic_alias_add").click(t),this.$id("@topic_alias_add_form").submit(t),this.$id("@show_alias_link").click(function(t){t.preventDefault(),e.$id("@add_topic_alias").removeClass("hidden"),e.$id("@show_alias").hide(),e.$id("@topic_alias_input").focus()})},get_value:function(){return this.$id("@topic_alias_input").val()},addAliasSubmit:function(){
return this._request(this.get_value()),!1},_request:function(e){var t=this;return this.tid&&e?void this.serverCall("add_topic_alias").kwargs({tid:this.tid,alias:e}).success(function(){t.$id("@topic_alias_input").val(""),t.$id("@topic_alias_input").focus()}).liveMutate().send():!1}}),t.TopicAlias=n.extend({onLoad:function(){var e=this;this.$id("@topic_alias_remove").click(function(){return s.createDialog(e).title(e.dialog_title).cancel().ok(function(){e._request()}).text(e.dialog_contents),!1})},_request:function(){return this.tid&&this.alias?void this.serverCall("remove_topic_alias").kwargs({tid:this.tid,alias:this.alias}).liveMutate().send():!1}}),t.TopicDelete=n.extend({onLoad:function(){var e=this;this.$id("@delete_topic_link").click(function(){return e.showDialog(!0),!1}),this.$id("@undelete_topic_link").click(function(){return e.showDialog(!1),!1})},getKwargs:function(e){return{tid:this.tid,comment:e.serialize()}},showDialog:function(e){var t=this.title,i=e?"delete_topic":"undelete_topic",n=e?"delete_dialog":"undelete_dialog",o=this;
s.createDialog(o).title(t).ok(function(e){var t=e.dialogComponent.child("editor");return t.isOnlyWhiteSpace()?!1:void o.serverCall(i).kwargs(o.getKwargs(t)).liveMutate().send()},c.ok).cancel(null,c.cancel).load(n)}}),t.TopicFollowButton=n.extend({onLoad:function(){var e=this.follow.bind(this),t=this.unfollow.bind(this);this.$id("@follow").click(e),this.$id("@unfollow").click(t),this.tooltip&&r.attach(this.$id("@follow"),this.tooltip_text)},follow:function(e){o.setQfeedLog(this,"TopicFollow"),o.setQueryLog(this,"TopicFollow"),o.setTlog({type:"TopicFollow",tid:this.tid}),l.logSecondaryAction("TopicFollow",{type:"topic",tid:this.tid}),this.serverCall("follow").kwargs({tid:this.tid}).liveMutate().send(),e.preventDefault()},unfollow:function(e){this.serverCall("unfollow").kwargs({tid:this.tid}).liveMutate().send(),e.preventDefault()}}),t.AdultTopicFollowButton=a.DialogLink.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.$id("@link").click(function(){return e.serverCall("follow").liveMutate().send(),
!1})}}),t.TopicNameLinkBase=n.extend({onLoad:function(){var e=this;this.$id("@link").mousedown(function(){o.setQfeedLog(e,"TopicClickthrough"),o.setQueryLog(e,"TopicClickthrough")})}}),t.HoverTopicMenuMuteLink=n.extend({onLoad:function(){this.hoverMenuContext=this.getContext(d.HoverMenu),this.$link=this.$id("@link");var e=this;this.$link.on("click",function(){var t=e.$link.hasClass("topic_muted");return t?e.serverCall("unmute").liveMutate().send():(e.hoverMenuContext&&e.hoverMenuContext.set("hidden",!0),e.serverCall("mute").liveMutate().send()),!1})}}),t.TopicTrendingIndicator=n.extend({onLoad:function(){r.attach(this.$id("@trending"),this.tooltipText)}})},"./app/view/topic/edit_topic_modal.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.EditTopicsList=n.extend({onLoad:function(){var e=this;this.handleEvent(o.Types.TOPIC_LIST_REMOVE,function(t){e.removeTid(t.payload.tid)})},removeTid:function(e){this.serverCall("remove").kwargs({tid:e
}).liveMutate().send()}}),t.EditTopicsLink=n.extend({onLoad:function(){var e=this;this.$id("@edit_topics").click(function(t){t.preventDefault(),e.createModal("load_modal").kwargs({metadata:e.metadata}).show()})}}),t.TopicRow=n.extend({onLoad:function(){var e=this;this.$id("@remove_topic").on("click",function(t){t.preventDefault(),e.emitEvent({type:o.Types.TOPIC_LIST_REMOVE,payload:{tid:e.tid}})})}})},"./app/view/topic/faq.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./shared/events/index.js"),a=i("./view/selector.js").WithServerCallMessageMixin,r=i("./view/reorderable_list.js").ReorderableList,d=i("./view/reorderable_list.js").ReorderableListContents,l=i("./view/reorderable_list.js").ReorderableListItem,c=i("./view/modal.js").Base,u=i("./shared/action_log.js"),h=u.ActionableComponent;t.TopicFaqMainListWrapper=h.extend({onLoad:function(){this._super.apply(this,arguments),this.$id("@actionable").off("mousedown"),this.$id("@actionable").off("click");
}}),t.TopicFaqSubPageMainList=r.extend({onLoad:function(){this._super.apply(this,arguments),this.user_can_edit&&(this.setEditLink(),this.update(),this.bindClickHandler(),this.updateToc()),this.updateFixable();var e=this;this.handleEvent(s.Types.REORDERABLE_LIST_TOGGLE_EDIT,function(){e.toggleEditMode()}),this.handleEvent(s.Types.TOPIC_FAQ_HIGHLIGHT_QUESTION,function(t){if(e.is_editing){var i=["div[sid='",t.payload.section_id,"']","[oid='",t.payload.qid,"']"].join("");o(i).addClass("highlighted")}})},enableLocalUpdate:!1,resetActiveState:function(){this.$id("@wrapper").find(".active").removeClass("active")},update:function(){this.is_editing?(this.$id("@wrapper").addClass("is_editing"),this.attach()):(this.$id("@wrapper").removeClass("is_editing"),this.detach()),this.resetActiveState()},showErrorOnLiveUpdate:function(){if(this.isOnDragActive){this.isOnDragActive=!1,o("html, body").stop();var e=this;this.serverCall("show_error_on_liveupdate").success(function(){setTimeout(function(){e.detach(),
e.attach()},0)}).send()}},toggleEditMode:function(){this.is_editing=!this.is_editing,this.update(),this.resetActiveState(),this.updateFixable()},editLinkClickCallback:function(){},onEndSectionMousedownCallback:function(e,t){o(t).addClass("dragging_node node_clone_section on_drag"),e.style.height=o(t).outerHeight()+"px"},onEndSubsectionMousedownCallback:function(e,t){o(e).addClass("dragging_node node_clone on_drag"),1>t?o(e).addClass("primary_section"):o(e).addClass("sec_section")},onEndSubsectionMouseupCallback:function(e,t,i,n,s,a){if(o(t).removeClass("on_drag"),o(t).addClass("on_release"),i===n&&s===a)return void this.setToDefaultView();e=e.firstChild;var r=e.getAttribute("sid"),d=this.sectionNodes[s][0].firstChild.getAttribute("sid"),l=this;s===a?this.serverCall("move_question_in_section").kwargs({section_id:parseInt(d),qid:parseInt(e.getAttribute("oid")),new_pos:i}).liveMutate().success(function(){l.setToDefaultView()}).error(function(){l.setToDefaultView(),setTimeout(function(){l.detach(),
l.attach()})}).send():this.serverCall("move_question_across_section").kwargs({section_id:parseInt(d),old_section_id:parseInt(r),qid:parseInt(e.getAttribute("oid")),new_pos:i}).liveMutate().success(function(){l.setToDefaultView()}).error(function(){l.setToDefaultView(),setTimeout(function(){l.detach(),l.attach()})}).send()},onEndSectionMouseupCallback:function(e,t,i,n){if(o(t).removeClass("on_drag"),o(t).addClass("on_release"),1>i||i===n)return void this.setToDefaultView();if(e=e.firstChild,i!=n){var s=this;this.serverCall("move_section").kwargs({section_id:parseInt(e.getAttribute("sid")),tid:s.tid,new_pos:i}).liveMutate().success(function(){s.setToDefaultView()}).send()}},updateFixable:function(){},setEditLink:function(){},bindClickHandler:function(){},updateToc:function(){}}),t.TopicFaqMainListEditLink=h.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.$id("@edit").on("click",function(t){t.preventDefault(),e.toggleMainListEditMode()}),this.$id("@done").on("click",function(t){
t.preventDefault(),e.toggleMainListEditMode()})},toggleMainListEditMode:function(){this.emitEvent({type:s.Types.REORDERABLE_LIST_TOGGLE_EDIT,payload:{}})}}),t.TopicFaqContents=d.extend({onLoad:function(){this._super.apply(this,arguments),this.emitEvent({type:s.Types.REORDERABLE_LIST_ITEM_UPDATE,payload:{}});var e=this;document.addEventListener("mousedown",function(){e.emitEvent({type:s.Types.REORDERABLE_LIST_ITEM_ACTIVE,payload:{}})},!0),this.handleEvent(s.Types.TOPIC_FAQ_VIEW_MORE,function(){e.$id("@contents_wrapper").addClass("show_hidden_items")})}}),t.TopicSection=n.extend({onLoad:function(){this.handleEvent(s.Types.REORDERABLE_LIST_TOGGLE_EDIT,this.focusSelector.bind(this))},focusSelector:function(){this.child("selector").$input.focus()}}),t.RecentlyAddedQuestionHighlighter=n.extend({onLoad:function(){this.emitEvent({type:s.Types.TOPIC_FAQ_HIGHLIGHT_QUESTION,payload:{section_id:this.section_id,qid:this.highlight_question}})}}),t.TopicSectionEmptyState=n.extend({onLoad:function(){var e=this;
this.$id("@add_question").on("click",function(t){t.preventDefault(),e.emitEvent({type:s.Types.REORDERABLE_LIST_TOGGLE_EDIT,payload:{}})})}});var p=!1;t.TopicFaqViewMoreLabel=n.extend({onLoad:function(){var e=this;e.$id("@view_more").click(function(t){p=!0,t.preventDefault(),e.expand()}),p&&e.expand()},expand:function(){this.emitEvent({type:s.Types.TOPIC_FAQ_VIEW_MORE,payload:{}}),this.$id("@view_more").removeClass("view_mode_only"),this.$id("@view_more").addClass("hidden")}}),t.TopicSectionQuestionItem=l.extend({remove:function(){this.createModal("remove").kwargs({oid:this.oid,section_id:this.section_id}).show()}}),t.TopicFaqRemoveQuestionWarning=c.extend({onSubmit:function(){var e=this;e.serverCall("remove").liveMutate().success(function(){e._closeModal()}).sendOnlyOnce()}}),t.TopicFaqQuestionSelector=a.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.questionMarkInserted=!1},resultsServerCallHandler:function(){this._super.apply(this,arguments),this.$input.focus()},createNewQuestion:function(){
var e=this;e.hasPendingServerCall()||(u.logPrimaryAction("WebTopicFaqMainListWrapperQuestionAdd",e.impression_target),e.makeServerCall(e.serverCall("create_new_question").kwargs({input_text:e.query}).liveMutate()))},addExistingQuestion:function(e){var t=this;t.hasPendingServerCall()||t.makeServerCall(t.serverCall("add_existing_question").kwargs({qid:e}).liveMutate())},maybeInsertQuestionMark:function(){return"?"===this.query&&this.questionMarkInserted?(this.setQuery(""),void(this.questionMarkInserted=!1)):this.query?void(this.questionMarkInserted||null===this.query.match(/[?]$/)&&(this.questionMarkInserted=!0,this.setQuery(this.query+"?"))):void(this.questionMarkInserted=!1)},queryDidChange:function(){this._super.apply(this,arguments),this.maybeInsertQuestionMark()},resultWasSelected:function(e){switch(e.ty){case"question":this.addExistingQuestion(e.data.qid);break;case"create_question":this.createNewQuestion()}},updateServerMessage:function(e,t){if(e)this.faq_is_empty||this.setQuery("");else if(t&&t.message)return this.$id("@server_message_title").text(t.message.title),
t.message.note&&this.$id("@server_message_note").text(t.message.note),!0;return!1}})},"./app/view/topic/flag.js":function(e,t,i){var n=i("./view/dialog.js");t.EnableFAQFlagOverflowDialog=n.AddCommentDialog.extend({submitServerCall:function(e){var t=this;this.serverCall("dialog_submit_controller").kwargs(e).success(function(e){window.location.href=e,t.close()}).send()}})},"./app/view/topic/leaderboard.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/window_manager.js");t.LeaderboardStatus=n.extend({onLoad:function(){var e=this;e.$id("@refresh_link").click(function(t){t.preventDefault(),e.refreshLeaderboard()})},refreshLeaderboard:function(){var e=this;e.serverCall("refresh_leaderboard").kwargs({tid:e.tid}).success(function(){e.$id("@refresh_link").addClass("completed").text("Refreshing completed. (Reloading the page)"),o.reload()}).error(function(){e.$id("@refresh_link").addClass("completed").text("Refreshing failed! Reload to retry.")}).send(),e.$id("@refresh_link").addClass("completed").text("Refreshing started...");
}}),t.AddToBlacklistMVW=n.extend({onLoad:function(){var e=this;e.$id("@add_link").click(function(t){t.preventDefault(),e.update(!1)}),e.$id("@remove_link").click(function(t){t.preventDefault(),e.update(!0)})},update:function(e){var t=this;t.serverCall("update").kwargs({tid:t.tid,is_removal:e}).success(function(){e===!0?t.$id("@remove_link").addClass("completed").text("Removed"):t.$id("@add_link").addClass("completed").text("Added")}).send()}})},"./app/view/topic/location.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.TopicLocationPreview=n.extend({onLoad:function(){var e=this;this.$id("@enlarge_map").click(function(){return e.$id("@enlarge_map").hide(),e.$id("@wrapper").css("height","auto"),e.$id("@wrapper").css("width","auto"),e.$id("@wrapper").removeClass("mask"),e.$id("@content").removeClass("mask_content"),e.$id("@content").css("top","0px"),e.child("topicmap").child("picker").toggleControls(!0),!1})}})},"./app/view/topic/merge.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./w2.dialog.js"),s=i("./app/view/topic_selector.js").TopicSelector,a=i("./settings-webpack.js").interface_strings;
t.TopicMergeSelector=s.extend({topicWasSelected:function(e){var t=function(t){var i=t.dialogComponent.child("editor");return i.isOnlyWhiteSpace()?!1:void this.serverCall("merge").kwargs({to_tid:e,from_tid:this.from_tid,comment:i.serialize()}).liveMutate().send()}.bind(this);o.createDialog(this).title(this.topic_merge_text).ok(t,a.ok).cancel(null,a.cancel).load("merge_dialog")}}),t.TopicMergeUnmerge=n.extend({onLoad:function(){var e=this;this.is_locked_for_user||this.$id("@show_merge").click(function(){return e.$id("@merge").removeClass("hidden"),e.$id("@show_merge").addClass("hidden"),e.child("selector").focus(),!1})}}),t.TopicUnmergeLink=n.extend({onLoad:function(){var e=this;this.$id("@unmerge").click(function(){return e.serverCall("unmerge_topic").kwargs({tid:e.tid}).liveMutate().send(),!1})}})},"./app/view/topic/topic_create.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/window_manager.js"),s=i("./w2.dialog.js").Dialog,a=i("./view/selector.js").Selector,r=i("./view/selector.js").NavigateToResultUrlSelectorMixin;
t.TopicNavigateSelector=a.extend(r),t.TopicCreateMain=n.extend({onLoad:function(){var e=this;this.submitted=!1,this.$id("@fake_editor").click(function(){return e.$id("@fake_editor_row").hide(),e.$id("@editor_row").show(),e.child("editor").focus(),!1}),this.$id("@create").click(function(){var t=e.getTopicName();if(!t||/^\s+$/.test(t)||e.submitted)return!1;e.submitted=!0;var i=e.child("editor").serialize();e.serverCall("create_topic").kwargs({topic_name:t,about:i}).success(function(e){o.sameDomainURL(e)&&(document.location=e)}).liveMutate().send()}),this.$id("@cancel").click(function(){return e.cancelClicked(),!1})},getTopicName:function(){return this.child("selector").query},cancelClicked:function(){}}),t.TopicCreateDialog=t.TopicCreateMain.extend({cancelClicked:function(){s.dialogFor(this).close_()}})},"./app/view/topic/topic_list.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./tooltip.js");t.TopicListItem=n.extend({onLoad:function(){var e=this;o.attach(this.$id("@remove_topic"),this.remove_tooltip_text),
this.$id("@remove_topic").click(function(t){e.serverCall("remove_topic").liveMutate().send(),t.preventDefault()}),this.$id("@remove_topic").hover(function(){e.$id("@topic_list_item").addClass("hover")},function(){e.$id("@topic_list_item").removeClass("hover")})}}),t.QuestionTopicHorizontalList=n.extend({onLoad:function(){var e=this;e.$id("@modal_link").on("click",function(t){t.preventDefault(),e.createModal("load_inner").kwargs({qid:e.qid,is_anon_page:e.is_anon_page}).show()})}})},"./app/view/topic/topic_ontology.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.AddTopicParent=n.extend({onLoad:function(){var e=this;this.$id("@existing_link").click(function(t){t.preventDefault(),e.$id("@existing_link").addClass("hidden"),e.$id("@existing").removeClass("hidden"),e.child("parent_selector").focus()})}}),t.AddTopicChildren=n.extend({onLoad:function(){var e=this;this.$id("@existing_link").click(function(t){t.preventDefault(),e.$id("@existing_link").addClass("hidden"),e.$id("@existing").removeClass("hidden"),
e.child("child_selector").focus()})}}),t.OrganizeChildItem=n.extend({onLoad:function(){var e=this;e.$id("@remove").click(function(t){t.preventDefault(),e.serverCall("remove_topic").liveMutate().send()})},toggleInstruction:function(){this.$id("@instruction").toggleClass("hidden")}}),t.ManageParentTopicsLink=n.extend({onLoad:function(){var e=this;e.$id("@link").click(function(t){t.preventDefault(),e.createModal("load").kwargs({tid:e.tid}).show()})}})},"./app/view/topic/topic_redesign.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.TopicPhotoCard=n.extend({onLoad:function(){var e=this;e.$id("@card").click(function(t){return e.onCardClick(),!1})},onCardClick:function(){this.isSelected=!this.isSelected,this.isSelected?this.select():this.deselect()},select:function(){this.$id("@card").addClass(this.selectClass),this.emitEvent({type:o.Types.TOPICS_GRID_ADD,payload:{tid:this.tid}})},deselect:function(){this.$id("@card").removeClass(this.selectClass),
this.emitEvent({type:o.Types.TOPICS_GRID_REMOVE,payload:{tid:this.tid}})}})},"./app/view/topic_selector.js":function(e,t,i){var n=i("./view/selector.js").Selector,o=i("./w2.dialog.js"),s=t.TopicSelector=n.extend({resultWasSelected:function(e,t,i){if("topic"===e.ty)this.topicWasSelected(e.data.tid,e.data.topic_name,t,i,e);else{if("create_topic"!==e.ty)throw Error();this.createTopicWasSelected(e.data.new_topic_name,t,i)}},topicWasSelected:function(e,t,i,n){},createTopicWasSelected:function(e,t,i){}});t.AddTopicSelector=s.extend({showErrorDialog:function(){o.createDialog(this).title(this.dialog_title).ok(null,this.close_button_text).text(this.dialog_message)},topicWasSelected:function(e,t,i,n){this.clear_query_on_select&&this.setQuery(""),this.serverCall("add_topic").kwargs({tid:e}).liveMutate().error(this.showErrorDialog.bind(this)).send(),this.clear_query_on_select||this.updateResults()},createTopicWasSelected:function(e,t,i){this.setQuery(""),this.serverCall("create_and_add_topic").kwargs({
new_topic_name:e}).liveMutate().error(this.showErrorDialog.bind(this)).send()}}),t.TopicSelectorForFormField=t.AddTopicSelector.extend({onTopicSelected:function(e){this._onTopicSelectedCallback=e},topicWasSelected:function(e,t,i){this._onTopicSelectedCallback&&this._onTopicSelectedCallback(t,e),this.setQuery("")},createTopicWasSelected:function(e,t){var i=this;i.serverCall("create_and_add_topic").kwargs({new_topic_name:e}).success(function(t){i._onTopicSelectedCallback&&i._onTopicSelectedCallback(e,t),i.setQuery("")}).liveMutate().send()}})},"./app/view/tumblr.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.TumblrCallbackPage=n.extend({onLoad:function(){if(window.opener)if(this.url){var e=window.opener.require("shared/jquery");e(window.opener.document).trigger("tumblr_oauth_approved",this.url),window.close()}else alert(this.error_message)}})},"./app/view/twitter.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/cookies.js");t.TwitterConnectCallbackPage=n.extend({
onLoad:function(){if(o.setCookie("twitter_oauth_access_key",this.access_token.key,{path:"/twitter/"}),window.opener&&window.opener.document){var e=window.opener.require("shared/jquery");e(window.opener.document).trigger("twitter_oauth_approved",{accessToken:this.access_token,userData:this.user_data})}window.close()}})},"./app/view/user.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./shared/cookies.js"),a=i("./w2.dialog.js"),r=i("./settings-webpack.js"),d=r.interface_strings;t.UserStatusMain=n.extend({onLoad:function(){this.admin_log_list=this.$id("@admin_log_scroll_context"),this.admin_log_list.on("mouseover",function(){document.body.style.overflowY="hidden"}),this.admin_log_list.on("mouseout",function(){document.body.style.overflowY="auto"}),o(".inline_editor_create").on("click",function(){o(".admin_qtext").addClass("visible")}),o(".inline_editor_cancel_button").on("click",function(){o(".admin_qtext").removeClass("visible")})}}),t.ProfilePhoto=n.extend({
toggleSuggestion:function(){}}),t.UserFollowLink=n.extend({onLoad:function(){var e=this;this.$id("@follow_user").click(function(t){e.follow(),t.preventDefault()}),this.$id("@unfollow_user").click(function(t){e.unfollow(),t.preventDefault()})},follow:function(){s.setQfeedLog(this,"UserFollow"),s.setQueryLog(this,"UserFollow"),s.setTlog({type:"UserFollow",uid:this.uid}),this.serverCall("follow_user").liveMutate().send()},unfollow:function(){s.setQfeedLog(this,"UserUnfollow"),s.setQueryLog(this,"UserUnfollow"),s.setTlog({type:"UserUnfollow",uid:this.uid}),this.serverCall("unfollow_user").liveMutate().send()}}),t.BatchRevertControls=n.extend({onLoad:function(){var e=this;this.$id("@select_all_word").click(function(){return e.toggleCheckboxes(),"Select All"==e.$id("@select_all_word").text()?e.$id("@select_all_word").html("Select None"):e.$id("@select_all_word").html("Select All"),!1}),this.$id("@revert").click(function(){return e.batchRevert(),!1})},batchRevert:function(){var e=this,t=[];return o(".user_log_operations_to_revert input:checked").each(function(e){
t.push(o(this).attr("name"))}),0===t.length?!1:(this._dialog=a.createDialog(this).title(this.dialog_title).cancel(null,d.cancel).ok(function(i){var n=i.dialogComponent,o=n.child("editor");if(!o.isOnlyWhiteSpace()){var s=o.serialize();e.serverCall("batch_revert").kwargs({revert_strings:t,comment:s}).liveMutate().send()}}).load("batch_revert_dialog"),!1)},toggleCheckboxes:function(){var e=o(".user_log_operations_to_revert .pagedlist_hidden input:not(:disabled)").length,t=o(".user_log_operations_to_revert input:not(:disabled)").length-e,i=o(".user_log_operations_to_revert input:checked").length;t!=i?(o("input:not(:disabled)").prop("checked",!0),o(".user_log_operations_to_revert .pagedlist_hidden input").each(function(e){o(this).prop("checked",!1)})):o("input:not(:disabled)").prop("checked",!1)},getKwargs:function(e,t){return{revert_strings:e,comment:t.serialize()}}}),t.UnconfirmedEmailBlockedEditor=n.extend({onLoad:function(){var e=this;this.$id("@resend").click(function(){return e.serverCall("resend_email_confirmation").send(),
!1})}})},"./app/view/user/content.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./app/view/topic_selector.js").TopicSelector,s=i("./shared/window_manager.js"),a=i("./shared/core/component.js").Component;t.UserContentFilter=a.extend({onLoad:function(){var e=this;this.$id("@filter_links a").click(function(){var t=n(this);if(t.hasClass("selected"))return!1;var i=t.attr("data-value"),o={};o[e.data_key]=i;var a=s.makeUpdatedURL(o);return s.navigateTo(a),!1})}}),t.UserContentFilterTopics=a.extend({onLoad:function(){var e=this;this.$id("@all_topics").click(function(){return e.$id("@all_topics").hasClass("selected")||e.clearChosenTopic(),!1}),this.$id("@remove_chosen_topic").click(function(){return e.clearChosenTopic(),!1})},clearChosenTopic:function(){var e={};e[this.data_key]=null;var t=s.makeUpdatedURL(e);s.navigateTo(t)}}),t.UserContentFilterTopicSelector=o.extend({topicWasSelected:function(e,t,i,n,o){if(t){var a={};a.topic=o.data.topic_routing_name;var r=s.makeUpdatedURL(a);s.navigateTo(r);
}}})},"./app/view/user/profile.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./tooltip.js"),s=i("./shared/window_manager.js"),a=i("./view/editable_list.js").EditableList;t.VerificationBadge=n.extend({onLoad:function(){o.attach(this.$id("@badge"),this.tooltip_text)}}),t.NGProfileNameEditor=n.extend({onLoad:function(){this.$id("@update").click(this.updateName.bind(this)),this.$id("@edit").click(this.toggleEditor.bind(this)),this.$id("@cancel").click(this.toggleEditor.bind(this))},toggleEditor:function(){return this.$id("@initial").toggleClass("hidden"),this.$id("@editor").toggleClass("hidden"),!1},updateName:function(){var e=this.$id("@name").val(),t=this;return this.serverCall("update").kwargs({name:e}).success(function(e){e&&(t.toggleEditor(),s.reload())}).liveMutate().send(),!1}}),t.ProfileExperienceList=a.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.shouldLoadModal&&e.createModal("load_modal").show(),e.$id("@modal_link_title").on("click",function(){
e.createModal("load_modal").show()}),e.$id("@modal_link").on("click",function(){e.createModal("load_modal").show()})}})},"./app/view/user/setup_.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./w2.dialog.js"),s=i("./shared/events/index.js"),a=!1;t.ChecklistStep=n.extend({onLoad:function(){var e=this,t=e.should_show_x;this.$id("@step_link").click(function(i){i.preventDefault(),a||(a=!0,e._dialog=o.createDialog(e).opt("width",500).opt("left","50%").opt("dialogClass","dialog_nux").opt("showXButton",t).title(e.dialog_title).load("get_step_dialog").close(e.onDialogClose.bind(e)))}),this.handleEvent(s.Types.NUX_DIALOG_STANDALONE_DONE,function(){e._dialog&&e._dialog.close_()})},onDialogClose:function(){a=!1,this.serverCall("mark_dialog_step_complete").send()}}),t.ChecklistLinkStep=n.extend({onLoad:function(){var e=this;this.$id("@step_link").click(function(){e.serverCall("log_link_click").send()})}})},"./app/view/user/subscribe.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./view/modal.js").Base;
t.UserSubscribeLink=n.extend({onLoad:function(){var e=this;e.button=e.$id("@user_subscribe_button"),e.button.click(function(t){e.isSubscribing?e.serverCall("unsubscribe").kwargs({subscribed_uid:e.uid,from_hovercard:e.getDvar("hovermenu_parent")}).liveMutate().send():e.createModal("load_inner").kwargs({should_show_subscribe:e.canSubscribe(),subscribe_to_uid:e.uid}).show(),t.preventDefault()})},canSubscribe:function(){return!this.button.hasClass("unsubscribe_button")}}),t.SubscribeConfirmModal=o.extend({onSubmit:function(){this.serverCall("change_subscription").kwargs({from_hovercard:this.getDvar("hovermenu_parent")}).liveMutate().success(this._closeModal.bind(this)).send()}})},"./app/view/user/topics.js":function(e,t,i){var n=i("./shared/events/index.js"),o=i("./view/modal.js").Base,s=i("./app/view/topic_selector.js").AddTopicSelector,a=i("./app/view/topic/edit_topic_modal.js").EditTopicsList;t.EditKnowsAboutTopicsModal=o.extend({onLoad:function(){this._super.apply(this,arguments),this.topicsChanged=!1;
var e=this;this.handleEvent(n.Types.PROFILE_TOPICS_UPDATED,function(){e.topicsChanged=!0})},_closeModal:function(){this._super.apply(this,arguments),this.topicsChanged&&window.location.reload()}}),t.KnowsAboutTopicsList=a.extend({removeTid:function(){this._super.apply(this,arguments),this.emitEvent({type:n.Types.PROFILE_TOPICS_UPDATED,payload:{}})}}),t.EditKnowsAboutTopicsModalSelector=s.extend({topicWasSelected:function(){this._super.apply(this,arguments),this.emitEvent({type:n.Types.PROFILE_TOPICS_UPDATED,payload:{}})},createTopicWasSelected:function(){this._super.apply(this,arguments),this.emitEvent({type:n.Types.PROFILE_TOPICS_UPDATED,payload:{}})}})},"./app/view/user_settings/notifications.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./gating-webpack.js"),s=i("./unified_view/switch.js").Switch;t.DesktopPushGroupWrapper=n.extend({onLoad:function(){this.maybeLoadInner()},maybeLoadInner:function(){var e=this;"serviceWorker"in window.navigator&&o.desktop_push_notifs&&window.navigator.serviceWorker.ready.then(function(t){
t.pushManager.getSubscription().then(function(t){var i=!!t;e.loadInnerComponent(i)})})},loadInnerComponent:function(e){this.serverCall("fetch_toggled_component").kwargs({is_subscribed:e}).contentFor(this.$id("@desktop_push_group")).send()}}),t.DesktopPushToggle=s.extend({onLoad:function(){this._super.apply(this,arguments)},toggleOff:function(e){var t=this;window.navigator.serviceWorker.ready.then(function(e){e.pushManager.getSubscription().then(function(e){var i=t.getDeviceToken(e.endpoint);e.unsubscribe(),t.serverCall("off").kwargs({device_token:i}).send()})["catch"](function(e){})})},toggleOn:function(e){var t=this;window.navigator.serviceWorker.ready.then(function(e){e.pushManager.subscribe({userVisibleOnly:!0}).then(function(e){var i=t.getDeviceToken(e.endpoint);t.serverCall("on").kwargs({device_token:i}).send()})["catch"](function(e){})})},getDeviceToken:function(e){var t=e.split("/");return t[t.length-1]}})},"./app/view/user_settings/settings.js":function(e,t,i){var n=i("./shared/core/component.js").Component;
t.SettingsRow=n.extend({onLoad:function(){var e=this;this.$id(e.selectorId).on("click",function(){e.optionSelected()})},optionSelected:function(){this.serverCall("settings_toggle").liveMutate().send()}})},"./app/view/user_stats.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./shared/events/index.js"),a=i("./view/hover_menu.js").HoverMenu;t.StatsMain=n.extend({onLoad:function(){this.handleEvent(s.Types.USER_STATS_SHOW,this.show.bind(this));var e=this;this.handleEvent(s.Types.USER_STATS_UPDATE_ATTRIBUTES,function(t){e.updateAttributes(t.payload)})},show:function(){this.$id("@stats_main").removeClass("fade_in")},updateGraph:function(e){e||(e=this.content_type),this.child("graphs_section").updateGraphs(e,this.interval_type,this.oid)},updateContentList:function(){this.serverCall("render_new_content_list_wrapper").args(this.content_type,this.interval_type).contentFor(this.$id("@stats_side")).send()},updateAttributes:function(e){var t=!1,i=!1;
return"oid"in e&&this.oid!=e.oid&&(this.oid=e.oid,t=!0,4===this.content_type)?void this.updateGraph(e.content_type):("interval_type"in e&&(e.interval_type=parseInt(e.interval_type),this.interval_type!=e.interval_type&&(this.interval_type=e.interval_type,t=!0,i=!0)),"content_type"in e&&(e.content_type=parseInt(e.content_type),this.content_type!=e.content_type&&(this.content_type=e.content_type,t=!0,i=!0)),t&&this.updateGraph(),void(i&&this.updateContentList()))}}),t.Filter=a.extend({registerClickHandlers:function(){var e=this;this._super.apply(this,arguments),this.$id("@menu").on("click",".option",function(t){e.updateAttributes(o(t.target).attr("name")),e.$id("@link").text(o(t.target).text()),o(t.target).parent().siblings().removeClass("selected"),o(t.target).parent().addClass("selected"),t.preventDefault()})},updateAttributes:function(){}}),t.FilterIntervalType=t.Filter.extend({updateAttributes:function(e){this.emitEvent({type:s.Types.USER_STATS_UPDATE_ATTRIBUTES,payload:{interval_type:e
}})}}),t.FilterContentType=t.Filter.extend({updateAttributes:function(e){this.emitEvent({type:s.Types.USER_STATS_UPDATE_ATTRIBUTES,payload:{content_type:e}})}}),t.TabbedStatsNavController=n.extend({onLoad:function(){var e=this;o(".tabbed_nav_wrapper .content_type_tab").click(function(t){t.preventDefault();var i=o(this).attr("id");o(".tabbed_nav_wrapper .content_type_tab").removeClass("active"),o(this).addClass("active"),o("#"+i).addClass("active"),e.emitEvent({type:s.Types.USER_STATS_UPDATE_ATTRIBUTES,payload:{content_type:i}})})}}),t.ContentListWrapper=n.extend({onLoad:function(){var e=this.$id("@content_list_wrapper"),t=e.outerHeight(),i=o(window).height(),n=e.offset().top,a=i-n-32;a>t&&e.css("height",a),this.emitEvent({type:s.Types.USER_STATS_SHOW,payload:{}})}}),t.ContentListItem=n.extend({onLoad:function(){var e=this;this.$id("@content_external_link").click(function(e){e.stopPropagation()}),this.$id("@link").click(function(){e.$id("@link").hasClass("is_active")||(o(".is_active").removeClass("is_active"),
e.$id("@link").addClass("is_active")),o(".StatsMain").hasClass("full_width_stats")&&o("html, body").animate({scrollTop:0},1e3),e.emitEvent({type:s.Types.USER_STATS_UPDATE_ATTRIBUTES,payload:{oid:e.oid,content_type:e.content_type}})}),o(".StatsMain").hasClass("full_width_stats")&&o(".ContentListWrapper").click(function(){o(".ContentListItem.PagedListItem").hasClass("is_active")?o(".ContentListWrapper").addClass("selected_item"):o(".ContentListWrapper").removeClass("selected_item")})}}),t.RSGraph=n.extend({onLoad:function(){var e=this,t=new Rickshaw.Color.Palette({scheme:this.colors}),i=this.getHeight(),n=this.width;for(var s in this.data_json)this.data_json[s].color=t.color();o(".StatsMain").hasClass("full_width_stats")&&(i=300,n=960);var a=new Rickshaw.Graph({element:this.$id("@rsgraph").get(0),series:this.data_json,width:n,height:i,renderer:"bar",stroke:!0,min:this.min,max:this.max,xmin:this.xmin,xmax:this.xmax,interpolation:"step-after",nearestPoint:!1});a.render();var r=new Rickshaw.Graph.Axis.Y({
graph:a,tickFormat:this.ypercent?function(e){return(100*e).toFixed(1)+"%"}:null});o(".StatsMain").hasClass("full_width_stats")&&(r=new Rickshaw.Graph.Axis.Y({graph:a,element:this.$id("@y_axis").get(0)})),r.render();var d=new Rickshaw.Graph.Axis.Time({graph:a});d.render();new Rickshaw.Graph.HoverDetail({graph:a,formatter:function(t,i,n){return e.hover_text+": "+n}})},getHeight:function(){var e=o(window).height(),t=o(".graphs").offset().top,i=e-t-32;return i>this.height?i:this.height}}),t.Graphs=n.extend({onLoad:function(){var e=this,t=window.location.hash;this.metrics.forEach(function(t){e.child("headsup_section").$id("@"+t).click(function(i){var n=o(i.target);return n.hasClass("heads_up_item")||(n=n.parents(".heads_up_item")),n.hasClass("is_active")||(n.siblings(".is_active").removeClass("is_active"),n.addClass("is_active")),e.active_metric!=t&&(o(".stats_graph").addClass("hidden"),e.child("stats_graphs").$id("@graph_"+t).removeClass("hidden"),e.active_metric=t),i.preventDefault(),!1})}),
this.metrics.forEach(function(i){"#"+i==t&&e.child("headsup_section").$id("@"+i).click()})},updateGraphs:function(e,t,i){var n=this;o(".heads_up_item").first().addClass("is_active"),this.serverCall("render_new_graphs").args(e,t,i).contentFor(this.$id("@graphs"),{useLoadingSpinner:!1}).send(),this.serverCall("get_new_counts").args(e,t,i).success(function(e){e.forEach(function(e){null===e[1]?n.child("headsup_section").$id("@"+e[0]).addClass("hidden"):(n.child("headsup_section").$id("@"+e[0]).removeClass("hidden"),n.child("headsup_section").$id("@"+e[0]+">.big_num").text(e[1]),n.child("headsup_section").$id("@"+e[0]+">.num_label").text(e[2])),o(".heads_up_item").first().addClass("is_active")})}).send()}})},"./app/view/vc.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./w2.dialog.js"),a=i("./settings-webpack.js").interface_strings;t.RevertDialog=n.extend({onLoad:function(){this.shortcutKeyListener(),this.radioChangeListener()},radioChangeListener:function(){
o("input:radio").change(function(){o("input:radio").each(function(){o(this).prop("checked")&&o(".content").html(o(this).val())})})},shortcutKeyListener:function(){o(document).keypress(function(e){(49==e.which||50==e.which||51==e.which||52==e.which)&&(49==e.which?o("#spam").prop("checked",!0):50==e.which?o("#tos").prop("checked",!0):51==e.which?o("#vandalism").prop("checked",!0):52==e.which&&o("#other").prop("checked",!0),o("input:radio").each(function(){o(this).prop("checked")&&o(".content").html(o(this).val())}))})},validateReason:function(){return!0}}),t.OperationRevert=n.extend({onLoad:function(){var e=this;e.$id("@operation_revert").click(function(){return s.createDialog(e).title(e.dialog_title).ok(function(t){var i=t.dialogComponent.child("editor");e.serverCall("revert_revision").kwargs(e.getKwargs(i)).liveMutate().send()},e.ok_text).cancel(null,a.cancel).load("revert_dialog"),!1})},getKwargs:function(e){return{oid:this.oid,comment:e.serialize()}}}),t.AddQuestionRedirectRevertLink=n.extend({
onLoad:function(){var e=this;e.$id("@revert").click(function(t){t.preventDefault(),s.createDialog(e).title(e.dialog_title).ok(function(t){var i=t.dialogComponent.child("editor");e.serverCall("revert").kwargs({to_qid:e.to_qid,from_qid:e.from_qid,comment:i.serialize()}).liveMutate().send()},e.ok_text).cancel(null,a.cancel).load("revert_dialog")})}})},"./app/view/write.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./view/fixable2.js"),s=i("./view/modal.js").Base,a=i("./shared/window_manager.js");t.WriteMain=n.extend({onLoad:function(){var e=this,t=this.$id("@left_col_inner"),i=this.$id("@left_col");e.notifBanner||i.length>0&&t.length>0&&o.makeFixable(t,{min_height:i.outerHeight()+i.offset().top,min_width:990})}}),t.RemoveAllDraftsLink=n.extend({onLoad:function(){var e=this;this.$id("@confirmation_dialogue").on("click",function(t){return e.createModal("load_inner").show(),!1})}}),t.WritePageBatchActionConfirmationModal=s.extend({onSubmit:function(){this.removeAll();
},removeAll:function(){var e=this;this.serverCall("remove_all").liveMutate().success(function(t){e._closeModal(),a.reload()}).send()}})},"./app/view/zapdos/card.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.CardBase=n.extend({onLoad:function(){var e=this;this.handleEvent(o.Types.ZAPDOS_INLINE_DISMISS,function(t){t.payload.cardType==e.cardType&&e.$id(e.id_).addClass("hidden")})}}),t.CardButton=n.extend({onLoad:function(){var e=this;e.$id("@card-button-link").click(e.onClick.bind(e))},onClick:function(e){e.preventDefault();var t=this;return t.redirectUrl&&(window.location.href=t.redirectUrl),t.serverCall("click").send(),!1}}),t.DismissCardButton=t.CardButton.extend({onClick:function(e){var t=this;return t.emitEvent({type:o.Types.ZAPDOS_INLINE_DISMISS,payload:{cardType:t.cardType}}),t._super.apply(t,arguments)}})},"./facebook.js":function(e,t,i){function n(e,t,i){FB.login(function(n){if("connected"==n.status){var o=n.authResponse;e&&o.userID!=e?i(o.userID):t(o.userID,o.accessToken,o.expiresIn);
}},{scope:"publish_actions"})}var o=i("./shared/facebook.js"),s=i("./shared/core/component.js").Component,a=i("./shared/events/index.js");t.maybePromptToPublish=function(e,t,i){if(!o.isLoaded())return o.asyncUpdatePermissions(),!1;var s=null;return FB.getAuthResponse()&&(s=FB.getAuthResponse().userID),s&&e?s==e?o.hasPermission("publish_actions")?t():n(e,t):i(s):n(e,t,i),!1};var r=s.extend({onLoad:function(){o.load(),this.$id("@facebook_connect_button").on("click",this.onClickFacebookConnectButton.bind(this))},connect:function(){var e=this;FB.login(function(t){t&&"connected"==t.status?e.onLogin(t.authResponse):e.onLoginFailed()},{scope:this.perms})},onClick:function(){},onLogin:function(e){},onLoginFailed:function(){},onClickFacebookConnectButton:function(){return o.isLoaded()&&(this.connect(),this.onClick()),!1}});t.FacebookConnectButton=r.extend({onLogin:function(e){this._onLogin(e)},_onLogin:function(e){this.serverCall("connect_facebook").kwargs({fb_access_token:e.accessToken,fb_uid:e.userID,
expires:e.expiresIn}).liveMutate().send()}}),t.FacebookConnectButtonZapdos=t.FacebookConnectButton.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.$id("@facebook_connect_button").on("click",function(){e.dismissWall()})},dismissWall:function(){var e=this;e.emitEvent({type:a.Types.ZAPDOS_WALL_DISMISS,payload:{cardType:e.card_type}})}})},"./gating-webpack.js":function(e,t){e.exports=window.Q.gating},"./init.js":function(e,t,i){var n=i("./shared/log.js").log,o=i("./shared/window_manager.js"),s=i("./shared/onload.js"),a=i("./shared/events/index.js"),r=i("./visibility.js"),d=i("./shared/jquery.js");window.console=window.console||n.console;var l=function(){var e=r.getFrameElement();if(e&&"true"===e.getAttribute("autoresize")){var t=d(document),i=t.width(),n=t.height();d(e).width(i).height(n)}};window.addEventListener("resize",l),d(document).ready(l),i("./qtext.js").init(),a.GlobalProxy.subscribe(a.Types.LOGOUT_USER,function(){o.reload()}),s.execAfterLoadDelayed(function(){
d(document).on("fire_facebook_conversion_pixel",function(e,t){var i=new Image(1,1);i.src="https://www.facebook.com/offsite_event.php?id="+t+"&amp;value=0.01&amp;currency=USD"})})},"./input_validate.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js");t.InputValidator=n.extend({init:function(){this._super.apply(this,arguments),this.isValid=null},onLoad:function(){var e,t=this.input(),i=this;t.on("change blur",function(){var n=t.val();n!==e&&(e=n,i.validate())}),this._managerComponent().__validators=this._managerComponent().__validators||[],this._managerComponent().__validators.push(this)},input:function(){return this.parent().$id(this.id)},_managerComponent:function(){return this.parent()},validate:function(e){var t=this;e=e||{};var i=this.input().val();if(i){this.hideAllErrors();var n={value:this.input().val()},o=this.additional_kwargs();for(var s in o)n[s]=o[s];this.serverCall("validate").kwargs(n).success(function(i){t.hideAllErrors(),i.valid?(t.isValid=!0,
t.hideAllErrors(),t.input().removeClass("error"),"function"==typeof e.valid&&e.valid(i.message)):(t.isValid=!1,i.message&&(t.setWidth(t.$id("@invalid_message")),t.$id("@invalid_message").text(i.message),t.invalidMessage=i.message),t.hideAllErrors(),t.showErrorOnComponent("@validator .invalid"),"function"==typeof e.invalid&&e.invalid(i.message))}).send()}else this.hideAllErrors(),this.isValid=null},additional_kwargs:function(){return{}},populate_if_valid:function(e,t){var i=this;this.serverCall("validate").kwargs({value:e}).success(function(n){n.valid&&(i.isValid=!0,t.val(e))}).send()},setWidth:function(e){var t=parseInt(this.input().width())-4;t>0&&e.css("width",t+"px")},hideAllErrors:function(){this.$id("@validator .invalid").hide(),this.$id("@validator .valid").hide(),this.input().removeClass("input_validation_error"),o("textarea").removeClass("input_validation_error")},showErrorOnComponent:function(e){this.$id(e).show(),this.input().addClass("input_validation_error"),o("textarea").addClass("input_validation_error");
}}),t.InputValidator.validate=function(e,t){t=t||{},e.__validators&&e.__validators.length?e.__validators[0].validate(t):"function"==typeof t.valid&&t.valid()}},"./interface/settings.js":function(e,t,i){var n=i("./settings-webpack.js");t.action=n.action,t.batchedServerCallUrl=n.batchedServerCallUrl,t.clientTrackerTrail=n.clientTrackerTrail,t.componentInspector=n.componentInspector,t.controller=n.controller,t.debug=n.debug,t.enableClientTracker=n.enableClientTracker,t.enableFrameBusting=n.enableFrameBusting,t.interface_strings=n.interface_strings,t.isLoggedIn=n.isLoggedIn,t.logComponentTime=n.logComponentTime,t.serverCallUrl=n.serverCallUrl,t.windowId=n.windowId},"./login.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./shared/errors.js"),s=i("./shared/events/index.js"),a=i("./shared/core/component.js").Component,r=i("./shared/window_manager.js"),d=i("./shared/siteuri.js").URI,l=i("./settings-webpack.js"),c=i("./unified_view/signup/_signup.js").SignupContext,u=i("./view/modal.js").Base;
t.LoginButton=a.extend({onLoad:function(){this.$id("@login_link").click(function(e){var t=d("/?next="+encodeURIComponent(r.getURL()));return r.navigateTo(t.unicode()),!1})}});var h=t.InlineLogin=a.extend({onLoad:function(){var e=this;e.checkingPassword=!1,e.hasLoggedIn=!1;var t=function(t){var i=t.keyCode||t.which;13==i&&e.$id("@submit_button").click()},i=t.bind(e);e.$id("@password").keydown(i),e.$id("@email").keydown(i),e.$id("@resend_confirmation").click(function(t){return e.serverCall("resend_confirmation_link").kwargs({email:e._email()}).success(function(){e.hideAllErrors()}).send(),!1}),e.$id("@reset_password_link").click(e.resetPasswordHandler.bind(this)),e.$id("@forgot_password_link").click(e.resetPasswordHandler.bind(this)),e.$id("@email").on("input",function(){setTimeout(function(){e.updatePreview()},10)}),e.$id("@submit_button").click(function(){return e.checkPassword(),!1}),e.$id("@submit_button").on("touchend",function(){return e.checkPassword(),!1}),e.$id("@login_link").click(function(){
return e.$id("@associated").addClass("hidden"),e.$id("@alt_login_row").addClass("hidden"),e.$id("@login_form").removeClass("hidden"),e.$id("@email").focus(),!1}),this.handleEvent(s.Types.LOGIN_UPDATE_FIELDS,function(t){e.$id("@email").val(t.payload.email),e.updatePreview(),e.$id("@password").focus()});var o=this.getContext(c);o&&this.$id("@email_not_found_error a").click(function(){var e={email:this.$id("@email").val(),password:this.$id("@password").val()};return o.set("loginData",e),!1}.bind(this)),n(document).ready(function(){e.updatePreview()})},resetPasswordHandler:function(){var e=this;return e.serverCall("reset_password").kwargs({email:e._email()}).success(function(){e.hideAllErrors()}).send(),!1},updatePreview:function(){this._updatePreviewMemCache=this._updatePreviewMemCache||{};var e=this,t=e._email(),i=e._updatePreviewMemCache,o=function(o){i[t]=o,e.customSuccessUpdatePreviewCallback?(e.customSuccessUpdatePreviewCallback(o),e.removeButtonDisabled()):(n(".usercard_big").fadeTo(1,1),
e.$id("@preview").hide(),e.$id("@associated").addClass("hidden"),e.$id("@alt_login_row").addClass("hidden"),e.$id("@login_form").removeClass("hidden"),e.$id("@password").focus(),e.$id("@name").text(o.name),e.$id("@pic").attr("src",o.photo_url),e.$id("@preview").show(),e.removeButtonDisabled(),e.hideAllErrors())};return i[t]?void o(i[t]):void e.serverCall("preview_info").kwargs({email:t}).success(o).except("email_not_found",function(t){return e.$id("@preview").fadeOut(120),e.hideAllErrors(),e.showErrorOnComponent("@email_not_found_error","@email"),e.addButtonDisabled(),!1}).except("no_email",function(t){e.$id("@preview").fadeOut(120),e.hideAllErrors(),e.addButtonDisabled()}).except("email_unconfirmed",function(t){e.$id("@preview").fadeOut(120),e.hideAllErrors(),e.showErrorOnComponent("@email_not_confirmed_error","@email"),e.removeButtonDisabled()}).except("refused",function(t){e.$id("@preview").fadeOut(120),e.hideAllErrors(),e.removeButtonDisabled()}).send()},removeButtonDisabled:function(){
this.$id("@submit_button").removeClass("submit_button_disabled")},addButtonDisabled:function(){this.$id("@submit_button").addClass("submit_button_disabled")},loginKwargs:function(){var e=this.$id("@email").val(),t=this.$id("@password").val();return{email:e,password:t}},loginSuccessCallback:function(e){if(this.customSuccessLoginCallback)this.customSuccessLoginCallback(e);else{var t=e;this.hideAllErrors(),(l.uid==t||"post_reload"==l.pageMode)&&this.emitEvent(s.helpers.loginUser()),this.serverCall("finish_add_question").success(function(e){e&&r.navigateTo(e)}).send()}var i=this;i.addButtonDisabled()},checkPassword:function(){this.hideAllErrors();var e=this;e.hasLoggedIn||e.checkingPassword||(e.checkingPassword=!0,e.serverCall("do_login").kwargs(e.loginKwargs()).success(function(t){e.hasLoggedIn=!0,e.checkingPassword=!1,e.loginSuccessCallback(t)}).except("email_not_found",function(){e.checkingPassword=!1,e.hideAllErrors(),e.showErrorOnComponent("@email_not_found_error","@email")}).except("incorrect_password",function(){
e.checkingPassword=!1,e.hideAllErrors(),e.showErrorOnComponent("@incorrect_password_error","@password")}).except("email_unconfirmed",function(){e.checkingPassword=!1,e.hideAllErrors(),e.showErrorOnComponent("@email_not_confirmed_error","@email")}).except("banned_user",function(){e.checkingPassword=!1,e.hideAllErrors(),e.serverCall("login_user_is_banned").kwargs(e.loginKwargs()).send()}).except("too_many_attempts",function(){e.checkingPassword=!1,e.hideAllErrors(),e.serverCall("login_user_rate_limited").kwargs(e.loginKwargs()).send()}).except("password_leaked",function(){e.checkingPassword=!1,e.serverCall("load_password_leaked_dialog").kwargs({email:e._email()}).contentFor(e.$id("@email_password_leak_error")).success(function(){e.hideAllErrors(),e.$id("@login_form .login_options").hide(),e.$id("@email_password_leak_error").show()}).send()}).except("two_factor_authentication",function(){e.checkingPassword=!1,e.hideAllErrors(),e.createModal("login_user_two_factor_authentication").kwargs({email:e._email()
}).show()}).sendOnlyOnce())},_email:function(){return this.$id("@email").val()},hideAllErrors:function(){this.$id("@email_not_found_error").addClass("hidden"),this.$id("@email_not_confirmed_error").addClass("hidden"),this.$id("@incorrect_password_error").addClass("hidden"),this.$id("@email_password_leak_error").addClass("hidden"),this.$id("@email").removeClass("input_validation_error"),this.$id("@password").removeClass("input_validation_error")},showErrorOnComponent:function(e,t){this.$id(e).removeClass("hidden"),this.$id(t+"_menu").removeClass("hidden"),this.$id(t).addClass("input_validation_error")}});t.VerifyUser2FAModal=u.extend({onLoad:function(){this._super.apply(this,arguments)},onSubmit:function(){var e=this;e._closeModal()}}),t.LoginSignal=a.extend({onLoad:function(e){if(!e){var t=this.uid;l.isLoggedIn&&o.logJsError("Got a login signal for logged in user: "+t),t?this.emitEvent(s.helpers.loginUser()):this.emitEvent(s.helpers.logoutUser())}}});var p=t.LoggedOutHomeLogin=h.extend({
onLoad:function(){this._super.apply(this,arguments),this.$id("@email").focus(),this.$id("@cancel_link").on("click",this.toggleLoginOptions.bind(this))},hideAllErrors:function(){this._super.apply(this,arguments),this.$id("@login_form .login_options").show()},showErrorOnComponent:function(e,t){this._super.apply(this,arguments),this.$id("@login_form .login_options").hide()},toggleLoginOptions:function(){return this.$id("@login_form").hide(),!0}});t.OAuthLogin=p.extend({customSuccessLoginCallback:function(e){this.hideAllErrors(),this.serverCall("get_permissions_page_response").success(function(e){window.location=e.next_url}).send()}}),t.LoginPageLoginListener=a.extend({init:function(){this._super.apply(this,arguments),this._enabled=!0},onLoad:function(){var e=this;this.handleEvent(s.Types.LOGIN_USER,function(t){var i={};if(t.payload.pmsg&&(i.__pmsg__=t.payload.pmsg),e._enabled){var n,o=e.next,s=[];for(n in i)s.push(n+"="+encodeURIComponent(i[n]));s.length>0&&(o+=-1==o.indexOf("?")?"?":"&",o+=s.join("&")),
r.navigateTo(o)}})}}),t.LeakedPasswordMessage=a.extend({onLoad:function(){var e=this;this.$id("@reset_password_link").click(function(){e.serverCall("reset_password").kwargs({email:e.email}).send()})}})},"./main.js":function(e,t,i){i("./third_party/json2.js"),i("./shared/log.js"),i("./shared/beforeunload.js"),i("./w2.errors.js"),i("./init.js"),i("./shared/init.js"),window.log&&window.log.enabled&&window.log("main","main is loaded."),i("./shared/w2.timing.js").logTime("mainScriptEnd")},"./qtext.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./tooltip.js");t.init=function(){n(document).on("mouseover","a[data-qt-tooltip]",function(e){var t=n(this);return t.attr("data-tooltip")?!1:(t.attr("data-tooltip","attached"),o.attach(t,t.attr("data-qt-tooltip"),{attach_to_body:!0}),setTimeout(function(){t.trigger("mouseenter")},10),!1)})}},"./qtext2.js":function(e,t,i){var n=i("./unified_view/qtext2/editor/mobile.js"),o=i("./unified_view/qtext2/toolbar.js");t.handleToolbarAction=function(e,t){
o.activeToolbar&&o.activeToolbar.trigger(e,t)},t.handleRestoreState=function(e){n.activeEditor.restoreState(e)},t.saveDraft=function(){n.activeEditor.saveDraft()},t.clearDraft=function(){n.activeEditor.clearDraft()},t.focus=function(){n.activeEditor.focus()}},"./qtext2/extension/base.js":function(e,t,i){var n=i("./shared/Class.js").Class;t.Extension=n.extend({__init__:function(e){this.doc=e},install:function(){throw new Error("Sub-classes should implement this method.")},destroy:function(){}})},"./qtext2/extension/link_interaction.js":function(e,t,i){var n=i("./qtext2/extension/base.js").Extension,o=i("./gating-webpack.js"),s=t.linkInteractionEnabled=function(){return o.qtext2_link_interaction};t.LinkInteraction=n.extend({install:function(){s()&&(this._activeLinkSpan=null,this.doc.on("caretMoved",this.onCaretMoved.bind(this)))},onCaretMoved:function(){this._maybeSwitchToolbar()},_maybeSwitchToolbar:function(){this._shouldSwitchToolbar()?this._switchToolbar():this._activeLinkSpan&&this._switchBackToolbar();
},_shouldSwitchToolbar:function(){var e=this.doc.caret.start.span;return this.doc.caret.isCollapsed()&&(e.hasModifier("link")||e.hasModifier("citation"))},_switchToolbar:function(){var e,t=this.doc.caret.start.span;t.hasModifier("link")?e=t.getModifier("link"):t.hasModifier("citation")&&(e=t.getModifier("citation").target),e&&e.url&&this._activeLinkSpan!==t&&(this._activeLinkSpan=t,this.doc.setLinkInputFocus(!1),this.doc.handleCommand("link"))},_switchBackToolbar:function(){this.doc.trigger("focus"),this.doc.setLinkInputFocus(!0),this._activeLinkSpan=null}})},"./qtext2/keys.js":function(e,t,i){var n=i("./shared/Class.js").Class,o=t.isMac=/Mac/.test(window.navigator.platform),s={8:"BACKSPACE",9:"TAB",13:"RETURN",27:"ESCAPE",35:"END",36:"HOME",37:"LEFT",38:"UP",39:"RIGHT",40:"DOWN",46:"DELETE",106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a=function(e){return-1!=[35,36,37,38,39,40].indexOf(e.which)},r=function(e){
return e.shiftKey&&16==e.which},d=n.extend({__init__:function(e){e=e.toUpperCase(),this.alt=/ALT-/.test(e),this.ctrl=/CTRL-/.test(e)||!o&&/CMD-/.test(e),this.meta=/META-/.test(e)||o&&/CMD-/.test(e),this.shift=/SHIFT-/.test(e),this.character=e.split("-").pop()},toString:function(){var e="";return this.alt&&(e+="ALT-"),this.ctrl&&(e+="CTRL-"),this.meta&&(e+="META-"),this.shift&&(e+="SHIFT-"),e+=this.character}}),l=function(e){var t=s[e.which]||String.fromCharCode(e.which).toUpperCase(),i="";return e.altKey&&(i+="ALT-"),e.ctrlKey&&(i+="CTRL-"),e.metaKey&&(i+="META-"),e.shiftKey&&(i+="SHIFT-"),i+=t},c=n.extend({__init__:function(){this._handlers=[]},on:function(e,t){var i=new d(e);if(i in this._handlers)throw new Error("Already attached handler for "+i);this._handlers[i]=t},trigger:function(e){var t=l(e),i=this._handlers[t];return i?i(e):!0}});t.getShortcutHint=function(e){var t=new d(e),i="";return o?(t.meta&&(i+="&#x2318;"),t.ctrl&&(i+="^"),t.alt&&(i+="&#x2325;"),t.shift&&(i+="&#x21E7;")):(t.ctrl&&(i+="Ctrl-"),
t.alt&&(i+="Alt-"),t.shift&&(i+="Shift-")),i+t.character[0]+t.character.slice(1).toLowerCase()},t.isNavigation=a,t.isOnlyShiftKey=r,t.Hub=c,t.SPECIAL_KEYS=s},"./qtext2/quirks.js":function(e,t,i){var n=i("./shared/browser.js"),o={usesCompositionEvents:function(){return n.gecko||n.webkit&&n.webkitVersion>532},dragEventContainsFile:function(e){var t=e.dataTransfer;return t?t.files&&t.files.length>0?!0:t.types?t.types.indexOf&&-1!=t.types.indexOf("Files")?!0:t.types.contains&&t.types.contains("application/x-moz-file")?!0:!1:!1:!1},insertsPeriodWithDoubleSpace:function(){return n.ios}};t.Quirks=o},"./qtext2/shortcuts.js":function(e,t,i){var n=i("./qtext2/keys.js"),o=i("./shared/util.js").extend,s={Backspace:"backspace",Delete:"delete",Return:"return","Alt-Return":"return","Ctrl-Return":"return","Shift-Return":"soft-return"," ":"space",Tab:"indent","Shift-Tab":"deindent","Cmd-B":"bold","Cmd-I":"italic","Cmd-U":"underline","Cmd-K":"link","Cmd-Shift-7":"ordered_list","Cmd-Shift-8":"unordered_list",
"Cmd-Shift-9":"quote","Cmd-Shift-K":"code","Cmd-Shift-L":"math","Cmd-Z":"undo","Cmd-Shift-Z":"redo"};n.isMac?o(s,{"Ctrl-H":"backspace","Ctrl-D":"delete","Ctrl-K":"delete-forward","Cmd-Backspace":"delete-backward","Ctrl-T":"transpose","Ctrl-Backspace":"backspace","Ctrl-Delete":"delete","Shift-Backspace":"backspace","Shift-Delete":"delete","Alt-Backspace":"delete-previous-word","Alt-Delete":"delete-next-word","Ctrl-U":"underline"}):o(s,{"Ctrl-Backspace":"delete-previous-word","Ctrl-Delete":"delete-next-word","Shift-Backspace":"backspace","Shift-Delete":"delete","Alt-Backspace":"backspace","Alt-Delete":"delete"}),t.SHORTCUTS=s},"./qtext2/tooltip.js":function(e,t,i){var n,o,s=null,a=i("./shared/jquery.js"),r=function(){n||(n=a("<div>").addClass("qtext2_tooltip"),a(document.body).append(n),o=a("<div>"),n.append(o))};t.show=function(e,t){r(),e=a(e);var i=e.offset(),d=i.left+.5*e.width();o.html(t),i.top<30?n.css("top",e.height()+20):n.css("top",i.top-30),n.css("left",Math.max(0,d-.5*n.width())),
n.removeClass("hidden"),clearTimeout(s),s=setTimeout(function(){n.addClass("visible")},500)},t.hide=function(){n&&(clearTimeout(s),s=setTimeout(function(){n.removeClass("visible"),n.addClass("hidden")},100))}},"./qtext2/ui.js":function(e,t,i){var n=i("./shared/Class.js").Class,o=i("./qtext2/util.js").Util,s=i("./shared/log.js").log,a=i("./qtext2/quirks.js").Quirks,r=i("./qtext2/extension/link_interaction.js").linkInteractionEnabled,d=i("./shared/upload.js");s=s.bind(s,"qtext2"),t.LinkSelector=n.extend({__init__:function(e){this.editor=e,this.toolbar=e.toolbar,this.active=!1,this.key="",this._onSubmitCallback=null,this._onCancelCallback=null},isActive:function(){return this.active},show:function(){throw new Error("NotImplemented: Subclasses should override")},hide:function(){this.active=!1,this.key=""},submit:function(){throw new Error("NotImplemented: Subclasses should override")},cancel:function(){throw new Error("NotImplemented: Subclasses should override")},onSubmit:function(e){this._onSubmitCallback=e;
},onCancel:function(e){this._onCancelCallback=e},getExternalURL:function(e,t,i){this.toolbar&&(this.toolbar.on("linkInput",e),this.toolbar.showBar(0),r()&&this.toolbar.setLinkToolbarStatus(t,i))},getLinkPreview:function(e,t,i){this.editor.serverCall("get_link_preview").kwargs({url:e}).success(t).error(i).send()}}),t.ImageUploader=n.extend({__init__:function(e,t,i,n,o){this.editor=e,this.doc=t,this.$dropZone=i,this.$fileInput=n,this.interface_strings=o,this._dragStartedInDoc=!1,this.initEventHandlers()},_debugEvent:function(e,t){s("dropzone",e,t)},initEventHandlers:function(){o.on("dragenter",this.doc.node,this.onDragEnter.bind(this)),o.on("dragstart",this.doc.node,this.onDragStart.bind(this)),o.on("dragend",this.doc.node,this.onDragEnd.bind(this)),o.on("paste",this.doc.node,this.onPaste.bind(this)),o.on("drop",this.doc.node,this.onDropInDoc.bind(this)),o.on("dragleave",this.$dropZone,this.onDragLeave.bind(this)),o.on("dragover",this.$dropZone,this.onDragOver.bind(this)),o.on("click",this.$dropZone,this.onClick.bind(this)),
o.on("drop",this.$dropZone,this.onDrop.bind(this)),o.on("change",this.$fileInput,this.onChange.bind(this))},onDragEnter:function(e){this._debugEvent("dragenter",e),a.dragEventContainsFile(e)&&(this._dragStartedInDoc||this.showDropZone())},onDragStart:function(e){this._debugEvent("dragstart",e),this._dragStartedInDoc=!0},onDragEnd:function(e){this._debugEvent("dragend",e),this._dragStartedInDoc=!1},onDropInDoc:function(e){this._debugEvent("drop (in doc)",e),this._dragStartedInDoc=!1},onDragLeave:function(e){this._debugEvent("dragleave",e),this.hideDropZone()},onDragOver:function(e){this._debugEvent("dragover",e),e.preventDefault()},onClick:function(e){this._debugEvent("click",e),this.hideDropZone()},onDrop:function(e){return this._debugEvent("drop",e),e.preventDefault(),e.stopPropagation(),e.dataTransfer?void this.startUpload(e.dataTransfer.files):void this.hideDropZone()},onChange:function(e){this._debugEvent("change",e),this.startUpload(this.$fileInput.files),this.$fileInput.value=null;
},onPaste:function(e){this._debugEvent("paste",e);var t=e.clipboardData,i=[];if(!t||!t.items)return!1;for(var n=0;n<t.items.length;++n){var o=t.items[n].type;(o.match(/image/i)||o.match(/file/i))&&i.push(t.items[n].getAsFile())}return this.startUpload(i),!1},showDropZone:function(){this.$dropZone.innerHTML=this.interface_strings.drop_images,this.$dropZone.classList.remove("hidden"),this.$dropZone.style.lineHeight=this.doc.node.clientHeight+"px",this.$dropZone.style.top=this.doc.node.offsetTop+"px"},hideDropZone:function(){this.$dropZone.classList.remove("uploading"),this.$dropZone.classList.add("hidden")},showUploading:function(e){this.showDropZone(),e>1?this.$dropZone.innerHTML=this.interface_strings.uploading_images.replace("{}",e):this.$dropZone.innerHTML=this.interface_strings.uploading_image},_onUpload:function(e){this.doc.insertImages(e.qimg_urls,{source:"upload"}),this.hideDropZone()},_onError:function(e){e&&e.message?alert(e.message):alert(this.interface_strings.upload_error),this.hideDropZone();
},startUpload:function(e){return 0===e.length?void this.hideDropZone():(this.showUploading(e.length),void d.uploadData({kind:"qtext"},e,this._onUpload.bind(this),this._onError.bind(this)))},uploadImageUrl:function(e,t){this.editor.serverCall("upload_image_url").kwargs({url:e}).success(t).error(this._onError.bind(this,null)).send()}}),t.PhotoSearch=n.extend({__init__:function(e,t,i,n){this.$searchComponent=t,this.$wrapper=i,this.$searchComponent.setSelectCallback(this.submit.bind(this)),this.$searchComponent.setUploadCallback(this.hide.bind(this)),this.$searchComponent.setUploader(n),this.active=!1},isActive:function(){return this.active},fixPosition:function(){var e=this.$wrapper,t=this.$wrapper.parent(),i=6,n=function(){var o=t.find(".editor_toolbar"),s=t.offset().left+t.width()-e.width();"fixed"===o.css("position")?e.css("position","fixed").css("left",s).css("right","auto"):e.css("position","absolute").css("left","auto").css("right",0),e.css("top",parseInt(o.css("top"))+o.height()+i),
window.requestAnimationFrame(n)};n()},show:function(){var e=this;e.fixPosition(),e.$wrapper.addClass("animate_in"),setTimeout(function(){e.$wrapper.removeClass("animate_in"),e.$wrapper.addClass("is_shown")},200),e.$searchComponent.makeActive(),e.active=!0},hide:function(){var e=this;e.active=!1,e.$wrapper.addClass("animate_out"),setTimeout(function(){e.$wrapper.removeClass("is_shown"),e.$wrapper.removeClass("animate_out")},200)},toggle:function(){this.active?this.hide():this.show()},submit:function(e){this._onInsertCallback&&this._onInsertCallback(e)},cancel:function(){return this._onCancelCallback?(this._onCancelCallback(),!1):void 0},onInsert:function(e){this._onInsertCallback=e},onCancel:function(e){this._onCancelCallback=e}})},"./qtext2/util.js":function(e,t,i){var n=i("./shared/email.js").isValidEmail,o=i("./shared/jquery.js"),s=i("./shared/log.js").log,a=["keydown","keyup","keypress"],r=i("./shared/linkify.js"),d=/^https?\:\/\//,l=i("./shared/util.js");s.warn=s.warn.bind(s,"qtext2");
var c={assert:function(e){if(!e){var t=Array.prototype.slice.call(arguments,1);throw new Error(t)}},create:function(e){return document.createElement(e)},objectIntersection:function(e,t){for(var i=Object.keys(e),n={},o=0;o<i.length;o++){var s=i[o];c.jsonEqual(e[s],t[s])&&(n[s]=e[s])}return n},removeNullValues:function(e){for(var t,i=Object.keys(e),n=0;n<i.length;n++)if(t=i[n],null===e[t])delete e[t];else if("[object Object]"===Object.prototype.toString.call(e[t]))c.removeNullValues(e[t]);else if("[object Array]"===Object.prototype.toString.call(e[t]))for(var o=0;o<e[t].length;o++)c.removeNullValues(e[t][o]);return e},getData:function(e,t){return e.getAttribute("data-"+t)},setData:function(e,t,i){e.setAttribute("data-"+t,i)},removeData:function(e,t){e.removeAttribute("data-"+t)},isTextNode:function(e){return e&&3==e.nodeType},safeRemoveChild:function(e,t){e?e.parentNode?e.parentNode!=t?s.warn("Tried to remove node from non parent",e,t):t.removeChild(e):s.warn("Node already detached from parent.",e):s.warn("Node is undefined.");
},on:function(e,t,i){e=e instanceof Array?e:[e],e.forEach(function(e){t.addEventListener(e,function(t){var n;return-1!=a.indexOf(e)&&(t.which=void 0!==t.charCode?t.charCode:t.keyCode),n=i(t,e),n===!1&&(t.preventDefault(),t.stopPropagation()),n})})},ensureProtocol:function(e){return n(e)?e:(d.test(e)||(e="http://"+e),e)},splitLines:function(e){return e.split(/\n|\r\n?/)},splitByRegex:function(e,t){for(var i,n=[];e;)i=e.match(t),i?(i.index&&n.push({text:e.slice(0,i.index)}),n.push({text:i[0],match:i}),e=e.slice(i.index+i[0].length)):(n.push({text:e}),e="");return n},jsonEqual:function(e,t){var i,n;if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t)return e===t;if(null===e||void 0===e||null===t||void 0===t)return!1;if(typeof e!=typeof t)return!1;if(e instanceof Array){if(e.length!==t.length)return!1;for(var o=0;o<e.length;o++)if(!c.jsonEqual(e[o],t[o]))return!1;return!0}return i=Object.getOwnPropertyNames(e),n=Object.getOwnPropertyNames(t),i.length!=n.length?!1:i.every(function(i){
return c.jsonEqual(e[i],t[i])})},linkify:function(e){var t=[];return r.linkify(e,{callback:function(e,i){0!==e.length&&t.push({text:e,href:i})}}),t},firstScrollingParent:l.firstScrollingParent,getContainerOffset:function(e,t){var i=o(e).offset(),n=t||c.firstScrollingParent(e);if(n!==document.body){var s=o(n).offset();i.left+=n.scrollLeft-s.left,i.top+=n.scrollTop-s.top}return i},isAstralSymbol:function(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e)},createPlainIframe:function(e){var t=document.createElement("iframe"),i=["<html>","<head>","<style>html, body {margin: 0; padding 0;}</style>","</head>","<body>",e.outerHTML,"</body>","</html>"];return t.srcdoc=i.join(""),t},h:function(e,t){for(var i=new Array(arguments.length-2),n=2;n<arguments.length;n++)i[n-2]=arguments[n];var o;o=null===e?document.createDocumentFragment():document.createElement(e),Object.keys(t||{}).forEach(function(e){o.setAttribute(e,t[e])});for(var s=0;s<i.length;s++){var a=i[s];a&&(Array.isArray(a)&&(a=c.h.apply(null,[null,null].concat(a))),
"string"==typeof a&&(a=document.createTextNode(a)),o.appendChild(a))}return o}};t.Util=c},"./shared/Class.js":function(e,t){function i(e,t){function i(){if(o||(e.call(d),n(l,t,a),o=!0,t=null),this!==d){var i=this.__init__;i&&i.apply(this,arguments)}}var o,a=r.prototype=e.prototype,l=new r;return i.prototype=l,i.extend=s,l.constructor=i,i}function n(e,t,i){for(var n in t)t.hasOwnProperty(n)&&(e[n]=i?o(n,t,i):t[n])}function o(e,t,i){var n=t[e],o=i[e];return"function"==typeof n&&"function"==typeof o&&n!==o&&a.test(n)?function(){var t=this._super;this._super=i[e];try{return n.apply(this,arguments)}finally{this._super=t}}:n}function s(e){return i(this,e)}var a=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/,r=function(){},d={};t.Class=s.call(function(){},{})},"./shared/action_log.js":function(e,t,i){function n(e){e&&v.log("action_log",e)}function o(e){y[e.cid]&&(e.impression_target&&n(e.impression_target),delete y[e.cid])}function s(e,t,i,n){g.setMessage("alog",[e,t,i,n])}function a(e,t){t&&s(e,t,null,null);
}function r(e,t){var i=p.actionTrail;i&&s(e,null,t,i)}function d(e){y[e.cid]=e;var t=f.firstScrollingParent(e.$id("@actionable").get(0)),i=t.id||"body",n=t===document.body?document:t;x[i]||(x[i]=!0,_(n).on("scroll",S)),c()}function l(e){delete y[e.cid]}function c(){k&&clearTimeout(k),k=setTimeout(S,C)}function u(e,t){e&&r(e,t)}var h,p=i("./settings-webpack.js"),f=i("./shared/util.js"),_=i("./shared/jquery.js"),m=i("./shared/viewport.js"),g=i("./shared/cookies.js"),v=i("./shared/logging.js"),w=i("./shared/debounce.js").debounce,b=i("./shared/core/component.js").Component,y={},C=500,k=null,x={};t.logPrimaryAction=a,t.logSecondaryAction=r;var S=w(function(){for(var e in y){var t=y[e];m.isElementInViewport(t.$id("@actionable").get(0))&&o(t)}},C);t.ActionableComponent=b.extend({onLoad:function(){this.registerWithImpressionsLogger(),this._handleOnLoadDesktop()},registerWithImpressionsLogger:function(){d(this)},_handleOnLoadMobile:function(){var e,t,i=this,n=i.$id("@actionable a"),o=function(e){
return function(t){var n=e.getAttribute("action_mousedown")||e.getAttribute("action_click");t.stopActionLogging||i.processAction(n),e.getAttribute("action_stop_propagation")&&(t.stopActionLogging=!0)}};if(i.setDvar("impression_target",i.impression_target),n)for(t=0;t<n.length;++t)e=n[t],h.safeClickHandler(e,o(e))},_handleOnLoadDesktop:function(){var e=this;this.$id("@actionable").on("mousedown","[action_mousedown]",function(t){var i=t.originalEvent||t;i.stopActionLogging||e.processAction(_(this).attr("action_mousedown"),_(this).attr("action_target")),_(this).attr("action_stop_propagation")&&(i.stopActionLogging=!0)}),this.$id("@actionable").on("click","[action_click]",function(t){var i=t.originalEvent||t;i.stopActionLogging||e.processAction(_(this).attr("action_click"),_(this).attr("action_target")),_(this).attr("action_stop_propagation")&&(i.stopActionLogging=!0)})},sendActions:function(){this.serverCall("send_actions").send()},processAction:function(e){var t=this;o(t),e&&(a(e,t.impression_target),
t.actionCallback(e))},actionCallback:function(e){},onUnload:function(){l(this)}}),t.registerActionLogClickHandlers=function(){},t.findActionableComponentsInViewport=function(){},t.findFeedItemsInViewport=function(){},_(document).on("mousedown","[action_mousedown]",function(e){var t=_(e.currentTarget).attr("action_mousedown"),i=_(e.currentTarget).attr("action_target");u(t,i)}),_(document).on("click","[action_click]",function(e){var t=_(e.currentTarget).attr("action_click"),i=_(e.currentTarget).attr("action_target");u(t,i)})},"./shared/activity_metrics.js":function(e,t,i){function n(e){var t={eventType:e,time:1e3*Date.now(),path:window.location.href,controller:r.controller,action:r.action};s.log("activity_metrics",t)}function o(e){var t=n.bind(null,e);window.addEventListener(e,a(t,d,{trailing:!1}),!0)}var s=i("./shared/logging.js"),a=i("./shared/debounce.js").throttle,r=i("./interface/settings.js"),d=6e4;t.init=function(){o("scroll"),o("click"),o("keyup")}},"./shared/ads_impression_logging.js":function(e,t,i){
function n(){var e=s.siteHeaderHeight();return isNaN(e)&&(e=0),-e+"px 0px 0px 0px"}function o(e){var t=e.$id("@actionable").get(0);t&&(h||(h=new IntersectionObserver(u,{threshold:[d],rootMargin:n()})),r(t).data("impression_target",e.impression_target),r(t).data("observer",h),h.observe(t))}var s=i("./shared/viewport.js"),a=i("./shared/logging.js"),r=i("./shared/jquery.js"),d=.5,l=1e3,c=function(e){a.log("action_log",r(e).data("impression_target"),{sendImmediately:!0}),r(e).data("observer").unobserve(e),r(e).removeData("observer")},u=function(e){e.forEach(function(e){var t=e.target,i=e.intersectionRatio>=d;i?void 0===r(t).data("timeout")&&r(t).data("timeout",setTimeout(c,l,t)):r(t).data("timeout")&&(clearTimeout(r(t).data("timeout")),r(t).removeData("timeout"))})},h=void 0;t.registerAd=o},"./shared/beforeunload.js":function(e,t,i){var n=i("./shared/jquery.js"),o=!1,s=[];t.registerHandler=function(e){s.push(e)},t.isUnloading=function(){return o};var a=function(e){o=!0,e=e||window.event;for(var t,i=0;i<s.length;i++){
var n=s[i].call(s,e);if(n){t=n;break}}return e&&(e.returnValue=t),t};n(window).on("beforeunload",a)},"./shared/browser.js":function(e,t,i){var n=i("./third_party/browser.js");n.version=parseFloat(n.version),e.exports=n},"./shared/client.js":function(e,t,i){var n=i("./settings-webpack.js"),o=i("./shared/browser.js"),s=t.DeviceType={ANDROID:0,IOS:1,WEB:2},a=t.getDeviceType=function(){var e=n.deviceName;return"iphone"==e?s.IOS:"android"==e?s.ANDROID:s.WEB},r=t.isIOSApp=function(){return a()==s.IOS},d=t.isAndroidApp=function(){return a()==s.ANDROID};t.isNativeApp=function(){return r()||d()};var l=t.isMobileWeb=function(){return!1};t.isWKWebView=function(){return r()&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.Q?!0:!1},t.isUIWebView=function(){return r()&&!window.webkit};var c=t.isAndroidMobileWeb=function(){return l()&&o.android};t.isIOSMobileWeb=function(){return l()&&o.ios},t.isAndroid=function(){return c()||d()}},"./shared/client_tracker.js":function(e,t,i){
var n,o=i("./shared/Class.js").Class,s=(i("./shared/w2.context.js"),i("./shared/core/rpc.js")),a=i("./shared/cookies.js"),r=i("./shared/util.js"),d=i("./shared/window_manager.js"),l=i("./shared/core/component.js"),c=i("./shared/jquery.js"),u=i("./interface/settings.js"),h=u.enableClientTracker,p=o.extend({__init__:function(){this.trail=u.clientTrackerTrail,this.started=!1},start:function(){h&&(this.started||(this.started=!0,c(document).on("mousedown",this.setFeedTrail.bind(this)),s.addMetadataCallback(this.addFeedMetadata.bind(this))))},track:function(e,t,n){h&&(t=r.extend({},t),this.addFeedMetadata(t,n),t.action=e,i("./shared/logging.js").log("ctrkr",t))},addFeedMetadata:function(e,t){var i=this.feedDataFromComponent(t);i&&(e.qfl2=i),this.trail&&this.trail.qfl2&&(e["qfl2-t"]=this.trail.qfl2)},feedDataFromComponent:function(e){if(!l.isOnLoadRunning()){var t=(e.getDvar("enable_feed_logging"),e.getDvar("feed_story_hash"));if(t){var i=e.getDvar("feed_ty");i=null!==i?i:0;var n=(e.getDvar("paged_list_hash"),
e.getDvar("feed_story_position"));n=null===n?0:n;var o=e.getDvar("feed_story_initial")||!1,s=e.getDvar("feed_page"),a=e.getDvar("page_data"),r=e.getDvar("focus_ty"),d=e.getDvar("feed_story_inner_position");d=null===d?0:d;var c=e.getDvar("bundle_position");return[9,t,n,o,"_ctkr",i,s,a,r,d,c]}}},setFeedTrail:function(e){for(var t=e.target,i=d.getDomain();t;){if("A"==t.tagName){var n=t.getAttribute("href");if(n&&n.startsWith("/"))break;if(n&&n.startsWith(i)){n=n.slice(i.length-1);break}}t=t.parentElement}if(t){var o=l.getComponentFromElement(t);if(o){var s=this.feedDataFromComponent(o);if(s){var r={path:n,expires:1};a.setMessage("ctrkr",{qfl2:s},null,r)}}}}}),f=t.init=function(){n=new p,n.start()};t.track=function(){n||f(),n.track.apply(n,arguments)}},"./shared/cookies.js":function(e,t,i){var n=i("./shared/util.js"),o=(i("./shared/w2.context.js"),i("./settings-webpack.js")),s=o.cookiePrefix,a=".quora.com",r=function(){r.called||(r.called=!0,i("./shared/logging.js").log.apply(this,arguments));
},d=function(e){return n.extend({expires:1825,path:"/",domain:a},e)};t.setCookie=function(e,i,n,o){n=d(n);t.setCookieOnDocument(e,i,n)},t.getCookie=function(e,i){return t.getCookieOnDocument(e)},t.setCookieOnDocument=function(e,t,i){i=d(i),e=s+"-"+e;var n,o=i.document||document,a=i.path?"; path="+i.path:"",r=i.domain?"; domain="+i.domain:"",l=i.secure?"; secure":"",c="";null===t&&(t="",i.expires=-1),i.expires&&"number"==typeof i.expires&&(n=new Date,n.setTime(n.getTime()+24*i.expires*60*60*1e3),c="; expires="+n.toUTCString()),i.expires instanceof Date&&(c="; expires="+i.expires.toUTCString()),o.cookie=[e,"=",encodeURIComponent(t),c,a,r,l].join("")},t.getCookieOnDocument=function(e){e=s+"-"+e;var t,i,n,o=document;if(o.cookie&&""!==o.cookie)for(t=o.cookie.split(";"),n=0;n<t.length;n++)if(i=t[n].trim(),i.startsWith(e+"="))return decodeURIComponent(i.substring(e.length+1))};var l=function(e){var t,i,n="="+encodeURIComponent(e),o='="'+encodeURIComponent(e)+'"';if(document.cookie)for(t=document.cookie.split(";"),
i=0;i<t.length;i++)if(t[i].endsWith(n)||t[i].endsWith(o))return!0;return!1},c=t.setMessage=function(e,i,n,s,a){var c,u=document,h=u.cookie.length,p=u.cookie.split(";").length;if(s=d(s),h>2400||p>50){var f={key:e,args:i,size:h,count:p,cookie:u.cookie};return void r("cookie_message_errors",f,{scribeOnly:!0})}var _=Math.floor(4294967296*Math.random()),m=JSON.stringify({key:e,args:i});a=void 0!==a?a:o.nid,c=["qm",_,a].join("-"),l(m)||t.setCookie(c,m,s,n)};t.setQfeedLog=function(e,t){var i,n=e.getDvar("feed_story_hash"),o=(e.getDvar("paged_list_hash"),e.getDvar("enable_feed_logging"),e.getDvar("feed_story_initial")),s=e.getDvar("feed_ty"),a=e.getDvar("feed_page"),r=e.getDvar("page_data"),d=e.getDvar("focus_ty"),l=e.getDvar("feed_story_inner_position"),u=e.getDvar("bundle_position"),h=e.getDvar("bundle_type"),p=e.getDvar("feed_story_position"),f=e.__extra_args&&e.__extra_args.nid_override;if(n){null===s&&(s=0),o||(o=!1);p=null===p?0:p,l=null===l?0:l,i=[10,n,p,o,t,s,a,r,d,l,u,h],c("qfl",i,void 0,void 0,f);
}},t.setTlog=function(e){o.trail&&e&&c("tlog",[o.trail,e])},t.setQueryLog=function(e,t){var i=e.getDvar("query_id"),n=e.getDvar("index");null!==i&&(null===n&&(n=0),c("qlch",[i,{type:t,index:n}]))},t.setScreenSizeCookie=function(){var e=window.screen.width,i=window.screen.height;t.setCookie("screen_size",e+"x"+i)}},"./shared/core/component.js":function(e,t,i){var n=i("./shared/Class.js").Class,o=i("./shared/w2.timing.js"),s=i("./shared/eventemitter.js").EventEmitter,a=i("./shared/jquery.js"),r=i("./shared/w2.context.js"),d=i("./shared/util.js"),l=i("./interface/settings.js"),c=i("./shared/errors.js"),u=i("./shared/events/index.js"),h=i("./shared/log.js").log,p=i("./shared/logging.js"),f=i("./gating-webpack.js"),_=(i("./shared/client.js"),{}),m={},g={},v={},w={},b={},y={},C={},k={};t._parents=_,t._components=m,t._allChildren=g,t._children=v,t._hmacs=w,t._domids=b,t._domidToCid=y,t._debugInfo=C,t._unloaded=k;var x=t.addParents=function(e){var t,i,n,o;for(t=Object.keys(e),o=0;o<t.length;o++)i=t[o],
n=e[i],_[i]=n,n in g||(g[n]=[]),g[n].push(i),i in v||(v[i]={})},S=function(e){var t,i,n;for(t=Object.keys(e),i=0;i<t.length;i++)n=t[i],w[n]=e[n]},E=function(e){var t,i,n;for(t=Object.keys(e),i=0;i<t.length;i++)n=t[i],n in v||(v[n]={}),d.extend(v[n],e[n])},T=function(e){var t,i,n,o;for(t=Object.keys(e),i=0;i<t.length;i++)n=t[i],o=e[n],b[n]=o,y[o]=n},$=t.addDebugInfo=function(e){var t,i,n;for(t=Object.keys(e),i=0;i<t.length;i++)n=t[i],C[n]=e[n],o.timing._components&&(n in o.timing._components||(o.timing._components[n]={}),o.timing._components[n].addDebugInfo=Date.now())};t.addComponentMetadata=function(e){var t=e.parents,i=e.children,n=e.domids,o=e.hmacs;x(t),S(o),E(i),T(n),"debugInfo"in e&&$(e.debugInfo)},t.registerComponents=function(e){return e.forEach(function(e){m[e.cid]=e}),e};var L=t._safeGetComponentByCID=function(e){return e?(m[e]||(m[e]=B(e)),m[e]):null};t.isCid=function(e){return e&&!!m[e]},t.getLiveDomId=function(e){return b[e]},t.getLiveDomElement=function(e){return e in b?document.getElementById(b[e]):void 0;
},t.getComponentFromElement=function(e){for(;e&&!(e.id in y);)e=e.parentNode;return e&&L(y[e.id])};var j=t.getLiveParent=function(e){return e in b?b[e]:e in _?j(_[e]):""};t.getLiveParentDomElement=function(e){return document.getElementById(j(e))},t.getLiveChildren=function(e){var t,i,n;if(t=g[e],i=[],t)for(n=0;n<t.length;n++)t[n]in b&&i.push(b[t[n]]);return i};var A=function(e,t,i){var n=e.cid,o=e.vcon(),s="Component onload took more than "+t+"ms";c.logJsError("slow component onload",s+" ("+n+" "+o+")"),p.log("slow_component_js",{time:i,hmac:o})},D=function(e,t){var i=Date.now(),n=e.cid;try{e.onLoad(t),e._flushOnLoadCallbacks()}catch(s){var a=e.vcon();a&&(s.message=s.message+" ("+n+" "+a+")"),c.report(s)}var r=Date.now()-i,d=f.slow_component_js_threshold;r>d&&f.log_slow_component_js&&A(e,d,r),o.timing.components&&(o.timing.components[n]||(o.timing.components[n]={}),o.timing.components[n].l=r)},I=t.removeComponentMetadata=function(e){u.DocumentProxy.dispatch({type:u.Types.WEBNODE_BEFORE_REMOVE_COMPONENT_METADATA,
payload:{cid:e}});var t=m[e],i=_[e],n=t&&t.cname;if(i&&n){var o=v[i];o&&o[n]==e&&delete o[n]}if(i){var s=g[i];if(s){var a=s.indexOf(e);a>-1&&s.splice(a,1)}}delete g[e],delete v[e],delete m[e],delete C[e],delete y[b[e]],delete b[e],delete w[e],delete _[e]},M=t.unloadComponent=function(e){try{h("core.component","unloadComponent(",e,")");var t=m[e];t&&(t.onUnload(),t._flushOnUnloadCallbacks(),r.unloadComponent(t));var i=g[e]||[];i=i.slice(),i.forEach(function(e){M(e)}),I(e),u.ComponentProxy.unsubscribeAll(e)}catch(n){c.report(n)}finally{k[e]=!0}},O=!1;t.isOnLoadRunning=function(){return O},t.beforeOnLoad=function(e){e&&(o.logTime("preOnLoad"),(l.logComponentTime||l.debug||l.componentInspector)&&(o.timing.components={},o.timing._components={})),u.DocumentProxy.dispatch({type:u.Types.WEBNODE_COMPONENT_PRE_ONLOAD,payload:{isPageLoad:e}})},t.afterOnLoad=function(e){e&&(o.logTime("postOnLoad"),o.logTime("pageInteractive")),u.DocumentProxy.dispatch({type:u.Types.WEBNODE_COMPONENT_POST_ONLOAD,payload:{
isPageLoad:e}})},t.registerBeforeOnLoadCallback=function(e){u.DocumentProxy.subscribe(u.Types.WEBNODE_COMPONENT_PRE_ONLOAD,function(t){e(t.payload.isPageLoad)})},t.registerAfterOnLoadCallback=function(e){u.DocumentProxy.subscribe(u.Types.WEBNODE_COMPONENT_POST_ONLOAD,function(t){e(t.payload.isPageLoad)})},t.onLoad=function(e,t){O=!0;for(var i=0;i<e.length;i++)r.initComponent(e[i]);for(var n=0;n<e.length;n++)D(e[n],t);return window.clearHandlers&&window.clearHandlers(),O=!1,e},t.getRootParent=function(e){if(!m[e])return null;for(var t=e;t&&!t.startsWith("*");)t=_[t];return t},t.getAllDvars=function(e){for(var t,i={},n=e,o={};n;){if(n.cid in o){var s="Broke parent loop",a=n.vcon();a&&(s+=" ("+n.cid+" "+a+")"),c.logJsError("getAllDvars",s);break}t=d.extend({},n.__dvars__),i=d.extend(t,i),o[n.cid]=!0,n=n.parent()}return i};var N=t.Component=n.extend({__init__:function(e,t,n,o){this.cid=e,this.cname=t,this.__js_init=n,this.__extra_args=o,this.__onloaded=!1;var s=w[this.cid];this.__vcon=s?s.split(":"):null,
this.__emitter=null,this.init(n),o.nid_override&&i("./shared/core/rpc.js").addMetadataCallback(this._addNidOverrideMetadataInRpc.bind(this))},init:function(e){d.isPlainObject(e)&&d.extend(this,e)},onLoad:function(e){},onUnload:function(){},contextConstructor:function(){},child:function(e){var t=v[this.cid],i=t?t[e]:null;return L(i)},children:function(){var e=g[this.cid]||[];return e.map(function(e){return L(e)})},parent:function(){return L(_[this.cid])},setDvar:function(e,t){this.__dvars__=this.__dvars__||{},this.__dvars__[e]=t},getDvar:function(e){if(this.__dvars__=this.__dvars__||{},e in this.__dvars__)return this.__dvars__[e];for(var t,i=this.cid;i;)if(i=_[i],t=m[i])return t.getDvar(e);return null},vcon:function(){var e=this.__vcon;if(!e)return null;if(1===e.length)return e;switch(e[0]){case"cls":case"hmac":return e;case"live":return e.slice(2)}return null},__maybeCreateEmitter:function(){this.__emitter||(this.__emitter=new s)},whenOnLoaded:function(e){return this.__onloaded?void e():(this.__maybeCreateEmitter(),
void this.__emitter.on("onload",e))},whenUnloaded:function(e){this.__maybeCreateEmitter(),this.__emitter.on("unload",e)},_flushOnLoadCallbacks:function(){this.__emitter&&this.__emitter.trigger("onload"),this.__onloaded=!0},_flushOnUnloadCallbacks:function(){this.__emitter&&this.__emitter.trigger("unload")},_my:function(){return"__w2_"+this.cid+"_"},ge:function(e){return document.getElementById(e.replace("@",this._my()))},createModal:function(e){var t=i("./shared/modal.js"),n=t.fromComponent(this);if(e){var o=this.vcon();if(!o)throw new Error("Invalid vcon for component: "+this.cid);n.fromServerCall(o,e)}return n},emitEvent:function(e){u.ComponentProxy.dispatch(e,this.cid)},handleEvent:function(e,t){u.ComponentProxy.subscribe(e,t,this.cid)},$id:function(e){if("@"!=e[0])throw new Error("Expect id to begin with @. Got: "+e);return e=e.replace("@",this._my()),a("#"+e)},serverCall:function(e){var t=this.vcon();if(t){var n=i("./shared/core/rpc.js");return new n.ServerCall(t,e,this)}},_addNidOverrideMetadataInRpc:function(e,t){
t.__extra_args.nid_override&&(e.nid_override=t.__extra_args.nid_override)}}),R=N.extend({__init__:function(e){this._super(e,null,{},{}),this.isVirtual=!0,r.initComponent(this)}}),B=t.makeVirtualComponent=function(e){return new R(e)}},"./shared/core/rpc.js":function(e,t,i){var n=i("./shared/errors.js"),o=i("./shared/events/index.js"),s=i("./shared/util.js"),a=i("./shared/perf.js"),r=i("./settings-webpack.js"),d=i("./shared/loading.js"),l=i("./shared/w2.timing.js"),c=i("./shared/jquery.js"),u=i("./shared/core/component.js"),h=i("./shared/core/webnode.js"),p=i("./shared/client.js"),f=i("./shared/rpc_manager.js"),_=i("./shared/window_manager.js"),m=i("./shared/Class.js").Class,g,v,w,b,y,C;g=i("./w2.livenode.js"),w=i("./webnode2.js"),b=i("./w2.errors.js"),v=i("./actions.js");var k={},x=!1;o.GlobalProxy.subscribe(o.Types.WEBNODE_RPC_RETRY_FAILED,function(e){var t=k[e.payload.requestId];t&&(t(),delete k[e.payload.requestId])});var S=m.extend({__init__:function(){this.__data={args:[],kwargs:{}},
this.__success=null,this.__error=null,this.__contentFor=null,this.__url=null,this.__exceptionCatchAll=null,this.__name=null,this.__liveMutation=!1,this.__inLiveMutation=!1,this.__optimisticUpdate=!1,this.__creationTime=Date.now(),this.__isRelatedToUserAction=b.canBeRelatedToUserAction()},args:function(){return this.__data.args=Array.prototype.slice.call(arguments),this},kwargs:function(e){return this.__data.kwargs=s.extend({},e),this},url:function(e){return this.__url=e,this},_url:function(){return this.__url},_xhrFields:function(){return this.__xhrFields},xhrFields:function(e){return this.__xhrFields=e,this},_appFields:function(){return this.__appFields},appFields:function(e){return this.__appFields=e,this},success:function(e){return this.__success=e,this},error:function(e){return this.__error=e,this},_error:function(){return this.__error||this._defaultErrorHandler},_defaultErrorHandler:function(e,t,i){if(r.debug||Math.random()<.1){var o={statusCode:e.status,status:t,error:i,name:this.__name
},s="Unhandled xhr error: "+JSON.stringify(o);n.logJsError("coreRpc",s)}},except:function(e,t){switch(arguments.length){case 1:this.__exceptionCatchAll=e;break;case 2:if("string"!=typeof e)return void n.logJsError("coreRpc","pattern should be a string, got: "+typeof e);this.__exceptionPatterns[e]=t;break;default:var i=Array.prototype.slice.call(arguments);n.logJsError("coreRpc","Invalid arguments to except: %s"%JSON.stringify(i))}return this},contentFor:function(e,t){if(t=t||{},!t.parentCid){if(!this._component)return void n.logJsError("contentFor","parentCid not specified for non component rpc.");t.parentCid=this._component.cid}return e instanceof c&&(e=e.get(0)),t=s.extend(t,{element:e}),t.useLoadingSpinner||t.useLoadingSpinner===!1||(t.useLoadingSpinner=!0),this.__contentFor=t,this},sendJsData:function(e){return this._sendJsData=!!e,this},liveMutate:function(e){return this.__liveMutation=!0,e=e||{},void 0===e.optimisticUpdate?this.__optimisticUpdate=!1:this.__optimisticUpdate=e.optimisticUpdate,
this},disableDefaultUserPerceivedLogging:function(){return this._disableDefaultUserPerceivedLogging=!0,this},sendOnlyOnce:function(){return this._onlyOnce(),this.send()},send:function(e){var t=e&&e.batched;return t?void f.enqueueRequest(this):this._send()},_send:function(){var e=r.subdomain_name||"www",t=this._url();if(p.isNativeApp()&&(t.startsWith("//")&&(t=window.location.protocol+t),t.startsWith("http://")||t.startsWith("https://"))){var i=s.getLocation(t),n=i.hostname,o=n.indexOf(r.subdomain_suffix);e=n.substr(0,o-1)||"www",t=i.pathname}this.__liveMutation&&(this.__inLiveMutation=!0,this.__liveMutationInfo=g.startMutation(this.__optimisticUpdate)),this.__contentFor&&this.__contentFor.useLoadingSpinner&&(this.__contentForLoadingTimeout=setTimeout(function(){w.forgetContents(c(this.__contentFor.element));var e=document.createElement("div");e.className="__contentfor_loading_dots",e.appendChild(d.createDots()),this.__contentFor.element.appendChild(e),this.__contentForLoadingDots=e}.bind(this),150));
var a={post:this._data(),url:t,subdomain:e};if(!x&&t.startsWith(r.serverCallUrl)&&(a.post.__first_server_call=!0,x=!0),this._beforeSendHandler(),this.__onlyOnce){if(this._isSimilarServerCallActive())return this;this._component.activeServerCalls[this.__vcon_method]=1}var u=this._successHandler.bind(this),h=this._error().bind(this),f=this._completeHandler.bind(this);this.__startTime=l.getTime(),a.dataType="json",a.type="POST",a.xhrFields=this._xhrFields();var _=this._beforeErrorHandler.bind(this);a.success=u,a.error=function(e,t,i){try{_.apply(this,arguments)}finally{h.apply(this,arguments)}},a.complete=f,a.data=a.post,c.ajax(a)},_beforeSendHandler:function(){this.__vcon&&(this._action=a.startPOST({vcon:this.__vcon,method:this.__vcon_method}),this._disableDefaultUserPerceivedLogging||(this._userPerceivedAction=a.startUserPerceived({vcon:this.__vcon,method:this.__vcon_method})))},_beforeErrorHandler:function(e,t,i){this.__contentFor&&this.__contentFor.useLoadingSpinner&&this.__contentForLoadingDots&&this.__contentFor.element.removeChild(this.__contentForLoadingDots),
b.reportAjaxError(e,t,i,this.__isRelatedToUserAction,this.__creationTime)},_completeHandler:function(){if(this.__startTime&&l.logRequestTime(this.__name,this.__startTime),this._action&&(a.finishAction(this._action),this._action=null),!this._disableDefaultUserPerceivedLogging&&this._userPerceivedAction&&(a.finishAction(this._userPerceivedAction),this._userPerceivedAction=null),this.__onlyOnce&&this._isSimilarServerCallActive()&&delete this._component.activeServerCalls[this.__vcon_method],this.__contentForLoadingTimeout&&clearTimeout(this.__contentForLoadingTimeout),this.__inLiveMutation){if(this.__liveMutationInfo){var e=this.__liveMutationInfo.transactionId;e&&g.mutationDoneAfterVersion(e,0)}this.__inLiveMutation=!1}},_successHandler:function(e){if(e.pmsg){var t,i,n;o.DocumentProxy.dispatch({type:o.Types.PMSG_SHOW,payload:{content:e.pmsg,fadeOut:!0}})}if(e.exception)return void this._handleException(e);if(this.__contentFor){var s=c(this.__contentFor.element);w.forgetContents(s),document.body.contains(s.get(0))&&h.setContent(s,e.value),
c(document).trigger("rpc_content_for_done",{opts:this.__contentFor,value:e.value})}this.__success&&this.__success(e.value),this.__liveMutation&&"post_reload"==r.pageMode&&_.reload(),p.isAndroidApp()&&y.buildNumber>=1163||e.dirtied_depkeys&&C.send("broadcastAllWebViews",{messageName:"reloadDirtiedDepkeys",data:{dirtied_depkeys:e.dirtied_depkeys}}),e.post_perf_html&&o.DocumentProxy.dispatch({type:o.Types.PERF_POST_HTML,payload:{html:e.post_perf_html,js:e.post_perf_js}})},_onlyOnce:function(){return this._component.activeServerCalls||(this._component.activeServerCalls={}),this.__onlyOnce=!0,this},_invokeExceptionCallback:function(e){var t=this.__exceptionPatterns[e.exception.type];return t?t(e.exception,e,this):this.__exceptionCatchAll?void this.__exceptionCatchAll(e.exception,e,this):!0},_handleException:function(e){var t=this._invokeExceptionCallback(e);if(t){var i=r.request_id;o.GlobalProxy.dispatch({type:o.Types.WEBNODE_RPC_EXCEPTION,payload:{exceptionType:e.exception.type,requestId:i}
}),k[i]=this.send.bind(this)}},_data:function(){r.formkey||n.logJsError("coreRpc","formkey not set -- can't send request securely.");var e;try{e=JSON.stringify(this.__data,function(e,t){return void 0===t?null:t})}catch(t){n.logJsError("coreRpc","Can't JSON encode arguments to server call."),e=JSON.stringify({error:"Can't JSON encode arguments to server call."})}var i={json:e,revision:r.revision,formkey:r.formkey,postkey:r.postkey,window_id:r.windowId,referring_controller:r.controller,referring_action:r.action};if(this.__contentFor){i.parent_cid=this.__contentFor.parentCid;var o=this.__contentFor.element,a=u.getLiveChildren(i.parent_cid),d=a.filter(function(e){return o.contains(document.getElementById(e))});i.parent_domid=u.getLiveParent(i.parent_cid),i.domids_to_remove=JSON.stringify(d)}if(this.__liveMutation&&s.extend(i,this.__liveMutationInfo.data),this.__vcon){i.__vcon_json=JSON.stringify(this.__vcon),i.__vcon_method=this.__vcon_method;var l=v.startOrUpdateAction(i.__e2e_action_id,{url:this.__url,
vcon:this.__vcon,method:this.__vcon_method,args:i.args,kwargs:i.kwargs});i.__e2e_action_id=l.id}return this._component&&(this._sendJsData&&(i.js_init=JSON.stringify(this._component.__js_init)),i.__metadata=JSON.stringify($(this._component))),i},_isSimilarServerCallActive:function(){return this._component.activeServerCalls?this.__vcon_method in this._component.activeServerCalls:!1}});t.rpc=function(e){return(new S).url(e)},t.ServerCall=S.extend({__init__:function(e,t,i){this._super(),this.__vcon=e,this.__vcon_method=t,this.__name=this.__vcon+"."+this.__vcon_method,this.__exceptionPatterns={state_expired:this._stateExpired.bind(this)};var n=r.serverCallUrl;p.isIOSApp()||(n=_.addParamToURL(n,"_v",e),n=_.addParamToURL(n,"_m",t)),this.url(n),this._component=i,this._sendJsData=!0,this._action=null,this._disableDefaultUserPerceivedLogging=!1,this._userPerceivedAction=null},_stateExpired:function(){g.reportPageNeedsReload("livenode_state_expired")}});var E={},T=[];t.addMetadataCallback=function(e){
T.push(e)};var $=function(e){var t=e.cid,i=t in E?E[t]:{};delete E[t];for(var n=0;n<T.length;n++)T[n](i,e);return i};t.atLeastOneServerCallIsSent=function(){return x}},"./shared/core/webnode.js":function(module,exports,__webpack_require__){var coreComponent=__webpack_require__("./shared/core/component.js"),errors=__webpack_require__("./shared/errors.js"),broadcast;exports.initialize2=function(e,t,i,n){coreComponent.beforeOnLoad(i),coreComponent.addComponentMetadata(e),t=t.map(function(e){var t=e[0],i=e[1],n=t?window.require(t)[i]:window[i];if(!n){var o=t?'require("'+t+'").':"window.",s="Cannot find component class: "+o+i+" - js_init: ";return void errors.logJsError("webnode",s+JSON.stringify(e))}var a=e[2],r=e[3],d=e[4],l=e[5],c=l&&l.name_save;return c&&(l.jsInitFacade=e),new n(a,r,d,l)}),t=t.filter(function(e){return e}),coreComponent.registerComponents(t),coreComponent.onLoad(t,i),coreComponent.afterOnLoad(i)};var setContentHTML=exports.setContentHTML=function(e,t){e.html?e.html(t.html):e.innerHTML=t.html;
},evaluateContentJS=exports.evaluateContentJS=function(content){var js=content.js?content.js:content;eval(js)};exports.setContent=function(e,t){setContentHTML(e,t),evaluateContentJS(t)}},"./shared/datetime.js":function(e,t,i){var n=i("./settings-webpack.js"),o=t.SECOND=1e3,s=t.MINUTE=60*o,a=t.HOUR=60*s,r=t.DAY=24*a,d=function(){return n.datetime_strings},l=function(e,t){return e.replace(/\{([^{}]*)\}/g,function(e,i){return t[i]})},c=function(e,t){var i,n=new Array(4),l=[r,a,s,o],c=d().timeAbbrevs;for(i=0;i<n.length;++i)n[i]=Math.floor(e/l[i]),e-=n[i]*l[i];for(var u=0;u<n.length&&!n[u];)++u;for(var h=n.length-1;h>=0&&l[h]<t;)--h;var p="";for(i=u;h>=i;++i)p+=n[i].toString()+c[i],h>i&&(p+=" ");return p};t.dayStr=function(e){var t=new Date(e/1e3);return l(d().dayMonthYearTemplate,{day:t.getDate().toString(),month:d().monthNames[t.getMonth()],year:t.getFullYear()})},t.timestampStr=function(e,t){var i,u=new Date,h=new Date(e/1e3),p=u.getTime()-h.getTime();if(0>p)return p>=-2*o?d().justNow:h.toLocaleDateString(n.interfaceLanguage,{
weekday:"short",year:"numeric",month:"short",day:"numeric"});if(t&&(i=c(p,t)))return l(d().agoTemplate,{time:i});if(s>p)return d().justNow;if(a>p){var f=Math.floor(u.getTime()/s)-Math.floor(h.getTime()/s);return i=f.toString()+d().timeAbbrevs[2],l(d().agoTemplate,{time:i})}if(12*a>p||r>p&&u.getDate()==h.getDate()){var _=Math.floor(u.getTime()/a)-Math.floor(h.getTime()/a);return i=_.toString()+d().timeAbbrevs[1],l(d().agoTemplate,{time:i})}var m=new Date;if(m.setDate(u.getDate()-1),2*r>p&&h.getDate()==m.getDate())return d().yesterday;if(31*r>p&&u.getMonth()==h.getMonth()){var g=Math.floor(u.getTime()/r)-Math.floor(h.getTime()/r);return i=g.toString()+d().timeAbbrevs[0],l(d().agoTemplate,{time:i})}return h.getFullYear()==u.getFullYear()?l(d().dayMonthTemplate,{day:h.getDate().toString(),month:d().monthNames[h.getMonth()]}):l(d().dayMonthYearTemplate,{day:h.getDate().toString(),month:d().monthNames[h.getMonth()],year:h.getFullYear()})}},"./shared/debounce.js":function(e,t){var i=function(e){
var t=typeof e;return!!e&&("object"==t||"function"==t)};t.debounce=function(e,t,n){function o(){_&&clearTimeout(_),u&&clearTimeout(u),g=0,u=_=m=void 0}function s(){return Date.now()}function a(t,i){i&&clearTimeout(i),u=_=m=void 0,t&&(g=s(),h=e.apply(f,c),_||u||(c=f=void 0))}function r(){var e=t-(s()-p);0>=e||e>t?a(m,u):_=setTimeout(r,e)}function d(){a(w,_)}function l(){var i,n;if(c=arguments,p=s(),f=this,m=w&&(_||!b),v===!1)i=b&&!_;else{u||b||(g=p);var o=v-(p-g);n=0>=o||o>v,n?(u&&(u=clearTimeout(u)),g=p,h=e.apply(f,c)):u||(u=setTimeout(d,o))}return n&&_?_=clearTimeout(_):_||t===v||(_=setTimeout(r,t)),i&&(n=!0,h=e.apply(f,c)),!n||_||u||(c=f=void 0),h}var c,u,h,p,f,_,m,g=0,v=!1,w=!0;if("function"!=typeof e)throw new Error("Only able to debounce functions.");t=0>t?0:+t||0;var b;return n===!0?(b=!0,w=!1):i(n)&&(b=!!n.leading,v="maxWait"in n&&Math.max(+n.maxWait||0,t),w="trailing"in n?!!n.trailing:w),l.cancel=o,l},t.throttle=function(e,n,o){var s=!0,a=!0;if("function"!=typeof e)throw new Error("Only able to throttle functions.");
return i(o)&&(s="leading"in o?!!o.leading:s,a="trailing"in o?!!o.trailing:a),t.debounce(e,n,{leading:s,maxWait:n,trailing:a})}},"./shared/dom.js":function(e,t,i){function n(e){if(!e||!e.parentNode)return!1;var t=e.getAttribute("id");e.setAttribute("id",a);var i=!!document.getElementById(a);return t?e.setAttribute("id",t):e.removeAttribute("id"),i}var o=i("./shared/jquery.js"),s=i("./shared/browser.js"),a=(new Date).toString(16),r=!1;t.getScrollbarWidth=function(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),document.body.appendChild(t);var i=e.offsetWidth;t.style.overflow="scroll";var n=e.offsetWidth;return i==n&&(n=t.clientWidth),document.body.removeChild(t),i-n},t.anchor=function(e,t){if(e=o(e),r||e.length<1)return e;r=!0;var i=[],s=o(window).scrollTop(),a=o(window).scrollLeft();
i.length=e.length;for(var d=0;e[d];++d)i[d]=[e[d],o(e[d]).offset().top-s];var l=function(){for(var e,t,s,d={},l=0,c=[void 0,-1];t=i[l++];)n(t[0])&&(e=o(t[0]).offset().top-t[1],s=d[e]=(d[e]||0)+1,c[1]<s&&(c=[e,s]));-1!=c[1]&&window.scrollTo(a,Math.round(c[0],0)),r=!1};return t?l:(setTimeout(l,10),e)},t.addAnimationClass=function(e,t,i){function n(){for(var e=0;e<l.length;e++){var t=r.css(l[e]);if(t)return t}}function a(e){if(!e)return!1;var t=e.originalEvent.animationName;return t+d}var r=o(e);if(s.msie&&s.version<=9)return i(),r;var d="W2_css_animation",l=["-webkit-animation-name","-moz-animation-name","-o-animation-name","-ms-animation-name"];r.addClass(t),r.on("oanimationend animationend webkitAnimationEnd MSAnimationEnd",function(e){r.trigger(a(e))});var c=n()+d;return r.on(c,function(){r.off(c),r.removeClass(t),i()}),r}},"./shared/e2e.js":function(e,t,i){var n=i("./shared/util.js"),o=i("./shared/log.js").log,s=i("./shared/logging.js"),a=i("./settings-webpack.js"),r=i("./shared/w2.timing.js"),d=i("./shared/resource_timing.js"),l=i("./shared/client.js"),c=i("./shared/paint_timing.js"),u=!1,h=!1,p=null,f=null;
t.NATIVE_PERF_SAMPLE_RATE=.01;var _=!1;t.maybeReportPrefetchedData=function(){_=!0,window.performance.timing.loadEventEnd>0&&b()},t.reportPageData=function(e){if(null!==e&&e.mustReport){delete e.mustReport;var t=r.timing,i={};for(var o in t)"components"!==o&&"_components"!==o&&(i[o]=t[o]);p=n.extend(e,{win_perf:{path:window.location.pathname,revision:a.revision,request_id:a.request_id,controller:a.controller,action:a.action,server_time:t.server_time,total_worker_time:t.total_worker_time,window_id:t.window_id,is_css_inlined:t.is_css_inlined,is_early_js_inlined:t.is_early_js_inlined,experiments:t.experiments},w2_timing:i,paint_timing:c.getPaintTimingInformation()}),g()}};var m=function(){return window.performance&&window.performance.timing},g=function(){return m()&&0===window.performance.timing.loadEventEnd?void setTimeout(g,250):void v()},v=function(){if(m()){var e={};for(var t in window.performance.timing){var i=window.performance.timing[t];"number"==typeof i&&(e[t]=i)}p.win_perf.timing=e;
}else p.win_perf.timing={};r.stop(),u=!0,w()},w=function(){y()},b=function(){var e=!1;l.isMobileWeb()&&u&&(e=!0),!m()&&f&&(e=!0),u&&p&&f&&(e=!0),l.isNativeApp()&&a.isPagePrefetched&&!_&&(e=!1),e&&y()},y=function(){if(!h){h=!0;var e=n.extend(p||{},f||{});setTimeout(function(){if(e.resource_timing=d.getResourceTimingInformation(),o.enabled){var t=p.win_perf.timing,i=t.loadEventStart-t.navigationStart,n=e.win_perf.server_time;o("e2e.reportPageData","Metric:",i,"Server time:",n,"Details:",p)}s.log("perf/get_e2e",e,{sampleRate:.2})},100),a.componentInspector||(delete r.timing.components,delete r.timing._components)}}},"./shared/email.js":function(e,t){t.isValidEmail=function(){var e="[^\\x0d\\x22\\x5c\\x80-\\xff]",t="[^\\x0d\\x5b-\\x5d\\x80-\\xff]",i="[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+",n="\\x5c[\\x00-\\x7f]",o="\\x5b("+t+"|"+n+")*\\x5d",s="\\x22("+e+"|"+n+")*\\x22",a=i,r="("+a+"|"+o+")",d="("+i+"|"+s+")",l=r+"(\\x2e"+r+")*",c=d+"(\\x2e"+d+")*",u=c+"\\x40"+l,h="^"+u+"$",p=new RegExp(h);
return function(e){return p.test(e)}}()},"./shared/eventemitter.js":function(e,t,i){var n=i("./shared/Class.js").Class,o=i("./shared/errors.js");t.EventEmitter=n.extend({on:function(e,t){this.__handlers=this.__handlers||{},this.__handlers[e]=this.__handlers[e]||[],this.__handlers[e].push(t)},off:function(e,t){if(this.__handlers&&this.__handlers[e]){var i=this.__handlers[e].indexOf(t);-1!=i&&this.__handlers[e].splice(i,1)}},once:function(e,t){this.__onceHandlers=this.__onceHandlers||{},this.__onceHandlers[e]=this.__onceHandlers[e]||[],this.__onceHandlers[e].push(t)},trigger:function(e,t){for(var i=this.__handlers&&this.__handlers[e]||[],n=[],s=0;s<i.length;s++)try{n.push(i[s].apply(null,t||[]))}catch(a){o.report(a)}for(var r=this.__onceHandlers&&this.__onceHandlers[e]||[];0!==r.length;)try{n.push(r.pop().apply(null,t||[]))}catch(a){o.report(a)}return n}})},"./shared/events/helpers.js":function(e,t,i){var n=i("./shared/events/types.js").EventTypes,o=i("./shared/events/scope.js");t.addAnswerUpvote=function(e){
return{type:n.ANSWER_VOTE_STATE,payload:{aid:e,state:"upvoted"},scope:o.GLOBAL}},t.addAnswerDownvote=function(e){return{type:n.ANSWER_VOTE_STATE,payload:{aid:e,state:"downvoted"},scope:o.GLOBAL}},t.removeAnswerDownvote=t.removeAnswerUpvote=function(e){return{type:n.ANSWER_VOTE_STATE,payload:{aid:e,state:null},scope:o.GLOBAL}},t.addUserFollow=function(e){return{type:n.USER_FOLLOW_STATE,payload:{uid:e,state:"followed"},scope:o.GLOBAL}},t.removeUserFollow=function(e){return{type:n.USER_FOLLOW_STATE,payload:{uid:e,state:null},scope:o.GLOBAL}},t.addQuestionDownvote=function(e){return{type:n.QUESTION_VOTE_STATE,payload:{qid:e,state:"downvoted"},scope:o.GLOBAL}},t.removeQuestionDownvote=function(e){return{type:n.QUESTION_VOTE_STATE,payload:{qid:e,state:null},scope:o.GLOBAL}},t.addQuestionCantAnswer=function(e){return{type:n.QUESTION_CANT_ANSWER_STATE,payload:{qid:e,state:"passed"},scope:o.GLOBAL}},t.removeQuestionCantAnswer=function(e){return{type:n.QUESTION_CANT_ANSWER_STATE,payload:{qid:e,state:null
},scope:o.GLOBAL}},t.changeQuestionDeletionState=function(e){return{type:n.QUESTION_DELETE_STATE_CHANGE,payload:{qid:e},scope:o.GLOBAL}},t.inlineEditorCancel=function(e,t){return{type:n.INLINE_EDITOR_STATE,payload:{oid:t,contentType:e,state:"cancel"}}},t.inlineEditorEdit=function(e,t){return{type:n.INLINE_EDITOR_STATE,payload:{oid:t,contentType:e,state:"edit"}}},t.inlineEditorLoad=function(e,t){return{type:n.INLINE_EDITOR_STATE,payload:{oid:t,contentType:e,state:"load"}}},t.inlineEditorSubmit=function(e,t){return{type:n.INLINE_EDITOR_STATE,payload:{oid:t,contentType:e,state:"submit"}}},t.inlineEditorSubmitted=function(e,t){return{type:n.INLINE_EDITOR_STATE,payload:{oid:t,contentType:e,state:"submitted"}}},t.inlineEditorDisclaimer=function(e,t){return{type:n.INLINE_EDITOR_STATE,payload:{oid:t,contentType:e,state:"disclaimer"}}},t.inlineEditorToggle=function(e,t){return{type:n.INLINE_EDITOR_STATE,payload:{oid:t,contentType:e,state:"toggle"}}},t.loginUser=function(e){return{type:n.LOGIN_USER,
payload:{pmsg:e},scope:o.GLOBAL}},t.logoutUser=function(){return{type:n.LOGOUT_USER,payload:{},scope:o.GLOBAL}},t.anonLinkSaved=function(){return{type:n.ANON_LINK_SAVED,payload:{},scope:o.GLOBAL}},t.feedNegativeFeedback=function(e,t){return t?{type:n.FEED_NEGATIVE_FEEDBACK_STATE,payload:{oid:e,message:t,state:"show_message"}}:{type:n.FEED_NEGATIVE_FEEDBACK_STATE,payload:{oid:e,state:"hide"}}}},"./shared/events/hub.js":function(e,t,i){var n=i("./shared/Class.js").Class,o=i("./shared/eventemitter.js").EventEmitter,s=i("./shared/errors.js"),a=i("./shared/events/types.js"),r=n.extend({__init__:function(){this.reset()},reset:function(){this._emitter=new o,this._allEmitter=new o},_isValidType:function(e,t){if(!a.EventTypes[e]){var i="Unknown error type - "+e;return i=t?i+" "+JSON.stringify(t):i,s.logJsError("Hub",i),!1}return!0},_isValidEvent:function(e){var t=this._isValidType(e.type),i=!!e.payload,n=!!e.scope;return i||s.logJsError("Hub","Event object missing payload - "+JSON.stringify(e)),
n||s.logJsError("Hub","Event object missing scope - "+JSON.stringify(e)),t&&i&&n},subscribe:function(e,t){this._isValidType(e)&&this._emitter.on(e,t)},subscribeAll:function(e){this._allEmitter.on("any",e)},unsubscribe:function(e,t){this._isValidType(e)&&this._emitter.off(e,t)},dispatch:function(e){this._isValidEvent(e)&&(this._emitter.trigger(e.type,[e]),this._allEmitter.trigger("any",[e]))}});t.Hub=new r},"./shared/events/index.js":function(e,t,i){var n=i("./shared/events/types.js"),o=i("./shared/events/proxy.js"),s=i("./shared/events/hub.js"),a=i("./shared/events/scope.js"),r=i("./shared/events/helpers.js");t.Types=n.EventTypes,t.GlobalProxy=o.Global,t.DocumentProxy=o.Document,t.Hub=s.Hub,t.ComponentProxy=o.Component,t.scope=a,t.helpers=r},"./shared/events/proxy.js":function(e,t,i){var n=i("./shared/Class.js").Class,o=i("./shared/events/hub.js").Hub,s=i("./shared/events/scope.js"),a=n.extend({__init__:function(){this._subscriptions={}},reset:function(){for(var e=Object.keys(this._subscriptions),t=0;t<e.length;t++)this.unsubscribeAll(e[t]);
},subscribe:function(e,t,i){var n=function(e){e.scope.contains(i)&&t(e)};this._subscriptions[i]=this._subscriptions[i]||[],this._subscriptions[i].push([e,n]),o.subscribe(e,n)},unsubscribeAll:function(e){var t=this._subscriptions[e];if(t){for(var i=0;i<t.length;i++){var n=t[i],s=n[0],a=n[1];o.unsubscribe(s,a)}delete this._subscriptions[e]}},dispatch:function(e,t){e.scope||(e.scope=this.defaultScope(e.type,t)),o.dispatch(e)},defaultScope:function(e,t){return null}}),r=a.extend({defaultScope:function(e,t){return s.GLOBAL}}),d=a.extend({defaultScope:function(e,t){return s.DOCUMENT}}),l=a.extend({defaultScope:function(e,t){return new s.ComponentScope(t)}});t.Global=new r,t.Document=new d,t.Component=new l},"./shared/events/scope.js":function(e,t,i){var n=i("./shared/Class.js").Class;t.GLOBAL={contains:function(){return!0},toJSON:function(){return{type:"GlobalScope"}}},t.DOCUMENT={contains:function(){return!0},toJSON:function(){return{type:"DocumentScope"}}},t.ComponentScope=n.extend({__init__:function(e){
this.source=e;var t=i("./shared/core/component.js");this.rootParent=t.getRootParent(e)},contains:function(e){var t=i("./shared/core/component.js");return t.isCid(e)?this.rootParent==t.getRootParent(e):!1},toJSON:function(){return{type:"ComponentScope",source:this.source,root:this.rootParent}}})},"./shared/events/types.js":function(e,t,i){var n=i("./shared/util.js");t.EventTypes=n.makeEnum(["AD_REPORTED","ADS_MANAGER_TABLE_SORT","ADS_MANAGER_ADD_SUGGESTED_TOPIC","ADS_MANAGER_UPDATE_SUGGESTED_TOPIC","ADS_MANAGER_UPDATE_SUGGESTED_BID","ACTIVATION_NEXT_STEP","ACTIVATION_PROGRESS_BAR_STEP","ANON_LINK_SAVED","ANON_ACTION_VIEW_DISMISSED","ANSWER_COMMENT_SORT_ALL","ANSWER_FEED_INLINE_EXPAND","ANSWER_MODAL_CONTENT_VISIBLE","ANSWER_TOGGLE_EDITOR","ANSWER_VOTE_STATE","ASK_QUESTION_MODAL_SUBMIT","ASK_QUESTION_MODAL_RESULT_CLICK","ASK_QUESTION_MODAL_QUERY_CHANGE","ASK_QUESTION_MODAL_OPEN","CAROUSEL_CHECK_DISMISS_ALL","CAROUSEL_DISMISS_ALL","COMMENT_ADD","COMMENT_REPLY_FOCUS","CREDENTIAL_ADDED","CREDENTIAL_DELETED","CREDENTIAL_ADD_FORM_VISIBILITY","CREDENTIAL_CHOSEN","FEED_IMPRESSIONS_DISABLED","FEED_NEGATIVE_FEEDBACK_STATE","FEED_NUM_PIN_TOPICS","FEED_CONTROL_UPDATE","FEED_PAGING_DONE","FEED_ANSWER_INLINE_EXPAND","FILTER_NAV_LIST_UPDATE","HOME_MULTIFEED_REFRESH","I18N_MONITOR_QUESTIONS_ADD","INLINE_EDITOR_STATE","INTERACTION_MODE_BANNER_STATE","KNOWS_ABOUT_ADD_TOPIC","KNOWS_ABOUT_REMOVE_TOPIC","LIVENODE_LOADING_SPINNER","LOGIN_UPDATE_FIELDS","LOGIN_USER","LOGOUT_USER","LOOKUP_BAR_ASK_QUESTION","LOOKUP_BAR_QUESTION_DETAILS_STATE","LOOKUP_BAR_SET_ASKING_TARGET","MOBILE_APP_MODAL_CLOSE","MOBILE_APP_MODAL_SUBMIT","MOBILE_NOTIFS_RESYNC","MULTIFEED_BUNDLE_REMOVE","MULTIFEED_TOP_QUESTIONS_FROM_NETWORK_HIDE","MULTIFEED_QUESTIONS_FOR_NEW_WRITERS_HIDE","NOTIFS_CLEAR_BADGE","NOTIFS_HIDE_DROPDOWN","NOTIFS_MARK_ALL_READ","NUX_PROGRESS_BAR_STEP","NUX_DIALOG_CLOSE","NUX_DIALOG_NEXT_STEP","NUX_DIALOG_STANDALONE_DONE","NUX_DIALOG_SKIP_NEXT_STEP","NUX_DIALOG_FRIENDS_UPDATE","NUX_DIALOG_FINISH","NETWORK_BETA_LOGIN_FORM_STATE","NETWORK_BETA_WAITLIST_FORM_STATE","NETWORK_INVITE_USER","NETWORK_JOIN_MODAL","PENDING_CONTENT_STATUS_CHANGE","PERF_POST_HTML","PILE_ON_REQUEST_MADE","PMSG_SHOW","PROFILE_SWITCH_CONTENT","PROFILE_TOPICS_UPDATED","POST_DISCLAIMER","QTEXT_EXPANDABLE_STATE","QUESTION_BIO_TOPIC_SELECT","QUESTION_CANT_ANSWER_STATE","QUESTION_DELETE_STATE_CHANGE","QUESTION_TOPIC_SELECTION_ADD","QUESTION_VOTE_STATE","QUESTION_EDITING_STATE","READING_LIST_VIEW_STATE","READING_LIST_ITEM_REMOVE","RELATED_QUESTIONS_EXPAND","REORDERABLE_LIST_ITEM_UPDATE","REORDERABLE_LIST_TOGGLE_EDIT","REORDERABLE_LIST_ITEM_ACTIVE","SITE_HEADER_SEARCH_FOCUSED","SHARE_SEND_ITEM_SELECTED","SHARE_SEND_ITEM_SHARED","SIGNUP_TOAST_SHOW","DISCOVER_TOOL_CONFIRMED","TOPICS_GRID_ADD","TOPICS_GRID_REMOVE","TOPICS_GRID_UPDATE_SHOWN","TOPIC_LIST_REMOVE","TOPIC_FAQ_VIEW_MORE","TOPIC_FAQ_HIGHLIGHT_QUESTION","USER_FOLLOW_STATE","USER_LEADERBOARD_TOGGLE_EDIT","USER_STATS_UNSELECT_ITEMS","USER_STATS_UPDATE_GRAPHS","USER_STATS_UPDATE_ATTRIBUTES","USER_STATS_SHOW","UPLOAD_DIALOG_DROPZONE","UPLOAD_DIALOG_LOADING_STATE","WEBNODE_BEFORE_REMOVE_COMPONENT_METADATA","WEBNODE_COMPONENT_POST_ONLOAD","WEBNODE_COMPONENT_PRE_ONLOAD","WEBNODE_RPC_EXCEPTION","WEBNODE_RPC_RETRY_FAILED","WORDPRESS_CONNECT_SUCCESS","ZAPDOS_INLINE_DISMISS","ZAPDOS_WALL_DISMISS"]);
},"./shared/facebook.js":function(e,t,i){var n=i("./shared/loadjs.js").loadJS,o=i("./shared/util.js"),s=i("./shared/onload.js"),a=(i("./shared/client.js"),i("./settings-webpack.js")),r=!1,d=[],l=o.once(function(){var e=a.fbLanguageCode,t="//connect.facebook.net/"+e+"/sdk.js",i=a.fbAppId;window.fbAsyncInit=function(){for(FB.init({appId:i,oauth:!0,xfbml:!1,version:a.fbApiVersion}),r=!0;d.length;)d.pop().call()},n(t)}),c=t.onInit=function(e){r?e():(s.execAfterLoadDelayed(l),d.push(e))};t.isLoaded=function(){return r},t.load=function(){c(function(){})};var u=null,h=t.updatePermissions=function(e){FB.api("/me/permissions",function(t){t.data&&t.data.length>0?(u=t.data,e&&e(!0,t.data)):e&&e(!1,null)})};t.asyncUpdatePermissions=function(){null===u&&c(function(){FB.getLoginStatus(function(e){"connected"==e.status&&h()})})},t._disconnect=function(){FB.getLoginStatus(function(e){e.authReponse?FB.api({method:"auth.revokeAuthorization"},function(e){e?console.log("Successfully disconnected"):console.error("Disconnection failed");
},console.error):console.warn("Already not connected")})};var p=t.hasPermission=function(e){return u&&1==u[e]};t.requestPermissions=function(e,t){var i=function(e){return e.split(",").every(p)};i(e)?t(!0):FB.login(function(n){"connected"===n.status?h(function(n,o){t(n&&i(e))}):t(!1)},{scope:e})};var f=function(){return r?FB.getAuthResponse():null};t.getAccessToken=function(){var e=f();return e?e.accessToken:null},t.getExpiresIn=function(){var e=f();return e?e.expiresIn:null},t.getFbUid=function(){var e=f();return e?e.userID:null}},"./shared/frame_busting.js":function(e,t,i){var n=i("./interface/settings.js"),o=i("./shared/log.js");t.check=function(){if(n.enableFrameBusting){var e=!1;try{e=!/\.quora\.com$/i.test(window.top.location.host)}catch(t){e=!0}e&&""+window.top.location!=""+window.location&&(window.top.location=window.location,o&&o.enabled&&o("frame_busting","Updating window.location."))}}},"./shared/fx.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./shared/util.js"),s={duration:400,
easing:""},a=function(e,t){var i=!1;e.one("webkitTransitionEnd transitionEnd",function(){i=!0});var n=function(){i||e.trigger("transitionEnd")};setTimeout(n,t)},r=function(e){e.each(function(){this.offsetHeight})},d=function(e,t,i){i=o.extend({},s,i);var n="all "+i.duration+"ms "+i.easing;t.webkitTransition=n,t.mozTransition=n,t.transition=n;var r=o.once(function(){e.dequeue(),i.complete&&i.complete.apply(e)});e.queue(function(){e.one("webkitTransitionEnd transitionEnd",r),a(e),e.css(t)})},l=function(e,t,i,o){e=n(e),e.css(t),r(e),d(e,i,{duration:o||s.duration})};t.highlight=function(e,t){l(e,{backgroundColor:"#ffff99"},{backgroundColor:"transparent"},t)},t.fadeIn=function(e,t){l(e,{opacity:0},{opacity:1},t)}},"./shared/google_.js":function(e,t,i){var n=i("./shared/loadjs.js").loadJS,o=i("./shared/util.js"),s=i("./shared/onload.js"),a=!1,r=[],d=o.once(function(){var e="//apis.google.com/js/client:plusone.js?onload=gapiAsyncInit";window.gapiAsyncInit=function(){for(a=!0;r.length;)r.pop().call();
},n(e)});t.onInit=function(e){a?e():(s.execAfterLoadDelayed(d),r.push(e))}},"./shared/init.js":function(e,t,i){var n=i("./shared/events/index.js"),o=i("./shared/cookies.js"),s=i("./shared/onload.js"),a=i("./shared/client.js"),r=i("./settings-webpack.js"),d=i("./shared/scaled_inference.js");i("./shared/activity_metrics.js").init(),i("./shared/client_tracker.js").init(),i("./shared/frame_busting.js").check(),i("./shared/qtext.js").init(),i("./shared/links_logger.js"),i("./shared/lazy_load_images.js"),n.DocumentProxy.subscribe(n.Types.WEBNODE_RPC_EXCEPTION,function(e){"network_membership_required"==e.payload.exceptionType&&(window.location="/join")}),a.isNativeApp()||o.setCookie("tz",(new Date).getTimezoneOffset(),{path:"/"}),s.execAfterLoadDelayed(function(){window.require.prefetchAll()}),r.useScaledInference&&d.load()},"./shared/inline_css.js":function(e,t,i){var n=i("./shared/cookies.js"),o=function(e){window.requestAnimationFrame(function(){for(var t,i=document.getElementsByClassName(e);i.length;)t=i[0],
t.parentElement.removeChild(t)})},s=function(e,t,i,s){o(e),t&&i&&n.setCookie(t,i,{expires:s})};t.loadStyleSheet=function(e,t,i,n,o){var a=document.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.setAttribute("href",e),a.setAttribute("id","onLoadCss"),a.onload=function(){s(t,i,n,o)},document.head.appendChild(a)},t.cssBuilder=function(){var e=document.getElementsByClassName("q-inline-css"),t=document.getElementById("onLoadCss"),i=document.getElementById("inlineCssLoader"),n=!!i,o=0===e.length;if(!n)return"";if(n&&o)return[t.outerHTML];for(var s=[],a=0;a<e.length;a++)s.push(e[a].outerHTML);return s.push(i.outerHTML),s}},"./shared/jquery.js":function(e,t,i){var n=(i("./settings-webpack.js"),i("./shared/errors.js"),i("./third_party/jquery3.js"));i("./shared/client.js");window.jQuery=n;var o=n.fn.offset,s=function(){var e,t=this[0],i={top:0,left:0};return t&&t.nodeType?(e=(t.ownerDocument||document).documentElement,n.contains(e,t)?o.apply(this,arguments):i):i;
};n.fn.on,n.fn.off;n.fn.offset=s,e.exports=n},"./shared/keyboard_event_handler.js":function(e,t,i){var n=i("./shared/jquery.js"),o=[];t.push=function(e){o.push(e)},t.remove=function(e){var t=o.indexOf(e);t>-1&&o.splice(t,1)},n(document).on("keydown",function(e){for(var t=o.length-1;t>=0;t--){var i=o[t](e);if(0==i||e.isDefaultPrevented())return}})},"./shared/keystrokes.js":function(e,t){function i(e,t){for(var i=0,o=n.length;o>i;++i)n[i].trigger(e,t)}var n=[];document.addEventListener("keydown",function(e){e.target&&!e.target.getAttribute("contenteditable")&&"INPUT"!==e.target.nodeName&&i(e.keyCode||e.charCode,e)});var o=function(e,t){this.codes=e,this.matchHandler=t,this.position=0};o.prototype.trigger=function(e,t){e===this.codes[this.position]?this.position+=1:this.position=0,this.position===this.codes.length&&(this.matchHandler(t),this.position=0)},t.on=function(e,t){e="number"==typeof e?[e]:e.slice(0),n.push(new o(e,t))}},"./shared/lazy_load_images.js":function(e,t,i){function n(e){
e.getAttribute("data-src")&&(e.setAttribute("src",e.getAttribute("data-src")),e.removeAttribute("data-src"),e.addEventListener("load",function(){e.style.opacity=1;var t=e.previousElementSibling;t&&t.classList.contains("qtext_image_placeholder")&&setTimeout(function(){t.style.visibility="hidden"},1e3)}))}function o(){for(var e=document.querySelectorAll("img[data-src]"),t=0;t<e.length;t++)n(e[t])}function s(){o(),a.insertionQ("img").every(function(e){n(e)}),setInterval(o,d)}var a=i("./third_party/insertion_query.js"),r=i("./shared/onload.js"),d=2e3;r.execAfterLoad(s)},"./shared/linkify.js":function(e,t){t.iterLinks=function(e,t){i(e,{callback:function(e,i){return i&&t(i,e),""}})};var i=t.linkify=function(){var e="[a-z\\d.-]+://",t="(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)+",i="(?:ac|ad|aero|ae|af|ag|ai|al|am|an|ao|aq|arpa|ar|asia|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|biz|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|cat|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|coop|com|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|info|int|in|io|iq|ir|is|it|je|jm|jobs|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mobi|mo|mp|mq|mr|ms|mt|museum|mu|mv|mw|mx|my|mz|name|na|nc|net|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pro|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tel|tf|tg|th|tj|tk|tl|tm|tn|to|tp|travel|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|xn--0zwm56d|xn--11b5bs3a9aj6g|xn--80akhbyknj4f|xn--9t4b11yi5a|xn--deba0ad|xn--g6w251d|xn--hgbk6aj7f53bba|xn--hlcj6aya9esc7a|xn--jxalpdlp|xn--kgbechtv|xn--zckzah|ye|yt|yu|za|zm|zw)",n="(?:"+t+i+")",o="(?:[;/][^#?<>\\s\\[\\]]*)?",s="(?:\\?[^#<>\\s]*)?(?:#[^<>\\s]*)?",a="\\b"+e+"[^<>\\s\\[\\]]+",r="\\b"+n+o+s+"(?!\\w)",d="mailto:",l="(?:"+d+")?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@"+n+s+"(?!\\w)",c=new RegExp("(?:"+a+"|"+r+"|"+l+")","ig"),u=new RegExp("^"+e,"i"),h={
"'":"`",">":"<",")":"(","]":"[","}":"{","»":"«","›":"‹"},p={callback:function(e,t){return t?'<a href="'+t+'" title="'+t+'">'+e+"</a>":e},punct_regexp:/(?:[!?.,:;'"]|(?:&|&amp;)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)$/};return function(e,t){t=t||{};var i,n,o,s,a,r,l,f,_,m,g,v,w="",b=[];for(n in p)void 0===t[n]&&(t[n]=p[n]);for(;i=c.exec(e);)if(o=i[0],r=c.lastIndex,l=r-o.length,!/[\/:]/.test(e.charAt(l-1))){do f=o,v=o.substr(-1),g=h[v],g&&(_=o.match(new RegExp("\\"+g+"(?!$)","g")),m=o.match(new RegExp("\\"+v,"g")),(_?_.length:0)<(m?m.length:0)&&(o=o.substr(0,o.length-1),r--)),t.punct_regexp&&(o=o.replace(t.punct_regexp,function(e){return r-=e.length,""}));while(o.length&&o!==f);s=o,u.test(s)||(s=(-1!==s.indexOf("@")?s.indexOf(d)?d:"":s.indexOf("irc.")?s.indexOf("ftp.")?"http://":"ftp://":"irc://")+s),a!=l&&(b.push([e.slice(a,l)]),a=r),b.push([o,s])}for(b.push([e.substr(a)]),n=0;n<b.length;n++)w+=t.callback.apply(window,b[n]);return w||e}}()},"./shared/links_logger.js":function(e,t,i){
var n=i("./shared/links.js"),o=i("./shared/logging.js"),s=i("./shared/siteuri.js"),a=function(e,t){s.isSiteUrl(e)||o.log("link_click",{url:e,answer_context:t,current_url:window.location.href})};n.onLinkClick(a)},"./shared/loading.js":function(e,t){t.createDots=function(e){e=e||"regular";var t=document.createElement("div");t.className="LoadingDots "+e;var i=document.createElement("div");i.className="dot first";var n=document.createElement("div");n.className="dot second";var o=document.createElement("div");return o.className="dot third",t.appendChild(i),t.appendChild(n),t.appendChild(o),t}},"./shared/loadjs.js":function(e,t,i){var n=i("./shared/util.js"),o=i("./shared/onload.js");t.loadJS=function(e,t){var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,t&&(i.onload=i.onreadystatechange=n.once(t));var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(i,o)};var s=function(e){var t=document.createElement("object");t.data=e,t.type="application/javascript",
t.width=0,t.height=0,document.body.appendChild(t)};t.lazyPrefetchJS=function(e){o.execAfterLoadDelayed(function(){s(e)})}},"./shared/log.js":function(e,t,i){!function(e){var n=new Date,o=function(e){return Array.prototype.join.call(e," ")},s=i("./shared/util.js"),a=e.log=t.log=function(){return a.log.apply(a,arguments)},r=e.console,d=r||{},l=window&&"Microsoft Internet Explorer"==window.navigator.appName;if(l){var c=/MSIE ([0-9]{1,}[.0-9]{0,})/;null!==c.exec(window.navigator.userAgent)&&parseFloat(RegExp.$1)>=8?(d={},d.log=function(){r&&r.log&&r.log(o(arguments))},d.info=function(){r&&r.log&&r.info(o(arguments))},d.warn=function(){r&&r.log&&r.warn(o(arguments))},d.error=function(){r&&r.log&&r.error(o(arguments))}):d={}}var u=["log","info","warn","error"],h=function(){};for(var p in u){var f=u[p];d[f]||(d[f]=h)}var _=function(e){void 0===e&&(e=null),this.level=e,this.children={}};_.prototype.setLevel=function(e,t,i){var n=this.tryGetChild(e,i);return null===n?(void 0===t&&(t=null),void(this.level=t)):(void 0===n.child&&(this.children[n.name]=n.child=new _),
n.child.setLevel(e,t,n.continueFrom),void this.optimize(n.name))},_.prototype.removeChildren=function(e,t){var i=this.tryGetChild(e,t);return null===i?void(this.children={}):void(void 0!==i.child&&(i.child.removeChildren(e,i.continueFrom),this.optimize(i.name)))},_.prototype.optimize=function(e){var t=this.children[e];void 0!==t&&null===t.level&&0===t.childCount()&&delete this.children[e]},_.prototype.childCount=function(){var e=0;for(var t in this.children)this.children.hasOwnProperty(t)&&e++;return e},_.prototype.getLevel=function(e,t){var i=this.tryGetChild(e,t);if(null===i||void 0===i.child)return this.level;var n=i.child.getLevel(e,i.continueFrom);return null!==n?n:this.level},_.prototype.print=function(e,t,i){var n=null===this.level?i:this.level;a.console.log(e+t+": "+a.level.toString(n)+(null===this.level?" (inherited)":""));for(t in this.children){var o=this.children[t];o.print(e+"  ",t,n)}},_.prototype.tryGetChild=function(e,t){if("string"!=typeof e)throw new Error("Scope must be string.");
if(t=t||0,t>=e.length)return null;var i=e.indexOf(".",t),n=null;return 0>i?(i=e.length,n=e.substr(t,i-t)):(n=e.substr(t,i-t),i++),{name:n,child:this.children[n],continueFrom:i}};var m=function(e,t,i){this.time=new Date,this.level=e,this.scope=t,this.data=i,this.message=o(i)};m.prototype.toString=function(){return a.level.toString(this.level).concat(" ",this._timeToString(),", ",this.scope,": ",this.message)},m.prototype.print=function(){var e="trace"==this.level?"log":this.level;a.console[a.level.toString(e)].apply(a.console,[this._timeToString()+", "+this.scope+":"].concat(this.data))},m.prototype.checkScope=function(e){return this.scope==e||this.scope.startsWith(e+".")},m.prototype._timeToString=function(){return((this.time-n)/1e3).toString()+"s"};var g=function(e){this.list=e||[]};g.prototype.toString=function(){return this.list.join("\r\n")},g.prototype.print=function(){for(var e in this.list)this.list[e].print()},g.prototype.add=function(e){return this.list.push(e)},g.prototype.count=function(){
return this.list.length},g.prototype.getLast=function(){return 0===this.list.length?null:this.list[this.list.length-1]},g.prototype.clear=function(){this.list=[]},g.prototype.filter=function(e,t){var i,n;if("function"==typeof e)return i=Array.prototype.filter.apply(this.list,arguments),new g(i);void 0===t&&"string"==typeof e&&(t=e,e=null);var o="number"==typeof e;if(!o){var s={};for(n in e)s[e[n]]=e[n];e=s}i=[];for(n in this.list){var a=this.list[n];(null===e||void 0===e||(o?!(a.level<e):a.level in e))&&(null===t||void 0===t||a.checkScope(t))&&i.push(a)}return new g(i)};var v={enabled:null,outputEnabled:!0,entries:new g,level:{none:0,trace:1,log:2,info:3,warn:4,error:5,toString:function(e){switch(e){case 0:return"none";case 1:return"trace";case 2:return"log";case 3:return"info";case 4:return"warn";case 5:return"error";default:throw new Error("Unknown log.level value.")}}},scopes:{root:new _(0),cache:{},setLevel:function(e,t){this.root.setLevel(e,t),this.cache={}},resetLevel:function(e,t){
this.root.removeChildren(e),this.root.setLevel(e,t),this.cache={}},removeChildren:function(e){this.root.removeChildren(e),this.cache={}},getLevel:function(e){return void 0===this.cache[e]&&(this.cache[e]=this.root.getLevel(e)||a.level.none),this.cache[e]},hasLevel:function(e,t){var i=this.getLevel(e);return t>=i&&i!=a.level.none},print:function(e){a.console.log("Log scopes:"),this.root.print("  ","(root)")}},enabledImpl:{console:d,trace:function(e){var t=this._tryAddLogEntry(a.level.log,e,Array.prototype.slice.call(arguments,1));return null===t?null:(a.outputEnabled&&(a.console.trace?a.console.trace():a.console.log.call(a.console,("Stack trace:\r\n"+a._getStackTrace()).replace("\r\n","\r\n  "))),t)},log:function(e){return this._tryAddLogEntry(a.level.log,e,Array.prototype.slice.call(arguments,1))},info:function(e){return this._tryAddLogEntry(a.level.info,e,Array.prototype.slice.call(arguments,1))},warn:function(e){return this._tryAddLogEntry(a.level.warn,e,Array.prototype.slice.call(arguments,1));
},error:function(e){return this._tryAddLogEntry(a.level.error,e,Array.prototype.slice.call(arguments,1))},_tryAddLogEntry:function(e,t,i){if(!a.scopes.hasLevel(t,e))return null;var n=new m(e,t,i);return a.entries.add(n),a.outputEnabled&&n.print(),n},_getStackTrace:function(){var e=[],t=!1;try{o.dont.exist+=0}catch(i){var n,o,s;if(i.stack){for(n=i.stack.split("\n"),o=0,s=n.length;s>o;o++)n[o].match(/^\s*[A-Za-z0-9\-_\$]+\(/)&&e.push(n[o]);e.shift(),t=!0}else if(window&&window.opera&&i.message){for(n=i.message.split("\n"),o=0,s=n.length;s>o;o++)if(n[o].match(/^\s*[A-Za-z0-9\-_\$]+\(/)){var a=n[o];n[o+1]&&(a+=" at "+n[o+1],o++),e.push(a)}e.shift(),t=!0}}if(!t)for(var r=arguments.callee.caller;r;){var d=r.toString(),l=d.substring(d.indexOf("function"),d.indexOf("{"))||"anonymous";e.push(l),r=r.caller}return e.join("\r\n")}},disabledImpl:{console:{log:function(){},trace:function(){},info:function(){},warn:function(){}},log:function(){},trace:function(){},info:function(){},warn:function(){},error:function(){}
},enable:function(e){if(e=void 0===e?!0:e,a.enabled!==e){a.enabled=e;var t=e?a.enabledImpl:a.disabledImpl;s.extend(a,t)}},disable:function(){a.enable(!1)},enableOutput:function(e){e=null===e?!0:e,a.outputEnabled=e},disableOutput:function(){a.enableOutput(!1)},resetSettings:function(){i("./shared/log.settings.js").resetSettings(a),a("log.resetSettings","Settings are reset to default.")}};s.extend(a,v),a.resetSettings()}(window)},"./shared/log.settings.js":function(e,t,i){t.resetSettings=function(e){var t,n,o=i("./gating-webpack.js").client_side_logging;if(e.enable(!!o),o){e.scopes.resetLevel("",e.level.error);for(t in o)n=o[t],e.scopes.resetLevel(t,e.level[n])}}},"./shared/logging.js":function(e,t,i){function n(){g.messages().length>=m?s():o()}function o(){_||(_=setTimeout(s,h.client_side_batched_logging_interval))}function s(){if(_&&(clearTimeout(_),_=!1),0!==g.messages().length){var e=g.messages();g.clear();var t="";h.client_side_batched_logging_use_log_end_point&&"quora.com"==p.subdomain_suffix&&(t+=[window.location.protocol,"//",u.netlocForSubdomainName("log")].join("")),
t+="/ajax/batched_log_POST";var i=c.rpc(t);f.isIOSApp()&&i.appFields({maxRetries:1,persistent:!0}),i.xhrFields({withCredentials:!0}).kwargs({messages:e,nid:p.nid}).success(a.bind(this,e)).error(r.bind(this,e)).send()}}function a(){}function r(e){e&&g.concat(e)}i("./shared/qlocal_storage.js");var d=i("./shared/window_manager.js"),l=i("./shared/util.js"),c=i("./shared/core/rpc.js"),u=i("./shared/siteuri.js"),h=i("./gating-webpack.js"),p=i("./settings-webpack.js"),f=i("./shared/client.js"),_=!1,m=50;t.log=function(e,t,i){i||(i={});var o={sampleRate:1,sendImmediately:!1,scribeOnly:!1};i=l.extend(o,i),(i.sampleRate<0||i.sampleRate>1)&&(i.sampleRate=1);var a=null;i.scribeOnly?(t.scribe_category=e,a={category:"scribe_only",data:t,time:1e3*Date.now()}):a={category:e,data:t,time:1e3*Date.now()},i.sampleRate>0&&Math.random()<=i.sampleRate&&g.push(a),i.sendImmediately||d.isPendingNavigation()?s():n()};var g={msgBuffer:[],push:function(e){this.msgBuffer.push(e)},messages:function(){return this.msgBuffer;
},clear:function(){this.msgBuffer=[]},concat:function(e){this.msgBuffer=this.msgBuffer.concat(e)}}},"./shared/mathify.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./shared/mathjax.js");t.iterMaths=function(e,t){return r(e,function(e,i){return i&&t(i,e),""})};var s=function(e,t){return e?"<b>"+e+"</b>":t},a=t.getParts=function(e){for(var t,i,n,o,s,a="\\s\\S",r=new RegExp("\\[math\\](["+a+"]+?)\\[\\/math\\]","g"),d=[],l=0;t=r.exec(e);)i=t[0],n=t[1],o=r.lastIndex,s=o-i.length,l!=s&&d.push([e.slice(l,s)]),l=o,d.push([i,n]);return l!=e.length&&d.push([e.substr(l)]),d},r=t.mathify=function(e,t){t=t||s;for(var i=a(e),n="",o=0;o<i.length;o++)n+=t.apply(window,i[o]);return n||e};t.renderMath=function(e){e instanceof n&&(e=e.get(0)),o.onInit(function(){window.MathJax&&MathJax.Hub&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,e])})}},"./shared/mathjax.js":function(e,t,i){var n=i("./shared/util.js"),o=i("./shared/onload.js"),s=i("./shared/loadjs.js").loadJS,a=[],r="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.6.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML,Safe",d=function(){
var e={showMathMenu:!1,messageStyle:"none",errorSettings:l(),"HTML-CSS":c(),tex2jax:u(),TeX:h(),"fast-preview":{disabled:!0}};return"window.MathJax = "+JSON.stringify(e)+";"},l=function(){return{style:{color:"#000000","font-style":"normal"}}},c=function(){return{linebreaks:{automatic:!0,width:"container"},EqnChunk:150,EqnChunkDelay:20}},u=function(){return{inlineMath:[["[math]","[/math]"]],displayMath:[],ignoreClass:"edit_latex|qtext_editor_content|ignore_latex",processClass:"render_latex",preview:"none"}},h=function(){return{noUndefined:{attributes:{mathcolor:"red"}},Macros:{C:"{\\mathbb{C}}",N:"{\\mathbb{N}}",O:"{\\emptyset}",Q:"{\\mathbb{Q}}",R:"{\\mathbb{R}}",Z:"{\\mathbb{Z}}"}}},p=n.once(function(){var e=["color","textDecoration","fontWeight"];MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function(){var t=MathJax.ElementJax.mml.mbase.prototype.HTMLhandleColor;MathJax.ElementJax.mml.mbase.Augment({HTMLhandleColor:function(i){var n=t.call(this,i);return e.forEach(function(e){
i.style[e]&&(i.style[e]="")}),n}})})}),f=n.once(function(){var e=d(),t=document.createElement("script");t.type="text/javascript",t.appendChild(document.createTextNode(e));var i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(t,i),s(r,function(){for(p();a.length;)a.pop().call()})});t.onInit=function(e){window.MathJax&&MathJax.Hub?e():(o.execAfterLoad(f),a.push(e))}},"./shared/modal.js":function(e,t,i){var n,o,s,a=i("./shared/errors.js"),r=i("./shared/events/index.js"),d=(i("./shared/core/component.js"),i("./shared/eventemitter.js")),l=i("./shared/util.js"),c=i("./shared/client.js"),u=i("./shared/Class.js").Class;o=i("./w2.modal.js");var h={},p=function(e){var t;return t=o.Modal.openerFor(e).cid,h[t]};t.handleClose=function(e){var t;t=p(e),t.handleClose(),t.innerModalInstance().close()},t.handleSubmit=function(e,t){var i=p(e);return void i.handleSubmit(t)},t.fromComponent=function(e){return new f(e)};var f=u.extend({__init__:function(e){this.component=e,this.emitter=new d.EventEmitter,
h[this.component.cid]=this,this.__id=[l.randomId(),this.component.cid].join("-"),this.__kwargs={},this.__webOnlyOptions=null,this.__loaded=!1,this.__fromServerCall=!1,this.__method=null,this.__vcon=null,this.__fromElement=!1,this.__element=null},innerModalInstance:function(){if(c.isNativeApp())return void a.logJsError("shared/modal","Trying to getModalInstance on native");if(!this.__modal){var e={kwargs:this.__kwargs};e=l.extend(this.__webOnlyOptions||{},e),this.__modal=new o.ModalWithCallBacks(this.component,e)}return this.__modal},load:function(){return this.__loaded?this:(this.__loaded=!0,this.innerModalInstance().fetch(this.__method),this)},show:function(){if(this.load(),c.isNativeApp()){var e=this;r.GlobalProxy.subscribe(r.Types.MOBILE_APP_MODAL_SUBMIT,function(t){e.handleSubmit(t.payload)},this.__id),r.GlobalProxy.subscribe(r.Types.MOBILE_APP_MODAL_CLOSE,function(){e.handleClose()},this.__id)}return this.innerModalInstance().load(this.__method),this},_addHashMobileWeb:function(){if(c.isMobileWeb()){
var e=0,t=window.location.hash;if(t){var i=t.split("-");if(i.length>1){var o=parseInt(i[1])||0;e=o+1}}t="mwebmodal-"+e,n.addHash(this,t,function(){s.dismissActiveModal()})}},unload:function(){this.emitter.trigger("unload"),h[this.component.cid]=null,c.isMobileWeb()&&n.checkAndDeleteHash(this),c.isNativeApp()&&r.GlobalProxy.unsubscribeAll(this.__id)},onUnload:function(e){return this.emitter.on("unload",e),this},fromElement:function(e,t){return a.logJsError("shared/modal","fromElement only supported in mobile."),this.__fromServerCall&&a.logJsError("shared/modal","Used both fromElement and fromServerCall."),this.__fromElement=!0,this.__element=e,this.__kwargs=t,this},fromServerCall:function(e,t){return this.__fromElement&&a.logJsError("shared/modal","Used both fromElement and fromServerCall."),this.__fromServerCall=!0,this.__vcon=e,this.__method=t,this},kwargs:function(e){return this.__kwargs=e,this},webOnlyOptions:function(e){return this.__webOnlyOptions=e,this},onSubmit:function(e){return this.emitter.on("submit",e),
this},onClose:function(e){return this.emitter.on("close",e),this},handleClose:function(){this.emitter.trigger("close"),this.unload()},handleSubmit:function(e){c.isMobileWeb()&&n.checkAndDeleteHash(this),this.emitter.trigger("submit",[e])}})},"./shared/oauth.js":function(e,t,i){var n=i("./shared/google_.js"),o=i("./shared/facebook.js"),s=i("./settings-webpack.js"),a=!1;t.googleOnLoad=function(e,t,i){},t.googleConnect=function(e,t,i){a=!1;var o=function(e){return a?void 0:(void 0!==e.success&&(a=!0),e&&void 0===e.error&&("AUTO"===e.status.method&&1===e.num_sessions||"PROMPT"===e.status.method)?void t(e):void(e.error&&"immediate_failed"!==e.error&&i()))},r={callback:o,clientid:s.googleClientId,cookiepolicy:s.googleCookiePolicy,scope:e.web_data.scope};e.web_data.prompt_ota_install&&(r.apppackagename=s.androidAppPackageName),n.onInit(function(){window.gapi.auth.setToken(null),window.gapi.auth.signIn(r)})},t.facebookConnect=function(e,t,i){var n=function(e){e&&"connected"==e.status?t(e.authResponse):i();
};o.onInit(function(){FB.login(n,{scope:e.perms})})}},"./shared/paint_timing.js":function(e,t,i){i("./third_party/timing.js"),t.getPaintTimingInformation=function(){return window.timing.getTimes()}},"./shared/perf.js":function(e,t,i){var n={},o=5e3,s=3e4,a=function(e){delete e.id,i("./shared/logging.js").log("perf/post_e2e",e)},r=function(e){if(!e)throw new Error("This method expects an object describing the action.");var t=e.method;if(t.startsWith("log_")||t.startsWith("record_")||t.startsWith("track_"))return null;if(e.startTime=Date.now(),!e.id){var i=1e3*e.startTime+Math.floor(1e3*Math.random());e.id=i.toString(36)}return n[e.id]=e,e},d=function(e){var t=n[e];t&&(t.duration=Date.now()-t.startTime,delete t.startTime,delete n[e],a(t))};t.startPOST=function(e){return e.type="web",r(e)},t.startUserPerceived=function(e){return e.type="user_perceived",r(e)},t.finishAction=function(e){e&&e.id&&d(e.id)},t.cancelAction=function(e){e&&e.id&&delete n[e.id]};var l=function(){for(var e=Date.now(),t=Object.keys(n),i=0;i<t.length;i++){
var o=n[t[i]];e-o.startTime>=s&&(o.timeout=!0,d(o.id))}};setInterval(l,o)},"./shared/prettyprint.js":function(e,t,i){i("./third_party/prettify.js"),t.prettyPrint=window.prettyPrint},"./shared/qlocal_storage.js":function(e,t,i){function n(){try{if(window.localStorage)return!0}catch(e){return!1}return!1}var o=i("./shared/client.js"),s=null;t.storageAvailable=function(){return n()?!0:s&&o.isNativeApp()?!0:!1},t.setItem=function(e,t){if(n())try{window.localStorage.setItem(e,t)}catch(i){if("NS_ERROR_FILE_CORRUPTED"===i.name)return;throw i}else s&&o.isNativeApp()&&s.setItem(e,t)},t.getItem=function(e,t){if(n()){var i=window.localStorage.getItem(e);t(i)}else s&&o.isNativeApp()&&s.getItem(e,function(e){e.success&&t(e.value)})}},"./shared/qtext.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./shared/mathify.js").renderMath,s=i("./shared/core/component.js"),a=i("./shared/twitter_oembed.js"),r=i("./unified_view/qtext_video.js"),d=i("./shared/prettyprint.js").prettyPrint,l=function(e,t,i){var o=n(e);
o.find(t).not(".qt-processed").each(function(e,t){i(t)}),o.find(t).addClass("qt-processed")},c=t.renderQText=function(){l(document,".render_latex",o),l(document,".twitter-tweet",a.loadEmbeds),l(document,"[data-qt-video]",r.setupPlayer),l(document,"[data-qt-pending-video-client-uuid]",r.updateUploadProgress),d()};t.ignoreNode=function(e){var t=function(){};l(e,".twitter-tweet",t),l(e,"[data-qt-video]",t),n(e).find(".render_latex").addClass("ignore_latex").removeClass("render_latex")},t.unIgnoreNode=function(e){n(e).find(".qt-processed").removeClass("qt-processed"),n(e).find(".ignore_latex").addClass("render_latex").removeClass("ignore_latex")},t.init=function(){s.registerAfterOnLoadCallback(c)}},"./shared/recaptcha.js":function(e,t,i){var n=i("./settings-webpack.js"),o=i("./shared/util.js"),s=i("./shared/loadjs.js").loadJS,a=i("./shared/onload.js"),r=!1,d=[],l=o.once(function(){var e=["https://www.google.com/recaptcha/api.js?","hl="+n.interfaceLanguage,"&onload=onCaptchaLoadedCallback","&render=explicit"].join("");
window.onCaptchaLoadedCallback=function(){for(r=!0;d.length;)d.pop().call()},s(e)});t.onInit=function(e){r?e():(d.push(e),a.execAfterLoadDelayed(l))}},"./shared/resource_timing.js":function(e,t){var i=["name","initiatorType","connectStart","connectEnd","domainLookupStart","domainLookupEnd","duration","fetchStart","redirectEnd","redirectStart","requestStart","responseEnd","responseStart","secureConnectionStart","startTime","workerStart","transferSize","encodedBodySize","decodedBodySize","entryType"];t.getResourceTimingInformation=function(){var e=[],t=window.performance;if(t&&t.getEntriesByType)for(var n=t.getEntriesByType("resource"),o=0;o<n.length;o++){for(var s=n[o],a={},r=0;r<i.length;r++){var d=i[r];d in s&&(a[d]=s[d])}e.push(a)}return e}},"./shared/rpc_manager.js":function(e,t,i){var n=i("./shared/core/rpc.js"),o=i("./interface/settings.js"),s=i("./shared/errors.js"),a=i("./shared/debounce.js").debounce,r=i("./shared/Class.js").Class.extend({__init__:function(){this._urlToBatchedUrl={},
this._pendingRequests={},this._makeBatchRequests={},this._debounceWait=10,this._registerUrlToBatchedUrl(o.serverCallUrl,o.batchedServerCallUrl),this._registerUrlToBatchedUrl("/api/rerender_component_POST","/api/batched_rerender_component_POST")},_registerUrlToBatchedUrl:function(e,t){this._urlToBatchedUrl[e]=t,this._pendingRequests[e]=[],this._makeBatchRequests[e]=this._getBatchRequestFunction(e)},_shouldBatchRequest:function(e){return e._url()in this._urlToBatchedUrl},enqueue:function(e){return this._shouldBatchRequest(e)?(this._pendingRequests[e._url()].push({request:e,data:this._getDataObject(e),success:this._getSuccessCallback(e),error:this._getErrorCallback(e)}),void this._makeBatchRequests[e._url()]()):e.send()},_getDataObject:function(e){var t=e._data();return delete t.formkey,delete t.window_id,delete t.referring_controller,delete t.referring_action,t},_getSuccessCallback:function(e){return function(t){e._successHandler({value:t}),e._completeHandler()}},_getErrorCallback:function(e){
return function(){e._beforeErrorHandler.apply(e,arguments),e._error()(),e._completeHandler()}},_getBatchRequestFunction:function(e){var t=this;return a(function(){var i=t._pendingRequests[e];if(t._pendingRequests[e]=[],1===i.length)return void i[0].request.send();var o=i.map(function(e){return e.data}),a=function(e){i.forEach(function(t){t.error(e)})},r=function(e){i.forEach(function(t,i){try{t.success(e[i])}catch(n){s.report(n)}})};n.rpc(t._urlToBatchedUrl[e]).kwargs({requestsData:o}).success(r).error(a).send()},t._debounceWait)}}),d=new r;t.enqueueRequest=function(e){d.enqueue(e)}},"./shared/scaled_inference.js":function(e,t,i){var n=[],o=!1,s=i("./shared/loadjs.js").loadJS,a=i("./shared/onload.js"),r=i("./shared/util.js"),d=t.load=r.once(function(){a.execAfterLoadDelayed(function(){var e="https://amp.ai/libs/39b7bb0abd974a9a.js";s(e,function(){for(o=!0;n.length;)n.pop().call()})})});t.onApiLoaded=function(e){return o?void e():(d(),void n.push(e))}},"./shared/scroll_animation_handler.js":function(e,t){
t.add=function(e,t){var i,n=!1,o=function(){i=e.scrollY,void 0===i&&(i=e.scrollTop),n||requestAnimationFrame(function(){n=!1,t(i)}),n=!0};return e.addEventListener("scroll",o),o(),o}},"./shared/siteuri.js":function(e,t,i){function n(e){this.message=this.errorType+": "+e}function o(e){return"http:"==e.substring(0,5)?"https:"+e.substring(5):e}function s(e){var t=e.match(l);if(!t)return!1;var i=t[1],n=t[2],o=r();if("www."+n!=o){if("www"!=i&&i&&"www."+i+"."+n==o){var s=e.replace("://","://www.").match(l);if(s)return s}return!1}return t}var a=i("./settings-webpack.js");n.prototype=new Error,n.prototype.errorType="SiteURIError",n.prototype.constructor="SiteURIError",t.SiteURIError=n;var r=function(e,t){var i;return i=t?"quora.com":a.subdomain_suffix||"quora.com",e?e+"."+i:"www."+i};t.netlocForSubdomainName=r;var d=function(e,t){return"http://"+r(e,t)+"/"};t.baseUrlForSubdomainName=d;var l=/https?:\/\/(?:([^.\/]+)\.)?((?:[^.\/]+\.)*quora\.com(?::[0-9]*)?)(\/.*)?/,c=function(e){return s(e)!==!1;
};t.isSiteAbsoluteUrl=c;var u=function(e){return e.startsWith("/")&&!e.startsWith("//")};t.isSiteRelativeUrl=u;var h=function(e){return c(e)||u(e)};t.isSiteUrl=h;var p=function(e,t){return new f(e,t)};t.URI=p;var f=i("./shared/Class.js").Class.extend({__init__:function(e,t){e instanceof f&&(e=e.unicode());var i,o=s(e),r=t&&t.subdomainName||null,d=t&&t.secure||!1;if(o){if(r)throw new n("subdomain context should not be set for absolute url, url = "+e+", subdomain = "+r);r=o[1],"www"==r&&(r=null),i=o[3]||"",""===i&&(i="/"),"https"==e.substring(0,5)&&(d=!0)}else i=e;if("/"!=i[0])throw new n("invalid site uri input "+e);return this.relativeUrl=i,this.subdomainName=r,this.subdomainName||(this.subdomainName=a.subdomain_of_network),this.isSecure=d,this},unicode:function(e){if(a.force_use_absolute_links)return this.absolute(e);var t=this.relativeUrl;return(this.subdomainName||a.subdomain_name)&&(t=d(this.subdomainName,e)+t.substring(1),"/"==t.charAt(t.length-1)&&(t=t.substring(0,t.length-1))),this.isSecure&&(t=o(t)),
t},absolute:function(e){var t=d(this.subdomainName,e),i=t+this.relativeUrl.substring(1);return this.isSecure&&(i=o(i)),i},secure:function(e){return o(this.absolute(e))}});t.SiteURI=f},"./shared/skyfall.js":function(e,t,i){function n(){return window.performance&&window.performance.now&&window.performance.timing?window.performance.timing.navigationStart+window.performance.now():Date.now()}function o(e,t,i,n){a.log("skyfall",{request_id:e,metric_type:t,metric_name:i,value:n})}function s(e){return!isNaN(parseFloat(e))&&isFinite(e)}var a=i("./shared/logging.js"),r=i("./settings-webpack.js"),d=i("./shared/errors.js"),l={};t.logMarker=function(e,t){var i=r.request_id;return t||(t=n()),s(t)?void o(i,"marker",e,t):void d.logJsError("skyfall#logMarker","value for a marker must be a number: "+e+" "+t)};var c=t.logRange=function(e,t){var i=r.request_id;return t.startTime&&t.endTime?void o(i,"range",e,t):void d.logJsError("skyfall#logRange","value must have startTime and endtime")};t.logRangeStart=function(e,t){
return t||(t=n()),s(t)?void(l[e]=t):void d.logJsError("skyfall#logRangeStart","value for a rangeStart must be a number.")},t.logRangeEnd=function(e,t){if(t||(t=n()),!s(t))return void d.logJsError("skyfall#logRangeEnd","value for a rangeEnd must be a number.");var i=l[e];return i?void d.logJsError("skyfall#logRangeEnd","logRangeStart was not called for this metric: "+e):(c(e,{startTime:i,endTime:t}),void delete l[e])},t.logMeta=function(e,t){var i=r.request_id;o(i,"meta",e,t)},t.logResourceTiming=function(){var e=r.request_id;window.performance&&window.performance.getEntriesByType&&o(e,"resourceTiming","resourceTiming",window.performance.getEntriesByType("resource"))}},"./shared/stripeLoader.js":function(e,t,i){var n=i("./settings-webpack.js"),o=i("./shared/util.js"),s=i("./shared/loadjs.js").loadJS,a="https://js.stripe.com/v2/";t.load=o.once(function(){s(a,function(){Stripe.setPublishableKey(n.stripePublishableKey)})})},"./shared/toast.js":function(e,t,i){var n=i("./shared/Class.js").Class,o=i("./interface/settings.js"),s=(i("./shared/client.js"),
o.interface_strings),a=i("./shared/jquery.js"),r=null,d=t.Toast={show:function(){null!==r&&r.close(),r=this,this.closeTimeout=setTimeout(this.close.bind(this),3e3)},close:function(){clearTimeout(this.closeTimeout),r=null,0!==this.$container.length&&(this.$container.addClass("animate_out"),this.$container.css("paddingBottom",""),setTimeout(this.cleanup.bind(this),1e3))},cleanup:function(){var e=this.$container.get(0);e.parentNode&&e.parentNode.removeChild(e)}},l=n.extend(d).extend({__init__:function(e,t){this.additionalClasses=t||[],this.message=e,this.$container=a(this.render())},render:function(){var e=document.getElementById("pmsg_container");e||(e=document.createElement("div"),e.id="pmsg_container",document.body.appendChild(e)),e.className="PMsgContainer";var t=document.createElement("div");t.className=["PMsg"].concat(this.additionalClasses).join(" "),e.appendChild(t);var i=document.createElement("div");return i.className="contents",a(i).text(this.message),t.appendChild(i),t}});t.show=function(e){
var t=new l(e);t.show()};var c=t.showError=function(e){var t=new l(e,["PMsgError"]);t.show()};t.showPleaseTryAgainError=function(){c(s.please_try_again)}},"./shared/twitter.js":function(e,t,i){var n=i("./shared/onload.js"),o=i("./shared/util.js"),s=i("./shared/loadjs.js").loadJS,a=!1,r=[],d=o.once(function(){var e=window.twttr={_events:[],ready:function(t){e._events.push(t)}};s("//platform.twitter.com/widgets.js",function(){window.twttr.ready(function(e){for(a=!0;r.length;)r.pop().call()})})});t.onInit=function(e){a?e():(r.push(e),n.execAfterLoadDelayed(d))}},"./shared/twitter_oembed.js":function(e,t,i){function n(e,t,i){var n=a(e);n?t(n,!1):o(e,function(n){if(n){var o=document.createElement("iframe");o.className="tweet-content",o.srcdoc=n.html,t(o,!0),s(e,o)}else i(null)},i)}function o(e,t,i){r.rpc("/twitter/get_twitter_oembed_json_POST").kwargs({url:e}).success(function(e){"error"in e?i(e):t(e)}).error(i).send()}function s(e,t){var i=h[e];i?i.push(t):h[e]=[t]}function a(e){for(var t=h[e]||[],i=0;i<t.length;i++){
var n=t[i],o=n.getElementsByTagName("twitterwidget");if(!n.isConnected&&o.length>0)return n}return null}var r=i("./shared/core/rpc.js"),d=i("./shared/twitter.js"),l=i("./shared/client.js"),c=i("./settings-webpack.js"),u=i("./shared/errors.js"),h={};t.getTweetData=n;var p=t.loadEmbeds=function(e){_()&&d.onInit(function(){window.twttr&&window.twttr.widgets?window.twttr.widgets.load(e):u.logJsError("Twitter","Error: Twitter JS initialized but widgets not available")})},f=function(e){d.onInit(function(){window.twttr&&window.twttr.events?window.twttr.events.bind("loaded",e):u.logJsError("Twitter","Error: Twitter JS initialized but events not available")})};t.renderTweetIFrame=function(e){e.onload=function(){var t=e.contentDocument||e.contentWindow.document;f(function(){e.style.height=t.body.scrollHeight+"px"}),p(t.body)}};var _=t.tweetsEnabled=function(){return!(l.isIOSApp()&&c.buildNumber<742)}},"./shared/upload.js":function(e,t,i){var n=i("./settings-webpack.js"),o=i("./shared/siteuri.js"),s=i("./gating-webpack.js"),a=i("./shared/jquery.js"),r=function(e){
return!s.use_webupload||s.use_webupload<Math.random()?e:"quora.com"!=n.subdomain_suffix?e:[window.location.protocol,"//",o.netlocForSubdomainName("upload"),e].join("")};t.uploadData=function(e,t,i,o){var s=new window.FormData;s.append("formkey",n.formkey);for(var d=Object.keys(e),l=0;l<d.length;l++)s.append(d[l],e[d[l]]);for(var c=0;c<t.length;c++)s.append("file",t[c]);s.append("nid",n.nid),a.ajax({method:"POST",processData:!1,contentType:!1,url:r("/_/imgupload/upload_POST"),data:s,xhrFields:{withCredentials:!0},success:function(e){e.success?i(e):o(e)},error:o})},t.uploadBlob=function(e,t,i){var o=new window.FormData;o.append("formkey",n.formkey),o.append("blob",e),a.ajax({method:"POST",processData:!1,contentType:!1,url:r("/_/avupload/upload_POST"),data:o,xhrFields:{withCredentials:!0},success:function(e){e.success?t(e):i(e)},error:i})},t.uploadVideoMetadata=function(e,t,i){a.ajax({method:"POST",dataType:"json",url:r("/_/avupload/metadata_POST"),data:{formkey:n.formkey,json:JSON.stringify({
kwargs:e})},xhrFields:{withCredentials:!0},success:t,error:i})},t.uploadClipChunk=function(e,t,i,o,s){var d=new window.FormData;d.append("formkey",n.formkey),d.append("chunk",e),d.append("clip_id",t),d.append("file",i),a.ajax({method:"POST",dataType:"json",processData:!1,contentType:!1,url:r("/_/avupload/chunk_POST"),data:d,xhrFields:{withCredentials:!0},success:o,error:s})}},"./shared/util.js":function(e,t,i){var n=i("./shared/errors.js");t.extend=function(e,t){e=e||{};for(var i=1;i<arguments.length;i++)if(arguments[i])for(var n in arguments[i])arguments[i].hasOwnProperty(n)&&(e[n]=arguments[i][n]);return e},t.documentFragmentFromString=function(e){var t=document.createElement("div");t.innerHTML=e;for(var i=document.createDocumentFragment(),n=t.firstChild,o=null;n;)o=n.nextSibling,i.appendChild(n),n=o;return i};var o=t.isPlainObject=function(e){if("[object Object]"!=Object.prototype.toString.call(e))return!1;var t=e.constructor;if("function"!=typeof t)return!1;var i=t.prototype;return"[object Object]"!=Object.prototype.toString.call(i)?!1:i.hasOwnProperty("isPrototypeOf")===!1?!1:!0;
},s=t.cloneObject=function(e){if(!Array.isArray(e)&&!o(e))return e;for(var t=e.constructor(),i=Object.keys(e),n=0;n<i.length;n++){var a=i[n];t[a]=s(e[a])}return t};t.firstScrollingParent=function(e){var t=null;for(e&&(t=e.parentNode);t&&t!==document.body;){var i=window.getComputedStyle(t);if(i){var n=i.getPropertyValue("overflow-y");if("scroll"==n||"auto"==n)return t}t=t.parentNode}return document.body},t.makeEnum=function(e){var t={},i=Array.isArray(e);for(var n in e)e.hasOwnProperty(n)&&(n=i?e[n]:n,t[n]=n);return t},t.once=function(e){var t;return function(){t||(t=!0,e.apply(this,arguments))}};var a=0;t.randomId=function(e){return e=e||"",[e,a++,Math.floor(4294967296*Math.random())].join("-")},t.uuid4=function(){var e=Date.now();return"undefined"!=typeof window.performance&&"function"==typeof window.performance.now&&(e+=window.performance.now()),"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(t){var i=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?i:3&i|8).toString(16);
})},t.escapeHTML=function(e){return e=e.replace(/&/g,"&amp;"),e=e.replace(/</g,"&lt;"),e=e.replace(/>/g,"&gt;")},t.iterItems=function(e,t){if(!o(e))return void n.logJsError("util.iterItems expects a plain object. got "+e);for(var i=Object.keys(e),s=0;s<i.length;s++)t.call(null,i[s],e[i[s]])},t.getLocation=function(e){var t=e.match(/^(https?\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/);return t&&{protocol:t[1],host:t[2],hostname:t[3],port:t[4],pathname:t[5],search:t[6],hash:t[7]}}},"./shared/viewport.js":function(e,t,i){var n=i("./shared/dom.js"),o=i("./shared/jquery.js"),s=i("./shared/window_manager.js"),a=function(e){var t=e.getBoundingClientRect(),i=0==t.bottom&&0==t.right&&0==t.top&&0==t.left;return i},r=function(e){if(a(e))return!1;var t=e.getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,o=function(e,t){return document.elementFromPoint(e,t)};if(t.right<0||t.bottom<0||t.left>i||t.top>n)return!1;
var s=5;return e.contains(o(t.left+s,t.top+s))||e.contains(o(t.right-s,t.top+s))||e.contains(o(t.right-s,t.bottom-s))||e.contains(o(t.left+s,t.bottom-s))};t.isElementInViewport=function(e){return e?r(e):!1};var d=null;t.siteHeaderHeight=function(){return null===d&&(d=o(".SiteHeader").height()),d},t.setPageScroll=function(e){var t=o("body"),i=o(".SiteHeader"),s=n.getScrollbarWidth();e?(t.removeClass("modal_prevent_scroll"),t.css("padding-right",0),i.css("padding-right",0)):(t.addClass("modal_prevent_scroll"),t.css("padding-right",s+"px"),i.css("padding-right",s+"px"))},t.isElementDefinitelyOutOfViewport=function(e){var t=e.getBoundingClientRect();return t.right<0||t.bottom<0||t.left>o(window).width()||t.top>o(window).height()},t.scrollToElem=function(e){e.jquery||(e=o(e)),e.length>1&&(e=e.get(0));var t=e.offset().top;t-=s.headerOffset+20,window.scroll(0,t)}},"./shared/views.js":function(e,t,i){var n=i("./shared/viewport.js"),o=i("./shared/core/component.js"),s=i("./shared/log.js").log,a=i("./shared/logging.js"),r=i("./shared/window_manager.js"),d=i("./shared/Class.js").Class.extend({
__init__:function(){var e=this;e.trackedKeys={},e.trackedComponents=[],e.lastCheckTime=0,e.rateLimitMs=400;var t=r.getPathName();t.startsWith("/internal/")||document.addEventListener("scroll",e.logViews.bind(e))},addComponentToTrack:function(e){var t=e.view_tracking_key;if(t)this.trackedKeys[t]||(this.trackedKeys[t]=!0,this.trackedComponents.push(e));else if(s&&s.enabled){var i="View tracking key not found for the component. This should be specified in js_data.";s("views",i)}},logViews:function(){var e=Date.now();if(!(e<this.lastCheckTime+this.rateLimitMs)){this.lastCheckTime=e;for(var t=[],i=[],n=[],o=0;o<this.trackedComponents.length;o++){var s=this.trackedComponents[o];s&&this.inViewPort(s)&&(t.push(s.view_tracking_key),i.push(s.view_tracking_hash),void 0!==s.__extra_args&&n.push(s.__extra_args.nid_override),this.trackedComponents[o]=void 0)}var r={keys:t,hashes:i,nid_overrides:n};t.length&&a.log("object_views",{messages:r}),this.trackedComponents=this.trackedComponents.filter(function(e){
return void 0!==e})}},inViewPort:function(e){var t=o.getLiveDomElement(e.cid);return t?n.isElementInViewport(t):!1}});t.viewsLogger=new d},"./shared/w2.context.js":function(e,t,i){var n=i("./shared/Class.js").Class,o=i("./shared/errors.js"),s=n.extend({__init__:function(e){this.value=e,this.handlers={}},bind:function(e,t){this.handlers.hasOwnProperty(t)||(this.handlers[t]=[]),this.handlers[t].push(e)},unbind:function(e){delete this.handlers[e]},trigger:function(){var e=Array.prototype.slice.call(arguments);for(var t in this.handlers)if(this.handlers.hasOwnProperty(t))for(var i=this.handlers[t],n=0;n<i.length;n++)i[n].apply(this,e)},set:function(e){var t=this.value;this.value=e,this.trigger(t,e)},get:function(){return this.value}}),a=t.Context=n.extend({__init__:function(){var e=this.initialProperties();if(!e){var t=["Override initialProperties() in your subclasses to define a list ","of properties that this Context should listen to."].join("");return void o.logJsError("w2.context",t)}this.properties={};
for(var i in e)this.properties[i]=new s(e[i])},initialProperties:function(){},on:function(e,t,i){this.assertPropertyName(e),this.properties[e].bind(t,i)},off:function(e){for(var t in this.properties)this.properties[t].unbind(e)},set:function(e,t){this.assertPropertyName(e),this.properties[e].set(t)},get:function(e){return this.assertPropertyName(e),this.properties[e].get()},assertPropertyName:function(e){if(!this.properties.hasOwnProperty(e)){var t=["Hey, you are trying to access a context property with an invalid ","property name. You can only retrieve property names that are defined ","in the Context initialProperties definition."].join("");o.logJsError("w2.context",t)}}}),r=n.extend({__init__:function(e,t){this._context=e,this._cid=t},on:function(e,t){this._context.on(e,t,this._cid)},off:function(){this._context.off(this._cid)},get:function(e){return this._context.get(e)},set:function(e,t){this._context.set(e,t)}}),d=n.extend({__init__:function(e){this.component=e;var t=this.component.contextConstructor();
this._context=t?new t(this.component):null,this._contextProxies=[]},get:function(e){for(var t=0;t<this._contextProxies.length;t++)if(this._contextProxies[t]._context instanceof e)return this._contextProxies[t];for(var i=null,n=this.component;n&&"*ROOT*"!=n.cid;){var o=n.contextManager._context;if(o instanceof e){i=o;break}var s=n.parent();if(n===s)throw new Error(n+"is its own parent()");n=s}if(!i)return null;var a=new r(i,this.component.cid);return this._contextProxies.push(a),a},unload:function(){for(var e=0;e<this._contextProxies.length;e++)this._contextProxies[e].off()}});t.initComponent=function(e){var t=new d(e);e.contextManager=t,e.getContext=t.get.bind(t)},t.unloadComponent=function(e){e.contextManager&&e.contextManager.unload()},t.ActionBar=a.extend({initialProperties:function(){return{commentsElem:null,loadComments:!1,showComments:!1,feedCommentExpanded:!1,pageFeedCommentsLink:null,feedCommentsPaged:!1,updateSticky:!1,toggleRAD:!1}}}),t.UniversalPageFeedContext=a.extend({initialProperties:function(){
return{feedStories:[],impressionLogger:null,readingTimeLogger:null}}}),t.CaptchaInput=a.extend({initialProperties:function(){return{present:!1,sync:null,isCaptchaFilled:!0,captchaResponse:""}}}),t.HoverMenu=a.extend({initialProperties:function(){return{isShown:!1,hidden:!0}}})},"./shared/window_manager.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./shared/util.js");t.catchRedirectCallback=null;var s=function(e){return/https?:\/\/[a-z.0-9_\.\-]*quora\.com/i.test(e)},a=t.getDomain=function(){return window.location.protocol+"//"+window.location.host+"/"};t.getPathName=function(){return decodeURI(window.location.pathname)};var r=t.getURL=function(){return decodeURI(window.location.href)},d=t.getHash=function(){return window.location.hash},l=t.replaceURL=function(e){window.history&&window.history.replaceState&&window.history.replaceState(window.history.state,null,e)};t.isInHash=function(e){var t=d();if("#"==t.substr(0,1)){t=t.replace("%23","-");for(var i=t.substring(1).split("-"),n=0;n<i.length;n++)if(i[n]==e)return!0;
}return!1};var c=function(e){for(var t={},i=e.split("&"),n=0;n<i.length;n++){var o=i[n],s=o.split("=");t[s[0]]=decodeURIComponent(s[1])}return t};t.parseURLParamsMulti=function(e){e||(e=window.location.search.substring(1));for(var t={},i=e.split("&"),n=0;n<i.length;n++){var o=i[n],s=o.split("=");s[0].length>0&&(s[0]in t||(t[s[0]]=[]),t[s[0]].push(decodeURIComponent(s[1])))}return t};var u=t.parseURLParams=function(e){return e||(e=window.location.search.substring(1)),0===e.length?{}:c(e)};t.parseParams=function(e){var t={};if(e){var i=e.split("?");2==i.length&&(t=c(i[1]))}return t},t.isParamInURL=function(e,t){return e in u(t)},t.addParamToURL=function(e,t,i){var n=encodeURIComponent(t)+"="+encodeURIComponent(i);n=-1==e.indexOf("?")?"?"+n:"&"+n;var o=e.indexOf("#");return-1==o?e+n:e.substring(0,o)+n+e.substring(o)},t.getURLParam=function(e){return u()[e]};var h=function(e,t,i,o,s){var a=[];if(i)for(var r in i)if(i.hasOwnProperty(r)&&null!==i[r])if(s===!0&&n.isArray(i[r]))for(var d=0;d<i[r].length;d++)a.push(r+"="+encodeURIComponent(i[r][d]));else a.push(r+"="+encodeURIComponent(i[r]));
var l=a.join("&"),c=e+t;return l.length>0&&(c+="?"+l),c+=o},p=t.makeURL=function(e,t,i,n){return h(e,t,i,n,!1)},f=t.makeURLMultiParams=function(e,t,i,n){return h(e,t,i,n,!0)},_=t.makeUpdatedURL=function(e){return p(window.location.origin,window.location.pathname,o.extend(u(),e),window.location.hash)};t.updateURLParams=function(e){var t=_(e);return l(t),t},t.replaceURLParamsMulti=function(e){var t=f(window.location.origin,window.location.pathname,e,window.location.hash);return l(t),t},t.addURLParam=function(e,i){var n=u();return n[e]=i,t.updateURLParams(n)},t.removeURLParam=function(e){var i=u();return i[e]=null,t.updateURLParams(i)},t.getTitle=function(){return document.title},t.setTitle=function(e){document.title=e},t.reload=function(){window.location.reload()};var m=!1;t.isPendingNavigation=function(){return m};var g=function(e){return-1!==e.indexOf("quora://")};t.sameDomainURL=function(e){return e&&("/"==e.charAt(0)||new RegExp("^https?://"+window.location.hostname+"/","i").test(a(e)));
};var v=function(e){var t=document.createElement("div");return t.innerHTML="<a></a>",t.firstChild.href=e,t.innerHTML=t.innerHTML,t.firstChild.href};t.navigateTo=function(e){if(""!==e&&"#"!==e&&e!=r()+"#")if(e=v(e),s(e)||g(e)){var i=!0;t.catchRedirectCallback&&(i=t.catchRedirectCallback(e)),i&&(m=!0,window.location=e)}else window.open(e)},t.headerOffset=45,t.actionBarHeight=52,t.scrollContext=60,t.scrollAndFocus=function(e,i){e-=t.headerOffset,e=Math.max(0,Math.min(n(document).height()-n(window).height(),e));var o=Math.min(500,.5*Math.abs(e-n(document).scrollTop())),s=!1;n("html,body").animate({scrollTop:e},o,"swing",function(){if(!s&&n(i).length){var e=window.scrollX,t=window.scrollY;n(i).focus(),window.scrollTo(e,t),s=!0}})},t.scrollIntoView=function(e){var i=n(e).offset().top,o=i-n(document).scrollTop();(o<t.headerOffset||o>n(window).height())&&t.scrollAndFocus(i)}},"./shared/youtube.js":function(e,t,i){var n=i("./shared/loadjs.js").loadJS,o=i("./shared/util.js"),s=i("./shared/onload.js"),a=[],r=!1,d=o.once(function(){
n("//www.youtube.com/player_api",function(){for(r=!0;a.length;)a.pop().call()})});t.onInit=function(e){r?e():(s.execAfterLoadDelayed(d),a.push(e))}},"./simscroll.js":function(e,t){function i(e,t,i,n,o){return[e,!!t,!!i,!!n,!!o].join(" ")}function n(e){var t=e.keyCode||e.charCode,n=Math.round(a.clientHeight-100);switch(i(t,e.shiftKey,e.ctrlKey,e.altKey,e.metaKey)){case r:window.scrollBy(0,-s);break;case d:window.scrollBy(0,s);break;case l:case c:window.scrollBy(0,-n);break;case u:case h:window.scrollBy(0,n);break;default:return!1}return o=!0,!0}var o,s=50,a=document.documentElement,r=i(38),d=i(40),l=i(33),c=i(32,!0),u=i(32),h=i(34);document.addEventListener&&document.addEventListener("keypress",function(e){var t=e.originalTarget||e.target;o||t!==a&&t!==document.body||!n(e)||(e.preventDefault(),e.stopPropagation()),o=!1},!1),t.maybeSimulateScroll=n,t.cancelSimulatedScroll=function(){o=!0}},"./sticky.js":function(e,t,i){var n=i("./shared/debounce.js").debounce,o=i("./shared/jquery.js"),s="sticky",a=[],r=!1;
t.add=function(e){if(e.elem&&e.container){var t=o(e.elem),i=o(e.container),n=o.extend({top:0,bottom:0},e.offsets),d=t.css("position");t.addClass(s);var c=t.outerHeight(!0);t.removeClass(s);var u=o("<div>").css({height:0,margin:0,padding:0,clear:"both",display:"block"});t.before(u),a.push({elem:t,sentinelElem:u,container:i,origPadding:parseInt(i.css("padding-bottom")),origPos:d,curPos:d,offsets:n,height:c}),r||(r=!0,l())}},t.remove=function(e){for(var t=0;t<a.length;++t){var i=a[t];if(i.elem[0]===o(e)[0]){a.splice(t,1),d(i,i.origPos);break}}};var d=function(e,t){if(t!=e.curPos){e.curPos=t,e.elem.css("position",t);var i=e.elem.outerHeight(!0);"fixed"==t?(e.sentinelElem.css("height",i),e.elem.addClass(s)):(e.sentinelElem.css("height",0),e.elem.removeClass(s),e.height=i)}},l=n(function(){for(var e=o(window),t=e.scrollTop()+e.height(),i=0;i<a.length;++i){var n=a[i];if(n.elem.is(":visible")){var s=n.container.offset().top+n.height+n.offsets.top,r=n.sentinelElem.offset().top+n.height-n.offsets.bottom;
t>=s&&r>=t?d(n,"fixed"):d(n,n.origPos)}}window.requestAnimationFrame(l)},100)},"./tchannel_up.js":function(e,t,i){var n=i("./shared/jquery.js"),o=i("./w2.livenode.js"),s=i("./shared/onload.js"),a=i("./shared/util.js"),r=i("./shared/beforeunload.js"),d=i("./shared/Class.js").Class,l=null,c=function(e,t,i){return e?window.location.protocol+"//"+e:[window.location.protocol,"//","tch",Math.floor(1e6*Math.random())+1,".tch.",t,"/up/",i,"/updates?"].join("")},u=function(e){new Function(e).call(window)},h=d.extend({__init__:function(e,t,i,n,o,s){this.minSeq=e,this.channel=t,this.channelHash=i,this.boxName=n,this.baseHost=o,this.targetUrl=c(s,o,n),this.isConnected=!0,this.isActive=!0,this.updateBackOffTime(!0),this.maxBackOffTime=3e4,this.numActiveXhr=0,this.pendingMessages=[]},makeJsonpRequest:function(e){if(0===this.numActiveXhr){this.numActiveXhr+=1;var t={min_seq:this.minSeq,channel:this.channel,hash:this.channelHash};e&&(t.timeout=e),n.ajax({url:this.targetUrl,jsonpCallback:function(){return"jsonp"+a.uuid4();
},dataType:"jsonp",method:"GET",data:t,success:this._onSuccess.bind(this),error:this._onError.bind(this),complete:this._onComplete.bind(this)})}},setIsConnected:function(e){var t=this.isConnected!=e;t&&(e?o.reportPageRegainedConnection():o.reportPageLostConnection()),this.isConnected=e},updateBackOffTime:function(e){e&&(this.backOffTime=500),this.backOffTime=Math.min(2*this.backOffTime,this.maxBackOffTime)},_onError:function(e,t){var i=this;setTimeout(function(){i.isActive&&!r.isUnloading()&&(i.updateBackOffTime(),i.setIsConnected(!1),i.poll())},0)},_onSuccess:function(e){if(this.isActive&&!r.isUnloading()){this.updateBackOffTime(!0),this.setIsConnected(!0);try{if(e.error)throw e.error;this.minSeq=e.min_seq;for(var t=0;t<e.messages.length;t++)u(e.messages[t])}catch(i){return void o.reportPageNeedsReload("tchannel_error")}this.poll()}},_onComplete:function(){this.numActiveXhr-=1},poll:function(e){setTimeout(this.makeJsonpRequest.bind(this,e),this.backOffTime)},start:function(){this.poll(2e3);
},stop:function(){this.isActive=!1}});t.start=function(e,t,i,n,o,a){l=new h(e,t,i,n,o,a),s.execAfterLoadDelayed(function(){l.start()})},t.stop=function(){l&&l.stop()}},"./third_party/autosize.js":function(e,t){!function(i,n){if("function"==typeof define&&define.amd)define(["exports","module"],n);else if("undefined"!=typeof t&&"undefined"!=typeof e)n(t,e);else{var o={exports:{}};n(o.exports,o),i.autosize=o.exports}}(this,function(e,t){"use strict";function i(e){function t(){var t=window.getComputedStyle(e,null);h=t.overflowY,"vertical"===t.resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),u="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(u)&&(u=0),o()}function i(t){var i=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=i,h=t,c&&(e.style.overflowY=t),n()}function n(){var t=window.pageYOffset,i=document.body.scrollTop,n=e.style.height;e.style.height="auto";
var o=e.scrollHeight+u;return 0===e.scrollHeight?void(e.style.height=n):(e.style.height=o+"px",p=e.clientWidth,document.documentElement.scrollTop=t,void(document.body.scrollTop=i))}function o(){var t=e.style.height;n();var o=window.getComputedStyle(e,null);if(o.height!==e.style.height||"hidden"!==h&&i("hidden"),t!==e.style.height){var s=document.createEvent("Event");s.initEvent("autosize:resized",!0,!1),e.dispatchEvent(s)}}var a=void 0===arguments[1]?{}:arguments[1],r=a.setOverflowX,d=void 0===r?!0:r,l=a.setOverflowY,c=void 0===l?!0:l;if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!s.has(e)){var u=null,h=null,p=e.clientWidth,f=function(){e.clientWidth!==p&&o()},_=function(t){window.removeEventListener("resize",f),e.removeEventListener("input",o),e.removeEventListener("keyup",o),e.removeEventListener("autosize:destroy",_),s["delete"](e),Object.keys(t).forEach(function(i){e.style[i]=t[i]})}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,
wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",_),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",o),window.addEventListener("resize",f),e.addEventListener("input",o),e.addEventListener("autosize:update",o),s.add(e),d&&(e.style.overflowX="hidden",e.style.wordWrap="break-word"),t()}}function n(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName){var t=document.createEvent("Event");t.initEvent("autosize:destroy",!0,!1),e.dispatchEvent(t)}}function o(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName){var t=document.createEvent("Event");t.initEvent("autosize:update",!0,!1),e.dispatchEvent(t)}}var s="function"==typeof Set?new Set:function(){var e=[];return{has:function(t){return Boolean(e.indexOf(t)>-1)},add:function(t){e.push(t)},"delete":function(t){e.splice(e.indexOf(t),1)}}}(),a=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?(a=function(e){return e},a.destroy=function(e){return e},a.update=function(e){return e}):(a=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){
return i(e,t)}),e},a.destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],n),e},a.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],o),e}),t.exports=a})},"./third_party/browser.js":function(e,t){!function(t,i){"undefined"!=typeof e&&e.exports?e.exports=i():"function"==typeof define&&define.amd?define(t,i):this[t]=i()}("bowser",function(){function e(e){function t(t){var i=e.match(t);return i&&i.length>1&&i[1]||""}function i(t){var i=e.match(t);return i&&i.length>1&&i[2]||""}var n,o=t(/(ipod|iphone|ipad)/i).toLowerCase(),s=/like android/i.test(e),r=!s&&/android/i.test(e),d=/nexus\s*[0-6]\s*/i.test(e),l=!d&&/nexus\s*[0-9]+/i.test(e),c=/CrOS/.test(e),u=/silk/i.test(e),h=/sailfish/i.test(e),p=/tizen/i.test(e),f=/(web|hpw)os/i.test(e),_=/windows phone/i.test(e),m=(/SamsungBrowser/i.test(e),!_&&/windows/i.test(e)),g=!o&&!u&&/macintosh/i.test(e),v=!r&&!h&&!p&&!f&&/linux/i.test(e),w=t(/edge\/(\d+(\.\d+)?)/i),b=t(/version\/(\d+(\.\d+)?)/i),y=/tablet/i.test(e),C=!y&&/[^-]mobi/i.test(e),k=/xbox/i.test(e);
/opera/i.test(e)?n={name:"Opera",opera:a,version:b||t(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr|opios/i.test(e)?n={name:"Opera",opera:a,version:t(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||b}:/SamsungBrowser/i.test(e)?n={name:"Samsung Internet for Android",samsungBrowser:a,version:b||t(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(e)?n={name:"Opera Coast",coast:a,version:b||t(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(e)?n={name:"Yandex Browser",yandexbrowser:a,version:b||t(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(e)?n={name:"UC Browser",ucbrowser:a,version:t(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(e)?n={name:"Maxthon",maxthon:a,version:t(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(e)?n={name:"Epiphany",epiphany:a,version:t(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(e)?n={name:"Puffin",puffin:a,version:t(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(e)?n={name:"Sleipnir",sleipnir:a,version:t(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)
}:/k-meleon/i.test(e)?n={name:"K-Meleon",kMeleon:a,version:t(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:_?(n={name:"Windows Phone",windowsphone:a},w?(n.msedge=a,n.version=w):(n.msie=a,n.version=t(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(e)?n={name:"Internet Explorer",msie:a,version:t(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:c?n={name:"Chrome",chromeos:a,chromeBook:a,chrome:a,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/chrome.+? edge/i.test(e)?n={name:"Microsoft Edge",msedge:a,version:w}:/vivaldi/i.test(e)?n={name:"Vivaldi",vivaldi:a,version:t(/vivaldi\/(\d+(\.\d+)?)/i)||b}:h?n={name:"Sailfish",sailfish:a,version:t(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(e)?n={name:"SeaMonkey",seamonkey:a,version:t(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(e)?(n={name:"Firefox",firefox:a,version:t(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(e)&&(n.firefoxos=a)):u?n={name:"Amazon Silk",silk:a,version:t(/silk\/(\d+(\.\d+)?)/i)
}:/phantom/i.test(e)?n={name:"PhantomJS",phantom:a,version:t(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(e)?n={name:"SlimerJS",slimer:a,version:t(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(e)||/rim\stablet/i.test(e)?n={name:"BlackBerry",blackberry:a,version:b||t(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:f?(n={name:"WebOS",webos:a,version:b||t(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(e)&&(n.touchpad=a)):/bada/i.test(e)?n={name:"Bada",bada:a,version:t(/dolfin\/(\d+(\.\d+)?)/i)}:p?n={name:"Tizen",tizen:a,version:t(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||b}:/qupzilla/i.test(e)?n={name:"QupZilla",qupzilla:a,version:t(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||b}:/chromium/i.test(e)?n={name:"Chromium",chromium:a,version:t(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||b}:/chrome|crios|crmo/i.test(e)?n={name:"Chrome",chrome:a,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:r?n={name:"Android",version:b}:/safari|applewebkit/i.test(e)?(n={name:"Safari",safari:a},b&&(n.version=b)):o?(n={
name:"iphone"==o?"iPhone":"ipad"==o?"iPad":"iPod"},b&&(n.version=b)):n=/googlebot/i.test(e)?{name:"Googlebot",googlebot:a,version:t(/googlebot\/(\d+(\.\d+))/i)||b}:{name:t(/^(.*)\/(.*) /),version:i(/^(.*)\/(.*) /)},!n.msedge&&/(apple)?webkit/i.test(e)?(/(apple)?webkit\/537\.36/i.test(e)?(n.name=n.name||"Blink",n.blink=a):(n.name=n.name||"Webkit",n.webkit=a),!n.version&&b&&(n.version=b)):!n.opera&&/gecko\//i.test(e)&&(n.name=n.name||"Gecko",n.gecko=a,n.version=n.version||t(/gecko\/(\d+(\.\d+)?)/i)),n.msedge||!r&&!n.silk?o?(n[o]=a,n.ios=a):g?n.mac=a:k?n.xbox=a:m?n.windows=a:v&&(n.linux=a):n.android=a;var x="";n.windowsphone?x=t(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):o?(x=t(/os (\d+([_\s]\d+)*) like mac os x/i),x=x.replace(/[_\s]/g,".")):r?x=t(/android[ \/-](\d+(\.\d+)*)/i):n.webos?x=t(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):n.blackberry?x=t(/rim\stablet\sos\s(\d+(\.\d+)*)/i):n.bada?x=t(/bada\/(\d+(\.\d+)*)/i):n.tizen&&(x=t(/tizen[\/\s](\d+(\.\d+)*)/i)),x&&(n.osversion=x);var S=x.split(".")[0];
return y||l||"ipad"==o||r&&(3==S||S>=4&&!C)||n.silk?n.tablet=a:(C||"iphone"==o||"ipod"==o||r||d||n.blackberry||n.webos||n.bada)&&(n.mobile=a),n.msedge||n.msie&&n.version>=10||n.yandexbrowser&&n.version>=15||n.vivaldi&&n.version>=1||n.chrome&&n.version>=20||n.samsungBrowser&&n.version>=4||n.firefox&&n.version>=20||n.safari&&n.version>=6||n.opera&&n.version>=10||n.ios&&n.osversion&&n.osversion.split(".")[0]>=6||n.blackberry&&n.version>=10.1||n.chromium&&n.version>=20?n.a=a:n.msie&&n.version<10||n.chrome&&n.version<20||n.firefox&&n.version<20||n.safari&&n.version<6||n.opera&&n.version<10||n.ios&&n.osversion&&n.osversion.split(".")[0]<6||n.chromium&&n.version<20?n.c=a:n.x=a,n}function t(e){return e.split(".").length}function i(e,t){var i,n=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(i=0;i<e.length;i++)n.push(t(e[i]));return n}function n(e){for(var n=Math.max(t(e[0]),t(e[1])),o=i(e,function(e){var o=n-t(e);return e+=new Array(o+1).join(".0"),i(e.split("."),function(e){
return new Array(20-e.length).join("0")+e}).reverse()});--n>=0;){if(o[0][n]>o[1][n])return 1;if(o[0][n]!==o[1][n])return-1;if(0===n)return 0}}function o(t,i,o){var s=r;"string"==typeof i&&(o=i,i=void 0),void 0===i&&(i=!1),o&&(s=e(o));var a=""+s.version;for(var d in t)if(t.hasOwnProperty(d)&&s[d])return n([a,t[d]])<0;return i}function s(e,t,i){return!o(e,t,i)}var a=!0,r=e("undefined"!=typeof navigator?navigator.userAgent||"":"");return r.test=function(e){for(var t=0;t<e.length;++t){var i=e[t];if("string"==typeof i&&i in r)return!0}return!1},r.isUnsupportedBrowser=o,r.compareVersions=n,r.check=s,r._detect=e,r})},"./third_party/insertion_query.js":function(e,t){t.insertionQ=function(){"use strict";function e(e,t){var n,o="insQ_"+a++,s=function(e){(e.animationName===o||e[d]===o)&&(i(e.target)||t(e.target))};n=document.createElement("style"),n.innerHTML="@"+l+"keyframes "+o+" {  from {  outline: 1px solid transparent  } to {  outline: 0px solid transparent }  }\n"+e+" { animation-duration: 0.001s; animation-name: "+o+"; "+l+"animation-duration: 0.001s; "+l+"animation-name: "+o+";  } ",
document.head.appendChild(n);var r=setTimeout(function(){document.addEventListener("animationstart",s,!1),document.addEventListener("MSAnimationStart",s,!1),document.addEventListener("webkitAnimationStart",s,!1)},p.timeout);return{destroy:function(){clearTimeout(r),n&&(document.head.removeChild(n),n=null),document.removeEventListener("animationstart",s),document.removeEventListener("MSAnimationStart",s),document.removeEventListener("webkitAnimationStart",s)}}}function t(e){e.QinsQ=!0}function i(e){return p.strictlyNew&&e.QinsQ===!0}function n(e){return i(e.parentNode)?e:n(e.parentNode)}function o(e){for(t(e),e=e.firstChild;e;e=e.nextSibling)void 0!==e&&1===e.nodeType&&o(e)}function s(s,a){var r=[],d=function(){var e;return function(){clearTimeout(e),e=setTimeout(function(){r.forEach(o),a(r),r=[]},10)}}();return e(s,function(e){if(!i(e)){t(e);var o=n(e);r.indexOf(o)<0&&r.push(o),d()}})}var a=100,r=!1,d="animationName",l="",c="Webkit Moz O ms Khtml".split(" "),u="",h=document.createElement("div"),p={
strictlyNew:!0,timeout:20};if(h.style.animationName&&(r=!0),r===!1)for(var f=0;f<c.length;f++)if(void 0!==h.style[c[f]+"AnimationName"]){u=c[f],d=u+"AnimationName",l="-"+u.toLowerCase()+"-",r=!0;break}var _=function(t){return r&&t.match(/[^{}]/)?(p.strictlyNew&&o(document.body),{every:function(i){return e(t,i)},summary:function(e){return s(t,e)}}):!1};return _.config=function(e){for(var t in e)e.hasOwnProperty(t)&&(p[t]=e[t])},_}()},"./third_party/jquery3.js":function(e,t){!function(t,i){"use strict";"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return i(e)}:i(t)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function i(e,t){t=t||Z;var i=t.createElement("script");i.text=e,t.head.appendChild(i).parentNode.removeChild(i)}function n(e){var t=!!e&&"length"in e&&e.length,i=he.type(e);return"function"===i||he.isWindow(e)?!1:"array"===i||0===t||"number"==typeof t&&t>0&&t-1 in e;
}function o(e,t,i){if(he.isFunction(t))return he.grep(e,function(e,n){return!!t.call(e,n,e)!==i});if(t.nodeType)return he.grep(e,function(e){return e===t!==i});if("string"==typeof t){if(Ce.test(t))return he.filter(t,e,i);t=he.filter(t,e)}return he.grep(e,function(e){return oe.call(t,e)>-1!==i&&1===e.nodeType})}function s(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function a(e){var t={};return he.each(e.match($e)||[],function(e,i){t[i]=!0}),t}function r(e){return e}function d(e){throw e}function l(e,t,i){var n;try{e&&he.isFunction(n=e.promise)?n.call(e).done(t).fail(i):e&&he.isFunction(n=e.then)?n.call(e,t,i):t.call(void 0,e)}catch(e){i.call(void 0,e)}}function c(){Z.removeEventListener("DOMContentLoaded",c),e.removeEventListener("load",c),he.ready()}function u(){this.expando=he.expando+u.uid++}function h(e,t,i){var n;if(void 0===i&&1===e.nodeType)if(n="data-"+t.replace(Ne,"-$&").toLowerCase(),i=e.getAttribute(n),"string"==typeof i){try{i="true"===i?!0:"false"===i?!1:"null"===i?null:+i+""===i?+i:Oe.test(i)?JSON.parse(i):i;
}catch(o){}Me.set(e,t,i)}else i=void 0;return i}function p(e,t,i,n){var o,s=1,a=20,r=n?function(){return n.cur()}:function(){return he.css(e,t,"")},d=r(),l=i&&i[3]||(he.cssNumber[t]?"":"px"),c=(he.cssNumber[t]||"px"!==l&&+d)&&Be.exec(he.css(e,t));if(c&&c[3]!==l){l=l||c[3],i=i||[],c=+d||1;do s=s||".5",c/=s,he.style(e,t,c+l);while(s!==(s=r()/d)&&1!==s&&--a)}return i&&(c=+c||+d||0,o=i[1]?c+(i[1]+1)*i[2]:+i[2],n&&(n.unit=l,n.start=c,n.end=o)),o}function f(e){var t,i=e.ownerDocument,n=e.nodeName,o=Ue[n];return o?o:(t=i.body.appendChild(i.createElement(n)),o=he.css(t,"display"),t.parentNode.removeChild(t),"none"===o&&(o="block"),Ue[n]=o,o)}function _(e,t){for(var i,n,o=[],s=0,a=e.length;a>s;s++)n=e[s],n.style&&(i=n.style.display,t?("none"===i&&(o[s]=Ie.get(n,"display")||null,o[s]||(n.style.display="")),""===n.style.display&&Fe(n)&&(o[s]=f(n))):"none"!==i&&(o[s]="none",Ie.set(n,"display",i)));for(s=0;a>s;s++)null!=o[s]&&(e[s].style.display=o[s]);return e}function m(e,t){var i="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[];
return void 0===t||t&&he.nodeName(e,t)?he.merge([e],i):i}function g(e,t){for(var i=0,n=e.length;n>i;i++)Ie.set(e[i],"globalEval",!t||Ie.get(t[i],"globalEval"))}function v(e,t,i,n,o){for(var s,a,r,d,l,c,u=t.createDocumentFragment(),h=[],p=0,f=e.length;f>p;p++)if(s=e[p],s||0===s)if("object"===he.type(s))he.merge(h,s.nodeType?[s]:s);else if(Ge.test(s)){for(a=a||u.appendChild(t.createElement("div")),r=(We.exec(s)||["",""])[1].toLowerCase(),d=Ve[r]||Ve._default,a.innerHTML=d[1]+he.htmlPrefilter(s)+d[2],c=d[0];c--;)a=a.lastChild;he.merge(h,a.childNodes),a=u.firstChild,a.textContent=""}else h.push(t.createTextNode(s));for(u.textContent="",p=0;s=h[p++];)if(n&&he.inArray(s,n)>-1)o&&o.push(s);else if(l=he.contains(s.ownerDocument,s),a=m(u.appendChild(s),"script"),l&&g(a),i)for(c=0;s=a[c++];)Qe.test(s.type||"")&&i.push(s);return u}function w(){return!0}function b(){return!1}function y(){try{return Z.activeElement}catch(e){}}function C(e,t,i,n,o,s){var a,r;if("object"==typeof t){"string"!=typeof i&&(n=n||i,
i=void 0);for(r in t)C(e,r,i,n,t[r],s);return e}if(null==n&&null==o?(o=i,n=i=void 0):null==o&&("string"==typeof i?(o=n,n=void 0):(o=n,n=i,i=void 0)),o===!1)o=b;else if(!o)return e;return 1===s&&(a=o,o=function(e){return he().off(e),a.apply(this,arguments)},o.guid=a.guid||(a.guid=he.guid++)),e.each(function(){he.event.add(this,t,o,n,i)})}function k(e,t){return he.nodeName(e,"table")&&he.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e:e}function x(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function S(e){var t=tt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function E(e,t){var i,n,o,s,a,r,d,l;if(1===t.nodeType){if(Ie.hasData(e)&&(s=Ie.access(e),a=Ie.set(t,s),l=s.events)){delete a.handle,a.events={};for(o in l)for(i=0,n=l[o].length;n>i;i++)he.event.add(t,o,l[o][i])}Me.hasData(e)&&(r=Me.access(e),d=he.extend({},r),Me.set(t,d))}}function T(e,t){var i=t.nodeName.toLowerCase();"input"===i&&He.test(e.type)?t.checked=e.checked:("input"===i||"textarea"===i)&&(t.defaultValue=e.defaultValue);
}function $(e,t,n,o){t=ie.apply([],t);var s,a,r,d,l,c,u=0,h=e.length,p=h-1,f=t[0],_=he.isFunction(f);if(_||h>1&&"string"==typeof f&&!ce.checkClone&&et.test(f))return e.each(function(i){var s=e.eq(i);_&&(t[0]=f.call(this,i,s.html())),$(s,t,n,o)});if(h&&(s=v(t,e[0].ownerDocument,!1,e,o),a=s.firstChild,1===s.childNodes.length&&(s=a),a||o)){for(r=he.map(m(s,"script"),x),d=r.length;h>u;u++)l=s,u!==p&&(l=he.clone(l,!0,!0),d&&he.merge(r,m(l,"script"))),n.call(e[u],l,u);if(d)for(c=r[r.length-1].ownerDocument,he.map(r,S),u=0;d>u;u++)l=r[u],Qe.test(l.type||"")&&!Ie.access(l,"globalEval")&&he.contains(c,l)&&(l.src?he._evalUrl&&he._evalUrl(l.src):i(l.textContent.replace(it,""),c))}return e}function L(e,t,i){for(var n,o=t?he.filter(t,e):e,s=0;null!=(n=o[s]);s++)i||1!==n.nodeType||he.cleanData(m(n)),n.parentNode&&(i&&he.contains(n.ownerDocument,n)&&g(m(n,"script")),n.parentNode.removeChild(n));return e}function j(e,t,i){var n,o,s,a,r=e.style;return i=i||st(e),i&&(a=i.getPropertyValue(t)||i[t],""!==a||he.contains(e.ownerDocument,e)||(a=he.style(e,t)),
!ce.pixelMarginRight()&&ot.test(a)&&nt.test(t)&&(n=r.width,o=r.minWidth,s=r.maxWidth,r.minWidth=r.maxWidth=r.width=a,a=i.width,r.width=n,r.minWidth=o,r.maxWidth=s)),void 0!==a?a+"":a}function A(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function D(e){if(e in ct)return e;for(var t=e[0].toUpperCase()+e.slice(1),i=lt.length;i--;)if(e=lt[i]+t,e in ct)return e}function I(e,t,i){var n=Be.exec(t);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):t}function M(e,t,i,n,o){for(var s=i===(n?"border":"content")?4:"width"===t?1:0,a=0;4>s;s+=2)"margin"===i&&(a+=he.css(e,i+Pe[s],!0,o)),n?("content"===i&&(a-=he.css(e,"padding"+Pe[s],!0,o)),"margin"!==i&&(a-=he.css(e,"border"+Pe[s]+"Width",!0,o))):(a+=he.css(e,"padding"+Pe[s],!0,o),"padding"!==i&&(a+=he.css(e,"border"+Pe[s]+"Width",!0,o)));return a}function O(e,t,i){var n,o=!0,s=st(e),a="border-box"===he.css(e,"boxSizing",!1,s);if(e.getClientRects().length&&(n=e.getBoundingClientRect()[t]),0>=n||null==n){if(n=j(e,t,s),
(0>n||null==n)&&(n=e.style[t]),ot.test(n))return n;o=a&&(ce.boxSizingReliable()||n===e.style[t]),n=parseFloat(n)||0}return n+M(e,t,i||(a?"border":"content"),o,s)+"px"}function N(e,t,i,n,o){return new N.prototype.init(e,t,i,n,o)}function R(){ht&&(e.requestAnimationFrame(R),he.fx.tick())}function B(){return e.setTimeout(function(){ut=void 0}),ut=he.now()}function P(e,t){var i,n=0,o={height:e};for(t=t?1:0;4>n;n+=2-t)i=Pe[n],o["margin"+i]=o["padding"+i]=e;return t&&(o.opacity=o.width=e),o}function F(e,t,i){for(var n,o=(H.tweeners[t]||[]).concat(H.tweeners["*"]),s=0,a=o.length;a>s;s++)if(n=o[s].call(i,t,e))return n}function q(e,t,i){var n,o,s,a,r,d,l,c,u="width"in t||"height"in t,h=this,p={},f=e.style,m=e.nodeType&&Fe(e),g=Ie.get(e,"fxshow");i.queue||(a=he._queueHooks(e,"fx"),null==a.unqueued&&(a.unqueued=0,r=a.empty.fire,a.empty.fire=function(){a.unqueued||r()}),a.unqueued++,h.always(function(){h.always(function(){a.unqueued--,he.queue(e,"fx").length||a.empty.fire()})}));for(n in t)if(o=t[n],
pt.test(o)){if(delete t[n],s=s||"toggle"===o,o===(m?"hide":"show")){if("show"!==o||!g||void 0===g[n])continue;m=!0}p[n]=g&&g[n]||he.style(e,n)}if(d=!he.isEmptyObject(t),d||!he.isEmptyObject(p)){u&&1===e.nodeType&&(i.overflow=[f.overflow,f.overflowX,f.overflowY],l=g&&g.display,null==l&&(l=Ie.get(e,"display")),c=he.css(e,"display"),"none"===c&&(l?c=l:(_([e],!0),l=e.style.display||l,c=he.css(e,"display"),_([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===he.css(e,"float")&&(d||(h.done(function(){f.display=l}),null==l&&(c=f.display,l="none"===c?"":c)),f.display="inline-block")),i.overflow&&(f.overflow="hidden",h.always(function(){f.overflow=i.overflow[0],f.overflowX=i.overflow[1],f.overflowY=i.overflow[2]})),d=!1;for(n in p)d||(g?"hidden"in g&&(m=g.hidden):g=Ie.access(e,"fxshow",{display:l}),s&&(g.hidden=!m),m&&_([e],!0),h.done(function(){m||_([e]),Ie.remove(e,"fxshow");for(n in p)he.style(e,n,p[n])})),d=F(m?g[n]:0,n,h),n in g||(g[n]=d.start,m&&(d.end=d.start,d.start=0))}}function U(e,t){
var i,n,o,s,a;for(i in e)if(n=he.camelCase(i),o=t[n],s=e[i],he.isArray(s)&&(o=s[1],s=e[i]=s[0]),i!==n&&(e[n]=s,delete e[i]),a=he.cssHooks[n],a&&"expand"in a){s=a.expand(s),delete e[n];for(i in s)i in e||(e[i]=s[i],t[i]=o)}else t[n]=o}function H(e,t,i){var n,o,s=0,a=H.prefilters.length,r=he.Deferred().always(function(){delete d.elem}),d=function(){if(o)return!1;for(var t=ut||B(),i=Math.max(0,l.startTime+l.duration-t),n=i/l.duration||0,s=1-n,a=0,d=l.tweens.length;d>a;a++)l.tweens[a].run(s);return r.notifyWith(e,[l,s,i]),1>s&&d?i:(r.resolveWith(e,[l]),!1)},l=r.promise({elem:e,props:he.extend({},t),opts:he.extend(!0,{specialEasing:{},easing:he.easing._default},i),originalProperties:t,originalOptions:i,startTime:ut||B(),duration:i.duration,tweens:[],createTween:function(t,i){var n=he.Tween(e,l.opts,t,i,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(n),n},stop:function(t){var i=0,n=t?l.tweens.length:0;if(o)return this;for(o=!0;n>i;i++)l.tweens[i].run(1);return t?(r.notifyWith(e,[l,1,0]),
r.resolveWith(e,[l,t])):r.rejectWith(e,[l,t]),this}}),c=l.props;for(U(c,l.opts.specialEasing);a>s;s++)if(n=H.prefilters[s].call(l,e,c,l.opts))return he.isFunction(n.stop)&&(he._queueHooks(l.elem,l.opts.queue).stop=he.proxy(n.stop,n)),n;return he.map(c,F,l),he.isFunction(l.opts.start)&&l.opts.start.call(e,l),he.fx.timer(he.extend(d,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function W(e){return e.getAttribute&&e.getAttribute("class")||""}function Q(e,t,i,n){var o;if(he.isArray(t))he.each(t,function(t,o){i||Et.test(e)?n(e,o):Q(e+"["+("object"==typeof o&&null!=o?t:"")+"]",o,i,n)});else if(i||"object"!==he.type(t))n(e,t);else for(o in t)Q(e+"["+o+"]",t[o],i,n)}function V(e){return function(t,i){"string"!=typeof t&&(i=t,t="*");var n,o=0,s=t.toLowerCase().match($e)||[];if(he.isFunction(i))for(;n=s[o++];)"+"===n[0]?(n=n.slice(1)||"*",(e[n]=e[n]||[]).unshift(i)):(e[n]=e[n]||[]).push(i)}}function G(e,t,i,n){
function o(r){var d;return s[r]=!0,he.each(e[r]||[],function(e,r){var l=r(t,i,n);return"string"!=typeof l||a||s[l]?a?!(d=l):void 0:(t.dataTypes.unshift(l),o(l),!1)}),d}var s={},a=e===Bt;return o(t.dataTypes[0])||!s["*"]&&o("*")}function z(e,t){var i,n,o=he.ajaxSettings.flatOptions||{};for(i in t)void 0!==t[i]&&((o[i]?e:n||(n={}))[i]=t[i]);return n&&he.extend(!0,e,n),e}function K(e,t,i){for(var n,o,s,a,r=e.contents,d=e.dataTypes;"*"===d[0];)d.shift(),void 0===n&&(n=e.mimeType||t.getResponseHeader("Content-Type"));if(n)for(o in r)if(r[o]&&r[o].test(n)){d.unshift(o);break}if(d[0]in i)s=d[0];else{for(o in i){if(!d[0]||e.converters[o+" "+d[0]]){s=o;break}a||(a=o)}s=s||a}return s?(s!==d[0]&&d.unshift(s),i[s]):void 0}function J(e,t,i,n){var o,s,a,r,d,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];for(s=c.shift();s;)if(e.responseFields[s]&&(i[e.responseFields[s]]=t),!d&&n&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),d=s,s=c.shift())if("*"===s)s=d;else if("*"!==d&&d!==s){
if(a=l[d+" "+s]||l["* "+s],!a)for(o in l)if(r=o.split(" "),r[1]===s&&(a=l[d+" "+r[0]]||l["* "+r[0]])){a===!0?a=l[o]:l[o]!==!0&&(s=r[0],c.unshift(r[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(u){return{state:"parsererror",error:a?u:"No conversion from "+d+" to "+s}}}return{state:"success",data:t}}function X(e){return he.isWindow(e)?e:9===e.nodeType&&e.defaultView}var Y=[],Z=e.document,ee=Object.getPrototypeOf,te=Y.slice,ie=Y.concat,ne=Y.push,oe=Y.indexOf,se={},ae=se.toString,re=se.hasOwnProperty,de=re.toString,le=de.call(Object),ce={},ue="3.0.0",he=function(e,t){return new he.fn.init(e,t)},pe=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,fe=/^-ms-/,_e=/-([a-z])/g,me=function(e,t){return t.toUpperCase()};he.fn=he.prototype={jquery:ue,constructor:he,length:0,toArray:function(){return te.call(this)},get:function(e){return null!=e?0>e?this[e+this.length]:this[e]:te.call(this)},pushStack:function(e){var t=he.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){
return he.each(this,e)},map:function(e){return this.pushStack(he.map(this,function(t,i){return e.call(t,i,t)}))},slice:function(){return this.pushStack(te.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,i=+e+(0>e?t:0);return this.pushStack(i>=0&&t>i?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:ne,sort:Y.sort,splice:Y.splice},he.extend=he.fn.extend=function(){var e,t,i,n,o,s,a=arguments[0]||{},r=1,d=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[r]||{},r++),"object"==typeof a||he.isFunction(a)||(a={}),r===d&&(a=this,r--);d>r;r++)if(null!=(e=arguments[r]))for(t in e)i=a[t],n=e[t],a!==n&&(l&&n&&(he.isPlainObject(n)||(o=he.isArray(n)))?(o?(o=!1,s=i&&he.isArray(i)?i:[]):s=i&&he.isPlainObject(i)?i:{},a[t]=he.extend(l,s,n)):void 0!==n&&(a[t]=n));return a},he.extend({expando:"jQuery"+(ue+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e);
},noop:function(){},isFunction:function(e){return"function"===he.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=he.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},isPlainObject:function(e){var t,i;return e&&"[object Object]"===ae.call(e)?(t=ee(e))?(i=re.call(t,"constructor")&&t.constructor,"function"==typeof i&&de.call(i)===le):!0:!1},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?se[ae.call(e)]||"object":typeof e},globalEval:function(e){i(e)},camelCase:function(e){return e.replace(fe,"ms-").replace(_e,me)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var i,o=0;if(n(e))for(i=e.length;i>o&&t.call(e[o],o,e[o])!==!1;o++);else for(o in e)if(t.call(e[o],o,e[o])===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(pe,"")},makeArray:function(e,t){
var i=t||[];return null!=e&&(n(Object(e))?he.merge(i,"string"==typeof e?[e]:e):ne.call(i,e)),i},inArray:function(e,t,i){return null==t?-1:oe.call(t,e,i)},merge:function(e,t){for(var i=+t.length,n=0,o=e.length;i>n;n++)e[o++]=t[n];return e.length=o,e},grep:function(e,t,i){for(var n,o=[],s=0,a=e.length,r=!i;a>s;s++)n=!t(e[s],s),n!==r&&o.push(e[s]);return o},map:function(e,t,i){var o,s,a=0,r=[];if(n(e))for(o=e.length;o>a;a++)s=t(e[a],a,i),null!=s&&r.push(s);else for(a in e)s=t(e[a],a,i),null!=s&&r.push(s);return ie.apply([],r)},guid:1,proxy:function(e,t){var i,n,o;return"string"==typeof t&&(i=e[t],t=e,e=i),he.isFunction(e)?(n=te.call(arguments,2),o=function(){return e.apply(t||this,n.concat(te.call(arguments)))},o.guid=e.guid=e.guid||he.guid++,o):void 0},now:Date.now,support:ce}),"function"==typeof Symbol&&(he.fn[Symbol.iterator]=Y[Symbol.iterator]),he.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){se["[object "+t+"]"]=t.toLowerCase()});var ge=function(e){
function t(e,t,i,n){var o,s,a,r,d,l,c,h=t&&t.ownerDocument,f=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==f&&9!==f&&11!==f)return i;if(!n&&((t?t.ownerDocument||t:q)!==I&&D(t),t=t||I,O)){if(11!==f&&(d=ge.exec(e)))if(o=d[1]){if(9===f){if(!(a=t.getElementById(o)))return i;if(a.id===o)return i.push(a),i}else if(h&&(a=h.getElementById(o))&&P(t,a)&&a.id===o)return i.push(a),i}else{if(d[2])return Y.apply(i,t.getElementsByTagName(e)),i;if((o=d[3])&&C.getElementsByClassName&&t.getElementsByClassName)return Y.apply(i,t.getElementsByClassName(o)),i}if(C.qsa&&!V[e+" "]&&(!N||!N.test(e))){if(1!==f)h=t,c=e;else if("object"!==t.nodeName.toLowerCase()){for((r=t.getAttribute("id"))?r=r.replace(ye,Ce):t.setAttribute("id",r=F),l=E(e),s=l.length;s--;)l[s]="#"+r+" "+p(l[s]);c=l.join(","),h=ve.test(e)&&u(t.parentNode)||t}if(c)try{return Y.apply(i,h.querySelectorAll(c)),i}catch(_){}finally{r===F&&t.removeAttribute("id")}}}return $(e.replace(re,"$1"),t,i,n)}function i(){function e(i,n){return t.push(i+" ")>k.cacheLength&&delete e[t.shift()],
e[i+" "]=n}var t=[];return e}function n(e){return e[F]=!0,e}function o(e){var t=I.createElement("fieldset");try{return!!e(t)}catch(i){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function s(e,t){for(var i=e.split("|"),n=i.length;n--;)k.attrHandle[i[n]]=t}function a(e,t){var i=t&&e,n=i&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(n)return n;if(i)for(;i=i.nextSibling;)if(i===t)return-1;return e?1:-1}function r(e){return function(t){var i=t.nodeName.toLowerCase();return"input"===i&&t.type===e}}function d(e){return function(t){var i=t.nodeName.toLowerCase();return("input"===i||"button"===i)&&t.type===e}}function l(e){return function(t){return"label"in t&&t.disabled===e||"form"in t&&t.disabled===e||"form"in t&&t.disabled===!1&&(t.isDisabled===e||t.isDisabled!==!e&&("label"in t||!xe(t))!==e)}}function c(e){return n(function(t){return t=+t,n(function(i,n){for(var o,s=e([],i.length,t),a=s.length;a--;)i[o=s[a]]&&(i[o]=!(n[o]=i[o]))})})}function u(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e;
}function h(){}function p(e){for(var t=0,i=e.length,n="";i>t;t++)n+=e[t].value;return n}function f(e,t,i){var n=t.dir,o=t.next,s=o||n,a=i&&"parentNode"===s,r=H++;return t.first?function(t,i,o){for(;t=t[n];)if(1===t.nodeType||a)return e(t,i,o)}:function(t,i,d){var l,c,u,h=[U,r];if(d){for(;t=t[n];)if((1===t.nodeType||a)&&e(t,i,d))return!0}else for(;t=t[n];)if(1===t.nodeType||a)if(u=t[F]||(t[F]={}),c=u[t.uniqueID]||(u[t.uniqueID]={}),o&&o===t.nodeName.toLowerCase())t=t[n]||t;else{if((l=c[s])&&l[0]===U&&l[1]===r)return h[2]=l[2];if(c[s]=h,h[2]=e(t,i,d))return!0}}}function _(e){return e.length>1?function(t,i,n){for(var o=e.length;o--;)if(!e[o](t,i,n))return!1;return!0}:e[0]}function m(e,i,n){for(var o=0,s=i.length;s>o;o++)t(e,i[o],n);return n}function g(e,t,i,n,o){for(var s,a=[],r=0,d=e.length,l=null!=t;d>r;r++)(s=e[r])&&(!i||i(s,n,o))&&(a.push(s),l&&t.push(r));return a}function v(e,t,i,o,s,a){return o&&!o[F]&&(o=v(o)),s&&!s[F]&&(s=v(s,a)),n(function(n,a,r,d){var l,c,u,h=[],p=[],f=a.length,_=n||m(t||"*",r.nodeType?[r]:r,[]),v=!e||!n&&t?_:g(_,h,e,r,d),w=i?s||(n?e:f||o)?[]:a:v;
if(i&&i(v,w,r,d),o)for(l=g(w,p),o(l,[],r,d),c=l.length;c--;)(u=l[c])&&(w[p[c]]=!(v[p[c]]=u));if(n){if(s||e){if(s){for(l=[],c=w.length;c--;)(u=w[c])&&l.push(v[c]=u);s(null,w=[],l,d)}for(c=w.length;c--;)(u=w[c])&&(l=s?ee(n,u):h[c])>-1&&(n[l]=!(a[l]=u))}}else w=g(w===a?w.splice(f,w.length):w),s?s(null,a,w,d):Y.apply(a,w)})}function w(e){for(var t,i,n,o=e.length,s=k.relative[e[0].type],a=s||k.relative[" "],r=s?1:0,d=f(function(e){return e===t},a,!0),l=f(function(e){return ee(t,e)>-1},a,!0),c=[function(e,i,n){var o=!s&&(n||i!==L)||((t=i).nodeType?d(e,i,n):l(e,i,n));return t=null,o}];o>r;r++)if(i=k.relative[e[r].type])c=[f(_(c),i)];else{if(i=k.filter[e[r].type].apply(null,e[r].matches),i[F]){for(n=++r;o>n&&!k.relative[e[n].type];n++);return v(r>1&&_(c),r>1&&p(e.slice(0,r-1).concat({value:" "===e[r-2].type?"*":""})).replace(re,"$1"),i,n>r&&w(e.slice(r,n)),o>n&&w(e=e.slice(n)),o>n&&p(e))}c.push(i)}return _(c)}function b(e,i){var o=i.length>0,s=e.length>0,a=function(n,a,r,d,l){var c,u,h,p=0,f="0",_=n&&[],m=[],v=L,w=n||s&&k.find.TAG("*",l),b=U+=null==v?1:Math.random()||.1,y=w.length;
for(l&&(L=a===I||a||l);f!==y&&null!=(c=w[f]);f++){if(s&&c){for(u=0,a||c.ownerDocument===I||(D(c),r=!O);h=e[u++];)if(h(c,a||I,r)){d.push(c);break}l&&(U=b)}o&&((c=!h&&c)&&p--,n&&_.push(c))}if(p+=f,o&&f!==p){for(u=0;h=i[u++];)h(_,m,a,r);if(n){if(p>0)for(;f--;)_[f]||m[f]||(m[f]=J.call(d));m=g(m)}Y.apply(d,m),l&&!n&&m.length>0&&p+i.length>1&&t.uniqueSort(d)}return l&&(U=b,L=v),_};return o?n(a):a}var y,C,k,x,S,E,T,$,L,j,A,D,I,M,O,N,R,B,P,F="sizzle"+1*new Date,q=e.document,U=0,H=0,W=i(),Q=i(),V=i(),G=function(e,t){return e===t&&(A=!0),0},z={}.hasOwnProperty,K=[],J=K.pop,X=K.push,Y=K.push,Z=K.slice,ee=function(e,t){for(var i=0,n=e.length;n>i;i++)if(e[i]===t)return i;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ie="[\\x20\\t\\r\\n\\f]",ne="(?:\\\\.|[\\w-]|[^\x00-\\xa0])+",oe="\\["+ie+"*("+ne+")(?:"+ie+"*([*^$|!~]?=)"+ie+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ne+"))|)"+ie+"*\\]",se=":("+ne+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",ae=new RegExp(ie+"+","g"),re=new RegExp("^"+ie+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ie+"+$","g"),de=new RegExp("^"+ie+"*,"+ie+"*"),le=new RegExp("^"+ie+"*([>+~]|"+ie+")"+ie+"*"),ce=new RegExp("="+ie+"*([^\\]'\"]*?)"+ie+"*\\]","g"),ue=new RegExp(se),he=new RegExp("^"+ne+"$"),pe={
ID:new RegExp("^#("+ne+")"),CLASS:new RegExp("^\\.("+ne+")"),TAG:new RegExp("^("+ne+"|[*])"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+se),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ie+"*(even|odd|(([+-]|)(\\d*)n|)"+ie+"*(?:([+-]|)"+ie+"*(\\d+)|))"+ie+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ie+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ie+"*((?:-\\d)?\\d*)"+ie+"*\\)|)(?=[^-]|$)","i")},fe=/^(?:input|select|textarea|button)$/i,_e=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ge=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ve=/[+~]/,we=new RegExp("\\\\([\\da-f]{1,6}"+ie+"?|("+ie+")|.)","ig"),be=function(e,t,i){var n="0x"+t-65536;return n!==n||i?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)},ye=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,Ce=function(e,t){return t?"\x00"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ke=function(){D()},xe=f(function(e){return e.disabled===!0;
},{dir:"parentNode",next:"legend"});try{Y.apply(K=Z.call(q.childNodes),q.childNodes),K[q.childNodes.length].nodeType}catch(Se){Y={apply:K.length?function(e,t){X.apply(e,Z.call(t))}:function(e,t){for(var i=e.length,n=0;e[i++]=t[n++];);e.length=i-1}}}C=t.support={},S=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},D=t.setDocument=function(e){var t,i,n=e?e.ownerDocument||e:q;return n!==I&&9===n.nodeType&&n.documentElement?(I=n,M=I.documentElement,O=!S(I),q!==I&&(i=I.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ke,!1):i.attachEvent&&i.attachEvent("onunload",ke)),C.attributes=o(function(e){return e.className="i",!e.getAttribute("className")}),C.getElementsByTagName=o(function(e){return e.appendChild(I.createComment("")),!e.getElementsByTagName("*").length}),C.getElementsByClassName=me.test(I.getElementsByClassName),C.getById=o(function(e){return M.appendChild(e).id=F,!I.getElementsByName||!I.getElementsByName(F).length;
}),C.getById?(k.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&O){var i=t.getElementById(e);return i?[i]:[]}},k.filter.ID=function(e){var t=e.replace(we,be);return function(e){return e.getAttribute("id")===t}}):(delete k.find.ID,k.filter.ID=function(e){var t=e.replace(we,be);return function(e){var i="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return i&&i.value===t}}),k.find.TAG=C.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):C.qsa?t.querySelectorAll(e):void 0}:function(e,t){var i,n=[],o=0,s=t.getElementsByTagName(e);if("*"===e){for(;i=s[o++];)1===i.nodeType&&n.push(i);return n}return s},k.find.CLASS=C.getElementsByClassName&&function(e,t){return"undefined"!=typeof t.getElementsByClassName&&O?t.getElementsByClassName(e):void 0},R=[],N=[],(C.qsa=me.test(I.querySelectorAll))&&(o(function(e){M.appendChild(e).innerHTML="<a id='"+F+"'></a><select id='"+F+"-\r\\' msallowcapture=''><option selected=''></option></select>",
e.querySelectorAll("[msallowcapture^='']").length&&N.push("[*^$]="+ie+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||N.push("\\["+ie+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+F+"-]").length||N.push("~="),e.querySelectorAll(":checked").length||N.push(":checked"),e.querySelectorAll("a#"+F+"+*").length||N.push(".#.+[+~]")}),o(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=I.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&N.push("name"+ie+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&N.push(":enabled",":disabled"),M.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&N.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),N.push(",.*:")})),(C.matchesSelector=me.test(B=M.matches||M.webkitMatchesSelector||M.mozMatchesSelector||M.oMatchesSelector||M.msMatchesSelector))&&o(function(e){C.disconnectedMatch=B.call(e,"*"),
B.call(e,"[s!='']:x"),R.push("!=",se)}),N=N.length&&new RegExp(N.join("|")),R=R.length&&new RegExp(R.join("|")),t=me.test(M.compareDocumentPosition),P=t||me.test(M.contains)?function(e,t){var i=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},G=t?function(e,t){if(e===t)return A=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i?i:(i=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&i||!C.sortDetached&&t.compareDocumentPosition(e)===i?e===I||e.ownerDocument===q&&P(q,e)?-1:t===I||t.ownerDocument===q&&P(q,t)?1:j?ee(j,e)-ee(j,t):0:4&i?-1:1)}:function(e,t){if(e===t)return A=!0,0;var i,n=0,o=e.parentNode,s=t.parentNode,r=[e],d=[t];if(!o||!s)return e===I?-1:t===I?1:o?-1:s?1:j?ee(j,e)-ee(j,t):0;if(o===s)return a(e,t);for(i=e;i=i.parentNode;)r.unshift(i);
for(i=t;i=i.parentNode;)d.unshift(i);for(;r[n]===d[n];)n++;return n?a(r[n],d[n]):r[n]===q?-1:d[n]===q?1:0},I):I},t.matches=function(e,i){return t(e,null,null,i)},t.matchesSelector=function(e,i){if((e.ownerDocument||e)!==I&&D(e),i=i.replace(ce,"='$1']"),C.matchesSelector&&O&&!V[i+" "]&&(!R||!R.test(i))&&(!N||!N.test(i)))try{var n=B.call(e,i);if(n||C.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(o){}return t(i,I,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==I&&D(e),P(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==I&&D(e);var i=k.attrHandle[t.toLowerCase()],n=i&&z.call(k.attrHandle,t.toLowerCase())?i(e,t,!O):void 0;return void 0!==n?n:C.attributes||!O?e.getAttribute(t):(n=e.getAttributeNode(t))&&n.specified?n.value:null},t.escape=function(e){return(e+"").replace(ye,Ce)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,i=[],n=0,o=0;if(A=!C.detectDuplicates,j=!C.sortStable&&e.slice(0),
e.sort(G),A){for(;t=e[o++];)t===e[o]&&(n=i.push(o));for(;n--;)e.splice(i[n],1)}return j=null,e},x=t.getText=function(e){var t,i="",n=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)i+=x(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[n++];)i+=x(t);return i},k=t.selectors={cacheLength:50,createPseudo:n,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(we,be),e[3]=(e[3]||e[4]||e[5]||"").replace(we,be),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,i=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":i&&ue.test(i)&&(t=E(i,!0))&&(t=i.indexOf(")",i.length-t)-i.length)&&(e[0]=e[0].slice(0,t),
e[2]=i.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(we,be).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=W[e+" "];return t||(t=new RegExp("(^|"+ie+")"+e+"("+ie+"|$)"))&&W(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,i,n){return function(o){var s=t.attr(o,e);return null==s?"!="===i:i?(s+="","="===i?s===n:"!="===i?s!==n:"^="===i?n&&0===s.indexOf(n):"*="===i?n&&s.indexOf(n)>-1:"$="===i?n&&s.slice(-n.length)===n:"~="===i?(" "+s.replace(ae," ")+" ").indexOf(n)>-1:"|="===i?s===n||s.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,i,n,o){var s="nth"!==e.slice(0,3),a="last"!==e.slice(-4),r="of-type"===t;return 1===n&&0===o?function(e){return!!e.parentNode}:function(t,i,d){var l,c,u,h,p,f,_=s!==a?"nextSibling":"previousSibling",m=t.parentNode,g=r&&t.nodeName.toLowerCase(),v=!d&&!r,w=!1;
if(m){if(s){for(;_;){for(h=t;h=h[_];)if(r?h.nodeName.toLowerCase()===g:1===h.nodeType)return!1;f=_="only"===e&&!f&&"nextSibling"}return!0}if(f=[a?m.firstChild:m.lastChild],a&&v){for(h=m,u=h[F]||(h[F]={}),c=u[h.uniqueID]||(u[h.uniqueID]={}),l=c[e]||[],p=l[0]===U&&l[1],w=p&&l[2],h=p&&m.childNodes[p];h=++p&&h&&h[_]||(w=p=0)||f.pop();)if(1===h.nodeType&&++w&&h===t){c[e]=[U,p,w];break}}else if(v&&(h=t,u=h[F]||(h[F]={}),c=u[h.uniqueID]||(u[h.uniqueID]={}),l=c[e]||[],p=l[0]===U&&l[1],w=p),w===!1)for(;(h=++p&&h&&h[_]||(w=p=0)||f.pop())&&((r?h.nodeName.toLowerCase()!==g:1!==h.nodeType)||!++w||(v&&(u=h[F]||(h[F]={}),c=u[h.uniqueID]||(u[h.uniqueID]={}),c[e]=[U,w]),h!==t)););return w-=o,w===n||w%n===0&&w/n>=0}}},PSEUDO:function(e,i){var o,s=k.pseudos[e]||k.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return s[F]?s(i):s.length>1?(o=[e,e,"",i],k.setFilters.hasOwnProperty(e.toLowerCase())?n(function(e,t){for(var n,o=s(e,i),a=o.length;a--;)n=ee(e,o[a]),e[n]=!(t[n]=o[a])}):function(e){
return s(e,0,o)}):s}},pseudos:{not:n(function(e){var t=[],i=[],o=T(e.replace(re,"$1"));return o[F]?n(function(e,t,i,n){for(var s,a=o(e,null,n,[]),r=e.length;r--;)(s=a[r])&&(e[r]=!(t[r]=s))}):function(e,n,s){return t[0]=e,o(t,null,s,i),t[0]=null,!i.pop()}}),has:n(function(e){return function(i){return t(e,i).length>0}}),contains:n(function(e){return e=e.replace(we,be),function(t){return(t.textContent||t.innerText||x(t)).indexOf(e)>-1}}),lang:n(function(e){return he.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(we,be).toLowerCase(),function(t){var i;do if(i=O?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return i=i.toLowerCase(),i===e||0===i.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var i=e.location&&e.location.hash;return i&&i.slice(1)===t.id},root:function(e){return e===M},focus:function(e){return e===I.activeElement&&(!I.hasFocus||I.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:l(!1),disabled:l(!0),checked:function(e){
var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!k.pseudos.empty(e)},header:function(e){return _e.test(e.nodeName)},input:function(e){return fe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,i){return[0>i?i+t:i]}),even:c(function(e,t){for(var i=0;t>i;i+=2)e.push(i);return e}),odd:c(function(e,t){for(var i=1;t>i;i+=2)e.push(i);return e}),lt:c(function(e,t,i){for(var n=0>i?i+t:i;--n>=0;)e.push(n);return e}),gt:c(function(e,t,i){for(var n=0>i?i+t:i;++n<t;)e.push(n);
return e})}},k.pseudos.nth=k.pseudos.eq;for(y in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})k.pseudos[y]=r(y);for(y in{submit:!0,reset:!0})k.pseudos[y]=d(y);return h.prototype=k.filters=k.pseudos,k.setFilters=new h,E=t.tokenize=function(e,i){var n,o,s,a,r,d,l,c=Q[e+" "];if(c)return i?0:c.slice(0);for(r=e,d=[],l=k.preFilter;r;){(!n||(o=de.exec(r)))&&(o&&(r=r.slice(o[0].length)||r),d.push(s=[])),n=!1,(o=le.exec(r))&&(n=o.shift(),s.push({value:n,type:o[0].replace(re," ")}),r=r.slice(n.length));for(a in k.filter)!(o=pe[a].exec(r))||l[a]&&!(o=l[a](o))||(n=o.shift(),s.push({value:n,type:a,matches:o}),r=r.slice(n.length));if(!n)break}return i?r.length:r?t.error(e):Q(e,d).slice(0)},T=t.compile=function(e,t){var i,n=[],o=[],s=V[e+" "];if(!s){for(t||(t=E(e)),i=t.length;i--;)s=w(t[i]),s[F]?n.push(s):o.push(s);s=V(e,b(o,n)),s.selector=e}return s},$=t.select=function(e,t,i,n){var o,s,a,r,d,l="function"==typeof e&&e,c=!n&&E(e=l.selector||e);if(i=i||[],1===c.length){if(s=c[0]=c[0].slice(0),s.length>2&&"ID"===(a=s[0]).type&&C.getById&&9===t.nodeType&&O&&k.relative[s[1].type]){
if(t=(k.find.ID(a.matches[0].replace(we,be),t)||[])[0],!t)return i;l&&(t=t.parentNode),e=e.slice(s.shift().value.length)}for(o=pe.needsContext.test(e)?0:s.length;o--&&(a=s[o],!k.relative[r=a.type]);)if((d=k.find[r])&&(n=d(a.matches[0].replace(we,be),ve.test(s[0].type)&&u(t.parentNode)||t))){if(s.splice(o,1),e=n.length&&p(s),!e)return Y.apply(i,n),i;break}}return(l||T(e,c))(n,t,!O,i,!t||ve.test(e)&&u(t.parentNode)||t),i},C.sortStable=F.split("").sort(G).join("")===F,C.detectDuplicates=!!A,D(),C.sortDetached=o(function(e){return 1&e.compareDocumentPosition(I.createElement("fieldset"))}),o(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||s("type|href|height|width",function(e,t,i){return i?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),C.attributes&&o(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||s("value",function(e,t,i){return i||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue;
}),o(function(e){return null==e.getAttribute("disabled")})||s(te,function(e,t,i){var n;return i?void 0:e[t]===!0?t.toLowerCase():(n=e.getAttributeNode(t))&&n.specified?n.value:null}),t}(e);he.find=ge,he.expr=ge.selectors,he.expr[":"]=he.expr.pseudos,he.uniqueSort=he.unique=ge.uniqueSort,he.text=ge.getText,he.isXMLDoc=ge.isXML,he.contains=ge.contains,he.escapeSelector=ge.escape;var ve=function(e,t,i){for(var n=[],o=void 0!==i;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&he(e).is(i))break;n.push(e)}return n},we=function(e,t){for(var i=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&i.push(e);return i},be=he.expr.match.needsContext,ye=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,Ce=/^.[^:#\[\.,]*$/;he.filter=function(e,t,i){var n=t[0];return i&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?he.find.matchesSelector(n,e)?[n]:[]:he.find.matches(e,he.grep(t,function(e){return 1===e.nodeType}))},he.fn.extend({find:function(e){var t,i,n=this.length,o=this;if("string"!=typeof e)return this.pushStack(he(e).filter(function(){
for(t=0;n>t;t++)if(he.contains(o[t],this))return!0}));for(i=this.pushStack([]),t=0;n>t;t++)he.find(e,o[t],i);return n>1?he.uniqueSort(i):i},filter:function(e){return this.pushStack(o(this,e||[],!1))},not:function(e){return this.pushStack(o(this,e||[],!0))},is:function(e){return!!o(this,"string"==typeof e&&be.test(e)?he(e):e||[],!1).length}});var ke,xe=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,Se=he.fn.init=function(e,t,i){var n,o;if(!e)return this;if(i=i||ke,"string"==typeof e){if(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:xe.exec(e),!n||!n[1]&&t)return!t||t.jquery?(t||i).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof he?t[0]:t,he.merge(this,he.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:Z,!0)),ye.test(n[1])&&he.isPlainObject(t))for(n in t)he.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return o=Z.getElementById(n[2]),o&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):he.isFunction(e)?void 0!==i.ready?i.ready(e):e(he):he.makeArray(e,this);
};Se.prototype=he.fn,ke=he(Z);var Ee=/^(?:parents|prev(?:Until|All))/,Te={children:!0,contents:!0,next:!0,prev:!0};he.fn.extend({has:function(e){var t=he(e,this),i=t.length;return this.filter(function(){for(var e=0;i>e;e++)if(he.contains(this,t[e]))return!0})},closest:function(e,t){var i,n=0,o=this.length,s=[],a="string"!=typeof e&&he(e);if(!be.test(e))for(;o>n;n++)for(i=this[n];i&&i!==t;i=i.parentNode)if(i.nodeType<11&&(a?a.index(i)>-1:1===i.nodeType&&he.find.matchesSelector(i,e))){s.push(i);break}return this.pushStack(s.length>1?he.uniqueSort(s):s)},index:function(e){return e?"string"==typeof e?oe.call(he(e),this[0]):oe.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(he.uniqueSort(he.merge(this.get(),he(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),he.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ve(e,"parentNode");
},parentsUntil:function(e,t,i){return ve(e,"parentNode",i)},next:function(e){return s(e,"nextSibling")},prev:function(e){return s(e,"previousSibling")},nextAll:function(e){return ve(e,"nextSibling")},prevAll:function(e){return ve(e,"previousSibling")},nextUntil:function(e,t,i){return ve(e,"nextSibling",i)},prevUntil:function(e,t,i){return ve(e,"previousSibling",i)},siblings:function(e){return we((e.parentNode||{}).firstChild,e)},children:function(e){return we(e.firstChild)},contents:function(e){return e.contentDocument||he.merge([],e.childNodes)}},function(e,t){he.fn[e]=function(i,n){var o=he.map(this,t,i);return"Until"!==e.slice(-5)&&(n=i),n&&"string"==typeof n&&(o=he.filter(n,o)),this.length>1&&(Te[e]||he.uniqueSort(o),Ee.test(e)&&o.reverse()),this.pushStack(o)}});var $e=/\S+/g;he.Callbacks=function(e){e="string"==typeof e?a(e):he.extend({},e);var t,i,n,o,s=[],r=[],d=-1,l=function(){for(o=e.once,n=t=!0;r.length;d=-1)for(i=r.shift();++d<s.length;)s[d].apply(i[0],i[1])===!1&&e.stopOnFalse&&(d=s.length,
i=!1);e.memory||(i=!1),t=!1,o&&(s=i?[]:"")},c={add:function(){return s&&(i&&!t&&(d=s.length-1,r.push(i)),function n(t){he.each(t,function(t,i){he.isFunction(i)?e.unique&&c.has(i)||s.push(i):i&&i.length&&"string"!==he.type(i)&&n(i)})}(arguments),i&&!t&&l()),this},remove:function(){return he.each(arguments,function(e,t){for(var i;(i=he.inArray(t,s,i))>-1;)s.splice(i,1),d>=i&&d--}),this},has:function(e){return e?he.inArray(e,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return o=r=[],s=i="",this},disabled:function(){return!s},lock:function(){return o=r=[],i||t||(s=i=""),this},locked:function(){return!!o},fireWith:function(e,i){return o||(i=i||[],i=[e,i.slice?i.slice():i],r.push(i),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},he.extend({Deferred:function(t){var i=[["notify","progress",he.Callbacks("memory"),he.Callbacks("memory"),2],["resolve","done",he.Callbacks("once memory"),he.Callbacks("once memory"),0,"resolved"],["reject","fail",he.Callbacks("once memory"),he.Callbacks("once memory"),1,"rejected"]],n="pending",o={
state:function(){return n},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return o.then(null,e)},pipe:function(){var e=arguments;return he.Deferred(function(t){he.each(i,function(i,n){var o=he.isFunction(e[n[4]])&&e[n[4]];s[n[1]](function(){var e=o&&o.apply(this,arguments);e&&he.isFunction(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[n[0]+"With"](this,o?[e]:arguments)})}),e=null}).promise()},then:function(t,n,o){function s(t,i,n,o){return function(){var l=this,c=arguments,u=function(){var e,u;if(!(a>t)){if(e=n.apply(l,c),e===i.promise())throw new TypeError("Thenable self-resolution");u=e&&("object"==typeof e||"function"==typeof e)&&e.then,he.isFunction(u)?o?u.call(e,s(a,i,r,o),s(a,i,d,o)):(a++,u.call(e,s(a,i,r,o),s(a,i,d,o),s(a,i,r,i.notifyWith))):(n!==r&&(l=void 0,c=[e]),(o||i.resolveWith)(l,c))}},h=o?u:function(){try{u()}catch(e){he.Deferred.exceptionHook&&he.Deferred.exceptionHook(e,h.stackTrace),t+1>=a&&(n!==d&&(l=void 0,
c=[e]),i.rejectWith(l,c))}};t?h():(he.Deferred.getStackHook&&(h.stackTrace=he.Deferred.getStackHook()),e.setTimeout(h))}}var a=0;return he.Deferred(function(e){i[0][3].add(s(0,e,he.isFunction(o)?o:r,e.notifyWith)),i[1][3].add(s(0,e,he.isFunction(t)?t:r)),i[2][3].add(s(0,e,he.isFunction(n)?n:d))}).promise()},promise:function(e){return null!=e?he.extend(e,o):o}},s={};return he.each(i,function(e,t){var a=t[2],r=t[5];o[t[1]]=a.add,r&&a.add(function(){n=r},i[3-e][2].disable,i[0][2].lock),a.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=a.fireWith}),o.promise(s),t&&t.call(s,s),s},when:function(e){var t=arguments.length,i=t,n=Array(i),o=te.call(arguments),s=he.Deferred(),a=function(e){return function(i){n[e]=this,o[e]=arguments.length>1?te.call(arguments):i,--t||s.resolveWith(n,o)}};if(1>=t&&(l(e,s.done(a(i)).resolve,s.reject),"pending"===s.state()||he.isFunction(o[i]&&o[i].then)))return s.then();for(;i--;)l(o[i],a(i),s.reject);return s.promise();
}});var Le=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;he.Deferred.exceptionHook=function(t,i){e.console&&e.console.warn&&t&&Le.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,i)};var je=he.Deferred();he.fn.ready=function(e){return je.then(e),this},he.extend({isReady:!1,readyWait:1,holdReady:function(e){e?he.readyWait++:he.ready(!0)},ready:function(e){(e===!0?--he.readyWait:he.isReady)||(he.isReady=!0,e!==!0&&--he.readyWait>0||je.resolveWith(Z,[he]))}}),he.ready.then=je.then,"complete"===Z.readyState||"loading"!==Z.readyState&&!Z.documentElement.doScroll?e.setTimeout(he.ready):(Z.addEventListener("DOMContentLoaded",c),e.addEventListener("load",c));var Ae=function(e,t,i,n,o,s,a){var r=0,d=e.length,l=null==i;if("object"===he.type(i)){o=!0;for(r in i)Ae(e,t,r,i[r],!0,s,a)}else if(void 0!==n&&(o=!0,he.isFunction(n)||(a=!0),l&&(a?(t.call(e,n),t=null):(l=t,t=function(e,t,i){return l.call(he(e),i)})),t))for(;d>r;r++)t(e[r],i,a?n:n.call(e[r],r,t(e[r],i)));
return o?e:l?t.call(e):d?t(e[0],i):s},De=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};u.uid=1,u.prototype={cache:function(e){var t=e[this.expando];return t||(t={},De(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,i){var n,o=this.cache(e);if("string"==typeof t)o[he.camelCase(t)]=i;else for(n in t)o[he.camelCase(n)]=t[n];return o},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][he.camelCase(t)]},access:function(e,t,i){return void 0===t||t&&"string"==typeof t&&void 0===i?this.get(e,t):(this.set(e,t,i),void 0!==i?i:t)},remove:function(e,t){var i,n=e[this.expando];if(void 0!==n){if(void 0!==t){he.isArray(t)?t=t.map(he.camelCase):(t=he.camelCase(t),t=t in n?[t]:t.match($e)||[]),i=t.length;for(;i--;)delete n[t[i]]}(void 0===t||he.isEmptyObject(n))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!he.isEmptyObject(t);
}};var Ie=new u,Me=new u,Oe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Ne=/[A-Z]/g;he.extend({hasData:function(e){return Me.hasData(e)||Ie.hasData(e)},data:function(e,t,i){return Me.access(e,t,i)},removeData:function(e,t){Me.remove(e,t)},_data:function(e,t,i){return Ie.access(e,t,i)},_removeData:function(e,t){Ie.remove(e,t)}}),he.fn.extend({data:function(e,t){var i,n,o,s=this[0],a=s&&s.attributes;if(void 0===e){if(this.length&&(o=Me.get(s),1===s.nodeType&&!Ie.get(s,"hasDataAttrs"))){for(i=a.length;i--;)a[i]&&(n=a[i].name,0===n.indexOf("data-")&&(n=he.camelCase(n.slice(5)),h(s,n,o[n])));Ie.set(s,"hasDataAttrs",!0)}return o}return"object"==typeof e?this.each(function(){Me.set(this,e)}):Ae(this,function(t){var i;if(s&&void 0===t){if(i=Me.get(s,e),void 0!==i)return i;if(i=h(s,e),void 0!==i)return i}else this.each(function(){Me.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Me.remove(this,e)})}}),he.extend({queue:function(e,t,i){var n;return e?(t=(t||"fx")+"queue",
n=Ie.get(e,t),i&&(!n||he.isArray(i)?n=Ie.access(e,t,he.makeArray(i)):n.push(i)),n||[]):void 0},dequeue:function(e,t){t=t||"fx";var i=he.queue(e,t),n=i.length,o=i.shift(),s=he._queueHooks(e,t),a=function(){he.dequeue(e,t)};"inprogress"===o&&(o=i.shift(),n--),o&&("fx"===t&&i.unshift("inprogress"),delete s.stop,o.call(e,a,s)),!n&&s&&s.empty.fire()},_queueHooks:function(e,t){var i=t+"queueHooks";return Ie.get(e,i)||Ie.access(e,i,{empty:he.Callbacks("once memory").add(function(){Ie.remove(e,[t+"queue",i])})})}}),he.fn.extend({queue:function(e,t){var i=2;return"string"!=typeof e&&(t=e,e="fx",i--),arguments.length<i?he.queue(this[0],e):void 0===t?this:this.each(function(){var i=he.queue(this,e,t);he._queueHooks(this,e),"fx"===e&&"inprogress"!==i[0]&&he.dequeue(this,e)})},dequeue:function(e){return this.each(function(){he.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var i,n=1,o=he.Deferred(),s=this,a=this.length,r=function(){--n||o.resolveWith(s,[s]);
};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)i=Ie.get(s[a],e+"queueHooks"),i&&i.empty&&(n++,i.empty.add(r));return r(),o.promise(t)}});var Re=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Be=new RegExp("^(?:([+-])=|)("+Re+")([a-z%]*)$","i"),Pe=["Top","Right","Bottom","Left"],Fe=function(e,t){return e=t||e,"none"===e.style.display||""===e.style.display&&he.contains(e.ownerDocument,e)&&"none"===he.css(e,"display")},qe=function(e,t,i,n){var o,s,a={};for(s in t)a[s]=e.style[s],e.style[s]=t[s];o=i.apply(e,n||[]);for(s in t)e.style[s]=a[s];return o},Ue={};he.fn.extend({show:function(){return _(this,!0)},hide:function(){return _(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Fe(this)?he(this).show():he(this).hide()})}});var He=/^(?:checkbox|radio)$/i,We=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,Qe=/^$|\/(?:java|ecma)script/i,Ve={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],
tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Ve.optgroup=Ve.option,Ve.tbody=Ve.tfoot=Ve.colgroup=Ve.caption=Ve.thead,Ve.th=Ve.td;var Ge=/<|&#?\w+;/;!function(){var e=Z.createDocumentFragment(),t=e.appendChild(Z.createElement("div")),i=Z.createElement("input");i.setAttribute("type","radio"),i.setAttribute("checked","checked"),i.setAttribute("name","t"),t.appendChild(i),ce.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",ce.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var ze=Z.documentElement,Ke=/^key/,Je=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Xe=/^([^.]*)(?:\.(.+)|)/;he.event={global:{},add:function(e,t,i,n,o){var s,a,r,d,l,c,u,h,p,f,_,m=Ie.get(e);if(m)for(i.handler&&(s=i,i=s.handler,o=s.selector),o&&he.find.matchesSelector(ze,o),i.guid||(i.guid=he.guid++),(d=m.events)||(d=m.events={}),(a=m.handle)||(a=m.handle=function(t){return"undefined"!=typeof he&&he.event.triggered!==t.type?he.event.dispatch.apply(e,arguments):void 0;
}),t=(t||"").match($e)||[""],l=t.length;l--;)r=Xe.exec(t[l])||[],p=_=r[1],f=(r[2]||"").split(".").sort(),p&&(u=he.event.special[p]||{},p=(o?u.delegateType:u.bindType)||p,u=he.event.special[p]||{},c=he.extend({type:p,origType:_,data:n,handler:i,guid:i.guid,selector:o,needsContext:o&&he.expr.match.needsContext.test(o),namespace:f.join(".")},s),(h=d[p])||(h=d[p]=[],h.delegateCount=0,u.setup&&u.setup.call(e,n,f,a)!==!1||e.addEventListener&&e.addEventListener(p,a)),u.add&&(u.add.call(e,c),c.handler.guid||(c.handler.guid=i.guid)),o?h.splice(h.delegateCount++,0,c):h.push(c),he.event.global[p]=!0)},remove:function(e,t,i,n,o){var s,a,r,d,l,c,u,h,p,f,_,m=Ie.hasData(e)&&Ie.get(e);if(m&&(d=m.events)){for(t=(t||"").match($e)||[""],l=t.length;l--;)if(r=Xe.exec(t[l])||[],p=_=r[1],f=(r[2]||"").split(".").sort(),p){for(u=he.event.special[p]||{},p=(n?u.delegateType:u.bindType)||p,h=d[p]||[],r=r[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=h.length;s--;)c=h[s],!o&&_!==c.origType||i&&i.guid!==c.guid||r&&!r.test(c.namespace)||n&&n!==c.selector&&("**"!==n||!c.selector)||(h.splice(s,1),
c.selector&&h.delegateCount--,u.remove&&u.remove.call(e,c));a&&!h.length&&(u.teardown&&u.teardown.call(e,f,m.handle)!==!1||he.removeEvent(e,p,m.handle),delete d[p])}else for(p in d)he.event.remove(e,p+t[l],i,n,!0);he.isEmptyObject(d)&&Ie.remove(e,"handle events")}},dispatch:function(e){var t,i,n,o,s,a,r=he.event.fix(e),d=new Array(arguments.length),l=(Ie.get(this,"events")||{})[r.type]||[],c=he.event.special[r.type]||{};for(d[0]=r,t=1;t<arguments.length;t++)d[t]=arguments[t];if(r.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,r)!==!1){for(a=he.event.handlers.call(this,r,l),t=0;(o=a[t++])&&!r.isPropagationStopped();)for(r.currentTarget=o.elem,i=0;(s=o.handlers[i++])&&!r.isImmediatePropagationStopped();)(!r.rnamespace||r.rnamespace.test(s.namespace))&&(r.handleObj=s,r.data=s.data,n=((he.event.special[s.origType]||{}).handle||s.handler).apply(o.elem,d),void 0!==n&&(r.result=n)===!1&&(r.preventDefault(),r.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,r),r.result;
}},handlers:function(e,t){var i,n,o,s,a=[],r=t.delegateCount,d=e.target;if(r&&d.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;d!==this;d=d.parentNode||this)if(1===d.nodeType&&(d.disabled!==!0||"click"!==e.type)){for(n=[],i=0;r>i;i++)s=t[i],o=s.selector+" ",void 0===n[o]&&(n[o]=s.needsContext?he(o,this).index(d)>-1:he.find(o,this,null,[d]).length),n[o]&&n.push(s);n.length&&a.push({elem:d,handlers:n})}return r<t.length&&a.push({elem:this,handlers:t.slice(r)}),a},addProp:function(e,t){Object.defineProperty(he.Event.prototype,e,{enumerable:!0,configurable:!0,get:he.isFunction(t)?function(){return this.originalEvent?t(this.originalEvent):void 0}:function(){return this.originalEvent?this.originalEvent[e]:void 0},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[he.expando]?e:new he.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==y()&&this.focus?(this.focus(),!1):void 0},
delegateType:"focusin"},blur:{trigger:function(){return this===y()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&he.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(e){return he.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},he.removeEvent=function(e,t,i){e.removeEventListener&&e.removeEventListener(t,i)},he.Event=function(e,t){return this instanceof he.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?w:b,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&he.extend(this,t),this.timeStamp=e&&e.timeStamp||he.now(),void(this[he.expando]=!0)):new he.Event(e,t)},he.Event.prototype={constructor:he.Event,
isDefaultPrevented:b,isPropagationStopped:b,isImmediatePropagationStopped:b,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=w,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=w,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=w,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},he.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&Ke.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Je.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which;
}},he.event.addProp),he.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){he.event.special[e]={delegateType:t,bindType:t,handle:function(e){var i,n=this,o=e.relatedTarget,s=e.handleObj;return(!o||o!==n&&!he.contains(n,o))&&(e.type=s.origType,i=s.handler.apply(this,arguments),e.type=t),i}}}),he.fn.extend({on:function(e,t,i,n){return C(this,e,t,i,n)},one:function(e,t,i,n){return C(this,e,t,i,n,1)},off:function(e,t,i){var n,o;if(e&&e.preventDefault&&e.handleObj)return n=e.handleObj,he(e.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof e){for(o in e)this.off(o,t,e[o]);return this}return(t===!1||"function"==typeof t)&&(i=t,t=void 0),i===!1&&(i=b),this.each(function(){he.event.remove(this,e,i,t)})}});var Ye=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Ze=/<script|<style|<link/i,et=/checked\s*(?:[^=]|=\s*.checked.)/i,tt=/^true\/(.*)/,it=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
he.extend({htmlPrefilter:function(e){return e.replace(Ye,"<$1></$2>")},clone:function(e,t,i){var n,o,s,a,r=e.cloneNode(!0),d=he.contains(e.ownerDocument,e);if(!(ce.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||he.isXMLDoc(e)))for(a=m(r),s=m(e),n=0,o=s.length;o>n;n++)T(s[n],a[n]);if(t)if(i)for(s=s||m(e),a=a||m(r),n=0,o=s.length;o>n;n++)E(s[n],a[n]);else E(e,r);return a=m(r,"script"),a.length>0&&g(a,!d&&m(e,"script")),r},cleanData:function(e){for(var t,i,n,o=he.event.special,s=0;void 0!==(i=e[s]);s++)if(De(i)){if(t=i[Ie.expando]){if(t.events)for(n in t.events)o[n]?he.event.remove(i,n):he.removeEvent(i,n,t.handle);i[Ie.expando]=void 0}i[Me.expando]&&(i[Me.expando]=void 0)}}}),he.fn.extend({detach:function(e){return L(this,e,!0)},remove:function(e){return L(this,e)},text:function(e){return Ae(this,function(e){return void 0===e?he.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=e)})},null,e,arguments.length)},append:function(){
return $(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=k(this,e);t.appendChild(e)}})},prepend:function(){return $(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=k(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return $(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return $(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(he.cleanData(m(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return he.clone(this,e,t)})},html:function(e){return Ae(this,function(e){var t=this[0]||{},i=0,n=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ze.test(e)&&!Ve[(We.exec(e)||["",""])[1].toLowerCase()]){e=he.htmlPrefilter(e);try{for(;n>i;i++)t=this[i]||{},
1===t.nodeType&&(he.cleanData(m(t,!1)),t.innerHTML=e);t=0}catch(o){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return $(this,arguments,function(t){var i=this.parentNode;he.inArray(this,e)<0&&(he.cleanData(m(this)),i&&i.replaceChild(t,this))},e)}}),he.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){he.fn[e]=function(e){for(var i,n=[],o=he(e),s=o.length-1,a=0;s>=a;a++)i=a===s?this:this.clone(!0),he(o[a])[t](i),ne.apply(n,i.get());return this.pushStack(n)}});var nt=/^margin/,ot=new RegExp("^("+Re+")(?!px)[a-z%]+$","i"),st=function(t){var i=t.ownerDocument.defaultView;return i&&i.opener||(i=e),i.getComputedStyle(t)};!function(){function t(){if(r){r.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",r.innerHTML="",ze.appendChild(a);var t=e.getComputedStyle(r);i="1%"!==t.top,s="2px"===t.marginLeft,n="4px"===t.width,
r.style.marginRight="50%",o="4px"===t.marginRight,ze.removeChild(a),r=null}}var i,n,o,s,a=Z.createElement("div"),r=Z.createElement("div");r.style&&(r.style.backgroundClip="content-box",r.cloneNode(!0).style.backgroundClip="",ce.clearCloneStyle="content-box"===r.style.backgroundClip,a.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",a.appendChild(r),he.extend(ce,{pixelPosition:function(){return t(),i},boxSizingReliable:function(){return t(),n},pixelMarginRight:function(){return t(),o},reliableMarginLeft:function(){return t(),s}}))}();var at=/^(none|table(?!-c[ea]).+)/,rt={position:"absolute",visibility:"hidden",display:"block"},dt={letterSpacing:"0",fontWeight:"400"},lt=["Webkit","Moz","ms"],ct=Z.createElement("div").style;he.extend({cssHooks:{opacity:{get:function(e,t){if(t){var i=j(e,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,
opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,i,n){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,s,a,r=he.camelCase(t),d=e.style;return t=he.cssProps[r]||(he.cssProps[r]=D(r)||r),a=he.cssHooks[t]||he.cssHooks[r],void 0===i?a&&"get"in a&&void 0!==(o=a.get(e,!1,n))?o:d[t]:(s=typeof i,"string"===s&&(o=Be.exec(i))&&o[1]&&(i=p(e,t,o),s="number"),null!=i&&i===i&&("number"===s&&(i+=o&&o[3]||(he.cssNumber[r]?"":"px")),ce.clearCloneStyle||""!==i||0!==t.indexOf("background")||(d[t]="inherit"),a&&"set"in a&&void 0===(i=a.set(e,i,n))||(d[t]=i)),void 0)}},css:function(e,t,i,n){var o,s,a,r=he.camelCase(t);return t=he.cssProps[r]||(he.cssProps[r]=D(r)||r),a=he.cssHooks[t]||he.cssHooks[r],a&&"get"in a&&(o=a.get(e,!0,i)),void 0===o&&(o=j(e,t,n)),"normal"===o&&t in dt&&(o=dt[t]),""===i||i?(s=parseFloat(o),i===!0||isFinite(s)?s||0:o):o}}),he.each(["height","width"],function(e,t){he.cssHooks[t]={get:function(e,i,n){return i?!at.test(he.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?O(e,t,n):qe(e,rt,function(){
return O(e,t,n)}):void 0},set:function(e,i,n){var o,s=n&&st(e),a=n&&M(e,t,n,"border-box"===he.css(e,"boxSizing",!1,s),s);return a&&(o=Be.exec(i))&&"px"!==(o[3]||"px")&&(e.style[t]=i,i=he.css(e,t)),I(e,i,a)}}}),he.cssHooks.marginLeft=A(ce.reliableMarginLeft,function(e,t){return t?(parseFloat(j(e,"marginLeft"))||e.getBoundingClientRect().left-qe(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px":void 0}),he.each({margin:"",padding:"",border:"Width"},function(e,t){he.cssHooks[e+t]={expand:function(i){for(var n=0,o={},s="string"==typeof i?i.split(" "):[i];4>n;n++)o[e+Pe[n]+t]=s[n]||s[n-2]||s[0];return o}},nt.test(e)||(he.cssHooks[e+t].set=I)}),he.fn.extend({css:function(e,t){return Ae(this,function(e,t,i){var n,o,s={},a=0;if(he.isArray(t)){for(n=st(e),o=t.length;o>a;a++)s[t[a]]=he.css(e,t[a],!1,n);return s}return void 0!==i?he.style(e,t,i):he.css(e,t)},e,t,arguments.length>1)}}),he.Tween=N,N.prototype={constructor:N,init:function(e,t,i,n,o,s){this.elem=e,this.prop=i,this.easing=o||he.easing._default,
this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=s||(he.cssNumber[i]?"":"px")},cur:function(){var e=N.propHooks[this.prop];return e&&e.get?e.get(this):N.propHooks._default.get(this)},run:function(e){var t,i=N.propHooks[this.prop];return this.options.duration?this.pos=t=he.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):N.propHooks._default.set(this),this}},N.prototype.init.prototype=N.prototype,N.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=he.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){he.fx.step[e.prop]?he.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[he.cssProps[e.prop]]&&!he.cssHooks[e.prop]?e.elem[e.prop]=e.now:he.style(e.elem,e.prop,e.now+e.unit)}}},N.propHooks.scrollTop=N.propHooks.scrollLeft={
set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},he.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},he.fx=N.prototype.init,he.fx.step={};var ut,ht,pt=/^(?:toggle|show|hide)$/,ft=/queueHooks$/;he.Animation=he.extend(H,{tweeners:{"*":[function(e,t){var i=this.createTween(e,t);return p(i.elem,e,Be.exec(t),i),i}]},tweener:function(e,t){he.isFunction(e)?(t=e,e=["*"]):e=e.match($e);for(var i,n=0,o=e.length;o>n;n++)i=e[n],H.tweeners[i]=H.tweeners[i]||[],H.tweeners[i].unshift(t)},prefilters:[q],prefilter:function(e,t){t?H.prefilters.unshift(e):H.prefilters.push(e)}}),he.speed=function(e,t,i){var n=e&&"object"==typeof e?he.extend({},e):{complete:i||!i&&t||he.isFunction(e)&&e,duration:e,easing:i&&t||t&&!he.isFunction(t)&&t};return he.fx.off||Z.hidden?n.duration=0:n.duration="number"==typeof n.duration?n.duration:n.duration in he.fx.speeds?he.fx.speeds[n.duration]:he.fx.speeds._default,(null==n.queue||n.queue===!0)&&(n.queue="fx"),
n.old=n.complete,n.complete=function(){he.isFunction(n.old)&&n.old.call(this),n.queue&&he.dequeue(this,n.queue)},n},he.fn.extend({fadeTo:function(e,t,i,n){return this.filter(Fe).css("opacity",0).show().end().animate({opacity:t},e,i,n)},animate:function(e,t,i,n){var o=he.isEmptyObject(e),s=he.speed(t,i,n),a=function(){var t=H(this,he.extend({},e),s);(o||Ie.get(this,"finish"))&&t.stop(!0)};return a.finish=a,o||s.queue===!1?this.each(a):this.queue(s.queue,a)},stop:function(e,t,i){var n=function(e){var t=e.stop;delete e.stop,t(i)};return"string"!=typeof e&&(i=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,o=null!=e&&e+"queueHooks",s=he.timers,a=Ie.get(this);if(o)a[o]&&a[o].stop&&n(a[o]);else for(o in a)a[o]&&a[o].stop&&ft.test(o)&&n(a[o]);for(o=s.length;o--;)s[o].elem!==this||null!=e&&s[o].queue!==e||(s[o].anim.stop(i),t=!1,s.splice(o,1));(t||!i)&&he.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,i=Ie.get(this),n=i[e+"queue"],o=i[e+"queueHooks"],s=he.timers,a=n?n.length:0;
for(i.finish=!0,he.queue(this,e,[]),o&&o.stop&&o.stop.call(this,!0),t=s.length;t--;)s[t].elem===this&&s[t].queue===e&&(s[t].anim.stop(!0),s.splice(t,1));for(t=0;a>t;t++)n[t]&&n[t].finish&&n[t].finish.call(this);delete i.finish})}}),he.each(["toggle","show","hide"],function(e,t){var i=he.fn[t];he.fn[t]=function(e,n,o){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(P(t,!0),e,n,o)}}),he.each({slideDown:P("show"),slideUp:P("hide"),slideToggle:P("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){he.fn[e]=function(e,i,n){return this.animate(t,e,i,n)}}),he.timers=[],he.fx.tick=function(){var e,t=0,i=he.timers;for(ut=he.now();t<i.length;t++)e=i[t],e()||i[t]!==e||i.splice(t--,1);i.length||he.fx.stop(),ut=void 0},he.fx.timer=function(e){he.timers.push(e),e()?he.fx.start():he.timers.pop()},he.fx.interval=13,he.fx.start=function(){ht||(ht=e.requestAnimationFrame?e.requestAnimationFrame(R):e.setInterval(he.fx.tick,he.fx.interval));
},he.fx.stop=function(){e.cancelAnimationFrame?e.cancelAnimationFrame(ht):e.clearInterval(ht),ht=null},he.fx.speeds={slow:600,fast:200,_default:400},he.fn.delay=function(t,i){return t=he.fx?he.fx.speeds[t]||t:t,i=i||"fx",this.queue(i,function(i,n){var o=e.setTimeout(i,t);n.stop=function(){e.clearTimeout(o)}})},function(){var e=Z.createElement("input"),t=Z.createElement("select"),i=t.appendChild(Z.createElement("option"));e.type="checkbox",ce.checkOn=""!==e.value,ce.optSelected=i.selected,e=Z.createElement("input"),e.value="t",e.type="radio",ce.radioValue="t"===e.value}();var _t,mt=he.expr.attrHandle;he.fn.extend({attr:function(e,t){return Ae(this,he.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){he.removeAttr(this,e)})}}),he.extend({attr:function(e,t,i){var n,o,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return"undefined"==typeof e.getAttribute?he.prop(e,t,i):(1===s&&he.isXMLDoc(e)||(o=he.attrHooks[t.toLowerCase()]||(he.expr.match.bool.test(t)?_t:void 0)),void 0!==i?null===i?void he.removeAttr(e,t):o&&"set"in o&&void 0!==(n=o.set(e,i,t))?n:(e.setAttribute(t,i+""),
i):o&&"get"in o&&null!==(n=o.get(e,t))?n:(n=he.find.attr(e,t),null==n?void 0:n))},attrHooks:{type:{set:function(e,t){if(!ce.radioValue&&"radio"===t&&he.nodeName(e,"input")){var i=e.value;return e.setAttribute("type",t),i&&(e.value=i),t}}}},removeAttr:function(e,t){var i,n=0,o=t&&t.match($e);if(o&&1===e.nodeType)for(;i=o[n++];)e.removeAttribute(i)}}),_t={set:function(e,t,i){return t===!1?he.removeAttr(e,i):e.setAttribute(i,i),i}},he.each(he.expr.match.bool.source.match(/\w+/g),function(e,t){var i=mt[t]||he.find.attr;mt[t]=function(e,t,n){var o,s,a=t.toLowerCase();return n||(s=mt[a],mt[a]=o,o=null!=i(e,t,n)?a:null,mt[a]=s),o}});var gt=/^(?:input|select|textarea|button)$/i,vt=/^(?:a|area)$/i;he.fn.extend({prop:function(e,t){return Ae(this,he.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[he.propFix[e]||e]})}}),he.extend({prop:function(e,t,i){var n,o,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&he.isXMLDoc(e)||(t=he.propFix[t]||t,o=he.propHooks[t]),
void 0!==i?o&&"set"in o&&void 0!==(n=o.set(e,i,t))?n:e[t]=i:o&&"get"in o&&null!==(n=o.get(e,t))?n:e[t]},propHooks:{tabIndex:{get:function(e){var t=he.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||vt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),ce.optSelected||(he.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),he.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){he.propFix[this.toLowerCase()]=this});var wt=/[\t\r\n\f]/g;he.fn.extend({addClass:function(e){var t,i,n,o,s,a,r,d=0;if(he.isFunction(e))return this.each(function(t){he(this).addClass(e.call(this,t,W(this)))});if("string"==typeof e&&e)for(t=e.match($e)||[];i=this[d++];)if(o=W(i),n=1===i.nodeType&&(" "+o+" ").replace(wt," ")){
for(a=0;s=t[a++];)n.indexOf(" "+s+" ")<0&&(n+=s+" ");r=he.trim(n),o!==r&&i.setAttribute("class",r)}return this},removeClass:function(e){var t,i,n,o,s,a,r,d=0;if(he.isFunction(e))return this.each(function(t){he(this).removeClass(e.call(this,t,W(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match($e)||[];i=this[d++];)if(o=W(i),n=1===i.nodeType&&(" "+o+" ").replace(wt," ")){for(a=0;s=t[a++];)for(;n.indexOf(" "+s+" ")>-1;)n=n.replace(" "+s+" "," ");r=he.trim(n),o!==r&&i.setAttribute("class",r)}return this},toggleClass:function(e,t){var i=typeof e;return"boolean"==typeof t&&"string"===i?t?this.addClass(e):this.removeClass(e):he.isFunction(e)?this.each(function(i){he(this).toggleClass(e.call(this,i,W(this),t),t)}):this.each(function(){var t,n,o,s;if("string"===i)for(n=0,o=he(this),s=e.match($e)||[];t=s[n++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else(void 0===e||"boolean"===i)&&(t=W(this),t&&Ie.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||e===!1?"":Ie.get(this,"__className__")||""));
})},hasClass:function(e){var t,i,n=0;for(t=" "+e+" ";i=this[n++];)if(1===i.nodeType&&(" "+W(i)+" ").replace(wt," ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g,yt=/[\x20\t\r\n\f]+/g;he.fn.extend({val:function(e){var t,i,n,o=this[0];{if(arguments.length)return n=he.isFunction(e),this.each(function(i){var o;1===this.nodeType&&(o=n?e.call(this,i,he(this).val()):e,null==o?o="":"number"==typeof o?o+="":he.isArray(o)&&(o=he.map(o,function(e){return null==e?"":e+""})),t=he.valHooks[this.type]||he.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))});if(o)return t=he.valHooks[o.type]||he.valHooks[o.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(i=t.get(o,"value"))?i:(i=o.value,"string"==typeof i?i.replace(bt,""):null==i?"":i)}}}),he.extend({valHooks:{option:{get:function(e){var t=he.find.attr(e,"value");return null!=t?t:he.trim(he.text(e)).replace(yt," ")}},select:{get:function(e){for(var t,i,n=e.options,o=e.selectedIndex,s="select-one"===e.type,a=s?null:[],r=s?o+1:n.length,d=0>o?r:s?o:0;r>d;d++)if(i=n[d],
(i.selected||d===o)&&!i.disabled&&(!i.parentNode.disabled||!he.nodeName(i.parentNode,"optgroup"))){if(t=he(i).val(),s)return t;a.push(t)}return a},set:function(e,t){for(var i,n,o=e.options,s=he.makeArray(t),a=o.length;a--;)n=o[a],(n.selected=he.inArray(he.valHooks.option.get(n),s)>-1)&&(i=!0);return i||(e.selectedIndex=-1),s}}}}),he.each(["radio","checkbox"],function(){he.valHooks[this]={set:function(e,t){return he.isArray(t)?e.checked=he.inArray(he(e).val(),t)>-1:void 0}},ce.checkOn||(he.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Ct=/^(?:focusinfocus|focusoutblur)$/;he.extend(he.event,{trigger:function(t,i,n,o){var s,a,r,d,l,c,u,h=[n||Z],p=re.call(t,"type")?t.type:t,f=re.call(t,"namespace")?t.namespace.split("."):[];if(a=r=n=n||Z,3!==n.nodeType&&8!==n.nodeType&&!Ct.test(p+he.event.triggered)&&(p.indexOf(".")>-1&&(f=p.split("."),p=f.shift(),f.sort()),l=p.indexOf(":")<0&&"on"+p,t=t[he.expando]?t:new he.Event(p,"object"==typeof t&&t),t.isTrigger=o?2:3,
t.namespace=f.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),i=null==i?[t]:he.makeArray(i,[t]),u=he.event.special[p]||{},o||!u.trigger||u.trigger.apply(n,i)!==!1)){if(!o&&!u.noBubble&&!he.isWindow(n)){for(d=u.delegateType||p,Ct.test(d+p)||(a=a.parentNode);a;a=a.parentNode)h.push(a),r=a;r===(n.ownerDocument||Z)&&h.push(r.defaultView||r.parentWindow||e)}for(s=0;(a=h[s++])&&!t.isPropagationStopped();)t.type=s>1?d:u.bindType||p,c=(Ie.get(a,"events")||{})[t.type]&&Ie.get(a,"handle"),c&&c.apply(a,i),c=l&&a[l],c&&c.apply&&De(a)&&(t.result=c.apply(a,i),t.result===!1&&t.preventDefault());return t.type=p,o||t.isDefaultPrevented()||u._default&&u._default.apply(h.pop(),i)!==!1||!De(n)||l&&he.isFunction(n[p])&&!he.isWindow(n)&&(r=n[l],r&&(n[l]=null),he.event.triggered=p,n[p](),he.event.triggered=void 0,r&&(n[l]=r)),t.result}},simulate:function(e,t,i){var n=he.extend(new he.Event,i,{type:e,isSimulated:!0});he.event.trigger(n,null,t);
}}),he.fn.extend({trigger:function(e,t){return this.each(function(){he.event.trigger(e,t,this)})},triggerHandler:function(e,t){var i=this[0];return i?he.event.trigger(e,t,i,!0):void 0}}),he.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){he.fn[t]=function(e,i){return arguments.length>0?this.on(t,null,e,i):this.trigger(t)}}),he.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),ce.focusin="onfocusin"in e,ce.focusin||he.each({focus:"focusin",blur:"focusout"},function(e,t){var i=function(e){he.event.simulate(t,e.target,he.event.fix(e))};he.event.special[t]={setup:function(){var n=this.ownerDocument||this,o=Ie.access(n,t);o||n.addEventListener(e,i,!0),Ie.access(n,t,(o||0)+1)},teardown:function(){var n=this.ownerDocument||this,o=Ie.access(n,t)-1;o?Ie.access(n,t,o):(n.removeEventListener(e,i,!0),Ie.remove(n,t));
}}});var kt=e.location,xt=he.now(),St=/\?/;he.parseXML=function(t){var i;if(!t||"string"!=typeof t)return null;try{i=(new e.DOMParser).parseFromString(t,"text/xml")}catch(n){i=void 0}return(!i||i.getElementsByTagName("parsererror").length)&&he.error("Invalid XML: "+t),i};var Et=/\[\]$/,Tt=/\r?\n/g,$t=/^(?:submit|button|image|reset|file)$/i,Lt=/^(?:input|select|textarea|keygen)/i;he.param=function(e,t){var i,n=[],o=function(e,t){var i=he.isFunction(t)?t():t;n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==i?"":i)};if(he.isArray(e)||e.jquery&&!he.isPlainObject(e))he.each(e,function(){o(this.name,this.value)});else for(i in e)Q(i,e[i],t,o);return n.join("&")},he.fn.extend({serialize:function(){return he.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=he.prop(this,"elements");return e?he.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!he(this).is(":disabled")&&Lt.test(this.nodeName)&&!$t.test(e)&&(this.checked||!He.test(e));
}).map(function(e,t){var i=he(this).val();return null==i?null:he.isArray(i)?he.map(i,function(e){return{name:t.name,value:e.replace(Tt,"\r\n")}}):{name:t.name,value:i.replace(Tt,"\r\n")}}).get()}});var jt=/%20/g,At=/#.*$/,Dt=/([?&])_=[^&]*/,It=/^(.*?):[ \t]*([^\r\n]*)$/gm,Mt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ot=/^(?:GET|HEAD)$/,Nt=/^\/\//,Rt={},Bt={},Pt="*/".concat("*"),Ft=Z.createElement("a");Ft.href=kt.href,he.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:kt.href,type:"GET",isLocal:Mt.test(kt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Pt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":he.parseXML},flatOptions:{
url:!0,context:!0}},ajaxSetup:function(e,t){return t?z(z(e,he.ajaxSettings),t):z(he.ajaxSettings,e)},ajaxPrefilter:V(Rt),ajaxTransport:V(Bt),ajax:function(t,i){function n(t,i,n,r){var l,h,p,b,y,C=i;c||(c=!0,d&&e.clearTimeout(d),o=void 0,a=r||"",k.readyState=t>0?4:0,l=t>=200&&300>t||304===t,n&&(b=K(f,k,n)),b=J(f,b,k,l),l?(f.ifModified&&(y=k.getResponseHeader("Last-Modified"),y&&(he.lastModified[s]=y),y=k.getResponseHeader("etag"),y&&(he.etag[s]=y)),204===t||"HEAD"===f.type?C="nocontent":304===t?C="notmodified":(C=b.state,h=b.data,p=b.error,l=!p)):(p=C,(t||!C)&&(C="error",0>t&&(t=0))),k.status=t,k.statusText=(i||C)+"",l?g.resolveWith(_,[h,C,k]):g.rejectWith(_,[k,C,p]),k.statusCode(w),w=void 0,u&&m.trigger(l?"ajaxSuccess":"ajaxError",[k,f,l?h:p]),v.fireWith(_,[k,C]),u&&(m.trigger("ajaxComplete",[k,f]),--he.active||he.event.trigger("ajaxStop")))}"object"==typeof t&&(i=t,t=void 0),i=i||{};var o,s,a,r,d,l,c,u,h,p,f=he.ajaxSetup({},i),_=f.context||f,m=f.context&&(_.nodeType||_.jquery)?he(_):he.event,g=he.Deferred(),v=he.Callbacks("once memory"),w=f.statusCode||{},b={},y={},C="canceled",k={
readyState:0,getResponseHeader:function(e){var t;if(c){if(!r)for(r={};t=It.exec(a);)r[t[1].toLowerCase()]=t[2];t=r[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=y[e.toLowerCase()]=y[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)k.always(e[k.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||C;return o&&o.abort(t),n(0,t),this}};if(g.promise(k),f.url=((t||f.url||kt.href)+"").replace(Nt,kt.protocol+"//"),f.type=i.method||i.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match($e)||[""],null==f.crossDomain){l=Z.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Ft.protocol+"//"+Ft.host!=l.protocol+"//"+l.host}catch(x){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=he.param(f.data,f.traditional)),G(Rt,f,i,k),c)return k;
u=he.event&&f.global,u&&0===he.active++&&he.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Ot.test(f.type),s=f.url.replace(At,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(jt,"+")):(p=f.url.slice(s.length),f.data&&(s+=(St.test(s)?"&":"?")+f.data,delete f.data),f.cache===!1&&(s=s.replace(Dt,""),p=(St.test(s)?"&":"?")+"_="+xt++ +p),f.url=s+p),f.ifModified&&(he.lastModified[s]&&k.setRequestHeader("If-Modified-Since",he.lastModified[s]),he.etag[s]&&k.setRequestHeader("If-None-Match",he.etag[s])),(f.data&&f.hasContent&&f.contentType!==!1||i.contentType)&&k.setRequestHeader("Content-Type",f.contentType),k.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Pt+"; q=0.01":""):f.accepts["*"]);for(h in f.headers)k.setRequestHeader(h,f.headers[h]);if(f.beforeSend&&(f.beforeSend.call(_,k,f)===!1||c))return k.abort();if(C="abort",
v.add(f.complete),k.done(f.success),k.fail(f.error),o=G(Bt,f,i,k)){if(k.readyState=1,u&&m.trigger("ajaxSend",[k,f]),c)return k;f.async&&f.timeout>0&&(d=e.setTimeout(function(){k.abort("timeout")},f.timeout));try{c=!1,o.send(b,n)}catch(x){if(c)throw x;n(-1,x)}}else n(-1,"No Transport");return k},getJSON:function(e,t,i){return he.get(e,t,i,"json")},getScript:function(e,t){return he.get(e,void 0,t,"script")}}),he.each(["get","post"],function(e,t){he[t]=function(e,i,n,o){return he.isFunction(i)&&(o=o||n,n=i,i=void 0),he.ajax(he.extend({url:e,type:t,dataType:o,data:i,success:n},he.isPlainObject(e)&&e))}}),he._evalUrl=function(e){return he.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},he.fn.extend({wrapAll:function(e){var t;return this[0]&&(he.isFunction(e)&&(e=e.call(this[0])),t=he(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),
this},wrapInner:function(e){return he.isFunction(e)?this.each(function(t){he(this).wrapInner(e.call(this,t))}):this.each(function(){var t=he(this),i=t.contents();i.length?i.wrapAll(e):t.append(e)})},wrap:function(e){var t=he.isFunction(e);return this.each(function(i){he(this).wrapAll(t?e.call(this,i):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){he(this).replaceWith(this.childNodes)}),this}}),he.expr.pseudos.hidden=function(e){return!he.expr.pseudos.visible(e)},he.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},he.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(t){}};var qt={0:200,1223:204},Ut=he.ajaxSettings.xhr();ce.cors=!!Ut&&"withCredentials"in Ut,ce.ajax=Ut=!!Ut,he.ajaxTransport(function(t){var i,n;return ce.cors||Ut&&!t.crossDomain?{send:function(o,s){var a,r=t.xhr();if(r.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)r[a]=t.xhrFields[a];t.mimeType&&r.overrideMimeType&&r.overrideMimeType(t.mimeType),
t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");for(a in o)r.setRequestHeader(a,o[a]);i=function(e){return function(){i&&(i=n=r.onload=r.onerror=r.onabort=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?s(0,"error"):s(r.status,r.statusText):s(qt[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=i(),n=r.onerror=i("error"),void 0!==r.onabort?r.onabort=n:r.onreadystatechange=function(){4===r.readyState&&e.setTimeout(function(){i&&n()})},i=i("abort");try{r.send(t.hasContent&&t.data||null)}catch(d){if(i)throw d}},abort:function(){i&&i()}}:void 0}),he.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),he.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){
return he.globalEval(e),e}}}),he.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),he.ajaxTransport("script",function(e){if(e.crossDomain){var t,i;return{send:function(n,o){t=he("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",i=function(e){t.remove(),i=null,e&&o("error"===e.type?404:200,e.type)}),Z.head.appendChild(t[0])},abort:function(){i&&i()}}}});var Ht=[],Wt=/(=)\?(?=&|$)|\?\?/;he.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Ht.pop()||he.expando+"_"+xt++;return this[e]=!0,e}}),he.ajaxPrefilter("json jsonp",function(t,i,n){var o,s,a,r=t.jsonp!==!1&&(Wt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Wt.test(t.data)&&"data");return r||"jsonp"===t.dataTypes[0]?(o=t.jsonpCallback=he.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,r?t[r]=t[r].replace(Wt,"$1"+o):t.jsonp!==!1&&(t.url+=(St.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){
return a||he.error(o+" was not called"),a[0]},t.dataTypes[0]="json",s=e[o],e[o]=function(){a=arguments},n.always(function(){void 0===s?he(e).removeProp(o):e[o]=s,t[o]&&(t.jsonpCallback=i.jsonpCallback,Ht.push(o)),a&&he.isFunction(s)&&s(a[0]),a=s=void 0}),"script"):void 0}),ce.createHTMLDocument=function(){var e=Z.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),he.parseHTML=function(e,t,i){if("string"!=typeof e)return[];"boolean"==typeof t&&(i=t,t=!1);var n,o,s;return t||(ce.createHTMLDocument?(t=Z.implementation.createHTMLDocument(""),n=t.createElement("base"),n.href=Z.location.href,t.head.appendChild(n)):t=Z),o=ye.exec(e),s=!i&&[],o?[t.createElement(o[1])]:(o=v([e],t,s),s&&s.length&&he(s).remove(),he.merge([],o.childNodes))},he.fn.load=function(e,t,i){var n,o,s,a=this,r=e.indexOf(" ");return r>-1&&(n=he.trim(e.slice(r)),e=e.slice(0,r)),he.isFunction(t)?(i=t,t=void 0):t&&"object"==typeof t&&(o="POST"),a.length>0&&he.ajax({
url:e,type:o||"GET",dataType:"html",data:t}).done(function(e){s=arguments,a.html(n?he("<div>").append(he.parseHTML(e)).find(n):e)}).always(i&&function(e,t){a.each(function(){i.apply(this,s||[e.responseText,t,e])})}),this},he.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){he.fn[t]=function(e){return this.on(t,e)}}),he.expr.pseudos.animated=function(e){return he.grep(he.timers,function(t){return e===t.elem}).length},he.offset={setOffset:function(e,t,i){var n,o,s,a,r,d,l,c=he.css(e,"position"),u=he(e),h={};"static"===c&&(e.style.position="relative"),r=u.offset(),s=he.css(e,"top"),d=he.css(e,"left"),l=("absolute"===c||"fixed"===c)&&(s+d).indexOf("auto")>-1,l?(n=u.position(),a=n.top,o=n.left):(a=parseFloat(s)||0,o=parseFloat(d)||0),he.isFunction(t)&&(t=t.call(e,i,he.extend({},r))),null!=t.top&&(h.top=t.top-r.top+a),null!=t.left&&(h.left=t.left-r.left+o),"using"in t?t.using.call(e,h):u.css(h)}},he.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){
he.offset.setOffset(this,e,t)});var t,i,n,o,s=this[0];if(s)return s.getClientRects().length?(n=s.getBoundingClientRect(),n.width||n.height?(o=s.ownerDocument,i=X(o),t=o.documentElement,{top:n.top+i.pageYOffset-t.clientTop,left:n.left+i.pageXOffset-t.clientLeft}):n):{top:0,left:0}},position:function(){if(this[0]){var e,t,i=this[0],n={top:0,left:0};return"fixed"===he.css(i,"position")?t=i.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),he.nodeName(e[0],"html")||(n=e.offset()),n={top:n.top+he.css(e[0],"borderTopWidth",!0),left:n.left+he.css(e[0],"borderLeftWidth",!0)}),{top:t.top-n.top-he.css(i,"marginTop",!0),left:t.left-n.left-he.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===he.css(e,"position");)e=e.offsetParent;return e||ze})}}),he.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var i="pageYOffset"===t;he.fn[e]=function(n){return Ae(this,function(e,n,o){var s=X(e);return void 0===o?s?s[t]:e[n]:void(s?s.scrollTo(i?s.pageXOffset:o,i?o:s.pageYOffset):e[n]=o);
},e,n,arguments.length)}}),he.each(["top","left"],function(e,t){he.cssHooks[t]=A(ce.pixelPosition,function(e,i){return i?(i=j(e,t),ot.test(i)?he(e).position()[t]+"px":i):void 0})}),he.each({Height:"height",Width:"width"},function(e,t){he.each({padding:"inner"+e,content:t,"":"outer"+e},function(i,n){he.fn[n]=function(o,s){var a=arguments.length&&(i||"boolean"!=typeof o),r=i||(o===!0||s===!0?"margin":"border");return Ae(this,function(t,i,o){var s;return he.isWindow(t)?0===n.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(s=t.documentElement,Math.max(t.body["scroll"+e],s["scroll"+e],t.body["offset"+e],s["offset"+e],s["client"+e])):void 0===o?he.css(t,i,r):he.style(t,i,o,r)},t,a?o:void 0,a)}})}),he.fn.extend({bind:function(e,t,i){return this.on(e,null,t,i)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,i,n){return this.on(t,e,i,n)},undelegate:function(e,t,i){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",i)}}),he.parseJSON=JSON.parse,
"function"==typeof define&&define.amd&&define("jquery",[],function(){return he});var Qt=e.jQuery,Vt=e.$;return he.noConflict=function(t){return e.$===he&&(e.$=Vt),t&&e.jQuery===he&&(e.jQuery=Qt),he},t||(e.jQuery=e.$=he),he})},"./third_party/json2.js":function(module,exports){"object"!=typeof JSON&&(window.JSON={}),function(){"use strict";function f(e){return 10>e?"0"+e:e}function this_value(){return this.valueOf()}function quote(e){return rx_escapable.lastIndex=0,rx_escapable.test(e)?'"'+e.replace(rx_escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var i,n,o,s,a,r=gap,d=t[e];switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(e)),"function"==typeof rep&&(d=rep.call(t,e,d)),typeof d){case"string":return quote(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(d)){
for(s=d.length,i=0;s>i;i+=1)a[i]=str(i,d)||"null";return o=0===a.length?"[]":gap?"[\n"+gap+a.join(",\n"+gap)+"\n"+r+"]":"["+a.join(",")+"]",gap=r,o}if(rep&&"object"==typeof rep)for(s=rep.length,i=0;s>i;i+=1)"string"==typeof rep[i]&&(n=rep[i],o=str(n,d),o&&a.push(quote(n)+(gap?": ":":")+o));else for(n in d)Object.prototype.hasOwnProperty.call(d,n)&&(o=str(n,d),o&&a.push(quote(n)+(gap?": ":":")+o));return o=0===a.length?"{}":gap?"{\n"+gap+a.join(",\n"+gap)+"\n"+r+"}":"{"+a.join(",")+"}",gap=r,o}}var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){
return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;"function"!=typeof JSON.stringify&&(meta={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(e,t,i){var n;if(gap="",indent="","number"==typeof i)for(n=0;i>n;n+=1)indent+=" ";else"string"==typeof i&&(indent=i);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(e,t){var i,n,o=e[t];if(o&&"object"==typeof o)for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n=walk(o,i),void 0!==n?o[i]=n:delete o[i]);return reviver.call(e,t,o)}var j;if(text=String(text),
rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},"./third_party/prettify.js":function(e,t){!function(){var e=null;window.PR_SHOULD_USE_CONTINUATION=!0,function(){function t(e){function t(e){var t=e.charCodeAt(0);if(92!==t)return t;var i=e.charAt(1);return(t=u[i])?t:i>="0"&&"7">=i?parseInt(e.substring(1),8):"u"===i||"x"===i?parseInt(e.substring(2),16):e.charCodeAt(1)}function i(e){return 32>e?(16>e?"\\x0":"\\x")+e.toString(16):(e=String.fromCharCode(e),"\\"===e||"-"===e||"]"===e||"^"===e?"\\"+e:e)}function n(e){var n=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],o="^"===n[0],s=["["];o&&s.push("^");for(var o=o?1:0,a=n.length;a>o;++o){
var r=n[o];if(/\\[bdsw]/i.test(r))s.push(r);else{var d,r=t(r);a>o+2&&"-"===n[o+1]?(d=t(n[o+2]),o+=2):d=r,e.push([r,d]),65>d||r>122||(65>d||r>90||e.push([32|Math.max(65,r),32|Math.min(d,90)]),97>d||r>122||e.push([-33&Math.max(97,r),-33&Math.min(d,122)]))}}for(e.sort(function(e,t){return e[0]-t[0]||t[1]-e[1]}),n=[],a=[],o=0;o<e.length;++o)r=e[o],r[0]<=a[1]+1?a[1]=Math.max(a[1],r[1]):n.push(a=r);for(o=0;o<n.length;++o)r=n[o],s.push(i(r[0])),r[1]>r[0]&&(r[1]+1>r[0]&&s.push("-"),s.push(i(r[1])));return s.push("]"),s.join("")}function o(e){for(var t=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),o=t.length,r=[],d=0,l=0;o>d;++d){var c=t[d];"("===c?++l:"\\"===c.charAt(0)&&(c=+c.substring(1))&&(l>=c?r[c]=-1:t[d]=i(c))}for(d=1;d<r.length;++d)-1===r[d]&&(r[d]=++s);for(l=d=0;o>d;++d)c=t[d],"("===c?(++l,r[l]||(t[d]="(?:")):"\\"===c.charAt(0)&&(c=+c.substring(1))&&l>=c&&(t[d]="\\"+r[c]);for(d=0;o>d;++d)"^"===t[d]&&"^"!==t[d+1]&&(t[d]="");
if(e.ignoreCase&&a)for(d=0;o>d;++d)c=t[d],e=c.charAt(0),c.length>=2&&"["===e?t[d]=n(c):"\\"!==e&&(t[d]=c.replace(/[A-Za-z]/g,function(e){return e=e.charCodeAt(0),"["+String.fromCharCode(-33&e,32|e)+"]"}));return t.join("")}for(var s=0,a=!1,r=!1,d=0,l=e.length;l>d;++d){var c=e[d];if(c.ignoreCase)r=!0;else if(/[a-z]/i.test(c.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){a=!0,r=!1;break}}for(var u={b:8,t:9,n:10,v:11,f:12,r:13},h=[],d=0,l=e.length;l>d;++d){if(c=e[d],c.global||c.multiline)throw Error(""+c);h.push("(?:"+o(c)+")")}return RegExp(h.join("|"),r?"gi":"g")}function i(e,t){function i(e){var d=e.nodeType;if(1==d){if(!n.test(e.className)){for(d=e.firstChild;d;d=d.nextSibling)i(d);d=e.nodeName.toLowerCase(),("br"===d||"li"===d)&&(o[r]="\n",a[r<<1]=s++,a[r++<<1|1]=e)}}else(3==d||4==d)&&(d=e.nodeValue,d.length&&(d=t?d.replace(/\r\n?/g,"\n"):d.replace(/[\t\n\r ]+/g," "),o[r]=d,a[r<<1]=s,s+=d.length,a[r++<<1|1]=e))}var n=/(?:^|\s)nocode(?:\s|$)/,o=[],s=0,a=[],r=0;return i(e),
{a:o.join("").replace(/\n$/,""),d:a}}function n(e,t,i,n){t&&(e={a:t,e:e},i(e),n.push.apply(n,e.g))}function o(e){for(var t=void 0,i=e.firstChild;i;i=i.nextSibling)var n=i.nodeType,t=1===n?t?e:i:3===n&&y.test(i.nodeValue)?e:t;return t===e?void 0:t}function s(i,o){function s(e){for(var t=e.e,i=[t,"pln"],c=0,u=e.a.match(a)||[],h={},p=0,f=u.length;f>p;++p){var _,m=u[p],g=h[m],v=void 0;if("string"==typeof g)_=!1;else{var w=r[m.charAt(0)];if(w)v=m.match(w[1]),g=w[0];else{for(_=0;d>_;++_)if(w=o[_],v=m.match(w[1])){g=w[0];break}v||(g="pln")}!(_=g.length>=5&&"lang-"===g.substring(0,5))||v&&"string"==typeof v[1]||(_=!1,g="src"),_||(h[m]=g)}if(w=c,c+=m.length,_){_=v[1];var b=m.indexOf(_),y=b+_.length;v[2]&&(y=m.length-v[2].length,b=y-_.length),g=g.substring(5),n(t+w,m.substring(0,b),s,i),n(t+w+b,_,l(g,_),i),n(t+w+y,m.substring(y),s,i)}else i.push(t+w,g)}e.g=i}var a,r={};!function(){for(var n=i.concat(o),s=[],d={},l=0,c=n.length;c>l;++l){var u=n[l],h=u[3];if(h)for(var p=h.length;--p>=0;)r[h.charAt(p)]=u;
u=u[1],h=""+u,d.hasOwnProperty(h)||(s.push(u),d[h]=e)}s.push(/[\S\s]/),a=t(s)}();var d=o.length;return s}function a(t){var i=[],n=[];t.tripleQuotedStrings?i.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,e,"'\""]):t.multiLineStrings?i.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,e,"'\"`"]):i.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,e,"\"'"]),t.verbatimStrings&&n.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,e]);var o=t.hashComments;if(o&&(t.cStyleComments?(o>1?i.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,e,"#"]):i.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,e,"#"]),n.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,e])):i.push(["com",/^#[^\n\r]*/,e,"#"])),t.cStyleComments&&(n.push(["com",/^\/\/[^\n\r]*/,e]),
n.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,e])),o=t.regexLiterals){var a=(o=o>1?"":"\n\r")?".":"[\\S\\s]";n.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+o+"])(?:[^/\\x5B\\x5C"+o+"]|\\x5C"+a+"|\\x5B(?:[^\\x5C\\x5D"+o+"]|\\x5C"+a+")*(?:\\x5D|$))+/")+")")])}return(o=t.types)&&n.push(["typ",o]),o=(""+t.keywords).replace(/^ | $/g,""),o.length&&n.push(["kwd",RegExp("^(?:"+o.replace(/[\s,]+/g,"|")+")\\b"),e]),i.push(["pln",/^\s+/,e," \r\n	 "]),o="^.[^\\s\\w.$@'\"`/\\\\]*",t.regexLiterals&&(o+="(?!s*/)"),n.push(["lit",/^@[$_a-z][\w$@]*/i,e],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,e],["pln",/^[$_a-z][\w$@]*/i,e],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,e,"0123456789"],["pln",/^\\[\S\s]?/,e],["pun",RegExp(o),e]),s(i,n)}function r(e,t,i){function n(e){var t=e.nodeType;
if(1!=t||s.test(e.className)){if((3==t||4==t)&&i){var d=e.nodeValue,l=d.match(a);l&&(t=d.substring(0,l.index),e.nodeValue=t,(d=d.substring(l.index+l[0].length))&&e.parentNode.insertBefore(r.createTextNode(d),e.nextSibling),o(e),t||e.parentNode.removeChild(e))}}else if("br"===e.nodeName)o(e),e.parentNode&&e.parentNode.removeChild(e);else for(e=e.firstChild;e;e=e.nextSibling)n(e)}function o(e){function t(e,i){var n=i?e.cloneNode(!1):e,o=e.parentNode;if(o){var o=t(o,1),s=e.nextSibling;o.appendChild(n);for(var a=s;a;a=s)s=a.nextSibling,o.appendChild(a)}return n}for(;!e.nextSibling;)if(e=e.parentNode,!e)return;for(var i,e=t(e.nextSibling,0);(i=e.parentNode)&&1===i.nodeType;)e=i;l.push(e)}for(var s=/(?:^|\s)nocode(?:\s|$)/,a=/\r\n?|\n/,r=e.ownerDocument,d=r.createElement("li");e.firstChild;)d.appendChild(e.firstChild);for(var l=[d],c=0;c<l.length;++c)n(l[c]);t===(0|t)&&l[0].setAttribute("value",t);var u=r.createElement("ol");u.className="linenums";for(var t=Math.max(0,t-1|0)||0,c=0,h=l.length;h>c;++c)d=l[c],
d.className="L"+(c+t)%10,d.firstChild||d.appendChild(r.createTextNode(" ")),u.appendChild(d);e.appendChild(u)}function d(e,t){for(var i=t.length;--i>=0;){var n=t[i];k.hasOwnProperty(n)?u.console&&console.warn("cannot override language handler %s",n):k[n]=e}}function l(e,t){return e&&k.hasOwnProperty(e)||(e=/^\s*</.test(t)?"default-markup":"default-code"),k[e]}function c(e){var t=e.h;try{var n=i(e.c,e.i),o=n.a;e.a=o,e.d=n.d,e.e=0,l(t,o)(e);var s=/\bMSIE\s(\d+)/.exec(navigator.userAgent),s=s&&+s[1]<=8,t=/\n/g,a=e.a,r=a.length,n=0,d=e.d,c=d.length,o=0,h=e.g,p=h.length,f=0;h[p]=r;var _,m;for(m=_=0;p>m;)h[m]!==h[m+2]?(h[_++]=h[m++],h[_++]=h[m++]):m+=2;for(p=_,m=_=0;p>m;){for(var g=h[m],v=h[m+1],w=m+2;p>=w+2&&h[w+1]===v;)w+=2;h[_++]=g,h[_++]=v,m=w}h.length=_;var b,y=e.c;y&&(b=y.style.display,y.style.display="none");try{for(;c>o;){var C,k=d[o+2]||r,x=h[f+2]||r,w=Math.min(k,x),S=d[o+1];if(1!==S.nodeType&&(C=a.substring(n,w))){s&&(C=C.replace(t,"\r")),S.nodeValue=C;var E=S.ownerDocument,T=E.createElement("span");
T.className=h[f+1];var $=S.parentNode;$.replaceChild(T,S),T.appendChild(S),k>n&&(d[o+1]=S=E.createTextNode(a.substring(w,k)),$.insertBefore(S,T.nextSibling))}n=w,n>=k&&(o+=2),n>=x&&(f+=2)}}finally{y&&(y.style.display=b)}}catch(L){u.console&&console.log(L&&L.stack||L)}}var u=window,h=["break,continue,do,else,for,if,return,while"],p=[[h,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],_=[p,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],m=[p,"abstract,as,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],p=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],g=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],v=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],w=[h,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],h=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],b=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,y=/\S/,C=a({
keywords:[f,m,p,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",g,v,h],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),k={};d(C,["default-code"]),d(s([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),d(s([["pln",/^\s+/,e," 	\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,e,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'\/>]|\/(?=\s)))/],["pun",/^[\/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]),
d(s([],[["atv",/^[\S\s]+/]]),["uq.val"]),d(a({keywords:f,hashComments:!0,cStyleComments:!0,types:b}),["c","cc","cpp","cxx","cyc","m"]),d(a({keywords:"null,true,false"}),["json"]),d(a({keywords:m,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:b}),["cs"]),d(a({keywords:_,cStyleComments:!0}),["java"]),d(a({keywords:h,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),d(a({keywords:g,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),d(a({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),d(a({keywords:v,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),d(a({keywords:p,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]),d(a({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",
hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),d(a({keywords:w,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]),d(s([],[["str",/^[\S\s]+/]]),["regex"]);var x=u.PR={createSimpleLexer:s,registerLangHandler:d,sourceDecorator:a,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:u.prettyPrintOne=function(e,t,i){var n=document.createElement("div");return n.innerHTML="<pre>"+e+"</pre>",n=n.firstChild,i&&r(n,i,!0),c({h:t,j:i,c:n,i:1}),n.innerHTML},prettyPrint:u.prettyPrint=function(t,i){function n(){for(var i=u.PR_SHOULD_USE_CONTINUATION?f.now()+250:1/0;m<d.length&&f.now()<i;m++){for(var s=d[m],l=k,h=s;h=h.previousSibling;){var p=h.nodeType,x=(7===p||8===p)&&h.nodeValue;if(x?!/^\??prettify\b/.test(x):3!==p||/\S/.test(h.nodeValue))break;
if(x){l={},x.replace(/\b(\w+)=([\w%+\-.:]+)/g,function(e,t,i){l[t]=i});break}}if(h=s.className,(l!==k||v.test(h))&&!w.test(h)){for(p=!1,x=s.parentNode;x;x=x.parentNode)if(C.test(x.tagName)&&x.className&&v.test(x.className)){p=!0;break}if(!p){if(s.className+=" prettyprinted",p=l.lang,!p){var S,p=h.match(g);!p&&(S=o(s))&&y.test(S.tagName)&&(p=S.className.match(g)),p&&(p=p[1])}if(b.test(s.tagName))x=1;else var x=s.currentStyle,E=a.defaultView,x=(x=x?x.whiteSpace:E&&E.getComputedStyle?E.getComputedStyle(s,e).getPropertyValue("white-space"):0)&&"pre"===x.substring(0,3);E=l.linenums,(E="true"===E||+E)||(E=(E=h.match(/\blinenums\b(?::(\d+))?/))?E[1]&&E[1].length?+E[1]:!0:!1),E&&r(s,E,x),_={h:p,c:s,j:E,i:x},c(_)}}}m<d.length?setTimeout(n,250):"function"==typeof t&&t()}for(var s=i||document.body,a=s.ownerDocument||document,s=[s.getElementsByTagName("pre"),s.getElementsByTagName("code"),s.getElementsByTagName("xmp")],d=[],l=0;l<s.length;++l)for(var h=0,p=s[l].length;p>h;++h)d.push(s[l][h]);var s=e,f=Date;
f.now||(f={now:function(){return+new Date}});var _,m=0,g=/\blang(?:uage)?-([\w.]+)(?!\S)/,v=/\bprettyprint\b/,w=/\bprettyprinted\b/,b=/pre|xmp/i,y=/^code$/i,C=/^(?:pre|code|xmp)$/i,k={};n()}};"function"==typeof define&&define.amd&&define("google-code-prettify",[],function(){return x})}()}()},"./third_party/smyte.js":function(e,t){var i=require("shared/onload");t.asyncInit=function(e,t,n){i.execAfterLoadDelayed(function(){!function(e,t,i,n,o){e._smyte=e._smyte||[],n=t.createElement(i),n.async=1,n.src="//ping.smyte.com/p.js",o=t.getElementsByTagName(i)[0],o.parentNode.insertBefore(n,o)}(window,document,"script"),_smyte.push(["_setClientKey",e]),_smyte.push(["_setSession",{id:t,actor:{id:n,type:"user"}}]),_smyte.push(["_log"])})}},"./third_party/timing.js":function(e,t){window.timing=window.timing||{getTimes:function(e){var t=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance;if(void 0===t)return!1;var i=t.timing,n={};if(e=e||{},i){if(e&&!e.simple)for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o]);
if(void 0===n.firstPaint){var s=0;window.chrome&&window.chrome.loadTimes?(s=1e3*window.chrome.loadTimes().firstPaintTime,n.firstPaintTime=s-1e3*window.chrome.loadTimes().startLoadTime):"number"==typeof window.performance.timing.msFirstPaint&&(s=window.performance.timing.msFirstPaint,n.firstPaintTime=s-window.performance.timing.navigationStart),e&&!e.simple&&(n.firstPaint=s)}n.loadTime=i.loadEventEnd-i.fetchStart,n.domReadyTime=i.domComplete-i.domInteractive,n.readyStart=i.fetchStart-i.navigationStart,n.redirectTime=i.redirectEnd-i.redirectStart,n.appcacheTime=i.domainLookupStart-i.fetchStart,n.unloadEventTime=i.unloadEventEnd-i.unloadEventStart,n.lookupDomainTime=i.domainLookupEnd-i.domainLookupStart,n.connectTime=i.connectEnd-i.connectStart,n.requestTime=i.responseEnd-i.requestStart,n.initDomTreeTime=i.domInteractive-i.responseEnd,n.loadEventTime=i.loadEventEnd-i.loadEventStart}return n},printTable:function(e){var t={},i=this.getTimes(e)||{};Object.keys(i).sort().forEach(function(e){t[e]={
ms:i[e],s:+(i[e]/1e3).toFixed(2)}}),console.table(t)},printSimpleTable:function(){this.printTable({simple:!0})}}},"./third_party/truncate.js":function(e,t){function i(e,t){if(e.innerText)e.innerText=t;else if(e.nodeValue)e.nodeValue=t;else{if(!e.textContent)return!1;e.textContent=t}}function n(e,t,n,s){var a,r=e.parent();e.remove();var d=n?n.length:0;if(r.contents().length>d)return a=r.contents().eq(-1-d),o(a,t,n,s);var l=r.prev();return a=l.contents().eq(-1),a.length?(i(a[0],a.text()+s.ellipsis),r.remove(),n.length&&l.append(n),!0):!1}function o(e,t,o,s){for(var a,d,l=e[0],c=e.text(),u="",h=0,p=c.length;p>=h;)a=h+(p-h>>1),d=r.trim(c.substr(0,a+1))+s.ellipsis,i(l,d),t.height()>s.maxHeight?p=a-1:(h=a+1,u=u.length>d.length?u:d);return u.length>0?(i(l,u),!0):n(e,t,o,s)}function s(e,t,i,n){var a,l,c=e[0],u=e.contents(),h=0,p=u.length,f=!1;for(e.empty();p>h&&!f;h++)a=u.eq(h),l=a[0],8!==l.nodeType&&(c.appendChild(l),i.length&&(r.inArray(c.tagName.toLowerCase(),d)>=0?e.after(i):e.append(i)),t.height()>n.maxHeight&&(f=3===l.nodeType?o(a,t,i,n):s(a,t,i,n)),
!f&&i.length&&i.remove());return f}function a(e,t){this.element=e,this.$element=r(e),this._name="truncate",this._defaults={lineHeight:parseInt(this.$element.css("line-height")),lines:1,ellipsis:"…",showMore:"",showLess:""},this.options=r.extend({},this._defaults,t),void 0===this.options.maxHeight&&(this.options.maxHeight=parseInt(this.options.lines,10)*parseInt(this.options.lineHeight,10)),this.$clipNode=r(r(this.options.showMore),this.$element),this.original=this.cached=e.innerHTML,this.isTruncated=!1,this.isCollapsed=!0,this.update()}var r=require("shared/jquery"),d=["table","thead","tbody","tfoot","tr","col","colgroup","object","embed","param","ol","ul","dl","blockquote","select","optgroup","option","textarea","script","style"];a.prototype={update:function(e){var t=!this.isCollapsed;e?this.original=this.element.innerHTML=e:this.isCollapsed&&this.element.innerHTML===this.cached&&(this.element.innerHTML=this.original);var i=this.$element.wrapInner("<div/>").children();i.css({border:"none",
margin:0,padding:0,width:"auto",height:"auto"}),this.isTruncated=!1,i.height()>this.options.maxHeight?this.isTruncated=s(i,i,this.$clipNode,this.options):this.isCollapsed=!1,i.replaceWith(i.contents()),this.cached=this.element.innerHTML,t&&(this.element.innerHTML=this.original)},expand:function(){this.isCollapsed&&(this.isCollapsed=!1,this.element.innerHTML=this.isTruncated?this.original+this.options.showLess:this.original)},collapse:function(e){this.isCollapsed||(this.isCollapsed=!0,e=e||!1,e?this.update():this.element.innerHTML=this.cached)}},t.Truncate=a},"./tooltip.js":function(e,t,i){var n=i("./shared/Class.js").Class,o=i("./shared/util.js"),s=i("./shared/jquery.js");t.attach=function(e,t,i){var n=new a(e,t,i);return n.bindHover()};var a=n.extend({__init__:function(e,t,i){this.$elem=s(e),this.text=t,this.options=o.extend({delay:75,direction:"top",align:"center",container_class:"document",vertical_offset:0,attach_to_body:!1},i)},updateText:function(e){return this.text=e,this},closeAll:function(){
return clearTimeout(this.timer),this.timer=null,this.$tooltip=null,s(".tooltip_parent").removeClass("tooltip_parent"),s(".tooltip").remove(),this},render:function(){this.closeAll(),this._renderTooltipElem(),this._positionTooltip();var e=this;return this.timer=setTimeout(function(){e.$tooltip.show()},this.options.delay),this},bindHover:function(){return this.$elem.on("mouseenter",this.render.bind(this)),this.$elem.on("mouseleave",this.closeAll.bind(this)),this},_shouldRenderTooltipBelow:function(){var e=this.$elem.offset(),t=50;if("document"==this.options.container_class)return e.top<t||"bottom"==this.options.direction;var i=s("."+this.options.container_class).offset();return e.top-i.top<t||"bottom"==this.options.direction},_renderTooltipElem:function(){var e=s("<span>").text(this.text),t=s("<div>").addClass("tooltip_contents"),i=s("<div>").addClass("tooltip");t.addClass(this._shouldRenderTooltipBelow()?"nub_top":"nub_bottom"),t.addClass("nub_"+this.options.align),t.append(e),i.append(t),
this.$tooltip=i},_positionTooltip:function(){this.$tooltip.appendTo(this.options.attach_to_body?s("body"):this.$elem),this.$elem.addClass("tooltip_parent"),this.$tooltip.css("display","block");var e=this.$tooltip.find(".tooltip_contents").outerWidth();this.$tooltip.css("display","none");var t=this.$tooltip.height()+5,i=this.$elem.offset(),n=this.$elem.height(),o=this.$elem.outerWidth(),a=this._shouldRenderTooltipBelow(),r=parseInt(this.$elem.css("line-height"),10),d=this.$elem.is("a")&&this.$elem.text()&&n-5>r;this.options.attach_to_body&&a?this.$tooltip.css("top",i.top+t+"px"):this.options.attach_to_body?this.$tooltip.css("top",i.top-t+"px"):a?this.$tooltip.css("top",n+5-this.options.vertical_offset+"px"):this.$tooltip.css("top",-1*t-this.options.vertical_offset+"px");var l=d?"right":this.options.align;if(this.options.attach_to_body)if("center"==l){var c=i.left+(o-e)/2;this.$tooltip.css("left",c+"px")}else"right"==l?this.$tooltip.css("left",i.left+o-e+"px"):this.$tooltip.css("left",i.left+"px");else"center"==l?this.$tooltip.css("left",(o-e)/2+"px"):"right"==l?this.$tooltip.css("right","0"):this.$tooltip.css("left","-16px");
}})},"./truncate.js":function(e,t,i){var n=i("./third_party/truncate.js").Truncate,o=i("./shared/errors.js");t.truncate=function(e,t){return e&&void 0!=e?new n(e,t):void o.logJsError("truncate","elem does not exist")}},"./unified_view/a2a.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.A2AHeader=n.extend({onLoad:function(){if(this.scroll_to_self){var e=this.$id("@header_other").prop("offsetTop");e&&window.scrollTo(0,e+80)}}})},"./unified_view/action_bar/_action_bar.js":function(e,t,i){var n=i("./unified_view/action_bar/base.js"),o=i("./shared/events/index.js"),s=i("./shared/util.js").firstScrollingParent,a=i("./shared/scroll_animation_handler.js"),r=i("./sticky.js");t.Question=n.ActionBarWeb.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.handleEvent(o.Types.QUESTION_EDITING_STATE,function(t){t.payload.qid==e.oid&&("edit"==t.payload.state?e.$actionBarElem.addClass("hidden"):"cancel"==t.payload.state?e.$actionBarElem.removeClass("hidden"):"request"==t.payload.state&&e.$actionBarElem.removeClass("hidden"));
})}}),t.Answer=n.ActionBarWeb.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.use_expanded_featured_comments&&e.maybeEnableSticky()},maybeEnableSticky:function(){var e=this;e.use_expanded_featured_comments?r.add({elem:this.$actionBarElem,container:this.$actionBarElem.parent().parent(),offsets:this.sticky_offsets}):e._super.apply(e,arguments)}}),t.AnswerInModal=t.Answer.extend({onLoad:function(){this._super.apply(this,arguments);var e=s(this.$actionBarElem.get(0));a.add(e,this.update.bind(this)),this.$actionBarElem.css("margin-bottom",0)},maybeEnableSticky:function(){if(this.is_sticky){var e=this.actionBarContext.get("commentsElem"),t=this.actionBarContext.get("showComments");e&&!t||this.use_expanded_featured_comments?(this.stickyEnabled=!0,this.update()):(this.stickyEnabled=!1,this.$actionBarElem.css("position","static"),this.$actionBarElem.removeClass("sticky"))}},updateSticky:function(){if(this.is_sticky){this.maybeEnableSticky();var e=this.$actionBarElem.parent(),t=e.offset().top,i=window.scrollY+window.innerHeight;
if(t>i){var n=this.$modalOverlay.scrollTop(),o=t-window.scrollY,s=n+o,a=Math.min(500,Math.abs(s-.5*n));this.$modalOverlay.animate({scrollTop:s},a)}}},update:function(){if(this.stickyEnabled){var e=this.$actionBarElem.parent(),t=this.$actionBarElem.outerHeight(!0),i=e.offset().top+t,n=window.scrollY+window.innerHeight;i>=n?(this.$actionBarElem.css("position","fixed"),this.$actionBarElem.addClass("sticky")):(this.$actionBarElem.css("position","static"),this.$actionBarElem.removeClass("sticky"))}}}),t.Comment=n.ActionBarWeb.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.handleEvent(o.Types.COMMENT_REPLY_FOCUS,function(t){t.payload.comment_id==e.oid[1]&&t.payload.comment_type==e.oid[0]&&e.$id("@overflow_link").toggleClass("hidden")})}})},"./unified_view/action_bar/answer.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.AskQuestionPromptExtraItem=n.extend({onLoad:function(){var e=this;this.handleEvent(o.Types.ANSWER_VOTE_STATE,function(t){
t.payload.aid==e.aid&&(null==t.payload.state?e.$id("@wrapper").addClass("hidden"):"upvoted"==t.payload.state&&e.$id("@wrapper").removeClass("hidden"))})}})},"./unified_view/action_bar/base.js":function(e,t,i){var n,o,s=i("./shared/core/component.js").Component,a=i("./shared/w2.context.js"),r=i("./shared/perf.js"),d=i("./unified_view/util.js"),l=i("./view/hover_menu.js"),c=i("./sticky.js"),u=i("./shared/window_manager.js");t.ActionBarWeb=s.extend({contextConstructor:function(){return a.ActionBar},onLoad:function(){this.overflowMenuShown=!1,this.overflowMenuMovedToBody=!1,this.overflowMenuLoaded=!this.lazy_loaded,this.$overflowLinkElem=this.$id("@overflow_link"),this.$overflowMenuElem=this.$id("@overflow_menu"),this.$actionBarElem=this.$id("@action_bar"),this.$overflowMenuContentsElem=this.$id("@overflow_menu_contents"),this.actionBarContext=this.getContext(a.ActionBar),this.overflowMenu=new l.ToggleableMenu({$linkElem:this.$overflowLinkElem,$menuElem:this.$overflowMenuElem,loadFunction:this.loadOverflowMenu.bind(this),
alignment:"right",clickOpen:!0,shouldAttachToBody:!1}),this.is_sticky&&(this.actionBarContext.on("commentsElem",this.maybeEnableSticky.bind(this)),this.actionBarContext.on("updateSticky",this.updateSticky.bind(this))),this.userPerceivedAction=null},loadOverflowMenu:function(){var e=this;this.overflowMenuLoaded||(this.userPerceivedAction=r.startUserPerceived({vcon:this.__vcon,method:"load_menu"}),this.overflowMenuLoaded=!0,this.serverCall("load_menu").disableDefaultUserPerceivedLogging().contentFor(this.$overflowMenuContentsElem.get(0)).success(function(){e.overflowMenu.shown===!0&&e.userPerceivedAction&&(r.finishAction(e.userPerceivedAction),e.userPerceivedAction=null)}).send())},maybeEnableSticky:function(){if(this.is_sticky){var e=this.actionBarContext.get("commentsElem"),t=this.actionBarContext.get("showComments");e&&!t?c.add({elem:this.$actionBarElem,container:this.$actionBarElem.parent().parent(),offsets:this.sticky_offsets}):c.remove(this.$actionBarElem)}},updateSticky:function(){
this.is_sticky&&(this.maybeEnableSticky(),u.scrollIntoView(this.$actionBarElem))}}),t.ActionBarMobile=s.extend({contextConstructor:function(){return a.ActionBar},onLoad:function(){this.overflowMenuLoaded=!this.lazy_loaded,this.overflowMenuLoading=!1,this.overflowMenuShown=!1,this.overflowMenuShownPending=!1,this.$overflowMenuContentsElem=this.$id("@overflow_menu_contents"),this.$overflowLinkElem=this.$id("@overflow_link"),this.$overflowLinkElem.on("click",this.showMenu.bind(this)),this.lazy_loaded&&this.loadOverflowMenu(),this.userPerceivedAction=null},loadOverflowMenu:function(){this.overflowMenuLoading||this.overflowMenuLoaded||this.$overflowMenuContentsElem.get(0)&&(this.overflowMenuLoading=!0,this.serverCall("load_menu").disableDefaultUserPerceivedLogging().contentFor(this.$overflowMenuContentsElem.get(0)).success(this.maybeShowMenu.bind(this)).send({batched:!0}))},enterLoadingState:function(){o.send("showLoadingView")},exitLoadingState:function(){o.send("hideLoadingView")},maybeShowMenu:function(){
this.overflowMenuLoaded=!0,this.overflowMenuLoading=!1,this.overflowMenuShownPending&&(this.overflowMenuShownPending=!1,this.exitLoadingState(),this.showMenu())},showMenu:function(){if(this.userPerceivedAction||(this.userPerceivedAction=r.startUserPerceived({vcon:this.__vcon,method:"load_menu"})),!this.overflowMenuLoaded)return this.overflowMenuShownPending=!0,this.enterLoadingState(),void this.loadOverflowMenu();if(!this.overflowMenuShown){this.overflowMenuShown=!0;for(var e=[],t=-1,i=this.getActionSheetItemsData(),s=0;s<i.length;s++){var a=i[s];e[a.index]=a.label,a.is_destructive&&(t=a.index)}n.supportsDestructiveActionSheetButtons()||(t=-1);var l={title:this.title,buttonTitles:e,destructiveButtonIndex:t,position:d.positionForElement(this.$overflowLinkElem.get(0))};o.send("showActionSheet",l,function(e){this.overflowMenuShown=!1;var t=parseInt(e.buttonIndex,10);0>t||setTimeout(this.selectOverflowItem.bind(this,t),100)}.bind(this)),this.userPerceivedAction&&(r.finishAction(this.userPerceivedAction),
this.userPerceivedAction=null)}},getActionSheetItemsData:function(){for(var e=this.children(),t=[],i=0;i<e.length;i++){var n=e[i];n.getActionSheetItemData&&t.push(n.getActionSheetItemData()),n.getActionSheetItemsData&&Array.prototype.push.apply(t,n.getActionSheetItemsData())}return t},selectOverflowItem:function(e){for(var t=this.children(),i=0;i<t.length;i++){var n=t[i];if(n.getActionSheetItemData){var o=n.getActionSheetItemData();if(o.index==e)return n.selectItem()}else if(n.selectOverflowItem)return n.selectOverflowItem(e)}}})},"./unified_view/action_bar/blog.js":function(e,t,i){var n,o=i("./shared/core/component.js").Component;t.AddPostActionItem=o.extend({onLoad:function(){this.$id(this.link_id).on("click",this.handleClick.bind(this))},handleClick:function(e){e.preventDefault(),this.createModal("load_editor_modal").kwargs({bid:this.bid}).onSubmit(function(){n.send("reload")}).show()}})},"./unified_view/action_bar/comment.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");
t.CommentItemComponent=n.extend({onLoad:function(){var e=this;this.handleEvent(o.Types.COMMENT_REPLY_FOCUS,function(t){t.payload.comment_id==e.comment_id&&t.payload.comment_type==e.comment_type&&e.$id("@wrapper").toggleClass("hidden")})}})},"./unified_view/action_bar/overflow_menu/ad.js":function(e,t,i){var n=i("./unified_view/modal.js").ModalBase,o=(i("./shared/jquery.js"),i("./unified_view/action_bar/overflow_menu/base.js")),s=i("./shared/events/index.js"),a=s.scope;t.HideAd=o.Item.extend({onSelectAction:function(){this.emitEvent({type:s.Types.AD_REPORTED,payload:{adId:this.adId},scope:a.GLOBAL}),this.serverCall("submit_feedback").kwargs({ad_id:this.adId,report_reason:"",impression_hash:this.impressionHash}).send(),this.createModal("load_feedback_modal").kwargs({ad_id:this.adId,impression_hash:this.impressionHash}).show()}}),t.AdFeedbackModal=n.extend({onLoad:function(){this._super();var e=this;this.reason="",this.$id("@feedback_list").on("change","input[type=radio]",function(){e.reason=this.value,
e.$id("@submit").removeClass("disabled")})},submitFeedback:function(){var e=this;this.serverCall("submit_feedback").kwargs({ad_id:e.adId,report_reason:e.reason,impression_hash:e.impressionHash}).send(),e.close()},onSubmit:function(){this.submitFeedback()}})},"./unified_view/action_bar/overflow_menu/answer.js":function(e,t,i){var n=i("./shared/events/index.js"),o=i("./unified_view/action_bar/overflow_menu/base.js");t.ChooseCredential=o.WithServerCall.extend({onSelectAction:function(){this.createModal("selected").kwargs({aid:this.aid}).show()}}),t.Downvote=o.Toggleable.extend({onToggledOn:function(){this.emitEvent(n.helpers.addAnswerDownvote(this.aid)),this._super.apply(this,arguments)},onToggledOff:function(){this.emitEvent(n.helpers.removeAnswerDownvote(this.aid)),this._super.apply(this,arguments)}})},"./unified_view/action_bar/overflow_menu/base.js":function(e,t,i){var n,o=i("./shared/core/component.js").Component,s=i("./shared/client_tracker.js"),a=i("./shared/cookies.js");t.Item=o.extend({
onLoad:function(){this.desktopOnLoad()},desktopOnLoad:function(){this.$id("@overflow_menu_item").on("click",this.selectItem.bind(this))},selectItem:function(){return this.qfeed_log_action&&(a.setQfeedLog(this,this.qfeed_log_action),s.track(this.qfeed_log_action,null,this)),this.onSelectAction(),this.close_on_click},onSelectAction:function(){},getActionSheetItemData:function(){return{index:this.index,label:this.label,is_destructive:this.is_destructive}}}),t.WithServerCall=t.Item.extend({onSelectAction:function(){var e=this;e.serverCall("selected").success(function(e){e.url&&(document.location=e.url)}).send()},onSuccessMobile:function(e){e&&e.url&&n.send("openURL",{url:e.url})}}),t.WithLink=t.Item.extend({desktopOnLoad:function(){var e=this;this.$id("@overflow_menu_item").on("click",function(t){e.onSelectAction(t)})},onSelectAction:function(){document.location=this.url}}),t.WithModal=t.WithLink.extend({onSelectAction:function(e){e.preventDefault(),this.createModal("load_modal").show()}}),
t.Toggleable=t.Item.extend({onToggledOff:function(){if(!this.one_way){if(this.qfeed_log_action_on_disable&&a.setQfeedLog(this,this.qfeed_log_action_on_disable),this.tlog_action_context&&this.tlog_action_on_disable){var e={type:this.tlog_action_on_disable};e[this.tlog_action_context]=this.oid,a.setTlog(e)}this.with_server_call&&this.makeServerCall("on_toggled_off")}},onToggledOn:function(){if(this.qfeed_log_action_on_enable&&a.setQfeedLog(this,this.qfeed_log_action_on_enable),this.tlog_action_context&&this.tlog_action_on_enable){var e={type:this.tlog_action_on_enable};e[this.tlog_action_context]=this.oid,a.setTlog(e)}this.with_server_call&&this.makeServerCall("on_toggled_on")},makeServerCall:function(e){var t=this;t.serverCall(e).liveMutate().success(function(){}).send()},onSelectAction:function(){this.is_on?this.onToggledOff():this.onToggledOn()}}),t.ToggleableWithConfirmation=t.Toggleable.extend({onToggledOn:function(){var e=this,t=e._super,i=function(){t.apply(e)};this.should_show_on_toggled_on?this.createModal("load_modal").onSubmit(i).kwargs(this.modal_kwargs).show():i();
},onToggledOff:function(){var e=this,t=e._super,i=function(){t.apply(e)};this.should_show_on_toggled_off?this.createModal("load_modal").onSubmit(i).kwargs(this.modal_kwargs).show():i()}})},"./unified_view/action_bar/overflow_menu/blog.js":function(e,t,i){var n=i("./unified_view/action_bar/overflow_menu/base.js"),o=i("./shared/events/index.js");t.MuteBlog=n.Toggleable.extend({onToggledOn:function(){this._super(),this.story_oid&&this.emitEvent({type:o.Types.FEED_NEGATIVE_FEEDBACK_STATE,payload:{oid:this.story_oid,message:this.message,state:"show_message"}})}})},"./unified_view/action_bar/overflow_menu/comment.js":function(e,t,i){var n,o=i("./unified_view/action_bar/overflow_menu/base.js");t.CopyLink=o.WithServerCall.extend({onSelectAction:function(){n.send("shareCopyURL",{url:this.share_url}),this._super.apply(this,arguments)}})},"./unified_view/action_bar/overflow_menu/profile.js":function(e,t,i){var n,o,s=i("./unified_view/action_bar/overflow_menu/base.js"),a=i("./shared/browser.js"),r=i("./unified_view/modal.js").ModalBase,d=i("./settings-webpack.js").interface_strings,l=i("./shared/events/index.js");
t.BlockUser=s.Toggleable.extend({onToggledOff:function(){this.createModal("load_unblock_modal").kwargs({target_uid:this.target_uid}).show()},onToggledOn:function(){this.createModal("load_block_modal").kwargs({target_uid:this.target_uid}).show()}}),t.BlockUserModal=r.extend({onSubmit:function(){var e=this;this.serverCall("add_block").liveMutate().success(function(){e.close()}).send()}}),t.UnblockUserModal=r.extend({onSubmit:function(){var e=this;this.serverCall("remove_block").liveMutate().success(function(){e.close()}).send()}}),t.Logout=s.Item.extend({onSelectAction:function(){var e=this;a.ios&&a.chrome?e.logout():o.showAlert({title:e.dialog_title,message:e.dialog_message,callback:function(t){0===t.buttonIndex&&e.logout()},cancelButtonTitle:e.dialog_title,otherButtonTitles:[d.cancel]})},logout:function(){var e=this;this.serverCall("logout").success(function(){n.send("disableAutoSignIn"),n.send("loginStateChanged",{isLoggedIn:!1})}).error(function(){o.showAlert({title:e.dialog_title,message:e.dialog_error_message,
cancelButtonTitle:d.ok})}).send()}}),t.SendMessage=s.Item.extend({onSelectAction:function(){this.createModal("load_message_modal").kwargs({target_uid:this.target_uid}).show()}}),t.UserFollow=s.Toggleable.extend({onToggledOff:function(){this._super(),this.story_oid&&this.emitEvent({type:l.Types.FEED_NEGATIVE_FEEDBACK_STATE,payload:{oid:this.story_oid,message:this.message,state:"show_message"}})}}),t.MuteUser=s.ToggleableWithConfirmation.extend({onToggledOn:function(){this._super(),this.story_oid&&this.emitEvent({type:l.Types.FEED_NEGATIVE_FEEDBACK_STATE,payload:{oid:this.story_oid,message:this.message,state:"show_message"}})}})},"./unified_view/action_bar/overflow_menu/question.js":function(e,t,i){var n,o,s=i("./unified_view/action_bar/overflow_menu/base.js"),a=i("./shared/events/index.js"),r=i("./unified_view/privacy.js"),d=i("./shared/toast.js"),l=i("./shared/client.js");t.PrivacyToggle=s.Toggleable.extend(r.ToggleQuestionPrivacyJSMixin).extend({onToggledOn:function(){this.trySetPrivacy();
},onToggledOff:function(){this.trySetPrivacy()}}),t.AddAnonAnswer=s.WithServerCall.extend({onSuccessMobile:function(e){e.url&&o.showFromUrl(e.url)}}),t.Downvote=s.Toggleable.extend({onToggledOn:function(){this.emitEvent(a.helpers.addQuestionDownvote(this.qid)),this._super.apply(this,arguments)}}),t.EditMenu=s.Item.extend({onSelectAction:function(){this.child("menu").showMenu()}}),t.ToggleEditQuestionItem=s.Item.extend({onSelectAction:function(){this.emitEvent({type:a.Types.QUESTION_EDITING_STATE,payload:{qid:this.qid,state:"edit"}})}}),t.DisclaimerQuestion=s.Toggleable.extend({onToggledOn:function(){this.emitEvent(a.helpers.inlineEditorDisclaimer("answer",this.qid))}}),t.CantAnswer=s.Toggleable.extend({onToggledOn:function(){this._super.apply(this,arguments),this.emitEvent(a.helpers.addQuestionCantAnswer(this.qid))}}),t.ModalEditQuestionItem=s.WithServerCall.extend({onSelectAction:function(){this.createModal("load_modal").kwargs({qid:this.qid}).show()}}),t.WithModalMerge=s.WithModal.extend({
onSelectAction:function(e){l.isNativeApp()&&n.registerOneTimeMessageHandler("dismissQuestionMerge",function(e){e.text&&(e.is_error?d.showError(e.text):d.show(e.text))}),this._super.apply(this,arguments)}})},"./unified_view/action_bar/overflow_menu/shared.js":function(e,t,i){var n,o,s,a=i("./shared/events/index.js"),r=i("./unified_view/action_bar/overflow_menu/base.js"),d=i("./shared/toast.js");t.AddModerationFlagWrapper=r.Item.extend({desktopOnLoad:function(){},onSelectAction:function(){this.one_click_report?this.serverCall("one_click_report").liveMutate().send():s.send("openURL",{target:"modal",url:this.url})}}),t.NativeShare=r.Item.extend({onSelectAction:function(){var e=this,t=function(t,i){switch(i){case 0:s.send("openURL",t.quora_message_data);break;case 1:s.send("shareCopyURL",t.copy_data),e.serverCall("share_log_copy_link").kwargs({data:t}).send();break;case 2:s.send("openURL",t.share_to_blog_data)}},i=o.isAndroidApp()?t:function(){};n.showNativeShareSheet(this.share_data,i)}});var l=t.EditItemMobile=r.Item.extend({
onSelectAction:function(){var e=this;e.createModal("load_editor_modal").kwargs({oid:e.oid}).onSubmit(e.onSubmit.bind(e)).show()},onSubmit:function(e){e.next_url&&s.send("openURL",{url:e.next_url})}});t.EditAnswerWikiItemMobile=l.extend({onSubmit:function(e){e.pmsg&&(e.is_success?d.show(e.pmsg):d.showError(e.pmsg))}}),t.EditItemWeb=r.Item.extend({onLoad:function(){this._super(),this.$labelElem=this.$id("@contents"),this.bindEditorEvents()},bindEditorEvents:function(){var e=this;this.handleEvent(a.Types.INLINE_EDITOR_STATE,function(t){t.payload.contentType==e.content_type&&t.payload.oid==e.oid&&("cancel"==t.payload.state?e.setToggled(!1):"submit"==t.payload.state?e.setToggled(!1):"submitted"==t.payload.state?e.setToggled(!1):"edit"==t.payload.state&&e.setToggled(!0))})},onSelectAction:function(){this.toggled?this.emitEvent(a.helpers.inlineEditorCancel(this.content_type,this.oid)):this.emitEvent(a.helpers.inlineEditorEdit(this.content_type,this.oid))},setToggled:function(e){this.toggled=e,
this.updateLabel()},toggle:function(){this.setToggled(!this.toggled)},updateLabel:function(){var e=this.toggled?this.alternate_label:this.label;this.$labelElem.text(e)}}),t.SuggestionsPendingItemWeb=t.EditItemWeb.extend({bindEditorEvents:function(){var e=this;this.handleEvent(a.Types.INLINE_EDITOR_STATE,function(t){t.payload.contentType==e.content_type&&t.payload.oid==e.oid&&("submit"==t.payload.state?e.toggle():"toggle"==t.payload.state?e.toggle():"cancel"==t.payload.state?e.setToggled(!1):"edit"==t.payload.state&&e.setToggled(!0))})},onSelectAction:function(){this.emitEvent(a.helpers.inlineEditorToggle(this.content_type,this.oid))}}),t.AddComment=r.Item.extend({onSelectAction:function(){this.createModal("load_editor_modal").kwargs({oid:this.oid,comment_type:this.comment_type}).onSubmit(function(e){e.next_url&&s.send("openURL",{url:e.next_url})}).show()}}),t.ToggleReadingListItem=r.Toggleable.extend({onToggledOn:function(){this._super.apply(this,arguments),this.maybeReloadBookmarksPage();
},onToggledOff:function(){this._super.apply(this,arguments),this.maybeReloadBookmarksPage()},maybeReloadBookmarksPage:function(){},isBookmarksPage:function(){return window.location.href&&window.location.href.endsWith("/pinned_topics")}})},"./unified_view/action_bar/overflow_menu/topic.js":function(e,t,i){var n=i("./unified_view/action_bar/overflow_menu/base.js"),o=i("./shared/events/index.js");t.TopicFollow=n.Toggleable.extend({onToggledOff:function(){this._super(),this.story_oid&&this.emitEvent({type:o.Types.FEED_NEGATIVE_FEEDBACK_STATE,payload:{oid:this.story_oid,message:this.message,state:"show_message"}})}}),t.MuteTopic=n.Toggleable.extend({onToggledOn:function(){this._super(),this.story_oid&&this.emitEvent({type:o.Types.FEED_NEGATIVE_FEEDBACK_STATE,payload:{oid:this.story_oid,message:this.message,state:"show_message"}})}})},"./unified_view/action_bar/question.js":function(e,t,i){var n,o,s,a=i("./shared/core/component.js").Component,r=i("./shared/events/index.js"),d=i("./shared/cookies.js"),l=i("./shared/action_log.js"),c=i("./shared/client.js"),u=i("./shared/qtext.js"),h=i("./settings-webpack.js"),p=i("./unified_view/modal.js").ModalBase;
t.AddAnswerEditorWrapper=a.extend({__init__:function(){this._super.apply(this,arguments),this.editor_inlined&&this.setDvar("prefetchedContentRootCid",this.cid)},onLoad:function(){var e=this;e.editorLoaded=!e.lazy_loaded,e.$editorWrapper=e.$id("@add_answer_editor_wrapper"),e.handleEvent(r.Types.ANSWER_TOGGLE_EDITOR,function(t){t.payload.bundle==e.getDvar("__writeMultiFeedBundle")&&t.payload.qid==e.qid&&e.toggleEditor()}),e.editor_inlined&&u.ignoreNode(e.$id("@editor"))},toggleEditor:function(){this.editorLoaded?this.$editorWrapper.hasClass("hidden")?this.$editorWrapper.removeClass("hidden"):this.$editorWrapper.addClass("hidden"):this.loadEditor()},loadEditor:function(){this.loadEditorDesktop()},loadEditorMobile:function(){var e=this;e.trackQuestionState();var t;if(e.editor_inlined){u.unIgnoreNode(e.$id("@editor"));var i=e.$id("@editor").get(0).childNodes[0],a=n.modalUrl(e.vcon(),"load_editor_modal",{qid:e.qid},e),r=c.isIOSApp()&&o.buildNumber>=700,p=h.shouldUseMobileActionView&&!r;t=this.createModal(),
t.fromElement(i,{url:a,useActionView:p,target:"modal",options:n.editorParams()})}else t=this.createModal("load_editor_modal"),t.kwargs({qid:e.qid});t.onSubmit(function(t){d.setTlog({type:"AddAnswer"}),d.setQfeedLog(e,"AddAnswer"),l.logPrimaryAction("MobileEditorAddAnswer",e.getDvar("impression_target")),l.logSecondaryAction("MobileEditorAddAnswer",null),s.send("openURL",{url:t.next_url})}).show(),e.editor_inlined&&u.ignoreNode(e.$id("@editor"))},loadEditorDesktop:function(){var e=this;e.$editorWrapper.removeClass("hidden"),e.serverCall("load_add_answer_editor").contentFor(e.$editorWrapper.get(0)).success(function(){e.editorLoaded=!0}).send()},trackQuestionState:function(){this.serverCall("track_question_state").kwargs({qid:this.qid}).send()}}),t.EditQuestionModal=p.extend({onSubmit:function(){var e=this;e.serverCall("submit").kwargs({qid:e.qid,title:e.child("title").serialize(),source:e.child("sources").toJSON()}).success(function(t){t&&e.close()}).liveMutate().send()}})},"./unified_view/action_bar/shared.js":function(e,t,i){
var n=i("./shared/core/component.js").Component,o=i("./shared/w2.context.js");t.CommentsActionItem=n.extend({onLoad:function(){this.actionBarContext=this.getContext(o.ActionBar),this.$linkElem=this.$id(this.link_id),this.$linkElem.on("mouseenter",this.loadComments.bind(this)),this.$linkElem.on("click",this.toggleComments.bind(this))},loadComments:function(){this.actionBarContext.set("loadComments",!0)},toggleComments:function(e){e.preventDefault();var t=this.actionBarContext.get("showComments");this.actionBarContext.set("showComments",!t)}}),t.CommentsExtraItem=n.extend({onLoad:function(){this.actionBarContext=this.getContext(o.ActionBar),this.$defaultCommentsElem=this.$id(this.wrapper_id),this.$feedCommentElem=this.$id(this.feed_comment_wrapper_id),this.feed_comment_id&&this.$feedCommentElem?this.$currentWrapperElem=this.$feedCommentElem:this.$currentWrapperElem=this.$defaultCommentsElem,this.fetched=!1,this.isFirstToggle=!0,this.actionBarContext.set("commentsElem",this.$currentWrapperElem),
this.actionBarContext.on("loadComments",this.loadComments.bind(this)),this.actionBarContext.on("showComments",this.toggleComments.bind(this))},loadComments:function(){this.fetched||(this.fetched=!0,this.feed_comment_id&&this.actionBarContext.get("feedCommentExpanded")||this.fetchComments())},fetchComments:function(){this.serverCall("fetch_comments").contentFor(this.$defaultCommentsElem.get(0),{parentCid:this.parent().cid}).send()},toggleComments:function(e,t){if(this.isFirstToggle&&this.feed_comment_id)if(this.isFirstToggle=!1,this.actionBarContext.get("feedCommentExpanded")){if(!this.actionBarContext.get("feedCommentsPaged")){var i=this.actionBarContext.get("pageFeedCommentsLink");if(i)return this.actionBarContext.set("feedCommentsPaged",!0),void i.click()}}else this.$currentWrapperElem=this.$defaultCommentsElem,this.actionBarContext.set("commentsElem",this.$defaultCommentsElem),this.$id("@feed_comment_container").toggleClass("hidden",!0);this.$currentWrapperElem.toggleClass("hidden",!t),
this.actionBarContext.set("updateSticky",!0)}})},"./unified_view/action_bar/user.js":function(e,t,i){var n,o=i("./shared/core/component.js").Component;t.SendMessageActionItem=o.extend({onLoad:function(){var e=this;e.$id("@message_link").on("click",function(t){t.preventDefault(),e.createModal("load_editor_modal").kwargs({to_uid:e.to_uid}).onSubmit(function(e){e.next_url&&n.send("openURL",{url:e.next_url})}).show()})}})},"./unified_view/activation.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.FollowPrompt=n.extend({onLoad:function(){var e=this;e.$question_follow=e.$id("@question_follow"),e.$prompt=e.$id("@prompt"),e.$question_follow.click(function(){e.$prompt.hasClass("fixed_prompt")&&setTimeout(function(){e.$prompt.addClass("slideOutDown")},500)})}}),t.PromptFromSearch=n.extend({onLoad:function(){var e=this;e.$prompt=e.$id("@prompt"),e.$dismiss=e.$id("@dismiss_button"),e.$dismiss.click(function(){e.$prompt.hasClass("inline_prompt")?(e.$prompt.addClass("fadeOut"),setTimeout(function(){
e.$prompt.addClass("hidden")},500)):(e.$prompt.removeClass("showBottomBanner"),e.$prompt.addClass("slideOutDown"))})}}),t.MobileQuestionPageCard=n.extend({onLoad:function(){var e=this;e.$prompt=e.$id("@prompt"),e.$background=e.$id("@background"),e.$dismiss=e.$id("@dismiss_button"),setTimeout(function(){e.$prompt.removeClass("hidden"),e.$prompt.addClass("showBottomBanner"),e.$background.removeClass("hidden"),e.$background.addClass("fadeIn")},7e3),e.$dismiss.click(function(){e.$background.removeClass("fadeIn"),e.$background.addClass("fadeOut"),e.$prompt.removeClass("showBottomBanner"),e.$prompt.addClass("slideOutDown")})}});var o=t.SurveyPrompt=n.extend({onLoad:function(){var e=this;e.$positive_action=e.$id("@positive_action"),e.$negative_action=e.$id("@negative_action"),e.$prompt=e.$id("@prompt"),e.$completed_prompt=e.$id("@completed_prompt"),e.$prompt_content=e.$id("@prompt_content"),e.$prompt_action=e.$id("@prompt_action"),e.$dismiss=e.$id("@dismiss_button"),null!=e.variant&&(e.$prompt.hasClass("hidden")||e.logImpression(e.qid,e.page_context,e.variant),
e.$prompt.hasClass("hidden")&&setTimeout(function(){e.$prompt.removeClass("hidden"),e.$prompt.addClass("showBottomBanner"),e.logImpression(e.qid,e.page_context,e.variant)},1e4),e.$dismiss.click(function(){e.dismissModule()}),e.$positive_action.click(function(){e.actionResponse(!0,e.qid,e.page_context,e.variant),e.clickedButton()}),e.$negative_action.click(function(){e.actionResponse(!1,e.qid,e.page_context,e.variant),e.clickedButton()}))},clickedButton:function(){var e=this;e.$prompt.hasClass("inline_prompt")&&(e.$prompt.addClass("fadeOut"),setTimeout(function(){e.$prompt.addClass("hidden"),e.$completed_prompt.removeClass("hidden"),e.$completed_prompt.addClass("fadeIn")},500),setTimeout(function(){e.$completed_prompt.removeClass("fadeIn")},1e3)),e.$prompt.hasClass("fixed_prompt")&&(e.$prompt_content.addClass("fadeOut"),e.$prompt_action.addClass("fadeOut"),e.$completed_prompt.addClass("fadeIn"),e.$completed_prompt.removeClass("hidden"),e.$dismiss.addClass("hidden"),e.$completed_prompt.addClass("slideOutDown"),
setTimeout(function(){e.$completed_prompt.removeClass("fadeIn"),e.$prompt.removeClass("showBottomBanner"),e.$completed_prompt.addClass("slideOutDown"),e.$prompt.addClass("slideOutDown")},1e3))},dismissModule:function(){var e=this;e.$prompt.hasClass("inline_prompt")?(e.$prompt.addClass("fadeOut"),setTimeout(function(){e.$prompt.addClass("hidden")},500)):(e.$prompt.removeClass("showBottomBanner"),e.$prompt.addClass("slideOutDown"))},logImpression:function(e,t,i){this.serverCall("log_impression_after_shown").success(function(){}).kwargs({qid:e,page_context:t,variant:i}).send()},actionResponse:function(e,t,i,n){this.serverCall("action_response_server_call").success(function(){}).kwargs({action_response:e,qid:t,page_context:i,variant:n}).send()}});t.InlineEmailPrompt=o.extend({onLoad:function(){var e=this;e.$prompt=e.$id("@prompt"),e.$subscribe=e.$id("@subscribe"),e.$dismiss=e.$id("@dismiss_button"),e.$completed_prompt=e.$id("@completed_prompt"),e.$prompt_content=e.$id("@prompt_content"),e.$prompt_action=e.$id("@prompt_action"),
e.$failed_prompt=e.$id("@failed_prompt"),e.$generic_failure_prompt=e.$id("@generic_failure_prompt"),e.$dismiss.click(function(){e.dismissModule()}),e.$subscribe.click(function(){e.subscribe()})},failedSubscribe:function(e){var t=this;return e?(this.$generic_failure_prompt.removeClass("hidden"),void this.$generic_failure_prompt.text(e)):(this.$failed_prompt.removeClass("hidden"),void t.$id("@login").click(function(){return window.loginIntent=!0,t.serverCall("show_signup_wall_if_not_logged_in").liveMutate().send(),!1}))},clickedButton:function(){this.$generic_failure_prompt.addClass("hidden"),this.$failed_prompt.addClass("hidden"),this._super()},subscribe:function(){var e=this,t=e.$id("@email").val();e.serverCall("subscribe_email").success(function(){e.$subscribe.unbind("click")}).success(function(t){var i=t[0],n=t[1];i?e.clickedButton():e.failedSubscribe(n)}).kwargs({email:t}).send()}})},"./unified_view/ama_self_serve.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./unified_view/modal.js").ModalBase,s=i("./shared/events/index.js"),a=i("./unified_view/button/abstract.js").TwoStateButton,r=i("./settings-webpack.js"),d=i("./shared/onload.js"),l=i("./shared/window_manager.js");
t.AskQuestionSelfServe=n.extend({onLoad:function(){var e=this;this.$id("@add_question_button").on("click",this.openSessionModal.bind(this)),this.shouldOpenModal&&d.execAfterLoad(function(){e.openSessionModal()})},openSessionModal:function(){!r.isLoggedIn,1,this.createModal("open_modal").kwargs({host_uid:this.host_uid}).show()}}),t.StartSessionModal=o.extend({onLoad:function(){this._super.apply(this,arguments),this.input=this.$id("@input"),this.counter=this.child("counter");var e=this;e.input.keydown(function(e){return 13!=e.keyCode||e.shiftKey?void 0:(e.preventDefault(),!1)}),e.input.keyup(function(t){if(e.updateNotifPreview(),e.counter){var i=e.input.val().length;e.counter.updateCounter(i)}})},updateNotifPreview:function(){var e=this.input.val();this.$id("@description").text(e)},onSubmit:function(e){var t=this.input.val(),i=this;t&&i.serverCall("update_session").kwargs({description:t}).success(function(e){i.close(),l.navigateTo(e.redirect_url)}).error(function(){i.close()}).liveMutate().send();
}}),t.AmaSelfServeStopSessionLink=n.extend({onLoad:function(){var e=this,t=e.$id("@link");t&&t.on("click",function(){e.createModal("close_session_modal").show()})}}),t.StopSessionModal=o.extend({onLoad:function(){this._super.apply(this,arguments)},onSubmit:function(e){var t=this;t.serverCall("stop_session").success(function(){t.close()}).error(function(){t.close()}).liveMutate().send()}}),t.AmaSelfServeStartAma=n.extend({onLoad:function(){var e=this,t=e.$id("@start_button");t&&t.on("click",function(){e.createModal("open_session_modal").show()}),t&&e.should_open_modal&&e.createModal("open_session_modal").show()}}),t.EditSelfServeAma=n.extend({onLoad:function(){var e=this,t=e.$id("@edit");t&&t.on("click",function(){e.createModal("open_edit_session_modal").show()})}}),t.RequestedQuestionsInAskModal=n.extend({onLoad:function(){var e=this;e.handleEvent(s.Types.ASK_QUESTION_MODAL_QUERY_CHANGE,function(t){""==t.payload.query||"?"==t.payload.query?e.$id("@answer_list").show():e.$id("@answer_list").hide();
})}}),t.SelfServeAmaButton=a.extend({switchState:function(e){var t=this;this.pressed||t._super.apply(t,arguments)},onUnpressed:function(){}})},"./unified_view/anon.js":function(e,t,i){var n,o,s=i("./shared/core/component.js").Component,a=i("./unified_view/modal.js").ModalBase,r=i("./shared/window_manager.js"),d=i("./shared/beforeunload.js"),l=i("./shared/errors.js"),c=i("./shared/events/index.js"),u=i("./shared/client.js"),h=i("./unified_view/util.js"),p=i("./shared/jquery.js"),f=function(){r.removeURLParam("show_alert")};t.AnonQuestionInfoModalLink=s.extend({onLoad:function(){var e=this;e.$id("@create_modal_link").on("click",function(t){t.preventDefault(),e.createInfoModal()}),d.registerHandler(this.beforeUnload.bind(this))},beforeUnload:function(){var e=r.isParamInURL("show_alert");return e?(this.createInfoModal(),!0):void 0},createInfoModal:function(){f();var e=this;e.createModal("load_inner").kwargs({anon_user_content_key:e.anon_user_content_key,target:e.target}).show()}}),t.AnonEmailModalLink=s.extend({
onLoad:function(){var e=this;e.$id("@create_modal_link").on("click",function(t){t.preventDefault(),e.createModal("load_inner").kwargs({anon_user_content_key:e.anon_user_content_key,target:e.target}).show()})}}),t.AnonEmailModal=a.extend({onSubmit:function(){var e=this;e.serverCall("email_link").kwargs({anon_user_content_key:e.anon_user_content_key,target:e.target,to_address:e.$id("@email").val()}).success(function(t){(!t||t.success)&&(e.onAnonLinkSaved(),e.onClose())}).send()},onAnonLinkSaved:function(){f(),this.emitEvent(c.helpers.anonLinkSaved())}}),t.AnonDestroyModalLink=s.extend({onLoad:function(){var e=this;e.$id("@create_modal_link").on("click",function(t){t.preventDefault(),e.createModal("load_inner").kwargs({anon_user_content_key:e.anon_user_content_key,target:e.target}).show()})}}),t.AnonDestroyModal=a.extend({onSubmit:function(){var e=this;e.serverCall("destroy_link").kwargs({anon_user_content_key:e.anon_user_content_key,target:e.target}).success(function(t){t&&t.url&&(e.onAnonLinkSaved(),
u.isNativeApp()?t.is_question?o.send("openURL",{url:t.url,target:"main"}):o.send("dismissModal"):r.navigateTo(t.url))}).send()},onAnonLinkSaved:function(){f(),this.emitEvent(c.helpers.anonLinkSaved())}}),t.AnonLinkGroup=s.extend({onLoad:function(){var e=this,t=e.$id("@link_input"),i=e.$id("@copy_link");i.on("click",function(n){n.preventDefault();try{u.isIOSApp()?o.send("setClipboard",{text:t.get(0).value}):(t.select(),document.execCommand("copy")),i.text(e.translated_copied),e.onAnonLinkSaved()}catch(s){l.report(s),alert(e.translated_copy_error)}}),t.on("click",function(){u.isIOSApp()&&n.buildNumber>=744?(t.get(0).setSelectionRange(0,t.get(0).value.length),setTimeout(function(){o.send("showContextMenu",{position:h.positionForElement(t.get(0))})},300)):t.select(),f()})},onAnonLinkSaved:function(){f(),this.emitEvent(c.helpers.anonLinkSaved())}}),t.DeleteAnonContentModal=a.extend({onSubmit:function(){this.serverCall("delete_anon_content").kwargs({oid:this.oid,anon_content_key:this.anon_content_key
}).success(function(e){e&&e.url&&(r.removeURLParam("show_alert"),r.navigateTo(e.url))}).send()}}),t.MaybePromptAnonLinkBanner=s.extend({onLoad:function(){var e=this;e.handleEvent(c.Types.ANON_LINK_SAVED,function(){r.removeURLParam("show_alert")}),e.$id("@maybe_prompter").find("a").each(function(){var t=p(this).attr("href");"#"!==t&&(p(this).attr("href","#"),p(this).click(function(i){i.preventDefault();var n=r.isParamInURL("show_alert");n?e.showModal(t):e.goToNextUrl(t)}))})},showModal:function(e){var t=this;r.removeURLParam("show_alert"),t.createModal("load_modal").kwargs({oid:t.oid,anon_content_key:t.anon_content_key}).onClose(function(){t.goToNextUrl(e)}).show()},goToNextUrl:function(e){u.isNativeApp()?n.sendMessageToClient("openURL",{url:e,target:"main"}):r.navigateTo(e)}})},"./unified_view/answer/anon.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/debounce.js").debounce,s=i("./shared/window_manager.js");t.AnonAnswerDraftEditor=n.extend({onLoad:function(){
var e=this;e.editor=e.child("editor"),e.$id("@anon_answer_editor_submit").on("click",function(t){t.preventDefault(),e.onSubmit()}),e.$id("@anon_answer_editor_save_draft").on("click",function(t){t.preventDefault(),e.saveDraft()});var t=o(function(){e.saveDraft()},750,{maxWait:1e4,leading:!0});e.editor.setMeaningfulChangeCallback(function(){t()})},onSubmit:function(){var e=this,t=s.isParamInURL("show_alert");t?(s.removeURLParam("show_alert"),e.createModal("load_modal").kwargs({anon_content_key:e.anon_content_key,oid:e.oid}).onClose(function(){e.submit()}).show()):e.submit()},getContent:function(){return this.editor.serialize()},submit:function(){this.serverCall("submit").kwargs({oid:this.oid,anon_content_key:this.anon_content_key,content:this.getContent()}).success(function(e){s.navigateTo(e.ans_url)}).liveMutate().sendOnlyOnce()},saveDraft:function(){this.serverCall("save_draft").kwargs({oid:this.oid,content:this.getContent()}).send()}}),t.AnonAnswerEditor=t.AnonAnswerDraftEditor.extend({
saveDraft:function(){}}),t.AnonAnswerLink=n.extend({onLoad:function(){var e=this;e.$id("@anon_answer_link").on("click",function(){e.createAnonLink()})},createAnonLink:function(){this.serverCall("create_anon_link").kwargs({qid:this.qid}).success(function(e){s.navigateTo(e.anon_url)}).liveMutate().send()}})},"./unified_view/answer/timeline.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./unified_view/toggle.js"),s=i("./shared/events/index.js");t.TimelineWrapper=n.extend({onLoad:function(){var e=this,t=window.location.search.substr(1);if(t.includes("timeline")){var i=e.$id("@timeline").offset().top;i-=55,window.scroll(0,i)}}}),t.TimelineToggleWrapper=o.ToggleBase.extend({onLoad:function(){this._super.apply(this,arguments);var e=this,t=window.location.search.substr(1);t.includes("timeline")&&setTimeout(function(){var t=e.$id("@timeline").offset().top;t-=55,window.scroll(0,t)},100)}}),t.TimelineInlineToggleWrapper=t.TimelineToggleWrapper.extend({onLoad:function(){this._super.apply(this,arguments);
var e=this;e.handleEvent(s.Types.ANSWER_FEED_INLINE_EXPAND,function(t){t.payload.aid==e.aid&&e.triggerSwitch()})}})},"./unified_view/button/abstract.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./interface/settings.js"),s=i("./shared/cookies.js"),a=i("./shared/perf.js");t.Button=n.extend({onLoad:function(){if(this._userPerceivedAction=null,!this.disabled){var e=this,t=e.$id("@button");t.on("click",function(t){t.preventDefault(),e.onClick()})}},onClick:function(){this.onPressed()},setUserPerceivedAction:function(e){this._userPerceivedAction||(this._userPerceivedAction=a.startUserPerceived({vcon:this.__vcon,method:e}))},onPressed:function(){var e=this;e.qfeed_log_press_action&&s.setQfeedLog(e,e.qfeed_log_press_action),this.setUserPerceivedAction("press"),this.serverCall("press").disableDefaultUserPerceivedLogging().liveMutate().error(function(){e.switchState(!1)}).send()}}),t.TwoStateButton=t.Button.extend({onClick:function(){this.dirtyURL();var e=this.pressed;e?this.onUnpressed():this.onPressed(),
this.switchState(!e)},dirtyURL:function(){},switchState:function(e){if(this._userPerceivedAction&&(a.finishAction(this._userPerceivedAction),this._userPerceivedAction=null),this.pressed!=e&&o.isLoggedIn){var t=this.$id("@button"),i=this.$id("@text"),n=i.text();if(i.text(this.optimistic_text),this.optimistic_text=n,this.optimistic_count){var s=this.$id("@count");"0"===this.optimistic_count?s.addClass("hidden"):s.removeClass("hidden");var r=s.text();s.text(this.optimistic_count),this.optimistic_count=r}this.pressed?t.removeClass("pressed"):t.addClass("pressed"),this.pressed=e}},onPressedKwargs:function(){return{}},onPressed:function(){var e=this;e.qfeed_log_press_action&&s.setQfeedLog(e,e.qfeed_log_press_action),this.setUserPerceivedAction("press");var t=this.onPressedKwargs();this.serverCall("press").disableDefaultUserPerceivedLogging().liveMutate({optimisticUpdate:!0}).kwargs(t).error(function(){e.switchState(!1)}).send()},onUnpressedKwargs:function(){return{}},onUnpressed:function(){var e=this;
e.qfeed_log_unpress_action&&s.setQfeedLog(e,e.qfeed_log_unpress_action),this.setUserPerceivedAction("unpress");var t=this.onUnpressedKwargs();this.serverCall("unpress").disableDefaultUserPerceivedLogging().liveMutate({optimisticUpdate:!0}).kwargs(t).error(function(){e.switchState(!0)}).send()}})},"./unified_view/button/ads.js":function(e,t,i){var n=i("./unified_view/button/abstract.js").Button;t.LearnMoreButton=n.extend({onPressed:function(){var e=this;e.win=window.open(e.ad_url,"_blank"),e.win.focus()}})},"./unified_view/button/downvote.js":function(e,t,i){var n=i("./unified_view/button/abstract.js").TwoStateButton,o=i("./shared/cookies.js"),s=i("./shared/events/index.js");t.Answer=n.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.handleEvent(s.Types.ANSWER_VOTE_STATE,function(t){if(t.payload.aid==e.aid){var i="downvoted"==t.payload.state;e.switchState(i)}})},onUnpressed:function(){this.emitEvent(s.helpers.removeAnswerDownvote(this.aid)),this._super.apply(this,arguments);
},onPressed:function(){o.setQfeedLog(this,"AnswerDownvote"),o.setTlog({type:"AnswerVoteDown",aid:this.aid}),this.emitEvent(s.helpers.addAnswerDownvote(this.aid)),this._super.apply(this,arguments)}}),t.BlogPost=n.extend({onPressed:function(){o.setTlog({type:"BoardItemVoteDown",board_item_id:this.biid}),this._super.apply(this,arguments)}}),t.Question=n.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.handleEvent(s.Types.QUESTION_VOTE_STATE,function(t){if(t.payload.qid==e.qid){var i="downvoted"==t.payload.state;e.switchState(i)}})},onPressed:function(){o.setQfeedLog(this,"QuestionDownvote"),o.setTlog({type:"QuestionDownvote",qid:this.qid}),this.emitEvent(s.helpers.addQuestionDownvote(this.qid)),this._super.apply(this,arguments)},onUnpressed:function(){this.emitEvent(s.helpers.removeQuestionDownvote(this.qid)),this._super.apply(this,arguments)}})},"./unified_view/button/follow.js":function(e,t,i){var n=i("./unified_view/button/abstract.js").TwoStateButton,o=i("./shared/cookies.js"),s=i("./shared/w2.context.js").ActionBar,a=i("./shared/events/index.js");
t.Topic=n.extend({onPressed:function(){o.setTlog({type:"TopicFollow",tid:this.tid}),o.setQfeedLog(this,"TopicFollow"),this._super.apply(this,arguments)},onUnpressed:function(){o.setTlog({type:"TopicUnfollow",tid:this.tid}),o.setQfeedLog(this,"TopicUnfollow"),this._super.apply(this,arguments)}}),t.Question=n.extend({onLoad:function(){var e=this;e._super.apply(this,arguments),e.actionBarContext=this.getContext(s),e.actionBarContext&&(e.actionBarContext.get("toggleRAD")&&e.$id("@nub").addClass("is_active"),e.actionBarContext.on("toggleRAD",function(t,i){i===!0?e.$id("@nub").addClass("is_active"):setTimeout(function(){e.$id("@nub").removeClass("is_active")},160)}))},onPressed:function(){o.setTlog({type:"QuestionFollow",qid:this.qid}),this.actionBarContext&&this.actionBarContext.set("toggleRAD",!0),this.$id("@nub").addClass("is_active"),this._super.apply(this,arguments)},onUnpressed:function(){o.setTlog({type:"QuestionUnfollow",qid:this.qid}),this.actionBarContext&&this.actionBarContext.set("toggleRAD",!1),
this.$id("@nub").removeClass("is_active"),this._super.apply(this,arguments)}}),t.User=n.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.handleEvent(a.Types.USER_FOLLOW_STATE,function(t){if(t.payload.uid==e.target_uid){var i="followed"==t.payload.state;e.switchState(i)}})},onPressed:function(){this.emitEvent(a.helpers.addUserFollow(this.target_uid)),o.setTlog({type:"UserFollow",uid:this.uid}),o.setQfeedLog(this,"UserFollow"),this._super.apply(this,arguments)},onPressedKwargs:function(){return{from_hovercard:this.getDvar("hovermenu_parent")}},onUnpressed:function(){this.emitEvent(a.helpers.removeUserFollow(this.target_uid)),o.setTlog({type:"UserUnfollow",uid:this.uid}),o.setQfeedLog(this,"UserUnfollow"),this._super.apply(this,arguments)},onUnpressedKwargs:function(){return{from_hovercard:this.getDvar("hovermenu_parent")}}}),t.Blog=n.extend({onPressed:function(){o.setTlog({type:"BoardFollow",bid:this.bid}),this._super.apply(this,arguments)}}),t.Session=n.extend({});
},"./unified_view/button/network.js":function(e,t,i){var n=i("./unified_view/button/abstract.js").Button;t.ActivationButton=n.extend({onPressed:function(){this.serverCall("press").success(this.onPressedSuccess.bind(this)).liveMutate().send()},onPressedSuccess:function(e){var t=this;document.location=t.url_to_redirect}})},"./unified_view/button/notif.js":function(e,t,i){var n,o,s=i("./unified_view/button/abstract.js").Button,a=i("./shared/window_manager.js");t.Next=s.extend({onLoad:function(e){this._super.apply(this,arguments)},onLoadMobile:function(e){var t=this;e&&t.serverCall("update_seen").liveMutate().send(),t.nextId&&t.nextUrl&&o.send("setPageAction",{rightTextButton:{title:t.text,callback:function(){o.send("setPageAction",{noRightButtons:!0}),n.broadcastKeyUpdate(n.getBroadcastKey("notification",t.nextId,"read_state"),"seen"),n.broadcastMessageToWebViews("notifRead"),t.logPress(),o.send("setCanonicalURL",{url:t.nextUrl}),o.send("reload")}}})},onClick:function(){this.nextUrl&&(a.navigateTo(this.nextUrl),
this.logPress())},logPress:function(){this.serverCall("log_press").send()}})},"./unified_view/button/pause_ad.js":function(e,t,i){var n=i("./unified_view/button/abstract.js").TwoStateButton,o=i("./shared/events/index.js");t.Ad=n.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.handleEvent(o.Types.ADS_MANAGER_TABLE_SORT,function(t){e.$id("@button").on("click",function(t){t.preventDefault(),e.onClick()})})}}),t.Campaign=n.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.handleEvent(o.Types.ADS_MANAGER_TABLE_SORT,function(t){e.$id("@button").on("click",function(t){t.preventDefault(),e.onClick()})})},onClick:function(){this.dirtyURL();var e=this.pressed;e?this.onUnpressed():(this.onPressed(),this.switchState(!e))},onUnpressed:function(){this.createModal("load_enable_campaign_workflow_modal").kwargs({campaign_id:this.campaign_id}).show()}})},"./unified_view/button/pin.js":function(e,t,i){var n=i("./unified_view/button/abstract.js").TwoStateButton,o=i("./shared/cookies.js");
t.Topic=n.extend({onPressed:function(){o.setTlog({type:"PinFollow",oid:this.oid}),o.setQfeedLog(this,"PinFollow"),this._super.apply(this,arguments)},onUnpressed:function(){o.setTlog({type:"PinFollow",oid:this.oid}),o.setQfeedLog(this,"PinUnfollow"),this._super.apply(this,arguments)}})},"./unified_view/button/upvote.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./unified_view/button/abstract.js").TwoStateButton,s=i("./shared/cookies.js"),a=i("./shared/events/index.js"),r=i("./settings-webpack.js"),d=i("./shared/viewport.js");t.Upvote=o.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),e.$count=this.$id("@count"),e.handleEvent(a.Types.ANSWER_VOTE_STATE,function(t){if(t.payload.aid==e.aid){var i="upvoted"==t.payload.state;e.switchState(i),"upvoted"==t.payload.state?(e.$count.removeClass("hide_in_feed"),e.is_upvoted=!0):"upvoted"!=t.payload.state&&(e.$count.addClass("hide_in_feed"),e.is_upvoted=!1)}})},bindExpandEvent:function(e){var t=this;t.handleEvent(a.Types.FEED_ANSWER_INLINE_EXPAND,function(i){
i.payload.aid==e&&t.$count.removeClass("hide_in_feed")})}}),t.Answer=t.Upvote.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),e.bindExpandEvent(e.aid)},onPressedKwargs:function(){var e=null,t=this.getDvar("feed_story_hash");return t?e=t:r.trail&&(e=JSON.parse(r.trail).args[0]),{feed_story_hash:e}},onUnpressed:function(){this.emitEvent(a.helpers.removeAnswerUpvote(this.aid)),this._super.apply(this,arguments)},onPressed:function(){this.emitEvent(a.helpers.addAnswerUpvote(this.aid)),s.setQfeedLog(this,"AnswerUpvote"),s.setTlog({type:"AnswerVoteUp",aid:this.aid}),this._super.apply(this,arguments)}}),t.BlogPost=t.Upvote.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),e.bindExpandEvent(e.biid)},onPressed:function(){s.setQfeedLog(this,"BoardItemUpvote"),s.setTlog({type:"BoardItemUpvote",board_item_id:this.biid}),this._super.apply(this,arguments)}}),t.UpvoteTooltip=n.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),this.$upvote_tooltip=this.$id("@upvote_tooltip"),
e.$id("@dismiss_button").on("click",function(){e.$upvote_tooltip.addClass("hidden")}),e.showUpvoteTooltip(6e3)},showUpvoteTooltip:function(e){var t=this;t.$upvote_tooltip.removeClass("hidden");var i=setInterval(function(){d.isElementInViewport(t.$upvote_tooltip.get(0))&&(t.hideAfterDelay(e),clearInterval(i))},1e3)},hideAfterDelay:function(e){var t=this;setTimeout(function(){t.$upvote_tooltip.removeClass("fadeInDownMini"),t.$upvote_tooltip.addClass("fadeOutUpMini")},e),setTimeout(function(){t.$upvote_tooltip.addClass("hidden")},e+1e3)}})},"./unified_view/button/write_answer.js":function(e,t,i){var n=i("./shared/events/index.js"),o=i("./unified_view/button/abstract.js").Button;t.WriteAnswer=o.extend({onClick:function(){return this.logged_in?(this.$id("@button").addClass("disabled"),void this.emitEvent({type:n.Types.ANSWER_TOGGLE_EDITOR,payload:{qid:this.qid,bundle:this.getDvar("__writeMultiFeedBundle")}})):void this.serverCall("force_login").send()}})},"./unified_view/button/writing_list.js":function(e,t,i){
var n=i("./unified_view/button/abstract.js").TwoStateButton,o=i("./shared/cookies.js");t.WritingList=n.extend({onPressed:function(){o.setTlog({type:"QuestionAnswerLater",oid:this.oid}),o.setQfeedLog(this,"QuestionAnswerLater"),this._super.apply(this,arguments)},onUnpressed:function(){o.setTlog({type:"UnmarkQuestionAnswerLater",oid:this.oid}),o.setQfeedLog(this,"UnmarkQuestionAnswerLater"),this._super.apply(this,arguments)}})},"./unified_view/captcha.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/recaptcha.js"),s=i("./shared/w2.context.js").CaptchaInput,a=t.AllCaptchaInstances=[];t.CaptchaInput=n.extend({onLoad:function(){var e=this;a.push(e),e._isGrecaptchaReady=!1,e.captchaContext=e.getContext(s),e.captchaContext.set("present",!0),e.captchaContext.on("sync",function(t,i){var n=e.getCaptchaResponse();e.captchaContext.set("captchaResponse",n),e.captchaContext.set("isCaptchaFilled",""!==n),i===!0&&e.maybeAddValidationText()}),e.renderedId=null,e.tryToRender(),
e.$id("@captcha_loading").removeClass("hidden")},onUnload:function(){var e=a.indexOf(this);-1!==e&&a.splice(e,1)},getCaptchaResponse:function(){return grecaptcha.getResponse(this.renderedId)},tryToRender:function(){var e=this;o.onInit(function(){e.$id("@captcha_loading").addClass("hidden");var t=function(){e.captchaContext.set("sync",!0)},i=e.$id("@captcha"),n=i.get()[0];e.renderedId=grecaptcha.render(n.id,{sitekey:e.recaptcha_key,theme:"light",callback:t,"expired-callback":t}),e.captchaContext.set("captchaResponse","")})},maybeAddValidationText:function(){var e=this;o.onInit(function(){var t=e.getCaptchaResponse();""===t?e.$id("@captcha_validation_text").text(e.missing_captcha_text):e.$id("@captcha_validation_text").text("")})}})},"./unified_view/carousel.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js"),s=i("./shared/jquery.js");t.Carousel=n.extend({onLoad:function(){var e=this;e.num_suggestions=e.suggestions.length,e.handleCheckDismissAll(),
e.container=e.$id("@container"),e.distance=0,e.oldScrollLeft=0,e.newScrollLeft=0,e.$id("@right_arrow").on("click",function(t){t.preventDefault(),e.scrollCarousel("right")}),e.$id("@left_arrow").on("click",function(t){t.preventDefault(),e.scrollCarousel("left")})},scrollCarousel:function(e){var t=this,i=t.getScrollAmount(),n=300;"right"==e?t.distance+=i:(t.distance-=i,t.distance<0&&(t.distance=0)),t.toggleNav(t.distance,i),t.container.animate({scrollLeft:t.distance},n,function(){t.newScrollLeft=s(this).scrollLeft(),t.oldScrollLeft==t.newScrollLeft&&(t.distance=t.oldScrollLeft),t.oldScrollLeft=t.newScrollLeft})},getScrollAmount:function(){return 486},toggleNav:function(e,t){var i=this,n=i.$id("@left_arrow"),o=i.$id("@right_arrow"),s=i.container.find(".CarouselItem").length,a=i.container.find(".CarouselItem").width(),r=s*a;0==e?n.addClass("disabled"):n.removeClass("disabled"),e+t>r?o.addClass("disabled"):o.removeClass("disabled")},handleCheckDismissAll:function(){var e=this;e.carouselWrapper=s(e.$id("@container").get(0)).parent(),
e.bundle=e.$id("@bundle_body"),e.bundle.length>0&&(e.carouselWrapper=e.bundle.parent().parent()),e.handleEvent(o.Types.CAROUSEL_CHECK_DISMISS_ALL,function(t){e.num_suggestions--,0==e.num_suggestions&&e.emitEvent({type:o.Types.CAROUSEL_DISMISS_ALL,payload:{story_oid:e.story_oid}})}),e.handleEvent(o.Types.CAROUSEL_DISMISS_ALL,function(t){e.carouselWrapper.fadeOut(300,function(){s(this).hide()})})}}),t.CarouselItem=n.extend({onLoad:function(){var e=this;e.carouselItemWrapper=s(e.$id("@carousel_item").get(0)).parent(),e.$id("@dismiss").on("click",function(t){t.preventDefault(),e.dismissCarouselItem()})},dismissCarouselItem:function(){var e=this;e.carouselItemWrapper.addClass("hidden"),e.serverCall("dismiss").liveMutate().success(function(){e.emitEvent({type:o.Types.CAROUSEL_CHECK_DISMISS_ALL,payload:{oid:e.oid}})}).send()}})},"./unified_view/character_counter.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.CharacterCounter=n.extend({updateCounter:function(e){var t=this,i=t.$id("@counter");
t.left=parseInt(t.limit)-e,i.text(t.left),i.toggleClass("warning",t.left<=t.warning_limit),t.updateVisibility()},updateVisibility:function(){this.left<this.visible_on?this.show():this.hide()},show:function(){this.left<this.visible_on&&this.$id("@counter").removeClass("fade_out")},hide:function(){this.left>=0&&this.$id("@counter").addClass("fade_out")}})},"./unified_view/components.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./interface/settings.js"),a=i("./shared/logging.js"),r=i("./shared/core/rpc.js");i("./shared/onload.js"),i("./shared/beforeunload.js");t.JSTest=n.extend({onLoad:function(){var e=this;setTimeout(function(){r.atLeastOneServerCallIsSent()||e.serverCall("noop").send()},2e3)},_timeOnSiteData:function(){return{start:this.loadTime,end:Date.now(),wid:s.windowId}},_trackingInterval:function(){return this._trackingCount=this._trackingCount?this._trackingCount+1:1,this._trackingCount<=2?1e3:this._trackingCount<=5?2e3:this._trackingCount<=10?3e3:this._trackingCount<=20?5e3:this._trackingCount<=30?1e4:6e4;
},trackTimeOnSite:function(){var e=this;setTimeout(function(){a.log("time_on_site",e._timeOnSiteData()),e.trackTimeOnSite()},this._trackingInterval())},onBeforeUnload:function(){var e=o.param(this._timeOnSiteData());if(window.navigator&&window.navigator.sendBeacon)window.navigator.sendBeacon("/api/time_on_site_3RD_PARTY_POST?"+e);else{var t=new Image;t.src="/api/time_on_site?"+e}}})},"./unified_view/cookie_warning.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.CookieBanner=n.extend({onLoad:function(){var e=this;e.$id("@dismiss").on("click",function(){e.serverCall("dismiss").success(function(){e.onDismiss()}).send()})},onDismiss:function(){var e=this;e.$id("@banner").addClass("hidden")}})},"./unified_view/credential.js":function(e,t,i){var n,o,s,a=i("./shared/core/component.js").Component,r=i("./unified_view/modal.js").ModalBase,d=i("./unified_view/paged_list.js").PagedList,l=i("./unified_view/modal.js").FormModal,c=i("./unified_view/form.js").Form,u=i("./settings-webpack.js").interface_strings,h=i("./shared/events/index.js"),p=i("./shared/client.js"),f=i("./view/hover_menu.js");
t.CredentialsModal=r.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.handleEvent(h.Types.CREDENTIAL_ADD_FORM_VISIBILITY,function(){e.$id("@wrapper").toggleClass("hidden")})},_mobileOnSubmit:function(){var e=this;this._mobileDisabled||(this.onSubmit(),e.mobile_checklist_exp&&this.serverCall("complete_step").send())}}),t.ChooseCredentialModal=t.CredentialsModal.extend({onSubmit:function(){this._super.apply(this,arguments)},toggleNavigationButton:function(e){var t=this,i=u.edit;e&&(i=t.choose_text),p.isNativeApp()?s.send("setPageAction",{rightTextButton:{title:i,callback:t._mobileOnSubmit.bind(t)}}):t.$id("@nav").text(i)}}),t.CredentialsListBase=d.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.handleEvent(h.Types.CREDENTIAL_ADDED,function(){e.forceResync()}),e.handleEvent(h.Types.CREDENTIAL_DELETED,function(){e.forceResync()})}}),t.CredentialsListItemBase=a.extend({onLoad:function(){this.onLoadDesktop()},onLoadMobile:function(){},onLoadDesktop:function(){
var e=this;if(e.is_viewer){e.editWrapperLoaded=!1;var t=e.$id("@edit_wrapper_inner").get(0);t&&e.serverCall("get_edit_wrapper").contentFor(t).success(function(){var t=e.child("form");t&&e.child("form").registerOnSubmitSuccess(function(){e.toggleState()}),e.$id("@edit_wrapper .toggle_link").on("click",function(t){e.toggleState(),t.preventDefault()}),e.editWrapperLoaded=!0}).send({batched:!0}),e.$id("@view_wrapper .toggle_link").on("click",function(t){e.toggleState(),t.preventDefault(),t.stopPropagation()})}},toggleState:function(){this.$id("@view_wrapper").toggleClass("hidden"),this.$id("@edit_wrapper").toggleClass("hidden"),this.editWrapperLoaded===!0&&(this.$id("@edit_wrapper").hasClass("hidden")||this.child("form").autofocusField())}}),t.ChooseCredentialListItem=t.CredentialsListItemBase.extend({onLoadMobile:function(){var e=this;e.is_viewer&&!e.is_bad_credential&&(e.$id("@list_item").on("click",function(){e.$id("@list_item").hasClass("is_checked")||e.emitCredentialChosen()}),e.handleEvent(h.Types.CREDENTIAL_CHOSEN,function(t){
t.payload.credential_id==e.credential_id?(e.$id("@list_item").addClass("is_checked"),e.setCredentialOnQuestion()):e.$id("@list_item").removeClass("is_checked")}))},onLoadDesktop:function(){var e=this;e._super.apply(e,arguments),e.$id("@view_wrapper").on("click",function(){e.$id("@list_item").hasClass("is_checked")||e.emitCredentialChosen()}),e.handleEvent(h.Types.CREDENTIAL_CHOSEN,function(t){t.payload.credential_id==e.credential_id?(e.setCredentialOnQuestion(),e.$id("@list_item").addClass("is_checked"),e.$id("@radio").get(0).checked=!0):(e.$id("@list_item").removeClass("is_checked"),e.$id("@radio").get(0).checked=!1)})},emitCredentialChosen:function(){var e=this;e.emitEvent({type:h.Types.CREDENTIAL_CHOSEN,payload:{credential_id:e.credential_id}})},setCredentialOnQuestion:function(){var e=this;e.serverCall("set_credential_on_question").kwargs({qid:e.qid,credential_id:e.credential_id}).liveMutate().send()}}),t.EditCredentialListItem=t.CredentialsListItemBase.extend({onLoadMobile:function(){
var e=this;e.is_viewer&&e.$id("@list_item").on("click",function(){e.createModal("load_modal").kwargs({category:e.category,credential_id:e.credential_id}).show()})}}),t.AddCredentialsModal=l.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.handleEvent(h.Types.CREDENTIAL_DELETED,function(t){t.payload.credential_id==e.credential_id&&(e.submit(),e.close())})},registerOnFormSubmitSuccessExtra:function(){this.emitEvent({type:h.Types.CREDENTIAL_ADDED,scope:h.scope.GLOBAL,payload:{}})}}),t.AddCredentialsForm=c.extend({validateFormExtra:function(e){var t,i,n=this;return this.children().forEach(function(e){if(e.getFieldId){var n=e.getFieldId();"start_year"==n?t=e.getValue():"end_year"==n&&(i=e.getValue())}}),t&&i&&t>i&&(e=!1,window.alert(n.dialog_title_message)&&n.deleteCredential()),e}}),t.AddCredentialsModalLink=a.extend({onLoad:function(){},onLoadMobile:function(){var e=this;e.$id("@create_modal_link").on("click",function(t){t.preventDefault(),n.showActionSheet({title:e.action_sheet_title,
buttonTitles:e.action_sheet_options,destructiveButtonIndex:-1,callback:function(t){if(4!==t){var i=e.category_enums[t];e.loadModal(i)}}})})},loadModal:function(e){this.createModal("load_modal").kwargs({category:e,aid:this.aid}).show()}}),t.LifeExperienceExamples=a.extend({onLoad:function(){var e=this,t=0;e.interval=setInterval(function(){e.$id("@example").get(0).textContent=e.examples[t],e.$id("@example").removeClass("animate_out"),e.$id("@example").addClass("animate_in"),setTimeout(function(){e.$id("@example").removeClass("animate_in"),e.$id("@example").addClass("animate_out")},2800),t==e.examples.length-1?t=0:t++},5e3)},onUnload:function(){clearInterval(this.interval)}}),t.AddCredentialDropdown=a.extend({onLoad:function(){var e=this;e.overflowMenu=new f.ToggleableMenu({$linkElem:this.$id("@add_link"),$menuElem:this.$id("@overflow_menu"),loadFunction:function(){},alignment:"left",clickOpen:!0,useCssPositioning:!0}),e.default_category?e.emitEvent({type:h.Types.CREDENTIAL_ADD_FORM_VISIBILITY,
payload:{category:e.default_category}}):e.serverCall("get_add_forms").contentFor(e.$id("@add_forms").get(0)).send({batched:!0}),e.$id("@overflow_menu .js_category_link").on("click",function(){var t=this.getAttribute("data-category");e.emitEvent({type:h.Types.CREDENTIAL_ADD_FORM_VISIBILITY,payload:{category:t}}),e.serverCall("log_open_add_edit").kwargs({category:t}).send()}),e.handleEvent(h.Types.CREDENTIAL_ADD_FORM_VISIBILITY,function(){e.$id("@add_link").toggleClass("hidden")})}}),t.AddCredentialDropdownForms=a.extend({onLoad:function(){var e=this;e.handleEvent(h.Types.CREDENTIAL_ADD_FORM_VISIBILITY,function(t){var i=t.payload.category;e.$id("@wrapper_"+i).toggleClass("hidden"),e.child("form_"+i).autofocusField()}),e.categories.forEach(function(t){e.child("form_"+t).registerOnSubmitSuccess(function(){var i=e.child("form_"+t);i&&(i.clearForm(),e.emitCredentialAddFormVisibility(t),this.emitEvent({type:h.Types.CREDENTIAL_ADDED,scope:h.scope.GLOBAL,payload:{}}))}),e.$id("@wrapper_"+t+" .toggle_link").on("click",function(i){
e.child("form_"+t).clearForm(),e.emitCredentialAddFormVisibility(t),i.preventDefault()})})},emitCredentialAddFormVisibility:function(e){this.emitEvent({type:h.Types.CREDENTIAL_ADD_FORM_VISIBILITY,payload:{category:e}})}}),t.CredentialModalLink=a.extend({onLoad:function(){var e=this;e.$id("@modal_link").on("click",function(t){t.preventDefault(),e.createModal("load_modal").kwargs(e.getKwargs()).show()})},getKwargs:function(){return{}}}),t.EditCredentialsModalLink=t.CredentialModalLink.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.mobile_checklist_exp&&e.$id("@modal_link").on("click",function(t){e.emitEvent({type:h.Types.ZAPDOS_INLINE_DISMISS,payload:{cardType:e.card_type}})})},getKwargs:function(){return{target_uid:this.target_uid}}}),t.ChooseCredentialModalLink=t.CredentialModalLink.extend({getKwargs:function(){return{target_uid:this.target_uid,qid:this.qid,aid:this.aid}}}),t.EditCredentialModalLink=t.CredentialModalLink.extend({getKwargs:function(){return{target_uid:this.target_uid,
category:this.category}}}),t.DeleteCredentialLink=a.extend({onLoad:function(){this.onLoadDesktop()},onLoadMobile:function(){var e=this;e.$id("@link").on("click",function(t){t.preventDefault(),o.showAlert({title:e.dialog_title,message:e.dialog_message,cancelButtonTitle:u.cancel,otherButtonTitles:[e.dialog_button_text],callback:function(t){1==t.buttonIndex&&e.deleteCredential()}})})},onLoadDesktop:function(){var e=this;e.$id("@link").on("click",function(t){t.preventDefault(),window.confirm(e.dialog_title_message)&&e.deleteCredential()})},deleteCredential:function(){var e=this;e.serverCall("delete_credential").kwargs({credential_id:e.credential_id}).sendOnlyOnce(),e.emitEvent({type:h.Types.CREDENTIAL_DELETED,scope:h.scope.GLOBAL,payload:{credential_id:e.credential_id}})}}),t.SetDefaultCredentialLink=a.extend({onLoad:function(){this.onLoadDesktop()},onLoadMobile:function(){var e=this;e.$id("@link").on("click",function(t){t.preventDefault(),o.showAlert({title:e.dialog_title,message:e.dialog_message,
cancelButtonTitle:u.cancel,otherButtonTitles:[e.dialog_button_text],callback:function(t){1==t.buttonIndex&&e.setDefaultCredential()}})})},onLoadDesktop:function(){var e=this;e.$id("@link").on("click",function(t){t.preventDefault(),window.confirm(e.dialog_title_message)&&e.setDefaultCredential()})},setDefaultCredential:function(){var e=this;e.serverCall("set_default").kwargs({credential_id:e.credential_id}).send()}}),t.EditFreeformCredentialModal=r.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.handleEvent(h.Types.CREDENTIAL_DELETED,function(t){t.payload.credential_id==e.credential_id&&(e.submit(),e.close())}),e.child("form").registerOnSubmitSuccess(function(){e.submit(),e.close()}),e.$id("@list_item .toggle_link").on("click",function(t){t.preventDefault(),e.submit(),e.close()})}})},"./unified_view/curators.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.NewToolModalLink=n.extend({onLoad:function(){var e=this;this.$id("@create_modal").on("click",function(t){
t.preventDefault(),e.createModal("load_inner").show()})}}),t.CuratorsChat=n.extend({onLoad:function(){var e=this;e.$id("@submit").on("keypress",function(t){13==t.keyCode&&(t.preventDefault(),e.onSubmit())})},onSubmit:function(){var e=this.$id("@message_input").val();this.serverCall("submit").kwargs({content:e}).liveMutate().send()}}),t.ToolsList=n.extend({onLoad:function(){var e=this;e.$id("@tools_edit").on("click",function(){e.$id("@tools_list").toggleClass("editing")})}})},"./unified_view/datetime_.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=null,s={},a=i("./shared/datetime.js");t.DateTimeComponent=n.extend({onLoad:function(){if(this.$timespanElem=this.$id("@datespan"),this.js_disp&&this.updateDisplayStr(),this.js_update_interval){var e=this.js_update_interval+Math.floor(Math.random()*this.js_update_interval*.1);setInterval(this.updateDisplayStr.bind(this),e)}},updateDisplayStr:function(){this.date_only?this.$timespanElem.html(a.dayStr(this.epoch_us)):this.$timespanElem.html(a.timestampStr(this.epoch_us,this.granularity));
}}),t.CountdownClock=n.extend({onLoad:function(){var e=this,t=e.$id("@countdown");null===o&&(o=setInterval(function(){var e=!0;for(var t in s)s.hasOwnProperty(t)&&(e=!1,s[t]());e&&(clearInterval(o),o=null)},200)),s[e.cid]=function(){var i,n=Math.floor(Date.now()/1e3),o=e.getTimeDifference(n),a=Math.floor(o/60%60),r=Math.floor(o/3600),d=Math.floor(o%60);if(e.should_pad_zeroes){var l=function(e){var t=e.toString();return t.length>1?t:"0"+t};a=l(a),d=l(d)}i=e.template.replace("{hrs}",r).replace("{mins}",a).replace("{secs}",d),e.text!==i&&(e.text=i,t.text(i)),e.hasExpired(n)&&delete s[e.cid]}},onUnload:function(){delete s[this.cid]},getTimeDifference:function(e){return Math.max(this.expires_secs-e,0)},hasExpired:function(e){return e>this.expires_secs}}),t.TimeElapsedClock=t.CountdownClock.extend({getTimeDifference:function(e){return Math.max(e-this.expires_secs,0)},hasExpired:function(e){return!1}})},"./unified_view/download_csv.js":function(e,t,i){var n=i("./shared/core/component.js").Component;
t.DownloadCSV=n.extend({onLoad:function(){var e=this;this.$id("@download_link").on("click",function(t){t.preventDefault(),e.downloadData()})},createCSV:function(){var e,t,i="";if(this.print_all_keys)for(e=0;e<this.data.length;e++)for(var n in this.data[e])-1==this.header.indexOf(n)&&this.header.push(n);for(e=0;e<this.data.length;e++){var o=[];for(t=0;t<this.header.length;t++){var s=this.data[e][this.header[t]];void 0!==s?(s=String(s),/[,"\n]/.test(s)?o.push('"'+s.replace(/"/g,'""')+'"'):o.push(s)):o.push(s)}i+=o.join(",")+"\n"}return i},downloadData:function(){var e=this.createCSV(),t=this.header.join(",")+"\n",i=document.createElement("a"),n=void 0===this.file_name?"data":this.file_name;i.setAttribute("href","data:text/csv;charset=utf-8,"+encodeURIComponent(t)+encodeURIComponent(e)),i.setAttribute("download",n+".csv"),i.click()}})},"./unified_view/facebook.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/facebook.js"),s=i("./settings-webpack.js"),a=i("./shared/window_manager.js");
t.TokenRefresher=n.extend({onLoad:function(){var e=this;o.onInit(function(){window.FB.getLoginStatus(function(t){if("connected"==t.status){if(window.loginInProgress===!0)return;window.loginInProgress=!0;var i=t.authResponse;e.serverCall("update_access_token").kwargs({fb_uid:i.userID,access_token:i.accessToken,expires:i.expiresIn}).success(e.onSuccess.bind(e)).error(function(){window.loginInProgress=!1}).except(function(){window.loginInProgress=!1}).send()}})})},onSuccess:function(e){window.loginInProgress=!1;e&&"post_reload"==s.pageMode&&a.reload()}})},"./unified_view/fb_modal.js":function(e,t,i){var n=i("./shared/events/index.js"),o=i("./unified_view/modal.js").ModalBase;t.FacebookFriendsFollowModal=o.extend({onLoad:function(){this._super.apply(this,arguments),this.fuid_map={};for(var e=0;e<this.unchecked_fuids.length;++e)this.fuid_map[this.unchecked_fuids[e]]=!1;for(var t=0;t<this.checked_fuids.length;++t)this.fuid_map[this.checked_fuids[t]]=!0;var i=this;this.handleEvent(n.Types.NUX_DIALOG_FRIENDS_UPDATE,function(e){
e.payload.addFriend?i.add(e.payload.addFriend):e.payload.removeFriend?i.remove(e.payload.removeFriend):e.payload.addAll?i.addAll():e.payload.removeAll&&i.removeAll()})},add:function(e){this.fuid_map[e]=!0},remove:function(e){this.fuid_map[e]=!1},addAll:function(){for(var e in this.fuid_map)this.add(e)},removeAll:function(){for(var e in this.fuid_map)this.remove(e)},onSubmit:function(){var e=this._super.bind(this);this.serverCall("button_clicked").kwargs({fuid_map:this.fuid_map,prechecked_fuids:this.checked_fuids}).success(function(){e()}).liveMutate().send()}})},"./unified_view/feed/feedback.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.UnfollowOrMuteTopic=n.extend({onLoad:function(){this.$id("@unfollow_topic").on("click",this.unfollow.bind(this)),this.$id("@mute_topic").on("click",this.mute.bind(this))},unfollow:function(e){e.preventDefault(),this.serverCall("unfollow_topic").liveMutate().send()},mute:function(e){e.preventDefault(),
this.serverCall("mute_topic").liveMutate().send()}}),t.MuteUserModalLink=n.extend({onLoad:function(){var e=this,t=function(){e.serverCall("toggle_mute_for_user").liveMutate().send()};e.$id("@mute_user").on("click",function(i){i.preventDefault(),e.createModal("toggle_mute_user_modal").onSubmit(t).show()})}}),t.Feedback=n.extend({onLoad:function(){var e=this;e.can_undo&&e.$id("@undo").on("click",function(t){t.preventDefault(),e.undoDownvote(),e.serverCall("undo").liveMutate().send()})},undoDownvote:function(){"question"==this.type?this.emitEvent(o.helpers.removeQuestionDownvote(this.oid)):"answer"==this.type&&this.emitEvent(o.helpers.removeAnswerDownvote(this.oid))}}),t.NegativeFeedback=t.Feedback.extend({undoDownvote:function(){this.emitEvent({type:o.Types.FEED_NEGATIVE_FEEDBACK_STATE,payload:{oid:this.oid,state:"hide"}})}}),t.NegativeFeedbackReason=n.extend({onLoad:function(){var e=this;e.$id("@trigger").on("click",function(t){t.preventDefault(),e.emitEvent(o.helpers.feedNegativeFeedback(e.oid,e.message));
})}}),t.NegativeFeedbackMessage=n.extend({onLoad:function(){var e=this;e.$id("@undo").on("click",function(t){t.preventDefault(),e.emitEvent(o.helpers.feedNegativeFeedback(e.oid))})}}),t.NegativeFeedbackUnfollowTopic=n.extend({onLoad:function(){var e=this;e.$id("@trigger").on("click",function(t){t.preventDefault(),e.serverCall("unfollow_topic").liveMutate().send(),e.emitEvent(o.helpers.feedNegativeFeedback(e.oid,e.message))})}}),t.NegativeFeedbackUnfollowUser=n.extend({onLoad:function(){var e=this;e.$id("@trigger").on("click",function(t){t.preventDefault(),e.serverCall("unfollow_user").liveMutate().send(),e.emitEvent(o.helpers.feedNegativeFeedback(e.oid,e.message))})}}),t.NegativeFeedbackMuteTopic=n.extend({onLoad:function(){var e=this;e.$id("@trigger").on("click",function(t){t.preventDefault(),e.serverCall("mute_topic").liveMutate().send(),e.emitEvent(o.helpers.feedNegativeFeedback(e.oid,e.message))})}}),t.NegativeFeedbackMuteUser=n.extend({onLoad:function(){var e=this;e.$id("@trigger").on("click",function(t){
t.preventDefault(),e.serverCall("mute_user").liveMutate().send(),e.emitEvent(o.helpers.feedNegativeFeedback(e.oid,e.message))})}})},"./unified_view/feed/modal.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/client_tracker.js"),s=i("./shared/cookies.js");t.OneClickOverlay=n.extend({onLoad:function(){var e=this;e.$id("@link").on("click",function(){o.track(e.qfeed_log_action,null,e),s.setQfeedLog(e,e.qfeed_log_action)})}})},"./unified_view/feed/reasons.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.FeedReasonNegativeLink=n.extend({onLoad:function(){var e=this;e.$id("@close").click(function(t){return e.emitEvent({type:o.Types.FEED_NEGATIVE_FEEDBACK_STATE,payload:{oid:e.oid,to_uid:e.to_uid,tid:e.tid,matched_condition:e.matched_condition,state:"show_options"}}),!1})}})},"./unified_view/form.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.Form=n.extend({onLoad:function(){var e=this;e.autofocusField(),
e.should_render_submit_button&&e.$id("@submit").on("click",function(t){t.preventDefault(),e.submitForm()})},autofocusField:function(){var e=this,t=function(){e.children().forEach(function(t){t.getFieldId&&t.getFieldId()==e.field_id_to_autofocus&&t.whenOnLoaded(function(){t.focusField()})})};e.field_id_to_autofocus&&t()},getServerCallKwargsFromForm:function(){var e={};return this.children().forEach(function(t){if(t.getFieldId){var i=t.getFieldId();e[i]=t.getValue()}}),e},validateForm:function(){var e=!0;return this.children().forEach(function(t){t.isSubmittable&&(t.isSubmittable()?t.removeRequiredIndicator():(t.addRequiredIndicator(),e=!1))}),e===!0&&(e=this.validateFormExtra(e)),e},validateFormExtra:function(e){return e},clearForm:function(){this.children().forEach(function(e){e.clearValue&&e.clearValue()})},submitForm:function(){this.validateForm()?this._submitForm():this.onSubmitFailure()},_submitForm:function(){var e=this;e.$id("@submit").addClass("disabled"),e.serverCall("submit").kwargs(e.getServerCallKwargsFromForm()).success(function(){
e.onSubmitSuccess(),e.$id("@submit").removeClass("disabled")}).error(function(){e.onSubmitFailure(),e.$id("@submit").removeClass("disabled")}).liveMutate().send()},registerOnSubmitSuccess:function(e){this._callbackSuccess=e},registerOnSubmitFailure:function(e){this._callbackFailure=e},onSubmitSuccess:function(){this._callbackSuccess&&this._callbackSuccess(),this.should_clear_form_after_submitting&&this.clearForm()},onSubmitFailure:function(){this._callbackFailure&&this._callbackFailure()}}),t.FormField=n.extend({onLoad:function(){var e=this;e.$field=e.$id("@"+e.field_id),e.$field.on("input",function(){e.onTextChange()})},onTextChange:function(){this.removeRequiredIndicator()},getFieldId:function(){return this.field_id},focusField:function(){this.$field.focus()},getValue:function(){return this.$field.get(0).value},setValue:function(e){this.$field.get(0).value=e},clearValue:function(){this.setValue("")},isValid:function(){return this.$field.get(0).value.length>0},addRequiredIndicator:function(){
this.$field.addClass("required_indicator"),this.$id("@error_tooltip").removeClass("hidden")},removeRequiredIndicator:function(){this.$field.removeClass("required_indicator"),this.$id("@error_tooltip").addClass("hidden")},isSubmittable:function(){return this.required?this.isValid():!0}}),t.FormFieldInput=t.FormField.extend({onTextChange:function(){if(this._super.apply(this,arguments),this.counter=this.child("counter"),this.counter){var e=this.$field.get(0).value.length;this.counter.updateCounter(e)}}}),t.FormFieldSelect=t.FormField.extend({setValue:function(e){this.$field.get(0).value=e[0]},clearValue:function(){var e=this.options[this.default_selection];return e?this.setValue(e):void 0}}),t.FormFieldCheckbox=t.FormField.extend({onLoad:function(){this._super.apply(this,arguments)},getValue:function(){return this.$field.get(0).checked},setValue:function(e){"true"==e||"checked"==e?this.$field.get(0).setAttribute("checked"):this.$field.get(0).removeAttribute("checked")},clearValue:function(){
this.setValue(!1)}}),t.FormFieldTopicSelector=t.FormField.extend({onLoad:function(){this._super.apply(this,arguments),this.$value=this.$id("@value");var e=this;this.child("selector").onTopicSelected(function(t,i){e.setInput(t),e.setValue(i)}),e.$id("@remove_topic").on("click",function(t){t.preventDefault(),e.clearInput()})},setInput:function(e){var t=this,i=document.createElement("span");i.className="TopicName",i.textContent=e,t.$field.get(0).appendChild(i),t.$field.removeClass("hidden"),t.$id("@remove_topic").removeClass("hidden"),t.$id("@selector").addClass("hidden")},clearInput:function(){var e=this;e.$field.addClass("hidden"),e.$id("@remove_topic").addClass("hidden"),e.$id("@selector").removeClass("hidden"),e.$field.get(0).innerHTML="",e.setValue("")},focusField:function(){this.child("selector").focus()},getValue:function(){return parseInt(this.$value.get(0).value)},setValue:function(e){this.$value.get(0).value=e},clearValue:function(){this.clearInput()},isValid:function(){var e=this.getValue();
return e&&""!==e},addRequiredIndicator:function(){this.$id("@selector").addClass("required_indicator"),this.$id("@error_tooltip").removeClass("hidden")},removeRequiredIndicator:function(){this.$id("@selector").removeClass("required_indicator"),this.$id("@error_tooltip").addClass("hidden")}}),t.FormFieldQTextEditor=t.FormField.extend({focusField:function(){this.child("content").focus()},getValue:function(){return this.child("content").serialize()},clearValue:function(){this.child("content").clear()},isValid:function(){return!this.child("content").isEmpty()}})},"./unified_view/google_analytics.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/onload.js");t.GASnippet=n.extend({onLoad:function(){o.execAfterLoadDelayed(this.track.bind(this))},track:function(){!function(e,t,i,n,o,s,a){e.GoogleAnalyticsObject=o,e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o].l=1*new Date,s=t.createElement(i),a=t.getElementsByTagName(i)[0],s.async=1,s.src=n,a.parentNode.insertBefore(s,a);
}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),window.ga("create",this.tracking_id,"auto",{sampleRate:this.tracking_rate}),window.ga("require","displayfeatures"),window.ga("send","pageview"),this.custom_dimensions.forEach(function(e){window.ga("set",e[0],e[1])})}})},"./unified_view/home/logged_out_feed.js":function(e,t,i){var n=i("./unified_view/toggle.js");t.LoggedOutMultifeedBundle=n.ToggleBase.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.$id("@view_more").on("click",function(){e.$id("@view_more").text(e.loading_text)})}})},"./unified_view/inline_editor.js":function(e,t,i){var n=i("./unified_view/modal.js");t.ClearDraftConfirmationModal=n.ModalBase.extend({onSubmit:function(){this.serverCall("clear_draft").kwargs({draft_space:this.draft_space}).liveMutate().success(this._super.bind(this)).send()}})},"./unified_view/lazy.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/core/rpc.js");t.LazyComponent=n.extend({
onLoad:function(){var e=this,t=e.$id("@wrapper").get()[0];t&&o.rpc("/api/rerender_component_POST").contentFor(t,{parentCid:e.parent().cid}).kwargs({serialized_component:e.serialized_component,vcon:e.vcon()}).send({batched:!0})}})},"./unified_view/login.js":function(e,t,i){var n=i("./unified_view/modal.js").ModalBase,o=i("./shared/events/index.js"),s=i("./unified_view/signup/_signup.js");t.SetPasswordForUnconfirmedEmailModal=n.extend({onSubmit:function(){this.$id("@email_password_leak_error").hide(),this.serverCall("on_password_set").kwargs({password:this.$id("@password").val()}).success(this.passwordSetCallback.bind(this)).send()},onLoad:function(){this._super.apply(this,arguments),s.hideSignupWall();var e=this;this.$id("@password").focus(),this.$id("@password").on("keypress",function(t){13==t.keyCode&&e.onSubmit()})},onClose:function(){s.loadSignupWall(),this._super.apply(this,arguments)},passwordSetCallback:function(e){e.success?this.emitEvent(o.helpers.loginUser()):(e.error_message,1);
}})},"./unified_view/main.js":function(e,t,i){},"./unified_view/mobile_debug.js":function(e,t,i){var n,o,s=i("./shared/core/component.js").Component,a=i("./shared/cookies.js"),r=i("./shared/keystrokes.js"),d=s.extend({toggle:function(){var e=this;e.has_cookie?a.setCookie(e.cookie_key,null):a.setCookie(e.cookie_key,1),window.location.reload()}});t.ToggleMobileButton=d.extend({onLoad:function(){var e=this;n=e,e.$id("@toggle").on("click",function(t){return e.toggle(),t.preventDefault(),t.stopPropagation(),!1})}}),t.ToggleTabletButton=d.extend({onLoad:function(){var e=this;o=e,e.$id("@toggle").on("click",function(t){return e.toggle(),t.preventDefault(),t.stopPropagation(),!1})}}),r.on([77,48,77,48],function(){n&&n.toggle()}),r.on([84,48,84,48],function(){o&&o.toggle()})},"./unified_view/mobile_overlays.js":function(e,t,i){var n,o,s,a,r=i("./shared/core/component.js").Component,d=i("./shared/core/component.js"),l=i("./shared/client.js"),c=i("./shared/errors.js"),u=i("./shared/jquery.js"),h=r.extend({
$getContainer:function(){return this.$id("@container")},$getContent:function(){return this.$id("@content")},show:function(){var e=this;if(!this.isShown){this.isShown=!0,this._closeListener=this.close.bind(this),n.send("addHash",{hash:this._getHashName(),onRemove:this._closeListener}),window.onpopstate=function(t){var i=document.location.hash.substr(1);i&&i.length>0&&i!=e._getHashName()&&"action_sheet"!=i&&e.close()},this.modalBackground=document.createElement("div"),this.modalBackground.className="modal_bg";var t=this.$getContainer().css("z-index");this.modalBackground.style.zIndex=t-1,document.body.insertBefore(this.modalBackground,document.body.firstChild),u(this.modalBackground).on("click",function(){window.history.back()}),this.$getContainer().removeClass("hidden"),this.$getContainer().addClass(this._getOpenAnimation()),this.$getContent().scrollTop(0),this._fixHeight(),l.isIOSMobileWeb()?this._lockScrollOnIOS():document.body.style.overflowY="hidden",this._resizeListener=this._fixHeight.bind(this),
window.addEventListener("resize",this._resizeListener)}},close:function(){if(this.isShown){if(this.isShown=!1,this.$getContainer().addClass("hidden"),window.removeEventListener("popstate",this._closeListener),window.removeEventListener("resize",this._resizeListener),l.isIOSMobileWeb()){var e=this.$getContent().get(0);e.removeEventListener("touchstart",this._handleTouchStart),e.removeEventListener("touchmove",this._handleTouchMove),window.removeEventListener("scroll",this._iOSScrollHack),document.body.removeEventListener("touchmove",this._cancelTouch)}else document.body.style.overflowY="scroll";document.body.removeChild(this.modalBackground),this.onClose&&this.onClose(),this._clearPageAction()}},setOnClose:function(e){this.onClose=e},setRightTextButton:function(e){var t=this.$id("@navigation_button");t.removeClass("hidden"),t.removeClass("has_badge"),t.toggleClass("is_disabled",e.disabled),t.text(e.title);var i=this.$id("@header_action_buttons");i&&i.addClass("hidden");var n=e.callback;t.on("click",function(){
n()})},setRightIconButtons:function(e){this.hideRightButtons();var t=this.$id("@header_action_buttons");t.removeClass("hidden");for(var i=0;i<e.length;i++){var n=e[i],s="@right_icon_button_"+i,a=this.$id(s);a.removeClass("hidden"),a.toggleClass("is_disabled",n.disabled),a.text(o.getIconChar(n.iconName));var r=n.callback;a.on("click",function(){r()})}},hideRightButtons:function(){var e=this.$id("@navigation_button");e.toggleClass("hidden",!0);for(var t=0;2>t;t++){var i="@right_icon_button_"+t;this.$id(i).addClass("hidden")}},_fixHeight:function(){var e;e=!this._height||this._height>window.innerHeight?window.innerHeight:this._height;var t=this.$id("@action_view_header").height();this.$getContainer().height(e),this.$getContent().height(e-t);var i=window.scrollY+(window.innerHeight-e);this.$getContainer().css("top",i+"px")},_lockScrollOnIOS:function(){var e=this.$getContent().get(0),t=this;t.startScroll=window.scrollY,this._handleTouchStart=function(e){t.allowUp=this.scrollTop>0,t.allowDown=this.scrollTop<this.scrollHeight-this.clientHeight,
t.slideBeginY=e.pageY},e.addEventListener("touchstart",this._handleTouchStart),this._handleTouchMove=function(e){var i=e.pageY>t.slideBeginY,n=e.pageY<t.slideBeginY;t.slideBeginY=e.pageY,i&&t.allowUp||n&&t.allowDown?e.stopPropagation():e.preventDefault()},e.addEventListener("touchmove",this._handleTouchMove),this._cancelTouch=function(e){e.preventDefault()},document.body.addEventListener("touchmove",this._cancelTouch),this._iOSScrollHack=function(e){window.scrollTo(window.scrollX,t.startScroll)},window.addEventListener("scroll",this._iOSScrollHack)}});t.ModalOverlay=h.extend({onLoad:function(){var e=this;a=e;var t=e.$id("@close_button");t.on("click",function(){window.history.back()})},_clearPageAction:function(){this.hideRightButtons()},_getOpenAnimation:function(){return"modal-open"},_getHashName:function(){return"modal"}}),t.ActionViewOverlay=h.extend({onLoad:function(){var e=this;s=e;var t=e.$id("@close_button");t.on("click",function(){window.history.back()})},_clearPageAction:function(){
this.hideRightButtons(),this.setTitle("")},_getOpenAnimation:function(){return"action-view-slide-in"},_getHashName:function(){return"actionView"},setTitle:function(e){this.$id("@title").text(e)},setHeight:function(e){this._height=e,this._fixHeight()}}),t.getActionViewOverlay=function(){return s},t.getModalOverlay=function(){return a},t.isOverlayShown=function(){var e=!1;return[s,a].forEach(function(t){e|=t&&t.isShown}),e};var p=t.setPageAction=function(e){_[m]=e;var t;if(s.isShown)t=s,e.title&&t.setTitle(e.title);else{if(!a.isShown)return;t=a}e.rightTextButton&&t.setRightTextButton(e.rightTextButton),e.rightIconButtons&&t.setRightIconButtons(e.rightIconButtons)},f=0;t.moveElementToDiv=function(e,t){var i=document.createElement("div"),n="_movedElement_"+f++;i.id=n,e.parentElement&&e.parentElement.replaceChild(i,e),t.appendChild(e),e.setAttribute("_markerId",n)},t.moveElementBack=function(e){var t=e.getAttribute("_markerId"),i=document.getElementById(t);i?(i.parentElement.replaceChild(e,i),
e.setAttribute("_markerId",void 0)):e.parentElement.removeChild(e)};var _={},m=-1,g={};t.registerComponent=function(e,t){var i=g[e];void 0===i&&(i=[],g[e]=i),t.cid!=e&&i.push(t)},t.deregisterComponent=function(e,t){var i=g[e];if(i){var n=i.indexOf(t);n>-1&&i.splice(n,1)}},t.executeOnLoadForPrefetchedContent=function(e){var t=e.cid,i=g[t];m=t;var n=e.getDvar("prefetchedContentRootCid");if(n){e.setDvar("prefetchedContentRootCid",void 0);try{d.onLoad(i,!1)}catch(o){c.report(o)}}else{var s=_[t];s&&p(s)}}},"./unified_view/modal.js":function(e,t,i){var n,o,s,a=i("./shared/core/component.js").Component,r=i("./shared/modal.js"),d=i("./shared/util.js"),l=i("./shared/client.js");n=i("./w2.modal.js"),t.ModalBase=a.extend({onLoad:function(){var e=this;this.$id("@close").on("click",function(t){t.preventDefault(),e.onClose()}),this.$id("@cancel").on("click",function(t){t.preventDefault(),e.onClose()}),this.$id("@submit").on("click",function(t){t.preventDefault(),e.onSubmit()}),this.onLoadWeb()},onLoadWeb:function(){
var e=n.Modal.modalFor(this);this._originalClose=e.close.bind(e);var t=this;e.close=d.once(function(){e._isOpen&&t.onClose()})},onLoadMobile:function(){this._initMobileDoneButton(!1),this._initMobileCancelButton()},_initMobileDoneButton:function(e){this.mobile_done_button&&(l.isNativeApp()?this.nativeSetPageAction(e):(this.$nav=this.$id("@nav"),this.$nav.text(this.done_text),this.$nav.addClass("is_done"),this.$nav.removeClass("hidden"),this.$nav.on("click",this._mobileOnSubmit.bind(this))),this.setMobileDoneButtonDisabled(e))},_initMobileCancelButton:function(){l.isNativeApp()&&o.registerOneTimeMessageHandler("closeNavigationButtonPressed",this.onClose.bind(this))},_mobileOnSubmit:function(){this._mobileDisabled||this.onSubmit()},setMobileDoneButtonDisabled:function(e){this._mobileDisabled=e,l.isNativeApp()?this.nativeSetPageAction(e):this.$nav.toggleClass("is_disabled",e)},nativeSetPageAction:function(e){l.isNativeApp()&&s&&s.send("setPageAction",{title:this.title_text,rightTextButton:{
title:this.done_text,disabled:e,callback:this._mobileOnSubmit.bind(this)}})},close:function(){this._originalClose&&this._originalClose(),r.handleClose(this)},onClose:function(){this.close()},submit:function(e){r.handleSubmit(this,e)},onSubmit:function(e){this.submit(e),this.close()}}),t.FormModal=t.ModalBase.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.child("form").registerOnSubmitSuccess(function(){e.registerOnFormSubmitSuccessExtra(),e.submit(),e.close()})},registerOnFormSubmitSuccessExtra:function(){},onSubmit:function(){this.child("form").submitForm()}})},"./unified_view/multifeed/_multifeed.js":function(e,t,i){var n,o=i("./shared/core/component.js").Component,s=i("./unified_view/toggle.js"),a=i("./shared/events/index.js"),r=i("./view/hover_menu.js");t.QuestionsInTopicHeader=o.extend({onLoad:function(){var e=this;e.handleEvent(a.Types.KNOWS_ABOUT_ADD_TOPIC,function(t){t.payload.tid==e.tid&&e.addKnowsAboutTopic()}),e.handleEvent(a.Types.KNOWS_ABOUT_REMOVE_TOPIC,function(t){
t.payload.tid==e.tid&&e.removeKnowsAboutTopic()})},addKnowsAboutTopic:function(){var e=this;e.serverCall("add_knowsabout_topic").kwargs({tid:e.tid}).liveMutate().send()},removeKnowsAboutTopic:function(){var e=this;e.serverCall("remove_knowsabout_topic").kwargs({tid:e.tid}).liveMutate().send()},showActionSheet:function(){var e=this;n.showActionSheet({buttonTitles:e.actionSheetTitles,destructiveButtonIndex:0,callback:function(t){if(e.is_knows_about_topic){if(0!=t)return;e.emitEvent({type:a.Types.KNOWS_ABOUT_REMOVE_TOPIC,payload:{tid:e.tid}})}else if(0==t)e.emitEvent({type:a.Types.KNOWS_ABOUT_ADD_TOPIC,payload:{tid:e.tid}});else{if(1!=t)return;e.emitEvent({type:a.Types.MULTIFEED_BUNDLE_REMOVE,payload:{tid:e.tid}})}}})}}),t.QuestionsInTopicWebOverflowLink=o.extend({onLoad:function(){var e=this;this.overflowMenu=new r.ToggleableMenu({$linkElem:this.$id("@bundle_action"),$menuElem:this.$id("@overflow_menu"),loadFunction:function(){},alignment:"right",clickOpen:!0,shouldAttachToBody:!0}),e.$id("@remove_knowsabout_topic").on("click",function(){
e.emitEvent({type:a.Types.KNOWS_ABOUT_REMOVE_TOPIC,payload:{tid:e.tid}})}),e.$id("@add_knowsabout_topic").on("click",function(){e.emitEvent({type:a.Types.KNOWS_ABOUT_ADD_TOPIC,payload:{tid:e.tid}})}),e.$id("@hide_topic_bundle").on("click",function(){e.emitEvent({type:a.Types.MULTIFEED_BUNDLE_REMOVE,payload:{tid:e.tid}})})}}),t.QuestionsInTopic=s.ToggleBase.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.handleEvent(a.Types.MULTIFEED_BUNDLE_REMOVE,function(t){t.payload.tid==e.tid&&e.hideBundle()})},hideBundle:function(){this.$id("@normal_state").addClass("hidden"),this.$id("@removed_state").removeClass("hidden"),this.serverCall("hide_bundle").kwargs({tid:this.tid}).send()}}),t.TopQuestionsForYouInNetwork=o.extend({onLoad:function(){var e=this;this.handleEvent(a.Types.MULTIFEED_TOP_QUESTIONS_FROM_NETWORK_HIDE,function(t){e.hideBundle()})},hideBundle:function(){this.$id("@normal_state").addClass("hidden"),this.$id("@removed_state").removeClass("hidden"),this.serverCall("hide_bundle").send();
}}),t.TopQuestionsForYouInNetworkHeader=o.extend({onLoad:function(){},showActionSheet:function(){var e=this;n.showActionSheet({buttonTitles:e.actionSheetTitles,callback:function(t){0==t&&e.emitEvent({type:a.Types.MULTIFEED_TOP_QUESTIONS_FROM_NETWORK_HIDE,payload:{}})}})}}),t.TopQuestionsForYouInNetworkWebOverflowLink=o.extend({onLoad:function(){var e=this;this.overflowMenu=new r.ToggleableMenu({$linkElem:this.$id("@bundle_action"),$menuElem:this.$id("@overflow_menu"),loadFunction:function(){},alignment:"right",clickOpen:!0,shouldAttachToBody:!0}),e.$id("@hide_bundle").on("click",function(){e.emitEvent({type:a.Types.MULTIFEED_TOP_QUESTIONS_FROM_NETWORK_HIDE,payload:{}})})}}),t.SuggestedAMAsBundle=o.extend({onLoad:function(){var e=this,t=e.$id("@start_session");t&&t.on("click",function(){e.createModal("open_session_modal").show()})}}),t.AmaSelfServeBundleHeader=o.extend({onLoad:function(){var e=this,t=e.$id("@stop_button");t&&t.on("click",function(){e.createModal("close_session_modal").show();
})}}),t.YourAnswerBundle=o.extend({onLoad:function(){this.serverCall("mark_answer_as_shown").send()}}),t.CarouselStoryBundle=o.extend({onLoad:function(){var e=this;e.carousel=e.$id("@carousel")}})},"./unified_view/multifeed/home.js":function(e,t,i){var n,o,s=i("./unified_view/paged_list.js").PagedList,a=i("./shared/client.js"),r=i("./shared/window_manager.js"),d=i("./shared/events/index.js");t.HomeMultifeed=s.extend({onLoad:function(){var e=this;if(this._super.apply(this,arguments),this.prefetchNativeTabs(),this.removeVisitParams(),this.should_show_mobile_nux){var t={name:"nux_redirect_url",value:window.location.href,options:{expires:1}};o.send("setCookie",t),this.showNUX(),n.registerMessageHandler("showNUX",function(){e.showNUX()})}this.handleEvent(d.Types.HOME_MULTIFEED_REFRESH,function(e){window.location.href="/"})},prefetchNativeTabs:function(){a.isNativeApp()&&n.registerOneTimeMessageHandler("pageReadyComplete",function(){setTimeout(function(){o.send("prefetchTabs")},500)})},removeVisitParams:function(){
var e=r.getURL();-1!=e.indexOf("?qp_story=")&&r.replaceURL("/")},showNUX:function(){setTimeout(function(){o.send("openURL",{url:"/nux/follow_topic",target:"nondismissable_modal",nux:!0})},1)}})},"./unified_view/multifeed/story.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js"),s=i("./shared/logging.js"),a=i("./unified_view/multifeed/view_tracker.js").viewTracker,r=i("./gating-webpack.js"),d=i("./shared/viewport.js"),l=i("./shared/fx.js");t.FeedStory=n.extend({onLoad:function(){if(this.initiallyVisible=a.isComponentVisible(this),this.waitUntilImpressionLogMs=2e3,this.setDvar("feed_story_hash",this.qfeed_log_hash),this.setDvar("feed_story_position",this.position),this.setDvar("bundle_position",this.bundle_position),this.setDvar("bundle_type",this.bundle_type),this.setDvar("feed_story_initial",this.initiallyVisible),this.setDvar("feed_ty",this.feed_ty),this.setDvar("feed_page",this.feed_page),this.setDvar("focus_ty",this.focus_ty),this.setDvar("page_data",this.page_data),
this.setDvar("enable_feed_logging",!0),this.storyHeight=this.$id("@item").outerHeight(),a.trackComponent(this,this.waitUntilImpressionLogMs),this.scroll_to_story){var e=this.$id("@item");d.scrollToElem(e),e.length&&!e.hasClass("feed_card")&&l.highlight(e.get(0),2e3)}},onEnterView:function(){var e={hash:this.qfeed_log_hash,initially_visible:this.initiallyVisible,position:this.position,bundle_position:this.bundle_position,bundle_type:this.bundle_type},t={uid:this.__js_init.uid,focus_ty:this.__js_init.focus_ty,feed_ty:this.__js_init.feed_ty,feed_page:this.__js_init.feed_page,page_data:this.__js_init.page_data};s.log("feed_impression",{request_data:[e],__js_data__:t,nid_override:this.__extra_args.nid_override}),r.qfeed_log_impression_debug&&console.log("feed_impression:",JSON.stringify(e,null,2));var i=this.getViewableElement();if(i){var n=i.getElementsByClassName("FeedReason");if(n.length>0){var o=n[0].getElementsByClassName("profile_photo_img");o.length>0&&s.log("feed_reason_image_impression_logger",{
bundle_position:this.bundle_position,feed_page:this.__js_init.feed_page,num_images:o.length,story_hash:this.qfeed_log_hash,uid:this.__js_init.uid})}}var a=i.getElementsByClassName("FeedQuestionFollowers");if(a.length>0){var d=a[0].getElementsByClassName("facepile");if(d.length>0){var l=d[0].getElementsByClassName("photo_tooltip");l.length>0&&s.log("feed_reason_image_impression_logger",{bundle_position:this.bundle_position,feed_page:this.__js_init.feed_page,num_images:l.length,story_hash:this.qfeed_log_hash,uid:this.__js_init.uid})}}},getViewableElement:function(){return this.$id("@item").get(0)},showDownvoteFeedback:function(e){var t=this;this.$id("@item").hasClass("hidden")||(t.$id("@item").addClass("hidden"),"question"==e?(t.$id("@question_feedback").height(t.storyHeight),t.$id("@question_feedback").removeClass("hidden"),t.questionFeedbackLoaded===!1&&t.serverCall("load_question_downvote_feedback").contentFor(t.$id("@question_feedback")).success(function(){t.questionFeedbackLoaded=!0}).send()):"answer"==e&&(t.$id("@answer_feedback").height(t.storyHeight),
t.$id("@answer_feedback").removeClass("hidden"),t.answerFeedbackLoaded===!1&&t.serverCall("load_answer_downvote_feedback").contentFor(t.$id("@answer_feedback")).success(function(){t.answerFeedbackLoaded=!0}).send()))},hideDownvoteFeedback:function(e){this.$id("@item").hasClass("hidden")&&(this.$id("@item").removeClass("hidden"),"question"==e?this.$id("@question_feedback").addClass("hidden"):"answer"==e&&this.$id("@answer_feedback").addClass("hidden"))},showNegativeFeedback:function(e,t,i,n){var o=this;this.$id("@item").hasClass("hidden")||(o.$id("@item").addClass("hidden"),o.$id("@negative_feedback_options").height(o.storyHeight).removeClass("hidden"),o.serverCall("load_negative_feedback").kwargs({oid:e,to_uid:t,tid:i,matched_condition:n}).contentFor(o.$id("@negative_feedback_options")).send())},showNegativeFeedbackMessage:function(e,t){var i=this,n=i.$id("@negative_feedback_options").outerHeight(),o=i.storyHeight;n>o&&(o=n),i.$id("@item").addClass("hidden"),i.$id("@negative_feedback_options").addClass("hidden"),
i.$id("@negative_feedback_message").height(o).removeClass("hidden"),i.serverCall("load_negative_feedback_message").kwargs({oid:e,message:t}).contentFor(i.$id("@negative_feedback_message")).send()},hideNegativeFeedback:function(){this.$id("@item").removeClass("hidden"),this.$id("@negative_feedback_options").addClass("hidden"),this.$id("@negative_feedback_message").addClass("hidden")}}),t.AnswerFeedStory=t.FeedStory.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),e.answerFeedbackLoaded=!1,e.questionFeedbackLoaded=!1,e.handleEvent(o.Types.ANSWER_VOTE_STATE,function(t){t.payload.aid==e.aid&&("downvoted"==t.payload.state?e.showDownvoteFeedback("answer"):e.hideDownvoteFeedback("answer"))}),e.handleEvent(o.Types.QUESTION_VOTE_STATE,function(t){t.payload.qid==e.qid&&("downvoted"==t.payload.state?e.showDownvoteFeedback("question"):e.hideDownvoteFeedback("question"))}),e.handleEvent(o.Types.FEED_NEGATIVE_FEEDBACK_STATE,function(t){t.payload.oid==e.aid&&("show_options"==t.payload.state?e.showNegativeFeedback(t.payload.oid,t.payload.to_uid,t.payload.tid,t.payload.matched_condition):"show_message"==t.payload.state?e.showNegativeFeedbackMessage(t.payload.oid,t.payload.message):"hide"==t.payload.state&&e.hideNegativeFeedback());
})}}),t.QuestionFeedStory=t.FeedStory.extend({onLoad:function(){var e=this;this._super.apply(this,arguments),e.questionFeedbackLoaded=!1,e.negativeFeedbackLoaded=!1,e.handleEvent(o.Types.QUESTION_VOTE_STATE,function(t){t.payload.qid==e.qid&&("downvoted"==t.payload.state?e.showDownvoteFeedback("question"):e.hideDownvoteFeedback("question"))}),this.handleEvent(o.Types.QUESTION_CANT_ANSWER_STATE,function(t){if(t.payload.qid==e.qid){var i="passed"==t.payload.state;e.$id("@item").toggleClass("cant_answer",i)}}),e.handleEvent(o.Types.FEED_NEGATIVE_FEEDBACK_STATE,function(t){t.payload.oid==e.qid&&("show_options"==t.payload.state?e.showNegativeFeedback(t.payload.oid,t.payload.to_uid,t.payload.tid,t.payload.matched_condition):"show_message"==t.payload.state?e.showNegativeFeedbackMessage(t.payload.oid,t.payload.message):"hide"==t.payload.state&&e.hideNegativeFeedback())})}})},"./unified_view/multifeed/view_tracker.js":function(e,t,i){var n=i("./shared/core/component.js"),o=i("./shared/Class.js").Class,s=i("./shared/errors.js"),a=i("./shared/debounce.js").throttle,r=i("./shared/viewport.js"),d=i("./gating-webpack.js"),l=1e3,c=new Date,u=o.extend({
__init__:function(){this.debugView=d.view_tracker_debug,this.throttledLogViews=a(this.logViews.bind(this),l),document.addEventListener("scroll",this.throttledLogViews),document.addEventListener("mousemove",this.throttledLogViews),document.addEventListener("keypress",this.throttledLogViews),this.trackedComponentCids=[],this.alreadyLoggedCids={}},trackComponent:function(e,t){var i=this;if(t||(t=0),!e.getViewableElement)return void s.logJsError("ViewTracker","Component "+e.cid+" must implement getViewableElement");if(!e.onEnterView)return void s.logJsError("ViewTracker","Component "+e.cid+" must implement onEnterView");var n=new Date-c,o=Math.max(0,t-n);setTimeout(function(){i.delayedTrackComponent(e)},o)},delayedTrackComponent:function(e){this.trackedComponentCids.push(e.cid),this.throttledLogViews()},logViews:function(){for(var e=0;e<this.trackedComponentCids.length;e++){var t=this.trackedComponentCids[e],i=n._safeGetComponentByCID(t),o=this.isComponentVisible(i),s=i.getViewableElement();
this.debugView&&(o?s.classList.add("__debug_background"):s.classList.remove("__debug_background")),this.alreadyLoggedCids[t]||o&&(i.onEnterView(),this.alreadyLoggedCids[t]=!0,this.debugView&&s.classList.add("__debug_border"))}},isComponentVisible:function(e){var t=e.getViewableElement();return r.isElementInViewport(t)}});t.viewTracker=new u},"./unified_view/multifeed/write.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.EditKnowsAboutTopicsSection=n.extend({onLoad:function(){var e=this;e.$id("@add_topics_link").on("click",function(){e.createModal("load_modal").show()})}})},"./unified_view/network/admin.js":function(e,t,i){var n=i("./unified_view/question/ask_question.js").AskQuestionSelector;t.AdminA2AQuestionSelector=n.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.minWords=1,e.delay=200}})},"./unified_view/network/invite.js":function(e,t,i){var n=i("./shared/events/index.js"),o=i("./unified_view/modal.js").ModalBase,s=(i("./shared/modal.js"),i("./shared/core/component.js").Component);
t.InviteModalLink=s.extend({onLoad:function(){var e=this;e.$id("@link").on("click",function(){e.createModal("load_modal").show()})}}),t.InviteForm=s.extend({onLoad:function(){var e=this;this.handleEvent(n.Types.NETWORK_INVITE_USER,function(t){t.payload.uid?e.setToUser(t.payload.uid):t.payload.email&&e.performInviteActionToEmail(t.payload.email)})},setToUser:function(e){this.serverCall("perform_invite_existing_user_action").kwargs({invitee_uid:e}).success(this.onSuccessfulInvite.bind(this)).liveMutate().send()},onSuccessfulInvite:function(){this.child("selector")&&this.child("selector").setQuery("")},performInviteActionToEmail:function(e){this.serverCall("perform_invite_action").kwargs({email:e}).success(this.onSuccessfulInvite.bind(this)).liveMutate().send()}}),t.InviteModal=o.extend({onUnload:function(){}}),t.DontKnowLanguageLink=s.extend({onLoad:function(){var e=this;e.$id("@dont_know_language").on("click",function(){e.serverCall("mark_as_dont_know").liveMutate().send()}),e.$id("@unmark_dont_know_language").on("click",function(){
e.serverCall("unmark_as_dont_know").liveMutate().send()})}}),t.DontKnowLanguageLinkModal=t.DontKnowLanguageLink.extend({onLoad:function(){var e=this;e.$id("@dont_know_language").on("click",function(){e.serverCall("mark_as_dont_know").liveMutate().success(function(){e.dismissModal()}).send()})},dismissModal:function(){this.emitEvent({type:n.Types.NETWORK_JOIN_MODAL,payload:{hideModal:!0,hasBeenMarkedAsDecideLater:!0}})}})},"./unified_view/network/join.js":function(e,t,i){var n,o=i("./shared/core/component.js").Component,s=i("./shared/events/index.js"),a=i("./unified_view/modal.js").ModalBase;t.SwitchableWithLoginForms=o.extend({onLoad:function(){var e=this;this.handleEvent(s.Types.NETWORK_BETA_LOGIN_FORM_STATE,function(t){t.payload.showLogin?e.showLoginForm():e.showNonLoginForm()})},showLoginForm:function(){this.$id("@non_login_form").addClass("hidden"),this.$id("@login_form").removeClass("hidden")},showNonLoginForm:function(){this.$id("@non_login_form").removeClass("hidden"),this.$id("@login_form").addClass("hidden");
}}),t.LoggedOutMainBase=o.extend({onLoad:function(){}}),t.PublicRequestForm=o.extend({onLoad:function(){var e=this;e.$email=e.$id("@email"),e.$first_name=e.$id("@first_name"),e.$last_name=e.$id("@last_name"),e.$bio=e.$id("@bio"),e.handleEvent(s.Types.NETWORK_BETA_WAITLIST_FORM_STATE,function(t){t.payload.email&&e.$email.val(t.payload.email),t.payload.first_name&&e.$first_name.val(t.payload.first_name),t.payload.last_name&&e.$last_name.val(t.payload.last_name),e.showLoginAttemptFailedDescription(),e.updateButton()}),e.$email.on("input",function(){e.updateButton()}),e.$first_name.on("input",function(){e.updateButton()}),e.$last_name.on("input",function(){e.updateButton()}),e.$bio.on("input",function(){e.updateButton()}),e.$id("@submit").on("click",function(){e.sendRequest()}),e.$id("@login").on("click",function(){e.showLoginForm()}),e.$id("@login2").on("click",function(){e.showLoginForm()})},showLoginForm:function(){this.emitEvent({type:s.Types.NETWORK_BETA_LOGIN_FORM_STATE,payload:{showLogin:!0
}})},showLoginAttemptFailedDescription:function(){this.$id("@login_attempt_failed").removeClass("hidden")},updateButton:function(){var e=this;e.$email.val().length>0&&e.$first_name.val().length>0&&e.$last_name.val().length>0&&e.$bio.val().length>0?e.$id("@submit").removeClass("disabled"):e.$id("@submit").addClass("disabled")},sendRequest:function(){var e=this,t=e.$email.val(),i=e.$first_name.val()+" "+e.$last_name.val(),n=e.$bio.val();e.serverCall("request").kwargs({email:t,name:i,bio:n}).contentFor(e.$id("@request_form_content")).send()}}),t.EmailRequestInlineFeedback=o.extend({onLoad:function(){var e=this;this.$id("@login").on("click",function(){e.emitEvent({type:s.Types.NETWORK_BETA_LOGIN_FORM_STATE,payload:{showLogin:!1}})})}});var r=t.LoggedInJoinSiloPromptLink=o.extend({onLoad:function(){var e=this;e.setLinkHandler(),e.should_show_modal_on_load&&e.showModal()},setLinkHandler:function(){var e=this;e.$id("@link").on("click",function(){e.showModal()})},showModal:function(){var e=this;
e.can_show_modal?e.createModal("load_desktop").show():document.location=e.fallback_redirect_url_if_cannot_show_modal}});t.LoggedInJoinSiloPromptLinkAuto=t.LoggedInJoinSiloPromptLink.extend({showModal:function(){var e=this;e.createModal("load_desktop").webOnlyOptions({closeOnBackgroundClick:!1,closeOnEscape:!1}).show()}}),t.MobileAppLoggedInJoinSiloPromptPageAction=r.extend({setLinkHandler:function(){var e=this;e.setModalLinkState(!1),e.handleEvent(s.Types.NETWORK_JOIN_MODAL,function(t){t.payload.modalShown?e.setModalLinkState(!0):t.payload.modalDismissed&&e.setModalLinkState(!1)})},setModalLinkState:function(e){n.send("setPageAction",{rightTextButton:{title:this.join_text,callback:this.showModal.bind(this),disabled:e}})}}),t.DesktopLoggedInJoinSiloModal=a.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.handleEvent(s.Types.NETWORK_JOIN_MODAL,function(t){t.payload.showModal||(t.payload.hasBeenMarkedAsDecideLater?e.close():e.onClose())})},onClose:function(){var e=this;e.serverCall("mark_as_decide_later").success(function(){
e.close()}).send()}}),t.MobileLoggedInJoinSiloModalWrapper=o.extend({onLoad:function(){var e=this;e.$id("@background").on("click",function(){e.dismissModal(!0)}),e.handleEvent(s.Types.NETWORK_JOIN_MODAL,function(t){t.payload.showModal?e.showModal():t.payload.hideModal&&e.dismissModal(!t.payload.hasBeenMarkedAsDecideLater)})},showModal:function(){var e=this;e.$id("@wrapper").addClass("show");var t=e.$id("@modal_wrapper");t.html().length||e.serverCall("load_modal").contentFor(t).send(),e.emitEvent({type:s.Types.NETWORK_JOIN_MODAL,payload:{modalShown:!0}})},_hideWrapper:function(){var e=this;e.$id("@wrapper").addClass("animate_out"),setTimeout(function(){e.$id("@wrapper").removeClass("show"),e.$id("@wrapper").removeClass("animate_out")},200),e.emitEvent({type:s.Types.NETWORK_JOIN_MODAL,payload:{modalDismissed:!0}})},dismissModal:function(e){var t=this;e?t.serverCall("mark_as_decide_later").success(function(){t._hideWrapper()}).send():t._hideWrapper()}}),t.MobileLoggedInJoinSiloModalWrapperLinkAuto=t.MobileLoggedInJoinSiloModalWrapper.extend({
onLoad:function(){var e=this;e.should_show_modal_on_load&&e.showModal(),e.handleEvent(s.Types.NETWORK_JOIN_MODAL,function(t){t.payload.hideModal&&e.dismissModal(!t.payload.hasBeenMarkedAsDecideLater)})}});var d=t.MobileLoggedInJoinSiloModal=o.extend({onLoad:function(){var e=this;e.$id("@close").on("click",function(){e.emitEvent({type:s.Types.NETWORK_JOIN_MODAL,payload:{hideModal:!0,hasBeenMarkedAsDecideLater:!1}})})}});t.MobileLoggedInJoinSiloModalForSilo=d.extend({onLoad:function(){var e=this;e.$id("@close").on("click",function(){e.serverCall("mark_as_decide_later").send(),e.emitEvent({type:s.Types.NETWORK_JOIN_MODAL,payload:{hideModal:!0,hasBeenMarkedAsDecideLater:!0}})})}}),t.LoggedInJoinSiloPrompt=o.extend({onLoad:function(){var e=this;e.$id("@decide_later").on("click",function(){e.serverCall("mark_as_decide_later").success(function(){e.dismissModal()}).send()}),e.$id("@mark_as_do_not_know").on("click",function(){e.serverCall("mark_as_do_not_know").success(function(){e.dismissModal();
}).send()})},dismissModal:function(){this.emitEvent({type:s.Types.NETWORK_JOIN_MODAL,payload:{hideModal:!0,hasBeenMarkedAsDecideLater:!0}})}}),t.JoinSuggestedNetworksSidebar=o.extend({onLoad:function(){var e=this;e.$id("@dismiss").on("click",function(t){t.preventDefault(),e.serverCall("dismiss").success(function(){e.$id("@wrapper").addClass("hidden")}).liveMutate().send()})}})},"./unified_view/network/login.js":function(e,t,i){var n=i("./unified_view/signup/_signup.js").BaseSignupForm,o=i("./shared/events/index.js"),s=i("./unified_view/signup/facebook.js").SignupFacebookConnectButton,a=i("./unified_view/signup/google.js").SignupGoogleConnectButton;t.LoginOnlyForm=n.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.$id("@cancel_login").on("click",function(){e.emitEvent({type:o.Types.NETWORK_BETA_LOGIN_FORM_STATE,payload:{showLogin:!1}})})}}),t.LoginFacebookConnectButton=s.extend({onConnectSucceeded:function(e){var t=e,i=this;t.onFailure=function(e){i.emitEvent({type:o.Types.NETWORK_BETA_WAITLIST_FORM_STATE,
payload:{email:e.facebookOauthData.email,name:e.facebookOauthData.name}}),i.emitEvent({type:o.Types.NETWORK_BETA_LOGIN_FORM_STATE,payload:{showLogin:!1}})},this.signupContext.set("facebookOauthData",t)}}),t.LoginGoogleConnectButton=a.extend({_setGoogleOauthDataOnConnectSucceeded:function(e){var t=e,i=this;t.onFailure=function(e){i.emitEvent({type:o.Types.NETWORK_BETA_WAITLIST_FORM_STATE,payload:{email:e.googleOauthData.email,name:e.googleOauthData.name}}),i.emitEvent({type:o.Types.NETWORK_BETA_LOGIN_FORM_STATE,payload:{showLogin:!1}})},this.signupContext.set("googleOauthData",t)}})},"./unified_view/network/signup.js":function(e,t,i){var n=i("./unified_view/signup/_signup.js").BaseSignupForm,o=i("./shared/core/component.js").Component,s=i("./shared/events/index.js"),a=(i("./shared/client.js"),i("./unified_view/signup/_signup.js").SignupContext);t.HomepageSignupNetworkRedirectLink=o.extend({onLoad:function(){var e=this;this.$id("@link").on("click",function(){e.serverCall("mark_clicked").success(function(){
window.location.href=e.destinationUrl}).send()})}}),t.SignupWithCodeForm=n.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.SignupContext=e.getContext(a),e.signupContext.set("emailSubmitButton",e.$id("@submit")),e.SignupContext.on("showEmailSignup",function(t,i){i?e.showEmailSignupForm():e.hideEmailSignupForm()}),e.$id("@login").on("click",function(){e.emitEvent({type:s.Types.NETWORK_BETA_LOGIN_FORM_STATE,payload:{showLogin:!0}})}),e.$id("@cancel_signup_with_email").on("click",function(){e.SignupContext.set("showEmailSignup",!1)})},showEmailSignupForm:function(){this.$id("@email_signup_form").removeClass("hidden"),this.$id("@social_signup_form").addClass("hidden")},hideEmailSignupForm:function(){this.$id("@email_signup_form").addClass("hidden"),this.$id("@social_signup_form").removeClass("hidden")}}),t.SignupWithEmailButton=o.extend({onLoad:function(){var e=this;e.SignupContext=e.getContext(a),this.$id("@button").on("click",function(){e.SignupContext.set("showEmailSignup",!0);
})}})},"./unified_view/network/switcher.js":function(e,t,i){var n,o,s,a=i("./shared/core/component.js").Component;t.MobileNetworkSwitcherActionSheetSetter=a.extend({onLoad:function(){var e=this;e.$id("@link").on("click",function(t){t.preventDefault(),n.showActionSheet({buttonTitles:e.actionSheetTitles,callback:function(t){t>=e.actionSheetTitles.length||e.maybeSwitchNetwork(t)}})})},maybeSwitchNetwork:function(e){var t=this.destinationData[e];s.isMobileWeb()?window.location=t.url:t.is_member?n.updateConfig(t.subdomain,t.language):o.send("openURL",{target:"modal",url:t.url})}}),t.NativeSwitcherSetter=a.extend({onLoad:function(){o.send("updateSiloSwitcher",this.data)}})},"./unified_view/notifications.js":function(e,t,i){var n=i("./unified_view/paged_list.js").PagedList;i("./shared/events/index.js");t.NotificationsListContentsBaseUnified=n.extend({resyncButtonPressed:function(){this._super.apply(this,arguments),this.serverCall("clear_notif_badge").send()}}),t.AllNotificationsListContentsUnified=t.NotificationsListContentsBaseUnified.extend({
onLoad:function(){this._super.apply(this,arguments)}})},"./unified_view/nux.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./unified_view/modal.js").ModalBase;t.NuxModal=o.extend({onLoad:function(){var e=this;e.submit=this.$id("@submit"),e.next=this.$id("@next"),e.skip=this.$id("@skip"),e.title=this.$id("@modal_title"),e.content=this.$id("@content"),e.currentStep=-1,e.submit.addClass("hidden"),this._super.apply(this),e.next.on("click",function(t){t.preventDefault(),e.loadStepData()}),e.skip.on("click",function(t){t.preventDefault(),e.loadStepData()}),e.loadStepData()},updateTitle:function(e){this.title.text(e)},showSkip:function(){this.skip.removeClass("hidden")},hideSkip:function(){this.skip.addClass("hidden")},showFinish:function(){this.next.addClass("hidden"),this.submit.removeClass("hidden")},onSubmit:function(){this.close()},loadStepData:function(){var e=this;this.currentStep++;var t=this[this.step_order[this.currentStep]];e.serverCall(t.content).contentFor(e.content).liveMutate().success(function(){
e.updateTitle(t.title),t.allow_skip?e.showSkip():e.hideSkip(),e.currentStep==e.step_order.length-1&&e.showFinish()}).send()}}),t.NuxLink=n.extend({onLoad:function(){this.$id("@create_dialog_link").on("click",this.loadModal.bind(this))},loadModal:function(){this.createModal("load_modal").show()}})},"./unified_view/old_anon_content.js":function(e,t,i){var n=i("./unified_view/form.js").Form;t.OldAnonContentEmailForm=n.extend({onLoad:function(){var e=this;e._super.apply(e,arguments)},validateFormExtra:function(e){var t,i=this;return i.children().forEach(function(e){e.getFieldId&&(t=e.getValue())}),i.serverCall("check_validity").kwargs({email:t}).success(function(e){e?i._submitForm():i.serverCall("display_error_message").send()}).liveMutate().send(),!1}})},"./unified_view/paged_list.js":function(module,exports,__webpack_require__){var Component=__webpack_require__("./shared/core/component.js").Component,coreComponent=__webpack_require__("./shared/core/component.js"),$=__webpack_require__("./shared/jquery.js"),debounce=__webpack_require__("./shared/debounce.js").debounce,events=__webpack_require__("./shared/events/index.js"),scrollAnimationHandler=__webpack_require__("./shared/scroll_animation_handler.js"),loading=__webpack_require__("./shared/loading.js"),perf=__webpack_require__("./shared/perf.js"),util=__webpack_require__("./shared/util.js"),context=__webpack_require__("./shared/w2.context.js"),viewport=__webpack_require__("./shared/viewport.js"),fx=__webpack_require__("./shared/fx.js"),messages,client;
exports.PagedList=Component.extend({spinner:null,resyncIndex:null,updatedHashesDuringResync:null,elementsToDelete:null,scrollHandler:null,pagingInProgress:!1,onLoad:function(){this.$paged_list=this.$id("@paged_list"),this.$wrapper=this.$id("@paged_list_wrapper"),this.$container=this.$getContainer(),this.$spinnerDisplayArea=this.$id("@spinner"),this.$resyncButton=this.$id("@resync"),this.$resyncButtonWrapper=this.$id("@resync_wrapper"),this.$resyncButton.on("click",this.resyncButtonPressed.bind(this)),this.$moreButton=this.$id("@more"),this.$moreButton.on("click",this.moreButtonPressed.bind(this));var e=this.getContext(context.HoverMenu);e?(this.inHoverMenu=!0,e.on("isShown",this.onVisiblityChange.bind(this)),this.isVisible=e.get("isShown")):(this.isVisible=!0,this.inHoverMenu=!1),this.setupPaging(),this.maybeRetargetLinks(),this.enable_mobile_hide_content&&this.mapOverNodesBelowList(function(e){$(e).addClass("paged_list_hidden_footer")}),this.debug_show_resync&&this.showResyncButton()},
onVisiblityChange:function(e,t){this.isVisible=t,this.isVisible||null===this.resyncIndex||this.performResync(),this.scrollHandler&&this.scrollHandler()},$getContainer:function(){var e=util.firstScrollingParent(this.$wrapper.get(0));return e===document.body&&(e=window),$(e)},getContainerBottom:function(){return this.$container.height()+this.$container.scrollTop()},setScrollHandler:function(e){null!==this.scrollHandler&&this.$container.off("scroll",this.scrollHandler),null!==e&&this.$container.on("scroll",e),this.scrollHandler=e},setupPaging:function(){this.has_more?this.auto_paged?(this.bindAutoPaging(),this.$moreButton.addClass("hidden"),this.showLoading()):(this.hideLoading(),this.$moreButton.removeClass("hidden")):this.onPagingDone()},calculateAutoPageHeight:function(){var e=this.getContainerBottom(),t=this.$wrapper.height(),i=.1*(t-e)+e-100,n=t-4e3;return Math.max(i,n)},bindAutoPaging:function(){var e=this,t=function(){var t=e.calculateAutoPageHeight();e.getContainerBottom()>=t&&e.isVisible&&(e.setScrollHandler(null),
e.bindAutoPagePerfLogging(),e.requestNextPage())},i=debounce(t,200,{leading:!0,maxWait:500});e.setScrollHandler(i),t()},bindAutoPagePerfLogging:function(){var e=this,t=debounce(function(){e.getContainerBottom()>e.$wrapper.height()&&(e.setScrollHandler(null),e.startUserPerceivedAction())},50,{leading:!0});e.setScrollHandler(t),t()},requestNextPage:function(e){var t=this;t.pagingInProgress||(t.pagingInProgress=!0,t.serverCall("get_next_page").kwargs({paged_list_parent_cid:t.parent().cid,client_hashes:t.hashes,force_cid:t.cid,domids_to_remove:t.domIdsToDelete()}).success(function(i){t.pagingInProgress=!1,t.appendPage(i,e)}).error(function(){t.pagingInProgress=!1,t.onPagingDone(!0)}).send())},domIdsToDelete:function(){for(var e=[],t=this.elementsToDelete||[],i=0;i<t.length;i++)e.push(t[i].id);return e},startUserPerceivedAction:function(){this.userPerceivedAction||(this.userPerceivedAction=perf.startUserPerceived({vcon:this.__vcon,method:"get_next_page"}))},finishUserPerceivedAction:function(){
this.startUserPerceivedAction(),perf.finishAction(this.userPerceivedAction),this.userPerceivedAction=null},appendPage:function(data,highlight){var fragment=util.documentFragmentFromString(data.html),originalNumItems=this.hashes.length,W2,item;this.has_more=data.has_more,this.hashes=this.hashes.concat(data.hashes),this.$wrapper.get(0).appendChild(fragment),W2=__webpack_require__("./webnode2.js"),eval(data.js),null===this.scrollHandler?this.finishUserPerceivedAction():this.setScrollHandler(null),this.removeComponentsToDelete(),this.setupPaging(),this.maybeRetargetLinks(),this.handleModelUpdates(this.updatedHashesDuringResync),highlight&&(item=this.$wrapper.get(0).children[originalNumItems],0!==originalNumItems&&fx.highlight(item,2e3))},showLoading:function(){null===this.spinner&&(this.spinner=loading.createDots(),this.$spinnerDisplayArea.append(this.spinner)),this.$spinnerDisplayArea.removeClass("hidden")},hideLoading:function(){this.$spinnerDisplayArea.addClass("hidden")},onPagingDone:function(e){
this.hideLoading(),e&&(this.$moreButton.removeClass("hidden"),this.resyncIndex&&window.location.href.reload()),this.enable_mobile_hide_content&&this.mapOverNodesBelowList(function(e){$(e).removeClass("paged_list_hidden_footer")})},handleModelUpdates:function(e){if(e){if(null!==this.elementsToDelete)return void(this.updatedHashesDuringResync=e);this.updatedHashesDuringResync=null;var t=firstNewItemIndex(this.hashes,e);return null===t?void this.hideResyncButton():t>=this.hashes.length?(this.has_more===!1&&(this.has_more=!0,this.setupPaging()),void this.hideResyncButton()):(this.resyncIndex=t,this.resyncIndexIsBelowViewport()?void this.performResync(!1):void this.showResyncButton())}},$getChildAtIndex:function(){var e=this.$wrapper.get(0),t=e.children[this.resyncIndex];return $(t)},resyncIndexIsBelowViewport:function(){if(!this.isVisible)return!0;if(null===this.resyncIndex)return!1;var e=this.$getChildAtIndex(this.resyncIndex);return e.offset().top>this.getContainerBottom()},performResync:function(e){
if(this.hideResyncButton(),null!==this.resyncIndex){if(this.emitEvent({type:events.Types.LIVENODE_LOADING_SPINNER,payload:{show:!0}}),this.$paged_list.addClass("resyncing"),e&&this.resyncIndex<this.hashes.length){var t=this.$getChildAtIndex(this.resyncIndex),i=0;this.$container.get(0)!==window&&(i=this.$container.offset().top);var n=200,o=t.offset().top-i-n;this.$container.scrollTop(o)}this.markComponentsToDelete(this.resyncIndex),this.resyncIndex=null,this.requestNextPage(!0)}},showResyncButton:function(){var e=this,t=e.$container.get(0);if(!e.inHoverMenu){e.$resyncButtonWrapper.removeClass("hidden");var i=function(i){var n,o,s;t===window?(n=viewport.siteHeaderHeight(),o=e.$wrapper.offset().top):(n=0,o=0),s=o+e.$wrapper.height()-2*e.$resyncButton.height(),i+=n,o>i?e.$resyncButtonWrapper.css("position","absolute").css("top",0).css("width","100%"):i>s?e.$resyncButtonWrapper.css("position","absolute").css("top",s-o).css("width","100%"):e.$resyncButtonWrapper.css("position","fixed").css("top",n).css("width",e.$wrapper.width());
};e.resyncButtonScrollCallback=scrollAnimationHandler.add(t,i)}},hideResyncButton:function(){this.debug_show_resync||this.resyncButtonScrollCallback&&(this.$resyncButtonWrapper.addClass("hidden"),this.$container.off("scroll",this.resyncButtonScrollCallback))},resyncButtonPressed:function(){this.performResync(!0)},markComponentsToDelete:function(e){this.hashes=this.hashes.slice(0,e);var t,i,n=this.$wrapper.get(0),o=n.children;for(this.elementsToDelete=[],i=e;i<o.length;i++)t=o[i],this.elementsToDelete.push(t)},removeComponentsToDelete:function(){var e,t,i,n=this.$wrapper.get(0),o=this.elementsToDelete||[];for(this.elementsToDelete=null,i=0;i<o.length;i++)e=o[i],t=coreComponent.getComponentFromElement(e),t&&coreComponent.unloadComponent(t.cid),n.removeChild(e);o&&(this.emitEvent({type:events.Types.LIVENODE_LOADING_SPINNER,payload:{show:!1}}),this.$paged_list.removeClass("resyncing"))},moreButtonPressed:function(){this.$moreButton.addClass("hidden"),this.showLoading(),this.requestNextPage();
},maybeRetargetLinks:function(){this.retarget_links&&this.$id('@paged_list_wrapper a:not([href^="#"])').each(function(){"feed_modal"!=this.target&&$(this).attr("target","_blank")})},mapOverNodesBelowList:function(e){for(var t=this.$spinnerDisplayArea.get(0).nextSibling;t;)if(e(t),t.nextSibling)t=t.nextSibling;else{if(!t.parentNode||"main_page_wrapper"==t.parentNode.id)break;t=t.parentNode.nextSibling}},forceResync:function(e){e=e?e:0,this.resyncIndex=e,this.setScrollHandler(null),this.performResync(!0)}}),exports.InvisibleUpdater=Component.extend({onLoad:function(e){e||this.parent().handleModelUpdates(this.hashes)}});var firstNewItemIndex=exports.firstNewItemIndex=function(e,t){var i,n={};for(i=0;i<e.length;i++)n[e[i]]=!0;for(i=0;i<t.length;i++)if(!n[t[i]])return i;return null}},"./unified_view/payment/_payment.js":function(e,t,i){function n(e,t){var i;i="keydown paste change",e&&e.on(i,function(i){setTimeout(function(){var i=e.val(),n=t(i);i!==n&&e.val(n)},1)})}var o=i("./shared/core/component.js").Component,s=i("./shared/stripeLoader.js"),a=i("./shared/jquery.js");
t.PaymentMethod=o,t.AddCardForm=o.extend({onLoad:function(){s.load();var e=this;e.$name=e.$id("@name"),e.$number=e.$id("@number"),e.$expiry=e.$id("@expiry"),e.$cvc=e.$id("@cvc"),e.$zip=e.$id("@zip"),e.cardType=null,e.isSubmitting=!1,n(e.$number,function(t){var i=Stripe.card.cardType(t);switch(i){case"Unknown":i=null;break;case"American Express":i="amex";break;case"Diners Club":i="diners";break;default:i=i.toLowerCase().replace(/\s+/g,"")}e._setCardType(i);var n=t.replace(/[^0-9]/g,"");return n="amex"===i?(n.slice(0,4)+" "+n.slice(4,10)+" "+n.slice(10,n.length)).trim():(n.slice(0,4)+" "+n.slice(4,8)+" "+n.slice(8,12)+" "+n.slice(12,n.length)).trim()}),n(e.$expiry,function(e){var t=e.replace(/[^0-9]/g,"");return" /"===e.slice(2,e.length)?t[0]:(1===t.length&&("0"!==t[0]&&"1"!==t[0]||2===e.length&&"1"===t[0]&&(" "===e[1]||isNaN(e[1])))&&(t="0"+t),t.length>1&&(t=t.slice(0,2)+" / "+t.slice(2,t.length)),t)}),n(e.$cvc,function(e){return e.replace(/[^0-9]/g,"")})},getExpiryMonth:function(){return this.$expiry.val().replace(/[^0-9]/g,"").slice(0,2);
},getExpiryYear:function(){var e=this.$expiry.val();return e.replace(/[^0-9]/g,"").slice(2,e.length)},getEmail:function(){return this.$email.length?this.$email.val():void 0},submit:function(e){var t=this;t.isSubmitting||(t.isSubmitting=!0,document.activeElement.blur(),t._getStripeToken(function(i,n){t.serverCall("submit").kwargs({stripe_response:n,source_type:t.source_type,source_id:t.source_id}).success(function(i){var n;n=i,n?(t.isSubmitting=!1,e()):t.isSubmitting=!1}).error(function(){t.isSubmitting=!1,t.showServerError()}).liveMutate().send()}))},showServerError:function(){this.serverCall("show_error_pmsg").send()},_getStripeToken:function(e){Stripe.card.createToken({name:this.$name.val(),number:this.$number.val(),exp_month:this.getExpiryMonth(),exp_year:this.getExpiryYear(),cvc:this.$cvc.val(),address_zip:this.$zip.val(),currency:"usd"},e)},_setCardType:function(e){this.cardType!==e&&(this.cardType&&this.$number.removeClass(this.cardType),this.cardType=e,this.cardType&&this.$number.addClass(this.cardType),
"amex"===this.cardType?this.$number.attr("maxlength","17"):this.$number.attr("maxlength","19"))}}),t.AddBankForm=o.extend({onLoad:function(){s.load();var e=this;e.$form=e.$id("@form"),e.$name=e.$id("@name"),e.$country=e.$id("@country"),e.$routing_1_row=e.$id("@routing_1_row"),e.$routing_1_label=e.$id("@routing_1_label"),e.$routing_1=e.$id("@routing_1"),e.$routing_2_row=e.$id("@routing_2_row"),e.$routing_2_label=e.$id("@routing_2_label"),e.$routing_2=e.$id("@routing_2"),e.$currency_row=e.$id("@currency_row"),e.$currency=e.$id("@currency"),e.$account_row=e.$id("@account_row"),e.$account_label=e.$id("@account_label"),e.$account=e.$id("@account"),e.$us_tax_info=e.$id("@us_tax_info"),e.taxFormShown=!1,e.$dob=e.$id("@dob"),e.$address_line1=e.$id("@address_line1"),e.$address_city=e.$id("@address_city"),e.$address_state=e.$id("@address_state"),e.$address_postal_code=e.$id("@address_postal_code"),e.$ssn=e.$id("@ssn"),e.$i18n_verify=e.$id("@i18n_verify"),e.verifyFormShown=!1,e.$dob_year_first=e.$id("@dob_year_first"),
e.$i18n_address_line1=e.$id("@i18n_address_line1"),e.$i18n_address_city=e.$id("@i18n_address_city"),e.$i18n_address_state=e.$id("@i18n_address_state"),e.$i18n_address_postal_code=e.$id("@i18n_address_postal_code"),e.$i18n_address_country=e.$id("@i18n_address_country"),e.$country.on("change",function(t){e.switchCountry(e.$country.val()),"US"===e.countryCode?(e.showVerifyForm(!1),e.$account.val().length>0&&e.showTaxForm(!0),e.$dob_year_first.val(""),e.$i18n_address_line1.val(""),e.$i18n_address_city.val(""),e.$i18n_address_state.val(""),e.$i18n_address_postal_code.val("")):(e.showTaxForm(!1),e.$account.val().length>0&&e.showVerifyForm(!0),e.$ssn.val(""),e.$dob.val(""),e.$address_line1.val(""),e.$address_city.val(""),e.$address_state.val(""),e.$address_postal_code.val(""))}),n(e.$routing_1,function(t){return e._fireOnEdit(),t.replace(/[^0-9]/g,"")}),n(e.$routing_2,function(t){return e._fireOnEdit(),t.replace(/[^0-9]/g,"")}),n(e.$account,function(t){return e._fireOnEdit(),!e.taxFormShown&&"US"===e.countryCode&&e.$account.val().length>0?e.showTaxForm(!0):!e.verifyFormShown&&"US"!==e.countryCode&&e.$account.val().length>0&&e.showVerifyForm(!0),
e.inputs().account_numbers_only?t.replace(/[^0-9]/g,""):t.replace(/\s/g,"")}),n(e.$ssn,function(e){var t=e.replace(/[^0-9]/g,"");return t=t.slice(0,3)+"-"+t.slice(3,5)+"-"+t.slice(5,t.length),t.endsWith("--")?t=t.slice(0,t.length-2):t.endsWith("-")&&(t=t.slice(0,t.length-1)),t}),n(e.$dob,function(e){var t=e.replace(/[^0-9]/g,"");" /"===e.slice(-2)&&(t=t.slice(0,t.length-1));var i=t.slice(0,2),n=parseInt(i,10);(n>12||i.length<2&&n>1)&&(t="0"+t);var o=t.slice(2,4),s=parseInt(o,10);(s>31||o.length<2&&s>3)&&(t=t.slice(0,2)+"0"+t.slice(2,t.length));var a=t.slice(4,6);if(2==a.length&&"19"!=a&&"20"!=a){var r="19";parseInt(a,10)<16&&(r="20"),t=t.slice(0,4)+r+t.slice(4,t.length)}var d=t.slice(0,2);return t.length>=2&&(d+=" / "+t.slice(2,4)),t.length>=4&&(d+=" / "+t.slice(4,t.length)),d}),n(e.$dob_year_first,function(e){var t=e.replace(/[^0-9]/g,"");" /"===e.slice(-2)&&(t=t.slice(0,t.length-1));var i=t.slice(0,2);if(2==i.length&&"19"!=i&&"20"!=i){var n="19";parseInt(i,10)<16&&(n="20"),t=n+i+t.slice(4,t.length);
}var o=t.slice(4,6),s=parseInt(o,10);(s>12||o.length<2&&s>1)&&(t=t.slice(0,4)+"0"+o+t.slice(6,t.length));var a=t.slice(6,t.length),r=parseInt(a,10);(r>31||a.length<2&&r>3)&&(t=t.slice(0,6)+"0"+a);var d=t.slice(0,4);return t.length>=4&&(d+=" / "+t.slice(4,6)),t.length>=6&&(d+=" / "+t.slice(6,t.length)),d}),n(e.$address_state,function(e){return e.replace(/[^a-zA-Z]/g,"").toUpperCase()}),n(e.$address_postal_code,function(e){return e.replace(/[^0-9]/g,"")}),e.focus()},updateCurrencySelector:function(){var e=this;e.$currency.empty();var t=e.currencies[e.countryCode];a.each(t,function(t,i){e.$currency.append(a("<option></option>").val(i).text(i))}),1===t.length?e.$currency_row.addClass("hidden"):e.$currency_row.removeClass("hidden")},onEdit:function(e){void 0===this._editCallbacks&&(this._editCallbacks=[]),this._editCallbacks.push(e)},focus:function(){this.$routing_1_row.hasClass("hidden")?this.$account.focus():this.$routing_1.focus()},showTaxForm:function(e){var t=this,i=333,n="swing";e&&!t.taxFormShown?(t.taxFormShown=!0,
a("#"+t.$us_tax_info.attr("id")).animate({height:"show",opacity:"show"},i,n)):!e&&t.taxFormShown&&(t.taxFormShown=!1,a("#"+t.$us_tax_info.attr("id")).animate({height:"hide",opacity:"hide"},i,n))},showVerifyForm:function(e){var t=this,i=333,n="swing";e&&!t.verifyFormShown?(t.verifyFormShown=!0,a("#"+t.$i18n_verify.attr("id")).animate({height:"show",opacity:"show"},i,n)):!e&&t.verifyFormShown&&(t.verifyFormShown=!1,a("#"+t.$i18n_verify.attr("id")).animate({height:"hide",opacity:"hide"},i,n))},getRoutingNumber:function(){if(this.inputs().labels.routing_2){var e=this.inputs().routing_join_template;return e.replace("{1}",this.$routing_1.val()).replace("{2}",this.$routing_2.val())}return this.inputs().labels.routing_1?this.$routing_1.val():void 0},getBirthYear:function(){if("US"===this.countryCode){var e=this.$dob.val();return e.replace(/[^0-9]/g,"").slice(4,e.length)}return this.$dob_year_first.val().replace(/[^0-9]/g,"").slice(0,4)},getBirthMonth:function(){return"US"===this.countryCode?this.$dob.val().replace(/[^0-9]/g,"").slice(0,2):this.$dob_year_first.val().replace(/[^0-9]/g,"").slice(4,6);
},getBirthDay:function(){return"US"===this.countryCode?this.$dob.val().replace(/[^0-9]/g,"").slice(2,4):this.$dob_year_first.val().replace(/[^0-9]/g,"").slice(6,8)},getSSN:function(){return this.$ssn.val().replace(/[^0-9]/g,"")},getAddressLine1:function(){return"US"===this.countryCode?this.$address_line1.val():this.$i18n_address_line1.val()},getAddressCity:function(){return"US"===this.countryCode?this.$address_city.val():this.$i18n_address_city.val()},getAddressState:function(){return"US"===this.countryCode?this.$address_state.val():this.$i18n_address_state.val()},getAddressPostalCode:function(){return"US"===this.countryCode?this.$address_postal_code.val():this.$i18n_address_postal_code.val()},getAddressCountry:function(){return"US"===this.countryCode?"US":this.$i18n_address_country.val()},submit:function(e){var t=this;t.isSubmitting||(t.isSubmitting=!0,document.activeElement.blur(),t._getStripeToken(function(i,n){t.serverCall("submit").kwargs({stripe_response:n,country:t.countryCode,name:t.$name.val(),
birth_year:t.getBirthYear(),birth_month:t.getBirthMonth(),birth_day:t.getBirthDay(),address_line1:t.getAddressLine1(),address_city:t.getAddressCity(),address_state:t.getAddressState(),address_postal_code:t.getAddressPostalCode(),address_country:t.getAddressCountry(),ssn:t.getSSN()}).success(function(i){i?(t.isSubmitting=!1,e()):t.isSubmitting=!1}).error(function(){t.isSubmitting=!1,t.showServerError()}).liveMutate().send()}))},showServerError:function(){this.serverCall("show_error_pmsg").send()},inputs:function(e){var t=this.countryInputs[e||this.countryCode];return t.maxlength||(t.maxlength={}),t.placeholders||(t.placeholders={}),t},switchCountry:function(e){this.$form.removeClass("form_country_"+this.countryCode),this.countryCode=e,this.$form.addClass("form_country_"+this.countryCode),this.inputs().labels.routing_1?(this.$routing_1_label.text(this.inputs().labels.routing_1),this.$routing_1.attr("maxlength",this.inputs().maxlength.routing_1||""),this.$routing_1.attr("placeholder",this.inputs().placeholders.routing_1||""),
this.$routing_1_row.removeClass("hidden")):this.$routing_1_row.addClass("hidden"),this.inputs().labels.routing_2?(this.$routing_2_label.text(this.inputs().labels.routing_2),this.$routing_2.attr("maxlength",this.inputs().maxlength.routing_2||""),this.$routing_2.attr("placeholder",this.inputs().placeholders.routing_2||""),this.$routing_2_row.removeClass("hidden")):this.$routing_2_row.addClass("hidden"),this.$account_label.text(this.inputs().labels.account),this.$account.attr("maxlength",this.inputs().maxlength.account||""),this.$account.attr("placeholder",this.inputs().placeholders.account||""),this.focus(),this.updateCurrencySelector(),this.$i18n_address_country.val(this.countryCode).trigger("change")},_fireOnEdit:function(){if(void 0!==this._editCallbacks)for(;this._editCallbacks.length>0;)this._editCallbacks.pop()()},_getStripeToken:function(e){Stripe.bankAccount.createToken({country:this.countryCode,currency:this.$currency.val(),routing_number:this.getRoutingNumber(),account_number:this.$account.val(),
name:this.$name.val(),account_holder_type:"individual"},e)}})},"./unified_view/payment/money.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.MoneyAmountInput=n.extend({onLoad:function(){var e=this;e.$amount=e.$id("@amount"),e.$amount.on("keydown paste change",function(t){setTimeout(function(){e._filter()},1)}),e.$amount.on("blur",function(t){e._filter(!0)})},getValueInCents:function(){var e=this._cleanVal(!0)[1];return-1===e.indexOf(".")?e+="00":e=e.replace(".",""),parseInt(e)},_filter:function(e){var t=this._cleanVal(e),i=t[0],n=t[1],o=t[2];if(i!==n){var s=this.$amount.get()[0],a=s.selectionStart+o,r=s.selectionEnd+o;this.$amount.val(n),s.setSelectionRange(a,r)}},_cleanVal:function(e){for(var t=this.$amount.val(),i="",n=0,o=0,s=0,a=0;a<t.length;a++){var r=t.charAt(a);this.allowCents&&"."===r?0===o&&(0===n&&(i+="0",n++,s++),i+=r,o++):isNaN(r)||(o>0?3!==o&&(i+=r,o++):n<this.maxDollarNumbers&&(i+=r,n++))}if(e)for(;0!==o&&3>o;)i+="0",o++;var d=i.length;i=i.replace(/^0+(?=\d)/,"");
var l=d-i.length;return l>0&&(n-=l,s-=l),[t,i,s]}})},"./unified_view/pmsg.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/toast.js").Toast;t.PMsg=n.extend(o).extend({onLoad:function(){this.$container=this.$id("@container"),this.show()}})},"./unified_view/privacy.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.ToggleQuestionPrivacyJSMixin={loadConfirmationDialog:function(e){this.createModal("confirm_dialog_contents").kwargs({to_privacy:this.to_privacy,acted_inconsistent_qids:e.acted_inconsistent_qids}).onSubmit(this._setPrivacyUNSAFE.bind(this,{qid:this.qid,to_privacy:this.to_privacy,all_inconsistent_qids:e.all_inconsistent_qids})).show()},loadEmailConfirmationDialog:function(){var e=this;e.createModal("email_confirmation_dialog_contents").onSubmit(function(){e.serverCall("resend_email_confirmation").send()}).show()},_setPrivacyUNSAFE:function(e){this.serverCall("set_privacy").kwargs(e).liveMutate().success(function(){}).send()},trySetPrivacy:function(){
var e=this;return e.serverCall("try_set_privacy").kwargs({qid:e.qid,to_privacy:e.to_privacy}).success(function(t){t&&"response"in t&&("privacy_change_needs_confirmation"==t.response?e.loadConfirmationDialog(t):"privacy_change_needs_email_confirmation"==t.response&&e.loadEmailConfirmationDialog())}).liveMutate().send(),!1}};var o=n.extend(t.ToggleQuestionPrivacyJSMixin);t.QuestionAnonLink=o.extend({onLoad:function(){var e=this;this.$id("@set_privacy").on("click",function(t){t.preventDefault(),e.trySetPrivacy()})}})},"./unified_view/qtext.js":function(e,t,i){var n=i("./shared/client_tracker.js"),o=i("./shared/core/component.js").Component,s=i("./shared/events/index.js"),a=i("./unified_view/toggle.js"),r=i("./shared/cookies.js"),d=i("./shared/jquery.js"),l=i("./shared/debounce.js").debounce,c=i("./shared/viewport.js"),u=i("./shared/logging.js").log,h=i("./shared/action_log.js"),p=t.Expandable=a.ToggleBase.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.handleEvent(s.Types.QTEXT_EXPANDABLE_STATE,function(t){
e.content_type&&t.payload.content_type==e.content_type&&t.payload.oid==e.oid&&e.triggerSwitch()})},actualSwitch:function(){if(!this.switchCompleted){this.obj_type&&(n.track(this.obj_type+"Expand",null,this),r.setQfeedLog(this,this.obj_type+"Expand")),h.logSecondaryAction("ContentExpand",null);var e=d(this.$switchHide.get(0)),t=i("./video.js");t.handleVideosBeforeSelectionHidden(e)}this.css_truncation?(this.$id("@wrapper").addClass("expanded"),this.$id("@wrapper").removeClass("truncated")):this._super()}});t.PostContentExpandable=p.extend({actualSwitch:function(){var e=this;this.emitEvent({type:s.Types.FEED_ANSWER_INLINE_EXPAND,payload:{aid:e.biid}}),this._super.apply(this,arguments)}});var f=null;t.AnswerInFeedExpandable=p.extend({onLoad:function(){this._super.apply(this,arguments)},actualSwitch:function(){this.switchCompleted||this._logReadingTimeOpen(),this.emitEvent({type:s.Types.FEED_ANSWER_INLINE_EXPAND,payload:{aid:this.oid}}),this._super.apply(this,arguments)},_logReadingTimeOpen:function(){
this._logReadingTimeAction("open"),f&&f._logReadingTimeClose(),f=this;var e=l(function(){var e=f.$switchShow.get(0);e&&c.isElementDefinitelyOutOfViewport(e)&&f._logReadingTimeClose()},100,{trailing:!0,maxWait:500});d(window).on("scroll."+this.cid,e)},_logReadingTimeClose:function(){this._logReadingTimeAction("close"),f=null,d(window).off("scroll."+this.cid)},_logReadingTimeAction:function(e){u("web_expand_reading_time",{action:e,time:Date.now(),object_type:this.obj_type,object_id:this.oid,page_type:this.page_type})}}),t.Diff=o.extend({onLoad:function(){var e=this;e.$id("@more_link").on("click",function(){return e.$id("@diff_snip").addClass("hidden"),e.$id("@full_diff").removeClass("hidden"),!1})}})},"./unified_view/qtext2/editor.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/Class.js").Class,s=i("./qtext2/util.js").Util,a=i("./shared/onload.js"),r=i("./settings-webpack.js"),d=i("./qtext2/ui.js"),l=i("./third_party/autosize.js"),c=d.PhotoSearch,u=d.LinkSelector.extend({
__init__:function(e,t,i){var n=this;this._super(e),this.$selector=t,this.$wrapper=i,this.$selector.afterResultWasSelectedCallback=this.submit.bind(this),this.$selector.setEscKeyDown(function(e){var t=n.key+n.$selector.query;(27==e.keyCode||"@"===t&&(8==e.keyCode||13==e.keyCode))&&(n.cancel(t),e.preventDefault())})},show:function(e,t,i){this.key=e||"";var n=this.$wrapper.parent().get(0),o=s.getContainerOffset(n);t-=o.left,i-=o.top+5,this.$selector.setQuery(""),this.$wrapper.css("position","absolute").css("left",t).css("top",i).removeClass("hidden"),this.active=!0,this.$selector.focus()},hide:function(){this._super(),this.$wrapper.addClass("hidden")},submit:function(e,t,i){this._onSubmitCallback&&this._onSubmitCallback(e.data)},cancel:function(e){return this._onCancelCallback?(this._onCancelCallback(e),!1):void 0}}),h=o.extend({__init__:function(e){this._listeners={},this.$node=e,this.$node.on("blur",this.trigger.bind(this,"blur")),this.$node.on("keydown",this.trigger.bind(this,"keydown")),
this.$node.on("keydown",this.trigger.bind(this,"meaningfulChange")),l(this.$node.get(0))},on:function(e,t){this._listeners[e]=this._listeners[e]||[],this._listeners[e].push(t)},trigger:function(e){this._listeners[e]&&this._listeners[e].forEach(function(e){e()})},focus:function(){this.$node.focus(),this.trigger("focus")},getLength:function(){return this.$node.val().length},isEmpty:function(){return 0===this.getLength()},isOnlyWhiteSpace:function(){return 0==this.$node.val().trim().length},toJSON:function(){return{is_plaintext:!0,text:this.$node.val()}},hasChanged:function(e){return!s.jsonEqual(e,this.toJSON())},disable:function(){this.$node.prop("disabled",!0)},enable:function(){this.$node.prop("disabled",!1)},clear:function(){this.$node.val("")},destroy:function(){this.clear()}});t.Editor=n.extend({onLoad:function(){this._editorReady=!1,this._unloaded=!1;var e=this,t=function(){Promise.all([i.e("main"),i.e("main"),i.e("main"),i.e("main"),i.e("main"),i.e("main"),i.e("main"),i.e("qtext2"),i.e("qtext2")]).then(function(t){
if(!e._unloaded){var i=window.require;e._onLoad(i("qtext2/base")),e._editorReady=!0}}.bind(null,i))["catch"](i.oe)};this.shouldDelayOnLoad()?a.execAfterLoadDelayed(t):t()},shouldDelayOnLoad:function(){var e=r.controller,t=r.action;return"question"==e&&"draft"==t||"board"==e&&"add"==t?!1:!0},_onLoad:function(e){this.is_plaintext?this._setupPlainTextEditor():this._setupRichTextEditor(e),this._setupEventListeners(),this.counter=this.child("counter"),this.counter&&this.counter.updateCounter(this.doc.getLength()),this.$id("@fake_editor").on("click",this.hideFakeEditor.bind(this))},onUnload:function(){this._editorReady&&this.doc.destroy(),this._unloaded=!0},disabledCommands:function(){return this.disabled_commands},_setupPlainTextEditor:function(){this.doc=new h(this.$id("@doc"))},_setupRichTextEditor:function(e){var t=e.Doc;if(this.doc=new t(this.content_json),this.toolbar=this.child("toolbar"),this.doc.disableCommands(this.disabledCommands()),this.doc.setLinkSelector(new u(this,this.child("link_selector"),this.$id("@link_selector_wrapper"))),
this.photo_search_enabled&&this.child("photo_search")&&this.doc.setPhotoSearch(new c(this,this.child("photo_search"),this.$id("@photo_search_wrapper"),this.$id("@file"))),-1==this.disabledCommands().indexOf("image")){var i=new d.ImageUploader(this,this.doc,this.$id("@drop_zone").get(0),this.$id("@file").get(0),this.interface_strings);this.doc.setImageUploader(i)}this.$id("@doc").append(this.doc.node),this.doc.node.setAttribute("placeholder",this.interface_strings.placeholder),this._setupToolbar(),this.focusOnLoad&&(this.focus(),this.focusOnLoad=!1)},_setupToolbar:function(){var e=this;this.toolbar&&(this.toolbar.on("click",function(t){if("image"==t)e.photo_search_enabled&&e.child("photo_search")?e.doc.photoSearch.toggle():e.$id("@file").click();else if("link_hide"==t)e.toolbar.showBar(1);else if("overflow_show"==t)e.toolbar.showBar(2);else if("overflow_hide"==t)e.toolbar.showBar(1);else{var i=[t,null,{source:"toolbar",button:t}];e.doc.handleCommand.apply(e.doc,i)}}),this.toolbar.on("imageUpload",function(t){
e.doc.insertImages(t,{source:"upload"})}),this.toolbar.on("updateVideoPlaceholder",function(t){e.doc.handleCommand("video:update",t)}),this.toolbar.on("removeVideoPlaceholder",function(t){e.doc.handleCommand("video:remove",t)}),this.doc.on("focus",function(){e.toolbar.makeActive(e.doc)}),this.toolbar.makeActive(this.doc))},_setupEventListeners:function(){var e=this;e._onEditorReady&&e._onEditorReady(),this.doc.on("focus",function(){e.counter&&e.counter.show(),e._onFocus&&e._onFocus(),e.$id("@editor").addClass("focused")}),this.doc.on("blur",function(){e.counter&&e.counter.hide(),e._onBlur&&e._onBlur(),e.$id("@editor").removeClass("focused")}),this.doc.on("meaningfulChange",function(){e._updateCounter(),e.reportMeaningfulChange()}),this._trackTypingState()},_updateCounter:function(){if(this.counter){var e=0;this.doc.children.forEach(function(t){t.children.forEach(function(t){t.hasModifier("math")||(e+=t.getLength())})}),this.counter.updateCounter(e),this._lengthChangeCallback&&this._lengthChangeCallback(e>this.length_limit);
}},_trackTypingState:function(){var e,t=this,i=1e4,n=55e3,o=3e3,s="empty",a=0,r=0,d=function(){var l,c,u=(new Date).getTime();t.isOnlyWhiteSpace()||t.typingStopped?l="empty":(l=u-i>a?"paused":"typing",u-n>r&&(c=!0)),l!=s&&(c=!0),c&&t._onTypingStateChange&&(t._onTypingStateChange(l),s=l,r=u),e&&(clearTimeout(e),e=null),("typing"==l||"paused"==l)&&(e=setTimeout(d,o))};this.doc.on("keydown",function(){a=(new Date).getTime(),t.typingStopped=!1,d()})},setFocusCallback:function(e){this._onFocus=e},setEditorReadyCallback:function(e){return this._editorReady?void e():void(this._onEditorReady=e)},setBlurCallback:function(e){this._onBlur=e},setMeaningfulChangeCallback:function(e){this._onMeaningfulChange=e},reportMeaningfulChange:function(){this._onMeaningfulChange&&this._onMeaningfulChange()},setTypingStateCallback:function(e){this._onTypingStateChange=e},setLengthChangeCallback:function(e){this._lengthChangeCallback=e},isInteractive:function(){return!0},isEmpty:function(){return this.doc.isEmpty()&&!this.doc.linkSelector.isActive();
},isOnlyWhiteSpace:function(){return this.doc.isOnlyWhiteSpace()},stopTyping:function(){this.typingStopped=!0},fixEditorButtons:function(){this.toolbar&&this.toolbar.fix()},focus:function(){this.doc?this.doc.focus():this.focusOnLoad=!0},hideFakeEditor:function(){this.$id("@fake_editor").addClass("hidden"),this.$id("@editor").removeClass("hidden"),this.focus(),this.fixEditorButtons()},serialize:function(){return this.doc.toJSON()},getVideos:function(){return this.doc.getVideos()},hasChanged:function(e){return this.doc.hasChanged(e)},disable:function(){this.doc.disable(),this.$id("@editor").addClass("disabled")},enable:function(){this.doc.enable(),this.$id("@editor").removeClass("disabled")},clear:function(){this.doc.clear()}})},"./unified_view/qtext2/editor/mobile.js":function(e,t,i){var n,o,s=i("./shared/client.js"),a=i("./shared/core/component.js").Component,r=i("./unified_view/modal.js").ModalBase,d=i("./qtext2/ui.js"),l=i("./shared/debounce.js").debounce,c=i("./shared/window_manager.js"),u=i("./shared/events/index.js"),h=i("./shared/jquery.js"),p=i("./shared/toast.js"),f=i("./settings-webpack.js");
t.EditorModal=r.extend({onLoad:function(){this._super.apply(this,arguments),t.activeEditor=this,this._setupEditor();var e=this;Promise.all([i.e("main"),i.e("main"),i.e("main"),i.e("main"),i.e("main"),i.e("main"),i.e("main"),i.e("qtext2"),i.e("qtext2")]).then(function(){s.isNativeApp()&&(o.send("setupEditor",{hasDraft:!!e.has_draft}),o.send("restoreState",{key:e.key}))}.bind(null,i))["catch"](i.oe)},_setupEditor:function(){var e=this;if(this.editor=this.child("editor"),this.editor.setFocusCallback(function(){t.activeEditor=e}),this.has_draft){var i=l(this.autoSaveDraft.bind(this),750,{maxWait:1e4,leading:!0});this.editor.setMeaningfulChangeCallback(function(){e.saveState(),i()})}else this.editor.setMeaningfulChangeCallback(this.saveState.bind(this))},focus:function(){this.editor.focus()},getState:function(){return this.editor.serialize()},getVideos:function(){return this.editor.getVideos()},saveState:function(){s.isNativeApp()&&o.send("saveState",{key:this.key,value:this.getState()})},restoreState:function(e){
this.editor.doc.fromJSON(e)},_onDraftSaveSuccess:function(){o.send("draftSaveComplete",{success:!0})},_onDraftSaveError:function(){o.send("draftSaveComplete",{success:!1})},_onDraftClearSuccess:function(){o.send("draftClearComplete",{key:this.key,success:!0})},_onDraftClearError:function(){o.send("draftClearComplete",{key:this.key,success:!1})},_saveDraftServerCall:function(){return this.serverCall("save_draft").kwargs({oid:this.oid,content:this.getState()})},autoSaveDraft:function(){this.saveState(),this._saveDraftServerCall().send()},saveDraft:function(){o.send("showLoadingView"),this.saveState(),this._saveDraftServerCall().success(this._onDraftSaveSuccess.bind(this)).error(this._onDraftSaveError.bind(this)).send()},clearDraft:function(){o.send("showLoadingView"),this.serverCall("clear_draft").kwargs({oid:this.oid}).success(this._onDraftClearSuccess.bind(this)).error(this._onDraftClearError.bind(this)).send()},_beforeSubmit:function(){this.__submitPending=!0,s.isIOSApp()?o.send("showProgressBar"):o.send("showLoadingView");
var e=this;this._doneButtonIntervalId=null,s.isAndroidApp()&&(this._doneButtonIntervalId=setInterval(function(){e.setMobileDoneButtonDisabled(!0)},30))},_afterSubmit:function(e){this.__submitPending=!1,s.isIOSApp()?o.send("hideProgressBar",{complete:!!e}):o.send("hideLoadingView"),s.isAndroidApp()&&(clearInterval(this._doneButtonIntervalId),this.setMobileDoneButtonDisabled(!1))},onSubmit:function(){if(!this.__submitPending){this._beforeSubmit();var e=this._super.bind(this),t=this;this._preOnSubmitChecks(function(){t.serverCall("submit").kwargs({oid:t.oid,content:t.getState(),extra_kwargs:t.extra_kwargs}).success(function(i){t._afterSubmit(!0),i.success&&e(i)}).error(t._handleError.bind(t)).sendOnlyOnce()})}},_handleError:function(){this._afterSubmit(!1)},_preOnSubmitChecks:function(e){if(!f.qtextData.videoEnabled)return void e();var t=f.qtextData.videoEditorSupported,i=this.getVideos();if(0==i.length)return void e();if(!t&&0!=i.length)return this._handleError(),void p.showError(f.qtextData.cantSubmitVideo);
if(s.isMobileWeb()&&f.debug)return void e();var n=this;o.send("getExistingVideos",{},function(t){var s={};(t.videos||[]).forEach(function(e){s[e.uuid]=e});var a=i.every(function(e){return s[e]});return a?void o.send("uploadVideos",{videoUuids:i},function(t){return t.success?void e():void n._handleError()}):(n._handleError(),void p.showError(f.qtextData.cantSubmitVideo))})}}),t.WriteAnonAnswerModal=t.EditorModal.extend({onLoad:function(){this._super.apply(this,arguments),this.handleEvent(u.Types.ANON_LINK_SAVED,function(e){c.removeURLParam("show_alert")})},onSubmit:function(){var e=this._super.bind(this),t=c.isParamInURL("show_alert");t?this.createModal("load_modal").kwargs({oid:this.oid,anon_content_key:this.extra_kwargs.anon_content_key}).onClose(function(){e()}).show():e()},submit:function(e){o.send("openURL",{url:e.next_url})}}),t.DualEditorModal=t.EditorModal.extend({_setupEditor:function(){var e=this;this.title_editor=this.child("title"),this.details_editor=this.child("details"),this.isTitleOverLimit=!1,
this.isDetailsOverLimit=!1,this.lastFocusedEditor=null,this.title_editor.setFocusCallback(function(){t.activeEditor=e,e.lastFocusedEditor=e.title_editor}),this.details_editor&&this.details_editor.setFocusCallback(function(){t.activeEditor=e,e.lastFocusedEditor=e.details_editor}),this.title_editor.setMeaningfulChangeCallback(this.saveState.bind(this)),this.details_editor&&this.details_editor.setMeaningfulChangeCallback(this.saveState.bind(this)),this.title_length_limit&&this.title_editor.setLengthChangeCallback(function(t){e.isTitleOverLimit=t,e.updateButton()}),this.details_editor&&this.details_length_limit&&this.details_editor.setLengthChangeCallback(function(t){e.isDetailsOverLimit=t,e.updateButton()})},updateButton:function(){this.setMobileDoneButtonDisabled(this.isTitleOverLimit||this.isDetailsOverLimit)},focus:function(){var e=document.activeElement;this.title_editor.doc.contains(e)||this.details_editor&&this.details_editor.doc.contains(e)||(null===this.lastFocusedEditor?this.title_editor.focus():this.lastFocusedEditor.focus());
},getState:function(){return{title:this.title_editor.serialize(),details:this.details_editor?this.details_editor.serialize():""}},getVideos:function(){return[]},restoreState:function(e){this.title_editor.doc.fromJSON(e.title),this.details_editor&&this.details_editor.doc.fromJSON(e.details)}}),t.LinkSelectorModal=r.extend({onLoad:function(){this._super.apply(this,arguments),o.send("showSearchInput",{searchPlaceholderText:this.interface_strings.search_placeholder,searchFocus:!0,searchCancelButton:!1}),this.cleanUpCallback=this.close.bind(this),n.registerOneTimeMessageHandler("addLinkSelectorPressed",this.cleanUpCallback)},onUnload:function(){n.removeOneTimeMessageHandler("addLinkSelectorPressed",this.cleanUpCallback)}}),t.LinkSelector=d.LinkSelector.extend({__init__:function(e){var t=this;this._super(e),this._handleAddLink=function(e){t.submit(e)}},show:function(e){this.bindAddLinkHandler(),this.toolbar.createModal("load_link_selector").onClose(this.cancel.bind(this)).show(),this.active=!0,
this.key=e||""},bindAddLinkHandler:function(){n.removeOneTimeMessageHandler("addLinkSelectorPressed",this._handleAddLink),n.registerOneTimeMessageHandler("addLinkSelectorPressed",this._handleAddLink)},cleanUpModal:function(){s.isMobileWeb()&&this.isActive()&&o.send("hideSearchInput")},submit:function(e){this._onSubmitCallback&&this._onSubmitCallback({text:e.text,url:e.url})},cancel:function(){this._onCancelCallback&&setTimeout(this._onCancelCallback.bind(this,this.key),0)},hide:function(){this.cleanUpModal(),this._super()}}),t.activeEditor=null,t.VideoAnswerNUX=a.extend({onLoad:function(){this.bindEvents();var e=this;this.$id("@video_record_icon").on("click",function(){e.serverCall("log_video_nux_dismissed").send(),o.send("showVideoEditor")}),this.$id("@video_nux_close").on("click",function(){e.hideTooltip(),e.unbindEvents(),e.serverCall("log_video_nux_dismissed").send()})},bindEvents:function(){h(window).on("resize."+this.cid,this.setTooltipPosition.bind(this)),h(window).on("scroll."+this.cid,this.setTooltipPosition.bind(this)),
h(window).on("orientationchange."+this.cid,this.setTooltipPosition.bind(this))},unbindEvents:function(){h(window).off("resize."+this.cid),h(window).off("scroll."+this.cid),h(window).off("orientationchange."+this.cid)},hideTooltip:function(){this.$id("@video_nux").addClass("hidden")},setTooltipPosition:l(function(){if(this.$id("@video_nux").length>0){var e=this.$id("@video_nux").outerHeight(!0)+8;this.$id("@video_nux").css({top:window.innerHeight-e+"px"})}},100),onUnload:function(){this.unbindEvents()}})},"./unified_view/qtext2/photo_search.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/debounce.js").debounce;t.PhotoSearch=n.extend({onLoad:function(){this.hasInitialized=!1},initSearchInput:function(){var e=this,t="",i=e.$id("@search"),n=o(function(){var n=i.val();n!==t&&n.length>=3&&(e.getPhotos(n),t=n)},500);i.on("keydown",function(){n()})},initUploadLink:function(){var e=this;e.$id("@upload").on("click",function(t){t.preventDefault(),e.$uploader&&(e.uploadCallback&&e.uploadCallback(),
e.$uploader.click())})},setUploader:function(e){this.$uploader=e},makeActive:function(){this.$id("@search").focus(),this.serverCall("log_action").kwargs({action_type:"open"}).send(),this.hasInitialized===!1&&(this.initSearchInput(),this.initUploadLink(),this.load_default_results&&this.getPhotos(),this.hasInitialized=!0)},getPhotos:function(e){var t=this;e&&0!==e.length||(e=t.default_query),t.clearPhotos(),t.$id("@spinner").removeClass("hidden"),t.serverCall("get_photos").kwargs({query:e}).success(function(e){t.$id("@spinner").addClass("hidden"),t.renderPhotos(e)}).send()},renderEmptyState:function(){var e=this.$id("@empty_state");e.text(this.empty_msg),e.removeClass("hidden")},renderPhotos:function(e){var t=document.createDocumentFragment(),i=this;return 0===e.length?void i.renderEmptyState():(e.forEach(function(e){var n=document.createElement("img");n.src=e[1],n.dataset.original=e[0],n.addEventListener("click",function(){i.selectCallback&&i.selectCallback(n.dataset.original),i.serverCall("log_action").kwargs({
action_type:"insert_image"}).send()}),t.appendChild(n)}),void this.$id("@container").get(0).appendChild(t))},clearPhotos:function(){for(var e=this.$id("@container").get(0),t=0;t<e.childNodes.length;)"IMG"==e.childNodes[t].tagName?e.removeChild(e.childNodes[t]):++t;this.$id("@empty_state").addClass("hidden")},setSelectCallback:function(e){this.selectCallback=e},setUploadCallback:function(e){this.uploadCallback=e}})},"./unified_view/qtext2/toolbar.js":function(e,t,i){var n,o=i("./shared/core/component.js").Component,s=i("./shared/jquery.js"),a=i("./shared/scroll_animation_handler.js"),r=i("./qtext2.js"),d=i("./qtext2/keys.js"),l=i("./qtext2/shortcuts.js").SHORTCUTS,c=i("./qtext2/util.js").Util,u=i("./qtext2/tooltip.js"),h=o.extend({onLoad:function(){this._barIdx=1},on:function(e,t){this._handlers=this._handlers||[],this._handlers[e]=t},trigger:function(e,t){this._handlers[e]&&this._handlers[e](t)},makeActive:function(e){this.showBar(1),this._doc=e,this._startUpdating(),t.activeToolbar=this;
},makeInactive:function(){this._doc=null,this._updating=!1,t.activeToolbar=null},showBar:function(e){this._barIdx<e?this._animation="up":this._barIdx>e?this._animation="down":this._animation="",this._barIdx=e},_startUpdating:function(){var e=this;if(this.currentState=null,!this._updating){this._updating=!0;var t=function(){e._doc&&(e.update(e._doc.getToolbarState(e._barIdx),e._animation),e._animation=!1,requestAnimationFrame(t))};t()}},update:function(e,t){c.jsonEqual(e,this.currentState)||(this._update(e,t),this.currentState=e)},_update:null});t.Web=h.extend({onLoad:function(){this._super.apply(this,arguments),this.$linkInput=this.$id("@link_input"),this.$linkSave=this.$id("@link_save"),this.$isCitation=this.$id("@is_citation"),this.buttons.forEach(this.bindButtonEvents.bind(this)),this.bindLinkInput(),this.fix()},bindButtonEvents:function(e){this._bindButtonClick(e),this._bindButtonTooltip(e)},_bindButtonClick:function(e){var t="image"==e||"video"==e?"click":"touchstart mousedown",i=this;
this.$id("@"+e).on(t,function(){return u.hide(),i.trigger("click",e),!1})},_bindButtonTooltip:function(e){this.$id("@"+e).on("mouseenter",function(){var t,i=this.getAttribute("tooltip");for(t in l)if(l[t]==e){i+=" ("+d.getShortcutHint(t)+")";break}u.show(this,i)}),this.$id("@"+e).on("mouseout",function(){u.hide()})},bindLinkInput:function(){var e=this;this.$linkSave.on("click",function(){return e._triggerLinkInput(),!1}),this.$linkInput.on("keydown",function(t){13==t.which?(t.preventDefault(),t.stopPropagation(),e._triggerLinkInput()):27==t.which&&(t.preventDefault(),t.stopPropagation(),e.$linkInput.val(""),e._triggerLinkInput())})},_triggerLinkInput:function(){this.trigger("linkInput",{url:this.$linkInput.val(),isCitation:this.$isCitation.prop("checked")}),this.$linkInput.val(""),this.$isCitation.prop("checked",!1)},_update:function(e,t){var i,n=this,o=this.$id("@bar"+this._barIdx),s=n.$id("@storage"),a=o.children(".left"),r=n.$id("@scroller");o.find(".modifier").each(function(e,t){s.append(t);
}),e.forEach(function(e){"space"==e.name?a=o.children(".right"):(i=n.$id("@"+e.name),e.disabled?(i.removeClass("pressed"),i.addClass("disabled")):e.pressed?(i.removeClass("disabled"),i.addClass("pressed")):(i.removeClass("disabled"),i.removeClass("pressed")),a.append(i),e.focused&&i.focus())}),t?r.addClass("animate"):r.removeClass("animate"),r.css("top",100*-this._barIdx+"%")},setLinkToolbarStatus:function(e,t){this.$linkInput.val(e),this.$isCitation.prop("checked",!!t),this.$linkSave.text(e?"Update":"Add")},fix:function(){var e=this.$id("@toolbar"),t=e.parent(),i=c.firstScrollingParent(e.get(0)),n=s(".SiteHeader").height();(0!==s(".is_zen").length||i!==document.body)&&(n=0);var o=function(o){var a=t.offset().top-n;a-=i===document.body?o:s(i).offset().top;var r=a+t.height()-2*e.height();0>a&&r>0?e.css("position","fixed").css("top",n).css("left",t.offset().left).css("width",t.width()).css("-webkit-transform","translateZ(0)"):e.css("position","absolute").css("top",0).css("left",0).css("width","").css("-webkit-transform","");
};i===document.body?a.add(window,o):a.add(i,o)}}),t.activeToolbar=null;var p;t.MobileWebShim=t.Web.extend({onLoad:function(){this._super.apply(this),p=this},_bindButtonTooltip:function(e){},trigger:function(e,t){r.handleToolbarAction(e,t)},fix:function(){}}),t.updateMobileWebShim=function(e){if(p){for(var t=1,i=0;i<e.buttons.length;i++){if("link_input"==e.buttons[i].name){t=0;break}if("undo"==e.buttons[i].name){t=2;break}}p.showBar(t),p.update(e.buttons,e.animation)}},t.Mobile=h.extend({_update:function(e,t){n.send("updateToolbar",{buttons:e,animation:t})}})},"./unified_view/qtext_video.js":function(e,t,i){var n,o=i("./settings-webpack.js"),s=i("./shared/onload.js"),a=i("./shared/jquery.js"),r=i("./shared/client.js"),d=i("./shared/core/component.js");t.setupPlayer=function(e){if(o.qtextData.canViewVideos){var t=a(e).attr("data-qt-video");if(t){var n=a(e).attr("data-qt-aspect-ratio");s.execAfterLoad(function(){i.e("jwplayer").then(function(){var i,o,s=require,a=s("shared/jwplayer");i="//content.jwplatform.com/thumbs/"+t+"-720.jpg",
o="//content.jwplatform.com/videos/"+t+"-720.mp4";var r="//content.jwplatform.com/manifests/"+t+".m3u8";a(e.id).setup({image:i,sources:[{file:r,type:"application/vnd.apple.mpegurl"},{file:o,type:"video/mp4"}],width:"100%",aspectratio:n,preload:"auto",mediaid:t})}.bind(null,i))["catch"](i.oe)})}}},t.updateUploadProgress=function(e){if(o.qtextData.videoEnabled&&r.isNativeApp()){var t=a(e).attr("data-qt-pending-video-client-uuid"),i=a(e).attr("data-qt-video-should-update-progress");if(t&&i){var s=function(t){if(t.uploadedBytes>0&&t.totalBytes>0){var i=""+Math.round(t.uploadedBytes/1e3)+" / "+Math.round(t.totalBytes/1e3)+" KB",n=Math.round(t.uploadedBytes/t.totalBytes*100);a(e).find(".uploading_progress").text(i+" ("+n+"%)")}},l=function(){n.send("getVideoUploadingStatus",{uuid:t},function(t){if(s(t),2==t.state)setTimeout(l,2e3);else if(3==t.state){var i=d.getComponentFromElement(e);i.onVideoUploaded(t)}})};l()}}}},"./unified_view/question/anon.js":function(e,t,i){var n=i("./shared/core/component.js").Component;
t.EditQuestionAndDetailsButton=n.extend({onLoad:function(){var e=this;this.$id("@button").on("click",function(){e.showModal()})},showModal:function(){var e=this;e.createModal("load_modal").kwargs({qid:e.qid,anon_content_key:e.anon_content_key}).show()}})},"./unified_view/question/ask_ama_question.js":function(e,t,i){var n=i("./shared/errors.js"),o=i("./unified_view/question/ask_question.js").AskQuestionModal;t.AskAMAQuestionModal=o.extend({ask:function(e){if(e)return void n.logJsError("AskAMAQuestionModal","anon unsupported but set to true");var t=this,i=t.child("question_bar");t.setBusyState(!0),t.serverCall("create_new_question").liveMutate().kwargs({input_text:i.query}).success(function(e){t.setBusyState(!1),e&&t.close()}).except(function(e){t.setBusyState(!1)}).error(function(e){t.setBusyState(!1)}).send()}})},"./unified_view/question/ask_question.js":function(e,t,i){var n,o,s,a,r=i("./shared/core/component.js").Component,d=i("./shared/events/index.js"),l=i("./shared/window_manager.js"),c=i("./unified_view/modal.js").ModalBase,u=i("./shared/w2.context.js"),h=i("./shared/debounce.js").debounce,p=i("./shared/client.js"),f=i("./third_party/autosize.js");
n=i("./view/selector.js").Selector;var _=function(e,t,i){var n=e.$id("@prefetched_modal").get(0).childNodes[0],o=e.child("ask_modal"),s=a.modalUrl(e.vcon(),"ask_question_modal",{target_type:null,target_oid:null,source:t,initial_query:i},e);if(e.createModal().fromElement(n,{url:s,useActionView:!0,target:"modal",height:null,title:o.title_text,noPageWrapper:!0}).onSubmit(function(t){e.onSubmit(t)}).show(),i){var r=e.child("ask_modal").child("question_bar");r.setInputVal(i,i.length)}o.setSource(t)};t.PreloadedAskModal=r.extend({__init__:function(){this._super.apply(this,arguments)},onLoad:function(){var e=this;o.registerMessageHandler("askButtonPressed",function(t){_(e,e.source,e.initial_query)}),this.handleEvent(d.Types.ASK_QUESTION_MODAL_OPEN,function(t){_(e,e.source,e.initial_query)})},onSubmit:function(e){e.redirect_url?l.navigateTo(e.redirect_url):e.success&&e.qid&&(e.question_url||this.serverCall("show_question_added_pmsg").kwargs({qid:e.qid}).send())}}),t.AskQuestionButton=r.extend({
__init__:function(){this._super.apply(this,arguments)},onLoad:function(){var e=this;this.actionBarContext=this.getContext(u.ActionBar),this.$id("@button").on("click",function(t){t.preventDefault(),e.onClick()}),e.shouldOpenModalOnLoad&&window.setTimeout(function(){e.showModal(e.initial_query)},0)},onClick:function(){this.showModal(this.initial_query)},showModal:function(e){var t=this;this.shouldUsePageModal?t.emitEvent({type:d.Types.ASK_QUESTION_MODAL_OPEN,payload:{}}):this.modalPrefetched?_(this,this.source,this.initial_query):t.createModal("ask_question_modal").kwargs({target_type:t.targetType,target_oid:t.targetOid,source:t.source,initial_query:e}).onSubmit(function(e){t.onSubmit(e)}).show()},onSubmit:function(e){this.actionBarContext&&(this.actionBarContext.set("loadComments",!0),this.actionBarContext.set("showComments",!0)),e.redirect_url?l.navigateTo(e.redirect_url):e.success&&e.qid&&this.serverCall("show_question_added_pmsg").kwargs({qid:e.qid}).send()}});var m=t.AskQuestionModal=c.extend({
onLoad:function(){var e=this;this.busy=!1,e._super.apply(e,arguments),e.onLoadModalDesktop(),e.handleEvent(d.Types.ASK_QUESTION_MODAL_QUERY_CHANGE,function(t){e.updateCounter()}),this.$id("@anon_checkbox").on("change",function(t){e.toggleAnon(e.$id("@anon_checkbox").prop("checked")||!1)}),this.show_question_framing&&(this.current_ask_phrase=this.$id("@user_asks"),this.$id("@ask_phrase").on("click",function(t){e.$id("@ask_phrase").addClass("hidden"),e.$id("@phrase_selector").removeClass("hidden"),e.$id("@phrase_selector").focus()}),this.$id("@phrase_selector").on("change",function(t){e.current_ask_phrase.addClass("hidden"),e.current_ask_phrase=e.$id(t.target.value),e.$id(t.target.value).removeClass("hidden"),e.$id("@ask_phrase").removeClass("hidden"),e.$id("@phrase_selector").addClass("hidden")}),this.$id("@phrase_selector").on("focusout",function(t){e.$id("@ask_phrase").removeClass("hidden"),e.$id("@phrase_selector").addClass("hidden")}))},onLoadModalDesktop:function(){var e=this;this.handleEvent(d.Types.ASK_QUESTION_MODAL_SUBMIT,function(t){
e.onSubmit()});var t=this.child("question_bar");t.focus(),t.query&&t.$id("@input").get(0).setSelectionRange(t.query.length,t.query.length)},onLoadModalMobile:function(){var e=this,t={buttonText:this.submitButtonText,enabled:!0};this.anonymouslyText&&(t.anonToggleText=this.anonymouslyText),this.updateAskToolbar(t),o.registerMessageHandler("askToolbarSubmit",function(t){e.ask(t.is_anonymous)}),o.registerMessageHandler("askToolbarToggleAnon",function(t){e.toggleAnon(t.is_anonymous)}),o.registerMessageHandler("askToolbarAnonToggle",function(t){e.toggleAnon(t.is_anonymous)}),this.onOpen()},onOpen:function(){var e=this;p.isMobileWeb()&&!p.isIOSMobileWeb()||p.isIOSApp()?setTimeout(function(){e.child("question_bar").focus()},200):e.child("question_bar").focus()},updateAskToolbar:function(e){p.isNativeApp()&&s.send("showAskToolbar",e)},onSubmit:function(){this.ask(this.$id("@anon_checkbox").prop("checked")||!1)},close:function(){this.reset(),this._super.apply(this,arguments)},ask:function(e){var t=this,i=t.child("question_bar");
t.setBusyState(!0),t.serverCall("ask_question").liveMutate().kwargs({question_text:i.query,is_anon:e,question_details:t.getQuestionDetails(),source:t.source,target_type:t.targetType,target_oid:t.targetOid}).success(function(e){var i=e[0],n=e[1],o=e[2],s=e[3];t.setBusyState(!1),i&&(t.submit({success:i,redirect_url:n,qid:o,question_url:s}),t.targetOid?(t.reset(),t.child("question_bar").focus()):t.unified_aggressive_a2a?l.navigateTo(s):t.close())}).except(function(e){t.setBusyState(!1)}).error(function(e){t.setBusyState(!1)}).send()},setBusyState:function(e){this.busy=e,this.toggleButtonState(!this.busy);this.busy?this.$id("@submit").html(this.busyButtonText):this.$id("@submit").html(this.submitButtonText)},setSource:function(e){this.source=e},toggleAnon:function(e){e?(this.$id("@user_asks").addClass("hidden"),this.$id("@anon_asks").removeClass("hidden")):(this.$id("@anon_asks").addClass("hidden"),this.$id("@user_asks").removeClass("hidden"))},toggleButtonState:function(e){e?this.$id("@submit").removeClass("submit_button_disabled"):this.$id("@submit").addClass("submit_button_disabled");
},updateCounter:function(){var e=this.child("question_bar").charactersLeft();this.toggleButtonState(e>=0)},reset:function(){this.child("question_bar").reset(),this.updateCounter(),this.toggleAnon(!1),!p.isNativeApp()&&this.anonymouslyText&&(this.$id("@anon_checkbox").get(0).checked=!1),this.busy=!1},getQuestionDetails:function(){return this.removeDetails?this.child("sources").toJSON():null}});t.LoggedOutAskQuestionModal=m.extend({ask:function(e){var t=this,i=t.child("question_bar");t.setBusyState(!0),t.serverCall("ask_question").kwargs({question_text:i.query,is_anon:e,question_details:null,source:t.source,target_type:t.targetType,target_oid:t.targetOid}).success(function(e){t.setBusyState(!1),e&&(t.close(),t.serverCall("show_signup_wall_if_not_logged_in").liveMutate().send())}).except(function(e){t.setBusyState(!1)}).error(function(e){t.setBusyState(!1)}).send()}}),t.AskQuestionSelector=n.extend({onLoad:function(){var e=this;e.$input=e.$id("@input"),f(this.$input),e.queryChangeDebounced=h(function(){
e.emitEvent({type:d.Types.ASK_QUESTION_MODAL_QUERY_CHANGE,payload:{query:e.query}})},10,{maxWait:300,trailing:!0}),e._super.apply(e,arguments),e.$input.on("keydown",function(t){13==t.which&&(t.preventDefault(),e.emitEvent({type:d.Types.ASK_QUESTION_MODAL_SUBMIT,payload:{}}))}),e.handleEvent(d.Types.ASK_QUESTION_MODAL_RESULT_CLICK,function(t){e.resultClickHandler(t)}),e.minWords=3,e.timer=null,e.firstEdit=!0,e.allow_no_selection=!0,this.query&&this.queryDidChange(),e.$id("@add_details").on("click",function(t){t.preventDefault(),e.showQuestionDetailsEditor(!0)}),e.$id("@remove_details").on("click",function(t){t.preventDefault(),e.showQuestionDetailsEditor(!1)})},charactersLeft:function(){return this.question_length_limit-this.query.length},focus:function(){this.$id("@input").get(0).focus(),p.isAndroidApp()&&s.send("showKeyboard")},reset:function(){this.$id("@input").val(""),this.firstEdit=!0},resizeInput:function(){var e=document.createEvent("Event");e.initEvent("autosize:update",!0,!1),this.$input.get(0).dispatchEvent(e);
},setInputVal:function(e,t){var i=this.$input.get(0).selectionStart,n=this.$input.get(0).selectionEnd;t&&(i+=t,n+=t),this.$input.val(e),e.length>0&&this.$input.get(0).setSelectionRange(i,n)},getExtraKwargs:function(){return{target:this.target}},showQuestionDetailsEditor:function(e){e?(this.$id("@add_details").addClass("hidden"),this.$id("@remove_details").removeClass("hidden"),this.$id("@details_wrapper").removeClass("hidden")):(this.$id("@remove_details").addClass("hidden"),this.$id("@add_details").removeClass("hidden"),this.$id("@details_wrapper").addClass("hidden"))},capitalize:function(e){if(!e||!this.should_capitalize)return e;var t=e.startsWith(this.opening_question_punctuation)?this.opening_question_punctuation.length:0;return e=e.slice(0,t)+e.charAt(t).toUpperCase()+e.slice(t+1)},queryDidChange:function(){var e=this,t=0;this.firstEdit&&(this.firstEdit=!1,this.query.endsWith(e.closing_question_punctuation)||(this.query=this.query+this.closing_question_punctuation),this.query.startsWith(e.opening_question_punctuation)||(this.query=this.opening_question_punctuation+this.query),
t=this.opening_question_punctuation.length),this.setInputVal(this.capitalize(this.query),t),e.queryChangeDebounced()},wrapperFocusoutHandler:function(){},updateResults:function(){window.clearTimeout(this.timer),this.timer=window.setTimeout(this._super.bind(this),this.delay)},shouldShowEmptyInputPrompt:function(){return!this.show_results_for_empty_query&&(this.query.split(" ").length<this.minWords||0===this.query.trim().length)},resultClickHandler:function(e){var t=this,i=e.payload.question_text;t.query=i,t.setInputVal(i);var n=i.length;i.endsWith(t.closing_question_punctuation)&&(n-=t.closing_question_punctuation.length),t.$input.get(0).setSelectionRange(n,n),t.resizeInput()}}),t.AskQuestionSelectorResult=r.extend({onLoad:function(){var e=this;this.$id("@question_result_text").on("click",function(t){e.emitEvent({type:d.Types.ASK_QUESTION_MODAL_RESULT_CLICK,payload:{question_text:e.question_plaintext}})})}})},"./unified_view/question/disclaimer.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./unified_view/modal.js").ModalBase;
t.SetDisclaimerDialog=o.extend({showEditor:function(){this.$id("@choose_profession_area").hide(),this.$id("@edit_disclaimer_area").show(),this.child("editor").focusInput(),this.$id("@cancel").hide()},showError:function(){this.$id("@choose_profession_area").hide(),this.$id("@wrong_profession_error").show()}}),t.DisclaimerIndicateProfession=n.extend({onLoad:function(){var e=this;e.$id("@options").on("click",".profession",function(){return e.parent().showEditor(),!1}),e.$id("@other").on("click",function(){return e.parent().showError(),!1})}}),t.AttachDisclaimerLink2=n.extend({onLoad:function(){var e=this;this.$id("@add_disclaimer_link").click(function(){e.createModal("set_disclaimer_dialog").show()})}})},"./unified_view/question/pending_answer.js":function(e,t,i){var n=i("./shared/core/component.js").Component;i("./shared/events/index.js");t.PendingContentQText=n.extend({onVideoUploaded:function(){}})},"./unified_view/question/prompt.js":function(e,t,i){var n=i("./shared/core/component.js").Component;
i("./shared/events/index.js");t.QuestionMergedPrompt=n.extend({onLoad:function(){}}),t.PendingAnswerPromptBase=n.extend({onLoad:function(){return}})},"./unified_view/question/rad.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/w2.context.js").ActionBar,s=i("./shared/cookies.js"),a=i("./shared/action_log.js");t.RADToggle=n.extend({onLoad:function(){var e=this;e.actionBarContext=e.getContext(o),e.$id("@toggle").on("click",function(t){t.preventDefault(),e.actionBarContext.set("toggleRAD",!e.actionBarContext.get("toggleRAD"))}),e.actionBarContext.on("toggleRAD",function(t,i){i===!0?(e.$id("@toggle").addClass("is_active"),e.$id("@nub").addClass("is_active")):(e.$id("@toggle").removeClass("is_active"),setTimeout(function(){e.$id("@nub").removeClass("is_active")},160))})}}),t.RequestAnswersDrawer=n.extend({onLoad:function(){var e=this;e.actionBarContext=e.getContext(o),e.should_open_by_default&&e.actionBarContext.set("toggleRAD",!0),e.actionBarContext.on("toggleRAD",function(t,i){
e.toggleDrawer(i)}),e.$id("@close_button").on("click",function(t){t.preventDefault(),e.$id("@drawer").removeClass("is_active"),e.actionBarContext.set("toggleRAD",!1)})},toggleDrawer:function(e){var t=this;e?t.showDrawer():t.hideDrawer()},showDrawer:function(){var e=this;e.$id("@drawer").hasClass("is_active")||(e.$id("@drawer").addClass("transitioning_in"),setTimeout(function(){e.$id("@drawer").removeClass("transitioning_in"),e.$id("@drawer").addClass("is_active")},200))},hideDrawer:function(){var e=this;e.$id("@drawer").hasClass("is_active")&&(e.$id("@drawer").removeClass("is_active"),e.$id("@drawer").addClass("transitioning_out"),setTimeout(function(){e.$id("@drawer").removeClass("transitioning_out")},200))}}),t.RequestFromQuoraLink=n.extend({onLoad:function(){var e=this;e.$id("@request_answers_button").on("click",function(){e.$id("@request_answers_button").hasClass("is_active")?e.unRequestAnswers():e.requestAnswers()})},requestAnswers:function(){var e=this;e.$id("@list_item").addClass("is_active"),
e.$id("@request_answers_button").addClass("is_active"),e.serverCall("request_answers").error(function(){e.$id("@request_answers_button").removeClass("is_active")}).send(),s.setTlog({type:"QuestionReask",qid:e.qid}),s.setQfeedLog(e,"QuestionReask")},unRequestAnswers:function(){var e=this;e.$id("@list_item").removeClass("is_active"),e.$id("@request_answers_button").removeClass("is_active"),e.serverCall("unrequest_answers").error(function(){e.$id("@request_answers_button").addClass("is_active")}).send()}}),t.Suggestions=n.extend({onLoad:function(){var e=this;e.suggestionsLoaded=e.should_load_by_default,e.actionBarContext=e.getContext(o),e.actionBarContext.get("toggleRAD")&&e.loadSuggestions(),e.actionBarContext.on("toggleRAD",function(t,i){i===!0&&e.loadSuggestions()})},loadSuggestions:function(){var e=this;e.suggestionsLoaded!==!0&&e.serverCall("get_suggestions_list").contentFor(e.$id("@suggestions_list").get(0)).success(function(){e.suggestionsLoaded=!0}).send()}}),t.SuggestionListItem=a.ActionableComponent.extend({
onLoad:function(){var e=this;e.$id("@request_button").on("click",function(){e.request()}),e._super.apply(e,arguments)},request:function(){var e=this;e.renderRequested(),e.serverCall("request").success(function(t){"failed"==t&&e.renderDefault(),"reached"==t&&e.renderDefault()}).error(function(){e.renderDefault()}).liveMutate().send(),s.setQfeedLog(e,"AskToAnswer"),s.setTlog({type:"AskToAnswer",qid:e.qid}),a.logPrimaryAction("AskToAnswer",{type:e.impression_type,hash:e.impression_hash})},renderRequested:function(){this.$id("@list_item").addClass("is_active"),this.$id("@request_button").addClass("is_active")},renderDefault:function(){this.$id("@list_item").removeClass("is_active"),this.$id("@request_button").removeClass("is_active")}})},"./unified_view/question/sources.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.QuestionSourceEdit=n.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;if(e.tutorial){var t=e.$id("@tutorial");t.on("click",function(){
t.addClass("hidden"),e.serverCall("tutorial_clicked").send()})}},toJSON:function(){return{is_plaintext:!0,text:this.$id("@link_input").val()}}})},"./unified_view/reauth.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js"),s=i("./unified_view/modal.js").ModalBase;t.ReauthWrapper=n.extend({onLoad:function(){var e=this;this.handleEvent(o.Types.WEBNODE_RPC_EXCEPTION,function(t){"reauth_required"==t.payload.exceptionType&&e.load_reauth(t.payload.requestId)})},load_reauth:function(e){return this.createModal("load_reauth_modal").kwargs({request_id:e}).show(),!1}}),t.ReauthModal=s.extend({onSubmit:function(e){if(!this.submit_disabled){var t=this,i=t._super,n=function(n){n.login_success?(t.emitEvent({type:o.Types.WEBNODE_RPC_RETRY_FAILED,scope:o.scope.GLOBAL,payload:{requestId:t.request_id}}),i.call(t,e)):t.$id("@password").val("")},s=function(){t.serverCall("load_password_leaked_dialog").contentFor(t.$id("@email_password_leak_error")).success(function(){
t.$id("@normal_subtitle").hide(),t.$id("@email_password_leak_error").removeClass("hidden"),t.submit_disabled=!0}).send()},a={password:this.$id("@password").val()};this.serverCall("verify").kwargs(a).success(n).except("password_leaked",s).send()}},onLoad:function(){this._super.apply(this,arguments);var e=this;this.$id("@password").focus(),this.$id("@password").on("keypress",function(t){13==t.keyCode&&e.onSubmit()}),this.$id("@create_password").on("click",this.sendResetPasswordEmail.bind(this)),this.$id("@forgot_password").on("click",this.sendResetPasswordEmail.bind(this))},sendResetPasswordEmail:function(e){e.preventDefault(),this.serverCall("send_reset_password_email").send()}})},"./unified_view/refresh.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js"),s=o.GlobalProxy;t.RefreshFeedButton=n.extend({onLoad:function(){var e=this;e.$refreshButtonWrapper=this.$id("@refresh_wrapper"),s.subscribe(o.Types.DISCOVER_TOOL_CONFIRMED,function(t){e.showRefreshButton();
}),e.$id("@refresh").on("click",function(){window.location.href="/"})},showRefreshButton:function(){this.$refreshButtonWrapper.removeClass("hidden")}})},"./unified_view/repeat_offender.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/onload.js");t.RepeatOffenderModalLink=n.extend({onLoad:function(){var e=this;o.execAfterLoad(function(){e.createModal("load_repeat_offender_modal").kwargs({offense_type:e.offense_type,target_type:e.target_type,level:e.level,anon:e.anon}).webOnlyOptions({closeOnBackgroundClick:!1,closeOnEscape:!1}).onSubmit(function(){e.serverCall("mark_modal_as_read").send()}).show()})}})},"./unified_view/settings/languages.js":function(e,t,i){var n,o,s=i("./shared/core/component.js").Component,a=i("./unified_view/modal.js").ModalBase,r=i("./shared/client.js");t.LeaveModalLink=s.extend({onLoad:function(){var e=this;this.$id("@leave_link").on("click",function(){e.openModal()})},openModal:function(){var e=this;e.createModal("load_modal").kwargs({
nid:e.nid}).show()}}),t.MakeNetworkDefaultLink=s.extend({onLoad:function(){var e=this;e.$id("@make_default_link").on("click",function(){e.serverCall("set_default_network").liveMutate().send()})}}),t.LeaveNetworkModal=a.extend({onLoad:function(){this._super.apply(this,arguments)},onSubmit:function(e){var t=this;t.redirectUrl&&(r.isNativeApp()?n.updateConfig(t.redirectSubdomain,t.redirectLanguage):window.location.href=t.redirectUrl),r.isNativeApp()&&o.send("updateSiloSwitcher",t.siloSwitcherData),t.serverCall("leave_network").kwargs({nid:t.nid}).success(function(){t.redirectUrl||t.close()}).liveMutate().send()}})},"./unified_view/settings/privacy.js":function(e,t,i){var n,o,s=i("./shared/core/component.js").Component,a=i("./w2.modal.js").ModalWithCallBacks,r=s.extend({onLoad:function(e){this.desktopOnLoad(e)},desktopOnLoad:function(){var e=this;this.$id("@check_reauth").on("click",function(t){e.serverCall("check_reauth").success(function(){e.showControl()}).send(),t.preventDefault()})},showControl:function(){
this.$id("@check_reauth").addClass("hidden"),this.$id("@option_control").removeClass("hidden")},showAlert:function(e){var t=this;n.showAlert({title:t.dialog_title,message:t.dialog_message,callback:function(t){0===t.buttonIndex&&e&&e()},cancelButtonTitle:t.dialog_button_title,otherButtonTitles:[o.cancel]})}});t.DeactivateAccountCell=r.extend({desktopOnLoad:function(){this._super.apply(this,arguments);var e=this;this.$id("@deactivate").on("click",function(){var t=new a(e,{});t.onSubmitCallBack(function(){e.deactivateAccount()}),t.load("load_deactivate_account_modal")})},mobileOnLoad:function(){var e=this;this.$id("@deactivate").on("click",function(){e.showAlert(e.deactivateAccount.bind(e))})},deactivateAccount:function(){this.serverCall("deactivate_account").success(function(){}).send()}}),t.DeleteAccountCell=r.extend({desktopOnLoad:function(){this._super.apply(this,arguments);var e=this;this.$id("@delete").on("click",function(){var t=new a(e,{});t.onSubmitCallBack(function(){e.deleteAccount();
}),t.load("load_delete_account_modal")})},mobileOnLoad:function(){var e=this;this.$id("@delete").on("click",function(){e.showAlert(e.deleteAccount.bind(e))})},deleteAccount:function(){this.serverCall("delete_account").success(function(){}).send()}})},"./unified_view/sharethis.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.SharethisImageTracker=n.extend({onLoad:function(){var e=this;e.image_source&&setTimeout(function(){e.delayedImageTracker()},500)},delayedImageTracker:function(){var e=new Image;e.src=this.image_source}})},"./unified_view/signup/_signup.js":function(e,t,i){function n(e){if(!e)return"";e=e.trim();var t=e.split(/\s+/);if(!t.length)return"";var i=t[0],n=i.length;return"."===i.charAt(n-1)&&n--,t.length<=1||n>1?i:t[0]+" "+t[1]}function o(e){if(!e)return"";var t=n(e),i=t.length,o=t.substring(i+1);return o=o.trim()}var s,a,r,d,l=i("./shared/core/component.js").Component,c=i("./shared/w2.context.js"),u=i("./shared/events/index.js"),h=i("./shared/recaptcha.js"),p=c.CaptchaInput,f=i("./settings-webpack.js"),_=f.interface_strings,m=(f.isLoggedIn,
i("./shared/window_manager.js")),g=null,v=i("./shared/action_log.js").ActionableComponent,w=i("./shared/action_log.js").logSecondaryAction,b=i("./shared/dom.js"),y=i("./shared/siteuri.js"),C=i("./shared/onload.js"),k=i("./unified_view/signup/scaled_inference.js");t.SignupActionableComponent=v;var x=t.SignupContext=c.Context.extend({initialProperties:function(){return{googleOauthData:null,facebookOauthData:null,emailSignupData:null,captchaResponse:"",requiresCaptcha:!1,validators:{},emailSubmitButton:null,loginData:null,showEmailSignup:!1,facebookSignupFlowData:null}}}),S=t.BaseSignupForm=v.extend({contextConstructor:function(){return x},onLoad:function(){this._super.apply(this,arguments),this.signupContext=this.getContext(x),this.signupContext.on("googleOauthData",this.onGoogleAccountConnected.bind(this)),this.signupContext.on("facebookOauthData",this.onFacebookAccountConnected.bind(this)),this.signupContext.on("emailSignupData",this.onEmailSignupFormFilled.bind(this)),this.loginInProgress=!1,
this.oauth_error_response&&this.handleServerCallResponse(this.oauth_error_response)},showLoading:function(){this.emitEvent({type:u.Types.LIVENODE_LOADING_SPINNER,payload:{show:!0}})},hideLoading:function(){this.emitEvent({type:u.Types.LIVENODE_LOADING_SPINNER,payload:{show:!1}})},setRedirectCookie:function(e){if(e.indexOf("#")>0&&(e=e.substring(0,e.indexOf("#"))),e.indexOf("?")>0){var t=e.split("?"),i=t[1].split("&"),n=["success","access_token","provider","force_dialog"];i=i.filter(function(e){var t=e.split("=")[0];return!n.includes(t)}),e=t[0]+"?"+i.join("&")}d.setCookie("login_redirect_url",e,{expires:1})},clearRedirectCookie:function(){d.setCookie("login_redirect_url")},handleServerCallResponse:function(e){if(this.hideLoading(),this.loginInProgress=!1,e.success){if(k.sendObservationToScaledInference("Signup",{}),"oauth_redirect"==e.next_action)return void(window.location=e.next_url);switch(e.next_action){case"redirect":m.navigateTo(e.next_url);break;case"refresh":m.reload()}}else if(e.isMissingFbInfo&&this.signupContext.set("facebookSignupFlowData",e.facebookOauthData),
e.next_url&&r.send("openURL",{url:e.next_url}),e.pmsg&&this.serverCall("show_error_as_pmsg").kwargs({error_message:e.pmsg}).send(),e.error_message,1,"set_password_modal"===e.next_action){var t=e.state_token;C.execAfterLoad(function(){this.createModal("load_unconfirmed_set_password_modal").kwargs({state_token:t}).show()}.bind(this))}},maybeSwitchNativeSilo:function(e){e.subdomain&&e.language?s.updateConfig(e.subdomain,e.language):this.subdomain&&this.language&&s.updateConfig(this.subdomain,this.language)},logSignupSuccessAction:function(e){w(e,this.impression_target)},onGoogleAccountConnected:function(e,t){if(t){if(this.loginInProgress)return;this.loginInProgress=!0;var i={google_access_token:t.access_token,google_auth_code_info:t.auth_code_info||!1,use_test_signup:t.use_test_signup||!1},n=function(e){this.handleServerCallResponse(e),e.success||(this.loginInProgress=!1,t.onFailure&&t.onFailure(e))};this.serverCall("on_google_account_connected").kwargs(i).success(n.bind(this)).error(function(){
this.loginInProgress=!1}.bind(this)).send(),this.showLoading()}},onFacebookAccountConnected:function(e,t){if(t){if(this.loginInProgress)return;this.loginInProgress=!0;var i={fb_uid:t.userID,fb_access_token:t.accessToken||t.access_token,expires:t.expiresIn,use_test_signup:t.use_test_signup||!1},n=function(e){this.handleServerCallResponse(e),e.success||(this.loginInProgress=!1,t.onFailure&&t.onFailure(e))};this.serverCall("on_facebook_account_connected").kwargs(i).success(n.bind(this)).error(function(){this.loginInProgress=!1}.bind(this)).send(),this.showLoading()}},onEmailSignupFormFilled:function(e,t){function i(e){if(this.handleServerCallResponse(e),e.success);else this.loginInProgress=!1,t.onFailure&&t.onFailure(),this.signupContext.get("requiresCaptcha")&&h.onInit(function(){grecaptcha.reset()})}if(!this.loginInProgress){this.$id("@email_password_leak_error").addClass("hidden"),this.loginInProgress=!0;var n=t.name,o=t.email,s=t.password,a=this.signupContext.get("captchaResponse");this.serverCall("on_try_email_signup").kwargs({
name:n,email:o,password:s,"g-recaptcha-response":a}).success(i.bind(this)).except("password_leaked",this.passwordLeakHandler.bind(this,o)).error(function(){this.loginInProgress=!1}.bind(this)).send(),this.showLoading()}},passwordLeakHandler:function(e){this.loginInProgress=!1,this.hideLoading();var t=this;this.serverCall("load_password_leaked_dialog").kwargs({email:e}).contentFor(this.$id("@email_password_leak_error")).success(function(){t.$id("@email_password_leak_error").removeClass("hidden")}).send()}});t.HomePageSignupForm=S.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;this.$id("@continue_with_email").on("click",function(){e.toggleSignupColumn(!0)}),this.$id("@cancel").on("click",function(){e.toggleSignupColumn(!1)}),this.signupContext.set("emailSubmitButton",this.$id("@submit")),this.signupContext.on("loginData",function(e,t){t&&(this.serverCall("record_no_account_found_link").send(),this.toggleSignupColumn(!0))}.bind(this)),this.signupContext.on("facebookSignupFlowData",function(){
this.toggleSignupColumn(!0)}.bind(this)),this.signupContext.get("facebookSignupFlowData")&&this.toggleSignupColumn(!0)},toggleSignupColumn:function(e){e?(this.$id("@toggled_signup_column").removeClass("hidden"),this.$id("@initial_signup_column").addClass("hidden")):(this.$id("@toggled_signup_column").addClass("hidden"),this.$id("@initial_signup_column").removeClass("hidden"))}}),t.DialogSignupFormMobile=S.extend({onLoad:function(){if(this._super.apply(this,arguments),k.sendObservationToScaledInference("SignupWallSeen",{}),this.$id("@login .normal_login .inline_login_form").removeClass("hidden"),this.dismissible){var e=g.hideSignupWall.bind(g);this.$id("@dismiss_button").on("click",e);var t="@outer_modal".replace("@",this._my());this.$id("@outer_modal").on("click",function(i){i.target.id===t&&e()})}}}),t.DialogSignupFormWeb=S.extend({onLoad:function(){if(this._super.apply(this,arguments),k.sendObservationToScaledInference("SignupWallSeen",{}),this.signupContext.set("emailSubmitButton",this.$id("@submit")),
this.$id("@login .normal_login .inline_login_form").removeClass("hidden"),this.$id("@bottom_section .login_link").on("click",this.toggleToState.bind(this,"login_state")),this.$id("@bottom_section .email_signup_link").on("click",this.toggleToState.bind(this,"email_signup_state")),this.$id("@bottom_section .social_connect_link").on("click",this.toggleToState.bind(this,"social_signup_state")),this.dismissible){var e=g.hideSignupWall.bind(g);this.$id("@bottom_section .dismiss_link").on("click",e),this.$id("@close_x").on("click",e),this.$id("@outer_form").on("click",function(t){var i="@outer_form".replace("@",this._my());t.target.id===i&&e()}.bind(this))}this.signupContext.on("loginData",function(e,t){t&&(this.serverCall("record_no_account_found_link").send(),this.toggleToState("email_signup_state"))}.bind(this)),this.signupContext.on("facebookSignupFlowData",function(){this.toggleToState("email_signup_state")}.bind(this)),this.signupContext.get("facebookSignupFlowData")&&this.toggleToState("email_signup_state");
},toggleToState:function(e){if(e!==this.current_state){var t=this.state_toggle_id_map[e],i=this.state_toggle_id_map[this.current_state];i.forEach(function(e){this.$id(e).addClass("hidden")}.bind(this)),t.forEach(function(e){this.$id(e).removeClass("hidden")}.bind(this)),this.current_state=e}}}),t.SignupCaptcha=l.extend({contextConstructor:function(){return p},onLoad:function(){this.signupContext=this.getContext(x),this.captchaContext=this.getContext(p),this.captchaContext.on("captchaResponse",this.onCaptchaResponseChanged.bind(this)),this.signupContext.set("requiresCaptcha",!0)},onCaptchaResponseChanged:function(e,t){this.signupContext.set("captchaResponse",t)}}),t.EmailSignupFormWeb=l.extend({onLoad:function(){this.signupContext=this.getContext(x),this.registerFormChecks(),this.signupContext.get("emailSubmitButton").on("click",this.onSubmitClicked.bind(this)),this.signupContext.on("loginData",this.onLoginDataReceived.bind(this)),this.signupContext.on("facebookSignupFlowData",function(e,t){
this.onFacebookSignupFlowDataReceived(t)}.bind(this));var e=this.signupContext.get("facebookSignupFlowData");e&&this.onFacebookSignupFlowDataReceived(e)},onFacebookSignupFlowDataReceived:function(e){if(this.intermediate_facebook_data=e,e.name){var t=n(e.name),i=o(e.name);this.$id("@first_name").val(t),this.$id("@last_name").val(i)}e.email&&this.$id("@email").val(e.email)},onLoginDataReceived:function(e,t){t&&(this.$id("@email").val(t.email),this.$id("@password").val(t.password))},registerFormChecks:function(){var e=this.maybeChangeEmailSubmitButton.bind(this);this.signupContext.on("captchaResponse",e),this.$id("@email").on("keyup",e),this.$id("@first_name").on("keyup",e),this.$id("@last_name").on("keyup",e),this.$id("@password").on("keyup",e)},shouldEnableEmailSubmitButton:function(){var e=this.$id("@first_name").val(),t=!this.signupContext.get("requiresCaptcha")||""!==this.signupContext.get("captchaResponse");return t&&this.$id("@email").val()&&e&&this.validatePasswordInJs()},maybeChangeEmailSubmitButton:function(){
var e=this.signupContext.get("emailSubmitButton");this.shouldEnableEmailSubmitButton()?(e.prop("disabled",!1),e.removeClass("submit_button_disabled")):(e.prop("disabled",!0),e.addClass("submit_button_disabled"))},getValidator:function(e){return this.signupContext.get("validators")[e]},validateEmailSignupFields:function(){this.getValidator("@first_name").validate(),this.getValidator("@email").validate(),this.getValidator("@password").validate()},validatePasswordInJs:function(){var e=this.$id("@password").val();return e.length<this.minimum_password_length||e.length>this.maximum_password_length?!1:"password"===e.toLowerCase()?!1:!0},onSubmitClicked:function(){if(this.validateEmailSignupFields(),this.maybeChangeEmailSubmitButton(),this.shouldEnableEmailSubmitButton()){var e=this.$id("@first_name").val()+" "+this.$id("@last_name").val();this.signupContext.set("emailSignupData",{name:e,email:this.$id("@email").val(),password:this.$id("@password").val()})}}}),t.EmailSignupFormMobile=l.extend({
onLoad:function(){var e=this;this.signupContext=this.getContext(x),this.enableDoneButton(),s.registerMessageHandler("modalDoneButtonTapped",this.trySignup.bind(this)),this.signupContext.on("requiresCaptcha",function(t,i){!t&&i&&e.disableDoneButton()}),this.signupContext.on("captchaResponse",function(t,i){""!==i?e.enableDoneButton():e.disableDoneButton()}),s.registerOneTimeMessageHandler("pageReadyComplete",function(){this.focusForm(),a.isAndroidApp()&&r.send("showKeyboard")}.bind(this))},setDoneButton:function(e){r.send("setPageAction",{rightTextButton:{title:_.done,callback:this.trySignup.bind(this),disabled:e}})},disableDoneButton:function(){this.setDoneButton(!0)},enableDoneButton:function(){this.setDoneButton(!1)},focusForm:function(){this.$id("@first_name").focus()},onSignupFailure:function(){this.enableDoneButton(),r.send("hideLoadingView",{}),this.signupContext.get("requiresCaptcha")&&this.disableDoneButton(),this.previousActiveElement?this.previousActiveElement.focus():this.$id("@password").focus();
},trySignup:function(){this.disableDoneButton(),r.send("showLoadingView",{}),this.previousActiveElement=document.activeElement,document.activeElement.blur();var e=this.$id("@first_name").val()+" "+this.$id("@last_name").val();this.signupContext.set("emailSignupData",{name:e,email:this.$id("@email").val(),password:this.$id("@password").val(),onFailure:this.onSignupFailure.bind(this)})}}),t.DialogSignupFormWrapper=l.extend({onLoad:function(){g=this,this.signupWallLoaded=!this.dismissible,this.dismissible||this.scrollToTopAndDisableScroll();var e=this;this.handleEvent(u.Types.WEBNODE_RPC_EXCEPTION,function(t){"login_required"==t.payload.exceptionType&&e.loadSignupWall()})},scrollToTopAndDisableScroll:function(){var e=b.getScrollbarWidth(),t=document.getElementsByClassName("SiteHeader")[0];document.body.style.paddingRight=e+"px",t.style.paddingRight=e+"px",document.body.classList.add("signup_wall_prevent_scroll"),document.body&&document.body.scrollTop&&(document.body.scrollTop=0),document.documentElement&&document.documentElement.scrollTop&&(document.documentElement.scrollTop=0);
},loadSignupWall:function(){return y.isSiteAbsoluteUrl(window.top.location.href)?i("./settings-webpack.js").isLoggedIn?void this.serverCall("record_attempt_to_load_signup_wall_logged_in").send():void(this.signupWallLoaded?(this.scrollToTopAndDisableScroll(),this.$id("@signup_wall_wrapper").removeClass("hidden")):(this.signupWallLoaded=!0,this.serverCall("load_signup_wall").contentFor(this.$id("@signup_wall_wrapper")).success(this.scrollToTopAndDisableScroll).send())):void 0},hideSignupWall:function(){var e=document.getElementsByClassName("SiteHeader")[0];document.body.style.paddingRight=0,e.style.paddingRight=0,this.$id("@signup_wall_wrapper").addClass("hidden"),document.body.classList.remove("signup_wall_prevent_scroll")}}),t.loadSignupWall=function(){g&&g.loadSignupWall()},t.hideSignupWall=function(){g&&g.hideSignupWall()}},"./unified_view/signup/conversion_logging.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/cookies.js"),s=i("./shared/core/component.js"),a=i("./settings-webpack.js"),r=i("./shared/jquery.js");
t.ConversionLogging=n.extend({onLoad:function(){var e=function(e){var t=e.currentTarget,i=t.getAttribute("href");if(i&&"#"!=i){for(var n=s.getComponentFromElement(t),r=[],d=0;3>d&&n&&n.__vcon;d++)r.push(n),n=n.parent();var l=[];for(d=0;d<r.length;d++)l.push(r[d].__vcon[0]);var c=[];c.push(a.controller),c.push(a.action),c.push(window.location.pathname);var u=c.concat(l);JSON.stringify(u).length<400&&o.setMessage("cl",u)}};r("a").on("click",e)}})},"./unified_view/signup/facebook.js":function(e,t,i){var n=i("./unified_view/signup/_signup.js").SignupContext,o=i("./shared/oauth.js"),s=i("./shared/facebook.js"),a=i("./unified_view/signup/_signup.js").SignupActionableComponent;t.SignupFacebookConnectButton=a.extend({onLoad:function(){this._super.apply(this,arguments),this.signupContext=this.getContext(n),this.$id("@facebook_connect_button").on("click",this.clicked.bind(this)),s.load()},clicked:function(){this.serverCall("log_click_to_funnel").send(),o.facebookConnect(this,this.onConnectSucceeded.bind(this),this.onConnectFailed.bind(this)),
i("./settings-webpack.js").instance.includes("test")&&document.addEventListener("facebook_ui_test_event",function(e){var t={userID:e.detail.fb_uid,accessToken:e.detail.fb_access_token,expiresIn:e.detail.expires,use_test_signup:e.detail.use_test_signup};this.onConnectSucceeded(t)}.bind(this))},onConnectSucceeded:function(e){this.signupContext.set("facebookOauthData",e)},onConnectFailed:function(){}})},"./unified_view/signup/footer.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./unified_view/signup/_signup.js");t.SignupFooter=n.extend({onLoad:function(){var e=this;e.$id("@dismiss").click(function(t){t.preventDefault(),e.$id("@signup_container").addClass("hidden"),e.$id("@footer_gradient").addClass("hidden")}),e.$id("@signup_prompt").click(function(){return e.serverCall("log_browser_id").send(),o.loadSignupWall(),!1}),e.$id("@signin_link").click(function(){return e.serverCall("log_browser_id").send(),o.loadSignupWall(),!1}),e.$id("@signup_button").click(function(){
return e.serverCall("log_browser_id").send(),o.loadSignupWall(),!1})}})},"./unified_view/signup/google.js":function(e,t,i){var n,o,s=i("./unified_view/signup/_signup.js").SignupContext,a=i("./settings-webpack.js"),r=i("./shared/oauth.js"),d=i("./shared/window_manager.js"),l=i("./unified_view/signup/_signup.js"),c=i("./shared/google_.js"),u=l.SignupActionableComponent,h=i("./shared/core/component.js").Component;window.loginInProgress=!1,t.SignupGoogleConnectButton=u.extend({onLoad:function(){this._super.apply(this,arguments),this.signupContext=this.getContext(s),this.$id("@google_connect_button").on("click",this.onClick.bind(this)),r.googleOnLoad(this,this.onConnectSuceeded.bind(this),this.onConnectFailed.bind(this))},onClick:function(){r.googleConnect(this,this.onConnectSuceeded.bind(this),this.onConnectFailed.bind(this)),i("./settings-webpack.js").instance.includes("test")&&document.addEventListener("google_ui_test_event",function(e){var t={access_token:e.detail.access_token,use_test_signup:!0,
auth_code_info:null};this._setGoogleOauthDataOnConnectSucceeded(t)}.bind(this))},_setGoogleOauthDataOnConnectSucceeded:function(e){this.signupContext.set("googleOauthData",e)},onConnectSuceeded:function(e){this._setGoogleOauthDataOnConnectSucceeded(e)},onConnectFailed:function(e){this.onConnectFailedWeb()},onConnectFailedWeb:function(){this.serverCall("render_google_connect_failed_message").send()},onConnectFailedMobile:function(e){n.showAlert({title:this.mobile_data.error_title,message:this.mobile_data.error_message})}}),t.GoogleEndpointComponent=h.extend({onLoad:function(){window.opener.postMessage(this.response,window.location.origin),window.close()}}),t.GoogleAutoLoginWeb=h.extend({onLoad:function(){var e=this;c.onInit(function(){window.gapi.auth.authorize({immediate:!0,client_id:a.googleClientId,cookiepolicy:a.googleCookiePolicy,scope:e.scopes},e.signInCallback.bind(e))})},signInCallback:function(e){e&&void 0===e.error&&this.onLogin(e)},onLogin:function(e){window.loginInProgress!==!0&&(window.loginInProgress=!0,
this.serverCall("try_auto_login").kwargs({access_token:e.access_token}).success(function(e){e&&"post_reload"===a.pageMode&&d.reload(),window.loginInProgress=!1}).error(function(){window.loginInProgress=!1}).except(function(){window.loginInProgress=!1}).send())}}),t.GoogleAutoLoginMobile=h.extend({onLoad:function(){var e=this;this.requestedGoogleAPI=!1,c.onInit(function(){window.gapi.auth.authorize({immediate:!0,client_id:a.googleClientId,cookiepolicy:a.googleCookiePolicy,scope:e.scopes},e.signInCallback.bind(e))})},signInCallback:function(e){e&&void 0===e.error&&this.serverCall("try_auto_login").kwargs({access_token:e.access_token}).success(this.onLogin.bind(this)).send()},onLogin:function(e){if(e){var t=function(){o.send("loginStateChanged",{isLoggedIn:!0})},i={name:"login_redirect_url",value:this.redirect_url,options:{expires:1}};o.send("setCookie",i,t)}}})},"./unified_view/signup/oauth.js":function(e,t,i){var n=i("./shared/core/component.js").Component;i("./shared/client.js");t.PermissionsMain=n.extend({
onLoad:function(){var e=this;this.$id("@accept_button").on("click",function(){e.serverCall("authenticate_user").success(function(e){window.location=e.location}).send()})}})},"./unified_view/signup/scaled_inference.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/scaled_inference.js"),s=null;t.ScaledInferenceInterface=n.extend({onLoad:function(){s=this,o.load(),this.shouldMakeDecision&&o.onApiLoaded(this.makeDecision.bind(this))},makeDecision:function(){var e=this;void 0!==window.amp&&window.amp.decide(this.scaledInferenceExperimentDecisionName,this.scaledInferenceExperimentDecisionData,function(t,i){!t&&i&&e.serverCall("record_decision").kwargs({connect_buttons:i.connectButtons,explanation:i.explanation}).send()})},sendObservation:function(e,t){o.onApiLoaded(function(){void 0!==window.amp&&window.amp.observe(e,t)})}}),t.sendObservationToScaledInference=function(e,t){null!==s&&s.sendObservation(e,t)}},"./unified_view/smyte.js":function(e,t,i){var n=i("./shared/core/component.js").Component;
t.SmyteComponent=n.extend({onLoad:function(){i("./third_party/smyte.js").asyncInit(this.api_key,this.session_id,this.uid)}})},"./unified_view/survey.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./unified_view/modal.js").ModalBase,s=i("./shared/errors.js"),a=i("./shared/events/index.js");t.SurveyMobileLink=n.extend({onLoad:function(){var e=this;e.$id("@mobile_link").on("click",function(){e.createModal("load_modal").kwargs({survey_id:e.survey_id,extra_data:e.extra_data,actor_id:e.actor_id}).show(),e.$id("@mobile_link").addClass("hidden")}),e.serverCall("mark_as_seen").kwargs({}).send()}}),t.SurveyMobileLinkLoggedOut=n.extend({onLoad:function(){var e=this;e.$id("@mobile_link").on("click",function(){e.createModal("load_modal").kwargs({survey_id:e.survey_id,extra_data:e.extra_data,uid:e.uid}).show(),e.$id("@mobile_link").addClass("hidden")}),e.serverCall("mark_as_seen").kwargs({}).send()}}),t.SurveyModalWrapper=o.extend({onLoad:function(){this.child("survey_in_modal").onSubmit(this.close.bind(this));
}}),t.Survey=n.extend({onLoad:function(){var e=this;e.index=0,e.on_last_question=!1,e.buttons_attached=[],1==e.num_of_questions&&(e.on_last_question=!0),e._bindSurveyCellClickHandler(),e.serverCall("mark_as_seen").kwargs({}).send()},onSubmit:function(e){this.__submitCallback=e},_bindSurveyCellClickHandler:function(){for(var e=this,t=this.children(),i=0;i<t.length;i++){var n=t[i];n.setResponseChangeCallback&&n.setResponseChangeCallback(e._enableButton.bind(e))}},_enableButton:function(e){var t=this;t.buttons_attached[e]||(t.buttons_attached.push(!0),t.on_last_question?(t.$id("@submit_button_"+e).removeClass("disabled"),t.$id("@submit_button_"+e).on("click",function(){t._cleanupAndSubmit()})):(t.$id("@next_button_"+e).removeClass("disabled"),t.$id("@next_button_"+e).on("click",function(){t._handleNext()})))},_showNextQuestion:function(){var e=this;e.$id("@question_"+e.index).addClass("hidden"),e.index++,e.$id("@question_"+e.index).removeClass("hidden"),e.index+1==e.num_of_questions&&(e.on_last_question=!0);
},_handleNext:function(){var e=this;e._recordResponse(!1),e._showNextQuestion()},_cleanupAndSubmit:function(){var e=this;e.$id("@done_message").css("height",e.$id("@survey").css("height")),e.$id("@survey").addClass("survey_fade_out"),setTimeout(function(){e.$id("@survey").addClass("hidden"),e.$id("@done_message").removeClass("hidden"),setTimeout(function(){e.$id("@done_message").css("height",0),e.$id("@done_inner").addClass("hidden"),e.$id("@done_message").addClass("collapse"),e._recordResponse(!0),setTimeout(function(){e.$id("@done_message").addClass("hidden"),e.__submitCallback&&e.__submitCallback()},200)},1e3)},200)},_recordResponse:function(e){var t=this,i=t.child("answer_section_"+t.index).getResponse();t.serverCall("record_response").kwargs({question_index:t.index,response:i,is_last_question:e}).liveMutate().send()}}),t.NuxIntentSurvey=t.Survey.extend({_cleanupAndSubmit:function(){var e=this;e.emitEvent({type:a.Types.NUX_DIALOG_NEXT_STEP,payload:{stage:"followTopics"}}),e.should_animate_out?e._super():e._recordResponse(!0);
}}),t.ResponseSection=n.extend({setResponseChangeCallback:function(e){var t=this;t.$id("@section").on("click",function(){e(t.index)})},getResponse:function(){var e=this.child("response_type");return e?e.getResponse():(s.logJsError("SurveyResponseSection","A ResponseSection should have a ResponseType in it."),"")}}),t.ResponseType=n.extend({onLoad:function(){var e=this;e.selectedIndex=null,e.$id("@response .survey_cell.radio").on("click",function(t){var i=t.currentTarget.dataset.index;if(null!==e.selectedIndex&&i!=e.selectedIndex){var n=e.getIdForSelection(e.selectedIndex);e.$id(n).removeClass("selected"),e.$id(n).prop("checked",!1)}var o=e.getIdForSelection(i);e.$id(o).addClass("selected"),e.$id(o).prop("checked",!0),e.selectedIndex=i})},getIdForSelection:function(e){return"@value-"+e},getResponse:function(){return this.$id("@value-"+this.selectedIndex).val()}}),t.FreeResponse=t.ResponseType.extend({getResponse:function(){return this.$id("@response .free_response").val()}}),t.MultipleChoiceWithOther=t.ResponseType.extend({
getResponse:function(){return this.num_of_options.toString()==this.selectedIndex?"Other: "+this.$id("@other_input").val():this._super()}})},"./unified_view/switch.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.Switch=n.extend({onLoad:function(){this.getSwitch().on("click",this.handleClick.bind(this))},handleClick:function(){var e=this.getSwitch();e.hasClass("on")?this.toggleOff(e):this.toggleOn(e),this.toggleOnOffClasses(e)},toggleOnOffClasses:function(e){e.toggleClass("on").toggleClass("off")},toggleOff:function(e){this.serverCall("off").kwargs(this.kwargs).liveMutate().error(function(){e.removeClass("on").addClass("off")}).send()},toggleOn:function(e){this.serverCall("on").kwargs(this.kwargs).liveMutate().error(function(){e.addClass("on").removeClass("off")}).send()},getSwitch:function(){return this.$id("@switch")}})},"./unified_view/threaded_comments.js":function(e,t,i){var n=i("./unified_view/toggle.js").ToggleBase,o=i("./shared/logging.js");t.FeaturedCommentsPreview=n.extend({
switchEnd:function(){o.log("comments_toggled",{comment_type:this.comment_type,object_id:this.aid}),this._super.apply(this,arguments)}})},"./unified_view/toggle.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/errors.js"),s=i("./shared/debounce.js").debounce,a=i("./shared/toast.js"),r=i("./shared/perf.js"),d=i("./shared/viewport.js");t.ToggleBase=n.extend({onLoad:function(){this._userPerceivedAction=null,this.fetchCalled=!1,this.fetchCompleted=!1,this.switchCompleted=!1,this.switchPending=!1,this.$fetchInto=this.$id(this.fetch_into),this.$switchShow=this.optional$id(this.switch_show),this.$switchHide=this.optional$id(this.switch_hide),this.$loadingShow=this.optional$id(this.loading_show),this.$loadingHide=this.optional$id(this.loading_hide),this.$fetchOnElem=this.fetch_on.length>1?this.$id(this.fetch_on[1]):this.$switchHide,this.$switchOnElem=this.switch_on.length>1?this.$id(this.switch_on[1]):this.$switchHide,this.bindFetch(),this.handleSwitch(),this.fetchCompleted||this.$fetchInto||o.logJsError("Toggle","$fetchInto undefined but fetch is not completed.");
},optional$id:function(e){return e?this.$id(e):null},bindFetch:function(){switch(this.fetch_on[0]){case"request":this.fetchCalled=!0,this.fetchCompleted=!0;break;case"load":this.fetch();break;case"js":break;case"view":case"hover":case"click":var e=this.fetch_on[0];if(!this.$fetchOnElem)return void o.logJsError("Toggle","$fetchOnElem undefined for view/hover/click triggers.");"hover"==e?this.bindHover(this.$fetchOnElem,this.fetch.bind(this)):"view"==e?this.bindInViewPort(this.$fetchOnElem,this.fetch.bind(this)):this.bindClick(this.$fetchOnElem,this.fetch.bind(this));break;default:throw new Error("Invalid fetch trigger specified "+this.fetch_on)}},handleSwitch:function(){switch(this.switch_on[0]){case"request":this.fetchCalled=!0,this.fetchCompleted=!0,this.switchCompleted=!0;break;case"load":this.triggerSwitch();break;case"js":break;case"view":case"hover":case"click":var e=this.switch_on[0];if(!this.$switchOnElem)return void o.logJsError("Toggle","$switchOnElem undefined for view/hover/click triggers.");
"hover"==e?this.bindHover(this.$switchOnElem,this.triggerSwitch.bind(this)):"view"==e?this.bindInViewPort(this.$switchOnElem,this.triggerSwitch.bind(this)):this.bindClick(this.$switchOnElem,this.triggerSwitch.bind(this));break;default:throw new Error("Invalid show trigger specified "+this.switch_on)}},fetch:function(){this.fetchCalled||(this.fetchCalled=!0,this.serverCall("fetch_toggled_component").kwargs({serialized_args:this.serialized_args}).disableDefaultUserPerceivedLogging().sendJsData(!1).contentFor(this.$fetchInto.get(0)).success(this.onFetched.bind(this)).error(this.onFetchError.bind(this)).send({batched:!0}))},onFetchError:function(){this.switchPending&&"click"==this.switch_on[0]&&a.showPleaseTryAgainError(),this.switchPending=!1,this.fetchCalled=!1,this.exitLoadingState()},onFetched:function(){this.fetchCompleted=!0,this.switchPending&&(this.switchPending=!1,this.triggerSwitch())},enterLoadingState:function(){this.$loadingShow&&this.$loadingShow.removeClass("hidden"),this.$loadingHide&&this.$loadingHide.addClass("hidden");
},exitLoadingState:function(){this.$loadingShow&&this.$loadingShow.addClass("hidden")},actualSwitch:function(){this.switchCompleted||(this.switchCompleted=!0,this.$switchShow&&this.$switchShow.toggleClass("hidden"),this.$switchHide&&this.$switchHide.toggleClass("hidden"))},triggerSwitch:function(){this.switchStart(),this.fetch(),this.fetchCompleted?(this.exitLoadingState(),this.actualSwitch(),this.switchEnd()):(this.switchPending=!0,this.enterLoadingState())},switchStart:function(){this.log_switch_time&&(this._userPerceivedAction=r.startUserPerceived({vcon:this.__vcon,method:"fetch_toggled_component"}))},switchEnd:function(){this.log_switch_time&&(this.log_switch_time=!1,this._userPerceivedAction&&(r.finishAction(this._userPerceivedAction),this._userPerceivedAction=null))},_isLinkedAnchorTag:function(e){return"A"==e.tagName&&e.getAttribute("href")&&"#"!=e.getAttribute("href")},bindClick:function(e,t){var i=this;e.on("click",function(n){for(var o=n.target;o&&o!=e.get(0);){if(i._isLinkedAnchorTag(o))return;
o=o.parentElement}n.preventDefault(),t()})},bindHover:function(e,t){e.on("mouseenter",t)},bindInViewPort:function(e,t){if(d.isElementInViewport(e.get(0)))t();else{var i={leading:!0},n=s(function(){d.isElementInViewport(e.get(0))&&(t(),window.removeEventListener("scroll",n))},50,i);window.addEventListener("scroll",n)}}})},"./unified_view/translation.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.TranslationInterfaceToggle=n.extend({onLoad:function(){this._state=!1,this.setupKeyboardShortcut()},toggle:function(){var e,t=this,i=document.getElementsByClassName("translation_interface_info");if(t._state)for(t._state=!1,e=0;e<i.length;e++)i[e].style.display="none";else for(t._state=!0,e=0;e<i.length;e++)i[e].style.display="block"},setupKeyboardShortcut:function(){i("./shared/keystrokes.js").on([76,73,68,76,73,68],this.toggle.bind(this))}})},"./unified_view/twitter.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/twitter.js");t.TwitterFollowButton=n.extend({
onLoad:function(){o.onInit(function(){})}})},"./unified_view/util.js":function(e,t){t.positionForElement=function(e){for(var t=0,i=0,n=e.offsetWidth,o=e.offsetHeight;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-e.scrollLeft,i+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{left:t,top:i,width:n,height:o}}},"./unified_view/write/writing_list.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./unified_view/modal.js").ModalBase;t.RemoveAllWritingListLink=n.extend({onLoad:function(){var e=this;this.$id("@confirmation_dialogue").on("click",function(){return e.showModal(),!1})},showModal:function(){this.createModal("load_modal").show()}}),t.RemoveAllWritingListConfirmationModal=o.extend({onSubmit:function(){var e=this._super.bind(this);this.serverCall("remove_all").success(function(t){e(t)}).liveMutate().send()}})},"./unified_view/zapdos/wall.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.DialogZapdosFormWrapper=n.extend({
onLoad:function(){var e=this;e.scrollToTopAndDisableScroll(),e.$id("@background").on("click",function(){e.dismissZapdosWall()}),e.handleEvent(o.Types.ZAPDOS_WALL_DISMISS,function(t){e.dismissZapdosWall(t.payload.cardType)})},scrollToTopAndDisableScroll:function(){window.scrollTo(0,0),document.body.classList.add("zapdos_wall_prevent_scroll")},dismissZapdosWall:function(e){var t=this;this.serverCall("dismiss_wall").kwargs({card_type:t.card_type}).send(),this.$id("@zapdos_wall_wrapper").removeClass("show"),document.body.classList.remove("zapdos_wall_prevent_scroll")}}),t.ZapdosWallBase=n.extend({onLoad:function(){var e=this;e.serverCall("log_impression").send(),e.$id("@close").on("click",function(){e.dismissWall()})},dismissWall:function(){var e=this;this.emitEvent({type:o.Types.ZAPDOS_WALL_DISMISS,payload:{cardType:e.card_type}})}}),t.CancelWallButton=n.extend({onLoad:function(){var e=this;e.$id("@cancel_link").on("click",function(){e.dismissWall()})},dismissWall:function(){var e=this;e.emitEvent({
type:o.Types.ZAPDOS_WALL_DISMISS,payload:{cardType:e.card_type}})}}),t.ConfirmWallButton=n.extend({onLoad:function(){var e=this;e.$id("@confirm_link").on("click",function(){e.serverCall("confirm_clicked").kwargs({card_type:e.card_type}).send()})}})},"./video.js":function(e,t,i){var n=i("./shared/jquery.js");t.handleVideosBeforeSelectionHidden=function(e){e.find(".qtext_embed").each(function(t,i){e.find("iframe")&&n(i).parent().empty()})},t.stopAllVideos=function(e){e.find(".qtext_embed").each(function(e,t){n(t).find("iframe").each(function(e,t){var i=n(t).attr("src");i&&-1!==i.indexOf("autoplay=1")&&(i=i.replace("autoplay=1","autoplay=0")),n(t).attr("src",i)})})}},"./view/announcement.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.Announcement=n.extend({onLoad:function(){var e=this;this.$id("@close").click(function(){return e.closeAnnouncement("x"),!1}),this.serverCall("track_announcement_view").send()},closeAnnouncement:function(e){this.serverCall("close_announcement").kwargs({
closing_action:e}).liveMutate().send()}})},"./view/board_selector.js":function(e,t,i){var n=i("./view/selector.js").Selector,o=i("./view/selector.js").SelectorWithTypeaheadLogMixin;t.BoardSelector=n.extend(o).extend({onLoad:function(){var e=this;this._super.apply(this,arguments),e.$input_wrapper=e.$id("@input_wrapper"),e.$selected_board_wrapper=e.$id("@selected_board_wrapper"),e.$new_board_name_wrapper=e.$id("@new_board_name_wrapper"),e.$new_board_name=e.$id("@new_board_name"),e.$change_create_board=e.$id("@change_create_board");var t=function(t){t.preventDefault(),t.stopPropagation(),e.$change_create_board.addClass("hidden"),e.clear(),e.$input.focus()};e.$change_create_board.click(t)},shouldTypeaheadLog:function(e){var t=this.child("results");return!!e&&"board"===e.ty&&!!t.typeahead_log_data},resultWasSelected:function(e,t){this._super.apply(this,arguments);var i=this;"board"===e.ty?(i.selected_board={name:null,bid:e.data.bid,is_submission:!!e.data.is_submission},i.serverCall("update_selected_board").kwargs({
bid:e.data.bid}).contentFor(i.$selected_board_wrapper).success(function(){i.$wrapper.focusout(),i.$input_wrapper.addClass("hidden"),i.$new_board_name_wrapper.addClass("hidden"),i.$selected_board_wrapper.removeClass("hidden"),i.$change_create_board.removeClass("hidden")}).send()):"additem"===e.ty?(this.selected_board={name:i.query,bid:null,is_submission:!1},i.$new_board_name.text(i.query),i.$wrapper.focusout(),i.$input_wrapper.addClass("hidden"),i.$selected_board_wrapper.addClass("hidden"),i.$new_board_name_wrapper.removeClass("hidden"),i.$change_create_board.removeClass("hidden")):console.assert(!1)},clear:function(){this.setQuery(""),this.$input_wrapper.removeClass("hidden"),this.$selected_board_wrapper.addClass("hidden"),this.$selected_board_wrapper.empty(),this.$new_board_name_wrapper.addClass("hidden"),this.$new_board_name.empty(),this.selected_board=null}})},"./view/captcha.js":function(e,t,i){var n=i("./shared/recaptcha.js"),o=i("./shared/events/index.js"),s=i("./shared/core/component.js").Component,a=i("./view/modal.js").Base;
t.Captcha=s.extend({onLoad:function(){var e=this;this.handleEvent(o.Types.WEBNODE_RPC_EXCEPTION,function(t){"captcha_required"==t.payload.exceptionType&&e.load_captcha()})},load_captcha:function(){return this.createModal("load_captcha_modal").show(),!1}}),t.CaptchaModal=a.extend({onLoad:function(){this._super.apply(this,arguments);var e=this,t=function(){e.serverCall("on_captcha_verified").liveMutate().success(function(){e._closeModal()}).send()};n.onInit(function(){grecaptcha.render(e.$id("@captcha")[0],{sitekey:e.recaptcha_key,theme:"light",callback:t})})}})},"./view/dialog.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./tooltip.js"),a=i("./w2.dialog.js"),r=a.Dialog;t.Dialog=n.extend({onLoad:function(){var e=this;this.successCallback=null,this.ok2Submit=!0,this.submitted=!1,this.$id("@submit").click(function(t){e.submit(),t.preventDefault()}),this.$id("@cancel").click(function(t){e.close(),t.preventDefault()})},submit:function(){this.request();
},request:function(){var e=this.getPars();!this.submitted&&e&&this.ok2Submit&&(this.submitted=!0,this.submitServerCall(e))},getPars:function(){return{}},setSetup:function(e){var t=this;e.each(function(e,i){t.options[e]=i})},setSuccessCallback:function(e){this.successCallback=e},close:function(){o("#generic_dialog").length?o("#generic_dialog").remove():r.dialogFor(this).close_()},submitServerCall:function(e){var t=this;this.serverCall("dialog_submit_controller").liveMutate().kwargs(e).success(function(e){t.successCallback&&t.successCallback(e),t.close()}).send()}}),t.AddCommentDialog=t.Dialog.extend({onLoad:function(){this._super.apply(this,arguments),this.editor=this.child("editor"),this.editor.focus()},getPars:function(){return this.comment_required&&this.editor.isOnlyWhiteSpace()?!1:{comment:this.editor.serialize()}}}),t.DialogLink=n.extend({onLoad:function(){var e=this;this.tooltip&&s.attach(this.$id("@link"),this.tooltip),this.$id("@link").click(function(t){e.click(),t.preventDefault();
})},containsNonLatinCodepoints:function(e){return/[^\u0000-\u00ff]/.test(e)},addOption:function(e,t){t&&this.containsNonLatinCodepoints(JSON.stringify(t))&&(t=window.unescape(encodeURIComponent(t))),this.options[e]=t},click:function(){a.createDialog(this).load("get_dialog",{kwargs:{ty:this.type,object_id:this.object_id,options:this.options}})},triggerClick:function(e){o.each(e,this.addOption.bind(this)),this.click()}})},"./view/editable_list.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./settings-webpack.js").interface_strings;t.EditableList=n.extend({onLoad:function(){var e=this;e.setEditLink(),setTimeout(function(){e.update()},1),e.initState(),e.bindClickHandler()},setEditLink:function(){this.editLink=this.$id("@edit")},initState:function(){this.editLink.removeClass("hidden")},bindClickHandler:function(){var e=this;this.editLink.click(function(t){t.preventDefault(),e.toggleEdit()})},toggleEdit:function(){this.is_editing=!this.is_editing,this.update()},update:function(){
this.is_editing?(this.$id("@wrapper").addClass("is_editing"),this.editLink.text(o.done)):(this.$id("@wrapper").removeClass("is_editing"),this.editLink.text(this.edit_text))}}),t.EditableListItem=n.extend({onLoad:function(){var e=this;this.$id("@remove").click(function(t){e.serverCall("remove").liveMutate().send()})}})},"./view/embed.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js");t.ExternalEmbed=n.extend({onLoad:function(e){var t=this;this.$id("@embed_logo").mouseover(function(){t.$id("@embed_logo").css({"background-position":"0 -20px"}).animate({right:"0px"},80)}),this.$id("@external_embed_wrapper").on("mousedown",'a[href!="#"]',function(e){var t=o(e.currentTarget);t.attr("target","_blank")})}})},"./view/filter_nav_list.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./shared/events/index.js"),a=i("./shared/window_manager.js");t.FilterNavListItem=n.extend({onLoad:function(){var e=this;this.$id("@item").on("click",function(){
var t=o(this);if(t.hasClass("selected"))return!1;var i=t.attr("data-value");return e.updateDataAndReloadList(e.data_key,i),!1})},updateDataAndReloadList:function(e,t){var i=a.parseURLParams(window.location.search.substring(1).replace(/\+/g,"%20"));i[e]=t;for(var n in i)("all"===i[n]||""===i[n])&&delete i[n];var s=o.param(i);window.location=window.location.pathname+"?"+s}}),t.FilterMultipleValuesNavListBase=n.extend({onLoad:function(){var e=this;this.handleEvent(s.Types.FILTER_NAV_LIST_UPDATE,function(t){t.payload.key==e.data_key&&t.payload.remove&&e.removeFilterFromKey(t.payload.remove)})},updateDataAndReloadList:function(e){var t=o.param(e);window.location=window.location.pathname+"?"+t},addFilterToKey:function(e){var t=this.data_key,i=a.parseURLParams(window.location.search.substring(1).replace(/\+/g,"%20")),n=[];if("followed"==i[t]&&delete i[t],i[t]&&(n=i[t].split(" ")),0===n.length)i[t]=e;else{n.push(e);var o=n.join(" ");i[t]=o}this.updateDataAndReloadList(i)},removeFilterFromKey:function(e){
var t=this.data_key,i=a.parseURLParams(window.location.search.substring(1).replace(/\+/g,"%20")),n=i[t].split(" "),o=n.indexOf(e);if(o>-1){n.splice(o,1);var s=n.join(" ");i[t]=s}for(var r in i)("all"===i[r]||""===i[r])&&delete i[r];this.updateDataAndReloadList(i)}}),t.FilterMultipleValuesNavListItemBase=n.extend({onLoad:function(){var e=this;this.$id("@remove").click(function(){return e.emitEvent({type:s.Types.FILTER_NAV_LIST_UPDATE,payload:{key:e.data_key,remove:e.filter_value.toString()}}),!1})}})},"./view/filterable_list.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.FilterableList=n.extend({onLoad:function(){this.lastQuery=null,this.delay=100;var e=this;this.$id("@search").keyup(function(){var t=function(t){e.fetchResults(t)};setTimeout(t,e.delay,e.$id("@search").val())}),this.$id("@search_link").click(function(){return e.$id("@search_link").hide(),e.$id("@bullet").hide(),e.$id("@search").show().focus(),e.$id("@after_search").show().focus(),e.$id("@search_row").show().focus(),
!1})},newQueryEntered:function(e){},fetchResults:function(e){var t=this;e==this.$id("@search").val()&&e!=this.lastQuery&&(e&&""!==e&&e!=this.lastQuery?(this.serverCall("search_results").kwargs({query:e}).contentFor(this.$id("@search_results"),{useLoadingSpinner:!1}).success(function(){var e=t.$id("@search").val();e&&""!==e?(t.$id("@search_results").show(),t.$id("@default").hide()):(t.$id("@search_results").hide(),t.$id("@default").show())}).send(),this.lastQuery=e,this.newQueryEntered(e)):""===e&&(this.$id("@search_results").hide(),this.$id("@default").show()))}})},"./view/fixable2.js":function(e,t,i){function n(){return y.mobile||y.tablet}function o(e,t){if(("object"!=typeof t||null===t)&&(t={}),!n()||t.enable_mobile){var i=_(t.header)||document.querySelector(".SiteHeader"),o=_(t.footer)||null,d=i&&i.offsetHeight||0,l=i&&w(i).top||0,u={winHeight:x.innerHeight,winWidth:x.innerWidth,winScroll:document.body.scrollTop,scrollingDown:!0,elPosition:window.getComputedStyle(e).position,elTop:parseInt(window.getComputedStyle(e).top),
elWidth:e.offsetWidth,topSpacing:0};t=C.extend({scroll_dep:!1,height_dep:!0,width_dep:!0,header:i,footer:o,extra_top_spacing:t.extra_top_spacing||0,extra_bottom_spacing:t.extra_bottom_spacing||0,min_scroll:a(e,i,u.winScroll),max_scroll:r(e,i,o,u.winScroll),min_height:e.offsetHeight+d+l-u.winScroll,min_width:u.elWidth,sticky_release:!0,custom_trigger:null,enable_mobile:!1,min_scroll_callback:null,max_scroll_callback:null,responsive_width:!1},t),t.min_scroll-=t.extra_top_spacing,t.max_scroll-=t.extra_top_spacing+t.extra_bottom_spacing,u.topSpacing=w(e).top-t.min_scroll-parseInt(window.getComputedStyle(e)["margin-top"]),c(e,t,u),k.push(new s(e,t,u))}}function s(e,t,i){this.el=e||null,this.options=t||{},this.state=i||{}}function a(e,t,i){var n=w(e).top,o=t&&t.offsetHeight||0,s=(t&&w(t).top||0)-i,a=parseInt(window.getComputedStyle(e)["margin-top"]);return n-o-s-a}function r(e,t,i,n){var o=i&&w(i).top||0,s=w(e).top,r=e.offsetHeight,d=parseInt(window.getComputedStyle(e)["margin-bottom"]);return a(e,t,n)+o-s-r-d;
}function d(e){var t={scrollTop:document.body.scrollTop,height:x.innerHeight,width:x.innerWidth};T||requestAnimationFrame(l.bind(null,e,t)),T=!0}function l(e,t){var i=e.type;k.filter(function(e){return"w2.fixable.trigger"===i?e.getDependencies().custom:e.getDependencies()[i]}).forEach(function(i){var n=i.state.winScroll;C.extend(i.state,{winScroll:t.scrollTop,winHeight:t.height,winWidth:t.width,customTop:e.top||i.state.customTop||null}),i.state.scrollingDown=i.state.winScroll>n,c(i.el,i.options,i.state)}),T=!1}function c(e,t,i){u(e,t,i)?h(e,t,i):p(e,t,i)}function u(e,t,i){if("none"===window.getComputedStyle(e).display)return!1;var n=!0;return null!==t.custom_trigger?n=t.custom_trigger(t,i):t.scroll_dep&&(n=$.scroll(t,i)),n&&(t.height_dep&&(n=$.height(t,i)),t.width_dep&&(n=n&&$.width(t,i))),n}function h(e,t,i){if(!e.classList.contains("fixable_fixed")){var n,o=i.topSpacing;i.elWidth=e.offsetWidth,g(e),null!==t.custom_trigger&&null!==i.customTop?(o=i.customTop,i.customTop=null):t.scroll_dep||(o=w(e).top+parseInt(window.getComputedStyle(e)["margin-top"])),
e.style.top=o+"px",e.style.position="fixed",e.style.width=t.responsive_width?"100%":i.elWidth+"px",e.classList.add("fixable_fixed");try{n=new window.Event("w2.fixable.fixed")}catch(s){n=document.createEvent("Event"),n.initEvent("w2.fixable.fixed",!0,!0)}e.dispatchEvent(n)}}function p(e,t,i){var n;if(e.classList.contains("fixable_fixed")){null!==t.custom_trigger&&(i.customTop=parseInt(window.getComputedStyle(e).top)),i.scrollingDown&&null===t.custom_trigger&&t.sticky_release?(e.style.top=t.max_scroll-t.min_scroll+"px",e.style.position="relative"):(e.style.top=i.elTop+"px",e.style.position=i.elPosition),v(e),e.classList.remove("fixable_fixed");try{n=new window.Event("w2.fixable.unfixed")}catch(o){n=document.createEvent("Event"),n.initEvent("w2.fixable.unfixed",!0,!0)}e.dispatchEvent(n)}}function f(e){for(var t=0,i=k.length;i>t;t++)if(e===k[t].el)return t;return-1}function _(e){if(b&&e instanceof b){if(e.length>=2)throw new Error("Error in makeFixable(): getDomNode must only have a single element. (check the fixable element, header, and footer, are not collections)");
return e[0]}return e}function m(e){var t=document.createElement("div"),i=window.getComputedStyle(e);return t.classList.add("fixable_clone"),t.style.height=e.offsetHeight+"px",t.style.width=e.offsetWidth+"px",t.style["margin-top"]=i["margin-top"],t.style["margin-right"]=i["margin-right"],t.style["margin-bottom"]=i["margin-bottom"],t.style["margin-left"]=i["margin-left"],t}function g(e){var t=m(e),i=e.parentNode;return i.replaceChild(t,e),t.appendChild(e),t}function v(e){var t=e.parentNode.parentNode;return t.replaceChild(e,e.parentNode),e}function w(e){var t=e.getBoundingClientRect();return{top:t.top+document.body.scrollTop,left:t.left+document.body.scrollLeft}}var b=i("./shared/jquery.js"),y=i("./shared/browser.js"),C=i("./shared/util.js"),k=[],x=window,S=document,E=["resize","scroll","w2.fixable.trigger"],T=!1,$={height:function(e,t){return t.winHeight>=e.min_height},width:function(e,t){return t.winWidth>=e.min_width},scroll:function(e,t){if(e.min_scroll>=0&&(e.min_scroll_callback||e.max_scroll_callback)){
var i=e.min_scroll;e.min_scroll_callback&&(i=e.min_scroll_callback());var n=e.max_scroll;return e.max_scroll_callback&&(n=e.max_scroll_callback(),e.max_scroll=n),t.winScroll<=n&&i<=t.winScroll}return e.min_scroll>=0&&e.max_scroll>=0?e.min_scroll<=t.winScroll&&t.winScroll<=e.max_scroll:e.min_scroll>=0?t.winScroll>=e.min_scroll:e.max_scroll>=0?t.winScroll<=e.max_scroll:!1}},L=function(e,t){if(e=_(e),!e)throw new Error("No element given for makeFixable");return-1===f(e)?(o(e,t),E.forEach(function(e){"resize"===e&&(x.removeEventListener(e,d),x.addEventListener(e,d)),S.removeEventListener(e,d),S.addEventListener(e,d)}),e):void 0},j=function(e){if(e=_(e),!e)throw new Error("No element given for removeFixable");var t,i=f(e);return i>-1&&(t=k.splice(i,1)[0],t.el.style.top=t.state.elTop+"px",t.el.style.position=t.state.elPosition,t.el.classList.remove("fixable_fixed")),k.length<=0&&E.forEach(function(e){S.removeEventListener(e,d),x.removeEventListener(e,d)}),e},A=function(e,t,i){function n(){if(!e||!t)return!1;
var n,o=e.offsetHeight,s=document.body.scrollTop+window.innerHeight,a=w(t).top+o+i.top,r=e.parentNode;return n=r.classList.contains("fixable_clone")?w(r).top+o-i.bottom:w(e).top+o-i.bottom,s>=a&&n>=s}e=_(e),t=_(t),i=i||{},i.top=i.top||0,i.bottom=i.bottom||0,L(e,{scroll_dep:!0,custom_trigger:n}),e.addEventListener("w2.fixable.fixed",function(){this.style.top="auto",this.style.bottom=0})},D=function(e,t){var i,n=e.length;for(i=0;n-1>i;i++)L(e[i],C.extend(t,{scroll_dep:!0,footer:e[i+1]}));L(e[i],C.extend(t,{scroll_dep:!0,footer:t&&t.footer||null}))};s.prototype.getDependencies=function(){return{resize:this.options.height_dep||this.options.width_dep,scroll:this.options.scroll_dep,custom:null!==this.options.custom_trigger}},t.makeFixable=L,t.removeFixable=j,t.makeBottomFixable=A,t.makeStackedFixables=D},"./view/fixable_component.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./view/fixable2.js");t.FixableComponent=n.extend({onLoad:function(){var e=this.$id("@fixable_component");
o.makeFixable(e.parent(),this.options),e.remove()}})},"./view/follower_list.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.FollowerListModalLink=n.extend({onLoad:function(){var e=this;this.$id("@modal_link").click(function(){return e.createModal("load_inner").kwargs({object_id:e.object_id}).show(),!1})}})},"./view/hover_menu.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./shared/Class.js").Class,a=i("./shared/log.js").log,r=i("./shared/onload.js"),d=i("./shared/perf.js"),l=i("./shared/w2.context.js");t.HoverMenu=n.extend({contextConstructor:function(){return l.HoverMenu},onLoad:function(e){this.on=this.on||350,this.off=this.off||350,this.st=null,this.ht=null,this.loaded=this.loaded||this.should_preload_menu,this.loading=!1,this.shown=!1,this.cancelHover=!1,this.load_on_pageload&&e&&this.loadMenu(!0),this.registerClickHandlers(),this.maybeRegisterHoverHandlers(),this.hoverMenuContext=this.getContext(l.HoverMenu),
this._userPerceivedAction=null,this.setDvar("hovermenu_parent",this.cid)},registerClickHandlers:function(){var e=this;e.hoverMenuContext=e.getContext(l.HoverMenu),e.hoverMenuContext.on("hidden",function(t,i){i===!0&&(e.cancelHover=!0,e.doHide())}),this.click_open?(this.$id("@link").click(function(t){e.shown?(e.cancelHover=!0,e.doHide()):(e._userPerceivedAction=d.startUserPerceived({vcon:e.__vcon,method:"load_menu"}),e.cancelHover=!1,e.loadMenu(),e.doShow()),t.preventDefault()}),o(document).click(function(t){var i=e.isInvalidCloseTarget(o(t.target));e.shown&&!i&&(e.cancelHover=!0,e.doHide())})):this.$id("@link").click(function(){e.cancelHover=!0,e.doHide()})},isInvalidCloseTarget:function(e){var t=this.$id("@link");return e.is(t)||e.parents(t).is(t)?!0:!1},maybeRegisterHoverHandlers:function(){var e=this;this.show_menu&&!this.click_open&&(this.$id("@link").hover(this.show.bind(this),function(){e.hide(),e.cancelHover=!1,e.$id("@link").removeClass("hover")}),this.$id("@menu").hover(this.show.bind(this),this.hide.bind(this)));
},setPosition:function(){if(!this.css_positioning){var e=this.$id("@link").outerHeight(),t=this.$id("@link").offset(),i=t,n=o(window).height(),s=275,a=i.top-o(window).scrollTop(),r=s>n-a,d=this.menu_offset_px?this.menu_offset_px:0;if(this.$id("@menu").removeAttr("style"),r?(this.attach_to_body?this.$id("@menu").css("bottom",n-t.top+d+"px"):this.$id("@menu").css("bottom",e+"px"),this.$id("@menu").addClass("hover_menu_above")):(this.attach_to_body?this.$id("@menu").css("top",t.top+e+1+d+"px"):this.$id("@menu").css("top",e+"px"),this.$id("@menu").removeClass("hover_menu_above")),this.attach_to_body){var l=o(window).width(),c=this.$id("@menu").outerWidth(),u=c+i.left,h=i.left,p=this.$id("@link").outerWidth();"right"==this.alignment?this.$id("@menu").css("left",h-c+p+"px"):"center"==this.alignment?this.$id("@menu").css("left",h-c/2+p/2+"px"):u>l?(this.$id("@menu").addClass("right_align"),this.$id("@menu").css("left",h-c+p+"px")):(this.$id("@menu").css("left",h+"px"),this.$id("@menu").removeClass("right_align"));
}}},hide:function(){this._userPerceivedAction&&(d.cancelAction(this._userPerceivedAction),this._userPerceivedAction=null),clearTimeout(this.st),this.ht=setTimeout(this.doHide.bind(this),this.off)},doHide:function(){var e=this;this.shown&&(this.hoverMenuContext.get("hidden")||this.hoverMenuContext.set("hidden",!0),this.hoverMenuContext.set("isShown",!1),this.shown=!1,this.$id("@link").removeClass("hover"),this.$id("@menu").addClass("animate_out"),setTimeout(function(){e.shown||(e.$id("@menu").removeClass("animate_out"),e.$id("@menu").addClass("hidden"))},150))},getKwargs:function(){return this.kwargs?this.kwargs:{}},okToShowHoverMenu:function(){return this.should_show_hover_menu&&0===this.$id("@menu").parents(".hover_menu_contents").length},show:function(){this.okToShowHoverMenu()&&this.showInner()},showInner:function(){this._userPerceivedAction=d.startUserPerceived({vcon:this.__vcon,method:"load_menu"}),clearTimeout(this.ht),this.st=setTimeout(this.doShow.bind(this),this.on),this.loadMenu(),
this.$id("@menu").removeClass("animate_out"),this.$id("@link").addClass("hover")},doShow:function(){this.shown||this.cancelHover||(this.hoverMenuContext.set("isShown",!0),this.hoverMenuContext.set("hidden",!1),this.shown=!0,this.css_positioning||this.movedToBody||!this.attach_to_body||(this.$id("@menu").detach().prependTo(o("body")),this.movedToBody=!0),o(".GrowlNotification").hide(),this.$id("@menu").removeClass("hidden"),this.$id("@link").addClass("hover"),this.setPosition(),this.loaded===!0&&this._userPerceivedAction&&(d.finishAction(this._userPerceivedAction),this._userPerceivedAction=null))},loadMenu:function(e){var t=this;void 0===e&&(e=!1);var i=function(){t.loaded||t.loading||(a&&a.enabled&&a("Quora.HoverMenu.loadMenu",t.cid,"is loading, preload =",e),t.loading=!0,t.serverCall("load_menu").kwargs(t.getKwargs()).disableDefaultUserPerceivedLogging().contentFor(t.$id("@menu_contents")).success(function(i){a&&a.enabled&&a("Quora.HoverMenu.loadMenu",t.cid,"is loaded, preload =",e),t.loaded=!0,
t.loading=!1,t.shown===!0&&t._userPerceivedAction&&(d.finishAction(t._userPerceivedAction),t._userPerceivedAction=null)}).except(function(i){a&&a.enabled&&a("Quora.HoverMenu.loadMenu",t.cid,"is failed to load, preload =",e),t.loading=!1}).send())};e?r.execAfterLoadDelayed(function(){i()}):i()}}),t.ToggleableMenu=s.extend({__init__:function(e){if(this.$linkElem=e.$linkElem,this.$menuElem=e.$menuElem,this.loadFunction=e.loadFunction,!(this.$linkElem&&this.$menuElem&&this.loadFunction))throw new Error("Invalid kwargs given: "+e);this.useCssPositioning=e.useCssPositioning||!1,this.shouldAttachToBody=!!e.shouldAttachToBody,this.menuOffsetPx=e.menuOffsetPx||0,this.alignment=e.alignment||"left",this.clickOpen=e.clickOpen||!1,this.showDelayMs=e.showDelayMs||350,this.hideDelayMs=e.hideDelayMs||350,this.appendCssClass=e.appendCssClass||"",this.shown=!1,this.movedToBody=!1,this.cancelHover=!1,this.hideTimeout=null,this.showTimeout=null,this.registerHoverHandlers(),this.registerClickHandlers(),this.appendClass();
},registerHoverHandlers:function(){this.clickOpen||(this.$linkElem.hover(this.showMenuSlow.bind(this),function(){this.hideMenuSlow(),this.cancelHover=!1,this.$linkElem.removeClass("hover")}.bind(this)),this.$menuElem.hover(this.showMenuSlow.bind(this),this.hideMenuSlow.bind(this)))},registerClickHandlers:function(){this.clickOpen?(this.$linkElem.click(this.toggleMenu.bind(this)),o(document).on("click",this.maybeHideMenu.bind(this))):this.$linkElem.click(this.hideMenu.bind(this))},toggleMenu:function(e){e.preventDefault(),this.shown?(this.cancelHover=!0,this.hideMenu()):(this.cancelHover=!1,this.loadFunction(),this.showMenu())},maybeHideMenu:function(e){var t=e.target,i=this.$linkElem.get(0);t!=i&&t.parentNode!=i&&this.hideMenu()},hideMenuSlow:function(){clearTimeout(this.showTimeout),this.hideTimeout=setTimeout(this.hideMenu.bind(this),this.hideDelayMs)},hideMenu:function(){this.shown&&(this.cancelHover=!0,this.shown=!1,this.$linkElem.removeClass("hover"),this.$menuElem.addClass("animate_out"),
setTimeout(function(){this.shown||(this.$menuElem.removeClass("animate_out"),this.$menuElem.addClass("hidden"))}.bind(this),150))},shouldShowMenu:function(){return 0===this.$menuElem.parents(".hover_menu_contents").length},showMenuSlow:function(){this.shouldShowMenu()&&(clearTimeout(this.hideTimeout),this.showTimeout=setTimeout(this.showMenu.bind(this),this.showDelayMs),this.loadFunction(),this.$menuElem.removeClass("animate_out"),this.$linkElem.addClass("hover"))},showMenu:function(){this.shown||this.cancelHover||(this.shown=!0,this.moveMenuToBody(),o(".GrowlNotification").hide(),this.$menuElem.removeClass("hidden"),this.$linkElem.addClass("hover"),this.setPosition())},moveMenuToBody:function(){this.useCssPositioning||this.movedToBody||(this.movedToBody=!0,this.shouldAttachToBody?this.$menuElem.detach().prependTo(o("body")):this.$menuElem.detach().prependTo(this.$linkElem))},appendClass:function(){this.appendCssClass&&this.$menuElem.addClass(this.appendCssClass)},setPosition:function(){
if(!this.useCssPositioning){var e=o(window),t=this.$linkElem.outerHeight(),i=this.$linkElem.offset(),n=i,s=e.height(),a=275,r=n.top-e.scrollTop(),d=a>s-r,l=this.$menuElem.outerWidth(),c=this.$linkElem.outerWidth();if(this.$menuElem.removeAttr("style"),d?(this.shouldAttachToBody?this.$menuElem.css("bottom",s-i.top+this.menuOffsetPx+"px"):this.$menuElem.css("bottom",t+"px"),this.$menuElem.addClass("hover_menu_above")):(this.shouldAttachToBody?this.$menuElem.css("top",i.top+t+1+this.menuOffsetPx+"px"):this.$menuElem.css("top",t+"px"),this.$menuElem.removeClass("hover_menu_above")),this.shouldAttachToBody){var u=e.width(),h=l+n.left,p=n.left;if(h>u){var f=h-u;"left"==this.alignment&&(p-=f+10)}"right"==this.alignment?this.$menuElem.css("left",p-l+c+"px"):"center"==this.alignment?this.$menuElem.css("left",p-l/2+c/2+"px"):this.$menuElem.css("left",p+"px")}else"right"==this.alignment?this.$menuElem.css("right",0):"center"==this.alignment?this.$menuElem.css("left",c/2-l/2+"px"):this.$menuElem.css("left",0);
}}})},"./view/inline_editor.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/jquery.js"),s=i("./webnode2.js"),a=i("./shared/core/component.js"),r=i("./shared/events/index.js"),d=i("./shared/cookies.js"),l=i("./shared/debounce.js").debounce,c=i("./w2.dialog.js"),u=i("./settings-webpack.js"),h=i("./shared/beforeunload.js"),p=u.interface_strings,f=i("./shared/action_log.js").logSecondaryAction;t.InlineEditor=n.extend({onLoad:function(){var e=this;e.editor=e.child("editor"),e.input_obj=e.$id("@"+e.input),e.input_button="inline_editor_submit",e.input_button_obj=e.$id("@"+e.input_button),e.editorShown=e.show_editor,e.should_toggle_on_submit=!0,e.draft_space&&(e.draft_button="inline_editor_save_draft",e.draft_button_obj=e.$id("@"+e.draft_button)),e.toggle_callback=null,e.locked=!1,e.$id("@inline_editor_link").click(function(){return e.onEditLinkClick(),!1}),e.$id("@inline_editor_cancel").click(function(){return e.content_type?e.emitEvent(r.helpers.inlineEditorCancel(e.content_type,e.id)):e.cancelEditor(),
!1}),e.registerEditorCallbacks(),e.$id("@inline_editor_create_link").click(function(){return e.content_type?e.emitEvent(r.helpers.inlineEditorEdit(e.content_type,e.id)):e.toggle_editor(),!1}),e.submitHandler(),e.initDraftHandlers(),e.focus_onload&&e.focusInput(),e.typing_area&&e.editor.setTypingStateCallback(function(t){e.serverCall("typing").kwargs({area:e.typing_area,state:t}).send(),e.input_button_obj.text(e.submit_text)}),e.input_obj.is("[maxlength]")&&e.input_obj.on("keyup",function(){var e=o(this).attr("maxlength"),t=o(this).val();t.length>e&&o(this).val(t.slice(0,e))}),e.content_type&&e.whenOnLoaded(function(){e.emitEvent(r.helpers.inlineEditorLoad(e.content_type,e.id))})},registerEditorCallbacks:function(){var e=this;this.handleEvent(r.Types.INLINE_EDITOR_STATE,function(t){t.payload.contentType==e.content_type&&t.payload.oid==e.id&&("cancel"==t.payload.state?e.cancelEditor():"edit"==t.payload.state?e.onEditLinkClick():"disclaimer"==t.payload.state&&e.updateDisclaimer())})},onEditLinkClick:function(){
this.editorShown||this.toggle_editor()},updateDisclaimer:function(){var e=this.child("metadata"),t=e&&e.child("disclaimer");""===this.disclaimer_update||"remove"===this.disclaimer_update?(this.disclaimer_update="attach",t.$id("@item").removeClass("hidden")):(this.disclaimer_update="remove",t.$id("@item").addClass("hidden"))},initDraftHandlers:function(){this.draft_space&&(this.initEditorFocusCallback(),this.initDraftButtonClickCallback(),this.initMeaningfulChangeCallback(),this.initBeforeUnloadCallback(),this._latestSavedState=null)},initBeforeUnloadCallback:function(){h.registerHandler(this.beforeUnload.bind(this))},beforeUnload:function(){return this.hasUnsavedContent()?this.unsaved_content_msg:void 0},initSavedState:function(){this._latestSavedState||(this._latestSavedState=this.get_value())},updateSavedState:function(e){this._latestSavedState=e},hasUnsavedContent:function(){return this.cid in a._unloaded?!1:this._latestSavedState?this.editor.isOnlyWhiteSpace()&&0===this._latestSavedState.sections.length?!1:this.editor.hasChanged(this._latestSavedState):!1;
},initEditorFocusCallback:function(){var e=this;this.editor.setFocusCallback(function(){e.initSavedState(),e.$id("@inline_editor_save_draft").removeClass("hidden")})},initDraftButtonClickCallback:function(){var e=this;this.draft_button_obj.click(function(t){t.preventDefault(),e.save_draft(!0)})},initMeaningfulChangeCallback:function(){var e=l(this.save_draft.bind(this,!1),750,{maxWait:1e4,leading:!0});this.editor.setMeaningfulChangeCallback(e)},cancelEditor:function(){this.typing_area&&this.editor.stopTyping(),this.editorShown&&this.toggle_editor()},isEditorEmpty:function(){var e=this.getEditor();return e?e.isOnlyWhiteSpace():!1},getEditor:function(){return this.editor},submitHandler:function(){var e=this;this.input_button_obj.click(function(){return e.trigger_request(),!1})},get_value:function(){return this.is_qtext?this.editor.serialize():this.input_obj.val()},save_draft:function(e){var t=this,i=this.getSaveDraftMethod(e),n=this.getSaveDraftKwargs(),o=this.serverCall(i).kwargs(n);e&&(o.liveMutate(),
s.interactionMode.isBlocking()&&s.fallbackToPostReloadMode()),this.logSaveDraft(),o.success(function(){t.updateSavedState(n.content)}),o.send()},logSaveDraft:function(){},getSaveDraftMethod:function(e){return e?"save_draft":"save_draft_auto"},getSaveDraftKwargs:function(){return{content:this.get_value(),window_id:u.windowId,draft_space:this.draft_space}},server_call_method:"edit",_get_kwargs:function(){return{id:this.id,input:this.get_value()}},trigger_request:function(){return this.typing_area&&this.editor.stopTyping(),this.locked?!1:(this.locked=!0,void(this.require_comment?this.showConfirmationDialog():this.okToSubmitRequest()?(this.is_qtext&&this.editor.disable(),this.invokeEditServerCall(this._get_kwargs())):(this.is_qtext&&this.editor.focus(),this.locked=!1)))},trigger_cancel:function(){this.$id("@inline_editor_cancel").click()},okToSubmitRequest:function(){return!this.require_value||this.require_value&&!this.editor.isOnlyWhiteSpace()},invokeEditServerCall:function(e){var t=this,i=function(){
t.locked=!1};o(document).on("login_cancelled",i),this.content_type&&this.emitEvent(r.helpers.inlineEditorSubmit(this.content_type,this.id)),d.setTlog(t.tlog_data());var n=t.getLoggedAction();n&&f(n,null),t.input_button_obj.addClass("disabled");var s=function(e){t.locked=!1,t.input_button_obj.removeClass("disabled"),t.editor.enable(),o(document).off("login_cancelled",i)},a=function(){s()};t.serverCall(t.server_call_method).kwargs(e).success(function(i){t.updateSavedState(e.input),t.ajax_callback(i),s()}).error(a).except(a).liveMutate().send()},tlog_data:function(){return null},getLoggedAction:function(){return null},ajax_callback:function(e){this.content_type&&this.emitEvent(r.helpers.inlineEditorSubmitted(this.content_type,this.id)),this.should_toggle_on_submit&&this.toggle_editor()},focusInput:function(){var e=this;e.is_qtext?e.editor.focus():e.input_obj.focus()},setToggleCallback:function(e){if(this.toggle_callback){var t=this.toggle_callback;this.toggle_callback=function(){t(),e()}}else this.toggle_callback=e;
},toggle_editor:function(){if(this.editorShown=!this.editorShown,this.$id("@inline_editor_content").find(".qtext_embed").each(function(e,t){o(t).addClass("thumbnail").empty()}),this.$id("@inline_editor_content").toggleClass("hidden"),this.$id("@inline_editor_form").toggleClass("hidden"),this.is_qtext&&this.$id("@inline_editor_form").is(":visible")){var e=this.child("editor");e&&e.focus()}this.toggle_callback&&this.toggle_callback()},showConfirmationDialog:function(){var e=this,t=this.input_button_obj.text();this._dialog=c.createDialog(this).title(this.confirm_text).cancel(function(){e.locked=!1},p.cancel).ok(function(){var t=arguments[0].dialogComponent,i=t.child("editor");if(i.isOnlyWhiteSpace())return!1;var n=e._get_kwargs();n.comment=i.serialize(),e.invokeEditServerCall(n),e._dialog.close_()},t).load("comment_dialog")}}),t.InlineEditCommentDialog=n.extend({onLoad:function(){this.child("editor").focus()}}),t.DraftStatus=n.extend({onLoad:function(){var e=this;e.$id("@draft_status_clear").on("click",function(){
return e.createModal("load_clear_draft_confirmation").kwargs({draft_space:e.draft_space}).onSubmit(function(){e.clearDraftCallback()}).show(),!1})},clearDraftCallback:function(){}}),t.BoardDraftStatus=t.DraftStatus.extend({clearDraftCallback:function(){window.location.reload()}})},"./view/invisibleinfo.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/keystrokes.js"),s=i("./shared/jquery.js");t.InfoToggle=n.extend({onLoad:function(){this._state=!1,this.setupKeyboardShortcut()},toggle:function(){this._state?(this._state=!1,s(".invisible_info").hide()):(this._state=!0,s(".invisible_info").show())},setupKeyboardShortcut:function(){o.on([81,73,68,81,73,68],this.toggle.bind(this))}})},"./view/link_selector.js":function(e,t,i){var n=i("./view/selector.js").Selector,o=i("./view/selector.js").SelectorWithTypeaheadLogMixin;t.LinkSelector=n.extend(o).extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.$id("@input").keydown(function(){return e._escKeyDown?e._escKeyDown.apply(this,arguments):void 0;
}),e.$id("@input").keyup(function(t){return e._keyUp?e._keyUp.apply(this,arguments):void 0})},setEscKeyDown:function(e){this._escKeyDown=e},setKeyUp:function(e){this._keyUp=e}})},"./view/livenode.js":function(e,t,i){var n=i("./shared/log.js").log,o=i("./shared/jquery.js"),s=i("./webnode2.js"),a=i("./shared/events/index.js"),r=i("./w2.livenode.js"),d=i("./shared/core/component.js"),l=d.Component,c=i("./shared/window_manager.js"),u=i("./shared/loading.js");t.LiveSpinner=l.extend({init:function(){this._super.apply(this,arguments),this.t=null,this.showing=!1;var e=this;this.handleEvent(a.Types.LIVENODE_LOADING_SPINNER,function(t){t.payload.show?e.show():e.hide()})},show:function(){this.showing||(this.showing=!0,this.spinner||(this.spinner=u.createDots("small"),this.$id("@spinner").append(this.spinner)),this.$id("@loading").removeClass("fade_out").removeClass("hidden"))},hide:function(){var e=this;this.showing&&(this.showing=!1,this.$id("@loading").addClass("fade_out"),setTimeout(function(){
e.$id("@loading").hasClass("fade_out")&&e.$id("@loading").removeClass("fade_out").addClass("hidden")},150))}}),t.ErrorBanner=l.extend({init:function(){var e=this;this._super.apply(this,arguments),s.Error=this,this.shown=!1,this.$id("@hide").click(function(){return e.hide(),!1})},show:function(e){e=e||this.default_text,this.$id("@text").text(e),this.shown||(this.shown=!0,this.emitEvent({type:a.Types.INTERACTION_MODE_BANNER_STATE,payload:{shown:!0}}),this.$id("@banner").show().addClass("fade_in"),h())},hide:function(){if(this.shown){this.shown=!1,this.emitEvent({type:a.Types.INTERACTION_MODE_BANNER_STATE,payload:{shown:!1}});var e=this;e.$id("@banner").removeClass("fade_in").addClass("fade_out"),setTimeout(function(){e.$id("@banner").hide()},150),p()}}});var h=t.addContentPadding=function(){o(".ContentWrapper").addClass("extra_padding"),o(".NotifHeaderBar").addClass("extra_padding")},p=function(){o(".ContentWrapper").removeClass("extra_padding"),o(".NotifHeaderBar").removeClass("extra_padding");
};t.InteractionModeBanner=l.extend({init:function(){this._super.apply(this,arguments),s.interactionMode=this,this._changedComponents={},this._cidToDomId={},this._otherInteractions={},this._states={OFF:0,PENDING:1,ON:2,BLOCKING:3}},onLoad:function(){n&&n.enabled&&n("w2.interaction.InteractionModeBanner.onLoad","onLoad is called on",this),this.resumeUpdates(),this._state=this._states.OFF,this._lastVal=null,this._lastDOMNode=null,this.bindInteractionMode()},updateStateForLastFocusedDOMElement:function(e){var t;if(!e)return!1;if(this._state==this._states.PENDING)return t=this._getCIDForElement(e),this._lastVal==this._val(e)?(this._changedComponents[t]=this._states.OFF,!1):(this._changedComponents[t]=this._states.ON,this._cidToDomId[t]=this._getLiveDOMIdForElement(e),!0);if(this._state==this._states.ON){t=this._getCIDForElement(e);var i=this._changedComponents[t];return this._lastVal==this._val(e)&&i==this._states.PENDING?(this._changedComponents[t]=this._states.OFF,!1):(this._changedComponents[t]=this._states.ON,
this._cidToDomId[t]=this._getLiveDOMIdForElement(e),!0)}return!1},_getLiveDOMIdForElement:function(e){return e.id&&"ld_"==e.id.substr(0,3)?e.id:e.parentNode?this._getLiveDOMIdForElement(e.parentNode):null},_getCIDForElement:function(e){return e&&e.getAttribute?e.getAttribute("w2cid")?e.getAttribute("w2cid"):this._getCIDForElement(e.parentNode):null},isBlocking:function(){return this._state==this._states.BLOCKING},startBlocking:function(){var e=this;console.log("startBlocking called");var t=[];o.each(this._changedComponents,function(i,n){if(n==e._states.ON||n==e._states.PENDING){var o=d._components[i];o.meaningfulChangeCallback&&!o.draft_space&&t.push(o)}}),this.showBanner(t),h(),this._setBlockingState()},_setBlockingState:function(){this._state=this._states.BLOCKING},bindInteractionMode:function(){var e=this;o(document).on("focus",'[data-group="js-editable"]:not(.ignore_interaction)',function(t){var i=e._getCIDForElement(t.target);if(e._lastVal=e._val(t.target),e._lastDOMNode=t.target,0===r.state.pendingMutationCount)if(e._state==e._states.OFF)e._changedComponents[i]=e._states.PENDING,
e._state=e._states.PENDING;else{var n=e._changedComponents[i];n&&n!=e._states.OFF||(e._changedComponents[i]=e._states.PENDING)}}),o(document).on("blur",'[data-group="js-editable"]:not(.ignore_interaction)',function(t){switch(e._state){case e._states.PENDING:e.updateStateForLastFocusedDOMElement(t.target),e._lastVal==e._val(t.target)?e._state=e._states.OFF:e._state=e._states.ON;break;case e._states.ON:e.updateStateForLastFocusedDOMElement(t.target);break;case e._states.OFF:case e._states.BLOCKING:break;default:console.error("Unknown state of InteractionMode at blur time... weird")}})},_val:function(e){var t=o(e);return t.is(":input")?t.val():t.html()},_setVal:function(e,t){var i=o(e);i.is(":input")?i.val(t):i.html(t)},showBanner:function(e){return this.emitEvent({type:a.Types.INTERACTION_MODE_BANNER_STATE,payload:{shown:!0}}),e.length>0&&(this.$id("@draftable").removeClass("hidden"),this.$id("@not_draftable").addClass("hidden"),this.$id("@resume").click(function(t){return o.each(e,function(e,t){
t.meaningfulChangeCallback()}),c.reload(),!1})),this.$id("@banner").show().removeClass("fade_out").addClass("fade_in")},hideBanner:function(){this.emitEvent({type:a.Types.INTERACTION_MODE_BANNER_STATE,payload:{shown:!1}});var e=this;e.$id("@banner").removeClass("fade_in").addClass("fade_out"),setTimeout(function(){e.$id("@banner").hide()},150)},resumeUpdates:function(){this._state=this._states.OFF,this._changedComponents={},this.hideBanner(),p();for(var e=r.state.interactionDelayedLivedepOperations;e.length>0&&this._state==this._states.OFF;){var t=e.shift();r.onLivedepOperations(t.data,t.textStatus,!0)}}})},"./view/modal.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/errors.js"),s=i("./shared/debounce.js").debounce,a=i("./shared/util.js"),r=i("./shared/viewport.js"),d=i("./w2.modal.js"),l=t.Base=n.extend({onLoad:function(){var e=this;e.close_button=this.$id("@close_button"),e.cancel_button=this.$id("@cancel_button"),e.submit_button=this.$id("@submit_button"),
e.close_button.on("click",function(t){e.onClose(),t.preventDefault()}),e.cancel_button.on("click",function(t){e.onCancel(),t.preventDefault()}),e.submit_button.on("click",function(t){e.onSubmit(),t.preventDefault()})},_closeModal:function(){d.Modal.modalFor(this).close()},onClose:function(){this._closeModal()},onCancel:function(){this._closeModal()},onSubmit:function(){this.submitDisabled||this._closeModal()},disableSubmit:function(){this.submitDisabled=!0,this.submit_button.addClass("action_disabled")},enableSubmit:function(){this.submitDisabled=!1,this.submit_button.removeClass("action_disabled")}});t.MultiStep=l.extend({onLoad:function(){if(this.stepCallbacks=this.getCallBacks(),this.onLoadInit(),this._super.apply(this,arguments),this._bindEventHandlers(),!this.key)return void o.logJsError("modal.MultiStep","Please set a data key in python js_data");if(!this.stepCallbacks){var e=["Sub classes should override getCallBacks() and have it return a ","list of methods supported by each modal steps."].join("");
return void o.logJsError("modal.MultiStep",e)}return this.data_cache?void 0:void o.logJsError("modal.MultiStep","Please define a data storage variable in python")},onLoadInit:function(){var e=this.m("init");"function"==typeof e&&e()},getCallBacks:function(){},_bindEventHandlers:function(){var e=this.m("eventHandlers");"function"==typeof e&&e();var t=this;this.$id("@back_button").on("click",function(){t.onBack()})},m:function(e){return this.stepCallbacks[this.key][e]},onSubmit:function(){var e=this.m("onSubmit");return"function"==typeof e?void e():void(this.submitDisabled||this._loadNext())},onBack:function(){var e=this.m("onBack");return"function"==typeof e?void e():void this.loadPrev()},isLastStep:function(){var e=this.m("isLastStep");return e?e:!1},_loadNext:function(){var e=this;if(e.isLastStep())e.serverCall("last_step").kwargs({data_set:{data_cache:this.persistData()}}).success(function(t){e._closeModal()}).send();else{var t=new d.ModalWithCallBacks(e,{kwargs:{data_set:{data_cache:this.persistData()
}}});t.load("load_next_modal"),t.onCloseCallBack(function(){e._closeModal()})}},loadPrev:function(){var e=this,t=new d.ModalWithCallBacks(e,{kwargs:{data_set:{data_cache:this.persistData()}}});t.load("load_previous_modal"),t.onCloseCallBack(function(){e._closeModal()})},_getStepData:function(){var e=this.m("getStepData");if("function"==typeof e){var t=e();if(!t){var i=["Hey! we noticed that you defined a getStepData() method in ","your code but its not returning any value that is to be ","persisted for this modal step. To fix this error, either ","delete getStepData() definition or return a data that you ","want to be persisted for: "+this.key].join("");return void o.logJsError("modal.MultiStep",i)}var n=this.data_cache[this.key];return a.extend(n,t)}return null},persistData:function(){return this.data_cache[this.key]=this._getStepData(),this.data_cache},_closeModal:function(){d.Modal.modalFor(this).executeOnCloseCallBack(),this._super.apply(this,arguments)}}),t.ToggleModal=l.extend({onLoad:function(){
this.is_modal?(this._super.apply(this,arguments),this.onLoadModal()):this.onLoadInline()},onLoadModal:function(){},onLoadInline:function(){this.$inlineElem=this.$id(this.inline_wrapper),this.initModal(),this.should_prefetch&&(this.fetched=!1,this.bindInViewPort(this.$inlineElem,this.fetchModal.bind(this)));var e=this;e.$inlineElem.on("click",function(t){e._shouldIgnoreClick(t)||e.handleClick(t)})},initModal:function(){this._modal=new d.ModalBase(this,{kwargs:{serialized_args:this.serialized_args}})},showModal:function(){this._modal.load("load_modal")},fetchModal:function(){this.fetched||(this.fetched=!0,this._modal.fetch("load_modal"))},isModalOpen:function(){return this._modal?this._modal._isOpen:!1},bindInViewPort:function(e,t){if(r.isElementInViewport(e.get(0)))t();else{var i={leading:!0},n=s(function(){r.isElementInViewport(e.get(0))&&(t(),window.removeEventListener("scroll",n))},50,i);window.addEventListener("scroll",n)}},_shouldIgnoreClick:function(e){for(var t=e.target,i=this.$inlineElem.get(0);t&&t!==i;){
if("A"==t.tagName&&!t.classList.contains("more_link"))return!0;if(t.getAttribute("contenteditable")||t.classList.contains("editor_toolbar"))return!0;if(t.classList.contains("RequestAnswersDrawer","is_active"))return!0;if(t.classList.contains("action_bar_comments","threaded_comments"))return!0;t=t.parentNode}return!1},handleClick:function(e){e.preventDefault(),this.showModal()}})},"./view/paged_list.js":function(e,t,i){var n=i("./shared/log.js").log,o=i("./shared/jquery.js"),s=i("./shared/core/component.js").Component,a=i("./shared/core/component.js"),r=i("./w2.errors.js"),d=i("./shared/viewport.js"),l=i("./shared/onload.js"),c=i("./shared/eventemitter.js").EventEmitter,u=i("./shared/window_manager.js"),h=i("./shared/loading.js"),p=i("./shared/perf.js");t.PagedList=s.extend({init:function(e){this._super.apply(this,arguments),this.model_count=e.initial_count,this.container=window,this.first_hidden_index=0,this.visible_count=0,this.invisible_count=0,this.total_count=0,this.initializeCounts(),
this.max_should_show=this.buffer_count,this.hidden_count=0,this.currently_fetching=!1,this.waiting_for_updates=!1,this.waiting_for_updates_from_preload=!1,this.show_hidden_when_done_updating=!1,this.lastGetMoreSucceeded=!0,this.eventEmitter=new c,this.eventEmitter.on("onGetMoreDone",this.maybeUpdateOptimizedPaged),this.retarget_links&&this.retarget(),this.pagingDone=!1,this.userPerceivedAction=null},getFocusedItem:function(){var e=a.getLiveDomId(this.cid),t=o("#"+e+" .pagedlist_item:focus").first();return t.length?t:null},maybeScrollToItem:function(e,t,i){var n=e.height(),s=e.position().top,a=s+n,r=o(document).scrollTop()+u.headerOffset,d=Math.max(0,o(window).height()-(u.headerOffset+u.actionBarHeight+u.scrollContext)),l=r+d;if(!t.length){if(i&&s>=r)return void u.scrollAndFocus(0);if(!i&&l>=a)return void u.scrollAndFocus(o(document).height());t=e}if(r>a||s>l)return void u.scrollAndFocus(s);var c=i&&s>=r-5||!i&&l+5>=a;c&&(n=t.height(),s=t.position().top,a=s+n);var h=r;if(i)c&&n>d?h=a-d:r>s&&(h=s);else{
var p=.25*o(window).height();s>r+p?h=s-p+5:c||(h=r+d)}h=r+Math.max(Math.min(h-r,d),-d),u.scrollAndFocus(h,c&&t)},onMoreButtonClick:function(e){e||r.beginCanBeRelatedToUserActionBlock(100),n&&n.enabled&&n("paged_list.PagedList.onMoreButtonClick",this.cid,"'More...' button clicked",e?"(auto)":"");var t=this.showHiddenAndMaybeGetMore();return t||(this.show_hidden_when_done_updating=!0),this.currently_fetching&&this.showLoading(),this.startUserPerceivedAction(),!1},loadMoreButton:function(){var e=this;this.child("more_button").$id("@more").click(this.onMoreButtonClick.bind(this)),!this.crawler&&this.has_more&&l.execAfterLoadDelayed(function(){setTimeout(e.maybeGetMore.bind(e),50)})},initializeCounts:function(){var e=a.getLiveDomId(this.cid);if(e){var t=document.getElementById(e);if(t)for(var i=t.childNodes,n=0;n<i.length;n++){var s=o(i[n]),r=s.attr("id");r&&s.hasClass("pagedlist_item")&&(this.first_hidden_index+=1,this.total_count+=1,s.hasClass("pagedlist_invisible")?this.invisible_count+=1:this.visible_count+=1);
}}},showHiddenAndMaybeGetMore:function(){return this.showHidden(this.buffer_count),this.maybeGetMore()},showHidden:function(e){var t=0,i=0,n=a.getLiveDomElement(this.cid);if(n){for(var s=n.childNodes,r=!1,d=0;d<s.length;d++){var l=o(s[d]);if(l.hasClass("pagedlist_item")&&l.hasClass("pagedlist_hidden")&&(l.hasClass("pagedlist_invisible")||(t+=1),r||(r=!0),l.removeClass("pagedlist_hidden"),s[d].style.display="",i+=1,t>=e))break}this.visible_count+=t,this.hidden_count-=t,this.first_hidden_index+=i,this.has_more||this.pagingDone||(this.pagingDone=!0,this.onPagingDone()),this.visible_count>this.max_should_show&&(this.max_should_show=this.visible_count),this.eventEmitter.trigger("onShowHidden")}},onPagingDone:function(){},hideLoading:function(){n&&n.enabled&&n("paged_list.PagedList.hideLoading","Hide loading...");var e=this.child("more_button");e&&(e.$id("@loading").hide(),this.lastGetMoreSucceeded?e.updateAutoClickCapable():e.auto_click_capable=!1,e.maybeEnableOrDisableAutoClick())},showLoading:function(){
n&&n.enabled&&n("paged_list.PagedList.showLoading","Show loading...");var e=this.child("more_button");if(e&&this.auto_paged&&!this.crawler){var t=this.child("more_button").$id("@loading");this.spinner||(this.spinner=h.createDots(),t.append(this.spinner)),t.show()}else e&&e.$id("@loading").show()},hideMoreButton:function(){var e=this.child("more_button");e&&!e.isVirtual&&e.maybeHideButton()},showMoreButton:function(){var e=this.child("more_button");e&&!e.isVirtual&&e.maybeShowButton()},maybeGetMore:function(e){return this.currently_fetching||this.waiting_for_updates||this.waiting_for_updates_from_preload?void 0!==e&&this.total_count<e?(this.eventEmitter.once("onGetMoreDone",this.maybeGetMore.bind(this,e)),!0):!1:(void 0!==e&&this.total_count<e?this.getMore(e):this.visible_count+this.hidden_count>=this.model_count&&this.hidden_count<=this.buffer_count/4?this.getMore():this.hidden_count<=0&&this.hideMoreButton(),!0)},maybeUpdateOptimizedPaged:function(){this.optimize_for_seo&&(this.model_count>this.offset_count&&(this.model_count-=this.offset_count),
this.child("html_nav")&&(this.html_nav_item=a.getLiveDomElement(this.child("html_nav").cid),this.html_nav_item.style.display="block"))},getMore:function(e){return this.currently_fetching=!0,this.waiting_for_updates=!0,this.serverCall("increase_count").kwargs({cid:this.cid,num:void 0!==e?e-this.total_count:this.buffer_count,current:this.model_count}).disableDefaultUserPerceivedLogging().success(this._onGetMoreSuccess.bind(this)).error(this._onGetMoreError.bind(this)).send(),!1},_onGetMoreSuccess:function(){this.lastGetMoreSucceeded=!0,this.currently_fetching=!1,this.waiting_for_updates||(this.hideLoading(),this.show_hidden_when_done_updating&&(this.show_hidden_when_done_updating=!1,this.showHiddenAndMaybeGetMore())),this.eventEmitter.trigger("onGetMoreDone")},_onGetMoreError:function(){var e=this;this.lastGetMoreSucceeded=!1,this.currently_fetching=!1,setTimeout(function(){e.waiting_for_updates&&e.userPerceivedAction&&(p.finishAction(e.userPerceivedAction),e.userPerceivedAction=null),e.waiting_for_updates=!1,
e.hideLoading()},2e3)},onInsertNode:function(e,t){var i=o("#"+t);if(i.hasClass("pagedlist_item")){this.retarget_links&&i.find('a:not([href^="#"])').each(function(){"feed_modal"!=this.target&&o(this).attr("target","_blank")});var n=i.hasClass("pagedlist_invisible");if(this.total_count+=1,e.position>0&&e.position>=this.first_hidden_index)i.addClass("pagedlist_hidden"),e.transition.type="none",n||(this.hidden_count+=1,this.fixed_size_paged_list&&this.first_hidden_index<this.max_should_show?this.showHidden(1):this.showMoreButton());else{i.removeClass("pagedlist_hidden"),i[0].style.display="";var s=!0;if(n)this.invisible_count+=1;else if(this.visible_count+=1,this.fixed_size_paged_list&&this.visible_count>=this.first_hidden_index&&this.first_hidden_index>=this.max_should_show){s=!0;for(var r=a._domids[this.cid],d=document.getElementById(r),l=d.childNodes,c=0,u=0;u<l.length;u++){var h=o(l[u]);if(h.hasClass("pagedlist_item")&&!h.hasClass("pagedlist_hidden")&&!h.hasClass("pagedlist_invisible")&&(c+=1,
c>this.first_hidden_index)){h.addClass("pagedlist_hidden"),l[u].style.display="none",this.hidden_count+=1,this.visible_count-=1,this.showMoreButton();break}}}this.fixed_size_paged_list&&s||(this.first_hidden_index+=1)}}},onDeleteNode:function(e,t){var i=o("#"+t);if(i.hasClass("pagedlist_item")){var n=i.hasClass("pagedlist_invisible");this.total_count-=1,e.position>=this.first_hidden_index?n||(this.hidden_count-=1):(this.first_hidden_index-=1,n?this.invisible_count-=1:(this.visible_count-=1,this.fixed_size_paged_list&&this.showHidden(1)))}},onUpdate:function(e){this.model_count=e.count,this.has_more=e.has_more;var t=this.child("more_button");t&&!t.isVirtual&&(t.maybeEnableOrDisableAutoClick(),this.hidden_count<=0?this.hideMoreButton():this.showMoreButton()),this.auto_paged&&this.waiting_for_updates&&this.finishUserPerceivedAction(),this.waiting_for_updates=!1,this.waiting_for_updates_from_preload=!1,this.visible_count<this.buffer_count&&this.hidden_count>0&&(this.show_hidden_when_done_updating=!0);
var i=!0;this.currently_fetching||(this.hideLoading(),this.show_hidden_when_done_updating&&(this.show_hidden_when_done_updating=!1,this.showHiddenAndMaybeGetMore(),i=!1)),this.eventEmitter.trigger("onGetMoreDone"),i&&this.maybeGetMore()},startUserPerceivedAction:function(){this.userPerceivedAction||(this.userPerceivedAction=p.startUserPerceived({vcon:this.__vcon,method:"increase_count"}))},finishUserPerceivedAction:function(){this.startUserPerceivedAction(),p.finishAction(this.userPerceivedAction),this.userPerceivedAction=null},orderedVisibleChildren:function(){var e,t=a.getLiveDomElement(this.cid),i=t.childNodes,n=[];for(e=0;e<i.length;e++){var s=o(i[e]),r=s.attr("id");r&&s.hasClass("pagedlist_item")&&!s.hasClass("pagedlist_invisible")&&n.push(r)}return n},allOrderedChildren:function(){for(var e=a.getLiveDomElement(this.cid),t=e.childNodes,i=!1,n=[],s=0;s<t.length;s++){var r=o(t[s]),d=r.attr("id");d&&r.hasClass("pagedlist_item")&&(i||!r.hasClass("pagedlist_invisible"))&&(i=!0,n.push(d));
}return n},retarget:function(){o("#"+a.getLiveDomId(this.cid)+" .pagedlist_item").find('a:not([href^="#"])').each(function(){"feed_modal"!=this.target&&o(this).attr("target","_blank")})}}),t.PagedListMoreButton=s.extend({init:function(){this._super.apply(this,arguments),this.last_check_time=0,this.rate_limiter_ms=245,this.auto_click_enabled=!1,this.updateAutoClickCapable()},updateAutoClickCapable:function(){this.auto_click_capable=null!==this.auto_click_period&&this.auto_click_period>0},checkButtonPosition:function(e){if(this.auto_click_capable&&this.parent()){var t=+new Date;if(e||!(t<this.last_check_time+this.rate_limiter_ms)){var i=this.parent().model_count;this.parent().waiting_for_updates&&(i+=this.parent().buffer_count);var n=this.shouldEnableAutoClickFromModelCount(i);this.last_check_time=t;var s=this.$id("@more");if(0!==s.length){var a=this.$id("@sentinel"),r=this.parent().container,l=Math.ceil(o(r).height()),c=!1;if(d.isElementInViewport(a.get(0)))c=!0,this.parent().auto_paged&&this.parent().startUserPerceivedAction();else{
var u=o(r).height()+o(r).scrollTop(),h=u<=o(a).offset().top-l;h||(c=!0)}if(c)return this.parent().currently_fetching||this.parent().waiting_for_updates?(this.parent().showLoading(),void(n&&(this.parent().show_hidden_when_done_updating=!0))):void(n&&this.parent().onMoreButtonClick())}}}},onLoad:function(){var e=this;if(this.parent().loadMoreButton(),this.parent().eventEmitter.on("onShowHidden",function(){e.auto_click_capable&&!e.auto_click_enabled&&e.shouldEnableAutoClickFromModelCount(e.parent().model_count+e.parent().buffer_count)&&e.$id("@more").is(":visible")&&e.maybeHideButton()}),this.auto_click_capable){var t=function(){setTimeout(e.checkButtonPosition.bind(e,!1),125)};this._mousemove_handler=t,this._keypress_handler=t,this._scroll_handler=t,document.addEventListener("mousemove",this._mousemove_handler),document.addEventListener("keypress",this._keypress_handler),document.addEventListener("scroll",this._scroll_handler)}this.maybeEnableOrDisableAutoClick(),this.auto_click_enabled&&l.execAfterLoadDelayed(function(){
setTimeout(e.checkButtonPosition.bind(e,!0),125)})},onUnload:function(){void 0!==this._mousemove_handler&&document.removeEventListener("mousemove",this._mousemove_handler),void 0!==this._keypress_handler&&document.removeEventListener("keypress",this._keypress_handler),void 0!==this._scroll_handler&&document.removeEventListener("scroll",this._scroll_handler)},maybeShowButton:function(){this.auto_click_enabled||this.$id("@more").show()},maybeHideButton:function(){this.$id("@more").hide()},shouldEnableAutoClickFromModelCount:function(e){return e%this.auto_click_period!==0},maybeEnableOrDisableAutoClick:function(){if(!this.auto_click_capable)return void(this.auto_click_enabled=!1);var e=this.shouldEnableAutoClickFromModelCount(this.parent().model_count);e&&!this.auto_click_enabled?(this.auto_click_enabled=!0,this.parent().hideMoreButton()):!e&&this.auto_click_enabled&&(this.auto_click_enabled=!1)},counterStr:function(){return"PagedList counters: total_count "+this.total_count+", visible_count "+this.visible_count+", invisible_count "+this.invisible_count+", hidden_count "+this.hidden_count+", first_hidden_index "+this.first_hidden_index;
}})},"./view/photo.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./w2.dialog.js"),s=i("./shared/cookies.js");t.InlinePhotoEditor=n.extend({onLoad:function(){var e=this;this.$id("@x_photo").click(function(){return o.createDialog(e).title(e.dialog_title).cancel(null,e.close_button_text).ok(function(){e.serverCall("remove_photo").send()},e.dialog_button_text).html(e.dialog_message),!1}),e.whenOnLoaded(function(){e.$id("@photo").hover(function(){e.$id("@edit").toggleClass("hidden"),e.$id("@x_photo").toggleClass("hidden")})})}}),t.BoardPhoto=n.extend({onLoad:function(e){var t=this;this.$id("@link").mousedown(function(){s.setQfeedLog(t,"BoardClickthrough"),s.setQueryLog(t,"BoardClickthrough")})}}),t.TopicPhoto=n.extend({onLoad:function(e){var t=this;this.$id("@link").mousedown(function(){s.setQfeedLog(t,"TopicClickthrough"),s.setQueryLog(t,"TopicClickthrough")})}})},"./view/placepicker.js":function(e,t,i){function n(e){c?e():(p(),u.push(e))}var o=i("./shared/core/component.js").Component,s=i("./shared/jquery.js"),a=i("./shared/loadjs.js").loadJS,r=i("./shared/util.js"),d=i("./w2.dialog.js"),l=i("./shared/window_manager.js"),c=!1,u=[],h=i("./settings-webpack.js").interface_strings,p=r.once(function(){
var e="//maps.googleapis.com/maps/api/js?sensor=false&libraries=places";a(e,function(){for(c=!0;u.length;)u.pop().call()})});t.PlacePicker=o.extend({onLoad:function(){n(this.onLoadBase.bind(this))},onLoadBase:function(){var e=this;this.address=this.default_location,this.initializeGoogleMaps(),this.mutable===!0&&(this.$id("@edit_map").click(function(){return e.toggleEditor(),!1}),this.$id("@change_location").click(function(){if(e.place||e.marker){e.$id("@search_text_field").blur();var t,i;if(e.map.getBounds().contains(e.marker.getPosition())?(t=e.marker.getPosition().lat(),i=e.marker.getPosition().lng()):(t=e.map.getCenter().lat(),i=e.map.getCenter().lng()),!e.place){var n=new google.maps.LatLng(t,i),o=new google.maps.Geocoder;o.geocode({location:n},function(t,i){if(i==google.maps.GeocoderStatus.OK&&t.length){var n=t[0];e.radius=e.computeRadius(n.geometry.viewport),e.setAddress(n.address_components)}})}var a=s.trim(e.$id("@search_text_field").val());e.serverCall("place_changed").kwargs({
radius:e.radius,reference:e.place&&e.place.reference||e.reference,lat:t,lng:i,viewport:{zoom:e.map.getZoom(),mapTypeId:e.map.getMapTypeId(),icon:e.place&&e.place.icon,tilt:e.map.getTilt(),heading:e.map.getHeading()},address:a.length?a:e.address}).success(function(){e.default_location.hasLocation=!0}).send()}else e.$id("@search_text_field").focus()}),this.$id("@edit").click(function(){return e.toggleEditor(),!1}),this.$id("@add").click(function(){return e.reinitializeMap(),!1}),this.$id("@clear").click(function(){return d.createDialog(e).title(e.dialog_title).cancel(null,h.cancel).ok(function(){e.serverCall("place_cleared").success(e.toggleEditor.bind(e)).send()},e.dialog_title).html(e.dialog_message),!1}),this.$id("@close").click(function(){return e.toggleEditor(),e.initializeGoogleMaps(),e.default_location.hasLocation===!1&&e.$id("@map_wrapper").hide(),!1}),"#editlocation"==l.getHash().substr(0,13)&&this.reinitializeMap())},initializeGoogleMaps:function(){n(this.initializeGoogleMapsBase.bind(this));
},initializeGoogleMapsBase:function(){var e=this;this.mapOptions={center:window.google&&google.maps&&new google.maps.LatLng(this.default_location.latitude,this.default_location.longitude),zoom:this.viewport&&this.viewport.zoom||7,mapTypeId:this.viewport&&this.viewport.mapTypeId||window.google&&google.maps&&google.maps.MapTypeId.ROADMAP||"roadmap",tilt:this.viewport&&void 0!==this.viewport.tilt&&this.viewport.zoom>=18?this.viewport.tilt:45,heading:this.viewport&&this.viewport.heading,streetViewControl:!this.mutable};var t=this.viewport&&this.viewport.icon;if(this.static_map===!0){var i="//maps.googleapis.com/maps/api/staticmap?center="+encodeURIComponent(this.default_location.latitude+","+this.default_location.longitude)+"&zoom="+encodeURIComponent(this.mapOptions.zoom)+"&size="+encodeURIComponent(this.size.width+"x"+this.size.height)+"&maptype="+encodeURIComponent(this.mapOptions.mapTypeId)+"&markers="+encodeURIComponent("icon:"+t+"shadow:false|"+this.default_location.latitude+","+this.default_location.longitude)+"&sensor=false",n=s('<img src="'+i+'" />');
return void this.$id("@map_canvas").replaceWith(n)}if(this.map=new google.maps.Map(this.$id("@map_canvas").get(0),this.mapOptions),(this.simple_view===!0||this.mutable===!0)&&this.toggleControls(!1),this.default_location.hasLocation!==!1&&this.updateMarker(t,this.mapOptions.center,this.default_text),this.mutable===!0&&this.toggleDraggable(!1),this.mutable===!0){var o=this.$id("@search_text_field").get(0),a=new google.maps.places.Autocomplete(o);a.bindTo("bounds",this.map),google.maps.event.addListener(a,"place_changed",function(){e.infowindow&&e.infowindow.close(),e.place=a.getPlace(),e.place.geometry.viewport?(e.map.fitBounds(e.place.geometry.viewport),e.radius=e.computeRadius(e.place.geometry.viewport)):(e.map.setCenter(e.place.geometry.location),e.map.setZoom(17),e.radius=30),e.setAddress(e.place.address_components),e.updateMarker(e.place.icon,e.place.geometry.location)}),google.maps.event.addListener(this.map,"click",function(t){if(e.getControlState()){var i=t.latLng;e.radius=e.computeRadius(e.map.getBounds()),
e.handleMarkerReposition(i),e.updateMarker(null,i)}})}},setAddress:function(e){var t=this;if(this.address="",e){this.address=[e[0]&&e[0].short_name||"",e[1]&&e[1].short_name||"",e[2]&&e[2].short_name||""],this.address[1]==this.address[2]&&this.address.splice(2,1),this.address[0]==this.address[1]&&this.address.splice(1,1);var i="";s.each(this.address,function(e,n){i+=n,/^[0-9]+$/.test(n)?i+=" ":e!=t.address.length-1&&(i+=", ")}),this.address=i}},reinitializeMap:function(){var e=this;this.$id("@map_wrapper").show(0,function(){e.initializeGoogleMaps(),e.toggleEditor(),e.$id("@search_text_field").focus()})},toggleEditor:function(){this.$id("@view").toggleClass("hidden"),this.$id("@editor").toggleClass("hidden"),this.$id("@edit_map").toggleClass("hidden"),this.toggleDraggable(),this.toggleControls()},getControlState:function(){return!!this.mapOptions.mapTypeControl},toggleControls:function(e){n(this.toggleControlsBase.bind(this,e))},toggleControlsBase:function(e){var t=void 0!==e?e:!this.getControlState();
this.mapOptions.mapTypeControl=t,this.mapOptions.panControl=t,this.mapOptions.zoomControl=t,this.mapOptions.scaleControl=t,this.mapOptions.rotateControl=t,this.mapOptions.overviewMapControl=t,this.map.setOptions(this.mapOptions)},toggleDraggable:function(e){n(this.toggleDraggableBase.bind(this,e))},toggleDraggableBase:function(e){this.mapOptions.draggable=void 0!==e?e:!this.mapOptions.draggable,this.mapOptions.draggable?(this.mapOptions.minZoom=void 0,this.mapOptions.maxZoom=void 0,this.marker&&this.marker.setDraggable(!0)):(this.mapOptions.minZoom=this.map.getZoom(),this.mapOptions.maxZoom=this.map.getZoom(),this.marker&&this.marker.setDraggable(!1)),this.map.setOptions(this.mapOptions)},updateMarker:function(e,t){n(this.updateMarkerBase.bind(this,e,t))},updateMarkerBase:function(e,t){var i=this;this.marker&&this.marker.setMap(null);var n=new google.maps.MarkerImage(e||"//maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png",new google.maps.Size(40,40),new google.maps.Point(0,0),new google.maps.Point(20,40),new google.maps.Size(40,40));
this.marker=new google.maps.Marker({clickable:!0,draggable:this.mapOptions&&this.mapOptions.draggable,icon:n,map:this.map,position:t}),google.maps.event.addListener(this.marker,"dragend",function(e){var t=e.latLng;i.handleMarkerReposition(t)}),this.updateInfoWindow(t)},handleMarkerReposition:function(e){n(this.handleMarkerRepositionBase.bind(this,e))},handleMarkerRepositionBase:function(e){var t=this;this.place=null,window.setTimeout(function(){t.map.panTo(e)},1e4);var i=new google.maps.Geocoder;i.geocode({location:e},function(i,n){if(n==google.maps.GeocoderStatus.OK&&i.length){var o=i[0];t.radius=t.computeRadius(o.geometry.viewport),t.setAddress(o.address_components),t.updateInfoWindow(e)}})},updateInfoWindow:function(e){n(this.updateInfoWindowBase.bind(this,e))},updateInfoWindowBase:function(e){var t=this;this.infowindow&&this.infowindow.close(),this.address&&this.address.length&&(this.infowindow=new google.maps.InfoWindow({content:this.address,position:e}),google.maps.event.addListener(this.marker,"click",function(){
t.infowindow.open(t.map,t.marker)}))},computeRadius:function(e){var t=e.getNorthEast(),i=e.getSouthWest(),n=t.lat(),o=i.lat();return Math.floor(111045*Math.abs(n-o)/2)}})},"./view/pmsg.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/core/webnode.js"),s=i("./shared/events/index.js"),a=i("./shared/jquery.js");t.PMsg=n.extend({onLoad:function(){var e=this;this.$id("@x").click(function(){return e.close(),!1})},close:function(){this.$id("@container").hide(),a(".pmsg_container").hide()}}),t.PMsgContainer=n.extend({onLoad:function(e){var t=a("#layout_header");0!==t.length&&(this.headerHeight=t.outerHeight(),this.mobile||this.$id("@pmsg_container").css("top",this.headerHeight+10)),this.$id("@pmsg_container").html()&&!this.mobile&&(this.$id("@pmsg_container").fadeIn(350),this.setFadeTimeout(5e3));var i=this;this.handleEvent(s.Types.PMSG_SHOW,function(e){i.setContent(e.payload.content,e.payload.fadeOut)})},setFadeTimeout:function(e){var t=this;this.t=setTimeout(function(){
t.$id("@pmsg_container").fadeOut(350)},e)},setContent:function(e,t){var i=this;i.$id("@pmsg_container").hover(function(){clearTimeout(i.t),i.$id("@pmsg_container").stop(),i.$id("@pmsg_container").css("opacity",100)},function(){i.setFadeTimeout(1e3)});var n=function(e){o.setContent(i.$id("@pmsg_container"),e),i.$id("@pmsg_container").fadeIn(350),i.setFadeTimeout(5e3)};return this.$id("@pmsg_container").is(":visible")?(clearTimeout(this.t),this.$id("@pmsg_container").fadeOut(350,function(){n(e)})):n(e),this}})},"./view/reorderable_list.js":function(e,t,i){function n(e){var t=e.style[h];if(t)return{value:t,original:t};if(window.getComputedStyle){var i=window.getComputedStyle(e).getPropertyValue(p);if(i&&"none"!==i)return{value:i,original:""}}return{value:"",original:""}}function o(e){var t=e.ownerDocument&&e.ownerDocument.defaultView&&e.ownerDocument.defaultView.getComputedStyle&&e.ownerDocument.defaultView.getComputedStyle(e,null),i=t&&t.getPropertyValue("height")||"";return i=i&&i.indexOf(".")>-1?parseFloat(i)+parseInt(t.getPropertyValue("padding-top"))+parseInt(t.getPropertyValue("padding-bottom"))+parseInt(t.getPropertyValue("border-top-width"))+parseInt(t.getPropertyValue("border-bottom-width")):e.offsetHeight;
}function s(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()}var a=i("./shared/core/component.js").Component,r=i("./shared/events/index.js"),d=i("./tooltip.js"),l=i("./shared/jquery.js"),c=document.createElement("div"),u="webkitTransition"in c.style?"webkitTransition":"transition",h="webkitTransform"in c.style?"webkitTransform":"transform",p="webkitTransform"===h?"-webkit-transform":"transform",f="webkitUserSelect"in c.style?"webkitUserSelect":"userSelect";c.style[h]="translateZ(0)";var _=c.style[h]?"translateZ(0) ":"",m=c.style[h]?"translateZ(1px) ":"";t.ReorderableList=a.extend({onLoad:function(){this.pageRoots=l(".Standard2ColLayout").add(l(".ContentPageFeed").parent());var e=this;this.handleEvent(r.Types.REORDERABLE_LIST_ITEM_UPDATE,function(){e.is_editing&&(e.detach(),e.attach()),e.showErrorOnLiveUpdate()}),this.handleEvent(r.Types.REORDERABLE_LIST_ITEM_ACTIVE,function(){
e.$id("@wrapper").hasClass("is_editing")&&e.resetActiveState()})},isOnDragActive:!1,enableLocalUpdate:!0,onStartSectionMousedownCallback:null,onEndSectionMousedownCallback:null,onStartSubsectionMousedownCallback:null,onEndSubsectionMousedownCallback:null,onStartSectionMousemoveCallback:null,onEndSectionMousemoveCallback:null,onStartSubsectionMousemoveCallback:null,onEndSubsectionMousemoveCallback:null,onStartSectionMouseupCallback:null,onEndSectionMouseupCallback:null,onStartSubsectionMouseupCallback:null,onEndSubsectionMouseupCallback:null,setToDefaultView:function(){this.target.node.style[f]="",this.target.node.style[u]="",this.target.node.style[h]=this.target.baseTransform.original,this.target.node.style.zIndex="",document.body.removeChild(this.targetNodeClone),this.targetNodeClone=null,this.target.node.style.visibility="";for(var e=0;e<this.sectionNodesContainer.length;e++){var t=this.sectionNodes[e][0];t.style.height="",t.style[h]="",t.style[u]="";for(var i=0;i<this.sectionNodesContainer[e].nodes.length;i++){
var n=this.sectionNodesContainer[e].nodes[i];n.node.style[h]=n.baseTransform.original,n.node.style[u]=""}}this.pageRoots.removeClass("unselectable"),s(),this.removeMouseHandlers()},attach:function(){this.ReorderableList=this.$id("@wrapper")[0],this.otherNodes=[];var e=[];this.sectionNodes=this.$id("@wrapper").find(".ReorderableListBranch").each(function(){e.push(l(this).parent())}),this.sectionNodes=e;for(var t=0;t<this.sectionNodes.length;t++)for(var i=this.sectionNodes[t].find(".ReorderableListContents .drag_icon"),n=0;n<i.length;n++){var o=i[n],s=l(o).closest(".ReorderableListItem").parent(),a={startSectionIndex:t,startSubsectionIndex:o,node:s};l(o).on("mousedown",a,this._onSubsectionMousedown.bind(this))}},detach:function(){if(this.sectionNodes)for(var e=0;e<this.sectionNodes.length;e++)for(var t=this.sectionNodes[e].find(".ReorderableListContents .drag_icon"),i=0;i<t.length;i++){var n=t[i];l(n).off("mousedown")}},updatePosition:function(e,t){this.latestPosition=t;var i=document.body,n=i.scrollTop;
n!=i.scrollTop&&(this.startPosition.y+=n-i.scrollTop),this.latestPosition.time-this.previousPosition.time>100&&(this.previousPosition=this.latestPosition)},removeMouseHandlers:function(){this.mouseHandlersAttached&&(this.mouseHandlersAttached=!1,l(window).off("mousemove"),l(window).off("mouseup"))},_onMousedown:function(e){var t=e.data.node[0];this.startSectionIndex=e.data.startSectionIndex,this.startSubsectionIndex=e.data.startSubsectionIndex,this.target={node:t,baseTransform:n(t),height:t.offsetHeight},this.zero=this.target.node.offsetTop+this.target.height/2,this.sectionNodesContainer=[];for(var i=0;i<this.sectionNodes.length;i++){var s,a=[],r=this.sectionNodes[i][0];this.target.node!==r&&(r.style[u]=p+" 0.2s ease-in-out");for(var d=this.sectionNodes[i].find(".ReorderableListContents .ReorderableListItem"),l=0;l<d.length;l++){var c=d.eq(l)[0].parentNode;this.target.node!==c&&(c.style[u]=p+" 0.2s ease-in-out"),s=c.offsetTop,a.push({node:c,baseTransform:n(c),pos:s+(s<this.zero?c.offsetHeight:0)-this.zero
})}s=r.offsetTop,this.sectionNodesContainer.push({nodes:a,posRelative:s+(s<this.zero?r.offsetHeight:0)-this.zero,pos:r.getBoundingClientRect().top+window.pageYOffset-r.clientTop,height:o(r)})}var h={x:e.pageX,y:e.pageY,time:e.timeStamp};this.startTransformPosition=e.clientY,this.startPosition=this.previousPosition=this.latestPosition=h,this.targetNodeClone=this.target.node.cloneNode(!0),this.target.node.style.visibility="hidden";var f=this.target.node.getBoundingClientRect();this.targetNodeClone.style.position="fixed",this.targetNodeClone.style.top=f.top+"px",this.targetNodeClone.style.left=f.left+"px",this.targetNodeClone.style["background-color"]="#fff",document.body.appendChild(this.targetNodeClone)},_onSectionMousedown:function(e){"function"==typeof this.onStartSectionMousedownCallback&&this.onStartSectionMousedownCallback(),this._onMousedown(e),"function"==typeof this.onEndSectionMousedownCallback&&this.onEndSectionMousedownCallback(this.target.node,this.targetNodeClone),this._onSectionMousemove(e),
this.mouseHandlersAttached||(this.mouseHandlersAttached=!0,l(window).on("mousemove",this._onSectionMousemove.bind(this)),l(window).on("mouseup",this._onSectionMouseup.bind(this)))},_onSubsectionMousedown:function(e){"function"==typeof this.onStartSubsectionMousedownCallback&&this.onStartSubsectionMousedownCallback(),this._onMousedown(e),"function"==typeof this.onEndSubsectionMousedownCallback&&this.onEndSubsectionMousedownCallback(this.targetNodeClone,this.startSectionIndex),this._onSubsectionMousemove(e),this.mouseHandlersAttached||(this.mouseHandlersAttached=!0,l(window).on("mousemove",this._onSubsectionMousemove.bind(this)),l(window).on("mouseup",this._onSubsectionMouseup.bind(this)))},_onMousemove:function(e){this.isOnDragActive=!0,this.updatePosition(e,{x:e.pageX,y:e.pageY,time:e.timeStamp}),this.transformY=e.clientY,this.scrollIfNearEdge(this.transformY),this.pageRoots.addClass("unselectable");var t=this.transformY-this.startTransformPosition;this.target.node.style[h]="translate(0, "+t+"px) "+m+this.target.baseTransform.value,
this.targetNodeClone.style[h]=this.target.node.style[h]},_onSectionMousemove:function(e){"function"==typeof this.onStartSectionMousemoveCallback&&this.onStartSectionMousemoveCallback(),this._onMousemove(e);for(var t=this.getTotalMovement(),i=this.target.node.offsetHeight,n=0;n<this.sectionNodesContainer.length;n++){var o=this.sectionNodesContainer[n],s=this.sectionNodes[n][0],a=0;o.posRelative<0&&t.y<0&&o.posRelative>t.y?a=i:o.posRelative>0&&t.y>0&&o.posRelative<t.y&&(a=-i),a?s.style[h]="translate(0,"+a+"px) "+_:s.style[h]=""}"function"==typeof this.onEndSectionMousemoveCallback&&this.onEndSectionMousemoveCallback()},_onSubsectionMousemove:function(e){"function"==typeof this.onStartSubsectionMousemoveCallback&&this.onStartSubsectionMousemoveCallback(),this._onMousemove(e);for(var t=this.getTotalMovement(),i=this.target.height,n=0;n<this.sectionNodesContainer.length;n++)this.latestPosition.y>this.sectionNodesContainer[n].pos&&this.latestPosition.y<(this.sectionNodesContainer[n+1]?this.sectionNodesContainer[n+1].pos:1/0)?(this.endSectionIndex=n,
n!==this.startSectionIndex?this.sectionNodes[n][0].style.height=this.sectionNodesContainer[n].height+this.target.height+"px":this.sectionNodes[n][0].style.height=this.sectionNodesContainer[n].height+"px"):n===this.startSectionIndex?this.sectionNodes[n][0].style.height=this.sectionNodesContainer[n].height-this.target.height+"px":this.sectionNodes[n][0].style.height=this.sectionNodesContainer[n].height+"px";for(n=0;n<this.sectionNodesContainer.length;n++)for(var o=this.sectionNodesContainer[n],s=0;s<o.nodes.length;s++){var a=0,r=o.nodes[s];if(r.pos<0&&t.y<0&&r.pos>t.y?a+=i:r.pos>0&&t.y>0&&r.pos<t.y&&(a+=-i),this.latestPosition.y>o.pos&&n>this.startSectionIndex){a+=i,this.zero=this.target.node.offsetTop+this.target.height/2;var d=r.node.offsetTop;t.y>0?r.pos=d+(d<this.zero?r.offsetHeight:0)-this.zero+i:t.y<0&&(r.pos=d+(d<this.zero?r.offsetHeight:0)-this.zero-i);for(var l=0;l<this.sectionNodes.length;l++)this.sectionNodesContainer[l].pos=this.sectionNodes[l][0].getBoundingClientRect().top+window.pageYOffset-this.sectionNodes[l][0].clientTop;
}r.node.style[h]=a?"translate(0,"+a+"px) "+_+r.baseTransform.value:r.baseTransform.original}"function"==typeof this.onEndSubsectionMousemoveCallback&&this.onEndSubsectionMousemoveCallback()},_onMouseup:function(){this.isOnDragActive=!1,l("html, body").stop()},_onSectionMouseup:function(){"function"==typeof this.onStartSectionMouseupCallback&&this.onStartSectionMouseupCallback(),this._onMouseup();var e,t=this.getTotalMovement();if(t.y<0){for(e=0;e<this.sectionNodesContainer.length;e++)if(this.sectionNodesContainer[e].posRelative>t.y){this.endSectionIndex=e,this.enableLocalUpdate&&this.target.node.parentNode.insertBefore(this.target.node,this.sectionNodes[this.endSectionIndex]);break}}else for(e=this.sectionNodesContainer.length-1;e>=0;e--)if(this.sectionNodesContainer[e].posRelative<t.y){this.startSectionIndex===e+1?this.endSectionIndex=e+1:this.endSectionIndex=e,this.enableLocalUpdate&&this.target.node.parentNode.insertBefore(this.target.node,this.sectionNodes[e+1]?this.sectionNodes[e+1]:null);
break}if(this.removeMouseHandlers(),!this.enableLocalUpdate){var i=this.targetNodeClone.getBoundingClientRect().left;this.targetNodeClone.style[h]="",this.targetNodeClone.style.position="absolute",this.targetNodeClone.style.left=i;var n,o=l(window).scrollTop();0!==this.endSectionIndex&&(t.y<0?(n=this.sectionNodes[this.endSectionIndex-1][0],o+=n.getBoundingClientRect().bottom):(n=this.sectionNodes[this.endSectionIndex][0],o+=n.getBoundingClientRect().bottom)),this.targetNodeClone.style.top=o+"px"}"function"==typeof this.onEndSectionMouseupCallback&&this.onEndSectionMouseupCallback(this.target.node,this.targetNodeClone,this.endSectionIndex,this.startSectionIndex)},_onSubsectionMouseup:function(){this.removeMouseHandlers(),"function"==typeof this.onStartSubsectionMouseupCallback&&this.onStartSubsectionMouseupCallback(this.target.node,this.endSubsectionIndex,this.startSubsectionIndex),this._onMouseup();var e,t=this.sectionNodesContainer[this.endSectionIndex].nodes,i=this.getTotalMovement();if(0===t.length)this.enableLocalUpdate&&this.sectionNodes[this.endSectionIndex].querySelector("div.nested_contents").firstChild.appendChild(this.target.node),
this.endSubsectionIndex=0;else if(i.y<0){for(t[t.length-1].pos+this.target.height>i.y&&(this.localUpdate&&this.sectionNodes[this.endSectionIndex].querySelector("div.nested_contents").firstChild.insertBefore(this.target.node,t[t.length-1].node.nextSibling),this.endSubsectionIndex=t.length),e=0;e<t.length;e++)if(t[e].pos>i.y){this.endSubsectionIndex=e,this.localUpdate&&this.sectionNodes[this.endSectionIndex].querySelector("div.nested_contents").firstChild.insertBefore(this.target.node,t[e].node);break}}else for(t[0].pos>i.y&&(this.localUpdate&&this.sectionNodes[this.endSectionIndex].querySelector("div.nested_contents").firstChild.insertBefore(this.target.node,t[0].node),this.endSubsectionIndex=0),e=t.length-1;e>=0;e--)if(t[e].pos<i.y){this.endSectionIndex===this.startSectionIndex&&e+1!==this.startSubsectionIndex?this.endSubsectionIndex=e:this.endSubsectionIndex=e+1,this.localUpdate&&this.sectionNodes[this.endSectionIndex].querySelector("div.nested_contents").firstChild.insertBefore(this.target.node,t[e+1]?t[e+1].node:null);
break}if(!this.enableLocalUpdate){var n=this.targetNodeClone.getBoundingClientRect().left;this.targetNodeClone.style[h]="",this.targetNodeClone.style.position="absolute",this.targetNodeClone.style.left=n;var o,s=l(window).scrollTop();0===this.endSubsectionIndex||0===this.sectionNodesContainer[this.endSectionIndex].nodes.length?(o=l(this.sectionNodes[this.endSectionIndex])[0],s+=o.getBoundingClientRect().top):i.y<0?(o=this.sectionNodesContainer[this.endSectionIndex].nodes[this.endSubsectionIndex-1].node,s+=o.getBoundingClientRect().bottom):(o=this.endSectionIndex!==this.startSectionIndex?this.sectionNodesContainer[this.endSectionIndex].nodes[this.endSubsectionIndex-1].node:this.sectionNodesContainer[this.endSectionIndex].nodes[this.endSubsectionIndex].node,s+=o.getBoundingClientRect().bottom),this.targetNodeClone.style.top=s+"px"}"function"==typeof this.onEndSubsectionMouseupCallback&&this.onEndSubsectionMouseupCallback(this.target.node,this.targetNodeClone,this.endSubsectionIndex,this.startSubsectionIndex,this.endSectionIndex,this.startSectionIndex);
},scrollIfNearEdge:function(e){this.isOnDragActive&&(e+50>l(window).height()?l("html, body").stop().animate({scrollTop:l(document).height()},6e3,"linear"):100>e?l("html, body").stop().animate({scrollTop:0},6e3,"linear"):l("html, body").stop())},getTotalMovement:function(){return{x:this.latestPosition.x-this.startPosition.x,y:this.latestPosition.y-this.startPosition.y}}}),t.ReorderableListContents=a.extend({onLoad:function(){this.separator_tooltip_content&&d.attach(this.$id("@separator"),this.separator_tooltip_content)}}),t.ReorderableListItem=a.extend({onLoad:function(){var e=this;this.emitEvent({type:r.Types.REORDERABLE_LIST_ITEM_UPDATE,payload:{}}),e.$id("@remove").click(function(){return e.remove(),!1}),e.$id("@item").mousedown(function(){e.emitEvent({type:r.Types.REORDERABLE_LIST_ITEM_ACTIVE,payload:{}}),l(this).addClass("active").focus()})},remove:function(){this.serverCall("remove").liveMutate().send()}})},"./view/selector.js":function(e,t,i){var n=i("./webnode2.js"),o=i("./shared/core/webnode.js"),s=i("./shared/jquery.js"),a=i("./simscroll.js"),r=i("./shared/window_manager.js"),d=i("./third_party/autosize.js"),l=i("./shared/logging.js"),c=i("./shared/core/component.js"),u=c.Component;
t.Selector=u.extend({onLoad:function(){function e(e){if("keydown"===e.type){var t=i.child("results");if(t){var n=t.getSelectedResult();null===n&&i.allow_no_selection?i.submit():n&&i.onResultSelected(n,!1,t.$selectedItemElem)}else i.submit()}}function t(t){if(i.shouldSimScroll&&"keydown"==t.type){if(!i.query&&a.maybeSimulateScroll(t))return!1;if(!i.query&&39==t.which)return void i.$input.blur()}switch(t.which){case 13:t.preventDefault(),e(t);break;case 27:i.selectorFocusOutHandler();break;case 38:i.handleUpDownArrowKey(t,-1);break;case 40:i.handleUpDownArrowKey(t,1);break;default:var n=i.$input.val();n!==i.query&&i._setQuery(n)}}var i=this;i._busy=!1,i._resultsLastUpdated=Date.now(),i.$input=i.$id("@input"),i.$results_container=i.$id("@results_container"),i.$results=i.$id("@results"),i.$empty_input_prompt=i.$id("@empty_input_prompt"),i.$spinner=i.$id("@spinner"),i.$wrapper=i.$id("@wrapper"),i.shouldSimScroll=!1,i.hasAutoSized=!1,i.query=i.$input.val(),i.has_updated_result=!1,i.inputIsFocused=!1,
i.force_below=!1,i.$input.change(t).keydown(t).keyup(t).focus(i.inputFocusHandler.bind(i)).blur(i.inputBlurHandler.bind(i)),i.$wrapper.focusout(i.wrapperFocusoutHandler.bind(i)).focusin(i.wrapperFocusinHandler.bind(i))},handleUpDownArrowKey:function(e,t){if(e.preventDefault(),"keydown"===e.type){var i=this.child("results");i&&i.moveSelection(t)}},inputFocusHandler:function(){this.inputIsFocused=!0,this.has_updated_result||(this.has_updated_result=!0,this.updateResults()),this.is_textarea&&!this.hasAutoSized&&(d(this.$input),this.hasAutoSized=!0),this.showResults(!0),this.length_limit&&this.child("counter").show()},inputBlurHandler:function(){this.inputIsFocused=!1,this.length_limit&&this.child("counter").hide()},selectorFocusOutHandler:function(){this.showResults(!1),this.$input.blur()},wrapperFocusoutHandler:function(e){var t=this.$wrapper.get(0);return t&&t.contains(e.relatedTarget)?!1:void this.showResults(!1)},wrapperFocusinHandler:function(){this.focus()},setQuery:function(e){var t=this.$input[0].selectionStart,i=this.$input[0].selectionEnd;
this.$input.val(e),this.$input[0].setSelectionRange(t,i),this._setQuery(e)},queryDidChange:function(){},resultsDidChange:function(){},onResultSelected:function(e,t,i){this.beforeSelectResultCallback&&this.beforeSelectResultCallback(e,t,i),this.resultWasSelected(e,t,i),this.afterResultWasSelectedCallback&&this.afterResultWasSelectedCallback(e,t,i)},resultWasSelected:function(e,t,i){},submit:function(){},shouldShowEmptyInputPrompt:function(){return!(this.show_results_for_empty_query||this.query&&0!==this.query.trim().length)},adjustResultContainerContent:function(){this.shouldShowEmptyInputPrompt()?(this.$results.addClass("hidden"),this.$empty_input_prompt.removeClass("hidden")):(this.$results.removeClass("hidden"),this.$empty_input_prompt.addClass("hidden")),this.preventOverflow()},showResults:function(e){e?(this.$results_container.removeClass("hidden"),this.adjustResultContainerContent()):(this.$results_container.addClass("hidden"),this._needToPreventOverflow=!0)},preventOverflow:function(){
if(!this.$results_container.hasClass("hidden")&&this._needToPreventOverflow){this._needToPreventOverflow=!1,this.$results_container.removeClass("inverted"),this.$results_container.css({"overflow-y":"auto",height:"auto"});var e,t=this.$results_container.offset().top,i=this.$results_container.outerHeight(!0),n=t+i,o=s(window).scrollTop()+r.headerOffset,a=s(window).scrollTop()+s(window).height(),d=a-t,l=t-o;l>500&&200>d&&!this.force_below?(this.$results_container.addClass("inverted"),e=o-this.$results_container.offset().top):e=n-a,e>0&&this.$results_container.css({"overflow-y":"scroll",height:i-e})}},getExtraKwargs:function(){return{}},updateResults:function(){var e=this;if(e.shouldShowEmptyInputPrompt())return this._needToPreventOverflow=!0,void e.adjustResultContainerContent();if(!e.isBusy()){var t=Date.now(),i={query:e.query,parent_cid:e.cid,parent_domid:c.getLiveParent(e.cid)},n=e.$results.get(0),o=c.getLiveChildren(e.cid),s=o.filter(function(e){return n.contains(document.getElementById(e));
});i.domids_to_remove=JSON.stringify(s);var a=e.getExtraKwargs();for(var r in a)a.hasOwnProperty(r)&&(i[r]=a[r]);e.setBusy(!0),e.serverCall("results_content_for").kwargs(i).success(function(i){e.maybeUpdateResults(i,t),e.resultsServerCallHandler()}).except(function(){e.resultsServerCallHandler(!0)}).error(function(){e.resultsServerCallHandler(!0)}).send()}},maybeUpdateResults:function(e,t){if(t>this._resultsLastUpdated){this._resultsLastUpdated=t;var i=this.$results.get(0);n.forgetContents(s(i)),o.setContent(s(i),e),this._needToPreventOverflow=!0}},resultsServerCallHandler:function(e){this.setBusy(!1),this.$input.is(":focus")&&""!==this.$input.val()&&this.showResults(!0),e||this.child("results").query===this.$input.val()||this.updateResults()},isBusy:function(){return this._busy},setBusy:function(e){function t(){return!i._busy&&i._spinner}var i=this;if(i._busy=e,i._lastBusyUpdate=Date.now(),i._busy&&!i._spinner){i.$spinner.removeClass("hidden"),i._spinner=!0;var n=i._lastBusyUpdate;setTimeout(function(){
i._busy&&i._lastBusyUpdate===n&&i.resultsServerCallHandler.call(i)},5e3)}else t()&&setTimeout(function(){t()&&(i.$spinner.addClass("hidden"),i._spinner=null)},100)},focus:function(){var e=this.$id("@input");!this.inputIsFocused&&e&&e.focus()},blur:function(){this.$id("@input").blur()},_setQuery:function(e){this.query=e,this.length_limit&&this.child("counter").updateCounter(e.length),this.queryDidChange(),this.updateResults()}}),t.MultiSelector=t.Selector.extend({onLoad:function(){this._super.apply(this,arguments),this.saved_results=this.saved_results||[]},getExtraKwargs:function(){return{saved_results:this.saved_results}},resultWasSelected:function(e,t,i){this.saved_results.push(e),this.showResults(!1),this.setQuery(""),this.updateDisplayedResults(),this.onSavedResultsChanged()},onSavedResultsChanged:function(){},remove:function(e){this.saved_results.splice(e,1),this.updateDisplayedResults(),this.onSavedResultsChanged()},clear:function(){this.saved_results=[],this.updateDisplayedResults(),
this.onSavedResultsChanged()},updateDisplayedResults:function(){var e=this;e.serverCall("saved_results_content_for").contentFor(e.$id("@saved_results"),{useLoadingSpinner:!1}).args(e.saved_results).send()}}),t.MultiSelectorSavedResultList=u.extend({onLoad:function(){for(var e=0;e<this.num_results;e++)this.attachRemoveClickHandler(e)},attachRemoveClickHandler:function(e){var t=this;t.$id("@remove"+e).click(function(){return t.parent().remove(e),!1})}}),t.NavigateToResultUrlSelectorMixin={resultWasSelected:function(e,t){this._super.apply(this,arguments),e.data&&e.data.url&&(t?window.open(e.data.url):r.navigateTo(e.data.url))}},t.SelectorWithTypeaheadLogMixin={shouldTypeaheadLog:function(e){return!0},resultWasSelected:function(e,t){var i=this.child("results");if(this.shouldTypeaheadLog(e)){var n={data:i.typeahead_log_data,click_index:i.selectedIndex};parseInt(n.click_index)===n.click_index&&n.click_index>=0&&"undefined"!=typeof n.data&&l.log("typeahead",{message:n})}this._super.apply(this,arguments);
}},t.SelectorResults=u.extend({onLoad:function(){var e=this;e.allow_no_selection?e.setSelection(-1):e.setSelection(0),e.$id("@wrapper").on("mouseover",".selector_result",function(t){var i=e.getIndexFromResultElementID(this.id);e.setSelection(i)}).on("mousedown",".selector_result",function(e){e.preventDefault()}).on("click",".selector_result",function(t){var i=e.getIndexFromResultElementID(this.id);e.setSelection(i);var n=e.getSelectedResult(),o=t.metaKey||t.ctrlKey;e.parent().onResultSelected(n,o,e.$selectedItemElem)}),e.allow_no_selection&&e.$id("@wrapper").mouseleave(function(t){e.setSelection(-1)}),void 0!=e.parent().resultsDidChange&&e.parent().resultsDidChange()},getSelectedResult:function(){return-1===this.selectedIndex?null:!this.numResults&&this.allow_no_selection?null:this.results[this.selectedIndex]},setSelection:function(e){if(this.numResults&&!isNaN(parseInt(e)))if(-1===this.selectedIndex||isNaN(parseInt(this.selectedIndex))||this.$id("@result_"+this.selectedIndex).removeClass("selector_highlighted"),
(this.allow_no_selection&&-1>e||!this.allow_no_selection&&0>e)&&(e=this.numResults-1),e>this.numResults-1&&(e=this.allow_no_selection?-1:0),-1===e)this.selectedIndex=e,this.$selectedItemElem=null;else{var t=this.$id("@result_"+e);t&&(this.$selectedItemElem=t,this.$selectedItemElem.addClass("selector_highlighted"),this.selectedIndex=e)}},moveSelection:function(e){var t=this.selectedIndex+e;this.setSelection(t)},getIndexFromResultElementID:function(e){var t=e.split("_");return parseInt(t[t.length-1])}}),t.WithServerCallMessageMixin=t.Selector.extend({onLoad:function(){var e=this;e._super.apply(e,arguments),e.$serverMessage=e.$id("@server_message"),e.pendingServerCallRequest=null,e.serverCallBusy=!1},queryDidChange:function(){this._super.apply(this,arguments),this.showServerMessage(!1)},makeServerCall:function(e){this.pendingServerCallRequest=e,this.isBusy()||this.doServerCall()},hasPendingServerCall:function(){return null!==this.pendingServerCallRequest||this.serverCallBusy},resultsServerCallHandler:function(){
var e=this;null!==e.pendingServerCallRequest?e.doServerCall():(e._super.apply(e,arguments),e.showServerMessage(!1))},doServerCall:function(){var e=this;e.setBusy(!0),e.serverCallBusy=!0,e.showServerMessage(!1);var t=function(t,i){e.updateServerMessage(t,i)&&e.showServerMessage(!0),e.serverCallBusy=!1,e.setBusy(!1)};e.pendingServerCallRequest.success(function(e){t(!0,e)}).except(function(e){t(!1,e)}).error(function(){t(!1)}).send(),e.pendingServerCallRequest=null},updateServerMessage:function(e,t){return!1},showServerMessage:function(e){e?this.$serverMessage.removeClass("hidden"):this.$serverMessage.addClass("hidden")}})},"./view/suggested_edits.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./shared/events/index.js");t.SuggestedEditBar=n.extend({toggleButtons:function(){this.$id("@suggested_answer_buttons").toggleClass("hidden")}}),t.SuggestedEditButtons=n.extend({onLoad:function(){var e=this;e.$id("@view_original").click(function(){return e.content_type?e.emitEvent(o.helpers.inlineEditorToggle(e.content_type,e.object_id)):e.parent().parent().toggleSuggestion(),
!1}),e.content_type&&e.$id("@edit_suggestion").on("click",function(){return e.emitEvent(o.helpers.inlineEditorEdit(e.content_type,e.object_id)),!1})}})},"./view/tooltip.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./tooltip.js");t.TooltipComponent=n.extend({onLoad:function(){var e=this.$id("@tooltip");o.attach(e.parent(),this.options.contents,this.options),e.remove()}})},"./view/upload.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./w2.dialog.js").Dialog,s=i("./shared/jquery.js"),a=i("./shared/events/index.js"),r=i("./shared/browser.js"),d=i("./shared/upload.js"),l=i("./shared/facebook.js"),c=i("./shared/loading.js"),u=r.msie&&r.version<=9;t.UploadDialogContents=n.extend({onLoad:function(){var e=this;if(this.child("upload_form").success(this.uploadSuccess.bind(this)).failure(this.uploadFailure.bind(this)),u)return this.$id("@drop_zone").removeClass("drop_zone"),this.child("drag_and_drop_form").$id("@drag_and_drop_form").addClass("hidden"),
!1;if(this.inlineUploadForm=this.child("upload_web"),this.inlineUploadForm&&(this.inlineUploadForm.setContentForTarget(this.$id("@iframe")),this.inlineUploadForm.setShowPhotoChoiceCallback(function(){e.disableDropZone(),e.onShowInlinePhotoChoice()})),this.handleEvent(a.Types.UPLOAD_DIALOG_DROPZONE,function(t){t.payload.enabled?e.enableDropZone():e.disableDropZone()}),this.child("drag_and_drop_form")){e.addBodyDragoverListener();var t=function(t){t.stopPropagation(),t.preventDefault(),t.originalEvent.dataTransfer.dropEffect="copy",e.child("drag_and_drop_form").$id("@form_title").addClass("drag_and_hover"),e.$id("@drop_zone").addClass("drag_and_hover")},i=function(t){t.stopPropagation(),t.preventDefault(),e.child("drag_and_drop_form").$id("@form_title").removeClass("drag_and_hover"),e.$id("@drop_zone").removeClass("drag_and_hover")};this.child("drag_and_drop_form").setDropZone(this.$id("@drop_zone"),t,i),this.child("drag_and_drop_form").success(this.uploadSuccess.bind(this)).failure(this.uploadFailure.bind(this));
}},disableDropZone:function(){this.$id("@drop_zone").addClass("disabled"),this.child("drag_and_drop_form").$id("@form_title").addClass("disabled")},enableDropZone:function(){this.$id("@drop_zone").removeClass("disabled"),this.child("drag_and_drop_form").$id("@form_title").remove("disabled")},onUnload:function(){this.removeBodyDragoverListener()},removeBodyDragoverListener:function(){s("document, body").off(".uploadDialog")},addBodyDragoverListener:function(){s("document, body").on({"dragenter.uploadDialog":function(e){e.stopPropagation(),e.preventDefault();var t=e.originalEvent.dataTransfer;t.effectAllowed=t.dropEffect="none"},"dragover.uploadDialog":function(e){e.stopPropagation(),e.preventDefault();var t=e.originalEvent.dataTransfer;t.effectAllowed=t.dropEffect="none"}})},uploadSuccess:function(){},uploadFailure:function(){s(".drop_zone").removeClass("drag_and_hover"),this.child("drag_and_drop_form").$id("@form_title").removeClass("drag_and_hover"),this.child("upload_form").hideSpinner();
},onShowInlinePhotoChoice:function(){this.child("drag_and_drop_form").$id("@form_title").text(this.click_best_text),s("h3").removeClass("drag_and_hover"),this.$id("@drop_zone").removeClass("drag_and_hover")}}),t.UploadBaseForm=n.extend({onUpload:function(e){return e&&!e.success?(e.message&&alert(e.message),void(this._failureCallback&&this._failureCallback(e))):void(this._successCallback&&this._successCallback(e))},success:function(e){return this._successCallback=e,this},failure:function(e){return this._failureCallback=e,this},_uploadFiles:function(e){var t=this,i=this.$id("@form").get(0);if(u)return s(document).one("quora_file_upload",function(e,i){t.onUpload(i)}),void i.submit();var n={};s.each(i,function(e,t){"hidden"==t.type&&(n[t.name]=t.value)});var o=this.onUpload.bind(this);d.uploadData(n,e,o,o)}}),t.UploadFileForm=t.UploadBaseForm.extend({onLoad:function(){this._super.apply(this,arguments);var e=this;e.file_input=e.$id("@file"),e.file_button=e.$id("@file_button"),e.shouldShowUploadButton=!u&&e.file_button.length,
e.$id("@upload_spinner").append(c.createDots()),this.handleEvent(a.Types.UPLOAD_DIALOG_LOADING_STATE,function(t){"loading"==t.payload.state?e.showSpinner():e.hideSpinner()}),e.file_input.on("change",function(){var t=e.$id("@file")[0].files;e.showSpinner(),e._uploadFiles(t)}),e.file_button.on("click",function(){e.file_input.click()}),e._showInput()},_showInput:function(){this.shouldShowUploadButton?(this.file_input.addClass("hidden"),this.file_button.removeClass("hidden")):(this.file_button.addClass("hidden"),this.file_input.removeClass("hidden"))},_hideInput:function(){this.file_button.addClass("hidden"),this.file_input.addClass("hidden")},showSpinner:function(){this._hideInput(),this.$id("@upload_spinner").removeClass("hidden"),this.emitEvent({type:a.Types.UPLOAD_DIALOG_DROPZONE,payload:{enabled:!1}})},hideSpinner:function(){this.$id("@upload_spinner").addClass("hidden"),this._showInput(),this.emitEvent({type:a.Types.UPLOAD_DIALOG_DROPZONE,payload:{enabled:!0}})}}),t.DragAndDropForm=t.UploadBaseForm.extend({
setDropZone:function(e,t,i){this.dropZoneElement=e,this.dropZoneElement.on("dragover",t),this.dropZoneElement.on("dragleave",i),this.addDropEventListener()},addDropEventListener:function(){this.dropEventBound||this.dropZoneElement&&(this.onDropListener=this.onDrop.bind(this),this.dropZoneElement[0].addEventListener("drop",this.onDropListener,!1),this.dropEventBound=!0)},removeDropEventListener:function(){this.dropEventBound&&this.dropZoneElement&&(this.dropZoneElement[0].removeEventListener("drop",this.onDropListener),this.dropEventBound=!1)},onUnload:function(){this.removeDropEventListener()},onDrop:function(e){e&&e.dataTransfer&&(e.stopPropagation(),e.preventDefault(),this.emitEvent({type:a.Types.UPLOAD_DIALOG_LOADING_STATE,payload:{state:"loading"}}),this._uploadFiles(e.dataTransfer.files))}}),t.EditPhotoDialogContents=t.UploadDialogContents.extend({onLoad:function(){this._super.apply(this,arguments),this.$id("@from_facebook").on("click",this.fetchFacebookPicture.bind(this));var e=this;
e.addBodyDragoverListener();var t=function(t){t.stopPropagation(),t.preventDefault(),t.originalEvent.dataTransfer.dropEffect="copy",e.child("drag_and_drop_form").$id("@form_title").addClass("drag_and_hover"),e.$id("@drop_zone").addClass("drag_and_hover")},i=function(t){t.stopPropagation(),t.preventDefault(),e.child("drag_and_drop_form").$id("@form_title").removeClass("drag_and_hover"),e.$id("@drop_zone").removeClass("drag_and_hover")};return this.child("drag_and_drop_form").setDropZone(this.$id("@drop_zone"),t,i),this.child("drag_and_drop_form").success(this.uploadSuccess.bind(this)),this.child("upload_form").success(this.uploadSuccess.bind(this)),!1},fetchFacebookPicture:function(){if(this.fb_uid){var e=this;l.onInit(function(){var t="/"+e.fb_uid+"/picture?type=large";window.FB.api(t,function(t){var i=t.data;i&&i.url?(e.$id("@web_upload").addClass("hidden"),e.$id("@from_facebook").addClass("hidden"),e.child("upload_web").$id("@url").addClass("hidden").val(i.url),e.child("upload_web").$id("@download").click(),
e.$id("@web_upload").removeClass("hidden")):(e.serverCall("log_fb_picture_error").send(),alert(e.no_fb_picture_error))})})}},uploadSuccess:function(e){e.need_thumb_selection?this.serverCall("upload").kwargs({target_id:this.target_id,target:this.target}).contentFor(this.$id("@iframe")).success(this.onShowInlinePhotoChoice.bind(this)).send():o.dialogFor(this).close_()}})},"./view/user.js":function(e,t,i){var n=i("./shared/core/component.js").Component,o=i("./view/hover_menu.js").HoverMenu,s=i("./tooltip.js"),a=i("./shared/cookies.js");t.Name=o.extend({onLoad:function(e){var t=this;this._super.apply(this,arguments),this.$id("@name_link").mousedown(function(){a.setQfeedLog(t,"UserClickthrough"),a.setQueryLog(t,"UserClickthrough")})}}),t.UserPhoto=n.extend({onLoad:function(e){var t=this;this.$id("@link").mousedown(function(){a.setQfeedLog(t,"UserClickthrough"),a.setQueryLog(t,"UserClickthrough")})}}),t.TopAskerIcon=n.extend({onLoad:function(){s.attach(this.$id("@icon"),this.tooltip_text)}})},
"./view/voter_list.js":function(e,t,i){var n=i("./shared/core/component.js").Component;t.VoterListModalLink=n.extend({onLoad:function(){var e=this;this.$id("@modal_link").click(function(t){t.preventDefault(),e.createModal("load_inner").kwargs({object_id:e.object_id}).show()})}})},"./visibility.js":function(e,t){t.getFrameElement=function(){try{var e=window.frameElement;return e.getAttribute("className"),e}catch(t){return null}}},"./w2.dialog.js":function(e,t,i){var n=i("./shared/core/component.js"),o=i("./shared/jquery.js"),s=i("./shared/Class.js").Class,a=i("./webnode2.js"),r=i("./settings-webpack.js").interface_strings,d=t.Dialog=s.extend({__init__:function(e,t){this.opener&&this.opener(e),d._dialogCounter+=1,this._dialogId=d._dialogCounter,this._dialogOuter="#__w2_dialog_outer_"+this._dialogId,this._dialogContainerId="#__w2_dialog_container_"+this._dialogId,this._cid="*dialog*_"+this._dialogId,d._instance=this,this._title=null,this._buttons=[],this._ok=null,this._cancel=null,this.opts=o.extend({
closeOnEscape:!0,closeOnClickOut:!1,sortButtons:!0,focusOK:!1,dialogClass:"",verticalOffset:150,showXButton:!1,hideDialog:!1},t),this._opened=!1,this._containsComponent=!1,this._content=null,this.opts.html&&(this._content=this.opts.html)},opt:function(e,t){return this.opts[e]=t,this},ok:function(e,t){return"string"==typeof e&&(t=e,e=null),this._ok=e,t!==!1&&this.addButton(new c(this,t,null)),this},cancel:function(e,t,i){return"string"==typeof e&&(t=e,e=null),this._cancel=e,t!==!1&&(i?this.addButton(new h(this,t,null)):this.addButton(new u(this,t,null))),this},button:function(e,t,i){return this.addButton(new l(this,t,e,i))},title:function(e){if(this._opened)throw new Error("Can't set the title for a dialog once it has been opened.");return this._title=e,this},setTitle:function(e){e&&o("#__w2_dialog_title_"+this._dialogId).text(e)},addButton:function(e){if(this._opened)throw new Error("Can't add a button to a dialog once it has been opened");return this._buttons.push(e),this},opener:function(e){
return this._opener=e,this},open_:function(){if(this._opened)return this;this._createDOMElements();var e=n._safeGetComponentByCID(this._cid);n._components[this._cid]=e;var t={};t[this._cid]="*ROOT*",n.addParents(t);var i=function(e){this.opts.closeOnEscape&&27==e.keyCode&&(this.cancel_(),e.stopPropagation())};if(o(document).on("keydown.__w2_dialog_"+this._dialogId,i.bind(this)),this.opts.closeOnClickOut){var s=this._dialogOuter;o(document).on("click",s,function(e){e.stopPropagation()});var a=function(e){this.cancel_(),e.stopPropagation()};o(document).on("click",":not("+s+","+s+" *)",a.bind(this))}return this._opened=!0,"function"==typeof this._open&&this._open.apply(this,arguments),this},cancel_:function(e){var t=!0;"function"==typeof this._cancel&&this._cancel(this._callbackArg(e))===!1&&(t=!1),t&&this.close_()},_callbackArg:function(e){var t=n._safeGetComponentByCID(this._cid),i={dialog:this,dialogWrapper:t,button:e};return this._containsComponent&&(i.dialogComponent=t.child("__dialog__")),
i},ok_:function(e){var t=!0;return"function"==typeof this._ok&&this._ok(this._callbackArg(e))===!1&&(t=!1),t&&this.close_(),t},close_:function(){if(!this._opened)return this;o(document).off(".__w2_dialog_"+this._dialogId),a.forgetContents(o(this._dialogOuter)),n.unloadComponent(this._cid),o(this._dialogOuter).remove(),this._opened=!1,"function"==typeof this._close&&this._close.apply(this,arguments);var e=this._dialogOuter;return o(document).off("click",e),o(document).off("click",":not("+e+","+e+" *)"),this},open:function(e){return this._open=e,this},close:function(e){return this._close=e,this},html:function(e){return this._content=e,this.open_()},text:function(e){return this.html(e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"))},_createDOMElements:function(){var e=this.opts.width||470,t="dialog";this.opts.hideDialog&&(t="");var i,n=o("<div />").attr("id","__w2_dialog_outer_"+this._dialogId).addClass(t).addClass("w4").addClass(this.opts.dialogClass);this._title?(i=o("<div />").addClass("dialog_wrapper").append(o("<h2 />").attr("id","__w2_dialog_title_"+this._dialogId).addClass("dialog_header").addClass("dialog_frame").text(this._title)),
this._content&&i.append(o("<div />").addClass("dialog_frame").addClass("dialog_contents").addClass("dialog_body").html(this._content))):i=o("<div />").addClass("dialog_component").addClass("dialog_wrapper").addClass("dialog_body").html(this._content),this.opts.showXButton&&i.append(o("<a />").attr("href","#").addClass("remove").click(this.cancel_.bind(this)).click(function(){return!1})),this._buttons.length&&i.append(o("<div />").addClass("dialog_frame").addClass("dialog_buttons").append(this._buttonsDOM()));var s=o(window).width(),a=o(window).scrollTop(),r=e,d=s-r,l=d/2;if(a=this.opts.verticalOffset,o(window).height()<600&&(a=o(window).scrollTop(),i.css("position","static")),i.css("width",e-10+"px"),n.append(i).css("top",a+"px").css("left",this.opts.left||l-15+"px").css("width",e+10+"px").appendTo(o(document.body)),this.opts.focusOK)for(var c=this._buttons.length-1;c;c--){var u=this._buttons[c];if("submit"==u._type){o("#__w2_dialog_button_"+this._dialogId+"_"+c).focus();break}}},checkDialogPosition:function(){
var e=o(this._dialogOuter),t=e.offset().top,i=t+e.outerHeight(!0),n=o(window),s=n.scrollTop()+n.height();if(i>s){var a=this.opts.verticalOffset,r=n.scrollTop()+a+e.outerHeight(!0);r>s&&(a=10),e.css("top",a+"px")}this._checkContentOverflow()},_checkContentOverflow:function(){var e=this,t=o(window),i=t.scrollTop()+t.height(),n=o(e._dialogContainerId),s=n.offset().top,a=n.outerHeight(!0),r=s+a;if(r>i){var d=r-i,l=a-d;n.css({"overflow-y":"scroll",height:l})}},_buttonDOM:function(e,t){e._index=t;var i=o("<a />").addClass("dialog_button").text(e._text).click(e.click_.bind(e)).click(function(){return!1}).attr("href","#").attr("id","__w2_dialog_button_"+this._dialogId+"_"+t);switch(e._type){case"submit":i.addClass("submit_button");break;case"link":case"cancel":i.addClass("cancel");break;default:i.addClass("action_button")}return i},_buttonsDOM:function(){var e=o("<div />");this.opts.sortButtons&&this._buttons.sort(function(e,t){return e._priority-t._priority});for(var t=this._buttons.length-1;t>=0;t--){
var i=this._buttons[t];e.append(this._buttonDOM(i,t))}return e.addClass("dialog_buttons_contents")},_loadingHTML:function(){return'<div id="__w2_dialog_container_'+this._dialogId+'"></div>'},load:function(e,t){t=o.extend({args:[],kwargs:{},showImmediately:!0,showOnLoad:!0},t),this._content=this._loadingHTML(),this.open_();var i=function(){this._opener.__dialog__=this;var e=n._safeGetComponentByCID(this._cid);e.__opener__=this._opener,e.__dialog__=this,e.setDvar("__dialog__",this._cid),n._children[this._cid].__dialog__=n._allChildren[this._cid][0],this._containsComponent=!0,this.checkDialogPosition()},s=this._opener.serverCall(e);return s.args.apply(s,this.opts.args).kwargs(t.kwargs).success(i.bind(this)).contentFor(o(this._dialogContainerId),{parentCid:this._cid}),this.opts.error&&s.error.apply(this,this.opts.error),this.opts.except&&s.except.apply(this,this.opts.except),s.send(),this}});d.openerFor=function(e){var t=e.getDvar("__dialog__"),i=n._safeGetComponentByCID(t);return i&&i.__opener__;
},d.dialogFor=function(e){var t=e.getDvar("__dialog__"),i=n._safeGetComponentByCID(t);return i&&i.__dialog__},d._dialogCounter||(d._dialogCounter=0),d._instance||(d._instance=null);var l=s.extend({__init__:function(e,t,i,n){this._dialog=e,this._text=t,this._callback=i,this._opts=n||{},this._priority=50,this._type="action"},text:function(e){this._text=e},callback:function(e){this._callback=e},click_:function(){var e=!0;"function"==typeof this._callback&&this._callback.call(this._dialog,this._dialog._callbackArg(this))===!1&&(e=!1),e&&this._dialog.close_()}}),c=l.extend({__init__:function(e,t,i,n){var s=this;n=o.extend({style:"ok_button"},n),this._super(e,t||"OK",function(){var e=!0;return"function"==typeof i&&i.call(s,s._dialog._callbackArg(s))===!1&&(e=!1),e?s._dialog.ok_.call(s._dialog,s):e},n),this._priority=75,this._type="submit"}}),u=l.extend({__init__:function(e,t,i,n){var s=this;n=o.extend({style:"cancel_button"},n),this._super(e,t||r.cancel,function(){var e=!0;"function"==typeof i&&i.call(s,s._dialog._callbackArg(s))===!1&&(e=!1),
e&&s._dialog.cancel_.call(s._dialog,s)},n),this._priority=25,this._type="link"}}),h=u.extend({__init__:function(e,t,i,n){this._super(e,t,i,n),this._type="action"}});t.createDialog=function(e,t){return new d(e,t)}},"./w2.errors.js":function(e,t,i){function n(e,t,i,n,s){var r=0===e.status;if(r)return void setTimeout(function(){if(!a()){var e=f.interface_strings.connection_problem;o(e+" ")}},1e3);if(u.enabled&&u("w2.errors.reportAjaxError","Error:",e.status,i,", XHR: ",e),void 0!==s){var d=(new Date).getTime()-s;d>c&&(n=!1)}n&&o()}function o(e){h.Error&&h.Error.show(e)}function s(e){_++,setTimeout(function(){_--},e)}function a(){return 0!==_}function r(e){m++,setTimeout(function(){m--},e)}function d(){return 0!==m}var l=2e3,c=50,u=i("./shared/log.js").log,h=i("./webnode2.js"),p=i("./shared/jquery.js"),f=i("./settings-webpack.js"),_=0,m=0;p(window).on("unload.w2errors beforeunload.w2errors",function(){u.enabled&&u("w2.errors.unload","window.beforeunload event is raised."),s(l)}),p(document).on("mouseup.w2errors mousedown.w2errors keyup.w2errors keydown.w2errors keypress.w2errors",function(){
r(c)}),t.reportAjaxError=n,t.showError=o,t.canBeRelatedToUserAction=d,t.beginCanBeRelatedToUserActionBlock=r},"./w2.livenode.js":function(e,t,i){function n(e){var t,i={};return m("#"+e+" [w2cid]").each(function(e,n){t=n.getAttribute("w2cid"),i[t]=n}),i}function o(e){var t={};return m.each(e,function(e,i){if(!(i.domid in t)){var o=n(i.domid);t[i.domid]=o}}),t}function s(e){var t=g.interactionMode._changedComponents[e];return t&&t!=g.interactionMode._states.OFF}function a(e,t,i){var n=o(e);try{m.each(e,function(e,i){var o=n[i.domid];"update_data"!=i.type&&"insert_node"!=i.type&&m.each(o,function(e,n){if(s(e)){if(!t)throw console.log("throwing blocking_interaction_mode cid="+e+" on optype = "+i.type),console.log("affected node:"),console.log(o[e]),new Error("blocking_interaction_mode");console.log("forcing override on live update conflict with cid="+e+" on optype = "+i.type)}})})}catch(a){if("blocking_interaction_mode"==a.message)return console.log("Calling startBlocking from checkForConflicts"),
g.interactionMode.startBlocking(),D.interactionDelayedLivedepOperations.push({data:e,textStatus:i}),!1;throw a}return!0}function r(e,t,i){32e3>I?(A=setTimeout(d,I),I*=2):(clearTimeout(A),A=null,_("failed_sync_livedeps"))}function d(){A&&(clearTimeout(A),A=null);var e=[window.location.protocol,"//",window.location.host,"/check_livedeps/index?window_id=",S.windowId,"&random=",Math.random()].join("");m.ajax({type:"GET",url:e,error:r})}function l(e){g.interactionMode.resumeUpdates();var t=Math.random(),i={};return i._lm_transaction_id=t,i._lm_window_id=S.windowId,void 0===e?B[t]=1:B[t]={optimisticUpdate:e},h(),{transactionId:t,data:i}}function c(e,t){delete B[e],D.requiredVersion=Math.max(t,D.requiredVersion),h()}function u(e){D.currentVersion=e,f()}function h(){var e,t=0,i=0;for(e in B)i++,B[e].optimisticUpdate&&t++;D.pendingMutationCount=i,D.optimisticUpdateMutationCount=t,f()}function p(){$.stop()}function f(){window.log&&y.enabled&&y("w2.livenode.checkLoadingStatus","Pending mutation count:",D.pendingMutationCount,", current version",D.currentVersion,", required version",D.requiredVersion);
var e=D.pendingMutationCount>D.optimisticUpdateMutationCount,t=D.currentVersion<D.requiredVersion;w.GlobalProxy.dispatch({type:w.Types.LIVENODE_LOADING_SPINNER,payload:{show:e||t}})}function _(e,t){if(t=t||{},console.log("Page requires reload "+t),!M){var i={error:"reportPageNeedsReload",uid:S.uid,window_id:S.windowId,url:window.location.href,error_type:e,debug_info:t},n="lost_group"!==e;C.log("livenode_error",i,{scribeOnly:!0,sendImmediately:n}),M=!0}S.isLoggedIn&&(g.Error&&g.Error.hide(),g.fallbackToPostReloadMode(),g.interactionMode.$id("@message").html("<a href='javascript:window.location.reload();'>"+j.please_refresh+"</a>"),console.log("Calling startBlocking from reportPageNeedsReload"),g.interactionMode.startBlocking())}window.console||(window.console={}),window.console.log||(window.console.log=function(){});var m=i("./shared/jquery.js"),g=i("./webnode2.js"),v=i("./shared/core/webnode.js"),w=i("./shared/events/index.js"),b=i("./shared/core/component.js"),y=i("./shared/log.js").log,C=i("./shared/logging.js"),k=i("./shared/browser.js"),x=i("./shared/dom.js"),S=i("./settings-webpack.js"),E=i("./shared/errors.js"),T=i("./shared/viewport.js"),$=i("./tchannel_up.js"),L=i("./shared/fx.js"),j=S.interface_strings,A=null,D={
interactionDelayedLivedepOperations:[],pendingMutationCount:0,optimisticUpdateMutationCount:0,currentVersion:0,requiredVersion:0},I=1e3,M=!1,O={},N={};w.DocumentProxy.subscribe(w.Types.WEBNODE_BEFORE_REMOVE_COMPONENT_METADATA,function(e){var t=e.payload.cid;t&&(O[t]=b._hmacs[t],N[b._domids[t]]=b._hmacs[t])});var R=function(e,t,i){if(i=i||!1,"error"==e)return console.log("LiveNode error"),void _("livenode_data_error");if(!g.interactionMode||g.interactionMode.isBlocking())return D.interactionDelayedLivedepOperations.push({data:e,textStatus:t}),!1;if(!a(e,i,t))return!1;var n=!k.msie&&m(window).scrollTop()>0;n&&m("div.feed_item_inner").each(function(){T.isElementInViewport(this)&&x.anchor(m(this))}),m.each(e,function(e,t){var i,o,s;switch(window.log&&y.enabled&&y("w2.livenode.onLivedepOperations","Applying",t),m(document).trigger("livenode_op_start",t),t.type){case"set_node":if(t.domid in g._ignoreDomids)break;var a=m("#"+t.domid);if(!a.length)return void _("set_node_missing",{hmac:b._hmacs[t.cid],
op_domid:t.domid,op_cid:t.cid});var r=t.transition;if(s=b.getComponentFromElement(a.get(0)),s&&s.force_transition&&(r=s.force_transition),!("cid"in t))return void E.logJsError("w2.livenode","Expected cid in op got: "+JSON.stringify(t));switch(b.unloadComponent(t.cid),v.setContent(a,t.content),r.type){case"none":break;case"fade_in":L.fadeIn(a,2e3)}break;case"insert_node":if(t.domid in g._ignoreDomids)break;if(i=document.getElementById(t.domid),!i)return void _("insert_node_missing",{parent_hmac:b._hmacs[t.parent_cid],op_domid:t.domid,op_parent_cid:t.parent_cid});var d=document.createElement("DIV");if(v.setContentHTML(d,t.content),1!=d.childNodes.length)return console.log("error: append must give a single node"),void _("invalid_append");var l=d.childNodes[0],c=l.id;if(l.style.display="none",i.childNodes.length==t.position?i.appendChild(l):i.insertBefore(l,i.childNodes[t.position]),v.evaluateContentJS(t.content),o=b._components[t.parent_cid],o&&o.onInsertNode&&o.onInsertNode(t,c),"none"==t.transition.type)break;
if("scroll"==t.transition.type){l.style.display="",l.scrollIntoView(!1);break}if(n||"fade_in"==t.transition.type){m("#"+c).fadeIn(500);break}l.style.display="none",m("#"+c).fadeIn(1e3);break;case"delete_node":if(t.domid in g._ignoreDomids)break;if(i=document.getElementById(t.domid),!i)return void _("delete_node_missing",{op_domid:t.domid,op_parent_cid:t.parent_cid});if(!b._parents[t.parent_cid])return void _("delete_node_missing_component",{op_parent_cid:t.parent_cid});var u=i.childNodes[t.position];if(u.id!=t.child_domid)return void _("delete_node_wrong_child",{parent_hmac:b._hmacs[t.parent_cid],node_id:u.id,op_child_domid:t.child_domid});o=b._components[t.parent_cid],o&&o.onDeleteNode&&o.onDeleteNode(t,u.id),b.unloadComponent(t.child_cid),m("#"+u.id).remove();break;case"update_data":if(t.cid in g._ignoreCids)break;if(!b._parents[t.cid])return void _("update_data_missing_component",{op_cid:t.cid,op_parent_cid:t.parent_cid});s=b._components[t.cid],s&&s.onUpdate&&s.onUpdate(t.data);break;
case"error":return console.log("livedep error: "+t.error),void _("livenode_error",{op_error:t.error});default:_("invalid_op_type",{op_type:t.type})}}),m(document).trigger("livenode_finish_operations")},B={};t.reportPageRegainedConnection=function(){g.Error.hide()},t.reportPageLostConnection=function(){g.Error.show(j.trying_to_regain)},t.syncLivedeps=d,t.startMutation=l,t.onLivedepOperations=R,t.reportPageNeedsReload=_,t.setCurrentVersion=u,t.mutationDoneAfterVersion=c,t.stopLiveUpdates=p,t.state=D},"./w2.modal.js":function(e,t,i){var n=i("./shared/core/component.js"),o=i("./shared/jquery.js"),s=i("./shared/Class.js").Class,a=i("./webnode2.js"),r=i("./video.js"),d=i("./shared/logging.js").log,l=i("./shared/dom.js"),c=i("./shared/viewport.js"),u=i("./shared/core/component.js").getAllDvars,h=i("./shared/debounce.js").debounce,p=i("./shared/keyboard_event_handler.js"),f=[],_=function(e){f.push(e)},m=function(e){var t=f.indexOf(e);t>-1&&f.splice(t,1)},g=function(){return f[f.length-1]},v=0,w=function(){
return v++},b=1e3,y=t.ModalBase=s.extend({__init__:function(e,t){this.opener=e,this.opts=o.extend({args:[],kwargs:{},closeOnEscape:!0,closeOnBackgroundClick:!0,closeOnScroll:!1,showFixedCloseButton:!1,customOverlayClass:null,errorCallback:null},t),this._modalId=w(),this._cid="*modal*_"+this._modalId,this.$container=o("#__w2_modal_container_"),this._initModal(),this._fetchStarted=!1,this._fetchCompleted=!1,this._fetchStartTime=0,this._isOpen=!1,this._firstOpenTime=0},_initModal:function(){var e=document.createElement("div");e.id="#__w2_modal_overlay_"+this._modalId,e.className="modal_overlay hidden",this.opts.customOverlayClass&&e.classList.add(this.opts.customOverlayClass),this.$container.append(e),this.$overlay=o(e);var t=document.createElement("div");if(t.id="#__w2_modal_wrapper_"+this._modalId,t.className="modal_wrapper",t.tabIndex=-1,e.appendChild(t),this.$contentWrapper=o(t),this.opts.showFixedCloseButton){var i=document.createElement("a");i.id="#__w2_modal_close_"+this._modalId,i.className="modal_fixed_close hidden",
e.appendChild(i),this.$closeButton=o(i)}},_bindHandlers:function(){this.opts.closeOnEscape&&this.bindKeyboardHotkeys(),this.opts.closeOnBackgroundClick&&this.bindBackgroundClickDismissHandler(),this.opts.showFixedCloseButton&&this.bindCloseButton()},_unbindHandlers:function(){this.opts.closeOnEscape&&p.remove(this.escKeyHandler),this.opts.closeOnBackgroundClick&&this.$overlay.off("click.modalOverlay"),this.opts.closeOnScroll&&this.unbindCloseOnScroll(),this.opts.showFixedCloseButton&&this.$closeButton.off()},_open:function(){this._isOpen=!0,_(this),this._bindHandlers(),c.setPageScroll(!1),this.$overlay.removeClass("hidden"),this.opts.showFixedCloseButton&&this.$closeButton.removeClass("hidden"),this.$contentWrapper.focus(),this._fetchCompleted&&this.onContentVisible()},fetch:function(e){if(!this._fetchStarted){this.$contentWrapper.addClass("loading_overlay"),this._fetchStarted=!0,this._fetchStartTime=Date.now();var t=this,i=this.opener.serverCall(e);i.args.apply(i,t.opts.args).kwargs(t.opts.kwargs).error(function(){
t._fetchStarted=!1,n.unloadComponent(t._cid),t.close()}).success(function(){t.onFetchSuccess()}).contentFor(this.$contentWrapper,{parentCid:this._cid}),this.opts.errorCallback&&i.error(this.opts.errorCallback),i.send()}},onFetchSuccess:function(){this.opener.__modal__=this;var e=n._safeGetComponentByCID(this._cid);e.__opener__=this.opener,e.__modal__=this,n._components[this._cid]=e;var t={};t[this._cid]="*ROOT*",n.addParents(t),e.setDvar("__modal__",this._cid);var i=n._allChildren[this._cid][0],o=n._safeGetComponentByCID(i),s=u(this.opener);delete s.__modal__,o.__dvars__=s,"feed_desktop_modal"===this.opts.customOverlayClass&&d("web_modal_loading_time",{fetch_start_time:this._fetchStartTime,fetch_finish_time:Date.now(),first_open_time:this._firstOpenTime},{sampleRate:.01}),this.$contentWrapper.height()>b&&this.$contentWrapper.addClass("tall"),this.$contentWrapper.removeClass("loading_overlay"),this._fetchCompleted=!0,this._isOpen&&this.onContentVisible()},onContentVisible:function(){this.opts.closeOnScroll&&this.bindCloseOnScroll();
},load:function(e){return this._open(),this._fetchStarted||this.fetch(e),0===this._firstOpenTime&&(this._firstOpenTime=Date.now()),this},_teardownContent:function(){},close:function(e){if(this._isOpen){this._isOpen=!1,m(this),r.stopAllVideos(this.$contentWrapper),this.opts.showFixedCloseButton&&this.$closeButton.addClass("hidden");var t=this,i=function(){t.$overlay.addClass("hidden"),g()||(t.opts.closeOnScroll&&t._reenableScrollAfterClose?t._reenableScrollAfterClose():c.setPageScroll(!0)),t._unbindHandlers(),t._teardownContent()};e?i():l.addAnimationClass(t.$overlay,"closing",i)}},bindCloseButton:function(){var e=this;e.$closeButton.on("click",function(t){t.stopPropagation(),e._isOpen&&e.close()})},_closeOnScrollThreshold:function(){var e=this.$contentWrapper.outerHeight();return Math.max(e-.33*window.innerHeight,2*e/3)},bindCloseOnScroll:function(){var e=this;e._setupScrollClose||(e._setupScrollClose=h(function(){e.$contentWrapper.css("margin-bottom",window.innerHeight);var t=e._closeOnScrollThreshold();
e.$overlay.scrollTop()>t&&e.$overlay.scrollTop(t)},50)),e._checkScrollClose||(e._checkScrollClose=h(function(){e.$overlay.scrollTop()>e._closeOnScrollThreshold()&&e.close(!0)},50)),e._reenableScrollAfterClose||(e._reenableScrollAfterClose=h(function(){g()||(c.setPageScroll(!0),o(window).off("wheel",e._reenableScrollAfterClose))},100,{maxWait:1e3})),e.$overlay.scrollTop(0),e._setupScrollClose(),o(window).on("resize",e._setupScrollClose),e.$overlay.on("scroll",e._checkScrollClose),o(window).on("wheel",e._reenableScrollAfterClose)},unbindCloseOnScroll:function(){o(window).off("resize",this._setupScrollClose),this.$overlay.off("scroll",this._checkScrollClose)},bindKeyboardHotkeys:function(){var e=this;e.escKeyHandler=function(t){27==t.keyCode&&e._isOpen&&e===g()&&e.close()},p.push(e.escKeyHandler)},bindBackgroundClickDismissHandler:function(){var e=this;e.$overlay.on("mousedown.modalOverlay",function(t){t.target==this&&!e._isScrollBarClicked(t)&&e._isOpen&&(t.stopPropagation(),e.close())})},
_isScrollBarClicked:function(e){var t=l.getScrollbarWidth();return window.innerWidth-e.clientX<t?!0:!1}}),C=t.Modal=y.extend({_initModal:function(){this.$contentWrapper=o("#__w2_modal_wrapper_"),this.$overlay=o("#__w2_modal_overlay_"),this.$closeButton=o("#__w2_modal_close_")},_teardownContent:function(){a.forgetContents(this.$contentWrapper),n.unloadComponent(this._cid),this.$contentWrapper.html(""),this.$overlay.off(),this.opts.showFixedCloseButton&&this.$closeButton.off()}});t.ModalWithCallBacks=C.extend({_onCloseCallBack:null,_onSubmitCallBack:null,onCloseCallBack:function(e){return this._onCloseCallBack=e,this},executeOnCloseCallBack:function(){this._onCloseCallBack&&this._onCloseCallBack()},onSubmitCallBack:function(e){return this._onSubmitCallBack=e,this},executeOnSubmitCallBack:function(){this._onSubmitCallBack&&this._onSubmitCallBack.apply(null,arguments)}}),C.openerFor=function(e){var t=e.getDvar("__modal__"),i=n._safeGetComponentByCID(t);return i&&i.__opener__},C.modalFor=function(e){
var t=e.getDvar("__modal__"),i=n._safeGetComponentByCID(t),o=i&&i.__modal__;return o||(o=g()),o}},"./webnode2.js":function(e,t,i){var n=i("./shared/errors.js"),o=i("./settings-webpack.js"),s=i("./shared/core/component.js"),a=t._liveDepInfo={},r=t._ignoreDomids={},d=t._ignoreCids={};t.addLiveDepInfo=function(e){for(var t=Object.keys(e),i=t.length,n=0;i>n;++n){var o=t[n];a[o]=e[o]}},t.interactionMode=null,t.Error=null,t.assertUnloaded=function(e){e in s._unloaded||n.logJsError("webnode2","Cid was not unloaded: "+e)},t.fallbackToPostReloadMode=function(){o.pageMode="post_reload"},t.forgetContents=function(e){e.find("*").map(function(){var e=s._domidToCid[this.id];e&&(r[this.id]=1,d[e]=1)})}}});
